* elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format.
[external/binutils.git] / bfd / ChangeLog
1 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
2
3         * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format.
4         * elfcore.h (elf_core_file_p): Likewise.
5         * section.c (bfd_section_init): Remove prototype.
6
7 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
8
9         * elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer
10         field.
11         (enum elf_linker_section_enum): Delete.
12         (struct elf_linker_section): Delete.
13         (struct elf_linker_section_pointers): Delete.
14         (struct elf_obj_tdata): Remove #if 0 chunk.  Remove linker_section.
15         Make linker_section_pointers a void**.
16         (elf_local_ptr_offsets, elf_linker_section): Don't define.
17         * elf32-ppc.c (enum elf_linker_section_enum): New, cut-down version
18         of old item in elf-bfd.h.
19         (struct elf_linker_section): Likewise.
20         (struct elf_linker_section_pointers): Likewise.
21         (elf_local_ptr_offsets): Define.
22         (struct ppc_elf_link_hash_entry): Add linker_section_pointer.
23         (ppc_elf_link_hash_newfunc): Init it.
24         (struct ppc_elf_link_hash_table): Add sbss.
25         (ppc_elf_link_hash_table_create): zmalloc rather than clearing
26         individual fields.
27         (elf_create_linker_section): Fold into..
28         (ppc_elf_create_linker_section): ..here.  Remove hole_size code.
29         Make rela section here if shared.
30         (elf_find_pointer_linker_section): Pass lsect rather than enum.
31         (elf_create_pointer_linker_section): Adjust.  zalloc rather than
32         clearing in a loop.
33         (elf_finish_pointer_linker_section): Adjust.  Don't make rela
34         section here.
35         (ppc_elf_check_relocs): Adjust.
36         (ppc_elf_add_symbol_hook): Tighten hash creator test.  Remove code
37         creating .sbss by hand.
38         * elf.c (_bfd_elf_link_hash_newfunc): Adjust.
39
40 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
41
42         * elf32-s390.c (elf_howto_table): Change R_390_GOT12 to
43         complain_overflow_bitfield.
44         * elf64-s390.c (elf_howto_table): Change R_390_GOT12 to
45         complain_overflow_bitfield.
46
47 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
48
49         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Return
50         true even if -pie.
51
52 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
53
54         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec.
55         (elfNN_ia64_dynamic_symbol_p): Change info->shared into
56         !info->executable.
57         (get_fptr): For -pie create .opd as writable section and create
58         .rela.opd as well.
59         (elfNN_ia64_check_relocs): Change info->shared into
60         !info->executable.
61         (allocate_fptr): Likewise.
62         (allocate_dynrel_entries): Account for a relative reloc for -pie
63         @fptr().  Don't account for a relative reloc if -pie want_ltoff_fptr
64         for undefweak symbol.  Account for an IPLT reloc in .rela.opd
65         section if -pie.
66         (set_got_entry): Don't create a relative reloc if -pie
67         want_ltoff_fptr for undefweak symbol.
68         (set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie.
69         (elfNN_ia64_relocate_section): Emit a relative reloc for -pie
70         @fptr().
71
72         * elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol
73         even if -pie.
74         * elf32-i386.c (elf_i386_relocate_section): Likewise.
75         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
76         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
77         * elf64-s390.c (elf_s390_relocate_section): Likewise.
78         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
79         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
80         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
81         * elf32-s390.c (elf_s390_relocate_section): Likewise.
82         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
83
84 2003-07-04  Paul Clarke <paulc@senet.com.au>
85
86         * elf32-h8300.c (R_H8_DIR32A16): Fix name field.
87         (elf32_h8_relax_section) <R_H8_DIR16A8>: Adjust position of relocation.
88         <R_H8_DIR32A16>: Fix type of relocation.
89
90 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
91
92         * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic
93         sections were created already.  Remove unnecessary tests of
94         the previous change.
95
96 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
97
98         * elf32-sh.c (sh_elf_create_dynamic_sections): Don't call
99         bfd_make_section for existing sections.
100
101 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
102
103         * elf32-sparc.c (elf32_sparc_check_relocs): Don't call
104         create_got_section if we already have done so.
105         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
106         (sh_elf_check_relocs): Likewise.
107         (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var.  Use
108         htab->root.dynobj instead.
109         (sh_elf_check_relocs): Likewise.
110         (sh_elf_finish_dynamic_sections): Likewise.
111
112         * section.c (bfd_make_section): Return NULL for existing section.
113
114 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
115
116         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Don't call
117         ppc_elf_create_got if we've already done so.
118
119         * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare.
120         (_bfd_elf_find_pointer_linker_section): Likewise.
121         (bfd_elf32_create_pointer_linker_section): Likewise.
122         (bfd_elf32_finish_pointer_linker_section): Likewise.
123         (bfd_elf64_create_pointer_linker_section): Likewise.
124         (bfd_elf64_finish_pointer_linker_section): Likewise.
125         (_bfd_elf_make_linker_section_rela): Likewise.
126         * elfcode.h (elf_create_pointer_linker_section): Don't define.
127         (elf_finish_pointer_linker_section): Likewise.
128         * elflink.c (_bfd_elf_make_linker_section_rela): Delete.
129         (_bfd_elf_create_linker_section): Move this function..
130         (_bfd_elf_find_pointer_linker_section): ..and this..
131         * elflink.h (elf_create_pointer_linker_section): ..and this..
132         (elf_finish_pointer_linker_section): ..and this..
133         * elf32-ppc.c: ..to here, renaming to the following, and adjusting
134         calls.
135         (elf_create_linker_section): Convert to C90, tidy.
136         (elf_find_pointer_linker_section): Likewise.
137         (elf_create_pointer_linker_section): Likewise.
138         (elf_finish_pointer_linker_section): Likewise.
139         * elf32-i370.c: Delete #if 0 code.
140
141 2003-07-02  Alan Modra  <amodra@bigpond.net.au>
142
143         * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't allow _savef* and
144         _restf* to be satisfied by shared libs, and always force them local.
145         (toc_adjusting_stub_needed): Avoid scanning linker created sections.
146         Correct test for "bl".
147         (ppc64_elf_relocate_section <R_PPC64_TLS>): Correct test for
148         primary opcode 31.
149
150 2003-07-01  Martin Schwidefsky  <schwidefsky@de.ibm.com>
151
152         * elf32-s390.c (s390_elf_ldisp_reloc): New prototype.
153         (s390_tls_reloc): New function.
154         (elf_howto_table): Add long displacement relocations R_390_20,
155         R_390_GOT20, R_390_GOTPLT20 and R_390_TLS_GOTIE20.
156         (elf_s390_reloc_type_lookup): Likewise.
157         (elf_s390_check_relocs): Likewise.
158         (elf_s390_gc_sweep_hook): Likewise.
159         (elf_s390_relocate_section): Likewise.
160         * elf64-s390.c: Same changes as for elf32-s390.c.
161         * reloc.c: Add long displacement relocations BFD_RELOC_390_20,
162         BFD_RELOC_390_GOT20, BFD_RELOC_390_GOTPLT20 and 
163         BFD_RELOC_390_TLS_GOTIE20.
164         * bfd-in2.h: Regenerate.
165         * libbfd.h: Likewise.
166
167 2003-06-30  Alan Modra  <amodra@bigpond.net.au>
168
169         * cpu-ia64-opc.c (ext_imms_scaled): Don't sign extend using shifts.
170         (ins_imms, ins_immsm1u4): Likewise.  Warning fix.
171
172 2003-06-29  Alan Modra  <amodra@bigpond.net.au>
173
174         * archive.c: Convert to C90, remove unnecessary prototypes and casts.
175         Replace PTR with void *.  Formatting.
176         * archive64.c: Likewise.
177         * archures.c: Likewise.
178         * bfd-in.h: Likewise.
179         * bfd.c: Likewise.
180         * bfdio.c: Likewise.
181         * bfdwin.c: Likewise.
182         * cache.c: Likewise.
183         * corefile.c: Likewise.
184         * format.c: Likewise.
185         * init.c: Likewise.
186         * libbfd-in.h: Likewise.
187         * libbfd.c: Likewise.
188         * linker.c: Likewise.
189         * opncls.c: Likewise.
190         * reloc.c: Likewise.
191         * section.c: Likewise.
192         * simple.c: Likewise.
193         * syms.c: Likewise.
194         * targets.c: Likewise.
195         * bfd-in2.h: Regenerate.
196         * libbfd.h: Regenerate.
197
198         * ecoff.c (bfd_debug_section): Add missing kept_section initialization.
199         * libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined.
200         * libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify.
201         (bfd_getb64): Rewrite without parens.
202         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
203         * cache.c (insert, snip): Remove INLINE.
204         * linker.c (bfd_link_add_undef): Likewise.
205
206 2003-06-29  Andreas Jaeger  <aj@suse.de>
207
208         * elf64-x86-64.c: Convert to ISO C90 prototypes, remove
209         unnecessary prototypes.  Replace PTR with void *.
210         (elf64_x86_64_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to
211         trim plt entries.  Move undefweak non-default visibility test ...
212         (allocate_dynrelocs): ... from here.
213         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
214         Change all callers.
215         (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.  Use
216         SYMBOL_REFERENCES_LOCAL for dynreloc check.
217         (elf64_x86_64_relocate_section): Use SYMBOL_CALLS_LOCAL for
218         dynreloc and .got relocs.
219         (elf64_x86_64_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL
220         for .got relocs.
221
222 2003-06-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
223
224         * elfxx-mips.c: Allow lazy binding for R_MIPS_JALR.
225
226 2003-06-27  Nick Clifton  <nickc@redhat.com>
227
228         * opncls.c (bfd_add_gnu_debuglink_section): Rename to
229         bfd_add_gnu_debuglink_section and only create the section, do not
230         fill in its contents.
231         (bfd_fill_in_gnu_debuglink_section): New function.  Fill in the
232         contents of a .gnu-debuglink section.
233         * bfd-in2.h: Regenerate.
234
235 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
236
237         * elfxx-mips.c: Revert .got alignment to 2**4.
238
239 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
240
241         * elf32-mips.c: Fix addend for _gp_disp special symbol.
242
243 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
244
245         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default
246         relocation header setup.
247
248 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
249
250         * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast.
251         (ppc_elf_reloc_type_lookup): Modify comment.
252         (ppc_elf_info_to_howto): Ditto.
253         (ppc_elf_relocate_section): Ditto.
254         (ppc_elf_check_relocs): Call ppc_elf_howto_init.
255
256 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
257
258         * aout-ns32k.c: Correct spelling of "relocatable".
259         * aoutx.h: Likewise.
260         * bfd-in.h: Likewise.
261         * bfd.c: Likewise.
262         * bout.c: Likewise.
263         * coff-a29k.c: Likewise.
264         * coff-alpha.c: Likewise.
265         * coff-arm.c: Likewise.
266         * coff-i386.c: Likewise.
267         * coff-i860.c: Likewise.
268         * coff-i960.c: Likewise.
269         * coff-m68k.c: Likewise.
270         * coff-m88k.c: Likewise.
271         * coff-mcore.c: Likewise.
272         * coff-mips.c: Likewise.
273         * coff-or32.c: Likewise.
274         * coff-ppc.c: Likewise.
275         * coff-rs6000.c: Likewise.
276         * coff-sh.c: Likewise.
277         * coff-tic80.c: Likewise.
278         * coff64-rs6000.c: Likewise.
279         * cofflink.c: Likewise.
280         * cpu-ns32k.c: Likewise.
281         * ecoff.c: Likewise.
282         * ecofflink.c: Likewise.
283         * elf-bfd.h: Likewise.
284         * elf-eh-frame.c: Likewise.
285         * elf-hppa.h: Likewise.
286         * elf-m10200.c: Likewise.
287         * elf-m10300.c: Likewise.
288         * elf.c: Likewise.
289         * elf32-arm.h: Likewise.
290         * elf32-avr.c: Likewise.
291         * elf32-cris.c: Likewise.
292         * elf32-d10v.c: Likewise.
293         * elf32-dlx.c: Likewise.
294         * elf32-fr30.c: Likewise.
295         * elf32-frv.c: Likewise.
296         * elf32-h8300.c: Likewise.
297         * elf32-hppa.c: Likewise.
298         * elf32-i370.c: Likewise.
299         * elf32-i386.c: Likewise.
300         * elf32-i860.c: Likewise.
301         * elf32-i960.c: Likewise.
302         * elf32-ip2k.c: Likewise.
303         * elf32-iq2000.c: Likewise.
304         * elf32-m32r.c: Likewise.
305         * elf32-m68hc11.c: Likewise.
306         * elf32-m68hc1x.c: Likewise.
307         * elf32-m68k.c: Likewise.
308         * elf32-mcore.c: Likewise.
309         * elf32-mips.c: Likewise.
310         * elf32-msp430.c: Likewise.
311         * elf32-openrisc.c: Likewise.
312         * elf32-ppc.c: Likewise.
313         * elf32-s390.c: Likewise.
314         * elf32-sh.c: Likewise.
315         * elf32-sh64.c: Likewise.
316         * elf32-sparc.c: Likewise.
317         * elf32-v850.c: Likewise.
318         * elf32-vax.c: Likewise.
319         * elf32-xstormy16.c: Likewise.
320         * elf32-xtensa.c: Likewise.
321         * elf64-alpha.c: Likewise.
322         * elf64-hppa.c: Likewise.
323         * elf64-mips.c: Likewise.
324         * elf64-mmix.c: Likewise.
325         * elf64-ppc.c: Likewise.
326         * elf64-s390.c: Likewise.
327         * elf64-sh64.c: Likewise.
328         * elf64-sparc.c: Likewise.
329         * elf64-x86-64.c: Likewise.
330         * elfcode.h: Likewise.
331         * elflink.h: Likewise.
332         * elfn32-mips.c: Likewise.
333         * elfxx-ia64.c: Likewise.
334         * elfxx-mips.c: Likewise.
335         * i386linux.c: Likewise.
336         * ieee.c: Likewise.
337         * libcoff-in.h: Likewise.
338         * linker.c: Likewise.
339         * m68klinux.c: Likewise.
340         * pdp11.c: Likewise.
341         * pe-mips.c: Likewise.
342         * peXXigen.c: Likewise.
343         * reloc.c: Likewise.
344         * reloc16.c: Likewise.
345         * sparclinux.c: Likewise.
346         * sunos.c: Likewise.
347         * syms.c: Likewise.
348         * versados.c: Likewise.
349         * vms.c: Likewise.
350         * xcofflink.c: Likewise.
351         * bfd-in2.h: Regenerate.
352         * libcoff.h: Regenerate.
353         * libbfd.h: Regenerate.
354
355 2003-06-24  Alan Modra  <amodra@bigpond.net.au>
356
357         * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against
358         local sym errors.
359
360         * elf32-i386.c: Convert to C90 function definitions, remove unnecessary
361         prototypes and casts.  Replace PTR with void *.  Formatting.
362         * elf32-ppc.c: Likewise.  Break long strings too.
363         (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type.
364         (ppc_elf_unhandled_reloc): Internationalize error message.
365         * elf32-ppc.h: Remove PARAMS.
366
367 2003-06-23  Mark Mitchell  <mark@codesourcery.com>
368
369         * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count
370         APUinfo slots.
371         (ppc_elf_final_write_processing): Likewise.
372
373 2003-06-23  H.J. Lu <hongjiu.lu@intel.com>
374
375         * elflink.h (elf_link_input_bfd): Check raw size when using
376         kept_section to preserve debug information discarded by
377         linkonce.
378
379 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
380
381         * elf64-ppc.c (struct ppc_link_hash_table): Add top_id.
382         (ppc64_elf_setup_section_lists): Set it.
383         (ppc64_elf_relocate_section): Check sym section id against top_id.
384         (ppc_build_one_stub): Comment on top_id.
385
386 2003-06-20  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
387
388         * config.bfd: Add tic4x-*-rtems*.
389
390 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
391
392         * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary
393         prototypes and casts.  Replace PTR with void *.  Format copyright.
394         Mention ABI links.
395         (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt,
396         sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt.
397         (ppc_type_of_stub): Make r_type an enum.
398         (ppc64_elf_size_stubs): Likewise.
399         * elf64-ppc.h: Remove PARAMS macro.
400
401 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
402
403         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of
404         elf hash tab fields.
405
406         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype.
407         (ppc64_elf_info_to_howto): Likewise.
408         (ppc64_elf_build_stubs): Add "stats" param, and print statistics.
409         * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype.
410
411 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
412
413         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32
414         reloc overflow on discarded eh_frame entries.
415
416 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
417
418         * elf64-ppc.c (toc_adjusting_stub_needed): New function.
419         (ppc64_elf_next_input_section): Use it here to set has_gp_reloc.
420         Return error condition.
421         (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections
422         that have has_gp_reloc set.
423         (struct ppc_link_hash_table): Add stub_count.
424         (ppc_build_one_stub): Increment it.
425         (ppc64_elf_link_hash_table_create): zmalloc rather than clearing
426         individual fields.
427         * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype.
428
429 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
430
431         * elflink.h (elf_gc_record_vtentry): Revert last change.  Correct
432         size calculation from addend.  Round size up.
433
434 2003-06-18  Hans-Peter Nilsson  <hp@axis.com>
435
436         * elf32-cris.c (cris_elf_relocate_section) <case
437         R_CRIS_32_GOTREL>: When linking a program, don't complain about a
438         symbol from a normal object or an undefined weak symbol.
439
440 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
441
442         * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on
443         R_PPC64_TOC relocs.
444
445 2003-06-17  H.J. Lu <hongjiu.lu@intel.com>
446
447         * section.c (struct sec): Put back kept_section.
448         (STD_SECTION): Put back kept_section initialization.
449         * bfd-in2.h: Regenerate.
450
451         * elflink.h (elf_link_input_bfd): Also check discarded linkonce
452         sections for relocateable output. Use kept_section to preserve
453         debug information discarded by linkonce.
454
455 2003-06-17  Roland McGrath  <roland@redhat.com>
456
457         * elfxx-ia64.c (elfNN_ia64_relocate_section): Support
458         segment-relative relocation between different segments.
459
460 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
461
462         * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc
463         optimizations earlier.
464
465         * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index.
466         Restore previous input_list type.
467         (ppc64_elf_link_hash_table_create): Undo last change.
468         (ppc64_elf_setup_section_lists): Reinstate code setting up input lists
469         per output section, but don't bother with bfd_abs_section marker.
470         (ppc64_elf_next_input_section): Adjust for multiple input section
471         lists.
472         (group_sections): Likewise.
473
474 2003-06-17  Jakub Jelinek  <jakub@redhat.com>
475
476         * elf64-ppc.c (ppc64_elf_relocation_section): Ensure
477         *r_offset == r_addend for RELATIVE relocs against .got.
478
479 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
480
481         * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs.
482
483 2003-06-17  Nick Clifton  <nickc@redhat.com>
484
485         * elflink.h (elf_gc_record_vtentry): Allocate an extra element
486         in the vtable_entries_used array to allow for the accessing
487         the largest element.
488
489 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
490
491         * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index.  Modify
492         input_list.
493         (ppc64_elf_link_hash_table_create): Init input_list here.
494         (ppc64_elf_setup_section_lists): Remove code setting up input lists
495         per output section.  Set toc_off for abs and other standard sections.
496         (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc.
497         (ppc64_elf_next_input_section): Adjust for single input section list.
498         Don't set toc_curr from input bfds that haven't set elf_gp.
499         (group_sections): Adjust for single input section list.
500
501         * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero.
502
503 2003-06-16  Alan Modra  <amodra@bigpond.net.au>
504
505         * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel
506         tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a
507         dtprel entry.  Ensure TLS_LD DTPMOD reloc has a zero addend.  Write
508         got section for RELATIVE relocs.  Fix wrong comment.  Change condition
509         under which dynamic relocs update the section contents.
510
511 2003-06-13  Robert Millan  <zeratul2@wanadoo.es>
512
513         * config.bfd: Add i386-netbsd-gnu target.
514
515 2003-06-12  Nick Clifton  <nickc@redhat.com>
516
517         * opncls.c (calc_crc32): Rename to
518         bfd_calc_gnu_debuglink_crc32 and export.
519         (GNU_DEBUGLINK): Define and use to replace occurrences of
520         hard-coded ".gnu_debuglink" in the code.
521         (get_debug_link_info): Prevent aborts by replacing call to
522         xmalloc with a call to malloc.
523         (find_separate_debug_file): Prevent aborts by replacing calls
524         to xmalloc and xstrdup with calls to malloc and strdup.
525         (bfd_add_gnu_debuglink): New function.  Add a .gnu_debuglink
526         section to a bfd.
527         * bfd-in2.h: Regenerate.
528
529 2003-06-12 Federico G. Schwindt <fgsch@lodoss.net>
530
531         * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]):
532         New target (was i[3-7]86-*-openbsd* before).
533         (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec.
534         (vax-*-openbsd*): New target.
535
536 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
537
538         * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options
539         for n32, too.
540         (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too.
541         (mips_elf_rel_dyn_section): Use appropriate section alignment.
542         (mips_elf_create_got_section): Likewise.
543         (_bfd_mips_elf_create_dynamic_sections): Likewise.
544
545 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
546
547         * elf32-mips.c (mips_elf_generic_reloc): New Function.
548         (elf_mips_howto_table_rel): Use it.
549         (gprel32_with_gp): Move prototype.
550         (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend.
551         Use mips_elf_generic_reloc.
552         (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend.
553         Code cleanup.
554         (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of
555         zero addend.
556         (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic
557         as in the other *_gprel*_reloc functions.
558         (gprel32_with_gp): Handle partial_inplace properly.
559         (mips32_64bit_reloc): Use mips_elf_generic_reloc.
560         (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend.
561         Do addend handling directly instead of calling
562         _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly.
563         * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead
564         of zero addend. Handle partial_inplace properly.
565         (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero
566         addend.
567         (mips_elf64_gprel16_reloc): Likewise.
568         (mips_elf64_literal_reloc): Likewise.
569         (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment
570         logic as in the other *_gprel*_reloc functions. Handle
571         partial_inplace properly.
572         (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero
573         addend. Handle partial_inplace properly.
574         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
575         of calling _bfd_mips_elf_gprel16_with_gp.
576         * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL.
577         (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead
578         of zero addend.
579         (mips_elf_shift6_reloc): Handle partial_inplace properly.
580         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
581         of calling _bfd_mips_elf_gprel16_with_gp.
582         * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle
583         partial_inplace properly. Fix wrong addend handling. Fix overflow
584         check.
585         (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and
586         exported.
587         (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend.
588         (_bfd_mips_elf_relocate_section): Likewise.
589         (mips_elf_create_dynamic_relocation): Update sec_info_type access.
590         * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration.
591         (_bfd_mips_elf_sign_extend): New prototype.
592
593 2003-06-11 Federico G. Schwindt <fgsch@lodoss.net>
594
595         * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]):
596         New target (was sparc-*-openbsd* before).
597         (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec.
598
599         * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo.
600         * configure: Regenerate.
601
602 2003-06-11  H.J. Lu <hongjiu.lu@intel.com>
603
604         * po/Make-in (DESTDIR): New.
605         (install-data-yes): Support $(DESTDIR).
606         (uninstall): Likewise.
607
608 2003-06-11  Alan Modra  <amodra@bigpond.net.au>
609
610         * Makefile.am (config.status): Depend on version.h.
611         Run "make dep-am".
612         * Makefile.in: Regenerate.
613         * po/SRC-POTFILES.in: Regenerate.
614
615 2003-06-10  Alan Modra  <amodra@bigpond.net.au>
616             Gary Hade <garyhade@us.ibm.com>
617
618         * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq.
619
620 2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
621
622         * archures.c (bfd_mach_h8300sxn): New architecture.
623         * bfd-in2.h: Regenerate.
624         * cpu-h8300.c (h8300_scan): Check for 'sxn'.
625         (h8300sxn_info_struct): New.
626         (h8300sx_info_struct): Link to it.
627         * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case.
628         (elf32_h8_final_write_processing): Likewise.
629
630 2003-06-08  Alan Modra  <amodra@bigpond.net.au>
631
632         * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by
633         elfxx-target.h so that we can use elf_backend_got_header_size.
634         (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete.
635         (GLINK_CALL_STUB_SIZE): Modify.  Define new glink call stub and
636         associated macros.
637         (ppc64_elf_howto_raw <GOT_TPREL16_DS, GOT_TPREL16_LO_DS>): Correct
638         dst_mask.
639         (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and
640         ppc_stub_plt_branch_r2off.
641         (struct ppc_stub_hash_entry): Reorganize.
642         (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed,
643         toc_curr, toc_off and emit_stub_syms.
644         (ppc64_elf_link_hash_table_create): Init them.
645         (ppc_stub_name): Correct string size.
646         (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs.
647         (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries
648         used.
649         (ppc_type_of_stub): Tweak root.type test.
650         (build_plt_stub): Remove glink code.  Adjust for insn macro changes.
651         (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and
652         ppc_stub_plt_branch_r2off.
653         (ppc_build_one_stub): Likewise.  Fix var shadowing.  Correct addis,addi
654         range test.  Use toc_off to calculte r2 values.  Handle emit_stub_syms.
655         (ppc64_elf_setup_section_lists): Remove htab creator flavour test.
656         Initialize elf_gp and toc_curr.
657         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions.
658         (ppc64_elf_next_input_section): Set toc_off.
659         (group_sections): Ensure groups have the same TOC.
660         (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub.
661         (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab.
662         Build new glink stub.
663         (ppc64_elf_relocate_section): Handle multiple TOCs.  Fix comments.
664         (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK.
665         * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype.
666         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare.
667         * section.c (struct sec): Rename flag12 to has_gp_reloc.
668         (STD_SECTION): Update.
669         * ecoff.c (bfd_debug_section): Update comment.
670         * bfd-in2.h: Regenerate.
671
672 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
673
674         * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference
675         NULL function pointers.
676
677 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
678
679         * simple.c (bfd_simple_get_relocated_section_contents): Call
680         _bfd_generic_link_add_symbols instead of bfd_link_add_symbols.
681
682 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
683
684         * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and
685         ticoff1_bad_format_hook() functions. Removed the coff0 and coff1
686         swaptables.
687         * coff-tic4x.c: Ditto
688         * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC
689         and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro
690         CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(),
691         ticoff1_bad_format_hook() functions. Created the coff0 and coff1
692         swap tables.
693         * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros.
694         * coff-a29k.c: Append COFF_SWAP_TABLE argument
695         * coff-apollo.c: Ditto
696         * coff-arm.c: Ditto
697         * coff-h8300.c: Ditto
698         * coff-h8500.c: Ditto
699         * coff-i960.c: Ditto
700         * coff-m68k.c: Ditto
701         * coff-m88k.c: Ditto
702         * coff-mcore.c: Ditto
703         * coff-sh.c: Ditto
704         * coff-sparc.c: Ditto
705         * coff-tic80.c: Ditto
706         * coff-we32k.c: Ditto
707         * coff-z8k.c: Ditto
708         * coff-w65.c: Ditto
709
710 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
711
712         * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed
713         initialization bug
714
715 2003-06-03  Jakub Jelinek  <jakub@redhat.com>
716
717         * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK.
718         (bfd_section_from_phdr): Likewise.
719         (map_sections_to_segments): Create PT_GNU_STACK segment header.
720         (get_program_header_size): Count with PT_GNU_STACK.
721         * elf-bfd.h (struct elf_obj_tdata): Add stack_flags.
722         * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags.
723
724 2003-06-03  H.J. Lu <hongjiu.lu@intel.com>
725
726         * elflink.h (elf_link_input_bfd): Call linker error_handler
727         for discarded definitions.
728
729 2003-06-03  Elias Athanasopoulos  <elathan@phys.uoa.gr>
730
731         * syms.c (decode_section_type): Return 'n' if section flags are
732         SEC_HAS_CONTENTS && SEC_READONLY.
733
734 2003-06-03  Nick Clifton  <nickc@redhat.com>
735
736         * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to
737         R_V850_ABS32.  Add entry for R_V850_REL32.
738         (v850_elf_reloc_map): Likewise.
739         (v850_elf_check_relocs): Likewise.
740         (v850_elf_perform_relocation): Likewise.
741         (v850_elf_final_link_relocate): Likewise.  Include computation
742         to make R_V850_REl32 pc-relative.
743
744 2003-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
745
746         * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section
747         and DT_DEBUG dynamic tag even for position independent executables.
748         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize.
749
750 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
751
752         * config.bfd: Move obsolete entries out of the range of the
753         targmatch sed script.
754
755 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
756
757         * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete.
758
759 2003-05-31  Jakub Jelinek  <jakub@redhat.com>
760
761         * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192
762         plt entries, not just 8191.
763
764 2003-05-30  Daniel Jacobowitz  <drow@mvista.com>
765
766         * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index.
767         Reported by Ken Faiczak <kfaiczak@SANDVINE.com>.
768
769 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
770             Jakub Jelinek  <jakub@redhat.com>
771
772         * elflink.h (elf_link_add_object_symbols): Use !info->executable
773         instead of info->shared where appropriate.
774         (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise.
775         * elflink.c (_bfd_elf_create_got_section): Likewise.
776         (_bfd_elf_link_create_dynamic_sections): Likewise.
777         (_bfd_elf_link_assign_sym_version): Likewise.
778         * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section
779         and DT_DEBUG dynamic tag even for position independent executables.
780         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
781         * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise.
782         * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise.
783         * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise.
784         * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise.
785         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise.
786         * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise.
787         * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise.
788         * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise.
789
790 2003-05-30  Kris Warkentin <kewarken@qnx.com>
791
792         * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
793         signalled thread.
794         (elfcore_grok_nto_gregs): Only make .reg section for the active thread.
795
796 2003-05-29  Nick Clifton  <nickc@redhat.com>
797
798         * pef.c: Include "safe-ctype.h" instead of <ctype.h>.
799         Tidy up formatting.
800         * Makefile.am: Add dependency on safe-ctype.h.
801         * Makefile.in: Regenerate.
802
803 2003-05-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
804
805         * elfxx-mips.c: Don't force symbols local unconditionally.
806
807 2003-05-28  Alan Modra  <amodra@bigpond.net.au>
808
809         * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus
810         undefined_symbol call.
811
812 2003-05-27  Richard Sandiford  <rsandifo@redhat.com>
813
814         * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting.
815         (mips_elf_link_hash_table): Likewise.
816
817 2003-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
818
819         * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
820         R_MIPS_GNU_REL16_S2 support.
821         (bfd_elf64_bfd_reloc_type_lookup): Use it.
822         (mips_elf64_rtype_to_howto): Use it.
823         * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used
824         R_MIPS_GNU_REL16_S2 support.
825         (bfd_elf32_bfd_reloc_type_lookup): Use it.
826         (mips_elf_n32_rtype_to_howto): Use it.
827
828 2003-05-21  Stuart F. Downing  <sdowning@fame.com>
829
830         * som.h: Define PA_2_0 before including a.out.h
831
832 2003-05-07  Eric Christopher  <echristo@redhat.com>
833             Alexandre Oliva   <aoliva@redhat.com>
834
835         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
836         pic tests, change to warning.
837         (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.
838
839 2003-05-21  Marcus Comstedt  <marcus@mc.pp.se>
840
841         * config.bfd: Check for a target triplet of shl-...-netbsdelf as
842         well as shle-...-netbsdelf.  Remove duplicate entry.
843
844 2003-05-21  Nick Clifton  <nickc@redhat.com>
845
846         * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask
847         for X_STORMY16_REL_12 reloc.
848
849         * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check
850         the type of the hash table in the bfd_link_info structure.
851         (bfd_elf_get_runpath_list): Likewise.
852
853 2003-05-19  Roland McGrath  <roland@redhat.com>
854
855         * elf.c (bfd_elf_bfd_from_remote_memory): New function.
856         * bfd-in.h: Declare it.
857         * bfd-in2.h: Regenerated.
858         * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
859         * elf-bfd.h (struct elf_backend_data): New function pointer member
860         elf_backend_bfd_from_remote_memory.
861         (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
862         Declare them.
863         * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
864         (elfNN_bed): Add that to the initializer.
865
866 2003-05-15  Roland McGrath  <roland@redhat.com>
867
868         * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section.
869
870 2003-05-20  Jakub Jelinek  <jakub@redhat.com>
871
872         * elflink.h (elf_link_output_extsym): Only issue error about !=
873         STV_DEFAULT symbols if they are bfd_link_hash_undefined.
874
875 2003-05-20  H.J. Lu <hongjiu.lu@intel.com>
876
877         * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF
878         when removing the old definition for symbols with non-default
879         visibility.
880
881 2003-05-18  Jason Eckhardt  <jle@rice.edu>
882
883         * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation.
884
885 2003-05-17  Andreas Schwab  <schwab@suse.de>
886
887         * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in
888         elf_section_data during processing of pc-relative and absolute
889         relocations.
890         (elf_m68k_relocate_section): Use the cached reloc section instead
891         of computing it again.  Fix handling of visibility.  Don't modify
892         addend when copying over a relocation into the output.
893
894 2003-05-17  Alan Modra  <amodra@bigpond.net.au>
895
896         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
897         to trim plt entries.  Move undefweak non-default visibility test..
898         (allocate_dynrelocs): ..from here.
899         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test
900         dynamic_sections_created here.  Update comment.  Move undefweak
901         non-default visibility test..
902         (allocate_dynrelocs): ..from here.  Fix comment.
903         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
904         to trim plt entries.  Move undefweak non-default visibility test..
905         (allocate_dynrelocs): ..from here.  Fix comment.
906         * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with
907         STV_DEFAULT rather than comparing with zero.
908         * elflink.c (_bfd_elf_merge_symbol): Likewise.
909         (_bfd_elf_fix_symbol_flags): Likewise.  Format comment.
910
911 2003-05-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
912
913         * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
914         pointers.
915         (_bfd_set_gp_value): Likewise.
916
917 2003-05-16  Michael Snyder  <msnyder@redhat.com>
918         From Bernd Schmidt  <bernds@redhat.com>
919         * archures.c (bfd_mach_h8300sx): New.
920         * bfd-in2.h: Regenerate.
921         * cpu-h8300.c (h8300_scan)): Add support for h8300sx.
922         (h8300sx_info_struct): New.
923         (h8300s_info_struct): Link to it.
924         * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx.
925         (elf32_h8_final_write_processing): Likewise.
926         (elf32_h8_relax_section): Likewise.
927
928 2003-05-16  Kelley Cook  <kelleycook@wideopenwest.com>
929
930         * config.bfd: Accept i[3-7]86 variants.
931         * configure.host: Likewise.
932         * configure.in: Likewise.
933         * configure: Regenerate.
934
935 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
936
937         * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
938         symbol.
939
940 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
941
942         * elflink.h (elf_link_check_versioned_symbol): Also allow
943         the base version.
944
945 2003-05-15  Alan Modra  <amodra@bigpond.net.au>
946             H.J. Lu <hongjiu.lu@intel.com>
947
948         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
949         (elf_i386_relocate_section): Likewise.
950         * elf32-ppc.c (allocate_dynrelocs): Likewise.
951         (ppc_elf_relocate_section): Likewise.
952         * elf64-ppc.c (allocate_dynrelocs): Likewise.
953         (ppc64_elf_relocate_section): Likewise.
954
955 2003-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
956
957         * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case.
958
959 2003-05-13  Stephane Carrez  <stcarrez@nerim.fr>
960
961         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for
962         processor capability, allow merge of HC12 and HCS12 in some cases.
963         (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc.
964         * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct.
965         (bfd_m68hc12_arch): Link it.
966         (scan_mach): New function.
967
968 2003-05-13  Andrew Haley  <aph@redhat.com>
969
970         * elf.c (bfd_elf_hash): Mask lower 32 bits of hash.
971
972 2003-05-13  Alan Modra  <amodra@bigpond.net.au>
973             H.J. Lu  <hongjiu.lu@intel.com>
974
975         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from
976         elf32-ppc.c.  Add ELF_LINK_FORCED_LOCAL check.
977         * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete.
978         (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check.
979         (ppc_elf_relocate_section): Likewise.
980         * elf64-ppc.c (allocate_dynrelocs): Likewise.
981         (ppc64_elf_relocate_section): Likewise.  Use for .got relocs too.
982         (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt
983         relocs need no other types.
984         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for
985         dynreloc check.
986         (elf_i386_relocate_section): Likewise.  Use for .got relocs too.
987         (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for
988         .got relocs.
989
990 2003-05-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
991
992         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols,
993         copy ELF_LINK_NON_GOT_REF from weakdef.
994         (allocate_dynrelocs): For undef weak syms with non-default
995         visibility, a) don't allocate plt entries, b) don't allocate
996         .got relocs, c) discard dyn rel space
997         (sh_elf_relocate_section): d) don't generate .got relocs, e)
998         don't generate dynamic relocs.
999         (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF
1000         for weakdefs when symbol already adjusted.
1001
1002 2003-05-12  Nick Clifton  <nickc@redhat.com>
1003
1004         * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield'
1005         overflow detection for R_XSTORMY16_16 reloc.
1006
1007 2003-05-12  Paul Clarke  <paulc@senet.com.au>
1008
1009         * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc.
1010
1011 2003-05-11  Jason Eckhardt  <jle@rice.edu>
1012
1013         * elf32-i860.c (elf32_i860_relocate_highadj): Properly
1014         adjust upper bits.
1015         (elf32_i860_relocate_splitn): Obtain upper 5 bits from the
1016         proper place.
1017         (elf32_i860_relocate_pc16): Obtain upper 5 bits from the
1018         proper place.
1019
1020 2003-05-11  Andreas Schwab  <schwab@suse.de>
1021
1022         * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly
1023         complicated tests for unresolvable relocs with a simple direct
1024         scheme using "unresolved_reloc" var.  Report some detail on
1025         bfd_reloc_outofrange and similar errors.
1026
1027 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1028
1029         * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):
1030         Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call.
1031         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
1032         * elf64-s390.c: Likewise.
1033
1034 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1035
1036         * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one.
1037         (elf_s390_adjust_dynamic_symbol): For weak symbols, copy
1038         ELF_LINK_NON_GOT_REF from weakdef.
1039         (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has
1040         already been adjusted before treating it specially.
1041         * el64-s390.c: Likwise.
1042
1043 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1044
1045         * elf32-s390.c (allocate_dynrelocs): For undef weak syms with
1046         non-default visibility, a) don't make them dynamic, b) discard
1047         space for dynamic relocs.
1048         (elf_s390_relocate_section): Initialize the GOT entries and skip
1049         R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined
1050         symbols with non-default visibility.
1051         * elf64-s390.c: Likewise.
1052
1053 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
1054
1055         * cpu-arm.c (arm_check_note): Warning fix.
1056         * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes.  Arrange
1057         to keep relocs if edited.
1058         (iq2000_elf_print_private_bfd_data): Return TRUE.
1059         * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
1060         ELF64_R_SYM.
1061         (elfNN_ia64_relax_ldxmov): Warning fix.
1062         * xtensa-isa.c (xtensa_add_isa): Warning fix.
1063         * xtensa-modules.c (get_num_opcodes): Warning fix.
1064
1065 2003-05-09  Andrey Petrov <petrov@netbsd.org>
1066
1067         * elf.c (elf_fake_sections): Use correct cast for sh_name.
1068
1069 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
1070
1071         * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from
1072         elflink.h.  Replace LOG_FILE_ALIGN with bed->s->log_file_align.
1073         (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align.
1074         (bfd_elf_record_link_assignment): Move from elflink.h.
1075         (_bfd_elf_merge_symbol): Likewise.
1076         (_bfd_elf_add_default_symbol): Likewise.
1077         (_bfd_elf_export_symbol): Likewise.
1078         (_bfd_elf_link_find_version_dependencies): Likewise.
1079         (_bfd_elf_link_assign_sym_version): Likewise.
1080         (_bfd_elf_link_read_relocs): Likewise.
1081         (_bfd_elf_link_size_reloc_section): Likewise.
1082         (_bfd_elf_fix_symbol_flags): Likewise.
1083         (_bfd_elf_adjust_dynamic_symbol): Likewise.
1084         (_bfd_elf_link_sec_merge_syms): Likewise.
1085         (elf_link_read_relocs_from_section): Likewise.  Use bed->s->sizeof_rel
1086         and bed->s->sizeof_rela.
1087         (_bfd_elf_link_output_relocs): Likewise.
1088         * elf-bfd.h (struct elf_size_info): Rename file_align to
1089         log_file_align.
1090         (struct elf_info_failed): Move from elflink.h.
1091         (struct elf_assign_sym_version_info): Likewise.
1092         (struct elf_find_verdep_info): Likewise.
1093         (_bfd_elf_create_dynamic_sections): Delete duplicate declaration.
1094         (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol,
1095         _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies,
1096         _bfd_elf_link_assign_sym_version,
1097         _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs,
1098         _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs,
1099         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
1100         _bfd_elf_link_sec_merge_syms): Declare.
1101         (bfd_elf32_link_create_dynamic_sections): Don't declare.
1102         (_bfd_elf32_link_read_relocs): Likewise.
1103         (bfd_elf64_link_create_dynamic_sections): Likewise.
1104         (_bfd_elf64_link_read_relocs): Likewise.
1105         * elflink.h: Move lots o' stuff elsewhere.
1106         * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare.
1107         (bfd_elf64_record_link_assignment): Likewise.
1108         (bfd_elf_record_link_assignment): Declare.
1109         * bfd-in2.h: Regenerate.
1110         * elfcode.h (elf_link_create_dynamic_sections): Don't declare.
1111         (NAME(_bfd_elf,size_info)): Adjust for log_file_align.
1112         * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align.
1113         (assign_file_positions_for_segments): Likewise.
1114         (assign_file_positions_except_relocs): Likewise.
1115         (swap_out_syms, elfcore_write_note): Likewise.
1116         * elf-m10200.c: Adjust for changed function names.
1117         * elf-m10300.c: Likewise.
1118         * elf32-arm.h: Likewise.
1119         * elf32-h8300.c: Likewise.
1120         * elf32-hppa.c: Likewise.
1121         * elf32-ip2k.c: Likewise.
1122         * elf32-m32r.c: Likewise.
1123         * elf32-m68hc11.c: Likewise.
1124         * elf32-m68hc1x.c: Likewise.
1125         * elf32-m68k.c: Likewise.
1126         * elf32-mips.c: Likewise.
1127         * elf32-ppc.c: Likewise.
1128         * elf32-sh.c: Likewise.
1129         * elf32-v850.c: Likewise.
1130         * elf32-xtensa.c: Likewise.
1131         * elf64-alpha.c: Likewise.
1132         * elf64-hppa.c: Likewise.
1133         * elf64-mmix.c: Likewise.
1134         * elf64-ppc.c: Likewise.
1135         * elf64-sh64.c: Likewise.
1136         * elfxx-ia64.c: Likewise.
1137         * elfxx-mips.c: Likewise.
1138         (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align.
1139         * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align.
1140         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
1141         * elf64-mips.c (mips_elf64_size_info): Likewise.
1142         * elf64-s390.c (s390_elf64_size_info): Likewise.
1143         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
1144
1145 2003-05-08  H.J. Lu <hongjiu.lu@intel.com>
1146
1147         * elflink.h (elf_add_default_symbol): After skipping the
1148         unversioned symbol, go to non-default one.
1149
1150 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
1151
1152         * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
1153         want_plt field.
1154         (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
1155         for symbols with non-default visibility.
1156
1157 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
1158
1159         * elflink.h (elf_link_check_versioned_symbol): Also handle the
1160         case that a DSO references a hidden symbol which may be
1161         satisfied by a versioned symbol in another DSO.
1162         (elf_link_output_extsym): Check versioned definition for hidden
1163         symbol referenced by a DSO.
1164
1165 2003-05-07  Nick Clifton  <nickc@redhat.com>
1166
1167         * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset
1168         R_XSTORMY16_16 reloc to ignore overflows.
1169
1170 2003-05-06  Alexandre Oliva  <aoliva@redhat.com>
1171
1172         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve
1173         error message for mixing different-endian files.  Check for ABI
1174         compatibility of input files with the selected emulation.
1175
1176 2003-05-05  Alan Modra  <amodra@bigpond.net.au>
1177
1178         * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
1179         non-default visibility, a) don't make them dynamic, b) discard
1180         space for dynamic relocs.
1181         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
1182
1183         * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
1184         non-default visibility, a) don't allocate plt entries, b) don't
1185         allocate .got relocs, c) discard dyn rel space,
1186         (ppc_elf_relocate_section): d) don't generate .got relocs, e)
1187         don't generate dynamic relocs.
1188         * elf64-ppc.c (allocate_dynrelocs): As above.
1189         (ppc64_elf_relocate_section): As above.
1190
1191 2003-05-05  Andreas Jaeger  <aj@suse.de>
1192
1193         * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
1194         relocation entries for weak undefined symbols with non-default
1195         visibility.
1196         (elf64_x86_64_relocate_section): Initialize the GOT entries and
1197         skip R_386_32/R_386_PC32 for weak undefined symbols with
1198         non-default visibility.
1199
1200 2003-05-04  H.J. Lu <hjl@gnu.org>
1201
1202         * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
1203         relocation entries for weak undefined symbols with non-default
1204         visibility.
1205         (elf_i386_relocate_section): Initialize the GOT entries and
1206         skip R_386_32/R_386_PC32 for weak undefined symbols with
1207         non-default visibility.
1208
1209         * elfxx-ia64.c (allocate_fptr): Don't allocate function
1210         descriptors for weak undefined symbols with non-default
1211         visibility.
1212         (allocate_dynrel_entries): Don't allocate relocation entries
1213         for symbols resolved to 0.
1214         (set_got_entry): Don't install dynamic relocation for weak
1215         undefined symbols with non-default visibility.
1216         (set_pltoff_entry): Likewise.
1217
1218         * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
1219         with non-default visibility.
1220         (elf_link_output_extsym): Don't make weak undefined symbols
1221         with non-default visibility dynamic.
1222
1223 2003-05-04  H.J. Lu <hjl@gnu.org>
1224
1225         * elflink.h (elf_merge_symbol): Correctly handle weak definiton.
1226
1227 2003-05-04  H.J. Lu <hjl@gnu.org>
1228
1229         * elflink.h (elf_merge_symbol): Don't record a hidden/internal
1230         symbol dynamic. Check indirection when removing the old
1231         definition for symbols with non-default visibility.
1232         (elf_add_default_symbol): Skip when told by elf_merge_symbol.
1233
1234 2003-05-02  Nick Clifton  <nickc@redhat.com>
1235
1236         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the
1237         R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about
1238         unsigned overflow.
1239
1240 2003-05-02  Andreas Jaeger  <aj@suse.de>
1241
1242         * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy
1243         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
1244         (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
1245         (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy
1246         ELF_LINK_NON_GOT_REF from weakdef.
1247
1248 2003-05-02  Charles Lepple <clepple@ghz.cc>
1249             Nick Clifton <nickc@redhat.com>
1250
1251         * acinclude.m4: Fix name of --enable-install-libbfd switch.
1252         * aclocal.m4: Regenerate.
1253         * configure: Regenerate.
1254         * Makefile.in: Regenerate.
1255
1256 2003-05-01  Alan Modra  <amodra@bigpond.net.au>
1257
1258         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the
1259         weakdef sym has already been adjusted before treating it specially.
1260         * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy
1261         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
1262         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
1263         (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF.
1264
1265 2003-04-28  H.J. Lu <hjl@gnu.org>
1266
1267         * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during
1268         the relax finalize pass.
1269
1270         * section.c (struct sec): Add need_finalize_relax and remove
1271         flag11.
1272         (STD_SECTION): Update struct sec initializer.
1273         * bfd-in2.h: Regenerated.
1274
1275 2003-04-28  H.J. Lu <hjl@gnu.org>
1276
1277         * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol
1278         to copy any information related to dynamic linking when we flip
1279         the indirection.
1280
1281 2003-04-27  H.J. Lu <hjl@gnu.org>
1282
1283         * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New.
1284         (ELF_LINK_DYNAMIC_WEAK): New.
1285
1286         * elflink.h (elf_merge_symbol): Add one argument to indicate if
1287         a symbol should be skipped. Ignore definitions in dynamic
1288         objects for symbols with non-default visibility.
1289         (elf_add_default_symbol): Adjusted.
1290         (elf_link_add_object_symbols): Check if a symbol should be
1291         skipped. Don't merge the visibility field with the one from
1292         a dynamic object.
1293         (elf_link_check_versioned_symbol): Use undef_bfd.
1294         (elf_link_output_extsym): Warn if a forced local symbol is
1295         referenced from dynamic objects. Make non-weak undefined symbol
1296         with non-default visibility a fatal error.
1297
1298 2003-04-27  Daniel Jacobowitz  <drow@mvista.com>
1299
1300         * configure.in: Bump version on HEAD to 2.14.90.
1301         * configure: Regenerated.
1302
1303 2003-04-26  Stephane Carrez  <stcarrez@nerim.fr>
1304
1305         PR savannah/3331:
1306         * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
1307         when we couldn't relax something.
1308
1309 2003-04-25  Alan Modra  <amodra@bigpond.net.au>
1310
1311         * elflink.h (elf_merge_symbol): When we find a regular definition
1312         for an indirect symbol, flip the indirection so that the old
1313         direct symbol now points to the new definition.
1314
1315 2003-04-24  Roland McGrath  <roland@redhat.com>
1316
1317         * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr".
1318
1319 2003-04-24  Alan Modra  <amodra@bigpond.net.au>
1320
1321         * elf32-ppc.c: Formatting and comment fixes.
1322         (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
1323         (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
1324
1325 2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
1326
1327         * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
1328         * bfd-in2.h: Rebuilt.
1329         * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG.
1330         * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC
1331         & H8300SNMAGIC.
1332         (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn.
1333         * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn.
1334         (h8300sn_info_struct, h8300hn_info_struct): New.
1335         * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn
1336         (elf32_h8_final_write_processing): Likewise.
1337
1338 2003-04-23  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1339
1340         * elf32-sh.c (tpoff): New.
1341         (struct elf_sh_dyn_relocs): Remove tls_tpoff32.
1342         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
1343         (allocate_dynrelocs): Don't make unnecessary dynamic TLS
1344         relocations.  Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
1345         (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
1346         (dtpoff_base): Fix wrong indentation.
1347         (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
1348         relocations.  Don't set tls_tpoff32 flag.  Don't make unnecessary
1349         R_SH_TLS_TPOFF32 relocations.
1350
1351 2003-04-23  J"orn Rennecke <joern.rennecke@superh.com>
1352
1353         * archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
1354         * cpu-sh.c: Likewise.
1355         * elf32-sh.c: Likewise.
1356         * reloc.c (bfd_reloc_code_real): Likewise.
1357         * elf32-sh64-com.c: Change comment to refer to SuperH.
1358         * elf32-sh64.c: Likewise.
1359         * elf64-sh64.c: Likewise.
1360         * bfd-in2.h (enum bfd_architecture): Regenerate.
1361
1362 2003-04-23  Alan Modra  <amodra@bigpond.net.au>
1363
1364         From Julien LEMOINE <speedblue@debian.org>
1365         * elf32-i386.c (elf_i386_info_to_howto): Delete.
1366         (elf_info_to_howto): Define as elf_i386_info_to_howto_rel.
1367
1368 2003-04-22  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
1369
1370         * archures.c: Replace references to Mitsubishi M32R with references
1371         to Renesas M32R.
1372         * relocs.c: Likewise.
1373         * bfd-in2.h: Regenerate.
1374
1375 2003-04-21  Richard Henderson  <rth@redhat.com>
1376
1377         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an
1378         executable when a symbol is defined both regular and dynamic.
1379
1380 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
1381
1382         * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo.
1383         (elf32-m68hc1x.lo): Update dependencies
1384         * configure.in: Add elf32-m68hc1x.lo.
1385         * configure: Rebuild.
1386         * Makefile.in: Rebuild.
1387
1388 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
1389
1390         * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
1391         (m68hc11_elf_hash_table_create): New function.
1392         (elf32_m68hc11_link_hash_table_free): New function.
1393         (stub_hash_newfunc): New function.
1394         (m68hc11_add_stub): New function.
1395         (elf32_m68hc11_add_symbol_hook): New function.
1396         (elf32_m68hc11_setup_section_lists): New function.
1397         (elf32_m68hc11_next_input_section): New function.
1398         (elf32_m68hc11_size_stubs): New function.
1399         (elf32_m68hc11_build_stubs): New function.
1400         (m68hc11_get_relocation_value): New function.
1401         (elf32_m68hc11_relocate_section): Call the above to redirect
1402         some relocations to the trampoline code.
1403         (m68hc11_elf_export_one_stub): New function.
1404         (m68hc11_elf_set_symbol): New function.
1405         (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse.
1406         (m68hc11_elf_get_bank_parameters): Get parameters only when the info
1407         is not yet initialized.
1408
1409         * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
1410         (elf32_m68hc11_stub_hash_entry): New struct.
1411         (m68hc11_page_info): Add trampoline handler address.
1412         (m68hc11_elf_link_hash_table): Add stubs generation members.
1413         (elf32_m68hc11_add_symbol_hook): Declare.
1414         (elf32_m68hc11_setup_section_lists): Declare.
1415         (elf32_m68hc11_size_stubs): Declare.
1416         (elf32_m68hc11_build_stubs): Declare.
1417
1418         * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c.
1419         (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise.
1420         (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto.
1421         (_bfd_m68hc11_elf_set_private_flags): Ditto.
1422         (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto.
1423         (_bfd_m68hc11_elf_print_private_bfd_data): Ditto.
1424         (bfd_elf32_bfd_link_hash_table_create): Define.
1425         (elf_backend_add_symbol_hook): Define.
1426         (m68hc11_elf_bfd_link_hash_table_create): New function.
1427         (m68hc11_elf_build_one_stub): New function.
1428         (m68hc11_elf_size_one_stub): New function.
1429         (m68hc11_elf_bfd_link_hash_table_create): Install the above.
1430         (bfd_elf32_bfd_link_hash_table_create): Define.
1431
1432         * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove.
1433         (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked.
1434         (m68hc12_phys_addr): Ditto.
1435         (m68hc12_phys_page): Ditto.
1436         (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c.
1437         (elf32_m68hc11_gc_mark_hook): Likewise.
1438         (elf32_m68hc11_gc_sweep_hook): Likewise.
1439         (elf32_m68hc11_check_relocs): Likewise.
1440         (elf32_m68hc11_relocate_section): Likewise.
1441         (_bfd_m68hc12_elf_set_private_flags): Likewise.
1442         (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise.
1443         (_bfd_m68hc12_elf_print_private_bfd_data): Likewise.
1444         (m68hc12_elf_build_one_stub): New function.
1445         (m68hc12_elf_size_one_stub): New function.
1446         (m68hc12_elf_bfd_link_hash_table_create): New function, use the above.
1447         (elf_backend_add_symbol_hook): Define.
1448         (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
1449
1450 2003-04-18  Nick Clifton  <nickc@redhat.com>
1451
1452         * format.c (bfd_check_format_matches): Only check associated
1453         vector if the matching_vector has been created.
1454
1455 2003-04-15  Alexandre Oliva  <aoliva@redhat.com>
1456
1457         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in
1458         2003-04-09's change.
1459
1460 2003-04-15  Brian Ford  <ford@vss.fsi.com>
1461
1462         * peicode.h (coff_swap_scnhdr_in): If a section holds
1463         uninitialized data and is from an object file or from an
1464         executable image that has not initialized the s_size field, or if
1465         the physical size is padded, use the virtual size (stored in
1466         s_paddr) instead.
1467
1468 2003-04-15  H.J. Lu <hjl@gnu.org>
1469
1470         * elflink.h (elf_link_add_object_symbols): Properly report
1471         filename for alignment reduction.
1472
1473 2003-04-15  Rohit Kumar Srivastava <rohits@kpitcummins.com>
1474
1475         * archures.c: Replace occurrances of 'Hitachi' with 'Renesas'.
1476         * reloc.c: Likewise.
1477         * coff-h8300.c: Likewise.
1478         * coff-h8500.c: Likewise.
1479         * coff-sh.c: Likewise.
1480         * cpu-h8300.c: Likewise.
1481         * cpu-sh.c: Likewise.
1482         * elf32-h8300.c: Likewise.
1483         * elf32-sh.c: Likewise.
1484         * elf32-sh64-com.c: Likewise.
1485         * elf32-sh64.c: Likewise.
1486         * elf64-sh64.c: Likewise.
1487         * bfd-in2.h: Regenerate.
1488
1489 2003-04-14  H.J. Lu <hjl@gnu.org>
1490
1491         * elflink.h (elf_link_add_object_symbols): Maintain maximum
1492         alignment for common symbols. Warn reducing alignment for
1493         common symbols. Report old filename when symbol size changes.
1494
1495 2003-04-12  Alexandre Oliva  <aoliva@redhat.com>
1496
1497         * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other
1498         occurrences of the same test changed in the previous patch.
1499         Optimize.
1500
1501 2003-04-11  Alexandre Oliva  <aoliva@redhat.com>
1502
1503         * elfxx-mips.c (mips_elf_get_global_gotsym_index): New.
1504         (mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to
1505         GOT_DISP/addend only if the symbol got a global GOT entry.
1506
1507 2003-04-10  Alexandre Oliva  <aoliva@redhat.com>
1508
1509         * elfxx-mips.c (mips_elf_calculate_relocation): Decay
1510         GOT_PAGE/GOT_OFST referencing overridable symbol to
1511         GOT_DISP/addend.
1512         (_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing
1513         global symbol as GOT_DISP.
1514
1515 2003-04-10  Bob Wilson  <bob.wilson@acm.org>
1516
1517         * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
1518         next relocation on an undefined symbol.
1519
1520 2003-04-09  Richard Henderson  <rth@redhat.com>
1521
1522         * elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
1523         Ignore relocations against r_symndx == 0.
1524
1525 2003-04-09  H.J. Lu <hjl@gnu.org>
1526
1527         * elf64-alpha.c (elf64_alpha_relocate_section): Don't return
1528         FALSE for undefined symbols.
1529         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1530
1531 2003-04-09  Alexandre Oliva  <aoliva@redhat.com>
1532
1533         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
1534         and IRIX-specific shift-to-64-bit 4-byte lengths before following
1535         addr_size.
1536
1537 2003-04-08  Alexandre Oliva  <aoliva@redhat.com>
1538
1539         * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
1540         pointer size from ABI, not arch_bits_per_address.
1541
1542 2003-04-07  Kevin Buettner  <kevinb@redhat.com>
1543
1544         * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
1545         constants for n32 ABI.
1546
1547 2003-04-06  Andrew Cagney  <cagney@redhat.com>
1548
1549         * simple.c (bfd_simple_get_relocated_section_contents): Disable
1550         free that leads to GDB vs BFD memory corruption.
1551
1552 2003-04-04  Stephane Carrez  <stcarrez@nerim.fr>
1553
1554         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust
1555         symbols that mark the end of the section.
1556         (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when
1557         converting to a relative branch so that the offset is computed after
1558         the relaxation; also relocate a jsr into a bsr if possible but don't
1559         relax them if they are to a far symbol as we need to call the
1560         trampoline code.
1561         (elf_m68hc11_howto_table): Set pcrel_offset to true.
1562
1563 2003-04-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
1564
1565         * archures.c: Namespace cleanup. Rename bfd_mach_c3x to
1566         bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x
1567         * bfd-in2.h: Regenerate
1568         * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/
1569         * cpu-tic4x.c: Ditto
1570
1571 2003-04-03  Nick Clifton  <nickc@redhat.com>
1572
1573         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss
1574         differently for object files and executables.
1575         * peicode.h (coff_swap_scnhdr_in): Only set the s_size field
1576         for object files or for executables who have not already
1577         initialised the field.
1578         * libpei.h (bfd_pe_executable_p): New macro.  Return true if
1579         the PE format bfd is an executable.
1580
1581 2003-04-03  Alan Modra  <amodra@bigpond.net.au>
1582
1583         * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL
1584         here as it's too early to reliably determine locality.
1585         (ppc_elf_gc_sweep_hook): Likewise.
1586         (SYMBOL_REFERENCES_LOCAL): Expand comment.
1587
1588 2003-04-02  Bob Wilson  <bob.wilson@acm.org>
1589
1590         * xtensa-modules.c: Remove comment indicating that this is a
1591         generated file.
1592
1593 2003-04-02  Alan Modra  <amodra@bigpond.net.au>
1594
1595         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
1596
1597 2003-04-01  Bob Wilson  <bob.wilson@acm.org>
1598
1599         * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
1600         (ALL_MACHINES_CFILES): Add cpu-xtensa.c.
1601         (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
1602         xtensa-modules.lo.
1603         (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
1604         xtensa-modules.c.
1605         (cpu-xtensa.lo): New target.
1606         (elf32-xtensa.lo): Likewise.
1607         (xtensa-isa.lo): Likewise.
1608         (xtensa-modules.lo): Likewise.
1609         * Makefile.in: Regenerate.
1610         * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
1611         (bfd_archures_list): Add bfd_xtensa_arch.
1612         * config.bfd: Handle xtensa-*-*.
1613         * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
1614         * configure: Regenerate.
1615         * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
1616         PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
1617         * targets.c (bfd_elf32_xtensa_be_vec): Declare.
1618         (bfd_elf32_xtensa_le_vec): Likewise.
1619         (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
1620         * cpu-xtensa.c: New file.
1621         * elf32-xtensa.c: Likewise.
1622         * xtensa-isa.c: Likewise.
1623         * xtensa-modules.c: Likewise.
1624         * libbfd.h: Regenerate.
1625         * bfd-in2.h: Likewise.
1626
1627 2003-04-01  Nick Clifton  <nickc@redhat.com>
1628
1629         * archures.c (bfd_mach_arm_unknown): Define.
1630         * bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes,
1631         bfd_arm_get_mach_from_notes): Prototype.
1632         * bfd-in2.h: Regenerate.
1633         * coff-arm.c (coff_arm_merge_private_bfd_data): Call
1634         bfd_arm_merge_machines.
1635         (coff_arm_final_link_postscript): Call bfd_arm_update_notes.
1636         * coffcode.h (coff_set_arch_mach_hook): Call
1637         bfd_arm_get_mach_from_notes.
1638         * coffgen.c (coff_real_object_p): Revert previous delta.
1639         * cpu_arm.c (arm_check_note): New function.  Examine a note in a
1640         .note section.
1641         (bfd_arm_merge_machines): New function: Handle the merging of ARM
1642         binaries compiled for different architectures..
1643         (bfd_arm_update_notes): New function: Update an ARM note section.
1644         (bfd_arm_get_mach_from_notes): New function: Extract a bfd machine
1645         number from an ARM note section.
1646         * elf32-arm.h (elf32_arm_object_p): Use
1647         bfd_arm_get_mach_from_notes.
1648         (elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines.
1649         (elf32_arm_final_write_processing): Use bfd_arm_update_notes.
1650
1651 2003-04-01  Ben Elliston  <bje@wasabisystems.com>
1652
1653         * dwarf2.c (read_attribute_value): Correct typo in comment.
1654
1655 2003-04-01  Nick Clifton  <nickc@redhat.com>
1656
1657         * dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
1658         instead of concat().
1659         (decode_line_info): Only free filename if it is not NULL.
1660         (add_line_info): Make a copy of the filename when storing it into
1661         the info structure.
1662
1663 2003-03-31  Andreas Schwab  <schwab@suse.de>
1664             Daniel Jacobowitz  <drow@mvista.com>
1665
1666         * simple.c (bfd_simple_get_relocated_section_contents): Add
1667         parameter symbol_table.  Optionally use it instead of the symbol
1668         table from the bfd.  Save and restore output offsets and output
1669         sections  around bfd_get_relocated_section_contents.  Fix a memory
1670         leak.
1671         (simple_save_output_info, simple_restore_output_info): New
1672         functions.
1673         * bfd-in2.h: Regenerate.
1674         * dwarf2.c (read_abbrevs): Use
1675         bfd_simple_get_relocated_section_contents instead of
1676         bfd_get_section_contents.
1677         (decode_line_info): Likewise.
1678         (_bfd_dwarf2_find_nearest_line): Likewise.  Don't call
1679         find_rela_addend.
1680         (find_rela_addend): Remove.
1681         * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for
1682         debugging sections.
1683         (elfNN_ia64_hash_table_create): Create the hash table with malloc,
1684         not bfd_zalloc.
1685
1686 2003-03-31  David Heine  <dlheine@suif.stanford.edu>
1687
1688         * aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of
1689         bfd_alloc.
1690         * dwarf2.c (concat_filename): Always allocate space for the
1691         returned filename.
1692         (decode_line_info): Free the allocated filename returned by
1693         concat_filename.
1694         * elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks.
1695         * elf.c (copy_private_bfd_data): Likewise.
1696         (_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer.
1697         * elflink.h (elf_link_sort_relocs): Fix memory leak.
1698         * format.c (bfd_check_format_matches): Likewise.
1699         * linker.c (bfd_generic_final_link): Likewise.
1700         * opncls.c (find_separate_debug_info): Likewise.
1701         * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
1702
1703 2003-03-28  H.J. Lu <hjl@gnu.org>
1704
1705         * elflink.h (elf_link_add_object_symbols): Correctly combine
1706         visibilities.
1707
1708 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
1709
1710         * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
1711         to -1 before recomputing got offsets.
1712
1713 2003-03-26  Andreas Schwab  <schwab@suse.de>
1714
1715         * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
1716         (elf_m68k_relocate_section): Use it to correctly handle symbols
1717         forced to be local.
1718         (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got
1719         entries for symbols that are forced to be local.
1720
1721 2003-03-25  Alexandre Oliva  <aoliva@redhat.com>
1722
1723         * elfxx-mips.c (_bfd_mips_relax_section): New function.
1724         * elfxx-mips.h (_bfd_mips_relax_section): Declare.
1725         * elfn32-mips.c, elf64-mips.c: Use it.
1726
1727 2003-03-25  Stan Cox   <scox@redhat.com>
1728             Nick Clifton  <nickc@redhat.com>
1729
1730         Contribute support for Intel's iWMMXt chip - an ARM variant:
1731
1732         * archures.c: Add bfd_mach_arm_iWMMXt.
1733         * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2.
1734         * bfd-in2.h: Regenerate.
1735         * libbfd.h: Regenerate.
1736         * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt
1737         object files to be linked with XScale ones.
1738         (coff_arm_final_link_postscript): Update note section.
1739         * coffcode.h (coff_set_arch_mach_hook): Handle note section.
1740         * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook
1741         after identifying a coff binary.
1742         * cpu-arm.c (processors): Add iWMMXt.
1743         (arch_inf): Likewise.
1744         * elf32-arm.h (arm_object_p): Handle note section.
1745         (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to
1746         be linked with XScale ones.
1747         (elf32_arm_section_flags): New function: Set flags on note section.
1748         (elf32_arm_final_write_processing): Handle note section.
1749
1750 2003-03-21  DJ Delorie  <dj@redhat.com>
1751
1752         * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call
1753         _bfd_elf_rela_local_sym.
1754
1755 2003-03-20  H.J. Lu <hjl@gnu.org>
1756
1757         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for
1758         non-ELF outputs.
1759
1760 2003-03-20  Nick Clifton  <nickc@redhat.com>
1761
1762         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and
1763         $idata5 in case bfd_coff_final_link is not called.
1764
1765 2003-03-19  Jakub Jelinek  <jakub@redhat.com>
1766
1767         * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count
1768         field.
1769         (canon_reloc_count): Define.
1770         (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
1771         sparc64_elf_canonicalize_dynamic_reloc): Use it instead of
1772         reloc_count.
1773         (sparc64_elf_canonicalize_reloc): New routine.
1774         (bfd_elf64_canonicalize_reloc): Define.
1775
1776 2003-03-18  Jakub Jelinek  <jakub@redhat.com>
1777
1778         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation
1779         againt mergeable sections.  Take r_addend into account when caching
1780         trampolines.
1781
1782 2003-03-18  Richard Henderson  <rth@redhat.com>
1783
1784         * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
1785         local symbols that have no dyninfo.
1786
1787 2003-03-14  Gene Smith  <gene.smith@siemens.com>
1788
1789         * ieee.c (ieee_write_expression): Handle the case where symbol is
1790         NULL.
1791         General formatting improvements.
1792
1793 2003-03-13  Nick Clifton  <nickc@redhat.com>
1794
1795         * configure.in (LINGUAS): Add zh_CN.
1796         * configure: Regenerate.
1797         * po/zh_CN.po: New file.
1798
1799 2003-03-13  Elias Athanasopoulos  <elathan@phys.uoa.gr>
1800
1801         * aout-cris.c (BYTES_IN_WORD): Don't define.
1802         aout-encap.c: Likewise.
1803         aout-ns32k.c: Likewise.
1804         aout-tic30.c: Likewise.
1805         hp300bsd.c: Likewise.
1806         i386aout.c: Likewise.
1807         i386dynix.c: Likewise.
1808         i386linux.c: Likewise.
1809         i386lynx.c: Likewise.
1810         i386mach3.c: Likewise.
1811         m68k4knetbsd.c: Likewise.
1812         m68klinux.c: Likewise.
1813         m68klynx.c: Likewise.
1814         m68knetbsd.c: Likewise.
1815         m88kmach3.c: Likewise.
1816         mipsbsd.c: Likewise.
1817         newsos3.c: Likewise.
1818         sparclinux.c: Likewise.
1819         sparclynx.c: Likewise.
1820         sparcnetbsd.c: Likewise.
1821         vaxbsd.c: Likewise. Fix comment formatting.
1822
1823 2003-03-12  Alexandre Oliva  <aoliva@redhat.com>
1824
1825         * Reverted 2003-03-02's patch.
1826
1827         * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
1828         overridable.
1829         * elf64-mips.c (mips_elf64_canonicalize_reloc,
1830         mips_elf64_get_dynamic_reloc_upper_bound,
1831         mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
1832         (bfd_elf64_get_canonicalize_reloc,
1833         bfd_elf64_get_dynamic_reloc_upper_bound,
1834         bfd_elf64_canonicalize_dynamic_reloc): Define.
1835         (mips_elf64_slurp_reloc_table): Support dynamic.
1836         (mips_elf64_slurp_one_reloc_table): Adjust.
1837
1838 2003-03-12  Nick Clifton  <nickc@redhat.com>
1839
1840         * xsym.c (bfd_sym_fetch_type_information_table_entry): Change
1841         'index' to 'offset' in test for zero value.
1842
1843 2003-03-11  Alexandre Oliva  <aoliva@redhat.com>
1844
1845         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
1846         dynamic relocations pointing to local or section symbols, use the
1847         NULL symbol instead.  Document the choice to not emit an
1848         additional R_MIPS_64 relocation.
1849
1850 2003-03-11  Alan Modra  <amodra@bigpond.net.au>
1851
1852         * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
1853         zero index dynamic tls relocs generated for the GOT.  Tidy code.
1854         Set "relocation" to 1 on DTPMOD32 relocs.  Optimize HA adjustment.
1855         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1856
1857 2003-03-07  Alan Modra  <amodra@bigpond.net.au>
1858
1859         * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
1860         a tls_get_addr call.
1861
1862         * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
1863         (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
1864         ELF_LINK_NON_GOT_REF from weakdef.
1865         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
1866         (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
1867         ELF_LINK_NON_GOT_REF from weakdef.
1868         * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
1869         (elf_i386_adjust_dynamic_symbol): For weak symbols, copy
1870         ELF_LINK_NON_GOT_REF from weakdef.
1871
1872 2003-03-06  Jakub Jelinek <jakub@redhat.com>
1873         Andrew Haley  <aph@redhat.com>
1874
1875         * elflink.h (elf_bfd_discard_info): Don't process eh frames if
1876         output is relocateable.
1877
1878 2003-03-06  Steven Konopa <skonopa@kgo.csc.com>
1879
1880         * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and
1881         R_COMMENT.
1882
1883 2003-03-06  Alan Modra  <amodra@bigpond.net.au>
1884
1885         * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
1886         error messages.
1887         (ELIMINATE_COPY_RELOCS): Define to zero.
1888         (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
1889         TLSLD relocs.  Report reloc types on a number of errors.  Optimize
1890         LOCAL24PC check for non-local syms.  Don't capitalize error messages.
1891         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
1892         (ppc64_elf_relocate_section): Don't deref htab->tls_sec when
1893         calculating TLSLD relocs.  Report reloc types on a number of errors.
1894         Don't capitalize error messages.
1895
1896 2003-03-03  H.J. Lu <hjl@gnu.org>
1897
1898         * elfxx-ia64.c (USE_BRL): Removed.
1899         (oor_ip): Removed.
1900
1901 2003-03-03  J"orn Rennecke <joern.rennecke@superh.com>
1902
1903         * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
1904         relocation (no special function), and make it non-partial_inplace.
1905         (sh_elf_relax_section): When creating a bsr, use a consistent value
1906         no matter if the symbol is extern or not;  set addend to -4.
1907         Don't swap load / non-load instructions for SH4.
1908         (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
1909         rather than if the symbol is external to determine if adjusting the
1910         offset makes sense.  Adjust the addend too if appropriate.
1911         (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
1912         relocation.
1913
1914 2003-03-03  Nick Clifton  <nickc@redhat.com>
1915
1916         * po/da.po: Installed latest translation.
1917
1918 2003-03-02  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
1919
1920         * elf32-mips.c (elf_mips_howto_table_rel): Change definition of
1921         R_MIPS_PC16 to rightshift 2.
1922         (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
1923         (bfd_elf32_bfd_reloc_type_lookup): Support
1924         BFD_RELOC_MIPSEMB_16_PCREL_S2.
1925         * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
1926         R_MIPS_PC16 to rightshift 2.
1927         (mips_elf64_howto_table_rela): Likewise.
1928         (mips_reloc_map): Map to rightshifted BFD reloc.
1929         * elfn32-mips.c: The same as in elf64-mips.c.
1930         * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
1931         (mips_elf_calculate_relocation): Handle rightshifted addends for
1932         R_MIPS_PC16.
1933         * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
1934         MIPS Embedded PIC. Remove superfluous empty COMMENT.
1935         * libbfd.h: Regenerate.
1936         * bfd-in2.h: Regenerate.
1937
1938 2003-02-28  Richard Henderson  <rth@redhat.com>
1939
1940         * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
1941         for ltoff22x relaxation.
1942
1943 2003-03-01  Alan Modra  <amodra@bigpond.net.au>
1944
1945         * bfd-in.h (_bfd): Don't define.
1946         * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
1947         * syms.c: Likewise.
1948         * bfd-in2.h: Regenerate.
1949
1950 2003-02-27  Richard Henderson  <rth@redhat.com>
1951
1952         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
1953         (elfNN_ia64_check_relocs): Set it.
1954         (allocate_global_data_got): Check it.
1955         (allocate_local_got): Likewise.
1956         (allocate_dynrel_entries): Likewise.
1957         (elfNN_ia64_relax_ldxmov): New.
1958         (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
1959         (elfNN_ia64_choose_gp): Split out from ...
1960         (elfNN_ia64_final_link): ... here.
1961
1962 2003-02-27  Andrew Cagney  <cagney@redhat.com>
1963
1964         * bfd.c (struct bfd): Rename "struct _bfd".
1965         * bfd-in.h: Update copyright.
1966         (struct bfd): Rename "struct _bfd".
1967         (_bfd): Define for backward compatibility.
1968         * bfd-in2.h: Regenerate.
1969
1970 2003-02-25  Alan Modra  <amodra@bigpond.net.au>
1971
1972         * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
1973         and rel_hdr2 when initially counting input relocs rather than after
1974         creating output reloc sections.
1975         (elf_link_read_relocs_from_section): Don't abort with wrong reloc
1976         sizes.
1977
1978         * Makefile.am: Run "make dep-am".
1979         * Makefile.in: Regenerate.
1980
1981 2003-02-24  Kris Warkentin  <kewarken@qnx.com>
1982
1983         * elf.c (elfcore_read_notes): Add check for QNX style core file.
1984         (elfcore_grog_nto_note): New function.
1985         (elfcore_grog_nto_gregs): New function.
1986         (elfcore_grog_nto_status): New function.
1987
1988 2003-02-24  Alan Modra  <amodra@bigpond.net.au>
1989
1990         * elflink.c (_bfd_elf_create_got_section): Check existing .got
1991         section flags before concluding that we've already been called.
1992         Don't use register keyword.
1993         (_bfd_elf_create_dynamic_sections): Don't use register keyword.
1994         (_bfd_elf_create_linker_section): Formatting.
1995
1996 2003-02-20  jmc  <jmc@prioris.mini.pw.edu.pl>
1997
1998         * coff-h8300.c: Fix typo: intial -> initial.
1999         * coff-ppc.c: Likewise.
2000
2001 2003-02-20  Alan Modra  <amodra@bigpond.net.au>
2002
2003         * elf32-ppc.c: Formatting.
2004         (allocate_dynrelocs): LD and GD relocs against the same sym need
2005         separate GOT entries.
2006         (ppc_elf_relocate_section): Correct GOT handling for multiple GOT
2007         entries per symbol.
2008
2009 2003-02-19  Alan Modra  <amodra@bigpond.net.au>
2010
2011         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
2012         removal.  Localize vars.  Remove unnecessary dynobj test.
2013         * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
2014         of INFO.
2015         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
2016         and optimize.
2017         (elf_i386_relocate_section): Likewise.
2018         (elf_i386_gc_sweep_hook): Simplify dyn reloc removal.  Localize vars.
2019         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
2020         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
2021         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
2022         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
2023         * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.  Remove
2024         local_dynrel for section too.  Don't touch HIPLT22, LOPLT10, PCPLT32
2025         or PCPLT10 relocs.  Don't subtract twice on PLT32 relocs.
2026         Formatting.
2027
2028         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
2029         (ppc64_elf_check_relocs): Use it.  Correct comment.  Move SEC_ALLOC
2030         test.
2031         (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
2032         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2033         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
2034         and optimize.  Use ELIMINATE_COPY_RELOCS.
2035         (ppc64_elf_relocate_section): Likewise.
2036
2037         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
2038         (ppc_elf_copy_indirect_symbol): Copy pc_count field.
2039         (ELIMINATE_COPY_RELOCS): Define.
2040         (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
2041         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2042         (MUST_BE_DYN_RELOC): Define.
2043         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
2044         and optimize.  Trim dyn_relocs.
2045         (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
2046         not be used.  Do generate dyn_relocs for copy reloc avoidance.  Keep
2047         track of pc_rel dyn relocs.
2048         (ppc_elf_relocate_section): Remove "will_become_local".  Adjust
2049         WILL_CALL_FINISH_DYNAMIC_SYMBOL use.  Trim dyn relocs as per
2050         allocate_dynrelocs.  Don't recalculate "sec".
2051
2052 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
2053
2054         * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
2055         * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
2056         on invalid LD relocs.
2057         (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
2058         (ppc64_elf_relocate_section): Unify new handling of LD relocs and
2059         tlsld_got entry.  Use IS_PPC64_TLS_RELOC.
2060
2061         * elf32-ppc.h: New file.
2062         * elf32-ppc.c: Include elf32-ppc.h.
2063         (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
2064         (struct ppc_elf_link_hash_entry): Rename "root" to "elf".  Adjust uses.
2065         Add "tls_mask" field.
2066         (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
2067         (struct ppc_elf_link_hash_table): Rename "root" to "elf".  Adjust uses.
2068         Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
2069         sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
2070         Make use of htab shortcuts throughout file.
2071         (ppc_elf_link_hash_newfunc): Init tls_mask field.
2072         (ppc_elf_link_hash_table_create): Init new fields.
2073         (ppc_elf_copy_indirect_symbol): Copy tls_mask.
2074         (ppc_elf_howto_raw): Add tls relocs.
2075         (ppc_elf_reloc_type_lookup): Handle them.
2076         (ppc_elf_unhandled_reloc): New function.
2077         (ppc_elf_create_got): Stash got section pointer in hash table,
2078         return status.  Make .rela.got too.
2079         (ppc_elf_create_dynamic_sections): Stash section pointers in htab.
2080         (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
2081         NON_GOT_REF set.  Don't allocate space in .plt here..
2082         (allocate_dynrelocs): ..do so here instead, properly ref-counting and
2083         not allocating plt entries unnecessarily.  Allocate got entries here.
2084         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
2085         (ppc_elf_size_dynamic_sections): Allocate local got entries.  Pass
2086         "info" during allocate_dynrelocs hash traversal.  Use htab section
2087         shortcuts rather than searching for named sections.  Get rid of
2088         "plt" and "strip" booleans.
2089         (update_local_sym_info, bad_shared_reloc): New functions.
2090         (ppc_elf_check_relocs): Handle TLS relocs.  Move .rela.got creation to
2091         ppc_elf_create_got.  Don't mark got or plt reloc syms dynamic, do so
2092         in allocate_dynreloc.  Use update_local_sym_info and bad_shared_reloc.
2093         Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16,
2094         R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA
2095         in shared libs.  R_PPC_PLTREL32 is a plt reloc too.  Refcount all
2096         relocs that might use a plt entry.  Set NON_GOT_REF too.
2097         Enumerate all do-nothing relocs.
2098         (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs.  Handle
2099         tls relocs and all plt relocs.
2100         (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions.
2101         (ppc_elf_finish_dynamic_symbol): Don't build got entries here.
2102         (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab
2103         shortcuts.
2104         (ppc_elf_relocate_section): Tidy.  Handle TLS relocs.  Use
2105         bfd_elf_local_sym_name.  Simplify unresolved reloc code.  Build got
2106         entries and got relocs here.  Warn on non-zero got reloc addend.
2107         Split out branch taken/not taken reloc code into a separate switch
2108         and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs.
2109         Split out HA reloc adjustments to separate switch statement.  Don't
2110         warn on reloc overflow if we've already warned about undefined.
2111         Don't rebuild sym name when reporting errors.  Report all possible
2112         errors from _bfd_final_link_relocate.
2113         (bfd_elf32_bfd_final_link): Don't define.
2114
2115 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
2116
2117         * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r".  Don't
2118         rebuild sym name when reporting errors.
2119
2120 2003-02-17  Nick Clifton  <nickc@redhat.com>
2121
2122         * elflink.h (elf_link_output_extsym): Only check
2123         allow_shlib_undefined for shared libraries.
2124         * elf32-i386.c (elf_i386_relocate_section): Remove bogus check
2125         of allow_shlib_undefined.
2126         * elf32-cris.c (cris_elf_relocate_section): Likewise.
2127         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
2128         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2129         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2130         * elf32-s390.c (elf_s390_relocate_section): Likewise.
2131         * elf32-sh.c (sh_elf_relocate_section): Likewise.
2132         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2133         * elf32-vax.c (elf_vax_relocate_section): Likewise.
2134         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
2135         * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2136         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2137         * elf64-s390.c (elf_s390_relocate_section): Likewise.
2138         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2139         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
2140         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
2141         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
2142
2143 2003-02-17  Nick Clifton  <nickc@redhat.com>
2144
2145         * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the
2146         address field to use in the comparison.
2147         (SEGMENT_OVERLAPS): Check that LMAs overlap as well.
2148
2149 2003-02-14  Bob Wilson  <bob.wilson@acm.org>
2150
2151         * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF
2152         backends when checking if the generic ELF target should be used.
2153
2154         * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs
2155         outside of functions, treat values as absolute addresses.
2156
2157         * bfd.c: Change embedded documentation to use consistent indentation
2158         and to split up long lines.  Change informal style of description
2159         for functions lacking real documentation.
2160         * coffcode.h: Break up long lines in embedded documentation.
2161         * format.c: Likewise.
2162         * targets.c: Likewise.
2163         * libcoff.h: Regenerate.
2164         * bfd-in2.h: Regenerate.
2165
2166 2003-02-14  Alan Modra  <amodra@bigpond.net.au>
2167
2168         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
2169         (ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
2170         (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
2171         (allocate_dynrelocs): Don't treat undefined and undefweak specially.
2172         (ppc_size_one_stub): Fix warning, and tighten plt entry check.
2173         (group_sections): Don't share a stub section if stubs are for a large
2174         section.  Adjust comment.
2175         (ppc64_elf_size_stubs): Roughly double the size left for stubs if
2176         !stubs_always_before_branch.
2177         (ppc64_elf_relocate_section): Initialize tlsld GOT entry once.  Don't
2178         treat undefined and undefweak specially when processing dyn relocs.
2179
2180 2003-02-13  Jakub Jelinek  <jakub@redhat.com>
2181
2182         * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
2183
2184 2003-02-13  Nick Clifton  <nickc@redhat.com>
2185
2186         * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs
2187         in computation of offset to insert into BL instruction.
2188
2189 2003-02-11  Uwe Stieber  <uwe@wwws.de>
2190
2191         * config.bfd: Add support for kaOS as cross build target system.
2192
2193 2003-02-11  Alan Modra  <amodra@bigpond.net.au>
2194
2195         * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
2196         .__tls_get_addr too.
2197         (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
2198
2199 2003-02-10  Kaz kojima  <kkojima@rr.iij4u.or.jp>
2200
2201         * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
2202         (elf_sh_link_hash_entry): Remove tls_tpoff32 field.
2203         (sh_elf_link_hash_newfunc): Remove the initialization of
2204         tls_tpoff32 field.
2205         (allocate_dynrelocs): Keep dyn_relocs if it includes the entry
2206         for which tls_tpoff32 flag is set.
2207         (sh_elf_relocate_section): Covert to LE only if the dyn_relocs
2208         of the symbol includes the entry matched with the input_section
2209         and having tls_tpoff32 flag on.  When linking statically, set
2210         symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
2211         is defined in this executable.
2212         (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
2213
2214 2003-02-10  Jakub Jelinek  <jakub@redhat.com>
2215
2216         * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
2217         even if there is just non-empty .rela.plt.
2218
2219 2003-02-10  Nick Clifton  <nickc@redhat.com>
2220
2221         * archures.c (bfd_mach_arm_ep9312): Define.
2222         * bfd-in2.h: Regenerate.
2223         * cpu-arm.c (processors[]): Add ep9312.
2224         (bfd_arm_arch): Add ep9312.
2225         * elf32-arm.h (elf32_arm_merge_private_data): Update error
2226         messages and add test for Maverick floating point support.
2227         (elf32_arm_print_private_bfd_data): Handle
2228         EF_ARM_MAVERICK_FLOAT flag.
2229         (elf32_arm_object_p): New function.
2230         (elf_backend_object_p): Define.
2231
2232 2003-02-10  Alan Modra  <amodra@bigpond.net.au>
2233
2234         * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
2235         variables, structure fields or function params to tls_mask or
2236         similar to better reflect usage.
2237         (struct got_entry): Comment.
2238         (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*.
2239         (get_tls_mask): Rename from get_tls_type.
2240
2241 2003-02-09  Alan Modra  <amodra@bigpond.net.au>
2242
2243         * elf64-ppc.c (TLS_GD_LD): Don't define..
2244         (TLS_GD): ..define this instead and update all uses.
2245         (TLS_TPRELGD): Define.
2246         (ppc64_elf_link_hash_table_create): Tweak initialization of
2247         init_refcount and init_offset.
2248         (ppc64_elf_check_relocs): Add one extra element to t_symndx array.
2249         Mark second slot of GD or LD toc entries.
2250         (get_tls_type): Return an int.  Distinguish toc GD and LD entries
2251         from other tls types.
2252         (ppc64_elf_tls_setup): New function, split out from..
2253         (ppc64_elf_tls_optimize): ..here.  Don't optimize when symbols are
2254         defined in a dynamic object.  Fix LD optimization.  Don't set TLS_TPREL
2255         on GD->IE optimization, use TLS_TPRELGD instead.  Use get_tls_type
2256         return value to properly decide whether toc GD and LD entries can
2257         optimize away __tls_get_addr call.  Check next reloc after DTPMOD64
2258         to determine GD or LD rather than looking at TLS_LD flag.  Don't
2259         attempt to adjust got entry tls_type here..
2260         (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
2261         look for possible merges.
2262         (ppc64_elf_size_dynamic_sections): Adjust local got entries for
2263         optimization.
2264         (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
2265         (ppc64_elf_relocate_section): Rename some vars to better reflect usage.
2266         Make use of return value from get_tls_type to properly detect GD and
2267         LD optimizations.  Split tlsld/gd hi/ha from lo/ds case.  Don't
2268         handle tls_get_addr removal when looking at REL24 relocs, do it when
2269         looking at the previous reloc.  Check reloc after DTPMOD64 to determine
2270         GD or LD.
2271         * elf64-ppc.h (ppc64_elf_tls_setup): Declare.
2272
2273 2003-02-08  Alan Modra  <amodra@bigpond.net.au>
2274
2275         * elf32-hppa.c (group_sections): Don't share a stub section if
2276         stubs are for a large section.
2277
2278         * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for
2279         stubs if !stubs_always_before_branch.
2280
2281 2003-02-07  Nick Clifton  <nickc@redhat.com>
2282
2283         * elf.c (swap_out_syms): Generate an error message if an
2284         equivalent output section cannot be found for a symbol.
2285
2286 2003-02-07  Jakub Jelinek  <jakub@redhat.com>
2287
2288         * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
2289         local_got_entries is NULL.
2290
2291 2003-02-06  Andreas Schwab  <schwab@suse.de>
2292
2293         * elf-eh-frame.c (get_DW_EH_PE_signed): Define.
2294         (read_value): Add parameter is_signed, use signed extraction if
2295         the value is signed.
2296         (_bfd_elf_write_section_eh_frame): Pass signed flag of the
2297         encoding to read_value.
2298
2299 2003-02-06  Alan Modra  <amodra@bigpond.net.au>
2300
2301         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and
2302         plt info when called to transfer weak sym info.
2303
2304 2003-02-05  Alan Modra  <amodra@bigpond.net.au>
2305
2306         * reloc.c: Add PPC and PPC64 TLS relocs.
2307         * libbfd.h: Regenerate.
2308         * bfd-in2.h: Regenerate.
2309         * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare.
2310         (ppc64_elf_howto_raw): Add TLS howto's.  Adjust R_PPC64_NONE to be
2311         against a 32 bit field.
2312         (ppc64_elf_reloc_type_lookup): Handle TLS relocs.
2313         (_ppc64_elf_section_data): Add t_symndx and comments.
2314         (ppc64_elf_section_data): Use elf_section_data macro.
2315         (ppc64_elf_new_section_hook): American spelling.
2316         (struct got_entry, struct plt_entry): New.
2317         (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC.
2318         (struct ppc_stub_hash_entry): Add "addend" field.
2319         (struct ppc_link_hash_entry): Add "tls_type".
2320         (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL,
2321         TLS_EXPLICIT): Define.
2322         (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got.
2323         (link_hash_newfunc): Init new fields.
2324         (ppc64_elf_link_hash_table_create): Likewise.  Set init_refcount and
2325         init_offset to NULL.
2326         (ppc64_elf_copy_indirect_symbol): Copy got and plt info.  Don't call
2327         _bfd_elf_link_hash_copy_indirect, rather insert relevant code from
2328         there.
2329         (update_local_sym_info, update_plt_info): New functions.
2330         (ppc64_elf_check_relocs): Use them.  Handle TLS relocs.  Adjust GOT
2331         handling to use got.glist rather than got.refcount.  Likewise for PLT.
2332         (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists.
2333         (func_desc_adjust): Adjust for new PLT list.
2334         (ppc64_elf_adjust_dynamic_symbol): Likewise.
2335         (get_sym_h, get_tls_type): New functions.
2336         (ppc64_elf_edit_opd): Remove unused variable.  Use get_sym_h.
2337         (ppc64_elf_tls_optimize): New function.
2338         (allocate_dynrelocs): Adjust for new PLT and GOT lists.  Allocate
2339         TLS relocs.
2340         (ppc64_elf_size_dynamic_sections): Likewise.
2341         (ppc_type_of_stub): Adjust for new PLT list.
2342         (ppc_build_one_stub): Likewise.
2343         (ppc64_elf_size_stubs): Likewise.  Use get_sym_h.  Treat __tls_get_addr
2344         calls specially.
2345         (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists.  Handle
2346         TLS relocs.  Report local syms using bfd_elf_local_sym_name.  Don't
2347         init GOT entries that have a reloc.  Generate GOT relocs here..
2348         (ppc64_elf_finish_dynamic_symbol): ..not here.  Adjust for PLT list.
2349         * elf64-ppc.h (ppc64_elf_tls_optimize): Declare.
2350
2351 2003-02-04  Andreas Schwab  <schwab@suse.de>
2352
2353         * elf32-m68k.c (elf_m68k_hash_entry): Define.
2354         (elf_m68k_link_hash_traverse): Remove.
2355         (elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and
2356         elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to
2357         reduce casting.
2358         (elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of
2359         casting.
2360         (elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse
2361         instead of elf_m68k_link_hash_traverse.
2362         (elf_m68k_discard_copies): Change first parameter to pointer to
2363         struct elf_link_hash_entry and use elf_m68k_hash_entry when struct
2364         elf_m68k_link_hash_entry is needed.
2365
2366 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
2367
2368         * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare.
2369         (struct elf_link_hash_entry): Add "glist" and "plist" fields to
2370         "got" union, and declare as gotplt_union.  Use gotplt_uinion for
2371         "plt" field.
2372         (struct elf_link_hash_table): Make "init_refcount" a gotplt_union.
2373         Add "init_offset" field.
2374         (struct elf_obj_tdata <local_got>): Add "struct got_entry **" to union.
2375         (elf_local_got_ents): Declare.
2376         * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got"
2377         and "plt".
2378         (_bfd_elf_link_hash_hide_symbol): Use "init_offset".
2379         (_bfd_elf_link_hash_table_init): Set "init_offset".
2380         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount
2381         from init_offset.
2382         (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset.
2383
2384         * elf.c (bfd_elf_local_sym_name): Split out from..
2385         (group_signature): ..here.
2386         * elf-bfd.h (bfd_elf_local_sym_name): Declare.
2387
2388 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
2389
2390         * elf-bfd.h (enum elf_link_info_type): Remove.
2391         (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields
2392         to struct sec.  Remove linkonce_p field.
2393         (elf_linkonce_p): Delete.
2394         (elf_discarded_section): Update for sec_info_type change.
2395         * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc,
2396         flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24.
2397         (ELF_INFO_TYPE_NONE): Define.
2398         (ELF_INFO_TYPE_STABS): Define.
2399         (ELF_INFO_TYPE_MERGE): Define.
2400         (ELF_INFO_TYPE_EH_FRAME): Define.
2401         (ELF_INFO_TYPE_JUST_SYMS): Define.
2402         (STD_SECTION): Update struct sec initializer.
2403         * ecoff.c (bfd_debug_section): Likewise.
2404         * elf.c: Likewise.  Update occurrences of sec_info_type and use_rela_p.
2405         * elflink.h: Likewise.
2406         * elf-eh-frame.c: Likewise.
2407         * elf64-alpha.c: Likewise.
2408         * elfxx-ia64.c: Likewise.
2409         * elfxx-mips.c: Likewise.
2410         * bfd-in2.h: Regenerate.
2411
2412         * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than
2413         referring to used_by_bfd.
2414         * elf64-sparc.c (sec_do_relax): Likewise.
2415         * elf64-mmix.c (mmix_elf_section_data): Likewise.
2416         * elfxx-mips.c (mips_elf_section_data): Likewise.
2417         * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro.
2418         (ieee_get_section_contents): Likewise.
2419         (ieee_new_section_hook): Formatting.
2420         (ieee_canonicalize_reloc): Remove commented out code.
2421         * mmo.c (mmo_section_data): Define.  Use throughout file.
2422         * oasys.c (oasys_get_section_contents): Use oasys_per_section macro.
2423
2424 2003-01-31  Graydon Hoare <graydon@redhat.com>
2425
2426         * Makefile.am (opncls.lo): Add dependency upon libiberty.h.
2427         * Makefile.in: Regenerate.
2428         * opncls.c (calc_crc32, get_debug_link_info,
2429         seperate_debug_file_exists, find_seperate_debug_file): New
2430         internal functions.
2431         (bfd_follow_gnu_debuglink): New function.  Follow the pointer
2432         contained inside a .gnu_debuglink section.
2433         * bfd-in2.h: Regenerate.
2434
2435 2003-01-29  Alexandre Oliva  <aoliva@redhat.com>
2436
2437         * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference
2438         entry->abfd when it's NULL.
2439
2440 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
2441
2442         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle
2443         _bfd_elf_section_offset returning -2 the same way as -1.
2444
2445         * elfxx-mips.c (mips_elf_multi_got): New function.
2446         (struct mips_got_entry): Make symndx and gotidx signed.  Moved
2447         addend into union along with address and link hash entry.
2448         (struct mips_got_info): Added bfd2got and next.
2449         (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx.
2450         (mips_elf_got_section, mips_elf_create_got_section): Use
2451         SEC_EXCLUDE bit to tell whether we really need the got
2452         section.  Take boolean arguments to disregard an excluded
2453         section, or to create it as excluded.  Adjust all callers.
2454         Use mips_elf_got_section all over.
2455         (mips_elf_local_got_index, mips_elf_got_page,
2456         mips_elf_got16_entry): Take input bfd as argument, and pass it
2457         on to mips_elf_create_local_got_entry.
2458         (mips_elf_global_got_index, mips_elf_create_local_got_entry):
2459         Take input bfd as argument, and manage entries in the
2460         appropriate GOT.
2461         (mips_elf_got_offset_from_index): Take input bfd as argument,
2462         and use it to adjust the GP offset of the bfd.
2463         (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move
2464         unreferenced GOT entries of global symbols to the end.
2465         (mips_elf_record_global_got_symbol): Take input bfd as
2466         argument.  Add entries to the master GOT hash table.
2467         (struct mips_elf_bfd2got_hash): New.
2468         (struct mips_elf_got_per_bfd_arg): New.
2469         (struct mips_elf_set_global_got_offset_arg): New.
2470         (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash,
2471         mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash,
2472         mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd,
2473         mips_elf_merge_gots, mips_elf_set_global_got_offset,
2474         mips_elf_resolve_final_got_entry,
2475         mips_elf_resolve_final_got_entries, mips_elf_adjust_gp,
2476         mips_elf_got_for_ibfd): New functions.
2477         (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT.
2478         (MIPS_ELF_GOT_MAX_SIZE): New macro.
2479         (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT.
2480         (mips_elf_got_entry_hash): Take new fields into account.  Use
2481         mips_elf_hash_bfd_vma.
2482         (mips_elf_got_entry_eq): Take new fields into account.
2483         (mips_elf_create_got_section): Initialize new fields.
2484         (mips_elf_calculate_relocation): Pass input_bfd to functions
2485         that now take it.  Adjust gp for the input_bfd.
2486         (mips_elf_allocate_dynamic_relocation,
2487         mips_elf_create_dynamic_relocation,
2488         _bfd_mips_elf_create_dynamic_sections): Use...
2489         (mips_elf_rel_dyn_section): New function.  Borrow code from...
2490         (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that
2491         now take it.  Create the got section if needed, even if
2492         excluded, before recording a global got symbol.  Move some
2493         code to...
2494         (mips_elf_record_local_got_symbol): New fn.
2495         (_bfd_mips_elf_size_dynamic_sections): Disable combreloc.
2496         Compute multi-got global entries offsets.  Move GOT code to...
2497         (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got
2498         if the GOT is too big.
2499         (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of
2500         undefweak symbol to zero.  Generate dynamic relocations for
2501         non-primary GOT entries for global symbols.
2502         (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got
2503         case.  Generate dynamic relocations for local got entries.
2504         Sort dynamic relocations on N64 too, using...
2505         (sort_dynamic_relocs_64): New fns.
2506         (_bfd_mips_elf_hide_symbol): Adjust multi-got counters.
2507         (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT.
2508
2509 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
2510
2511         * bfd.c (struct _bfd): Added id field.
2512         * opncls.c (_bfd_id_counter): New static variable.
2513         (_bfd_new_bfd): Use it.
2514         * bfd-in2.h: Rebuilt.
2515
2516 2003-01-25  Alan Modra  <amodra@bigpond.net.au>
2517
2518         * elf32-sparc.c (bfd_elf32_new_section_hook): Define.
2519
2520 2003-01-25  Jakub Jelinek  <jakub@redhat.com>
2521
2522         * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs.
2523         (elf32_sparc_rev32_howto): New variable.
2524         (sparc_reloc_map): Add TLS relocs.
2525         (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto):
2526         Handle REV32.
2527         (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject):
2528         New functions.
2529         (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry,
2530         struct elf32_sparc_link_hash_table):
2531         New structures.
2532         (elf32_sparc_tdata, elf32_sparc_local_got_tls_type,
2533         elf32_sparc_hash_table): Define.
2534         (link_hash_newfunc, elf32_sparc_link_hash_table_create,
2535         create_got_section, elf32_sparc_create_dynamic_sections,
2536         elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New
2537         functions.
2538         (elf32_sparc_check_relocs): Handle TLS relocs.  Add dynamic reloc
2539         reference counting.
2540         (elf32_sparc_gc_sweep_hook): Likewise.
2541         (elf32_sparc_adjust_dynamic_symbol): Likewise.
2542         (elf32_sparc_size_dynamic_sections): Likewise.
2543         (elf32_sparc_relocate_section): Likewise.
2544         (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff):
2545         New functions.
2546         (elf32_sparc_object_p): Allocate backend private object data.
2547         (bfd_elf32_bfd_link_hash_table_create,
2548         elf_backend_copy_indirect_symbol, bfd_elf32_mkobject,
2549         elf_backend_can_refcount): Define.
2550         (elf_backend_create_dynamic_sections): Define to
2551         elf32_sparc_create_dynamic_sections.
2552         * reloc.c: Add SPARC TLS relocs.
2553         * bfd-in2.h, libbfd.h: Rebuilt.
2554         * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs.
2555         (sparc_reloc_map): Likewise.
2556
2557 2003-01-24  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2558
2559         * bfd-in2.h: Regenerate.
2560         * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition,
2561         s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions.
2562         (elf_howto_table): Add TLS relocs.
2563         (elf_s390_reloc_type_lookup): Likewise.
2564         (elf_s390_link_hash_entry): Add tls_type.
2565         (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type):
2566         New macros.
2567         (elf_s390_link_hash_table): Add tls_ldm_got.
2568         (link_hash_newfunc): Initialize tls_type.
2569         (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got.
2570         (elf_s390_copy_indirect_symbol): Copy tls_type information.
2571         (elf_s390_check_relocs): Support TLS relocs.
2572         (elf_s390_gc_sweep_hook): Likewise.
2573         (allocate_dynrelocs): Likewise.
2574         (elf_s390_size_dynamic_sections): Likewise.
2575         (elf_s390_relocate_section): Likewise.
2576         (elf_s390_finish_dynamic_symbol): Likewise.
2577         (bfd_elf32_mkobject): Define for TLS.
2578         * elf64-s390.c: Same changes as for elf32-s390.c.
2579         * libbfd.h: Regenerate.
2580         * reloc.c: Add s390 TLS relocations.
2581
2582 2003-01-24  Charles Lepple  <clepple@ghz.cc>
2583
2584         * aclocal.m4: Fix name of --enable-install-libbfd switch.
2585
2586 2003-01-23  Nick Clifton  <nickc@redhat.com>
2587
2588         * Add sh2e support:
2589         2002-04-02  Elena Zannoni  <ezannoni@redhat.com>
2590         * archures.c (bfd_mach_sh2e): Added.
2591         * bfd-in2.h: Rebuilt.
2592         * cpu-sh.c (arch_info_struct): Added SH2e.
2593         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E.
2594
2595 2003-01-23  Alan Modra  <amodra@bigpond.net.au>
2596
2597         * elf-bfd.h (struct bfd_elf_section_data): Remove tdata.  Change
2598         dynindx to an int.  Rearrange for better packing.
2599         * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
2600         * elf32-mips.c (bfd_elf32_new_section_hook): Define.
2601         * elf32-sh64.h: New.  Split out from include/elf/sh.h.
2602         (struct _sh64_elf_section_data): New struct.
2603         (sh64_elf_section_data): Don't dereference sh64_info (was tdata).
2604         * elf32-sh64-com.c: Include elf32-sh64.h.
2605         * elf32-sh64.c: Likewise.
2606         (sh64_elf_new_section_hook): New function.
2607         (bfd_elf32_new_section_hook): Define.
2608         (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
2609         (sh64_bfd_elf_copy_private_section_data): Likewise.
2610         (sh64_elf_final_write_processing): Likewise.
2611         * elf32-sparc.c (struct elf32_sparc_section_data): New.
2612         (elf32_sparc_new_section_hook): New function.
2613         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
2614         (sec_do_relax): Define.
2615         (elf32_sparc_relax_section): Adjust to use sec_do_relax.
2616         (elf32_sparc_relocate_section): Likewise.
2617         * elf64-mips.c (bfd_elf64_new_section_hook): Define.
2618         * elf64-mmix.c (struct _mmix_elf_section_data): New.
2619         (mmix_elf_section_data): Define.  Use throughout file.
2620         (mmix_elf_new_section_hook): New function.
2621         (bfd_elf64_new_section_hook): Define.
2622         * elf64-ppc.c (struct _ppc64_elf_section_data): New.
2623         (ppc64_elf_section_data): Define.  Use throughout.
2624         (ppc64_elf_new_section_hook): New function.
2625         (bfd_elf64_new_section_hook): Define.
2626         * elf64-sparc.c (struct sparc64_elf_section_data): New.
2627         (sparc64_elf_new_section_hook): New function.
2628         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
2629         (sec_do_relax): Define.
2630         (sparc64_elf_relax_section): Adjust to use sec_do_relax.
2631         (sparc64_elf_relocate_section): Likewise.
2632         (bfd_elf64_new_section_hook): Define.
2633         * elfn32-mips.c (bfd_elf32_new_section_hook): Define.
2634         * elfxx-mips.c (struct _mips_elf_section_data): New.
2635         (mips_elf_section_data): Define.  Use throughout.
2636         (_bfd_mips_elf_new_section_hook): New function.
2637         (mips_elf_create_got_section): Don't alloc used_by_bfd.
2638         * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
2639         * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
2640         * Makefile.am: Run "make dep-am".
2641         * Makefile.in: Regenerate.
2642
2643 2003-01-21  Richard Henderson  <rth@redhat.com>
2644
2645         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New.
2646         (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value.
2647         (elf64_alpha_adjust_dynamic_symbol): Set them.
2648         (elf64_alpha_size_plt_section_1): Reset them when plt entry removed.
2649         (elf64_alpha_relax_tls_get_addr): Handle LDM relocs.  Frob the
2650         symbol index when relaxing LDM to TPREL.
2651         (elf64_alpha_relax_section): Likewise.  Allow relaxation of GD
2652         relocs, even if the target isn't locally defined.
2653         (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero.
2654         (elf64_alpha_relocate_section): Likewise.  Force TP-relative
2655         relocs vs symndx 0 to the tp base.
2656
2657 2003-01-21  Fabio Alemagna  <falemagn@aros.org>
2658
2659         * config.bfd: Handle i[3456]86-*-aros*.
2660
2661 2003-01-21  Andreas Schwab  <schwab@suse.de>
2662
2663         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define.
2664         (struct ppc_elf_link_hash_entry): Define.
2665         (ppc_elf_hash_entry): New function.
2666         (struct ppc_elf_link_hash_table): Define.
2667         (ppc_elf_hash_table): New function.
2668         (ppc_elf_link_hash_newfunc): New function.
2669         (ppc_elf_link_hash_table_create): New function.
2670         (ppc_elf_copy_indirect_symbol): New function.
2671         (allocate_dynrelocs): New function.
2672         (readonly_dynrelocs): New function.
2673         (ppc_elf_size_dynamic_sections): Allocate space for dynamic
2674         relocs and determine DT_TEXTREL.
2675         (ppc_elf_check_relocs): Don't do that here, just count the
2676         dynamic relocs.
2677         (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the
2678         removed section.
2679         (bfd_elf32_bfd_link_hash_table_create): Define.
2680         (elf_backend_copy_indirect_symbol): Define.
2681
2682 2003-01-21  Richard Henderson  <rth@redhat.com>
2683
2684         * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and
2685         TPREL also get a reloc if shared.  Remove SREL support.
2686         (elf64_alpha_emit_dynrel): New.
2687         (elf64_alpha_relocate_section): Use it.  Resolve dynamic TPREL
2688         and GOTTPREL relocs to local symbols against the tp base.
2689         (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel.
2690
2691         * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got
2692         use count before clobbering r_type.
2693         (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn
2694         ordering would mean dataflow inspection is necessary.
2695
2696 2003-01-20  Svein E. Seldal  <Svein.Seldal@solidas.com>
2697
2698         * coffcode.h (coff_set_flags): Added get/set arch hooks.
2699
2700 2003-01-20  Fabio Alemagna  <falemagn@aros.org>
2701
2702         * elf32-sh.c: Treat elfNN_bed like other macros defined in
2703           elfxx-target.h and #undef it before #define'ing it.
2704         * elf32-i386.c: Likewise.
2705         * elf32-sh64.c: Likewise.
2706         * elf64-alpha.c: Likewise.
2707         * elf64-sh64.c: Likewise.
2708
2709 2003-01-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2710
2711         * bfd-in2.h: Regenerate.
2712         * elf32-s390.c (elf_s390_adjust_gotplt): New prototype.
2713         (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add
2714         R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16,
2715         R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16,
2716         R_390_PLTOFF32 and R_390_PLTOFF64.
2717         (elf_s390_reloc_type_lookup): Likewise.
2718         (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track
2719         of GOTPLT references to a function.
2720         (link_hash_newfunc): Initialize gotplt_refcount.
2721         (elf_s390_check_relocs): Move allocation of local_got_refcounts array
2722         and creation of the got section out of the main switch. Add support
2723         for the gotoff, gotplt and pltoff relocations.
2724         (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt
2725         and pltoff.
2726         (elf_s390_adjust_gotplt): New function.
2727         (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed
2728         plt entries.
2729         (allocate_dynrelocs): Add comment.
2730         (elf_s390_relocate_section): Change r_type to unsigned. Add support
2731         for gotoff, gotplt and pltoff relocations.
2732         * elf64-s390.c: Same changes as for elf32-s390.c.
2733         * libbfd.h: Regenerate.
2734         * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12,
2735         BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64,
2736         BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32
2737         and BFD_RELOC_390_PLTOFF64.
2738
2739 2003-01-18  Jakub Jelinek  <jakub@redhat.com>
2740
2741         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
2742         R_IA64_TPREL64[LM]SB against non-global symbol properly.
2743
2744 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
2745
2746         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add
2747         self_dtpmod_done and self_dtpmod_offset.
2748         (allocate_global_data_got): Only use one got entry for all
2749         dtpmod relocs against local symbols.
2750         (allocate_dynrel_entries): Only need .rela.got entry for
2751         dtpmod against global symbol.
2752         (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset.
2753         Reserve space in .rela.got for the local dtpmod entry.
2754         (set_got_entry): Initialize the common local dtpmod .got entry.
2755         (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB
2756         and R_IA_64_DTPREL64MSB.
2757
2758 2003-01-16  Alan Modra  <amodra@bigpond.net.au>
2759
2760         * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h.
2761         (R_PPC_*): Rename all occurrences to R_PPC64_*.
2762         (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30.
2763         (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type.
2764         (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other
2765         relative relocs, not with absolute ones.
2766         * Makefile.am: Run "make dep-am".
2767         * Makefile.in: Regenerate.
2768         * po/SRC-POTFILES.in: Regenerate.
2769
2770 2003-01-15  Andreas Schwab  <schwab@suse.de>
2771
2772         * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a
2773         relocation against a non-allocated readonly section.
2774
2775 2003-01-10  Alan Modra  <amodra@bigpond.net.au>
2776
2777         * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
2778         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.  PLTGOT16_HA too.
2779
2780 2002-01-08  Klee Dienes  <kdienes@apple.com>
2781
2782         * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
2783         (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
2784         * Makefile.in: Regenerate.
2785
2786 2003-01-08  Alexandre Oliva  <aoliva@redhat.com>
2787
2788         * elfn32-mips.c (prev_reloc_section): New.
2789         (GET_RELOC_ADDEND): Use it.  Parenthesize macro arguments.
2790         (SET_RELOC_ADDEND): Parenthesize macro argument.
2791
2792 2003-01-07  John David Anglin  <dave.anglin@nrc.gc.ca>
2793
2794         * elf32-hppa.c (final_link_relocate): For all DP relative relocations,
2795         adjust addil instructions if the symbol has no section.
2796
2797 2003-01-07  DJ Delorie  <dj@redhat.com>
2798
2799         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not
2800         partial_inplace.
2801
2802 2003-01-07  Andreas Schwab  <schwab@suse.de>
2803
2804         * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for
2805         PC relative relocations.
2806         (elf_m68k_discard_copies): Set it here instead.
2807
2808 2002-01-02  Ben Elliston  <bje@redhat.com>
2809             Jeff Johnston  <jjohnstn@redhat.com>
2810
2811         * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo.
2812         (ALL_MACHINES_CFILES): Add cpu-iq2000.c.
2813         (BFD32_BACKENDS): Add elf32-iq2000.lo.
2814         (BFD32_BACKENDS_CFILES): Add elf32-iq2000.c.
2815         (cpu-iq2000.lo): New target.
2816         * Makefile.in: Regenerate.
2817         * config.bfd: Handle iq2000-*-elf.
2818         * archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000.
2819         (bfd_archures_list): Add bfd_iq2000_arch.
2820         * configure.in: Handle bfd_elf32_iq2000_vec.
2821         * configure: Regenerate.
2822         * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
2823         and BFD_RELOC_IQ2000_UHI16.
2824         * targets.c (bfd_elf32_iq2000_vec): Declare.
2825         (bfd_target_vector): Add bfd_elf32_iq2000_vec.
2826         * elf.c (prep_headers): Set e_machine to EM_IQ2000.
2827         * cpu-iq2000.c: New file.
2828         * elf32-iq2000.c: Likewise.
2829         * libbfd.h: Regenerate.
2830         * bfd-in2.h: Likewise.
2831
2832 2003-01-02  Richard Sandiford  <rsandifo@redhat.com>
2833
2834         * elfxx-mips.c: Include libiberty.h.
2835         (elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove.
2836         (mips_set_isa_flags): New function, split out from...
2837         (_bfd_mips_elf_final_write_processing): ...here.  Only call
2838         mips_set_isa_flags if the EF_MIPS_MACH bits are clear.
2839         (mips_mach_extensions): New array.
2840         (mips_32bit_flags_p): New function.
2841         (_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks.
2842         Use mips_32bit_flags_p to check if one binary is 32-bit and the
2843         other is 64-bit.  When adopting IBFD's architecture, adopt the
2844         bfd_mach as well as the flags.
2845
2846 2003-01-02  Nick Kelsey  <nickk@ubicom.com>
2847
2848         * elf32-ip2k.c: Re-work of linker relaxation code for the ip2k to
2849         fix internal errors, fix bad code generation, fix incorrect stabs
2850         information, and improve ability to eliminate redundant page
2851         instructions. Added code to ip2k_final_link_relocate to self-verify
2852         the linker relaxation.  Fix formatting problems.
2853
2854 2002-12-30  Chris Demetriou  <cgd@broadcom.com>
2855
2856         * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case.
2857         * archures.c (bfd_mach_mipsisa32r2): New define.
2858         * bfd-in2.h: Regenerate.
2859         * cpu-mips.c (I_mipsisa32r2): New enum value.
2860         (arch_info_struct): Add entry for I_mipsisa32r2.
2861         * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach)
2862         (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2.
2863         (_bfd_mips_elf_final_write_processing): Add
2864         bfd_mach_mipsisa32r2 case.
2865         (_bfd_mips_elf_merge_private_bfd_data): Handle merging of
2866         binaries marked as using MIPS32 Release 2.
2867
2868 2002-12-30    Dmitry Diky <diwil@mail.ru>
2869
2870         * Makefile.am: Add msp430 target.
2871         * configure.in: Likewise.
2872         * Makefile.in: Regenerate.
2873         * configure: Regenerate.
2874         * archures.c: Add msp430 architecture vector.
2875         * config.bfd: Likewise.
2876         * reloc.c: Add msp430 relocs.
2877         * targets.c: Add msp320 target.
2878         * cpu-msp430.c: New file: msp430 cpu detection.
2879         * elf32-msp430.c: New file: msp430 reloc processing.
2880         * bfd-in2.h: Regenerate.
2881         * libbfd.h: Regenerate.
2882
2883 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
2884
2885         * elf.c (elf_sort_sections): Don't reorder .tbss.
2886         (assign_file_positions_for_segments): Only adjust off/voff
2887         for increased alignment in PT_LOAD or PT_NOTE segment,
2888         but adjust p_filesz for .tbss too.  in PT_LOAD consider
2889         .tbss to have zero memory size.
2890         (copy_private_bfd_data) [SECTION_SIZE]: Define.
2891         [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it.
2892         [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections
2893         into PT_TLS segment.  Never put SHF_TLS sections in
2894         segments other than PT_TLS or PT_LOAD.
2895
2896         * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Clear .plt
2897         sh_entsize.
2898
2899 2002-12-23  DJ Delorie  <dj@redhat.com>
2900
2901         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Fix logic reversal.
2902
2903 2002-12-23  Alan Modra  <amodra@bigpond.net.au>
2904
2905         * elflink.h (elf_link_output_extsym): Heed strip_discarded.
2906
2907 2002-12-23  Nick Clifton  <nickc@redhat.com>
2908
2909         * archures.c (bfd_arch_get_compatible): Add third parameter
2910         'accept_unknowns'.  Only accept unknown format BFDs if
2911         accept_unknowns is true, or if the format is "binary".
2912         * bfd-in2.h: Regenerate.
2913
2914 2002-12-21  Nick Clifton  <nickc@redhat.com>
2915
2916         * coff-arm.c (coff_arm_relocate_section): Disable WINCE workaround
2917         that subtracted 8 from pc relative relocations.
2918
2919 2002-12-20  Kazu Hirata  <kazu@cs.umass.edu>
2920
2921         * coff-h8300.c: Fix comment typos.
2922         * coffcode.h: Likewise.
2923         * cpu-cris.c: Likewise.
2924         * elf32-vax.c: Likewise.
2925         * genlink.h: Likewise.
2926         * linker.c: Likewise.
2927         * som.c: Likewise.
2928         * tekhex.c: Likewise.
2929         * vms-misc.c: Likewise.
2930
2931 2002-12-20  DJ Delorie  <dj@redhat.com>
2932
2933         * reloc.c: Add BFD_RELOC_XSTORMY16_12.
2934         * libbfd.h: Regenerate.
2935         * bfd-in2.h: Regenerate.
2936         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12.
2937         (xstormy16_reloc_map): Add R_XSTORMY16_12.
2938
2939 2002-12-19  Kazu Hirata  <kazu@cs.umass.edu>
2940
2941         * doc/bfdint.texi: Fix typos.
2942
2943 2002-12-20  Paul Eggert  <eggert@twinsun.com>
2944
2945         Port to POSIX 1003.1-2001.
2946         * acinclude.m4 (AM_INSTALL_LIBBFD): Do not rely on "test -o".
2947         * configure.in (build-warnings): Likewise.
2948         (Horrible hacks to build DLLs on Windows): Do not rely on "tail -1".
2949         * aclocal.m4: Regenerate.
2950         * config.in: Regenerate.
2951         * configure: Regenerate.
2952
2953 2002-12-19  Alan Modra  <amodra@bigpond.net.au>
2954
2955         * coff-h8300.c: Include libiberty.h.
2956         (h8300_reloc16_extra_cases): Check the hash table creator before
2957         referencing h8300 specific fields.  Stash the hash table pointer
2958         in a local var.  Comment typo fixes.
2959         (h8300_bfd_link_add_symbols): Likewise.
2960
2961         * reloc.c (struct reloc_howto_struct): Revise src_mask and
2962         dst_mask comments.
2963         * bfd-in2.h: Regenerate.
2964
2965 2002-12-18  Alan Modra  <amodra@bigpond.net.au>
2966
2967         * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc
2968         code a little.  Comment on dynamic relocs against section symbols.
2969
2970 2002-12-17  Roger Sayle  <roger@eyesopen.com>
2971
2972         * configure.host (ia64-*-hpux*): Support 64 bit targets using
2973         the HP compiler's "long long".
2974
2975 2002-12-16  Andrew MacLeod  <amacleod@redhat.com>
2976
2977         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_LO16
2978         and R_XSTORMY16_HI16) howto entries.
2979         (xstormy16_reloc_map): Map R_XSTORMY16_{LO,HI}16 to BFD_RELOC_{LO,HI}16.
2980         (xstormy16_info_to_howto_rela): Use R_XSTORMY16_GNU_VTINHERIT to
2981         determine the start of the second reloc table.
2982
2983 2002-12-16  Nathan Tallent  <eraxxon@alumni.rice.edu>
2984
2985         * ecofflink.c: Fix the reading of the debugging information
2986         of Tru64/Alpha binaries that are produced by recent Compaq
2987         compilers.
2988         (mk_fdrtab): Fix error in creating the FDR (file descriptor)
2989         table.
2990         (lookup_line): Because of the strange information sometimes
2991         generated by Compaq's recent compilers, change how the FDR
2992         table is searched so that PDRs (procedure descriptors) are
2993         correctly found.  Note that this change is really more of a hack;
2994         however, I have included extensive documentation as to why
2995         this is the best solution short of an extensive rewrite or
2996         another hack.
2997         (fdrtab_lookup): Add comments to explain the algorithm.
2998
2999 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
3000
3001         * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Reorder
3002         initializers to match struct declaration.
3003
3004 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
3005
3006         * dwarf2.c (comp_unit_contains_address): Comment typo fix.
3007         * elf.c (get_program_header_size): Likewise.
3008         * elf32-m32r.c (m32r_elf_lo16_reloc): Likewise.
3009         (m32r_elf_generic_reloc): Likewise.
3010         * elf32-ppc.c (ppc_elf_howto_init): Likewise.
3011         * elflink.h (elf_bfd_discard_info): Likewise.
3012
3013 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
3014
3015         * elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset
3016         to DT_JMPREL.  Use srelplt input section size for DT_PLTRELSZ and
3017         DT_RELSZ adjustment, not output section.  Avoid writing tags when
3018         unchanged.  Don't assume linker script is sane, adjust DT_REL too.
3019         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw
3020         size of srelplt for DT_PLTRELSZ.  Use srelplt input section size for
3021         DT_RELASZ adjustment, not output section.  Avoid writing tags when
3022         unchanged.  Adjust DT_RELA.
3023         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better
3024         formatting.  Avoid writing tags when unchanged.  Adjust DT_RELA.
3025
3026 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
3027
3028         * elfxx-mips.c (mips_elf_calculate_relocation): Don't divide
3029         addend by 4.
3030
3031 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
3032
3033         * elfxx-mips.c (struct mips_got_entry): New.
3034         (struct mips_got_info): Added got_entries field.
3035         (mips_elf_got_entry_hash, mips_elf_got_entry_eq): New functions.
3036         (mips_elf_local_got_index, mips_elf_got_page,
3037         mips_elf_got16_entry): Re-implement in terms of new...
3038         (mips_elf_create_local_got_entry): Rewrite to use got_entries.
3039         Change return type.
3040         (mips_elf_highest): Warning clean-up.
3041         (mips_elf_create_got_section): Initialize got_entries.
3042         (_bfd_mips_elf_check_relocs): Use got_entries to estimate
3043         local got size.
3044         (_bfd_mips_elf_size_dynamic_sections): Do not account for
3045         GOT_PAGE entries, since we now reuse GOT16 entries.
3046
3047 2002-12-10  Jason Thorpe  <thorpej@wasabisystems.com>
3048
3049         * aoutx.h (set_section_contents): Allow an otherwise unrepresentable
3050         read-only section that lies after .text and before .data to be
3051         written into the output file and included in a_text.
3052         (translate_to_native_sym_flags): If an otherwise unrepresentable
3053         section was merged with .text, convert its symbols to N_TEXT
3054         symbols.
3055         * libaout.h (aout_section_merge_with_text_p): New macro.
3056
3057 2002-12-08  Alan Modra  <amodra@bigpond.net.au>
3058
3059         * bfd-in.h: Comment typo fix.  Formatting.
3060         * bfd-in2.h: Regenerate.
3061         * coff64-rs6000.c (xcoff64_openr_next_archived_file): Warning fix.
3062         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): Prototype.
3063         * elf64-mmix.c (mmix_dump_bpo_gregs): Warning fix.
3064
3065 2002-12-05  Richard Henderson  <rth@redhat.com>
3066
3067         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21BI.
3068         Only send PCREL21B though the plt.  Fix installed reloc type.
3069         (elfNN_ia64_relocate_section): Give error for dynamic reloc
3070         against PCREL22 or PCREL64I; clean up error messages for
3071         branch relocs.
3072
3073 2002-12-04  Kevin Buettner  <kevinb@redhat.com>
3074
3075         * elf64-mips.c (elf64_mips_grok_prstatus, elf64_mips_grok_psinfo):
3076         New functions.
3077         (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
3078
3079 2002-12-04  David Mosberger  <davidm@hpl.hp.com>
3080
3081         * cpu-ia64-opc.c: Add operand constant "ar.csd".
3082
3083 2002-12-04  H.J. Lu <hjl@gnu.org>
3084
3085         * elfxx-ia64.c (get_local_sym_hash): Use section ID instead of
3086         BFD address when constructing local name.
3087
3088 2002-12-04  Andreas Schwab  <schwab@suse.de>
3089
3090         * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec
3091         member.
3092         (elf_m68k_link_hash_table_create): Initialize it.
3093         (elf_m68k_check_relocs): Handle symbols that are forced to be
3094         local due to visibility changes.
3095         (elf_m68k_adjust_dynamic_symbol): Likewise.
3096         (elf_m68k_size_dynamic_sections): Likewise.
3097         (elf_m68k_discard_copies): Likewise.
3098         (elf_m68k_relocate_section): Likewise.
3099
3100 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
3101
3102         * elf64-ppc.c (ppc64_elf_edit_opd): Correct typo.
3103
3104 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
3105
3106         * srec.c (srec_write_symbols): Restore '$' prefix to address
3107         accidentally removed in 2002-04-04 change.
3108         (srec_get_symtab): Use 0 instead of `(long) FALSE'.
3109
3110 2002-12-03  Nick Clifton  <nickc@redhat.com>
3111
3112         * elf32-ppc.c (apuinfo_list_init): New function.
3113         (apuinfo_list_add): New function: Add a value to the list.
3114         (apuinfo_list_length): New function: Return the number of
3115         values on the list.
3116         (apuinfo_list_element): New function: Return a value on the
3117         list.
3118         (apuinfo_list_finish): New function: Free the resources used
3119         by the list.
3120         (ppc_elf_begin_write_processing): New function.  Scan the
3121         input bfds for apuinfo sections.
3122         (ppc_elf_write_section): New function: Delay the creation of
3123         the contents of an apuinfo section in an output bfd.
3124         (ppc_elf_final_write_processing): New function.  Create the
3125         contents of an apuinfo section in an output bfd.
3126         (elf_backend_begin_write_processing): Define.
3127         (elf_backend_final_write_processing): Define.
3128         (elf_backend_write_section): Define.
3129
3130 2002-12-03  Richard Henderson  <rth@redhat.com>
3131
3132         * cpu-ia64-opc.c (elf64_ia64_operands): Add ldxmov entry.
3133
3134 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
3135
3136         Fix PR savannah/1417:
3137         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Don't adjust
3138         branch if it goes to the start of the deleted region.
3139
3140 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
3141
3142         * bfd-in2.h (bfd_mach_m6812): Rebuild.
3143         * archures.c (bfd_mach_m6812_default, bfd_mach_m6812,
3144         bfd_mach_m6812s): Declare.
3145
3146         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): New function.
3147         (_bfd_m68hc12_elf_set_private_flags): Call it.
3148         (_bfd_m68hc12_elf_print_private_bfd_data): Report processor version.
3149         (_bfd_m68hc12_elf_merge_private_bfd_data): Merge the flags and
3150         report microcontroller incompatibilities (HC12 vs HCS12).
3151         (elf_backend_object_p): Update.
3152
3153 2002-11-30  Alan Modra  <amodra@bigpond.net.au>
3154
3155         * bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete.
3156         (enum bfd_boolean, boolean): Delete.
3157         (bfd_boolean): Typedef to an int.
3158         (FALSE, TRUE): Define.
3159         * aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c,
3160         aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h,
3161         aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c,
3162         binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
3163         coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c,
3164         coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c,
3165         coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c,
3166         coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c,
3167         coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c,
3168         coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c,
3169         corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c,
3170         cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c,
3171         cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c,
3172         cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c,
3173         cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c,
3174         cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c,
3175         cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c,
3176         cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c,
3177         cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c,
3178         cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c,
3179         dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c,
3180         elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
3181         elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c,
3182         elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
3183         elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h,
3184         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
3185         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
3186         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
3187         elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c,
3188         elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
3189         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
3190         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
3191         elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c,
3192         elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h,
3193         elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
3194         elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c,
3195         hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c,
3196         i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c,
3197         libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h,
3198         libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c,
3199         m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c,
3200         mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c,
3201         nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
3202         pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c,
3203         pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c,
3204         pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c,
3205         reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c,
3206         som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c,
3207         syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c,
3208         vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h,
3209         xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with
3210         bfd_boolean, true with TRUE, false with FALSE.  Simplify comparisons
3211         of bfd_boolean vars with TRUE/FALSE.  Formatting.
3212         * bfd-in2.h, libbfd.h, libcoff.h: Regenerate
3213
3214 2002-11-28  Alan Modra  <amodra@bigpond.net.au>
3215
3216         * elf-bfd.h: Replace occurrences of Elf32_Internal_* and
3217         Elf64_Internal_* with Elf_Internal_*.  Replace Elf_Internal_Rel
3218         with Elf_Internal_Rela.
3219         * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
3220         elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
3221         elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
3222         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
3223         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
3224         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
3225         elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
3226         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
3227         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
3228         elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
3229         elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
3230         * elf-hppa.h (elf_hppa_internal_shdr): Delete.  Use Elf_Internal_Shdr
3231         throughout instead.
3232         * elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
3233         * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
3234         Remove INLINE keyword.
3235         (elf_swap_reloc_in): Likewise.  Also clear r_addend.
3236         (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
3237         as a bfd_byte *.
3238         (elf_write_relocs): Consolidate REL and RELA code.
3239         (elf_slurp_reloc_table_from_section): Simplify REL code.
3240         (NAME(_bfd_elf,size_info)): Populate reloc swap entries.
3241         * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
3242         * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
3243         RELA code.
3244         (elf_link_adjust_relocs): Likewise.  Don't malloc space for temp
3245         reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
3246         (elf_link_output_relocs): Likewise.
3247         (elf_reloc_link_order): Likewise.
3248         (elf_finish_pointer_linker_section): Likewise.
3249         (struct elf_link_sort_rela): Remove union.
3250         (elf_link_sort_cmp1): Update to suit.
3251         (elf_link_sort_cmp2): Here too.
3252         (elf_link_sort_relocs): Consolidate REL and RELA code.  Fix memory
3253         over-allocation for int_rels_per_ext_rel != 1 case.
3254         * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
3255         * elf32-i386.c: Likewise.
3256         * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
3257         * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
3258         elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
3259         * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
3260         * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
3261         elf64-sparc.c, elf64-x86-64.c: Likewise.
3262         * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
3263         * elfxx-mips.c (sort_dynamic_relocs): Likewise for
3264         bfd_elf32_swap_reloc_in.
3265
3266         * elf32-arm.h: Update elf32_arm_info_to_howto calls.
3267         * elf32-mips.c: Likewise for mips_info_to_howto_rel.
3268         (mips_elf64_swap_reloc_in): Zero r_addend.
3269         (mips_elf64_be_swap_reloc_in): Likewise.
3270         (mips_elf64_slurp_one_reloc_table): Simplify.
3271
3272         * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
3273         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
3274         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
3275
3276 2002-11-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3277
3278         * elf32-sh.c (sh_elf_relocate_section): Don't complain about
3279         unresolved debugging relocs in dynamic applications.
3280         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
3281
3282 2002-11-26  Alan Modra  <amodra@bigpond.net.au>
3283
3284         * elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
3285         (_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs
3286         on a relocatable link.  Comment typos.
3287         * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure
3288         in the order they are declared.  Clear elf_hash_value too.
3289         (_bfd_elf_link_hash_table_init): Likewise assign in order.  Clear
3290         eh_info and tls_segment.
3291         * elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets
3292         sorted when discarding relocs by turning them into R_*_NONE.
3293
3294         * libbfd.c (warn_deprecated): Comment spelling.
3295         * po/SRC-POTFILES.in: Regenerate.
3296
3297 2002-11-21  Richard Henderson  <rth@redhat.com>
3298
3299         * elflink.h (elf_link_add_object_symbols): Don't overwrite the
3300         arch's st_other bits when merging visibilities.
3301         (elf_link_output_extsym): Tidy clearing of visibility field.
3302
3303 2002-11-21  Alan Modra  <amodra@bigpond.net.au>
3304
3305         * coff-mcore.c (SWAP_IN_RELOC_OFFSET): Define.
3306         (SWAP_OUT_RELOC_OFFSET): Define.
3307
3308 2002-11-20  Alexandre Oliva  <aoliva@redhat.com>
3309
3310         * elf.c (_bfd_elf_link_hash_table_init): Make sure
3311         can_refcount is properly extended to the type of
3312         init_refcount.
3313
3314 2002-11-19  Alexandre Oliva  <aoliva@redhat.com>
3315
3316         * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro.
3317         (_bfd_mips_elf_relocate_section): Use it.
3318
3319         * elfxx-mips.c (MNAME): New macro.
3320         (_bfd_mips_elf_check_relocs): Use it.
3321         (_bfd_mips_elf_discard_info): Likewise.
3322         (_bfd_mips_elf_final_link): Likewise.
3323
3324 2002-11-19  Alan Modra  <amodra@bigpond.net.au>
3325
3326         * elf64-ppc.c (ppc64_elf_edit_opd): When deleting relocs, adjust
3327         rel_hdr.sh_size too.
3328
3329 2002-11-18  Klee Dienes  <kdienes@apple.com>
3330
3331         * Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo.
3332         (BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c.
3333         (BFD_H_FILES): Add bfdwin.c, bfdio.c.
3334         (LIBBFD_H_FILES): Add bfdwin.c, bfdio.c.
3335         Add dependencies for bfdwin.c, bfdio.c.
3336         * bfd.c: Remove bfd_get_mtime, bfd_get_size.
3337         * libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal,
3338         bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite,
3339         bfd_tell, bfd_flush, bfd_stat, bfd_seek.
3340         * bfdio.c: New file.  Contains real_read, bfd_bread, bfd_write,
3341         bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime,
3342         bfd_get_size (moved from libbfd.c and bfd.c).
3343         * bfdwin.c New file.  Contains _bfd_window_internal,
3344         bfd_init_window, bfd_free_window, bfd_get_file_window (moved from
3345         libbfd.c and bfd.c).
3346         * po/SRC-POTFILES.in: Regenerate.
3347         * po/bfd.pot: Regenerate.
3348         * libbfd.h: Regenerate.
3349         * bfd-in2.h: Regenerate.
3350         * aclocal.m4: Regenerate.
3351         * Makefile.in: Regenerate.
3352         * configure: Regenerate.
3353
3354 2002-11-18  Klee Dienes  <kdienes@apple.com>
3355
3356         * bfd.c (bfd_preserve_save): Don't zero BFD_IN_MEMORY.
3357
3358 2002-11-15  Kazu Hirata  <kazu@cs.umass.edu>
3359
3360         * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away
3361         jsr after a short jump.
3362         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
3363
3364 2002-11-15  Klee Dienes  <kdienes@apple.com>
3365
3366         * pef.c (bfd_pef_convert_architecture): Move declaration of
3367         ARCH_POWERPC and ARCH_M68K to the start of the function.
3368
3369 2002-11-14  Svein E. Seldal  <Svein.Seldal@solidas.com>
3370
3371         * coff-tic4x.c (tic4x_howto_table): Formatting fixup
3372
3373 2002-11-14  Hans-Peter Nilsson  <hp@bitrange.com>
3374
3375         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs):
3376         For bpo_gregs_section->contents, allocate _raw_size, not
3377         _cooked_size.
3378
3379 2002-11-13  Klee Dienes  <kdienes@apple.com>
3380
3381         * config.bfd: Add entries for powerpc-*-darwin and cousins.
3382
3383 2002-11-13  H.J. Lu <hjl@gnu.org>
3384
3385         * elfcode.h (elf_object_p): Don't restore abfd->arch_info.
3386
3387 2002-11-13  Klee Dienes  <kdienes@apple.com>
3388             Alan Modra  <amodra@bigpond.net.au>
3389
3390         * bfd.c (struct bfd_preserve): New.
3391         (bfd_preserve_save): New function.
3392         (bfd_preserve_restore): Ditto.
3393         (bfd_preserve_finish): Ditto.
3394         * bfd-in2.h: Regenerate.
3395         * mach-o.c: Formatting.
3396         (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned.
3397         (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish.
3398         (bfd_mach_o_core_p): Ditto.
3399         (bfd_mach_o_scan): Pass in mdata.
3400         * mach-o.h (bfd_mach_o_scan): Update prototype.
3401         * pef.c: Formatting.
3402         (bfd_pef_object_p): Use bfd_preserve_save/restore/finish.
3403         (bfd_pef_xlib_object_p): Ditto.
3404         (bfd_pef_scan): Pass in mdata.  Move version check to bfd_pef_object_p.
3405         * pef.h (bfd_pef_scan): Update prototype.
3406         * xsym.c: Formatting, K&R fixes.
3407         (bfd_sym_object_p): Use bfd_preserve_save/restore/finish.
3408         (bfd_sym_scan): New function split out from bfd_sym_object_p.
3409         * xsym.h (bfd_sym_scan): Declare.
3410         * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish.
3411         * elfcore.h (elf_core_file_p): Likewise.
3412         * targets.c (_bfd_target_vector): Revert 2002-11-08 change.
3413
3414 2002-11-12  Nick Clifton  <nickc@redhat.com>
3415
3416         * po/da.po: Updated Danish translation.
3417
3418 2002-11-12  Alan Modra  <amodra@bigpond.net.au>
3419
3420         * elflink.h (elf_link_add_object_symbols): Optimize stabs for
3421         relocatable link too.
3422         (elf_link_input_bfd): When emitting relocs, adjust offsets for
3423         eh_frame and stab sections.  Zap deleted relocs.
3424         (elf_reloc_symbol_deleted_p): Return true for zero r_symndx.
3425         (elf_bfd_discard_info): Run for relocatable link too.
3426         * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd.  Make global.
3427         Handle ld -r case.
3428         (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here.
3429         * elf64-ppc.h (ppc64_elf_edit_opd): Declare.
3430
3431         * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c.
3432         (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise.
3433         (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise.
3434         (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR.
3435         (struct eh_frame_hdr_info): Add "hdr_sec", remove "split".
3436         (struct elf_link_hash_table): Add eh_info.
3437         (struct elf_obj_tdata): Change eh_frame_hdr to an asection *.
3438         (_bfd_elf_discard_section_eh_frame): Update prototype.
3439         (_bfd_elf_discard_section_eh_frame_hdr): Likewise.
3440         (_bfd_elf_write_section_eh_frame): Likewise.
3441         (_bfd_elf_write_section_eh_frame_hdr): Likewise.
3442         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec"
3443         param.  Get "hdr_info" from link hash table.
3444         (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param.  Get
3445         header section from link hash table.  Save header section to elf_tdata.
3446         (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec".  Use
3447         header section from link hash table.  Don't alloc hdr_info.  Clear
3448         hdr_sec instead of setting "strip".
3449         (_bfd_elf_eh_frame_section_offset): Formatting.
3450         (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param.
3451         Get header section from link hash table.
3452         (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param.
3453         Get header section from link hash table.
3454         * elf.c (map_sections_to_segments): Use cached eh_frame_hdr.
3455         (get_program_header_size): Likewise.
3456         (_bfd_elf_section_offset): Formatting.
3457         * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header
3458         section pointer in link hash table.
3459         (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr
3460         and _bfd_elf_write_section_eh_frame calls.  Update comment about
3461         eh_frame entries.
3462         (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and
3463         _bfd_elf_discard_section_eh_frame_hdr calls.  Remove "ehdr".
3464
3465         * po/SRC-POTFILES.in: Regenerate.
3466
3467         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero
3468         relocs for discarded FDEs.  Remove dead code.
3469         (_bfd_elf_write_section_eh_frame_hdr): Remove dead code.
3470         * elflink.h (elf_bfd_discard_info): Don't save edited relocs.
3471         Tidy conditions under which stabs are edited.  Formatting.
3472         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
3473         from discarded relocs.
3474         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output
3475         section adjustments after testing magic values.
3476
3477 2002-11-12  Thomas Moestl <tmm@FreeBSD.org>
3478
3479         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct
3480         references to large plt symbols.
3481
3482 2002-11-12  Klee Dienes  <kdienes@apple.com>
3483
3484         * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when
3485         looking for an unused section name.
3486
3487 2002-11-11  Kazu Hirata  <kazu@cs.umass.edu>
3488
3489         * coff-h8300.c: Fix formatting.
3490         * elf32-h8300.c: Likewise.
3491         * reloc16.c: Likewise.
3492
3493 2002-11-09  Jeroen Dobbelaere  <jeroen.dobbelaere@acunia.com>
3494
3495         * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output
3496         section when dynamic section unused;  _bfd_strip_section_from_output
3497         instead.
3498
3499 2002-11-08  Alan Modra  <amodra@bigpond.net.au>
3500
3501         * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec
3502         and sym_vec.
3503
3504         * dwarf2.c: Revert last change.
3505
3506 2002-11-07  Michal Ludvig  <mludvig@suse.cz>
3507
3508         * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
3509         _bfd_dwarf2_find_nearest_line): Use
3510         bfd_simple_get_relocated_section_contents() instead of
3511         bfd_get_section_contents().
3512         * reloc.c (bfd_perform_relocation): Add sanity check.
3513         * simple.c (simple_get_relocated_section_contents): If the section
3514         does not have any relocs associated with it, just return the
3515         unadjusted contents.
3516
3517 2002-11-07  Hans-Peter Nilsson  <hp@axis.com>
3518
3519         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOT,
3520         case R_CRIS_32_GOT>: Correct test for filling in constant .got
3521         contents, enabling for a non-DSO, for symbols defined in the
3522         program with --export-dynamic.
3523
3524 2002-11-07  Alan Modra  <amodra@bigpond.net.au>
3525
3526         * elf64-ppc.c: Comment typo fixes.
3527         (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input.
3528
3529 2002-11-07  Nick Clifton  <nickc@redhat.com>
3530
3531         * po/da.po: Updated Danish translation.
3532
3533 2002-11-06  Alexandre Oliva  <aoliva@redhat.com>
3534
3535         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate
3536         exactly three internal relocs per external reloc.  Set reloc_count
3537         to the external reloc count.
3538
3539 2002-11-06  Klee Dienes  <kdienes@apple.com>
3540
3541          * coff-stgo32.c (stub_bytes): Mark as const.
3542          Fix comment formatting.
3543
3544 2002-11-06  Klee Dienes  <kdienes@apple.com>
3545
3546         * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and
3547         xsym.lo.
3548         (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c.
3549         (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h
3550         * archures.c (enum bfd_architecture): Add bfd_arch_m98k.
3551         * bfd.c (struct bfd): Add private data for mach-o, pef, and sym.
3552         * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and
3553         sym.
3554         (_bfd_target_vector): Add target vectors for mach-o, pef, and sym.
3555         * Makefile.in: Regenerate.
3556         * doc/Makefile.in: Regenerate.
3557         * bfd-in2.h: Regenerate.
3558         * xsym.c: New file.  Contains support for the Apple/Metrowerks
3559         xSYM debugging format.
3560         * xsym.h: New file.
3561         * pef.c: New file.  Contains support for the Apple Code Fragment
3562         Manager Preferred Executable Format
3563         * pef.h: New file.
3564         * pef-traceback.h: New file.  Contains support for parsing PowerPC
3565         traceback tables as used by PEF executables (and perhaps other
3566         systems as well).
3567         * mach-o.c: New file.  Contains support for the Mach-O object file
3568         format.
3569         * mach-o.h: New file.
3570         * mach-o-target.c: New file.  Declares the mach-o targets
3571         themselves.  Included three times by mach-o.c; each time with a
3572         different set of macros set.
3573
3574 2002-11-06  Graeme Peterson  <gp@qnx.com>
3575
3576         * Makefile.am: Remove entries for elf32-qnx.[ch].
3577         * Makefile.in: Regenerate.
3578         * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec,
3579         ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use
3580         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
3581         * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec,
3582         bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec,
3583         and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets.
3584         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
3585         * configure: Regenerate.
3586         * elf32-qnx.c: Remove.
3587         * elf32-qnx.h: Remove.
3588         * elf.c: Remove calls to QNX specific set_nonloadable_filepos,
3589         is_contained_by_filepos, and copy_private_bfd_data_p.
3590         * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos,
3591         is_contained_by_filepos, and copy_private_bfd_data_p.
3592         * elf32-i386.c: Remove QNX extended bfd support.
3593         * elf32-ppc.c: Remove QNX extended bfd support.
3594         * elf32-sh.c: Remove QNX extended bfd support.
3595         * elfarm-nabi.c: Remove QNX extended bfd support.
3596         * targets.c: Remove qnx vectors.
3597         * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove
3598         (elf_backend_is_contained_by_filepos): Remove.
3599         (elf_backend_copy_private_bfd_data_p): Remove.
3600         * po/SRC-POTFILES.in: Regenerate.
3601
3602 2002-11-06  David O'Brien  <obrien@FreeBSD.org>
3603             Alan Modra  <amodra@bigpond.net.au>
3604
3605         * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of
3606         dynamic relocs against section symbols for the output section vma.
3607
3608 2002-11-05  Alan Modra  <amodra@bigpond.net.au>
3609
3610         * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn,
3611         t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove.
3612
3613 2002-11-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3614             Alan Modra  <amodra@bigpond.net.au>
3615
3616         * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64
3617         vectors in target_selvecs.
3618         (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors
3619         in target_selvecs.
3620         (sh-*-netbsdelf*): Likewise.
3621         * configure.in (assocvecs): New variable.  Handle assocvecs like
3622         selvecs.
3623         * configure: Regenerate.
3624         * format.c (bfd_check_format_matches): Store bfd_target pointers
3625         in matching_vector instead of target names.  Select first target
3626         from bfd_associated_vector that matches a list of ambiguous targets.
3627         * targets.c (_bfd_associated_vector): New array.
3628         (bfd_associated_vector): New variable.
3629         (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec.
3630         * libbfd-in.h (bfd_associated_vector): Declare.
3631         * libbfd.h: Regenerate.
3632
3633 2002-11-05  Elias Athanasopoulos  <eathan@otenet.gr>
3634
3635         * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
3636         non-NULL before dereferencing.
3637
3638 2002-11-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3639
3640         * vms.c (vms_object_p): Restore the start address when returning
3641         NULL.
3642
3643 2002-11-04  Alan Modra  <amodra@bigpond.net.au>
3644             Hans-Peter Nilsson  <hp@axis.com>
3645
3646         * elflink.h (struct elf_final_link_info): Add shndxbuf_size.
3647         (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields.
3648         Set up a larger symshndxbuf, and write it out.  Free it on
3649         exit rather than freeing symbuf twice.  Correct section index
3650         on output section symbol loop.
3651         (elf_link_output_sym): Accumulate symbol extension section
3652         indices, reallocating symshndxbuf rather than writing it out.
3653         (elf_link_flush_output_syms): Don't flush symshndxbuf.
3654         * elf.c (assign_section_numbers): Init i_shdrp to all zero.
3655         Use bfd_zalloc to clear i_shdrp[0] too.
3656
3657 2002-11-03  Stephen Clarke <stephen.clarke@earthling.net>
3658
3659          * elf32-sh64-com.c (sh64_address_in_cranges): Use
3660         _raw_size of cranges section if _cooked_size not yet set.
3661
3662 2002-11-03  Hans-Peter Nilsson  <hp@axis.com>
3663
3664         * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters
3665         for bfd_elf32_swap_symbol_out.
3666
3667 2002-10-31  David O'Brien  <obrien@FreeBSD.org>
3668
3669         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
3670         signed and unsigned in comparison.
3671
3672 2002-10-30  Daniel Jacobowitz  <drow@mvista.com>
3673
3674         * coffcode.h: Remove extraneous '\'.
3675
3676 2002-10-28  H.J. Lu <hjl@gnu.org>
3677
3678         * Makefile.am (targets.lo): Depend on Makefile instead of
3679         config.status.
3680         (archures.lo): Likewise.
3681         * Makefile.in: Regenerated.
3682
3683 2002-10-25  Jason Thorpe  <thorpej@wasabisystems.com>
3684
3685         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add
3686         bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to
3687         targ_selvecs.
3688
3689 2002-10-25  Jim Wilson  <wilson@redhat.com>
3690
3691         * elf64-sh64.c (sh_elf64_relocate_section): Call
3692         _bfd_elf_rela_local_sym.  Handle relocs against STT_SECTION symbol
3693         of SHF_MERGE section.
3694
3695 2002-10-25  Hans-Peter Nilsson  <hp@axis.com>
3696
3697         * simple.c: Correct placement of ATTRIBUTE_UNUSED.
3698
3699 2002-10-24  John David Anglin  <dave@hiauly1.hia.nrc.ca>
3700
3701         * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to
3702         unsigned int.  Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to
3703         unsigned int.
3704         (NAME(aout,final_link)): Cast enum used in assignment.
3705         (aout_link_write_symbols): Cast enums in comparisons, int values to
3706         boolean, enums in assignments to int.
3707         (aout_link_input_section_std): Cast rel->r_index to unsigned int.
3708         (aout_link_input_section_ext): Likewise.  Cast enums used in
3709         comparisons with unsigned ints.
3710         (aout_link_reloc_link_order): Cast enum to int in assignment.
3711         * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr
3712         calls to char *.
3713         * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in
3714         assignment.
3715         * bfd-in2.h (bfd_set_section_vma): Likewise.
3716         * bfd.c (bfd_record_phdr): Cast enums in assignments.
3717         * binary.c (bfd_alloc): Cast enum to long.
3718         * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean.
3719         * dwarf2.c (read_abbrevs): Add casts to enum types.
3720         (read_attribute_value): Likewise.
3721         (arange_add): Cast result of bfd_zalloc call.
3722         (comp_unit_contains_address): Return true and false.
3723         (comp_unit_find_nearest_line): Cast return to boolean.
3724         * format.c (bfd_check_format_matches, bfd_set_format): Likewise.
3725         * gen-aout.c: define macro '_' if not defined.
3726         * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR.
3727         (bfd_bwrite): Cast bfd_realloc to bfd_byte *.
3728         (bfd_write_bigendian_4byte_int): Cast return to boolean.
3729         (bfd_seek): Cast bfd_realloc to bfd_byte *.
3730         (bfd_generic_is_local_label_name): Cast return to boolean.
3731         * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'.
3732         * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to
3733         struct bfd_hash_entry *.
3734         (_bfd_generic_link_hash_newfunc): likewise.
3735         (_bfd_generic_final_link): Cast enum to unsigned int.
3736         * merge.c (sec_merge_emit): Cast return to boolean.
3737         (merge_strings): Add casts to const unsigned char *.
3738         * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int.
3739         (bfd_generic_get_relocated_section_content): Cast enum to unsigned int.
3740         * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result
3741         to struct bfd_hash_entry *.
3742         (bfd_set_section_content): Add cast to PTR in comparison.
3743         * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol,
3744         simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous,
3745         simple_dummy_unattached_reloc,
3746         bfd_simple_get_relocated_section_contents): Add K&R declarations and
3747         function definitions.
3748         * srec.c (S3Forced): Initialize to false.
3749         (srec_get_symtab): Cast return value from bfd_alloc to asymbol *.
3750         * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons.
3751         (_bfd_discard_section_stabs): Likewise.  Also cast return to boolean.
3752         * syms.c (bfd_is_undefined_symclass): Cast return to boolean.
3753         (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in
3754         comparisons.
3755
3756 2002-10-23  Jakub Jelinek  <jakub@redhat.com>
3757
3758         * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic
3759         relocs into shared lib non-allocated reloc sections.
3760
3761 2002-10-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
3762
3763         * dwarf2.c (add_line_info): Ensure that the line_info_table is
3764         sorted even when given an out-of-order line sequence.
3765         (lookup_address_in_line_info_table): When an exact VMA match is
3766         not found, return line information with the closest VMA.
3767
3768 2002-10-23 Ross Alexander <ross.alexander@uk.neceur.com>
3769
3770         * elf64-hppa.c: Force DT_FLAGS to always be set.  Required by
3771         HPUX 11.00 patch PHSS_26559.
3772
3773 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
3774
3775         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move
3776         the options section into a separate section unless IRIX 6
3777         compatibility is enabled.
3778
3779 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
3780
3781         * elflink.h (struct elf_link_sort_rela): Turn rel and rela
3782         into arrays.
3783         (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust.
3784         (elf_link_sort_relocs): Likewise.  Take int_rels_per_ext_rel
3785         into account.
3786         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose
3787         R_MIPS_REL32 with R_MIPS64 if ABI_64_P.
3788
3789 2002-10-21  Graeme Peterson  <gp@qnx.com>
3790
3791         * targets.c (_bfd_target_vector): Add missing qnx vectors.
3792
3793 2002-10-21  Alan Modra  <amodra@bigpond.net.au>
3794
3795         * targets.c (bfd_target_list): Don't return the default target twice.
3796
3797 2002-10-21  Elias Athanasopoulos  <eathan@otenet.gr>
3798
3799         * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace
3800         perror with bfd_perror.
3801
3802 2002-10-19  H.J. Lu <hjl@gnu.org>
3803
3804         * elflink.h (elf_link_add_object_symbols): Correctly handle
3805         DT_RPATH and DT_RUNPATH.
3806
3807 2002-10-19  Mark Kettenis  <kettenis@gnu.org>
3808
3809         * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes.
3810
3811 2002-10-17  Denis Chertykov  <denisc@overta.ru>
3812
3813         * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code
3814         for ip2k port.
3815
3816 2002-10-17  Alan Modra  <amodra@bigpond.net.au>
3817
3818         * elfxx-target.h (USE_REL): Don't define as 1.
3819         * elf32-arm.h (USE_REL): Provide a default define of 0.
3820         Use #if rather than #ifdef when testing USE_REL.
3821         * elf32-m32r.c: Likewise.
3822
3823         * elf32-arc.c (USE_REL): Define as 1.
3824         * elf32-d10v.c (USE_REL): Likewise.
3825         * elf32-m32r.c (USE_REL): Likewise.
3826         * elf32-m68hc11.c (USE_REL): Likewise.
3827         * elf32-m68hc12.c (USE_REL): Likewise.
3828         * elf32-or32.c (USE_REL): Likewise.
3829         * elfarm-nabi.c (USE_REL): Likewise.
3830
3831 2002-10-16  Jakub Jelinek  <jakub@redhat.com>
3832
3833         * config.bfd (s390-*-linux*): Add targ64_selvecs.
3834         (s390x-*-linux*): Add targ_selvecs.
3835
3836 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
3837
3838         * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,
3839         elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo,
3840         elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo,
3841         elf32-sh64-nbsd.lo, elf32-shqnx.lo.  Add elf32-qnx.lo.
3842         (BFD32_BACKENDS_CFILES): Likewise for corresponding C files.
3843         (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo.
3844         (BFD64_BACKENDS_CFILES): Likewise for corresponding C files.
3845         (SOURCE_HFILES): Add elf32-qnx.h.
3846         (BUILD_HFILES): Add bfdver.h.
3847         Run "make dep-am".
3848         * Makefile.in: Regenerate.
3849         * configure.in Update bfd vector dependencies.
3850         * configure: Regenerate.
3851         * elf32-i386-fbsd.c: Delete.  Move code to elf32-i386.c.
3852         * elf32-i386qnx.c: Likewise.
3853         * elf32-ppcqnx.c: Delete.  Move code to elf32-ppc.c.
3854         * elf32-sh-nbsd.c: Delete.  Move code to elf32-sh.c.
3855         * elf32-sh-lin.c: Likewise.
3856         * elf32-shqnx.c: Likewise.
3857         * elf32-sh64-lin.c: Delete.  Move code to elf32-sh64.c.
3858         * elf32-sh64-nbsd.c: Likewise.
3859         * elf64-sh64-lin.c: Delete.  Move code to elf64-sh64.c.
3860         * elf64-sh64-nbsd.c: Likewise.
3861         * elfarmqnx-nabi.c: Delete.  Move code to elfarm-nabi.c.
3862         * elf32-arm.h (ELF_MAXPAGESIZE): Always define.
3863         * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests.
3864         * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests.
3865         * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define.
3866         (elf_backend_is_contained_by_filepos): Likewise.
3867         (elf_backend_copy_private_bfd_data_p): Likewise.
3868         Globalize and move functions to..
3869         * elf32-qnx.c: ..here.  New file.
3870         * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests.  Don't
3871         emit target vectors when INCLUDE_SHMEDIA.
3872         * elf32-sh64.c: Remove ELF_ARCH test.  Move TARGET_* etc. defines to
3873         end of file.
3874         * elf64-sh64.c: Remove ELF_ARCH test.
3875         * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test.
3876         * po/BLD-POTFILES.in: Regenerate.
3877         * po/SRC-POTFILES.in: Regenerate.
3878
3879 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
3880
3881         * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects
3882         loaded with --just-symbols.
3883
3884         * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define.
3885         * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
3886         * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
3887         * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
3888
3889 2002-10-15  Richard Henderson  <rth@redhat.com>
3890
3891         * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd.
3892         (BFD64_BACKENDS_CFILES): Likewise.
3893         * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha.
3894         * elf64-alpha-fbsd.c: Remove file, move code ...
3895         * elf64-alpha.c: ... here.
3896         * Makefile.in, configure: Rebuild.
3897
3898 2002-10-14  Richard Henderson  <rth@redhat.com>
3899
3900         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment
3901         VALUE, not ADDEND.
3902
3903 2002-10-14  Stephen Clarke <stephen.clarke@superh.com>
3904
3905         * elf32-sh.c (elf_sh_link_hash_entry): Replace
3906         datalabel_got_offset with union of datalabel_got
3907         offset and refcount.
3908         (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount.
3909         (allocate_dynrelocs): Delete unnecessary code for
3910         STT_DATALABEL type.  Create entry in got for
3911         datalabel version of symbol if datalabel_got.refcount > 0.
3912         (sh_elf_relocate_section): Use datalabel_got union.
3913         (sh_elf_gc_sweep_hook): Pull common code to initialize
3914         h and eh out of switch statement.  Declare seen_stt_datalabel.
3915         Initialize it.  Decrement datalabel_got.refcount for
3916         got relocs when seen_stt_datalabel is true.
3917         Decrement local_got_refcounts entry for datalabel got relocs
3918         of local symbols.
3919         (sh_elf_copy_indirect_symbol): Copy datalabel_got field over.
3920         (sh_elf_check_relocs): Declare seen_stt_datalabel.
3921         Initialize it.  When seen_stt_datalabel is true, increment
3922         datalabel_got refcount rather than got.refcount.
3923         (sh_elf_finish_dynamic_symbol): Create relocs to
3924         initialize got entry for datalabel version of symbol.
3925
3926 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
3927
3928         * Makefile.am: Run "make dep-am".
3929         (BFD_H_FILES): Remove version.h.
3930         * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move..
3931         * version.h: ..to here.
3932         * configure.in (bfd_version_date): Remove.
3933         (AC_OUTPUT): Make bfdver.h from version.h.
3934         * bfd.c: #include "bfdver.h".
3935         * vms-hdr.c: Likewise.
3936         * Makefile.in: Regenerate.
3937         * bfd-in2.h: Regenerate.
3938         * configure: Regenerate.
3939         * po/SRC-POTFILES.in: Regenerate.
3940
3941 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
3942
3943         * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
3944         bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
3945         bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
3946         bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
3947         bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
3948         bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
3949         bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
3950         bfd_mach_ip2022, bfd_mach_ip2022ext,
3951         bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
3952         * bfd-in2.h: Regenerate.
3953
3954 2002-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3955
3956         * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative
3957         endian vector to targ_selvecs.
3958
3959 2002-10-13  Alexandre Oliva  <aoliva@redhat.com>
3960
3961         * elfxx-mips.c (mips_elf_calculate_relocation): Take
3962         save_addend argument.  Don't apply the 32-bit mask to a
3963         GPREL32 value if it's to be used in another relocation.  Don't
3964         use forced-check computation of local_p to decide whether to
3965         add gp0 to GPREL16 value.  Don't use only the lowest 16 bits
3966         of the addend of a non-in-place GPREL16 relocation.
3967         (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to
3968         mips_elf_calculate_relocation().
3969
3970 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
3971
3972         * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs
3973         with symbols in other sections if we relaxed something;  the sections
3974         output offsets must be re-computed before.
3975
3976 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
3977
3978         * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols
3979         handling to use Elf_Internal_Sym.
3980         (m68hc11_elf_relax_delete_bytes): Likewise.
3981
3982 2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3983
3984         * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,
3985         sh_elf_object_p, dtpoff_base): New functions.
3986         (sh_elf_howto_table): Add TLS relocs.
3987         (sh_reloc_map): Likewise.
3988         (sh_elf_info_to_howto): Support TLS relocs.
3989         (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32.
3990         (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type):
3991         New macros.
3992         (sh_elf_obj_tdata): New.
3993         (elf_sh_link_hash_table): Add tls_ldm_got.
3994         (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got.
3995         (allocate_dynrelocs): Support TLS relocs.
3996         (sh_elf_size_dynamic_sections): Likewise.
3997         (sh_elf_relocate_section): Support TLS relocs.  Don't try to find
3998         .rela.got section when found already.  Return false after printing
3999         error about unresolvable relocation.
4000         (sh_elf_gc_sweep_hook): Support TLS relocs.
4001         (sh_elf_check_relocs): Likewise.
4002         (sh_elf_finish_dynamic_symbol): Likewise.
4003         (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case.
4004         * reloc.c: Add SH TLS relocs.
4005         * bfd-in2.h, libbfd.h: Regenerate.
4006
4007 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
4008
4009         * Makefile.in: Regenerated.
4010
4011 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
4012
4013         * Makefile.am: Run dep-am.
4014         (BFD_H_DEP): Add simple.c and linker.c.
4015         (BFD32_LIBS): Add simple.lo.
4016         (BFD32_LIBS_CFILES): Add simple.c.
4017         * Makefile.in: Regenerated.
4018         * bfd-in2.h: Regenerated.
4019         * simple.c: New file.
4020
4021 2002-10-11  Alan Modra  <amodra@bigpond.net.au>
4022
4023         * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers.
4024         (record_thumb_to_arm_glue): Likewise.
4025         * ecoff.c (ecoff_link_add_externals): Likewise.
4026         * elf32-arm.h (record_arm_to_thumb_glue): Likewise.
4027         (record_thumb_to_arm_glue): Likewise.
4028         * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
4029         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
4030         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
4031         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
4032         * elf64-ppc.c (func_desc_adjust): Likewise.
4033         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
4034         (sh64_elf64_create_dynamic_sections): Likewise.
4035         * elflink.c (_bfd_elf_create_got_section): Likewise.
4036         (_bfd_elf_create_dynamic_sections): Likewise.
4037         (_bfd_elf_create_linker_section): Likewise.
4038         * elflink.h (elf_add_default_symbol): Likewise.
4039         (elf_link_create_dynamic_sections): Likewise.
4040         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
4041         * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise.
4042         * elfxx-mips.c (mips_elf_create_got_section): Likewise.
4043         (_bfd_mips_elf_add_symbol_hook): Likewise.
4044         (_bfd_mips_elf_create_dynamic_sections): Likewise.
4045         * linker.c (generic_link_add_symbol_list): Likewise.
4046         * xcofflink.c (xcoff_link_add_symbols): Likewise.
4047
4048         * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define.
4049
4050         * elf64-ppc.c (edit_opd): Only zero opd syms when function is
4051         completely removed.  Correct local sym adjustment.
4052
4053 2002-10-10  Stephen Clarke <stephen.clarke@superh.com>
4054
4055         * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
4056         Correct mistake in calculation of address of .got.
4057         * elf64-sh64.c (elf_sh64_pic_plt_entry_be,
4058         elf_sh64_pic_plt_entry_le): Likewise.
4059
4060 2002-10-09  Richard Shann <richard.shann@superh.com>
4061             Stephen Clarke <stephen.clarke@superh.com>
4062
4063         * Makefile.am: Add entries for elf32-sh64-lin.c and
4064         elf64-sh64-lin.c. Regenerate.
4065         * Makefile.in: Regenerate.
4066         * config.bfd: Change sh64eb-*-linux* and sh64-*-linux*
4067         to use sh64 vectors rather than sh vectors.
4068         * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
4069         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
4070         * configure: Regenerate.
4071         * elf32-sh64-lin.c: New file.
4072         * elf64-sh64-lin.c: New file.
4073         * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
4074         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
4075
4076 2002-10-08  H.J. Lu <hjl@gnu.org>
4077
4078         * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
4079         IE->LE transition for R_386_TLS_IE.
4080
4081 2002-10-08  Alan Modra  <amodra@bigpond.net.au>
4082
4083         * elf64-ppc.c (edit_opd): Correct test for discarded sections.
4084
4085 2002-10-07  Mark Elbrecht  <snowball3@softhome.net>
4086
4087         * cofflink.c (mark_relocs): Don't mark relocations in excluded
4088         sections.
4089
4090 2002-10-07  Alan Modra  <amodra@bigpond.net.au>
4091
4092         * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent
4093         code.
4094
4095         * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx.
4096
4097 2002-10-06  Alan Modra  <amodra@bigpond.net.au>
4098
4099         * opncls.c: Formatting.
4100         (_bfd_new_bfd): Use a smaller section hash table.
4101
4102 2002-10-05  Alexandre Oliva  <aoliva@redhat.com>
4103
4104         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type
4105         of the other two relocations packed with a REL32 to NONE.
4106
4107 2002-10-02  Stephen Clarke <stephen.clarke@superh.com>
4108
4109         * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
4110         (sh_elf_link_hash_newfunc): Initialize it.
4111         (allocate_dynrelocs): Transfer gotplt refs from plt.refcount
4112         to got.refcount for symbols that are forced local or when
4113         we have direct got refs.
4114         (sh_elf_gc_sweep_hook): Adjust gotplt_refcount.  Use it
4115         to correctly adjust got.refcount and plt.refcount.
4116         (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across.
4117         (sh_elf_check_relocs): Increment gotplt_refcount.
4118
4119 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
4120
4121         * elf32-i386.c (elf_i386_relocate_section): Fix
4122         movl foo@indntpoff, %eax IE->LE transition.
4123
4124 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
4125
4126         * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD
4127         sequence and its transitions.
4128
4129 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
4130
4131         * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
4132         to st_value + addend in non-code sections.
4133         * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
4134         R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
4135
4136 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
4137             Ken Raeburn  <raeburn@cygnus.com>
4138             Aldy Hernandez  <aldyh@redhat.com>
4139             Eric Christopher  <echristo@redhat.com>
4140             Richard Sandiford  <rsandifo@redhat.com>
4141
4142         * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
4143         (bfd_mach_mips5500): New.
4144         * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New.
4145         (arch_info_struct): Add corresponding entries here.
4146         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120,
4147         E_MIPS_MACH_5400 and E_MIPS_MACH_5500.
4148         (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120,
4149         bfd_mach_mips5400 and bfd_mach_mips5500.
4150         (_bfd_mips_elf_mach_extends_p): New function.
4151         (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge
4152         the EF_MIPS_MACH flags.
4153         * bfd-in2.h: Regenerate.
4154
4155 2002-09-28  Jason Thorpe  <thorpej@wasabisystems.com>
4156
4157         * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip
4158         .got sections.
4159
4160 2002-09-28  Alan Modra  <amodra@bigpond.net.au>
4161
4162         * elf.c (map_sections_to_segments): Correct test for start of
4163         writable section in the same page as end of read-only section.
4164
4165 2002-09-27  Matt Thomas  <matt@3am-software.com>
4166
4167         * elf32-vax.c (elf_vax_check_relocs): Remove unused
4168         local_got_refcounts usage.  Remove allocation of got slot.
4169         (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage.
4170         Remove de-allocation of got slot.
4171         (elf_vax_size_dynamic_section): Fix some indentation.  Add hash
4172         traversal for elf_vax_instantiate_got_entries.  Allow empty .got
4173         sections to be GC'ed.
4174         (elf_vax_instantiate_got_entries): New function.
4175         (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling.  Remove
4176         tests that are now handled by elf_vax_instantiate_got_entries.
4177         Assert GOT entry falls within .got section size.  Remove redundant
4178         comparisions.  Fix comments.
4179
4180 2002-09-27  Jakub Jelinek  <jakub@redhat.com>
4181
4182         * reloc.c: Add x86-64 TLS relocs.
4183         * bfd-in2.h, libbfd.h: Rebuilt.
4184         * elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit
4185         relocs.  Add TLS relocs.
4186         (x86_64_reloc_map): Add TLS relocs.
4187         (elf64_x86_64_info_to_howto): Adjust for added TLS relocs.
4188         (struct elf64_x86_64_link_hash_entry): Add tls_type field.
4189         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define.
4190         (elf64_x86_64_hash_entry): Define.
4191         (struct elf64_x86_64_obj_tdata): New.
4192         (elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define.
4193         (struct elf64_x86_64_link_hash_table): Add tls_ld_got.
4194         (link_hash_newfunc): Initialize tls_type.
4195         (elf64_x86_64_link_hash_table_create): Initialize tls_ld_got.
4196         (elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary.
4197         (elf64_x86_64_mkobject): New.
4198         (elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata.
4199         (elf64_x86_64_tls_transition): New.
4200         (elf64_x86_64_check_relocs): Add r_type variable and use it.
4201         Handle TLS relocs.
4202         (elf64_x86_64_gc_sweep_hook): Handle TLS relocs.
4203         (allocate_dynrelocs): Allocate GOT space for TLS relocs.
4204         (elf64_x86_64_size_dynamic_sections): Likewise.
4205         (dtpoff_base, tpoff): New.
4206         (elf64_x86_64_relocate_section): Handle TLS relocs.
4207         (elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT
4208         entries.
4209         (bfd_elf64_mkobject): Define.
4210
4211         * elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set
4212         DF_STATIC_TLS if shared.
4213
4214 2002-09-26  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4215
4216         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Don't emit unneeded
4217         empty relocation sections.
4218
4219 2002-09-26  Alan Modra  <amodra@bigpond.net.au>
4220
4221         * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here.
4222         (ppc64_elf_build_stubs): Build them here instead.
4223
4224 2002-09-24  Jakub Jelinek  <jakub@redhat.com>
4225
4226         * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE
4227         addend into r_addend, not *r_offset.
4228         (elf32_sparc_finish_dynamic_symbol): Likewise.
4229         * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at
4230         R_SPARC_RELATIVE's r_offset.
4231
4232 2002-09-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
4233
4234         * dwarf2.c (decode_line_info): Update to correctly decode
4235         the (non-standard DWARF2) out-of-order address sequences
4236         generated by the Intel C++ 6.0 compiler for ia64-Linux.
4237
4238 2002-09-23  Mark Elbrecht  <snowball3@softhome.net>
4239
4240         * config.bfd: For DJGPP targets, match with any cpu and any machine.
4241
4242 2002-09-23  Alan Modra  <amodra@bigpond.net.au>
4243
4244         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs
4245         for discarded FDEs.  Remove redundant assignment.
4246         * elflink.h (elf_bfd_discard_info): Save edited relocs.
4247
4248 2002-09-22  H.J. Lu <hjl@gnu.org>
4249
4250         * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge
4251         the relocation count between different .reloc sections.
4252
4253 2002-09-21  Alan Modra  <amodra@bigpond.net.au>
4254
4255         * elf32-ppc.c (ppc_elf_relocate_section): Allow ".sbss.*" and
4256         ".sdata.*" for R_PPC_SDAREL16, ".sbss2*" and ".sdata2*" for
4257         R_PPC_EMB_SDA2REL.  Similarly for R_PPC_EMB_SDA21 and
4258         R_PPC_EMB_RELSDA.
4259
4260         * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount"
4261         unsigned.  Move "symcount" assignment out of loop.
4262         * Makefile.am: Run "make dep-am".
4263         * Makefile.in: Regenerate.
4264         * configure: Regenerate.
4265         * po/SRC-POTFILES.in: Regnerate.
4266
4267 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
4268
4269         * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is
4270         zero, set it to 8 for (non-standard) 64-bit DWARF2 formats
4271         (e.g. IRIX64).
4272
4273 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
4274
4275         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word
4276         even if generating R_PPC_RELATIVE reloc.
4277         (ppc_elf_relocate_section): Make sure relocation is performed
4278         if skip == -2.  Clear memory at r_offset when creating dynamic
4279         relocation.
4280
4281 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
4282
4283         * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE,
4284         BFD_RELOC_386_TLS_GOTIE): Add.
4285         * bfd-in2.h, libbfd.h: Rebuilt.
4286         * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE
4287         and R_386_TLS_GOTIE.
4288         (elf_i386_reloc_type_lookup): Handle it.
4289         (struct elf_i386_link_hash_entry): Change tls_type type to unsigned
4290         char instead of enum, change GOT_* into defines.
4291         (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define.
4292         (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
4293         (elf_i386_check_relocs): Likewise.  Avoid crash if local symbol is
4294         accessed both as normal and TLS symbol.  Move R_386_TLS_LDM and
4295         R_386_PLT32 cases so that R_386_TLS_IE can fall through.
4296         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
4297         (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
4298         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
4299         (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if
4300         tls_type is GOT_TLS_IE_BOTH.
4301         (elf_i386_size_dynamic_sections): Likewise.
4302         (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
4303         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
4304         (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch
4305         all 4 GOT_TLS_* TLS types.
4306
4307 2002-09-19  Nick Clifton  <nickc@redhat.com>
4308
4309         * elflink.h (elf_fix_symbol_flags): When examining weak symbols,
4310         follow indirect links.
4311
4312 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
4313
4314         * ecoffswap.h (ecoff_swap_pdr_in) <isym, iline>: Update to
4315         correctly sign-extend 32-bit ECOFF null values (0xffffffff, -1)
4316         on 64 bit machines.
4317         (ecoff_swap_sym_in) <iss>: Likewise.
4318         * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Fix error reading
4319         ECOFF information: 'ioptMax' refers to the actual *size*
4320         of the optimization symtab, not the number of entries.
4321
4322 2002-09-19  Daniel Jacobowitz  <drow@mvista.com>
4323
4324         * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update
4325         ELF_LINK_HASH_NEEDS_PLT logic.
4326
4327 2002-09-18  Daniel Jacobowitz  <drow@mvista.com>
4328
4329         * elfcode.h (elf_slurp_reloc_table_from_section): Check
4330         correct relocation count.
4331
4332 2002-09-17  Daniel Jacobowitz  <drow@mvista.com>
4333
4334         * bfd-in.h (bfd_get_dynamic_symcount): Define.
4335         * bfd.c (struct _bfd): Add dynsymcount.
4336         * bfd-in2.h: Regenerated.
4337         * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set
4338         abfd->dynsymcount.
4339         * elfcode.h (elf_slurp_reloc_table_from_section): Check
4340         for overflow.
4341
4342 2002-09-17  Stan Cox <scox@redhat.com>
4343
4344         * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
4345         (mips_elf64_final_gp): Don't make up gp value.
4346         * elfn32-mips.c (mips_elf_final_gp): Likewise.
4347         * elfxx-mips.c (_bfd_mips_elf_final_link): Always create
4348         .MIPS.options/.options section.
4349
4350 2002-09-17  David O'Brien  <obrien@FreeBSD.org>
4351
4352         * elf32-i386-fbsd.c: Always label using the EI_OSABI method.
4353         It is benign for FreeBSD < 4.1.  Minor reformatting.
4354         * elf64-alpha-fbsd.c: Likewise.
4355
4356 2002-09-17  Jakub Jelinek  <jakub@redhat.com>
4357
4358         * elf32-i386.c (elf_i386_relocate_section) [R_386_TLS_TPOFF32]: Negate
4359         addend.
4360
4361 2002-09-17  Alan Modra  <amodra@bigpond.net.au>
4362
4363         * elf64-alpha.c (alpha_elf_size_info): Make static.
4364
4365 2002-09-17  Svein E. Seldal  <Svein.Seldal@solidas.com>
4366
4367         * coff-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED.
4368         * cpu-tic4x.c: Ditto.
4369
4370 2002-09-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4371
4372         * elf64-mips.c (define elf_backend_ignore_discarded_relocs): Remove
4373         duplicate define.
4374
4375 2002-09-16  Bruno Haible  <bruno@clisp.org>
4376
4377         * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included
4378         by a target variant implementation.
4379         * elf64-alpha.c: Likewise.
4380         * elf32-i386-fbsd.c: New file.
4381         * elf64-alpha-fbsd.c: New file.
4382         * targets.c: Support bfd_elf32_i386_freebsd_vec and
4383         bfd_elf64_alpha_freebsd_vec.
4384         * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec,
4385         bfd_elf64_alpha_freebsd_vec.
4386         * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo.
4387         (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c.
4388         (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo.
4389         (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c.
4390         (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies.
4391         * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD
4392         specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate.
4393
4394 2002-09-12  Jakub Jelinek  <jakub@redhat.com>
4395
4396         * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is
4397         NULL.
4398         (elf_i386_relocate_section): Return false after printing error about
4399         unresolvable relocation.
4400
4401 2002-09-12  Nick Clifton  <nickc@redhat.com>
4402
4403         * elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of
4404         R_ARM_THM_PC11.
4405
4406 2002-09-11  Jeffrey Law  <law@redhat.com>
4407
4408         * elf32-h8300.c (elf32_h8_relax_section): Fix typo.
4409
4410 2002-09-11  Andrew Haley  <aph@cambridge.redhat.com>
4411
4412         * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and
4413         line_ptr before deciding we've found a symbol.
4414
4415 2002-09-11  Nick Clifton  <nickc@redhat.com>
4416
4417         * po/da.po: New Danish translation file.
4418         * configure.in (LINGUAS): Add 'da'.
4419         * configure: Regenerate.
4420
4421 2002-09-10  Michael Snyder  <msnyder@redhat.com>
4422
4423         * irix-core.c (do_sections, do_sections64): New functions.
4424         (irix_core_core_file_p): Call new functions do_sections,
4425         do_sections64, depending on corefile (32-bit or 64-bit).
4426
4427 2002-09-09  Richard Henderson  <rth@redhat.com>
4428
4429         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21M
4430         and PCREL21F like PCREL21B.
4431
4432 2002-09-04  Kevin Buettner  <kevinb@redhat.com>
4433
4434         * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
4435         vector.
4436
4437 2002-09-02  Nick Clifton  <nickc@redhat.com>
4438
4439         * elf32-v850.c (v850_elf_final_link_relocate): Use helpful
4440         names instead of cryptically overloaded bfd_reloc error
4441         codes.
4442         (v850_elf_relocate_section): Likewise.
4443         (v850_elf_relax_section): Replace caching of external symbols
4444         with caching of internal symbols obtained from calling
4445         bfd_elf_get_elf_syms().
4446         Fixup problems with freeing cached allocated memory blocks.
4447
4448 2002-09-02  Alan Modra  <amodra@bigpond.net.au>
4449
4450         * cpu-pj.c (scan_mach, compatible, arch_info_struct): Remove.
4451         (bfd_pj_arch): Use bfd_default_scan.
4452         * cpu-v850.c (scan): Remove.
4453         (N): Use bfd_default_scan.
4454         * cpu-z8k.c (scan_mach): Remove.
4455         (arch_info_struct, bfd_z8k_arch): Reorganize so that the default is
4456         first.  Use bfd_default_scan.
4457
4458         * ecoff.c (_bfd_ecoff_set_arch_mach_hook): Don't use hard-coded
4459         bfd_mach constants.
4460         (ecoff_get_magic): Likewise.
4461         * elf32-v850.c (v850_elf_object_p): Likewise.
4462         (v850_elf_final_write_processing): Likewise.
4463         * mipsbsd.c (MY(set_arch_mach)): Likewise.
4464         (MY(write_object_contents)): Likewise.
4465         * coff64-rs6000.c (xcoff64_write_object_contents): Likewise.
4466         * coffcode.h (coff_write_object_contents): Likewise.
4467         (coff_set_arch_mach_hook): Add comment describing machine == 0.
4468         Remove unnecessary "machine" assignments.
4469         (coff_write_relocs): Test for the absolute section sym by testing
4470         section and flags.
4471
4472         * aoutx.h (NAME(aout,machine_type)): Recognize bfd_mach_i386_i386
4473         and bfd_mach_i386_i386_intel_syntax.
4474         * pdp11.c (NAME(aout,machine_type)): Likewise.
4475
4476 2002-08-30  John David Anglin  <dave@hiauly1.hia.nrc.ca>
4477
4478         * bfd-in.h (align_power): Cast constants to bfd_vma type.
4479         * bfd-in2.h (align_power): Likewise.
4480
4481 2002-08-30  Alan Modra  <amodra@bigpond.net.au>
4482
4483         * Makefile.am: Run "make dep-am".
4484         * Makefile.in: Regenerate.
4485
4486         * cpu-avr.c (compatible): Don't use hard-coded mach constants.
4487         * cpu-powerpc.c (powerpc_compatible): Likewise.
4488         * cpu-rs6000.c (rs6000_compatible): Likewise.
4489
4490 2002-08-28  Catherine Moore  <clm@redhat.com>
4491
4492         * elf32-v850.c (v850_elf_reloc_map): Add new relocs.
4493         (v850-elf-reloc): Don't resolve pc relative relocs.
4494         (v850_elf_ignore_reloc): New routine.
4495         (v850_elf_final_link_relocate): Handle new relocs.
4496         (v850_elf_relax_delete_bytes ): New routine.
4497         (v850_elf_relax_section): New routine.
4498         (bfd_elf32_bfd_relax_section): Define.
4499         (HOWTO): New entries for new relocs.
4500         * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc.
4501         (BFD_RELOC_V850_LONGJUMP): New reloc.
4502         (BFD_RELOC_V850_ALIGN): New reloc.
4503         * archures.c: Remove redundant v850ea architecture.
4504         * cpu-v850.c: Remove redundant v850ea support.
4505         * libbfd.h: Regenerate.
4506         * bfd-in2.h: Regenerated.
4507
4508 2002-08-28  Svein E. Seldal  <Svein.Seldal@solidas.com>
4509
4510         * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target.
4511         * configure.in: Add tic4x_coff vector files.
4512         * configure: Regenerate.
4513         * Makefile.am: Add tic4x target.
4514         * Makefile.in: Regenerate.
4515
4516 2002-08-27  Michael Hayes <m.hayes@elec.canterbury.ac.nz>
4517
4518         * archures.c: Add the BFD arch type tic4x.
4519         * bfd-in.h: Add BFD_IN_MEMORY flag.
4520         * coff-tic4x.c: New file.
4521         * coffswap.h (coff_swap_sym_out): Add preadjuster.
4522         * cpu-tic4x.c: New file.
4523         * targets.c: Added tic4x- in list of xvecs.
4524         * ticoff.h: New file.
4525         * bfd-in2.h: Regenerate.
4526
4527 2002-08-27  Adam Nemet  <anemet@lnxw.com>
4528
4529         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last
4530         bit of DT_INIT and DT_FINI for Thumb functions.
4531
4532 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
4533
4534         * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC.
4535
4536 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
4537
4538         * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8.
4539
4540 2002-08-24  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4541
4542         * elf32-sh.c (sh_elf_copy_indirect_symbol): New.
4543         (create_got_section, allocate_dynrelocs, readonly_dynrelocs):
4544         Likewise.
4545         (struct elf_sh_pcrel_relocs_copied): Removed.
4546         (struct elf_sh_dyn_relocs): New.
4547         (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied
4548         field with dyn_relocs.
4549         (struct elf_sh_link_hash_table): Add short-cuts to get dynamic
4550         sections and sym_sec.
4551         (sh_elf_link_hash_newfunc): Clear dyn_relocs.
4552         (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec.
4553         (sh_elf_create_dynamic_sections): Use create_got_section instead
4554         of _bfd_elf_create_got_section.
4555         (sh_elf_check_relocs): Likewise.
4556         (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic
4557         sections.
4558         (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections,
4559         sh_elf_relocate_section, sh_elf_check_relocs,
4560         sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections):
4561         Likewise.
4562         (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the
4563         dynamic relocations and avoiding the copy relocation when we
4564         didn't find any dynamic relocations in the section which has
4565         contents or is read-only.
4566         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
4567         (sh_elf_size_dynamic_sections): Don't reset the size of
4568         .rela.got section even if dynamic_sections_created flag is off.
4569         Don't use sh_elf_discard_copies. Scan all input bfd and use
4570         allocate_dynrelocs. Call readonly_dynrelocs to determine
4571         whether we need DT_TEXTREL.
4572         (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine
4573         whether the symbol was never referred to.
4574         (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL.
4575         (sh_elf_gc_sweep_hook): Fill with the real sweep function.
4576         (sh_elf_check_relocs): Call create_got_section if the short-cut
4577         to .got is null. Increment reference counters only instead of
4578         allocating space on dynamic sections here. Don't conditionalize
4579         uninitialized got.offset value when marking the symbol as a
4580         global offset table entry. Keep relocations for symbols satisfied
4581         by a dynamic library to avoid copy relocations for the symbol.
4582         Set dynobj field of an elf hash table if needed.
4583         (sh_elf_finish_dynamic_sections): Handle null section pointer
4584         correctly.
4585         (elf_backend_copy_indirect_symbol): Defined.
4586         (elf_backend_can_refcount): Defined.
4587
4588 2002-08-23  Nick Clifton  <nickc@redhat.com>
4589
4590         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo
4591         previous change.  Add comment explaining why.
4592
4593 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
4594
4595         * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy
4596         contents of .got.plt[2] to tr0, not address of .got.plt.
4597         (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when
4598         patching absolute plt entry. For shmedia plt entry, set bottom bit
4599         of branch to plt0 as this is a branch to an shmedia instruction.
4600         * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le):
4601         Copy contents of .got.plt[2] to tr0, not address of .got.plt.
4602         (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to
4603         branch to plt0.
4604         (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when
4605         patching absolute plt entry. For shmedia plt entry, branch to
4606         plt0 is now ptrel, so use relative offset.  Set bottom bit of
4607         branch target as it is a branch to an shmedia instruction.
4608
4609 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>,
4610             Richard Shann <richard.shann@superh.com>
4611
4612         * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
4613         value if .init is an SHmedia function.  Similarly for DT_FINI.
4614         * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
4615
4616 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
4617
4618         * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
4619         dynamic section.
4620         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
4621
4622 2002-08-22  Kaz Kojima <kkojima@rr.iij4u.or.jp>
4623
4624         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
4625         byte read when reading the return address register column.
4626
4627 2002-08-22  Nick Clifton  <nickc@redhat.com>
4628
4629         * config.bfd: Add powepc64-*-*bsd* target.
4630
4631 2002-08-22  Graeme Peterson  <gp@qnx.com>
4632
4633         * Makefile.am: Add entries for elf32-shqnx.c
4634         * Makefile.in: Regenerate.
4635         * config.bfd: Add support sh-*-nto* target.
4636         * configure.in: Add support for bfd_elf32_sh{l}qnx_vec.
4637         * configure: Regenerate.
4638         * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" .
4639         * elf32-sh.c: Do not include elf32-target.h if
4640         ELF32_SH_C_INCLUDED is defined.
4641         * elf32-shqnx.c: New file: Support for QNX.
4642         * targets.c: Add bfd_elf32_sh{l}qnx_vec.
4643
4644 2002-08-22  Nick Clifton  <nickc@redhat.com>
4645
4646         * po/tr.po: Updated Turkish translation.
4647
4648         * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the
4649         symbols are not read.
4650
4651 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
4652
4653         * elf32-m68hc11.c: Formatting fixes.
4654         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
4655         * elf32-m68hc12.c: Formatting fixes.
4656         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
4657
4658 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
4659
4660         * coff-rs6000.c (rs6000coff_vec <object_flags>): Add SEC_CODE and
4661         SEC_DATA.
4662         (pmac_xcoff_vec): Likewise.
4663         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
4664         (aix5coff64_vec): Likewise.
4665
4666 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
4667
4668         * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data
4669         param to elf_backend_copy_indirect_symbol.
4670         (_bfd_elf_link_hash_copy_indirect): Likewise.
4671         * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust
4672         calls to copy_indirect_symbol.
4673         * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
4674         * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
4675         * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
4676         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
4677         * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
4678         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise.
4679         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
4680         * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
4681         * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise.
4682         * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise.  Properly
4683         test refcounts for "used" values.
4684
4685 2002-08-21  John David Anglin  <dave@hiauly1.hia.nrc.ca>
4686
4687         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to
4688         argument declaration.
4689
4690 2002-08-19  Elena Zannoni <ezannoni@redhat.com>
4691
4692         * archures.c (bfd_mach_ppc_e500): Added.
4693         * bfd-in2.h: Rebuilt.
4694         * cpu-powerpc.c (bfd_powerpc_archs): Added e500.
4695
4696 2002-08-19  Alan Modra  <amodra@bigpond.net.au>
4697
4698         * elf32-m68hc12.c (elf_backend_can_gc_sections): False.
4699
4700 2002-08-17  Andrew Cagney  <ac131313@redhat.com>
4701
4702         * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
4703         `bfd_byte'.
4704
4705 2002-08-17  Stan Cox  <scox@redhat.com>
4706
4707         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the
4708         IRIX 6 segment layout for NEWABI.
4709
4710 2002-08-16  Stephen Clarke <stephen.clarke@superh.com>
4711
4712         * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
4713         symbols when looking for section referred to by a relocation.
4714         * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
4715
4716 2002-08-15  Alan Modra  <amodra@bigpond.net.au>
4717
4718         * elf32-i370.c: Move reloc enum to include/elf/i370.h.
4719
4720 2002-08-15  Hans-Peter Nilsson  <hp@axis.com>
4721
4722         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add
4723         missing check for whether the symbol is referenced by DSO before
4724         unexporting it as an unneeded dynamic symbol.
4725
4726 2002-08-14  H.J. Lu <hjl@gnu.org>
4727
4728         * libbfd.h: Regenerate.
4729
4730 2002-08-14  H.J. Lu <hjl@gnu.org>
4731
4732         * config.bfd: Always add 64bit vectors to 32bit Linux/mips.
4733
4734 2002-08-14  Stephane Carrez  <stcarrez@nerim.fr>
4735
4736         * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of
4737         instructions.
4738         (m68hc11_direct_relax): New to define table of relaxable instructions.
4739         (find_relaxable_insn): New, find a relaxable insn.
4740         (compare_reloc): New to compare two relocs.
4741         (m68hc11_elf_relax_section): New, relax text sections.
4742         (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs.
4743         (elf32_m68hc11_check_relocs): New function for GC support.
4744         (elf32_m68hc11_relocate_section): New function for GC support.
4745         (bfd_elf32_bfd_relax_section): Define to support linker relaxation.
4746         (elf_backend_check_relocs): Likewise.
4747         (elf_backend_relocate_section): Likewise.
4748
4749 2002-08-13  H.J. Lu <hjl@gnu.org>
4750
4751         * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count
4752         definitions in shared objects when checking symbol with
4753         undefined version.
4754
4755 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
4756
4757         * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC.
4758         (elf32_m68hc11_gc_sweep_hook): Likewise.
4759         (elf_backend_gc_mark_hook): Define for GC section support.
4760         (elf_backend_gc_sweep_hook): Likewise.
4761         (elf_backend_can_gc_sections): Likewise.
4762
4763         * elf32-m68hc12.c: Likewise.
4764
4765 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
4766
4767         * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New.
4768         (_bfd_m68hc11_elf_merge_private_bfd_data): New function.
4769         (_bfd_m68hc11_elf_set_private_flags): New function.
4770         Use them to set/check/print ELF flags specific to 68HC11.
4771
4772         * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New.
4773         (_bfd_m68hc12_elf_merge_private_bfd_data): New function.
4774         (_bfd_m68hc12_elf_set_private_flags): New function.
4775         Use them to set/check/print ELF flags specific to 68HC12.
4776
4777 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
4778
4779         * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs;
4780         fix masks for PC-rel relocs.
4781         (m68hc11_elf_ignore_reloc): New function.
4782
4783         * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific
4784         68HC12 banked addressing relocs.
4785         (m68hc12_phys_addr): New to compute physical address of banked memory.
4786         (m68hc12_phys_page): Likewise for page.
4787         (m68hc12_addr_is_banked): New to see if address is in banked area.
4788         (elf_m68hc12_howto_table): Add new relocs and rename to xx12.
4789
4790 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
4791
4792         * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP,
4793         BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE,
4794         BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12.
4795         * bfd-in2.h: Regenerate.
4796
4797 2002-08-12  H.J. Lu <hjl@gnu.org>
4798
4799         * elflink.h (elf_add_default_symbol): Preserve section across
4800         elf_merge_symbol.
4801
4802 2002-08-09  Graeme Peterson  <gp@qnx.com>
4803
4804         * Makefile.am: Add entries for elf32-ppcqnx.c, and add
4805         elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c.
4806         * Makefile.in: Regenerate.
4807         * config.bfd: Add support for powerpc{le}-*-nto targets.
4808         * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec.
4809         * configure: Regenerate.
4810         * elf32-i386qnx.c: Moved backend functions into a QNX specific
4811         common file "elf32-qnx.h", and now include that file.
4812         * elf32-qnx.h: New file: QNX specific common elf backend.
4813         * elf32-ppc.c: Do not include elf32-target.h if
4814         ELF32_PPC_C_INCLUDED is defined.
4815         * elf32-ppcqnx.c: New file: Support for QNX.
4816         * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend.
4817         * targets.c: Add bfd_elf32_powerpc{le}qnx_vec.
4818
4819 2002-08-09  Nick Clifton  <nickc@redhat.com>
4820
4821         * po/sv.po: Updated Swedish translation.
4822
4823 2002-08-09  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4824
4825         * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if
4826         g->global_gotsym is NULL.
4827
4828 2002-08-08  H.J. Lu <hjl@gnu.org>
4829
4830         * elflink.h (elf_add_default_symbol): Don't warn if a definition
4831         overrides an indirect versioned symbol.
4832
4833 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
4834
4835         * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
4836         for R_386_TLS_TPOFF32 relocs against symndx 0.
4837
4838 2002-08-07  H.J. Lu <hjl@gnu.org>
4839
4840         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol
4841         with undefined version if needed.
4842         (elf_link_assign_sym_version): Match a default symbol with a
4843         version without definition. No need to hide the default
4844         definition separately.
4845
4846 2002-08-08  Alan Modra  <amodra@bigpond.net.au>
4847
4848         * elflink.h (elf_link_output_extsym): Don't output symbols from
4849         SEC_EXCLUDE sections.
4850
4851         * aoutx.h (aout_link_write_symbols): Correct handling of warning syms.
4852
4853 2002-08-07  Alan Modra  <amodra@bigpond.net.au>
4854
4855         * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd
4856         entries.
4857
4858 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4859
4860         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness
4861         mismatch.
4862
4863 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4864
4865         * elfxx-mips.c (ABI_64_P): Remove superfluous check.
4866
4867 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
4868
4869         * elf32-mips.c (mips_reloc_map): Fix typo.
4870
4871 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
4872
4873         * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section.
4874
4875 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
4876
4877         * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries.
4878
4879 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
4880
4881         * libxcoff.h: Use PARAMS on function declarations.
4882         * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc.
4883         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
4884
4885         * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in
4886         addend.
4887         * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise.
4888
4889 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
4890
4891         * coff-rs6000.c: Formatting fixes.
4892         (xcoff_calculate_relocation): Use PARAMS in declaration.
4893         (xcoff_complain_overflow): Likewise.
4894         (xcoff_ppc_relocate_section): Use old-style function pointer call.
4895         (bfd_xcoff_backend_data): Remove useless comments.
4896         (rs6000coff_vec): Likewise.
4897         (bfd_pmac_xcoff_backend_data): Likewise.
4898         (pmac_xcoff_vec): Likewise.
4899
4900         * coff64-rs6000.c: Formatting fixes.
4901         (xcoff64_calculate_relocation): Use PARAMS in declaration.
4902         (xcoff64_ppc_relocate_section): Use old-style function pointer call.
4903         (bfd_xcoff_backend_data): Remove useless comments.
4904         (rs6000coff64_vec): Likewise.
4905         (bfd_xcoff_aix5_backend_data): Likewise.
4906         (aix5coff64_vec): Likewise.
4907
4908 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
4909
4910         * coff-rs6000.c (xcoff_howto_table): Revert some of last change to
4911         mask entries.  Use complain_overflow_dont for R_REF.
4912         (xcoff_reloc_type_ba): Revert last change.
4913         (xcoff_reloc_type_br): Likewise.
4914         (xcoff_reloc_type_crel): Likewise.
4915         (xcoff_ppc_relocate_section): Likewise.
4916         * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise.
4917         (xcoff64_ppc_relocate_section): Likewise.
4918         (xcoff64_howto_table): Revert some of last change to mask entries.
4919         Use complain_overflow_dont for R_REF.
4920
4921         * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries.  Make all
4922         relocs with bitsize == 16 have size = 1.
4923         (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment.
4924         (xcoff_reloc_type_br): Likewise.
4925         (xcoff_reloc_type_crel): Likewise.
4926         (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly.
4927         * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and
4928         dst_mask adjustment.
4929         (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly.
4930         (xcoff64_howto_table): Fix src_mask entries.  Make all relocs with
4931         bitsize == 16 have size = 1.
4932
4933 2002-08-01  Denis Chertykov  <denisc@overta.ru>
4934
4935         * elf32-ip2k.c: Processor manufacturer changed to Ubicom.
4936         (struct misc): New field isymbuf. All free_* fields removed.
4937         (symbol_value): Pass in internal syms. No need to swap syms in.
4938         (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free
4939         possibly cached info.
4940         (tidyup_after_error): Removed.
4941         (ip2k_elf_relax_section_pass1): Don't use removed fields of struct
4942         misc. Use new field.
4943         (adjust_all_relocations): Use internal syms. No need to swap syms
4944         in and out.
4945         (add_page_insn): Don't use removed fields of struct misc.
4946
4947 2002-08-01  Nick Clifton  <nickc@redhat.com>
4948
4949         * elf32-arm.h: Revert previous delta.
4950
4951 2002-08-01  Nick Clifton  <nickc@redhat.com>
4952
4953         * configure.in (AM_INIT_AUTOMAKE): Bump version number.
4954         * configure: Regenerate.
4955
4956 2002-07-31  H.J. Lu <hjl@gnu.org>
4957
4958         * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is
4959         selected.
4960
4961 2002-07-31  H.J. Lu <hjl@gnu.org>
4962
4963         * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD
4964         is selected.
4965
4966 2002-07-31  Jakub Jelinek  <jakub@redhat.com>
4967
4968         * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type
4969         if _bfd_elf_link_hash_copy_indirect will swap got.refcount.
4970
4971 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
4972
4973         * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate):
4974         There is no 8 byte relocation type for this architecture.
4975         (do_ns32k_reloc): Use bfd_vma instead of native types.
4976         (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data
4977         returns void.
4978         (_bfd_ns32k_put_displacement): Don't check for overflow. We can
4979         rely on generic code to do that.
4980         * aout-ns32k.c (howto_table): Add appropriate overflow detection
4981         to all table entries.
4982         (_bfd_ns32k_relocate_contents): put_data returns void.
4983         * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate)
4984         (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions
4985         return void.
4986
4987 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
4988
4989         * aoutx.h (aout_link_check_ar_symbols): Whether to include an
4990         archive object is target dependant.
4991
4992 2002-07-31  Adam Nemet  <anemet@lnxw.com>
4993
4994         * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE.
4995         (THUMB_PLT_ENTRY_SIZE): New macro.
4996         (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE.
4997         (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to
4998         ARM_PLT_ENTRY_SIZE.
4999         (elf32_arm_plt_entry): Likewise.
5000         (elf_backend_plt_header_size): Likewise.
5001         (elf32_thumb_plt0_entry): New global.
5002         (elf32_arm_finish_dynamic_sections): Use it.  Put Thumb entries
5003         into .plt.thumb.
5004         (elf32_thumb_plt_entry): New global.
5005         (elf32_arm_finish_dynamic_symbol): Use it.  Use .thumb.plt for
5006         Thumb entries.  Set the bottom bit of the corresponding GOT entry
5007         for a Thumb PLT entry.
5008         (struct elf32_arm_plt_entry_info): New structure.
5009         (struct elf32_arm_link_hash_entry, plt_info): New member of this
5010         type.
5011         (elf32_arm_link_hash_newfunc): Initialize new member.
5012         (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle
5013         relocations against the PLT.
5014         (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set
5015         first_rel_type if this is the first time we encounter the symbol.
5016         (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case.
5017         Determine if relocation needs a PLT entry.  Set first_rel_type if
5018         this is the first time we encounter the symbol
5019         (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb
5020         functions as well.
5021         (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt.
5022         (elf32_arm_create_dynamic_sections): New function.  Create the
5023         .plt.thumb section.
5024         (elf_backend_create_dynamic_sections): Call it.
5025
5026 2002-07-31  Nick Clifton  <nickc@redhat.com>
5027
5028         * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to
5029         'alternative' in order to avoid shadowing global symbol of the
5030         same name.
5031         * bfd-in2.h: Regenerate.
5032         * libbfd.h: Regenerate.
5033         * libcoff.h: Regenerate.
5034
5035 2002-07-31  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
5036
5037         * Makefile.am: Add n32 ABI support.
5038         * Makefile.in: Regenerate.
5039         * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64
5040         bit vectors for mips*-*-linux targets as optional.
5041         * configure.in: Add n32 ABI vectors.
5042         * configure: Regenerate.
5043         * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files.
5044         * elfn32-mips.c: New file, n32 ABI support.
5045         * targets.c: Add n32 ABI vectors.
5046
5047 2002-07-30  Graeme Peterson  <gp@qnx.com>
5048
5049         * elfarmqnx-nabi.c: New file: Support for QNX.
5050         * config.bfd: Add support for arm-*-nto target.
5051         * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec.
5052         * configure: Regenerate.
5053         * Makefile.am: Add entries for elfarmqnx-nabi.c.
5054         * Makefile.in: Regenerate.
5055         * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined.
5056         Do not define global function if ELFARM_NABI_C_INCLUDED is defined.
5057         * elfarm-nabi.c: Do not include elf32-arm.h if
5058         ELFARM_NABI_C_INCLUDED is defined.
5059         * targets.c: Add bfd_elf32_{big|little}armqnx_vec.
5060
5061 2002-07-30  Nick Clifton  <nickc@redhat.com>
5062
5063         * po/sv.po: Updated Swedish translation.
5064
5065 2002-07-30  Jakub Jelinek  <jakub@redhat.com>
5066
5067         * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type.
5068
5069 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
5070
5071         * aoutx.h (some_aout_object_p): Clean up tdata properly on error.
5072         * archive.c (bfd_generic_archive_p): Likewise.
5073         * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise.
5074         (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol.
5075         * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
5076         (xcoff64_archive_p): Likewise.
5077         (xcoff64_openr_next_archived_file): Likewise.
5078         (xcoff64_archive_p): Clean up tdata properly on error.
5079         * coffgen.c (coff_real_object_p): Likewise.
5080         (coff_object_p): Release filehdr and opthdr.
5081         * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error.
5082         * ieee.c (ieee_archive_p): Likewise.
5083         * ihex.c (ihex_object_p): Likewise.
5084         (ihex_mkobject): Always allocate tdata.
5085         * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error.
5086         * srec.c (srec_mkobject): Always allocate tdata.
5087         (srec_object_p): Clean up tdata properly on error.
5088         (symbolsrec_object_p): Likewise.
5089         * versados.c (versados_object_p): Likewise.
5090         * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc,
5091         and bfd_realloc instead of realloc.
5092         (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections.
5093         * vms.c (vms_initialize): Always allocate tdata.  Use bfd_alloc in
5094         place of bfd_malloc, simplifying error freeing.  Free hash table too.
5095         (vms_object_p): Clean up tdata on error.
5096         (vms_mkobject): Don't complain on stderr if vms_initialize fails.
5097         (vms_close_and_cleanup): Adjust for bfd_alloc use.
5098
5099 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
5100
5101         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags.
5102
5103 2002-07-26  Chris Demetriou  <cgd@broadcom.com>
5104
5105         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE
5106         flags into resulting BFD.
5107
5108 2002-07-26  Alan Modra  <amodra@bigpond.net.au>
5109
5110         From John Reiser <jreiser@BitWagon.com>
5111         * elf32-i386.c (elf_i386_link_hash_table_create): Clear
5112         tls_ldm_got.refcount.
5113
5114 2002-07-25  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
5115
5116         * elf64-mips.c: Update TODO comment.
5117         (mips_elf64_higher_reloc,mips_elf64_highest_reloc,
5118         mips_elf64_gprel16_reloca): Remove prototypes.
5119         (mips16_jump_reloc,mips16_gprel_reloc): Add functions.
5120         (UNUSED_RELOC): Replace by EMPTY_RELOC.
5121         (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove
5122         wrong comments. Remove disfunctional support of R_MIPS_HIGHER and
5123         R_MIPS_HIGHEST.
5124         (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and
5125         R_MIPS_GOT16. Remove wrong comments.
5126         (elf_mips16_jump_howto,elf_mips16_gprel_howto,
5127         elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code
5128         from elf32-mips.c.
5129         (mips_elf64_hi16_reloc): Fix formatting.
5130         (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove.
5131         (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code.
5132         Better comment. Fall back to R_MIPS_GOT_DISP instead of abort().
5133         (mips_elf64_gprel16_reloc): Make static. Add check for
5134         partial_inplace.
5135         (mips_elf64_gprel16_reloca): Remove.
5136         (mips_elf64_literal_reloc): New function.
5137         (mips_elf64_gprel32_reloc): Fix formatting.
5138         (mips_elf64_shift6_reloc): Fix comment. Make static.
5139         (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from
5140         elf32-mips.c.
5141         (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in
5142         elf32-mips.c
5143         (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU
5144         specific relocations.
5145         (mips_elf64_rtype_to_howto): Enable GNU specific relocations.
5146         (mips_elf64_object_p): Invert logic to check for SGI-ish ABI.
5147         (ELF_MAXPAGESIZE): Add comment.
5148
5149 2002-07-25  Nick Clifton  <nickc@redhat.com>
5150
5151         * po/sv.po: Updated Swedish translation.
5152         * po/es.po: Updated Spanish translation.
5153         * po/fr.po: Updated French translation.
5154
5155 2002-07-25  Alan Modra  <amodra@bigpond.net.au>
5156
5157         * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define
5158         as elf_link_record_local_dynamic_symbol.
5159         (_bfd_elf64_link_record_local_dynamic_symbol): Likewise.
5160         (elf_link_record_local_dynamic_symbol): Declare.  Now returns int.
5161         * elflink.h (elf_link_record_local_dynamic_symbol): Move to..
5162         * elflink.c: .. here.  Use bfd_elf_get_elf_syms.  Check whether an
5163         attempt is made to record a symbol in a discarded section, and
5164         return `2' in that case.
5165
5166 2002-07-24  Nick Clifton  <nickc@redhat.com>
5167
5168         * po/sv.po: Updated Swedish translation.
5169         * po/es.po: Updated Spanish translation.
5170
5171 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
5172
5173         * po/SRC-POTFILES.in: Regenerate.
5174
5175         * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
5176         immediately.  Remove code handling relocatable linking.
5177         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
5178         * elf32-cris.c (cris_elf_relocate_section): Likewise.
5179         * elf32-fr30.c (elf32_frv_relocate_section): Likewise.
5180         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
5181         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
5182         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
5183         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
5184         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
5185         * elf32-v850.c (v850_elf_relocate_section): Likewise.
5186         * elf32-vax.c (elf_vax_relocate_section): Likewise.
5187         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
5188         * elf32-avr.c (elf_backend_rela_normal): Define.
5189         * elf32-cris.c: Likewise.
5190         * elf32-fr30.c: Likewise.
5191         * elf32-frv.c: Likewise.
5192         * elf32-h8300.c: Likewise.
5193         * elf32-hppa.c: Likewise.
5194         * elf32-ip2k.c: Likewise.
5195         * elf32-sparc.c: Likewise.
5196         * elf32-v850.c: Likewise.
5197         * elf32-vax.c: Likewise.
5198         * elf64-hppa.c: Likewise.
5199         * elf64-sparc.c: Likewise.
5200         * elf32-fr30.c (elf32_frv_relocate_section): Edit comment.
5201         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
5202         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
5203         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
5204         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
5205         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
5206         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
5207         * elf-m10200.c (USE_RELA): Don't define.
5208         * elf-m10300.c: Likewise.
5209         * elfarm-oabi.c: Likewise.
5210         * elf32-i370.c: Likewise.
5211         * elf32-ip2k.c: Likewise.
5212         * elf32-m68k.c: Likewise.
5213         * elf32-mcore.c: Likewise.
5214         * elf32-ppc.c: Likewise.
5215         * elf32-s390.c: Likewise.
5216         * elf32-vax.c: Likewise.
5217         * elf64-ppc.c: Likewise.
5218         * elf64-s390.c: Likewise.
5219         * elf64-x86-64.c: Likewise.
5220         * elfxx-ia64.c: Likewise.
5221         * elf32-avr.c (USE_REL): Don't undef.
5222         * elf32-ip2k.c: Likewise.
5223
5224 2002-07-23  Nick Clifton  <nickc@redhat.com>
5225
5226         * elf-bfd.h (struct elf_backend_data): Add new bitfield
5227         'want_p_paddr_set_to_zero'.
5228         * elfxx-target.h: Set default value for want_p_paddr_set_to_zero
5229         to false;
5230         * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target.
5231         * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero.
5232
5233 2002-07-23  Gabor Keresztfalvi  <keresztg@mail.com>
5234
5235         * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of
5236         the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to
5237         show the Copyright string.
5238         Minor formatting tidy ups.
5239
5240 2002-07-23  Nick Clifton  <nickc@redhat.com>
5241
5242         * po/fr.po: Updated French translation.
5243         * po/sv.po: Updated Swedish translation.
5244
5245 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
5246
5247         * elflink.h (elf_link_input_bfd): Don't change internal symbols
5248         when outputting relocs.
5249
5250 2002-07-20  Jason Thorpe  <thorpej@wasabisystems.com>
5251
5252         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert
5253         DT_PLTGOT into the dynamic section if there is a PLT.
5254
5255 2002-07-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
5256
5257         * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from
5258         elf32-mips.c.
5259         (_bfd_mips_elf_write_section): Likewise.
5260         * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype.
5261         (_bfd_mips_elf_write_section): Likewise.
5262         * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c.
5263         (elf32_mips_write_section): Likewise.
5264         * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it.
5265         (_bfd_mips_elf_write_section): Likewise.
5266
5267 2002-07-19  Alan Modra  <amodra@bigpond.net.au>
5268
5269         * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan
5270         PT_IA_64_UNWIND segments for a given section.
5271
5272 2002-07-17  H.J. Lu <hjl@gnu.org>
5273
5274         * Makefile.am: Fix a typo.
5275         * Makefile.in: Regenerate.
5276
5277 2002-07-15  Denis Chertykov  <denisc@overta.ru>
5278             Frank Ch. Eigler  <fche@redhat.com>
5279             Ben Elliston  <bje@redhat.com>
5280             Alan Lehotsky  <alehotsky@cygnus.com>
5281             John Healy  <jhealy@redhat.com>
5282             Graham Stott  <grahams@redhat.com>
5283             Jeff Johnston  <jjohnstn@redhat.com>
5284
5285         * Makefile.am: Add support for ip2k.
5286         * Makefile.in: Regenerate.
5287         * doc/Makefile.in: Regenerate.
5288         * archures.c: Add support for ip2k.
5289         * config.bfd: Add support for ip2k.
5290         * configure.in: Add support for ip2k.
5291         * configure: Regenerate.
5292         * reloc.c: Add support for ip2k.
5293         * targets.c: Add support for ip2k.
5294         * bfd-in2.h: Regenerate.
5295         * libbfd.h: Regenerate.
5296         * cpu-ip2k.c: New file.
5297         * elf32-ip2k.c: New file.
5298
5299 2002-07-17  Ian Rickards  <irickard@arm.com>
5300
5301         * dwarf2.c (concat_filename): If we can't establish the directory
5302         just return the filename.
5303
5304 2002-07-16  Moritz Jodeit  <moritz@jodeit.org>
5305
5306         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args.
5307
5308 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
5309
5310         * elflink.h: Formatting fixes, tidy prototypes.
5311         (elf_link_assign_sym_version): Move common code out of loop.
5312
5313 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
5314
5315         * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
5316         reloc section size is zero.  Correct reloc output location.
5317
5318 2002-07-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5319
5320         * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
5321         the final type for the e_fsel selector when generating PA2.0W code.
5322         (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1
5323         relocations.
5324
5325 2002-07-14  H.J. Lu <hjl@gnu.org>
5326
5327         * elflink.h (elf_link_assign_sym_version): Hide the default
5328         definition if there is a hidden versioned definition.
5329
5330 2002-07-12  Hans-Peter Nilsson  <hp@axis.com>
5331
5332         * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical
5333         dynamic reference test in assertion when initializing GOT with
5334         static contents.  Just assert that there are either no dynamic
5335         sections, the symbol is defined in the regular objects or that the
5336         symbol is undef weak.  Tweak comment.
5337         (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program
5338         only if the symbol isn't defined in the program and isn't undef
5339         weak.
5340         (elf_cris_adjust_dynamic_symbol): Simplify condition for getting
5341         rid of PLT entry: only do it if the symbol isn't defined in a DSO.
5342         When doing so, clear ELF_LINK_HASH_NEEDS_PLT.  Tweak comments.
5343         (elf_cris_discard_excess_program_dynamics): Don't consider
5344         ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs.
5345
5346 2002-07-11  Alan Modra  <amodra@bigpond.net.au>
5347
5348         * elf32-i386.c (elf_i386_relocate_section): Don't complain about
5349         unresolved debugging relocs in dynamic applications.
5350         * elf32-s390.c (elf_s390_relocate_section): Likewise.
5351         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
5352         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
5353         * elf64-s390.c (elf_s390_relocate_section): Likewise.
5354         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
5355         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
5356
5357 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
5358
5359         * elf64-ppc.c (ONES): Define.
5360         (ppc64_elf_howto_table): Use ONES here to avoid warnings.  Fill in
5361         missing src_mask fields.  Tweak R_PPC64_NONE, R_PPC64_COPY.  Fill
5362         in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32.
5363
5364         * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete.
5365         (ppc64_elf_set_private_flags): Delete.
5366         (ppc64_elf_section_from_shdr): Delete.
5367         (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code.
5368         (ppc64_elf_fake_sections): Delete.
5369         (bfd_elf64_bfd_set_private_flags): Don't define.
5370         (bfd_elf64_get_symbol_info): Likewise.
5371         (elf_backend_section_from_shdr): Likewise.
5372         (elf_backend_fake_sections): Likewise.
5373
5374 2002-07-10  Marco Walther  <Marco.Walther@sun.com>
5375
5376         * elf.c: (assign_section_numbers) Set sh_entsize for .stab only
5377         when not already set.
5378         * elf64-sparc.c: (sparc64_elf_fake_sections): New function.
5379         (elf_backend_fake_sections): Define.
5380
5381 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
5382
5383         * merge.c (_bfd_merge_section): Remove redundant output_section check.
5384         Formatting.
5385         (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections.
5386
5387 2002-07-09  Hans-Peter Nilsson  <hp@axis.com>
5388
5389         * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for
5390         NULL sym_hashes to just before use.
5391         <case R_CRIS_32_GOTREL>: In test for local symbol, accept also
5392         symbol with non-default visibility.
5393         <case R_CRIS_32_GOTREL, case R_CRIS_32_PLT_GOTREL>: Ditto.
5394         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
5395         Ditto.
5396         (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for
5397         symbol with non-default visibility.
5398         (cris_elf_check_relocs): At tests for local symbol before
5399         increasing h->plt.refcount, also check for non-default
5400         visibility.  Ditto when checking for local symbol to eliminate
5401         pc-relative runtime relocs.
5402
5403 2002-07-08  Alan Modra  <amodra@bigpond.net.au>
5404
5405         * elf.c: Formatting.
5406         (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks.
5407         (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP.
5408         (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP
5409         segments.
5410
5411 2002-07-07  Mark Mitchell  <mark@codesourcery.com>
5412             Alan Modra  <amodra@bigpond.net.au>
5413
5414         * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into
5415         account the impact of relocation count overflow when computing
5416         section offsets.
5417         * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether
5418         or not to apply the PE COFF reloc overflow handling.  Fix a
5419         fencepost error in deciding whether or not to use that technique.
5420
5421 2002-07-07  Alan Modra  <amodra@bigpond.net.au>
5422
5423         * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx,
5424         change type of locsyms.
5425         (bfd_elf_get_elf_syms): Declare.
5426         * elf.c (bfd_elf_get_elf_syms): New function.
5427         (group_signature): Use bfd_elf_get_elf_syms.
5428         (bfd_section_from_r_symndx): Likewise.
5429         * elfcode.h (elf_slurp_symbol_table): Likewise.
5430         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
5431         (elf_link_add_object_symbols): Likewise.  Reorganise to increase
5432         locality of various data structures.  Properly free internal relocs.
5433         (elf_bfd_final_link): Properly free internal relocs.
5434         (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms.
5435         (elf_link_input_bfd): Likewise.
5436         (elf_gc_mark): Likewise.  Properly free internal relocs.
5437         (elf_gc_sweep): Properly free internal relocs.
5438         (elf_reloc_symbol_deleted_p): No need to swap syms in.
5439         (elf_bfd_discard_info): Use bfd_elf_get_elf_syms.  Properly free
5440         internal relocs.
5441         * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms.
5442         Properly free possibly cached info.
5443         (mn10200_elf_relax_delete_bytes): Remove symbol swapping code.
5444         (mn10200_elf_symbol_address_p): Pass in internal syms.  Remove
5445         symbol swapping code.
5446         (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms.
5447         Properly free possibly cached info.
5448         * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c.
5449         (mn10300_elf_relax_delete_bytes): Likewise.
5450         (mn10300_elf_symbol_address_p): Likewise.
5451         (mn10300_elf_get_relocated_section_contents): Likewise.
5452         * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c.
5453         (elf32_h8_relax_delete_bytes): Likewise.
5454         (elf32_h8_symbol_address_p): Likewise.
5455         (elf32_h8_get_relocated_section_contents): Likewise.
5456         * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c.
5457         (m32r_elf_relax_delete_bytes): Likewise.
5458         (m32r_elf_get_relocated_section_contents): Likewise.
5459         * elf32-sh.c (sh_elf_reloc_loop): Free section contents using
5460         elf_section_data to determine whether cached.
5461         (sh_elf_relax_section): As above for elf-m10200.c.
5462         (sh_elf_relax_delete_bytes): Likewise.
5463         (sh_elf_get_relocated_section_contents): Likewise.
5464         * elf32-xstormy16.c (xstormy16_elf_relax_section): As above.
5465         * elf64-alpha.c (elf64_alpha_relax_section): As above.  Also delay
5466         reading of local syms.
5467         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
5468         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above.
5469         * elfxx-ia64.c (elfNN_ia64_relax_section): As above.
5470         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal
5471         relocs.
5472         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly
5473         free internal relocs and section contents.  Don't read symbols.
5474         * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms.
5475         (elf32_hppa_size_stubs): Don't free local syms.
5476         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay
5477         reading of local syms.  Use bfd_elf_get_elf_syms.  Properly free
5478         possibly cached info.
5479         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
5480         * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms.
5481         * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and
5482         all_local_syms.
5483         (get_local_syms): Delete function.
5484         (edit_opd): Use bfd_elf_get_elf_syms.  Free on error exit.  Cache
5485         on exit.
5486         (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms.  Free/cache on exit.
5487
5488 2002-07-05  Jim Wilson  <wilson@redhat.com>
5489
5490         * syms.c (decode_section_type): New.
5491         (bfd_decode_symclass): Call decode_section_type.
5492
5493 2002-07-04  Jakub Jelinek  <jakub@redhat.com>
5494
5495         * merge.c (_bfd_merged_section_offset): Avoid accessing byte before
5496         section content start.
5497         Reported by Michael Schumacher <mike@hightec-rt.com>.
5498
5499 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
5500
5501         * section.c (_bfd_strip_section_from_output): Remove unnecessary
5502         link order code.  Don't actually remove the output section here;
5503         Just set a flag for the linker to do so.
5504         * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed
5505         sections when setting up output section dynsyms.
5506
5507 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
5508
5509         * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux
5510         fudge.
5511         * elf.c (bfd_section_from_shdr): Work around broken hpux shared
5512         libs here instead.
5513
5514 2002-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5515
5516         * elf64-s390.c (create_got_section): Set .got section alignment to
5517         8 bytes.
5518         (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes.
5519
5520 2002-07-02  Alan Modra  <amodra@bigpond.net.au>
5521
5522         * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar.
5523
5524 2002-07-01  Matt Thomas  <matt@3am-software.com>
5525
5526         * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_*
5527         to EF_VAX_*.
5528
5529 2002-07-01  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
5530
5531         * elfxx-mips.c (ABI_64_P): Fix comment.
5532         (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the
5533         new section names for N64 ABI.
5534         (mips_elf_output_extsym): No special _gp_disp handling for NewABI.
5535         (mips_elf_calculate_relocation): Code formatting.
5536         (mips_elf_create_dynamic_relocation): Likewise.
5537         (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too.
5538         (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI.
5539         (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64
5540         in any NewABI.
5541         (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling
5542         for NewABI.
5543         (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI.
5544         (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled
5545         here, too.
5546
5547 2002-07-01  Andreas Schwab  <schwab@suse.de>
5548
5549         * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert
5550         R_X86_64_64 to R_X86_64_RELATIVE.
5551
5552 2002-07-01  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5553
5554         * vaxbsd.c: New BFD backend for VAX BSD and Ultrix.
5555         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend.
5556         Run "make dep-am".
5557         * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of
5558         host_aout_vec.
5559         * configure.in (vaxbsd_vec): Add.
5560         * targets.c (vaxbsd_vec): Add.
5561         * Makefile.in: Rebuild.
5562         * configure: Rebuild.
5563         * po/SRC-POTFILES.in: Rebuild.
5564
5565 2002-07-01  Alan Modra  <amodra@bigpond.net.au>
5566
5567         * elflink.h (elf_gc_mark): Pass in the section whose relocs we are
5568         examining to gc_mark_hook, rather than the bfd.
5569         (elf_gc_sections): Adjust.
5570         * elf-bfd.h (struct elf_backend_data <gc_mark_hook>): Likewise.
5571         * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise.
5572         * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
5573         * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
5574         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
5575         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
5576         * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
5577         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
5578         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
5579         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
5580         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
5581         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
5582         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
5583         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
5584         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
5585         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
5586         * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
5587         * elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
5588         * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
5589         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
5590         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
5591         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
5592         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
5593         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
5594         * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
5595         * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise.
5596         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
5597         * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise.  Also remove
5598         redundant local sym tests.
5599         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry.
5600         (link_hash_newfunc): Init is_entry.
5601         (ppc64_elf_copy_indirect_symbol): Copy is_entry.
5602         (ppc64_elf_link_hash_table_create): Init all_local_syms.
5603         (create_linkage_sections): Use bfd_make_section_anyway rather than
5604         bfd_make_section.
5605         (ppc64_elf_mark_entry_syms): New function.
5606         (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab.  Set
5607         up opd entry to function section map.
5608         (ppc64_elf_gc_mark_hook): Special case opd section relocs, and
5609         relocs that reference the opd section.
5610         (edit_opd): New function.
5611         (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd.
5612         (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here.
5613         (get_local_syms): Do so here.  Exit if we already have local syms.
5614         Remove bogus comment imported from elf32-hppa.c.  Don't attempt to
5615         read local syms on non-ELF input.
5616         (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather
5617         than duplicating it's function here.  Adjust free of internal
5618         relocs to suit.
5619         (ppc64_elf_relocate_section): Adjust local syms in opd section.
5620         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare.
5621         * elf32-hppa.c (elf32_hppa_size_stubs): Call
5622         _bfd_elf32_link_read_relocs rather than duplicating it's function
5623         here.  Adjust free of internal relocs to suit.
5624
5625 2002-07-01  Andreas Jaeger  <aj@suse.de>
5626
5627         * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations
5628         are not allowed in shared libs code, enforce -fPIC.
5629
5630 2002-06-29  Hans-Peter Nilsson  <hp@bitrange.com>
5631
5632         * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and
5633         trailing zero-sequences when there's previous left-over data.
5634
5635 2002-06-27  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5636
5637         * elf64-hppa.c (elf64_hppa_reloc_type_class): New function.
5638         (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec
5639         and opd_rel_sec in order for starting rela section.  Check _raw_size.
5640         (elf_backend_reloc_type_class): Define.
5641
5642 2002-06-27  Kevin Buettner <kevinb@redhat.com>
5643
5644         * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
5645         DWARF2 formats.
5646
5647 2002-06-27  Alan Modra  <amodra@bigpond.net.au>
5648
5649         * cpu-powerpc.c: Comment on ordering of arch_info.
5650         * elf32-ppc.c (ppc_elf_object_p): New function.
5651         (elf_backend_object_p): Define.
5652         * elf64-ppc.c (ppc64_elf_object_p): New function.
5653         (elf_backend_object_p): Define.
5654
5655 2002-06-26  Jason Thorpe  <thorpej@wasabisystems.com>
5656
5657         * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo.
5658         * configure: Regenerate.
5659
5660 2002-06-25  Jason Eckhardt  <jle@rice.edu>
5661
5662         * dwarf2.c (decode_line_info): Check unit->addr_size
5663         to read in the proper number of prologue bytes.
5664
5665 2002-06-25  Nick Clifton  <nickc@cambridge.redhat.com>
5666
5667         * config.bfd (powerpc-*-aix5*): Only create a selvecs for
5668         aix5coff64_vec if 64-bit bfd support has been enabled.
5669         (powerpc64-*-aix5*): Only define if 64-bit bfd support has
5670         been enabled.
5671
5672         * targets.c (_bfd_target_vector[]): Only include
5673         aix5coff64_vec if 64-bit bfd support has been enabled.
5674
5675 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
5676
5677         * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy.
5678         * elf32-hppa.c (hppa_add_stub): Likewise.
5679         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
5680         * elflink.h (elf_add_default_symbol): Fix comment typo.
5681         (elf_add_default_symbol): Replace strcpy and strncpy with memcpy.
5682         (elf_link_add_object_symbols): Likewise.
5683         (elf_link_assign_sym_version): Likewise.
5684         * hash.c (bfd_hash_lookup): Likewise.
5685         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
5686         * section.c (bfd_get_unique_section_name): Likewise.
5687         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
5688         * elf.c (_bfd_elf_make_section_from_phdr): Likewise.
5689         (assign_section_numbers): Likewise.
5690         (_bfd_elfcore_make_pseudosection): Likewise.
5691         (elfcore_grok_lwpstatus): Likewise.
5692         (elfcore_grok_win32pstatus): Likewise.
5693         (elfcore_write_note): Constify input params.  Use PTR instead of
5694         void *.  Include terminating NUL in namesz.  Correct padding.
5695         Support NULL "name" param.  Use memcpy instead of strcpy.
5696         (elfcore_write_prpsinfo): Constify input params.
5697         (elfcore_write_prstatus): Likewise.  Use PTR instead of void *.
5698         (elfcore_write_lwpstatus): Likewise.
5699         (elfcore_write_pstatus): Likewise.
5700         (elfcore_write_prfpreg): Likewise.
5701         (elfcore_write_prxfpreg): Likewise.
5702         * elf-bfd.h (elfcore_write_note): Update declaration.
5703         (elfcore_write_prpsinfo): Likewise.
5704         (elfcore_write_prstatus): Likewise.
5705         (elfcore_write_pstatus): Likewise.
5706         (elfcore_write_prfpreg): Likewise.
5707         (elfcore_write_prxfpreg): Likewise.
5708         (elfcore_write_lwpstatus): Likewise.
5709
5710 2002-06-25  Jason Eckhardt  <jle@rice.edu>
5711
5712         * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for
5713         symbols of type stProc and stStaticProc.
5714
5715 2002-06-25  Nick Clifton  <nickc@redhat.com>
5716
5717         * ecoff.c: VArious formatting fixes.
5718
5719 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
5720
5721         * coff-rs6000.c (xcoff_generate_rtinit): Fix typo.
5722
5723 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
5724
5725         * aout-adobe.c: Don't compare against "true" or "false.
5726         * aout-target.h: Likewise.
5727         * aoutx.h: Likewise.
5728         * archive.c: Likewise.
5729         * bout.c: Likewise.
5730         * cache.c: Likewise.
5731         * coff-a29k.c: Likewise.
5732         * coff-alpha.c: Likewise.
5733         * coff-i386.c: Likewise.
5734         * coff-mips.c: Likewise.
5735         * coff-or32.c: Likewise.
5736         * coff64-rs6000.c: Likewise.
5737         * coffcode.h: Likewise.
5738         * coffgen.c: Likewise.
5739         * cpu-ns32k.c: Likewise.
5740         * ecoff.c: Likewise.
5741         * ecofflink.c: Likewise.
5742         * elf.c: Likewise.
5743         * elf32-arm.h: Likewise.
5744         * elf32-cris.c: Likewise.
5745         * elf32-d30v.c: Likewise.
5746         * elf32-i386.c: Likewise.
5747         * elf32-mcore.c: Likewise.
5748         * elf32-ppc.c: Likewise.
5749         * elf32-sh.c: Likewise.
5750         * elf32-sh64.c: Likewise.
5751         * elf32-v850.c: Likewise.
5752         * elf64-alpha.c: Likewise.
5753         * elf64-sh64.c: Likewise.
5754         * elfcode.h: Likewise.
5755         * elfcore.h: Likewise.
5756         * elflink.h: Likewise.
5757         * elfxx-mips.c: Likewise.
5758         * i386os9k.c: Likewise.
5759         * ieee.c: Likewise.
5760         * libbfd.c: Likewise.
5761         * linker.c: Likewise.
5762         * mmo.c: Likewise.
5763         * nlm32-alpha.c: Likewise.
5764         * nlm32-i386.c: Likewise.
5765         * nlm32-ppc.c: Likewise.
5766         * nlm32-sparc.c: Likewise.
5767         * nlmcode.h: Likewise.
5768         * oasys.c: Likewise.
5769         * pdp11.c: Likewise.
5770         * peicode.h: Likewise.
5771         * reloc.c: Likewise.
5772         * som.c: Likewise.
5773         * srec.c: Likewise.
5774         * tekhex.c: Likewise.
5775         * vms.c: Likewise.
5776         * xcofflink.c: Likewise.
5777         * elf64-sparc.c: Edit comment to not use "== false".
5778
5779         * aoutf1.h: Don't use "? true : false".
5780         * ecoff.c: Likewise.
5781         * format.c: Likewise.
5782         * ieee.c: Likewise.
5783         * linker.c: Likewise.
5784         * mmo.c: Likewise.
5785         * oasys.c: Likewise.
5786
5787 2002-06-23  H.J. Lu  <hjl@gnu.org>
5788
5789         * elflink.h (elf_link_add_archive_symbols): For the default
5790         version, check references with only one `@' first.
5791
5792 2002-06-23  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5793
5794         * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New
5795         function.
5796         (allocate_global_data_dlt): Don't add millicode symbols to dynamic
5797         symbol table.
5798         (allocate_global_data_opd, allocate_dynrel_entries): Likewise.
5799         (elf64_hppa_size_dynamic_sections): Revise to use
5800         elf64_hppa_mark_milli_and_exported_functions.
5801         (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode
5802         symbols out of dynamic symbol table.
5803
5804 2002-06-23  Alan Modra  <amodra@bigpond.net.au>
5805
5806         * Makefile.in: Regenerate.
5807         * libbfd.h: Regenerate.
5808         * bfd-in2.h: Regenerate.
5809         * configure: Regenerate.
5810         * po/SRC-POTFILES.in: Regenerate.
5811
5812         * elflink.h: Comment typo fixes.
5813
5814 2002-06-23  H.J. Lu  <hjl@gnu.org>
5815
5816         * elf-bfd.h (elf_link_loaded_list): New structure.
5817         (elf_link_hash_table): Add "loaded".
5818         * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded".
5819         * elflink.h (elf_link_check_versioned_symbol): New function.
5820         (elf_link_output_extsym): Call elf_link_check_versioned_symbol.
5821
5822 2002-06-19  Nick Clifton  <nickc@cambridge.redhat.com>
5823
5824         * elflink.h (size_dynamic_sections): If the target does not
5825         support an ELF style hash table, return true, indicating that
5826         nothing needed to be done, rather than false, indicating that the
5827         section's size could not be computed.
5828
5829 2002-06-18  Dave Brolley  <brolley@redhat.com>
5830
5831         From Catherine Moore, Michael Meissner, Dave Brolley:
5832         * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c
5833         * targets.c: Support bfd_elf32_frv_vec.
5834         * reloc.c: Add FRV relocs.
5835         * configure.in: Add support for bfd-elf32-frv-vec.
5836         * config.bfd (targ_cpu): Add support for frv-*-elf.
5837         * archures.c: Add frv arch and machines.
5838         * Makefile.am (ALL_MACHINES): Add cpu-frv.lo.
5839         (ALL_MACHINES_CFILES): Add cpu-frv.c.
5840         (BFD32_BACKENDS): Add elf32-frv.lo.
5841         (BFD32_BACKENDS_CFILES): Add elf32-frv.c
5842         (cpu-frv.lo): New target.
5843         (elf32-frv.lo): New target.
5844         * cpu-frv.c: New file.
5845         * elf32-frv.c: New file.
5846
5847 2002-06-18  Jakub Jelinek  <jakub@redhat.com>
5848
5849         * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies
5850         e_shnum == 0.
5851         Only read the first section header if e_shoff is non-zero.
5852         Don't consider e_shstrndx if there are no sections.
5853
5854 2002-06-17  Tom Rix <trix@redhat.com>
5855
5856         * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R,
5857         R_D10V_10_PCREL_L and R_D10V_18_PCREL to use
5858         complain_overflow_bitfield.
5859
5860 2002-06-17  Alan Modra  <amodra@bigpond.net.au>
5861
5862         * opncls.c (bfd_openr): Remove redundant bfd_set_error.
5863         (bfd_fdopenr): Likewise.
5864         (bfd_openstreamr): Likewise.
5865         (bfd_openw): Likewise.
5866
5867         * targets.c: Sort target vecs.
5868         (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec,
5869         bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec,
5870         bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec,
5871         bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec.
5872         * configure.in: Sort target vecs.  Add m88kmach3_vec.
5873         * configure: Regenerate.
5874
5875 2002-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
5876
5877         * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
5878         bpo_reloc_no to break sort order ties, not address of items.
5879
5880 2002-06-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5881
5882         * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
5883         Skip excluded sections in determing __gp value.
5884         (elf_hppa_final_link_relocate): Use the symbol's address in
5885         R_PARISC_FPTR64 relocations that don't need an opd entry.
5886         * elf64-hppa.c (allocate_dynrel_entries): Simplify code.
5887         (elf64_hppa_finalize_dynreloc): Likewise.
5888         (elf64_hppa_size_dynamic_sections): Move comments and fix typo.
5889         (elf64_hppa_finish_dynamic_symbol): Break up assert.
5890
5891 2002-06-14  Sergey Grigoriev  <serge@leopold.Physik.Uni-Augsburg.DE>
5892
5893         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
5894         alignment for .bss, .data and .text sections so that sse and sse2
5895         code will work.
5896         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
5897
5898 2002-06013  J"orn Rennecke  <joern.rennecke@superh.com>
5899
5900         config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*,
5901         sh[1234]*-elf*.
5902
5903 2002-06-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5904
5905         * elflink.h (elf_bfd_final_link): Improve error handling for missing
5906         dynamic sections.
5907
5908         * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry
5909         for a symbol that has no output section.
5910         (allocate_dynrel_entries): Correct comment.
5911         (elf64_hppa_finalize_dynreloc): Likewise.  Don't create an opd entry
5912         unless we want one.
5913         (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL.
5914         (elf64_hppa_finalize_dlt): Likewise.  Prevent segfault for symbols
5915         with no section.  Remove unnecessary parentheses.
5916
5917 2002-06-11  Tom Rix  <trix@redhat.com>
5918
5919         * coffcode.h (coff_compute_section_file_positions): Add data
5920         section to AIX loader alignment check.
5921
5922         * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section
5923         alignment to 4 bytes.
5924         (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment
5925         power accessor macro.
5926         (do_shared_object_padding): Remove invalid assertion.
5927
5928 2002-06-10  Richard Sandiford  <rsandifo@redhat.com>
5929
5930         * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE
5931         for removed output sections.
5932
5933 2002-06-10  Geoffrey Keating  <geoffk@redhat.com>
5934
5935         * merge.c (merge_strings): Use htab_create_alloc with calloc, not
5936         htab_alloc.
5937         * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise.
5938
5939 2002-06-08  H.J. Lu <hjl@gnu.org>
5940
5941         * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to
5942         work around a long long bug in gcc 2.96 on mips.
5943
5944 2002-06-08  Jason Thorpe  <thorpej@wasabisystems.com>
5945
5946         * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo.
5947         (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c.
5948         Regenerate dependency lists.
5949         * Makefile.in: Regenerate.
5950         * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add
5951         vax1knetbsd_vec to targ_selvecs.
5952         * configure.in: Add vax1knetbsd_vec.
5953         * configure: Regenerate.
5954         * targets.c (_bfd_target_vector): Add vax1knetbsd_vec.
5955         * vax1knetbsd.c: New file.
5956         * vaxnetbsd.c: Update copyright years.
5957         (TARGET_PAGE_SIZE): Set to 0x1000.
5958         (DEFAULT_MID): Set to M_VAX4K_NETBSD.
5959
5960 2002-06-08  Matt Thomas  <matt@3am-software.com>
5961
5962         * libaout.h (enum machine_type): Add M_VAX4K_NETBSD.
5963
5964 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
5965
5966         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static.
5967
5968 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
5969
5970         * Makefile.am: Run "make dep-am".
5971         * Makefile.in: Regenerate.
5972
5973         * armnetbsd.c: Replace CONST with const.
5974         * corefile.c: Likewise.
5975         * elf32-dlx.c: Likewise.
5976         * elf64-mips.c: Likewise.
5977         * mmo.c: Likewise.
5978         * ns32knetbsd.c: Likewise.
5979
5980         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash
5981         table is elf64-sparc.
5982
5983 2002-06-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
5984
5985         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code.
5986         Fix RELA addends to get not shifted in the result. Don't do special
5987         handling of R_MIPS_64 for NewABI.
5988
5989 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
5990
5991         * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
5992         (NAME(aout,slurp_reloc_table)): Likewise.
5993         * coff-mips.c (mips_relax_section): Use bfd_zalloc.
5994         * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc.
5995         (xcoff_write_archive_contents_big): Likewise.
5996         (xcoff_generate_rtinit): Likewise.
5997         (xcoff_generate_rtinit): Likewise, and check error return.
5998         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
5999         * coffgen.c (coff_section_symbol): Use bfd_zalloc.
6000         (coff_get_normalized_symtab): Likewise.
6001         (coff_make_empty_symbol): Likewise.
6002         (bfd_coff_set_symbol_class): Likewise.
6003         * cofflink.c (coff_link_add_symbols): Likewise.
6004         * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise.
6005         * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc.
6006         (bfd_ecoff_write_accumulated_debug): Likewise.
6007         * elf64-alpha.c (get_got_entry): Use bfd_zalloc.
6008         * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise.
6009         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc.
6010         * ieee.c (do_with_relocs): Use bfd_zalloc.
6011         * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise.
6012         * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
6013         (NAME(aout,slurp_reloc_table)): Likewise.
6014         (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd.
6015         * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc.
6016         * som.c (som_build_and_write_symbol_table): Likewise.
6017         (som_slurp_string_table): Likewise.
6018         (som_slurp_symbol_table): Likewise.
6019         (som_bfd_ar_write_symbol_stuff): Likewise.
6020         * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc.
6021         * sunos.c (bfd_sunos_size_dynamic_sections): Likewise.
6022         * tekhex.c (find_chunk): Likewise.  Get rid of unused "sname".
6023         * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc.
6024         * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc.
6025
6026 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
6027
6028         * elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with
6029         "group" union.
6030         (elf_group_name): Update.
6031         (elf_group_id): Define.
6032         (bfd_elf_set_group_contents): Declare.
6033         * elf.c (elf_fake_sections): Qualify use of elf_group_name.
6034         (set_group_contents): Rename to bfd_elf_set_group_contents.  Remove
6035         ATTRIBUTE_UNUSED from failedptrarg.  If elf_group_id is set, use
6036         that sym for the signature.
6037         (_bfd_elf_compute_section_file_positions): Don't call
6038         set_group_contents for "ld -r" case.
6039         (swap_out_syms): Use bfd_zalloc.
6040         * elflink.h (elf_link_add_archive_symbols): Likewise.
6041         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
6042         (elf_bfd_final_link): Call bfd_elf_set_group_contents.
6043
6044 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
6045
6046         * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
6047         relocs in opd for non-shared too.
6048
6049 2002-06-06  Jeffrey Law  <law@redhat.com>
6050
6051         * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
6052         relocations.
6053
6054 2002-06-06  Nick Clifton  <nickc@cambridge.redhat.com>
6055
6056         * merge.c: Include libiberty.h.
6057         * elf-strtab.c: Include libiberty.h.
6058
6059 2002-06-06  Elias Athanasopoulos  <eathan@otenet.gr>
6060
6061         * peXXigen.c (pe_print_idata): Remove unused variable.
6062
6063 2002-06-06  David Heine <dlheine@tensilica.com>
6064
6065         * elf.c (assign_file_positions_for_segments): Remove unallocated
6066         sections from the section to segment mapping for PT_LOAD segments.
6067         Update comment about empty loadable segments.
6068
6069 2002-06-06  Richard Sandiford  <rsandifo@redhat.com>
6070
6071         * stabs.c (_bfd_link_section_stabs): Check that the symbol offset
6072         is within the .stabstr section.
6073
6074 2002-06-06  Alan Modra  <amodra@bigpond.net.au>
6075
6076         * elf-bfd.h (struct elf_size_info <swap_symbol_in>): Function args
6077         are "const PTR", not "const PTR *".
6078         (bfd_elf32_swap_symbol_in): Likewise.
6079         (bfd_elf64_swap_symbol_in): Likewise.
6080         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR.
6081         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
6082         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
6083         (elf_link_add_object_symbols): Likewise.
6084         (elf_link_record_local_dynamic_symbol): Likewise.
6085         (elf_link_input_bfd): Likewise.
6086         (elf_gc_mark): Likewise.
6087         (elf_reloc_symbol_deleted_p): Likewise.
6088         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
6089         (mn10200_elf_relax_delete_bytes): Likewise.
6090         (mn10200_elf_symbol_address_p): Likewise.
6091         (mn10200_elf_get_relocated_section_contents): Likewise.
6092         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
6093         (mn10300_elf_relax_section): Likewise.
6094         (mn10300_elf_relax_delete_bytes): Likewise.
6095         (mn10300_elf_symbol_address_p): Likewise.
6096         (mn10300_elf_get_relocated_section_contents): Likewise.
6097         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
6098         (elf32_h8_relax_delete_bytes): Likewise.
6099         (elf32_h8_symbol_address_p): Likewise.
6100         (elf32_h8_get_relocated_section_contents): Likewise.
6101         * elf32-hppa.c (get_local_syms): Likewise.
6102         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
6103         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
6104         * elf32-sh.c (sh_elf_relax_section): Likewise.
6105         (sh_elf_relax_delete_bytes): Likewise.
6106         (sh_elf_get_relocated_section_contents): Likewise.
6107         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
6108         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
6109         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
6110         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
6111         * elf64-ppc.c (get_local_syms): Likewise.
6112         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
6113         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
6114
6115 2002-06-05  J"orn Rennecke <joern.rennecke@superh.com>
6116
6117         * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations.
6118
6119 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
6120
6121         * elf.c (group_signature): Swap in the whole symbol, and handle
6122         extracting section symbol names.
6123         (setup_group): Add comment.
6124         (set_group_contents): When called from objcopy or ld, arrange for
6125         section contents to be written.  Write group member output section
6126         indices to allow objcopy to reorganize sections.
6127         (_bfd_elf_copy_private_section_data): Copy group info.
6128
6129         * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field.
6130         (bfd_elf32_swap_symbol_in): Update prototype.
6131         (bfd_elf64_swap_symbol_in): Likewise.
6132         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *.
6133         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
6134         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
6135         (elf_link_add_object_symbols): Likewise.
6136         (elf_link_record_local_dynamic_symbol): Likewise.
6137         (elf_link_input_bfd): Likewise.
6138         (elf_gc_mark): Likewise.
6139         (elf_reloc_symbol_deleted_p): Likewise.
6140         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
6141         (mn10200_elf_relax_delete_bytes): Likewise.
6142         (mn10200_elf_symbol_address_p): Likewise.
6143         (mn10200_elf_get_relocated_section_contents): Likewise.
6144         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
6145         (mn10300_elf_relax_section): Likewise.
6146         (mn10300_elf_relax_delete_bytes): Likewise.
6147         (mn10300_elf_symbol_address_p): Likewise.
6148         (mn10300_elf_get_relocated_section_contents): Likewise.
6149         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
6150         (elf32_h8_relax_delete_bytes): Likewise.
6151         (elf32_h8_symbol_address_p): Likewise.
6152         (elf32_h8_get_relocated_section_contents): Likewise.
6153         * elf32-hppa.c (get_local_syms): Likewise.
6154         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
6155         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
6156         * elf32-sh.c (sh_elf_relax_section): Likewise.
6157         (sh_elf_relax_delete_bytes): Likewise.
6158         (sh_elf_get_relocated_section_contents): Likewise.
6159         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
6160         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
6161         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
6162         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
6163         * elf64-ppc.c (get_local_syms): Likewise.
6164         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
6165         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
6166         * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser.
6167         * elf64-alpha.c (alpha_elf_size_info): Likewise.
6168         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
6169         * elf64-mips.c (mips_elf64_size_info): Likewise.
6170         * elf64-s390.c (s390_elf64_size_info): Likewise.
6171         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
6172
6173 2002-06-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
6174
6175         * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to...
6176         elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here.
6177         elf64-mips.c (elf_backend_ignore_discarded_relocs): Use
6178         _bfd_mips_elf_ignore_discarded_relocs.
6179         elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare.
6180
6181 2002-06-05  H.J. Lu <hjl@gnu.org>
6182
6183         * elfxx-mips.c (mips_elf_calculate_relocation): Call
6184         _bfd_elf_rel_local_sym for STT_SECTION relocations against
6185         the SEC_MERGE section.
6186
6187 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
6188
6189         * coff-alpha.c: Update copyright date.
6190         * coff-mips.c: Likewise.
6191         * xcoff-target.h: Likewise.
6192
6193         * bfd-in.h: Remove "taken from the source" comment.
6194         * libbfd-in.h: Likewise.
6195         * libcoff-in.h: Likewise.
6196         * bfd-in2.h: Regenerate.
6197         * libbfd.h: Regenerate.
6198         * libcoff.h: Regenerate.
6199
6200         * elf.c (bfd_elf_discard_group): Return true.
6201         * elf-bfd.h (bfd_elf_discard_group): Declare.
6202         * bfd-in.h (bfd_elf_discard_group): Don't declare here.
6203         * section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
6204         * bfd.c (bfd_discard_group): Define.
6205         * targets.c (struct bfd_target): Add _bfd_discard_group.
6206         (BFD_JUMP_TABLE_LINK): Here too.
6207         * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
6208         * aout-adobe.c (aout_32_bfd_discard_group): Define.
6209         * aout-target.h (MY_bfd_discard_group): Define.
6210         * aout-tic30.c (MY_bfd_discard_group): Define.
6211         * binary.c (binary_bfd_discard_group): Define.
6212         * bout.c (b_out_bfd_discard_group): Define.
6213         * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
6214         * coffcode.h (coff_bfd_discard_group): Define.
6215         * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
6216         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
6217         * i386msdos.c (msdos_bfd_discard_group): Define.
6218         * i386os9k.c (os9k_bfd_discard_group): Define.
6219         * ieee.c (ieee_bfd_discard_group): Define.
6220         * ihex.c (ihex_bfd_discard_group): Define.
6221         * mmo.c (mmo_bfd_discard_group): Define.
6222         * nlm-target.h (nlm_bfd_discard_group): Define.
6223         * oasys.c (oasys_bfd_discard_group): Define.
6224         * ppcboot.c (ppcboot_bfd_discard_group): Define.
6225         * som.c (som_bfd_discard_group): Define.
6226         * srec.c (srec_bfd_discard_group): Define.
6227         * tekhex.c (tekhex_bfd_discard_group): Define.
6228         * versados.c (versados_bfd_discard_group): Define.
6229         * vms.c (vms_bfd_discard_group): Define.
6230         * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
6231         * coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
6232         (aix5coff64_vec): Likewise.
6233         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
6234
6235 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
6236
6237         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo.
6238         (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c.
6239         (elf32-sh64-com.lo): New dependency list.
6240         * Makefile.in: Regenerate.
6241         * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec)
6242         (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add
6243         elf32-sh64-com.lo.
6244         * configure: Regenerate.
6245         * elf32-sh64.c (sh64_address_in_cranges)
6246         (sh64_get_contents_type, sh64_address_is_shmedia): Move to...
6247         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb):
6248         (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to...
6249         * elf32-sh64-com.c: ...here.  New file.
6250
6251 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
6252
6253         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove
6254         ATTRIBUTE_UNUSED on used params.
6255         * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks
6256         before calling bfd_section_from_elf_index on local syms.
6257         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
6258
6259 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
6260
6261         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo.
6262         (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c.
6263         (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo.
6264         (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c.
6265         (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules.
6266         * Makefile.in: Regenerate.
6267         * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
6268         (sh64-*-netbsd*): New targets.
6269         * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec,
6270         bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec.
6271         * configure: Regenerate.
6272         * elf32-sh64-nbsd.c: New file.
6273         * elf64-sh64-nbsd.c: New file.
6274         * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec,
6275         bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and
6276         bfd_elf64_sh64lnbsd_vec.
6277
6278 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
6279
6280         * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups.
6281         (bfd_section_from_shdr): Likewise.  Set section name of group
6282         sections from signature.
6283         (group_signature): Split out from setup_group.  Ensure symbol table
6284         is available.
6285         (bfd_elf_discard_group): New function.
6286         (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on
6287         .gnu.linkonce* sections if they are members of a group.
6288         (set_group_contents): Set GRP_COMDAT flag.
6289         * section.c (bfd_discard_group): New function.
6290         * bfd-in.h (bfd_elf_discard_group): Declare.
6291         * bfd-in2.h: Regenerate.
6292         * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field.
6293         (elf_linkonce_p): Define.
6294
6295 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
6296
6297         * elf.c (bfd_section_from_shdr): Make "name" const.
6298         * elf-bfd.h (elf_backend_section_from_shdr): Likewise.
6299         * elf32-i370.c (i370_elf_section_from_shdr): Likewise.
6300         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
6301         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
6302         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
6303         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
6304         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
6305         * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise.
6306         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
6307         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
6308         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
6309
6310 2002-06-03  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
6311
6312         * elfxx-mips.c (ABI_64_P): Use backend's data to determine the
6313         ABI.
6314
6315 2002-06-02  Kazu Hirata  <kazu@cs.umass.edu>
6316
6317         * elf32-arc.c: Fix formatting.
6318         * elf32-arm.h: Likewise.
6319         * elf32-cris.c: Likewise.
6320         * elf32-dlx.c: Likewise.
6321         * elf32-hppa.c: Likewise.
6322         * elf32-i386.c: Likewise.
6323         * elf32-i386qnx.c: Likewise.
6324         * elf32-or32.c: Likewise.
6325         * elf32-s390.c: Likewise.
6326         * elf32-sh64.c: Likewise.
6327         * elf32-vax.c: Likewise.
6328         * elf32-xstormy16.c: Likewise.
6329         * elf64-alpha.c: Likewise.
6330         * elf64-mmix.c: Likewise.
6331         * elf64-ppc.c: Likewise.
6332         * elf64-s390.c: Likewise.
6333         * elf64-sh64.c: Likewise.
6334         * elf64-x86-64.c: Likewise.
6335
6336 2002-06-02  Richard Henderson  <rth@redhat.com>
6337
6338         * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
6339         null when there are no got entries for a symbol.
6340         (elf64_alpha_relax_find_tls_segment): Rearrange to avoid
6341         uninitialized variable warning.
6342
6343 2002-06-01  Richard Henderson  <rth@redhat.com>
6344
6345         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for
6346         undefined symbols here.
6347         (elf64_alpha_relax_section): Do it here.  Also test for not
6348         defined in the current module.
6349         (elf64_alpha_relocate_section_r): Split out of ...
6350         (elf64_alpha_relocate_section): ... here.  Don't dereference
6351         NULL when looking up local got entries.
6352
6353 2002-06-01  Richard Henderson  <rth@redhat.com>
6354
6355         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined
6356         symbols from JSR relaxation.
6357         (elf64_alpha_size_plt_section_1): New.
6358         (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ...
6359         (elf64_alpha_size_rela_got_1): ... here.
6360         (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ...
6361         (elf64_alpha_size_rela_got_section): ... here.
6362         (elf64_alpha_size_plt_section): New.
6363         (elf64_alpha_relax_section): Call them.
6364         (elf64_alpha_size_got_sections): Remove output_bfd arg.
6365         (elf64_alpha_finish_dynamic_symbol): Check gotent use_count.
6366
6367 2002-06-01  Richard Henderson  <rth@redhat.com>
6368
6369         * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New.
6370         (elf64_alpha_relocate_section): Use them.  Reject LE TLS relocs
6371         in shared libraries.  Fix DTPRELHI and TPRELHI value.
6372         (INSN_ADDQ, INSN_RDUNIQ): New.
6373         (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent.
6374         (elf64_alpha_relax_with_lituse): Return boolean.  Remove irelend
6375         argument.  Reject dynamic symbols.  Use LITUSE symbolic constants.
6376         (elf64_alpha_relax_got_load): Rename from relax_without_lituse.
6377         Handle GOTDTPREL and GOTTPREL relocations.
6378         (elf64_alpha_relax_gprelhilo): New.
6379         (elf64_alpha_relax_tls_get_addr): New.
6380         (elf64_alpha_relax_find_tls_segment): New.
6381         (elf64_alpha_relax_section): Handle TLS relocations.
6382         (ALPHA_ELF_LINK_HASH_TLS_IE): New.
6383         (elf64_alpha_check_relocs): Set it.
6384
6385 2002-06-01  Richard Henderson  <rth@redhat.com>
6386
6387         * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp.
6388
6389         * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic
6390         check; don't suppress dynamic relocs for non-allocated sections.
6391
6392         * elf64-alpha.c: Remove dead code.
6393
6394 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
6395
6396         * bfd-in2.h: Regenerate.
6397         * libbfd.h: Regenerate.
6398         * po/SRC-POTFILES.in: Regenerate.
6399
6400         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
6401         space for bss .plt.
6402
6403 2002-05-31  Graeme Peterson  <gp@qnx.com>
6404
6405         * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
6406         (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
6407         Run "make dep-am".
6408         * Makefile.in: Regenerate.
6409         * config.bfd: Add i[3456]86-*-nto-qnx* support.
6410         * configure.in: Add bfd_elf32_i386qnx_vec support.
6411         * configure: Regenerate.
6412         * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
6413         is_contained_by_filepos, and copy_private_bfd_data_p.
6414         * elf.c (assign_file_positions_for_segments): Call backend
6415         set_nonloadable_filepos.  Fix non-K&R call to _bfd_error_handler.
6416         (IS_CONTAINED_BY_FILEPOS): Define.
6417         (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
6418         (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS.  Typo fix.
6419         Fix non-K&R call to _bfd_error_handler.
6420         (_bfd_elf_copy_private_section_data): Use backend
6421         copy_private_bfd_data_p.
6422         * elf32-i386.c: Don't include elfxx-target.h when
6423         ELF32_I386_C_INCLUDED is defined.
6424         * elf32-i386qnx.c: New QNX elf backend file.
6425         * elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
6426         elf_backend_is_contained_by_filepos, and
6427         elf_backend_do_copy_private_bfd_data.
6428         * targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
6429
6430 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
6431
6432         * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define.
6433         Move other similar defines to start of file.
6434
6435 2002-05-30  Tom Rix  <trix@redhat.com>
6436
6437         * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA.
6438         * coff64-rs6000.c (xcoff64_rtype2howto): Same.
6439
6440 2002-05-30  Richard Henderson  <rth@redhat.com>
6441
6442         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD,
6443         ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New.
6444         (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove.
6445         (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove.
6446         (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated.
6447         (struct alpha_elf_obj_tdata): Rename total_got_entries and
6448         n_local_got_entries to total_got_size and local_got_size.
6449         (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs.
6450         (alpha_got_entry_size): New.
6451         (elf64_alpha_relax_with_lituse): Use it.
6452         (elf64_alpha_relax_without_lituse): Likewise.
6453         (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES.
6454         (get_got_entry): New.
6455         (elf64_alpha_check_relocs): Handle TLS relocs.  Reorganize.
6456         (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask.
6457         (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type.
6458         (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise.
6459         (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size.
6460         (elf64_alpha_calc_got_offsets): Likewise.
6461         (alpha_dynamic_entries_for_reloc): New.
6462         (elf64_alpha_calc_dynrel_sizes): Use it.
6463         (elf64_alpha_size_dynamic_sections): Likewise.
6464         (elf64_alpha_relocate_section): Handle TLS relocations.
6465         * reloc.c: Add Alpha TLS relocations.
6466         * bfd-in2.h, libbfd.h: Rebuild.
6467
6468 2002-05-29 Ralf Habacker <ralf.habacker@freenet.de>
6469
6470         * peXXigen.c (pe_print_idata): Remove double printed
6471         import table lines; add Bound-To comment.
6472
6473 2002-05-29  Matt Thomas  <matt@3am-software.com>
6474
6475         * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo.
6476         (BFD32_BACKENDS_CFILES): Add elf32-vax.c.
6477         (elf32-vax.lo): New rule.
6478         * Makefile.in: Regenerate.
6479         * configure.in (bfd_elf32_vax_vec)
6480         (vaxnetbsd_vec): New vectors.
6481         * configure: Regenerate.
6482         * config.bfd (vax-*-netbsdelf*)
6483         (vax-*-netbsdaout*)
6484         (vax-*-netbsd*): New targets.
6485         * elf32-vax.c: New file.
6486         * reloc.c: Add VAX relocations.
6487         * bfd-in2.h: Regenerate.
6488         * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec.
6489
6490 2002-05-29  Jason Thorpe  <thorpej@wasabisystems.com>
6491
6492         * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec
6493         and bfd_elf32_bigarm_vec to targ_selvecs.
6494
6495 2002-05-29  Ralf Habacker  <ralf.habacker@freenet.de>
6496
6497         * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables
6498         with auto-imported symbols.
6499
6500 2002-05-29  Adam Nemet  <anemet@lnxw.com>
6501
6502         * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue
6503         sections only record bfd.
6504         (bfd_elf32_arm_add_glue_sections_to_bfd): New function.
6505         * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it.
6506         * bfd-in2.h: Regenerate.
6507
6508 2002-05-28  Nick Clifton  <nickc@cambridge.redhat.com>
6509
6510         * syms.c (_bfd_stab_section_find_nearest_line): Move
6511         declaration and initialisation of saw_line and saw_func out of
6512         for loop.
6513
6514 2002-05-29  Alan Modra  <amodra@bigpond.net.au>
6515
6516         * elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
6517         (bfd_elf64_get_symbol_info): Define.
6518         * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
6519
6520 2002-05-29  Andrey Volkov  <avolkov@transas.com>
6521
6522         * cpu-h8300.c: Make default h8300 machine first in machine list.
6523
6524 2002-05-28  Kuang Hwa Lin <kuang@sbcglobal.net>
6525
6526         * config.bfd: Added DLX configuraton.
6527         * Makefile.am: Added DLX configuraton.
6528         * configure.in: Added DLX configuraton.
6529         * archures.c: Add DLX architecure.
6530         * reloc.c: Add DLX relocs.
6531         * targets.c: Added DLX target vector.
6532         * configure: Regenerate.
6533         * Makefile.in: Regenreate.
6534         * bfd-in2.h: Regenreate.
6535         * elf32-dlx.c: New file: Support DLX target.
6536         * cpu-dlx.c: New file: Support DLX target.
6537
6538 2002-05-25  Alan Modra  <amodra@bigpond.net.au>
6539
6540         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting.
6541
6542         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change.
6543         (ppc64_elf_check_relocs): Don't set up function descriptor symbol
6544         strings to point inside function code sym string.
6545         (func_desc_adjust): Likewise.
6546         (ppc64_elf_hide_symbol): Rewrite code to look up function code sym.
6547
6548 2002-05-24  Michal Ludvig  <mludvig@suse.cz>
6549
6550         * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added.
6551         (elf64_x86_64_grok_psinfo): Added.
6552
6553 2002-05-24  TAMURA Kent <kent@netbsd.org>
6554
6555         * config.bfd: Add a target for i386-netbsdpe.
6556
6557 2002-05-24  Alan Modra  <amodra@bigpond.net.au>
6558
6559         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func
6560         and is_func_descriptor.
6561         (func_desc_adjust): Hide function code sym in shared libs unless
6562         there is a matching exported function descriptor sym.
6563
6564 2002-05-23  Jakub Jelinek  <jakub@redhat.com>
6565
6566         * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
6567         for symbols from SHF_TLS section.
6568         (_bfd_elf_print_private_bfd_data): Add PT_TLS.
6569         (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
6570         (map_sections_to_segments): Build PT_TLS segment if necessary.
6571         (assign_file_positions_for_segments): Likewise.
6572         (get_program_header_size): Account for PT_TLS segment.
6573         (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
6574         SEC_THREAD_LOCAL sections to STT_TLS.
6575         * reloc.c: Add 386 and IA-64 TLS relocs.
6576         * section.c (SEC_THREAD_LOCAL): Define.
6577         (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
6578         Remove.
6579         * elflink.h (elf_link_add_object_symbols): Support .tcommon.
6580         (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
6581         unconditionally.
6582         (struct elf_final_link_info): Add first_tls_sec.
6583         (elf_bfd_final_link): Set first_tls_sec.
6584         Compute elf_hash_table (info)->tls_segment.
6585         (elf_link_output_extsym): Handle STT_TLS symbols.
6586         (elf_link_input_bfd): Likewise.
6587         * syms.c (BSF_THREAD_LOCAL): Define.
6588         * bfd-in2.h: Rebuilt.
6589         * libbfd.h: Rebuilt.
6590         * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
6591         elf_i386_mkobject, elf_i386_object_p): New functions.
6592         (elf_howto_table): Add TLS relocs.
6593         (elf_i386_reloc_type_lookup): Support TLS relocs.
6594         (elf_i386_info_to_howto_rel): Likewise.
6595         (struct elf_i386_link_hash_entry): Add tls_type.
6596         (struct elf_i386_obj_tdata): New.
6597         (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
6598         New macros.
6599         (struct elf_i386_link_hash_table): Add tls_ldm_got.
6600         (link_hash_newfunc): Clear tls_type.
6601         (elf_i386_check_relocs): Support TLS relocs.
6602         (elf_i386_gc_sweep_hook): Likewise.
6603         (allocate_dynrelocs): Likewise.
6604         (elf_i386_size_dynamic_sections): Likewise.
6605         (elf_i386_relocate_section): Likewise.
6606         (elf_i386_finish_dynamic_symbol): Likewise.
6607         (bfd_elf32_mkobject, elf_backend_object_p): Define.
6608         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
6609         dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
6610         want_tprel, want_dtpmod, want_dtprel.
6611         (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
6612         (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
6613         R_IA64_LTOFF_TPREL22.
6614         (elf_code_to_howto_index): Add TLS relocs.
6615         (elfNN_ia64_check_relocs): Support TLS relocs.
6616         (allocate_global_data_got): Account for TLS .got data.
6617         (allocate_dynrel_entries): Account for TLS dynamic relocations.
6618         (elfNN_ia64_install_value): Supprt TLS relocs.
6619         (set_got_entry): Support TLS relocs.
6620         (elfNN_ia64_relocate_section): Likewise.
6621
6622 2002-05-23  Nick Clifton  <nickc@cambridge.redhat.com>
6623
6624         * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb
6625         BLX reloc round the relocation up rather than down.
6626         * coff-arm.c (coff_arm_relocate_section): Likewise.
6627
6628 2002-05-21  H.J. Lu  (hjl@gnu.org)
6629
6630         * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple
6631         definition.
6632
6633 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
6634
6635         * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt.
6636         (ppc64_elf_relocate_section): Handle unresolved relocs in opd.
6637
6638 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
6639
6640         * elf64-ppc.c (ppc64_elf_relocate_section): Return false for
6641         unresolved relocs.
6642         (ppc64_elf_size_dynamic_sections): Check for splt NULL.
6643
6644 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6645
6646         * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
6647         non-ELF targets.
6648
6649 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6650
6651         * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return
6652         an error value.
6653         * elflink.h (elf_link_output_relocs): Likewise. Improve error message.
6654         return with false on error.
6655         (elf_link_input_bfd): Check reloc_emitter return value.
6656
6657 2002-05-21  Jason Thorpe  <thorpej@wasabisystems.com>
6658
6659         * config.bfd (armeb-*-netbsdelf*): New target.
6660
6661 2002-05-20  Alan Modra  <amodra@bigpond.net.au>
6662
6663         * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
6664         at the plt call stub.
6665
6666 2002-05-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6667
6668         * cpu-mips.c (mips_compatible): Don't try to check machine
6669         compatibility.
6670
6671 2002-05-18  Tom Rix  <trix@redhat.com>
6672
6673         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent.
6674
6675 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
6676
6677         * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting.
6678         (ppc64_elf_relocate_section): Don't warn about reloc overflow when
6679         we've already warned about an undefined symbol.  Report more
6680         detail on reloc errors.
6681
6682 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
6683
6684         * acinclude.m4 (AM_INSTALL_LIBBFD): New.
6685         * configure.in: Invoke AM_INSTALL_LIBBFD.
6686         * Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
6687         (install_libbfd): .. New target.
6688         (uninstall_libbfd): Likewise.
6689         (install-bfdlibLTLIBRARIES): Likewise.
6690         (uninstall-bfdlibLTLIBRARIES): Likewise.
6691         (bfdlibdir): New.
6692         (bfdincludedir): New.
6693         (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
6694         * aclocal.m4: Regenerate.
6695         * configure: Regenerate.
6696         * Makefile.in: Regenerate.
6697
6698 2002-05-17  Stuart Balfour <sbalfour@cisco.com>
6699
6700         * hash.c (bfd_hash_lookup): Remove computation of len from inside
6701         hash loop.
6702
6703 2002-05-16  Nick Clifton  <nickc@cambridge.redhat.com>
6704
6705         * config.bfd: Add targets for sh64-linux (little endian and
6706         big endian).
6707
6708 2002-05-15  Laurent Pinchart <laurent.pinchart@skynet.be>
6709
6710         * peXXigen.c (pe_print_idata): Do not assume that the first thunk
6711         is located in the same section as the import table.  Instead
6712         check, and if necessary load the section containing the thunk.
6713
6714 2002-05-15  Nick Clifton  <nickc@cambridge.redhat.com>
6715
6716         * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with
6717         bfd_bread.
6718         (xcoff64_core_file_matches_executable_p): Replace bfd_read
6719         with bfd_bread.
6720
6721 2002-05-15  Alan Modra  <amodra@bigpond.net.au>
6722
6723         * aix5ppc-core.c: Warning fixes.
6724         * aout-adobe.c (aout_32_bfd_link_just_syms): Define.
6725         * aout-target.h (MY_bfd_link_just_syms): Define.
6726         * aout-tic30.c (MY_bfd_link_just_syms): Define.
6727         * bfd.c (bfd_link_just_syms): Define.
6728         * binary.c (binary_bfd_link_just_syms): Define.
6729         * bout.c (b_out_bfd_link_just_syms): Define.
6730         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
6731         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
6732         * coffcode.h (coff_bfd_link_just_syms): Define.
6733         * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
6734         (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
6735         (_bfd_elf_link_just_syms): Declare.
6736         * elf.c (_bfd_elf_link_just_syms): New function.
6737         * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
6738         sections haven't already been discarded by the linker.
6739         * elflink.h (elf_link_add_object_symbols): Likewise for stab
6740         sections and SEC_MERGE sections.
6741         (elf_bfd_discard_info): Similarly here.
6742         * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
6743         * i386msdos.c (msdos_bfd_link_just_syms): Define.
6744         * i386os9k.c (os9k_bfd_link_just_syms): Define.
6745         * ieee.c (ieee_bfd_link_just_syms): Define.
6746         * ihex.c (ihex_bfd_link_just_syms): Define.
6747         * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
6748         (_bfd_generic_link_just_syms): Declare.
6749         * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
6750         * linker.c (_bfd_generic_link_just_syms): New function.
6751         * mmo.c (mmo_bfd_link_just_syms): Define.
6752         * nlm-target.h (nlm_bfd_link_just_syms): Define.
6753         * oasys.c (oasys_bfd_link_just_syms): Define.
6754         * ppcboot.c (ppcboot_bfd_link_just_syms): Define.
6755         * som.c (som_bfd_link_just_syms): Define.
6756         * srec.c (srec_bfd_link_just_syms): Define.
6757         * targets.c (struct bfd_target): Add _bfd_link_just_syms.
6758         (BFD_JUMP_TABLE_LINK): And here.
6759         * tekhex.c (tekhex_bfd_link_just_syms): Define.
6760         * versados.c (versados_bfd_link_just_syms): Define.
6761         * vms.c (vms_bfd_link_just_syms): Define.
6762         * libbfd.h: Regenerate.
6763         * bfd-in2.h: Regenerate.
6764
6765 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6766
6767         * elf32-mips.c: Remove superfluous definitions copied from
6768         elfxx-mips.c.
6769         (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the
6770         SGIish vectors to check the special case.
6771         (mips_elf_hi16_reloc): Fix comment.
6772         (mips_elf_got16_reloc): Likewise.
6773         (_bfd_mips_elf32_gprel16_reloc): Likewise.
6774         (elf_reloc_map): Code cleanup.
6775         (mips_reloc_map): Add comment.
6776         (bfd_elf23_bfd_reloc_type_lookup): Code cleanup.
6777         (mips_elf32_rtype_to_howto): Likewise.
6778         (mips_elf32_discard_info): Likewise.
6779         (elf32_mips_irix_compat): Invert logic: Only SGIish vectors
6780         lead to IRIX compatibility now.
6781
6782 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6783
6784         * elfxx-mips.c: Call it IRIX, not Irix in comments.
6785
6786 2002-05-13  Jason Thorpe  <thorpej@wasabisystems.com>
6787
6788         * config.bfd (shle-*-netbsdelf*): Add target which includes
6789         sh64 support.
6790
6791 2002-05-13  David Edelsohn  <edelsohn@gnu.org>
6792
6793         * configure.in: Revert 2002-04-07.  Instead, auto-configure
6794         HAVE_ST_C_IMPL.
6795         * configure: Regenerate.
6796         * config.in: Regenerate.
6797         * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL
6798         or AIX_5_CORE.
6799
6800 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
6801
6802         * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd
6803         corefiles as well.2
6804         * configure: Regenerate.
6805
6806 2002-05-13  Alan Modra  <amodra@bigpond.net.au>
6807
6808         * Makefile.am (install-data-local): Install headers to
6809         $(exec_prefix)/include.
6810         * Makefile.in: Regenerate.
6811
6812 2002-05-11  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
6813             Daniel Jacobowitz  <drow@mvista.com>
6814
6815         * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE.  Don't
6816         map BFD_RELOC_RVA.
6817
6818 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
6819
6820         * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*,
6821         hppa*-*-openbsd*): New targets.
6822         * configure.in (alpha*-*-openbsd*): Set COREFILE.
6823         * configure: Regenerate.
6824
6825 2002-05-10  Tom Rix  <trix@redhat.com>
6826
6827         * coff64-rs6000.c (xcoff64_reloc_type_br): New function for
6828         xcoff64_ppc_relocate_section.
6829         * coff-rs6000.c : Extern common xcoff_reloc_type functions.
6830         * libxcoff.h: Common xcoff_reloc_type function declaration.
6831
6832 2002-05-10  Alan Modra  <amodra@bigpond.net.au>
6833
6834         * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks
6835         added in 2002-05-09 commit.
6836
6837         * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04,
6838         don't look for stubs on all undefined syms.
6839
6840 2002-05-09  Alan Modra  <amodra@bigpond.net.au>
6841
6842         * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete.
6843         (ppc64_elf_howto_raw <R_PPC64_RELATIVE>): Not pc_relative or
6844         pcrel_offset.
6845
6846         * elf32-i386.c (elf_howto_table): Comments.
6847         (elf_i386_relocate_section): Handle more relocs for relocatable
6848         linking and against SEC_MERGE sections.
6849
6850 2002-05-08  Alan Modra  <amodra@bigpond.net.au>
6851
6852         * elf32-ppc.c (ppc_elf_create_got): New function.
6853         (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before
6854         _bfd_elf_create_dynamic_sections.  Correct .plt flags.
6855         (ppc_elf_check_relocs): Use ppc_elf_create_got in place of
6856         _bfd_elf_create_got_section.
6857
6858 2002-05-07  Alan Modra  <amodra@bigpond.net.au>
6859
6860         * elf-bfd.h (struct elf_backend_data): Add rela_normal.
6861         * elfxx-target.h (elf_backend_rela_normal): Define.
6862         (elfNN_bed): Init rela_normal.
6863         * elflink.h (elf_link_input_bfd <emit_relocs>): Handle adjustment
6864         for section symbols here if rela_normal.  Simplify abs section test.
6865         * elf-m10200.c (mn10200_elf_relocate_section): If relocatable,
6866         return immediately.  Remove code handling relocatable linking.
6867         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
6868         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
6869         * elf32-i370.c (i370_elf_relocate_section): Likewise.
6870         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
6871         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
6872         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
6873         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
6874         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
6875         * elf32-s390.c (elf_s390_relocate_section): Likewise.
6876         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
6877         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
6878         * elf64-s390.c (elf_s390_relocate_section): Likewise.
6879         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
6880         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
6881         * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL.
6882         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
6883         * elf-m10200.c (elf_backend_rela_normal): Define.
6884         * elf-m10300.c (elf_backend_rela_normal): Define.
6885         * elf32-fr30.c (elf_backend_rela_normal): Define.
6886         * elf32-i370.c (elf_backend_rela_normal): Define.
6887         * elf32-i860.c (elf_backend_rela_normal): Define.
6888         * elf32-m68k.c (elf_backend_rela_normal): Define.
6889         * elf32-mcore.c (elf_backend_rela_normal): Define.
6890         * elf32-openrisc.c (elf_backend_rela_normal): Define.
6891         * elf32-ppc.c (elf_backend_rela_normal): Define.
6892         * elf32-s390.c (elf_backend_rela_normal): Define.
6893         * elf32-xstormy16.c (elf_backend_rela_normal): Define.
6894         * elf64-ppc.c (elf_backend_rela_normal): Define.
6895         * elf64-s390.c (elf_backend_rela_normal): Define.
6896         * elf64-x86-64.c (elf_backend_rela_normal): Define.
6897         * elfxx-ia64.c (elf_backend_rela_normal): Define.
6898         * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL.
6899         * elf32-m32r.c (elf_backend_rela_normal): Likewise.
6900
6901 2002-05-06  Nick Clifton  <nickc@cambridge.redhat.com>
6902
6903         * elf32-arm.h (elf32_arm_final_link_relocate): Convert
6904         'reloc_signed_max' and 'reloc_signed_min' into half-word offsets.
6905
6906 2002-05-06  Alan Modra  <amodra@bigpond.net.au>
6907
6908         * elflink.h (elf_link_input_bfd <emit_relocs>): Adjust r_offset
6909         when not relocatable.  Fix reloc_emitter call for K&R.
6910
6911 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
6912
6913         * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code
6914         reloading local sym addend mistakenly removed in 2002-05-01 change.
6915
6916         * dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
6917         (read_abbrevs): Change "offset" param to bfd_vma.
6918         (parse_comp_unit): Change "version" and addr_size to unsigned ints.
6919         Change "abbrev_offset" to bfd_vma.
6920         (read_indirect_string): Use correct conversion chars in error
6921         message format string, cast bfd_vma's to unsigned long.
6922         (read_abbrevs): Likewise.
6923         (read_attribute_value): Likewise.
6924         (decode_line_info): Likewise.
6925         (scan_unit_for_functions): Likewise.
6926         (parse_comp_unit): Likewise.
6927
6928 2002-05-04  Tom Rix  <trix@redhat.com>
6929
6930         * coffswap.h (coff_swap_reloc_in): Remove XCOFF support.
6931         (coff_swap_reloc_out): Same.
6932         * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h.
6933         (xcoff_swap_reloc_out): Same.
6934         (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special
6935         case some 16 bit relocs. Add reloc value to output.
6936         (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit
6937         R_RBR. Improve names.
6938         (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS.
6939         (bfd_xcoff_backend_data): Update with new reloc swap names.
6940         (bfd_pmac_xcoff_backend_data) : Same.
6941         * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h.
6942         (xcoff64_swap_reloc_out): Same.
6943         (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit
6944         R_POS. Add reloc value to output.
6945         (xcoff64_howto_table): Move 64 bit R_POS to first entry.  Add 16
6946         bit R_RBR. Improve names, masks.
6947         (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS.
6948         (bfd_xcoff_backend_data): Update with new reloc swap names.
6949         (bfd_xcoff_aix5_backend_data) : Same.
6950
6951 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
6952
6953         * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add
6954         bfd_count top_index, input_list, all_local_syms.
6955         (elf32_hppa_setup_section_lists): New function, split from
6956         elf32_hppa_size_stubs.
6957         (elf32_hppa_next_input_section): Likewise.
6958         (group_sections): Likewise.
6959         (get_local_syms): Likewise.
6960         (elf32_hppa_size_stubs): Adjust for split out functions.  Look for
6961         stubs on undefined syms too.
6962         (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*.
6963         Only access htab elf fields when we have an elf hash table.
6964         * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare.
6965         (elf32_hppa_next_input_section): Declare.
6966
6967 2002-05-04  Bob Byrnes  <byrnes@curl.com>
6968
6969         * opncls.c (_bfd_new_bfd_contained_in): Check return value of
6970         _bfd_new_bfd.
6971
6972 2002-05-03  H.J. Lu  (hjl@gnu.org)
6973
6974         * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
6975         (mips_elf_link_hash_newfunc): Initialize forced_local to false.
6976         (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
6977         to hide a global symbol.
6978         (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
6979         forced_local to true.
6980
6981 2002-05-02  Richard Henderson  <rth@redhat.com>
6982
6983         * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs
6984         vs SHN_UNDEF to zero.
6985
6986 2002-05-02  Alan Modra  <amodra@bigpond.net.au>
6987
6988         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_SECTOFF>): Change to a
6989         16 bit reloc.
6990         <R_PPC64_SECTOFF_DS>: Likewise.
6991         (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
6992         SECTOFF reloc.
6993         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_SECTOFF>): Correct.
6994         (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
6995         SECTOFF reloc.
6996
6997         * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete.
6998         (ppc64_elf_ha_reloc): New function.
6999         (ppc64_elf_brtaken_reloc): New function.
7000         (ppc64_elf_sectoff_reloc): New function.
7001         (ppc64_elf_sectoff_ha_reloc): New function.
7002         (ppc64_elf_toc_reloc): New function.
7003         (ppc64_elf_toc_ha_reloc): New function.
7004         (ppc64_elf_toc64_reloc): New function.
7005         (ppc64_elf_unhandled_reloc): New function.
7006         (ppc64_elf_howto_raw): Use the above.
7007         <R_PPC64_RELATIVE>: Mark pc_relative, pcrel_offset.
7008         <R_PPC64_SECTOFF>: Not pc_relative or pcrel_offset.  Fix dst_mask.
7009         <R_PPC64_SECTOFF_DS>: Likewise.
7010         (IS_ABSOLUTE_RELOC): Update.
7011         (struct ppc_link_hash_table): Add have_undefweak.
7012         (ppc64_elf_link_hash_table_create): Init.
7013         (func_desc_adjust): Set have_undefweak.
7014         (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier.  Only
7015         add the .sfpr blr when have_undefweak.
7016         (ppc64_elf_setup_section_lists): Check hash table flavour.
7017         (ppc64_elf_next_input_section): Move output_section->owner test to
7018         ppc64elf.em.
7019         (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param
7020         and relocatable test.  Return TOCstart and don't set elf_gp.
7021         (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch
7022         offset calculation.  Add assert on weak sym branch tweaks.
7023         * elf64-ppc.h (ppc64_elf_set_toc): Delete.
7024         (ppc64_elf_toc): Declare.
7025         (ppc64_elf_next_input_section): Update.
7026
7027 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
7028
7029         * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL
7030         file_name.
7031
7032 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
7033
7034         * elf64-ppc.c (CROR_151515, CROR_313131): Define.
7035         (ppc64_elf_relocate_section): Use them.  Don't look for plt calls
7036         on R_PPC64_ADDR24 relocs.  Require a nop or no link reg on plt
7037         call branches.  Correct undefined weak destination.
7038         (ppc64_elf_func_desc_adjust): Always create at least one blr in
7039         .sfpr, and correct case where either only savef* or restf* is
7040         needed.
7041
7042         Long branch stubs, multiple stub sections.
7043         * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare.
7044         (ppc64_elf_next_input_section): Declare.
7045         * elf64-ppc.c: Move linker-only prototypes.
7046         (STUB_SUFFIX): Define.
7047         (enum ppc_stub_type): New.
7048         (struct ppc_stub_hash_entry): New.
7049         (struct ppc_branch_hash_entry): New.
7050         (struct ppc_link_hash_entry): Add stub_cache, oh.
7051         (struct ppc_link_hash_table): Add stub_hash_table etc.  Remove
7052         sstub.  Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration.
7053         Rename plt_overflow to stub_error.
7054         (ppc_stub_hash_lookup): Define.
7055         (ppc_branch_hash_lookup): Define.
7056         (stub_hash_newfunc): New function.
7057         (branch_hash_newfunc): New function.
7058         (link_hash_newfunc): Init new fields.
7059         (ppc64_elf_link_hash_table_create): Likewise.
7060         (ppc64_elf_link_hash_table_free): New function.
7061         (ppc_stub_name): New function.
7062         (ppc_get_stub_entry): New function.
7063         (ppc_add_stub): New function.
7064         (create_linkage_sections): Use bfd_make_section_anyway.  Create
7065         .branch_lt and .rela.branch_lt sections.  Don't create .stub.
7066         (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*,
7067         and set up for plt call stubs.  Link func and func desc syms.
7068         (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24.
7069         (func_desc_adjust): Avoid hash lookup when func desc sym available
7070         via shortcut, and set links when processing.
7071         (ppc64_elf_hide_symbol): Likewise.
7072         (allocate_dynrelocs): Don't allocate stub section here.
7073         (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt.
7074         Remove sstub code.
7075         (ppc_type_of_stub): New function.
7076         (build_one_stub): Delete.
7077         (ppc_build_one_stub): New function.
7078         (ppc_size_one_stub): New function.
7079         (ppc64_elf_setup_section_lists): New function.
7080         (ppc64_elf_next_input_section): New function.
7081         (group_sections): New function.
7082         (get_local_syms): New function.
7083         (ppc64_elf_size_stubs): Rewrite.
7084         (ppc64_elf_build_stubs): Rewrite.
7085         (ppc64_elf_relocate_section): Look up stub entry for REL24
7086         relocs.  Don't propagate REL14* to dynamic objects.  Look for long
7087         branch stubs if REL14* or REL24 relocs won't reach.
7088         (bfd_elf64_bfd_link_hash_table_free): Define.
7089
7090 2002-04-30  Mark Mitchell  <mark@codesourcery.com>
7091
7092         * config.bfd: Add support for powerpc-*-windiss.
7093
7094 2002-04-30  Tom Rix  <trix@redhat.com>
7095
7096         * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT
7097         symbol names into the hash table.
7098
7099 2002-04-28  Tom Rix  <trix@redhat.com>
7100
7101         * coff-rs6000.c (xcoff_calculate_relocation) : Function table for
7102         calulating relocations.
7103         (xcoff_complain_overflow) : Function table for relocation errors.
7104         (xcoff_ppc_relocate_section): Use relocation and complain function
7105         tables.
7106         (xcoff_complain_overflow_unsigned_func): New complain function.
7107         (xcoff_complain_overflow_signed_func): Same.
7108         (xcoff_complain_overflow_bitfield_func): Same.
7109         (xcoff_complain_overflow_dont_func): Same.
7110         (xcoff_reloc_type_crel): New recot function.
7111         (xcoff_reloc_type_br): Same.
7112         (xcoff_reloc_type_ba): Same.
7113         (xcoff_reloc_type_toc): Same.
7114         (xcoff_reloc_type_rel): Same.
7115         (xcoff_reloc_type_neg): Same.
7116         (xcoff_reloc_type_pos): Same.
7117         (xcoff_reloc_type_fail): Same.
7118         (xcoff_reloc_type_noop): Same.
7119         * libxcoff.h : Declare common parts for xcoff64.
7120         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation
7121         and complain function tables.
7122
7123 2002-04-28  Alan Modra  <amodra@bigpond.net.au>
7124
7125         * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo.
7126         * elf32-hppa.c (elf32_hppa_final_link): Formatting.
7127
7128 2002-04-26  Alan Modra  <amodra@bigpond.net.au>
7129
7130         * opncls.c (bfd_make_readable): Call bfd_section_list_clear.
7131         * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
7132
7133         * elflink.h (elf_bfd_final_link): Ensure input bfd class is the
7134         same as the output before calling elf_link_input_bfd.
7135
7136         * coffcode.h (coff_compute_section_file_positions): Set
7137         section_tail after shuffling section list.
7138
7139 2002-04-24  Christian Groessler <chris@groessler.org>
7140
7141         * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The
7142         addresses are 23bit with a special layout, not plain 32bit
7143         values.  Prevent relocation of immediate values.
7144
7145 2002-04-24  Chris G. Demetriou  <cgd@broadcom.com>
7146
7147         * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or
7148         MIPS-16 ASE flags are set, print something to indicate that.
7149
7150 2002-04-23  Alan Modra  <amodra@bigpond.net.au>
7151
7152         * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition
7153         under which a plt call stub is used.
7154         (final_link_relocate): Similarly.
7155         (allocate_plt_static): Clear h-plabel except when plt entry is
7156         exclusively used for a plabel.
7157         (allocate_dynrelocs): Use the above to simplify plt sizing.
7158         (struct elf32_hppa_link_hash_table): Add has_22bit_branch.
7159         (elf32_hppa_link_hash_table_create): Init.
7160         (BL22_RP): Define.
7161         (hppa_build_one_stub): Use BL22_RP if has_22bit_branch.
7162         (elf32_hppa_check_relocs): Set has_22bit_branch.
7163
7164         * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message.
7165         (final_link_relocate): Likewise.
7166
7167 2002-04-22  Jakub Jelinek  <jakub@redhat.com>
7168
7169         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build
7170         search table if some FDE is DW_EH_PE_aligned encoded either.
7171         (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially.
7172
7173 2002-04-22  Richard Smith  <richard@ex-parrot.com>
7174             Jakub Jelinek  <jakub@redhat.com>
7175
7176         * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative.
7177         (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel
7178         encoded personality.
7179         (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality
7180         for CIE/FDE removal.
7181
7182 2002-04-20  Tom Rix  <trix@redhat.com>
7183
7184         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent.
7185
7186 2002-04-20  Alan Modra  <amodra@bigpond.net.au>
7187
7188         * archures.c (bfd_lookup_arch): Move the list order comment..
7189         (struct bfd_arch_info): ..to where it belongs.
7190         * bfd-in2.h: Regenerate.
7191
7192         * archures.c (bfd_lookup_arch): Add comment on list order.
7193         (bfd_default_set_arch_mach): Use bfd_lookup_arch.
7194         * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default
7195         is always at head of list.
7196
7197 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
7198
7199         * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9,
7200         insert_thumb_branch, record_thumb_to_arm_glue): Suppress
7201         definition of these functions for ARM_WINCE builds as they are
7202         not used.
7203         (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define
7204         for ARM_WINCE builds.
7205
7206 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
7207
7208         * coff-arm.c (bfd_arm_process_before_allocation):
7209
7210 2002-04-17  J"orn Rennecke <joern.rennecke@superh.com>
7211
7212         * cpu-sh.c (scan_mach): Delete.
7213         (arch_info_struct): Replace scan_mach with bfd_default_scan.
7214         (bfd_sh_arch): Likewise.
7215
7216 2002-04-16  Nick Clifton  <nickc@cambridge.redhat.com>
7217
7218         * ihex.c (ihex_write_object_contents): Fix check for records
7219         crossing 64K boundaries.
7220
7221 2002-04-16  Alan Modra  <amodra@bigpond.net.au>
7222
7223         * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
7224         type rather than just assuming entries are ELF.
7225         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
7226         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
7227         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
7228         * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
7229         rather than elf_link_hash_entry.
7230
7231 2002-04-15  Richard Henderson  <rth@redhat.com>
7232
7233         * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow
7234         n32 binaries.
7235
7236 2002-04-15  Michael Snyder  <msnyder@redhat.com>
7237
7238         * opncls.c (bfd_close): Write contents if writeable.
7239         Minor formatting tidy-ups.
7240
7241 2002-04-15  Alan Modra  <amodra@bigpond.net.au>
7242
7243         * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.
7244
7245 2002-04-12  Michael Snyder  <msnyder@redhat.com>
7246
7247         * bfd-in.h (bfd_get_section_lma): New access macro.
7248         Minor white-space fix-up.
7249
7250 2002-04-12  Alan Modra  <amodra@bigpond.net.au>
7251
7252         * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or
7253         header pad.
7254
7255 2002-04-09  DJ Delorie  <dj@redhat.com>
7256
7257         * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks.
7258
7259 2002-04-09  Casper S. Hornstrup <chorns@users.sourceforge.net>
7260
7261         * coffcode.h (coff_read_word): New.
7262         (coff_compute_checksum): New.
7263         (coff_apply_checksum): New.
7264         (coff_write_object_contents): Call coff_apply_checksum () to
7265         apply checksum to PE image.
7266
7267 2002-04-08  Randolph Chung  <tausq@debian.org>
7268
7269         * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h.
7270         (elf32_hppa_final_link): Split out sorting logic to..
7271         * elf-hppa.h (elf_hppa_sort_unwind): ..here.
7272         (elf_hppa_final_link): Call elf_hppa_sort_unwind.
7273
7274 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
7275
7276         * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]*
7277         pattern.
7278         * configure: Re-generate.
7279
7280 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
7281
7282         * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version
7283         is greater or equal to 4.3.3.
7284         * configure: Regenerate.
7285         Fix PR gdb/344.
7286
7287 2002-04-05  Hans-Peter Nilsson  <hp@axis.com>
7288
7289         * elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
7290         R_CRIS_32_PCREL>: Fix typo in name.
7291         (cris_elf_check_relocs): Always create .rela.got here when
7292         R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen.
7293         (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here;
7294         assume it's created.
7295
7296 2002-04-04  Daniel Jacobowitz  <drow@mvista.com>
7297
7298         * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define.
7299         * aout-target.h (MY_bfd_link_hash_table_free): Conditionally
7300         define.
7301         * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise.
7302         * bfd.c (bfd_link_hash_table_free): Define.
7303         * binary.c (binary_bfd_link_hash_table_free): Define.
7304         * bout.c (b_out_bfd_link_hash_table_free): Define.
7305         * coff-rs6000.c (rs6000coff_vec): Include
7306         _bfd_generic_link_hash_table_free.
7307         (pmac_xcoff_vec): Likewise.
7308         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
7309         (aix5coff64_vec): Likewise.
7310         * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define.
7311         * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function.
7312         (bfd_elf32_bfd_link_hash_table_free): Define.
7313         * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function.
7314         (bfd_elf32_bfd_link_hash_table_free): Define.
7315         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally
7316         define.
7317         * i386msdos.c (msdos_bfd_link_hash_table_free): Define.
7318         * i386os9k.c (os9k_bfd_link_hash_table_free): Define.
7319         * ieee.c (ieee_bfd_link_hash_table_free): Define.
7320         * ihex.c (ihex_bfd_link_hash_table_free): Define.
7321         * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define.
7322         (_bfd_generic_link_hash_table_free): Add prototype.
7323         * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype.
7324         * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define.
7325         * linker.c (_bfd_generic_link_hash_table_free): New function.
7326         * mmo.c (mmo_bfd_link_hash_table_free): Define.
7327         * nlm-target.h (nlm_bfd_link_hash_table_free): Define.
7328         * oasys.c (oasys_bfd_link_hash_table_free): Define.
7329         * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define.
7330         * som.c (som_bfd_link_hash_table_free): Define.
7331         * srec.c (srec_bfd_link_hash_table_free): Define.
7332         * tekhex.c (tekhex_bfd_link_hash_table_free): Define.
7333         * versados.c (versados_bfd_link_hash_table_free): Define.
7334         * vms.c (vms_bfd_link_hash_table_free): New function.
7335         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function.
7336
7337         * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc
7338         instead of bfd_alloc.
7339         * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
7340         * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise.
7341         * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise.
7342         * cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
7343         * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
7344         * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
7345         * elf.c (_bfd_elf_link_hash_table_create): Likewise.
7346         * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise.
7347         * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
7348         * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
7349         * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
7350         * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
7351         * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
7352         * elf32-sh.c (sh_elf_link_hash_table_create): Likewise.
7353         * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise.
7354         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
7355         * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
7356         * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
7357         * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise.
7358         * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise.
7359         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
7360         * linker.c (_bfd_generic_link_hash_table_create): Likewise.
7361         * m68klinux.c (linux_link_hash_table_create): Likewise.
7362         * sparclinux.c (linux_link_hash_table_create): Likewise.
7363         * sunos.c (sunos_link_hash_table_create): Likewise.
7364         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
7365
7366         * targets.c: Add _bfd_link_hash_table_free to xvec.
7367
7368         * bfd-in2.h: Regenerate.
7369         * libbfd.h: Regenerate.
7370         * libcoff.h: Regenerate.
7371
7372 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
7373
7374         * dep-in.sed: Cope with absolute paths.
7375         * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR.
7376         Run "make dep-am".
7377         * Makefile.in: Regenerate.
7378         * coff-arm.c: Fix copyright date.
7379         * cpu-h8300.c: Likewise.
7380         * cpu-i370.c: Likewise.
7381         * cpu-s390.c: Likewise.
7382         * cpu-mips.c: Likewise.
7383         * po/SRC-POTFILES.in: Regenerate.
7384
7385 2002-04-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7386
7387         * Makefile.am: Add elfxx-mips.c to the known backends.
7388         (elf32-mips.lo): remove dependency to coff/external.h.
7389         * Makefile.in: Regenerate.
7390         * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo
7391         Remove elf32-mips.lo from 64 bit vectors. Update dependencies
7392         accordingly.
7393         * configure: Regenerate.
7394         * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h.
7395         (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c.
7396         (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New
7397         MIPS specific backend functions.
7398         * elf32-mips.c: Moved most code to elfxx-mips.c.
7399         (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make
7400         static.
7401         (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc.
7402         (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc.
7403         (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc.
7404         (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed
7405         interface to allow selection of the right REL or RELA howto table.
7406         (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made
7407         static. Let it refuse n32 objects.
7408         (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus.
7409         (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo.
7410         (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info.
7411         (elf32_mips_ignore_discarded_relocs): Rename from
7412         _bfd_elf32_mips_ignore_discarded_relocs.
7413         (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section.
7414         (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT.
7415         (elf_mips_howto_table_rela): Remove.
7416         * elf64-mips.c: Moved most code to elfxx-mips.c.
7417         (bfd_elf64_bfd_reloc_type_lookup): Make static.
7418         (mips_elf64_rtype_to_howto): New function.
7419         (mips_elf64_object_p): Likewise.
7420         (elf64_mips_irix_compat): Likewise.
7421         * elfxx-mips.c: New file containing common code merged together from
7422         elf32-mips.c and elf64-mips.c.
7423         * elfxx-mips.h: New file containing MIPS specific prototypes from
7424         elf-bfd.h.
7425         * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and
7426         elf_backend_mips_rtype_to_howto.
7427
7428 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
7429
7430         * srec.c (MAXCHUNK, Chunk): Revise comments.
7431         (srec_write_record): Correct buffer size.
7432         (srec_write_header): Do without intermediate buffer.
7433         (srec_write_section): Validate Chunk.
7434         (srec_write_terminator): Pass NULL instead of dummy buffer.
7435         (srec_write_symbols): Pass file and symbol names directly to
7436         bfd_bwrite so sprintf won't overflow buffer.
7437
7438 2002-04-03  Jakub Jelinek  <jakub@redhat.com>
7439
7440         * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic
7441         PC relative relocs against hidden symbols.
7442         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7443
7444 2002-04-03  Alan Modra  <amodra@bigpond.net.au>
7445
7446         * elf.c (_bfd_elf_make_section_from_shdr): When setting section
7447         LMAs, loop over segments until p_vaddr and p_memsz specify an
7448         extent enclosing the section.
7449
7450 2002-04-02  Nick Clifton  <nickc@cambridge.redhat.com>
7451
7452         * ihex.c (ihex_write_object_contents): Do not allow records to
7453         cross a 64K boundary - wrap if necessary.
7454
7455 2002-04-01  Nathan Williams  <nathanw@wasabisystems.com>
7456
7457         * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
7458         which caused the returned LWP ID to always be 0.
7459
7460 2002-04-01  Richard Henderson  <rth@redhat.com>
7461
7462         * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
7463         (elf32_sparc_relocate_section): Use it to figure out when to
7464         initialize .got entries.
7465         * elf64-sparc.c: Similarly.
7466
7467 2002-03-28  Alan Modra  <amodra@bigpond.net.au>
7468
7469         * linker.c (link_action): Ignore duplicate warning syms.
7470         (_bfd_generic_link_write_global_symbol): Follow warning symbol link.
7471         * elflink.h (elf_adjust_dynstr_offsets): Likewise.
7472         (elf_adjust_dynamic_symbol): Likewise.
7473         (elf_export_symbol): Likewise.
7474         (elf_link_find_version_dependencies): Likewise.
7475         (elf_link_assign_sym_version): Likewise.
7476         (elf_link_sec_merge_syms): Likewise.
7477         (elf_link_output_extsym): Likewise.
7478         (elf_gc_sweep_symbol): Likewise.
7479         (elf_gc_propagate_vtable_entries_used): Likewise.
7480         (elf_gc_smash_unused_vtentry_relocs): Likewise.
7481         (elf_gc_allocate_got_offsets): Likewise.
7482         (elf_collect_hash_codes): Likewise.
7483         * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
7484         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
7485         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
7486         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
7487         * elf32-arm.h (elf32_arm_discard_copies): Likewise.
7488         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
7489         (elf_cris_discard_excess_dso_dynamics): Likewise.
7490         * elf32-hppa.c (clobber_millicode_symbols): Likewise.
7491         (mark_PIC_calls): Likewise.
7492         (allocate_plt_static): Likewise.
7493         (allocate_dynrelocs): Likewise.
7494         (readonly_dynrelocs): Likewise.
7495         * elf32-i386.c (allocate_dynrelocs): Likewise.
7496         (readonly_dynrelocs): Likewise.
7497         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
7498         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
7499         * elf32-mips.c (mips_elf_output_extsym): Likewise.
7500         (mips_elf_sort_hash_table_f): Likewise.
7501         (mips_elf_check_mips16_stubs): Likewise.
7502         * elf32-s390.c (allocate_dynrelocs): Likewise.
7503         (readonly_dynrelocs): Likewise.
7504         * elf32-sh.c (sh_elf_discard_copies): Likewise.
7505         * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
7506         (xstormy16_relax_plt_realloc): Likewise.
7507         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
7508         (elf64_alpha_output_extsym): Likewise.
7509         * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
7510         * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
7511         (mips_elf64_check_mips16_stubs): Likewise.
7512         (mips_elf64_output_extsym): Likewise.
7513         * elf64-ppc.c (func_desc_adjust): Likewise.
7514         (allocate_dynrelocs): Likewise.
7515         (readonly_dynrelocs): Likewise.
7516         * elf64-s390.c (allocate_dynrelocs): Likewise.
7517         (readonly_dynrelocs): Likewise.
7518         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
7519         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
7520         (readonly_dynrelocs): Likewise.
7521         * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
7522         * aoutx.h (aout_link_write_other_symbol): Likewise.
7523         * cofflink.c (_bfd_coff_write_task_globals): Likewise.
7524         (_bfd_coff_write_global_sym): Likewise.
7525         * i386linux.c (linux_tally_symbols): Likewise.
7526         * m68klinux.c (linux_tally_symbols): Likewise.
7527         * sparclinux.c (linux_tally_symbols): Likewise.
7528         * pdp11.c (aout_link_write_other_symbol): Likewise.
7529         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
7530         * xcofflink.c (xcoff_build_ldsyms): Likewise.
7531         (xcoff_write_global_symbol): Likewise.
7532
7533         * cofflink.c (_bfd_coff_final_link): Formatting.
7534         * cpu-mips.c (mips_compatible): Make static, prototype.
7535         * elf32-i386.c (elf_i386_check_relocs): Formatting.
7536         * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
7537         * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
7538         * elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
7539         (mips_elf64_final_link): Likewise.
7540         * elflink.h (elf_link_find_version_dependencies): Remove duplicate
7541         prototype.
7542
7543 2002-03-27  Nick Clifton  <nickc@cambridge.redhat.com>
7544
7545         * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define.
7546         (SWAP_OUT_RELOC_OFFSET): Define.
7547
7548 2002-03-27  Gregory Steuck <greg@nest.cx>
7549
7550         * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for
7551         terminating NULL if empty symbol table.
7552         (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
7553
7554 2002-03-26  H.J. Lu  (hjl@gnu.org)
7555
7556         * elflink.h (elf_link_input_bfd): Revert the last change since
7557         the gcc exception handling isn't fixed yet.
7558
7559 2002-03-26  H.J. Lu  (hjl@gnu.org)
7560
7561         * elflink.h (elf_link_input_bfd): Complain about relocations
7562         against local symbols in discarded sections.
7563
7564 2002-03-26  Alan Modra  <amodra@bigpond.net.au>
7565
7566         * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections.
7567
7568 2002-03-23  Alan Modra  <amodra@bigpond.net.au>
7569
7570         * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
7571         section file offset for !SEC_LOAD sections.
7572
7573 2002-03-21  Richard Earnshaw  <rearnsha@arm.com>
7574
7575         * elf32-arm.h (elf32_arm_final_link_relocate <case R_ARM_GOTOFF>,
7576         <case R_ARM_GOT>): Handle relocations to Thumb functions.
7577
7578 2002-03-21  Alan Modra  <amodra@bigpond.net.au>
7579
7580         * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
7581         Whitespace changes.
7582         * archive.c: Update copyright date.
7583         * bfd-in2.h: Regenerate.
7584         * libbfd.h: Regenerate.
7585         * Makefile.am: Run "make dep-am"
7586         * Makefile.in: Regenerate.
7587         * po/SRC-POTFILES.in: Regenerate.
7588
7589 2002-03-20  Daniel Jacobowitz  <drow@mvista.com>
7590
7591         * dwarf2.c (struct funcinfo): Move up.
7592         (lookup_address_in_function_table): New argument function_ptr.
7593         Set it.
7594         (lookup_address_in_line_table): New argument function.  If function
7595         is non-NULL, use it to handle ``addr'' before the first line note of
7596         the function.
7597         (comp_unit_find_nearest_line): Update and swap calls to
7598         lookup_address_in_function_table and lookup_address_in_line_table.
7599         * syms.c (_bfd_stab_section_find_nearest_line): Use the first
7600         N_SLINE encountered if we see an N_FUN before any N_SLINE.
7601
7602 2002-03-20  Tom Rix  <trix@redhat.com>
7603
7604         * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from
7605         _bfd_xcoff_generic_stat_arch_elt.  Fix format check.
7606         * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt.
7607
7608 2002-03-19  Tom Rix  <trix@redhat.com>
7609
7610         * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all
7611         dynamic objects in archives.
7612
7613 2002-03-19  Hans-Peter Nilsson  <hp@bitrange.com>
7614
7615         * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
7616         STT_NOTYPE symbols to STT_OBJECT.
7617
7618 2002-03-18  Jan Hubicka  <jh@suse.cz>
7619
7620         * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64"
7621
7622 2002-03-18  Tom Rix  <trix@redhat.com>
7623
7624         * aix5ppc.core.c : New file for AIX 5 64 bit core support.
7625         * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration.
7626         * coff-rs6000 (do_pad) : New function for archive padding.
7627         (do_copy) : New function for object file copying in archives.
7628         (do_shared_object_padding) : New function for padding shared
7629         objects to their text section alignment in archives.
7630         (bfd_xcoff_ar_achive_set_magic) : Stub.
7631         (xcoff_write_armap_big) : Use do_copy and do_pad.
7632         (xcoff_write_archive_contents_big) : Use do_shared_object_padding,
7633         do_copy and do_pad.
7634         * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use
7635         bfd_xcoff_magic_number.
7636         (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook
7637         fop.
7638         (xcoff_backend_data_r) : Use xcoff64_bad_format_hook.
7639         (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data.
7640         (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000.
7641         * rs6000-core.c : Update copyright date.
7642         * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL
7643         csectpp.
7644         * coffcode.h (coff_new_section_hook) : Use new accessor macros.
7645         (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #.
7646         (coff_set_flags) : Use bfd_xcoff_magic_number.
7647         * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC.
7648         * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support.
7649         * Makefile.am : Same.
7650         * config.bfd : Same.
7651         * targets.c : Same.
7652         * configure : Regnerate.
7653         * Makefile.in : Same.
7654         * bfd-in2.h : Same.
7655
7656 2002-03-18  Nick Clifton  <nickc@cambridge.redhat.com>
7657
7658         * po/fr.po: Updated version.
7659
7660 2002-03-18  Alan Modra  <amodra@bigpond.net.au>
7661
7662         * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success.
7663         * libbfd.h: Regenerate.
7664         * archive.c (coff_write_armap): Pass on failures from
7665         bfd_write_bigendian_4byte_int.
7666
7667 2002-03-14  H.J. Lu <hjl@gnu.org>
7668
7669         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD
7670         error to bfd_error_nonrepresentable_section for reinit_array
7671         section in DSO.
7672
7673 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
7674
7675         * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag,
7676         OR it in rather than replacing previously selected flags.
7677
7678         * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15.
7679         (TARGET_LITTLE_SYM): Set ar_max_namelen to 15.
7680
7681 2002-03-14  Alan Modra  <amodra@bigpond.net.au>
7682
7683         * cpu-mips.c (mips_compatible): New.  Don't check bits_per_word.
7684         (N): Use the above.
7685         * elflink.h (elf_bfd_final_link): Revert last change.  Instead,
7686         ensure reloc size matches before calling elf_link_input_bfd.
7687         Add an assert to check reloc size when counting output relocs.
7688
7689 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
7690
7691         * mmo.c (mmo_get_loc): Return NULL rather than false.
7692
7693 2002-03-13  Nick Clifton  <nickc@cambridge.redhat.com>
7694
7695         * po/fr.po: Updated version.
7696
7697 2002-03-13  Alan Modra  <amodra@bigpond.net.au>
7698
7699         * archures.c (bfd_default_compatible): Test bits_per_word.
7700         * cpu-i386.c (i386_compatible): Remove.  Replace occurrences with
7701         bfd_default_compatible.
7702         * cpu-i370.c (i370_compatible): Likewise.
7703         * cpu-sparc.c (sparc_compatible): Likewise.
7704         * cpu-h8300.c (compatible): Test in->arch == out->arch.
7705
7706         * elflink.h: Formatting fixes.
7707         (elf_link_output_extsym): Merge undefined and undef weak cases.
7708
7709         * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd
7710         when word size of input matches output word size.
7711
7712 2002-03-12  Andreas Jaeger  <aj@suse.de>
7713
7714         * cpu-i386.c (i386_compatible): New.  Use it instead of
7715         bfd_default_compatible.
7716
7717 2002-03-07  H.J. Lu  (hjl@gnu.org)
7718
7719         * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type
7720         as the type for bfd_reloc_val.
7721
7722 2002-03-05  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7723
7724         * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
7725         (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols.
7726         (elf_hppa_final_link_relocate): Correct relocations for indirect
7727         references to local data through the DLT.  Fix .opd creation for
7728         local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64
7729         relocations.  Use e_lsel selector for R_PARISC_DLTIND21L,
7730         R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per
7731         "Processor-Specific ELF for PA_RISC, Version 1.43" document.
7732         Similarly, use e_rsel for DLT and LTOFF 'R' relocations.
7733         * elf32-hppa.c (final_link_relocate): Revise relocation selectors
7734         as per "Processor-Specific ELF for PA_RISC, Version 1.43" document.
7735
7736 2002-03-05  Jakub Jelinek  <jakub@redhat.com>
7737
7738         * merge.c (_bfd_merge_sections): Don't segfault if there
7739         is nothing to merge due to GC.
7740
7741 2002-03-05  Alan Modra  <amodra@bigpond.net.au>
7742
7743         * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep
7744         symbols that have been forced local.
7745
7746         * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
7747         to output forced local syms for non-shared link.
7748         (elf_link_output_extsym): Tweak condition for calling backend
7749         adjust_dynamic_symbol so that previous behaviour is kept.
7750         Whitespace changes throughout file.
7751
7752 2002-03-04  H.J. Lu <hjl@gnu.org>
7753
7754         * elf.c (bfd_section_from_shdr): Handle special sections,
7755         .init_array, .fini_array and .preinit_array.
7756         (elf_fake_sections): Likewise.
7757
7758         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the
7759         DT entry only if the section is in output for .init_array,
7760         .fini_array and .preinit_array. Complain about .preinit_array
7761         section in DSO.
7762         (elf_bfd_final_link): Warn zero size for .init_array,
7763         .fini_array and .preinit_array sections.
7764
7765         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
7766         SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
7767         (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
7768         .preinit_array.
7769
7770 2002-03-04  Alan Modra  <amodra@bigpond.net.au>
7771
7772         * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment.
7773         * configure: Regenerate.
7774
7775 2002-03-02  Tom Rix  <trix@redhat.com>
7776
7777         * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with
7778         symbolic equiv.
7779         * coff-rs6000.c (xcoff_howto_table): Same.
7780
7781 2002-03-01  David Mosberger  <davidm@hpl.hp.com>
7782
7783         * elflink.h (size_dynamic_sections): If section named
7784         ".preinit_array" exists, create DT_PREINIT_ARRAY and
7785         DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
7786         ".init_array" and ".fini_array".
7787         (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
7788         DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
7789         DT_FINI_ARRAY.
7790
7791 2002-02-26  Andrew Macleod  <amacleod@cygnus.com>
7792
7793         * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
7794         dynsyms.
7795
7796 2002-02-25  Alan Modra  <amodra@bigpond.net.au>
7797
7798         * elf64-hppa.h: Update copyright date.
7799
7800         * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix.
7801         (ppc64_elf_relocate_section): Don't generate power4 style branch
7802         hints for *_BRTAKEN and *_BRNTAKEN relocs.
7803
7804 2002-02-22  Jakub Jelinek  <jakub@redhat.com>
7805
7806         * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my
7807         last patch.
7808         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
7809
7810 2002-02-21  Andreas Jaeger  <aj@suse.de>
7811
7812         * elf64-x86-64.c: Major rework that introduces all recent changes
7813         to the x86-64 backend.  Get a closer match to elf32-i386.
7814         (struct elf64_x86_64_dyn_relocs): Rename from
7815         elf64_x86_64_pcrel_relocs_copied, add additional fields.  Change
7816         all users.
7817         (struct elf64_x86_64_link_hash_table): Add short cuts to some
7818         sections.
7819         (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc,
7820         remove casts, initialize new hash members.
7821         (create_got_section): New.
7822         (elf64_x86_64_create_dynamic_sections): New.
7823         (elf64_x86_64_copy_indirect_symbol): New.
7824         (elf64_x86_64_check_relocs): Don't allocate space for dynamic
7825         relocs, .got or .relgot here but do it in allocate_dynrelocs.
7826         Reference count possible .plt and .got entries.  Don't test input
7827         section SEC_READONLY here to try to avoid copy relocs, and keep
7828         dyn_relocs regardless of ELF_LINK_NON_GOT_REF.  Don't set
7829         DF_TEXTREL here.  Delay setting of variables until needed.  Cache
7830         pointer to "sreloc" section in elf_section_data. Tweak condition
7831         under which .got created.  Report files with bad relocation
7832         section names.
7833         (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
7834         Reference count possible .plt entries.  Don't deallocate .got and
7835         .relgot space here.
7836         (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc.  Don't
7837         do copy reloc processing for weakdefs.  Remove redundant casts and
7838         aborts.  Delay setting of vars until needed.  Move creation of
7839         dynamic symbols and allocation of .plt and .rela.plt to
7840         allocate_dynrelocs.  Replace BFD_ASSERT with abort.
7841         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
7842         (allocate_dynrelocs): New.
7843         (readonly_dynrelocs): New.
7844         (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs.
7845         Allocate space for dyn relocs.  Replace BFD_ASSERT with abort.
7846         Zero out the dynamic allocated content space.
7847         (elf64_x86_64_discard_copies): Removed.
7848         (elf64_x86_64_relocate_section): Make use of dynamic section
7849         short-cuts.  Localise vars, and delay setting.  Better error
7850         reporting, replace BFD_ASSERT with abort.  Check
7851         ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the
7852         regular object file and tread the weak definition as the normal
7853         one.  Don't discard relocs for undefweak or undefined symbols and
7854         check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy
7855         relocs.
7856         (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for
7857         symbols that have been forced local.  Use same test to decide if
7858         we can use a relative reloc for got as relocate_section.  Expand
7859         SHN_UNDEF comment.  Move expressions out of function calls.
7860         Replace BFD_ASSERT with abort.
7861         (bfd_elf64_bfd_final_link): Removed.
7862         (elf_backend_copy_indirect_symbol): Define.
7863
7864 2002-02-20  Tom Rix  <trix@redhat.com>
7865
7866         * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA.
7867         (_bfd_xcoff_reloc_type_lookup): Use it.
7868         * coff64-rs6000.c (xcoff64_howto_table): Same.
7869         (xcoff64_reloc_type_lookup): Same.
7870
7871 2002-02-20  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>
7872
7873         * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are
7874         little endian.
7875
7876 2002-02-19  Martin Schwidefsky  <schwidefsky@de.ibm.com>
7877
7878         * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31.
7879         (bfd_mach_s390_esame): Rename to bfd_mach_s390_64.
7880         * bfd-in2.h: Regenerate.
7881         * cpu-s390.c (arch_info_struct): Use renamed architecture defines.
7882         Replace architecture name "s390" with "s390:31-bit" and "s390:esame"
7883         with "s390:64-bit".
7884         * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations.
7885         (elf_s390_reloc_type_lookup): Likewise.
7886         (elf_s390_check_relocs): Likewise.
7887         (elf_s390_gc_sweep_hook): Likewise.
7888         (elf_s390_relocate_section): Likewise.
7889         (elf_s390_object_p): Use renamed architecture define.
7890         * elf64-s390.c (elf_s390_object_p): Use renamed architecture define.
7891
7892 2002-02-19  Frank Ch. Eigler  <fche@redhat.com>
7893
7894         * syms.c (stt[]): Sorted.  Added .init/.fini -> "t" mapping.
7895
7896 2002-02-19  Jakub Jelinek  <jakub@redhat.com>
7897
7898         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable
7899         absptr -> pcrel optimization for shared libs.
7900         Only create minimal .eh_frame_hdr if absptr FDE encoding in shared
7901         library cannot be converted to pcrel.
7902         (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr
7903         relative.
7904         * elf32-i386.c (elf_i386_relocate_section): If
7905         _bfd_elf_section_offset returned -2, skip, but make sure the
7906         relocation is installed.
7907         * elf32-arm.h (elf32_arm_final_link_relocate): Likewise.
7908         * elf32-cris.c (cris_elf_relocate_section): Likewise.
7909         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
7910         * elf32-i370.c (i370_elf_relocate_section): Likewise.
7911         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
7912         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
7913         * elf32-s390.c (elf_s390_relocate_section): Likewise.
7914         * elf32-sh.c (sh_elf_relocate_section): Likewise.
7915         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
7916         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
7917         * elf64-s390.c (elf_s390_relocate_section): Likewise.
7918         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
7919         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7920         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
7921         * elf64-alpha.c (elf64_alpha_relocate_section): Handle
7922         _bfd_elf_section_offset returning -2 the same way as -1.
7923         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
7924         * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME
7925         and BFD_ASSERT.
7926         * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise.
7927
7928 2002-02-18  Tom Rix  <trix@redhat.com>
7929
7930         * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support.
7931         (bfd_xcoff_size_dynamic_sections): Same.
7932         * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same.
7933         (bfd_xcoff_size_dynamic_sections): Same.
7934         * coff-rs6000.c (xcoff_generate_rtinit): Same.
7935         * coff-rs646000.c (xcoff64_generate_rtinit): Same.
7936         * libxcoff.h (struct xcoff_backend_data_rec): Same.
7937         * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean.
7938         * bfd-in2.h: Regenerate.
7939
7940 2002-02-18  Alan Modra  <amodra@bigpond.net.au>
7941
7942         * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define.
7943         (struct ppc_link_hash_table): Add sfpr.
7944         (ppc64_elf_link_hash_table_create): Init it.
7945         (ppc64_elf_create_dynamic_sections): Split creation of .stub and
7946         .glink out to..
7947         (create_linkage_sections): ..here.  Make .sfpr too.
7948         (ppc64_elf_check_relocs): Call create_linkage_sections, and set
7949         dynobj early.
7950         (MIN_SAVE_FPR, MAX_SAVE_FPR): Define.
7951         (ppc64_elf_func_desc_adjust): Look for missing ._savef* and
7952         ._restf* functions, and create as needed.
7953         (func_desc_adjust): Only force_local for shared libs.
7954
7955 2002-02-18  David O'Brien  <obrien@FreeBSD.org>
7956
7957         * configure.in: Bump version number post 2.12 branching.
7958         * configure: Regenerate.
7959
7960 2002-02-17  Hans-Peter Nilsson  <hp@bitrange.com>
7961
7962         * mmo.c: Correct and improve comments.
7963         (mmo_write_chunk): Store trailing byte in bfd buffer; don't
7964         zero-pad.  Use input to fill up non-empty bfd buffer.
7965         (mmo_flush_chunk): New function.
7966         (mmo_write_loc_chunk): Add parameter last_vmap, all callers
7967         changed.  Don't emit location specifier if VMA is same as
7968         *LAST_VMAP after omitting leading zero contents.  Call
7969         mmo_flush_chunk before emitting location specifier.
7970         (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished
7971         with mmo_write_loc_chunk calls.
7972         (mmo_internal_write_section): Call mmo_flush_chunk after
7973         mmo_write_chunk.
7974         (mmo_write_symbols_and_terminator): Move :Main to first position
7975         in symbol array.  Add faked one if it does not exist if there are
7976         other symbols.  Don't add it if there are no symbols at all.  Move
7977         out test for value of :Main from symbol loop.  Rename table
7978         fakemain to maintable and variable mainsym to fakemain.
7979
7980 2002-02-15  Richard Henderson  <rth@redhat.com>
7981
7982         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target
7983         section with no got matches any got.  Simplify error generaion.
7984
7985 2002-02-15  Alan Modra  <amodra@bigpond.net.au>
7986
7987         Support arbitrary length fill patterns.
7988         * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc.
7989         (_bfd_default_link_order): Remove bfd_fill_link_order code.
7990         Call default_data_link_order.
7991         (default_fill_link_order): Delete.
7992         (default_data_link_order): New function.
7993         * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences
7994         of bfd_fill_link_order with bfd_data_link_order.
7995         * elf64-alpha.c (elf64_alpha_final_link): Likewise.
7996         * elf64-mips.c (mips_elf64_final_link): Likewise.
7997
7998         * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value.
7999         Correct value returned in "end" for "0x<non-hex>".
8000
8001 2002-02-14  Nick Clifton  <nickc@cambridge.redhat.com>
8002
8003         * cpu-arm.c (processors): Replace 'arch' field with 'mach'.
8004         (scan): Test against 'mach' field in info structure.
8005
8006 2002-02-14  Alan Modra  <amodra@bigpond.net.au>
8007
8008         * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD.
8009
8010 2002-02-14  Matt Fredette  <fredette@netbsd.org>
8011
8012         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize
8013         EF_M68000.
8014
8015 2002-02-13  Nick Clifton  <nickc@cambridge.redhat.com>
8016
8017         * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on
8018         non-zero physical addresses when adjusting the LMAs of new
8019         sections.
8020
8021 2002-02-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
8022
8023         * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped
8024         from _bfd_elf_hppa_gen_reloc_type.
8025         (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype.
8026         * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype.
8027         * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h.
8028         * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype.
8029
8030 2002-02-12  Alexandre Oliva  <aoliva@redhat.com>
8031
8032         * elf-m10300.c (mn10300_elf_relax_section): Skip section before
8033         loading its contents if there's nothing to do in it.
8034
8035 2002-02-12  Alan Modra  <amodra@bigpond.net.au>
8036
8037         * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
8038         64k boundary.
8039
8040         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic
8041         DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
8042         (ppc64_elf_finish_dynamic_sections): Set values for them.
8043
8044 2002-02-11  Michael Snyder  <msnyder@redhat.com>
8045
8046         * elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
8047         * elf.c (elfcore_grok_pstatus): Add prototype.
8048         (elfcore_grok_lwpstatus): Add prototype.
8049         (elfcore_write_lwpstatus): New function.
8050         (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
8051
8052 2002-02-11  Alexandre Oliva  <aoliva@redhat.com>
8053
8054         * elf32-sh.c: Added missing prototypes.
8055         * elf32-sh64.c: Likewise.
8056         (sh_elf_align_loads): Mark unused args as such.
8057         * elf64-sh64.c: Added missing prototypes.
8058         (struct elf_sh64_link_hash_entry): Fix typo.
8059         (sh_elf64_relocate_section): Fix info argument passed to
8060         _bfd_elf_section_offset.
8061
8062 2002-02-11  Alan Modra  <amodra@bigpond.net.au>
8063
8064         * Makefile.am: "make dep-am".
8065         * Makefile.in: Regenerate.
8066         * aclocal.m4: Regenerate.
8067         * config.in: Regenerate.
8068         * configure: Regenerate.
8069
8070 2002-02-10  Daniel Jacobowitz  <drow@mvista.com>
8071
8072         * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized
8073         variable warnings.
8074         * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned
8075         comparison warning.
8076         * trad-core.c (trad_unix_core_file_p): Silence pointer/integer
8077         cast warnings for the common case.
8078
8079 2002-02-10  Hans-Peter Nilsson  <hp@bitrange.com>
8080
8081         * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64
8082         vectors.
8083         (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64
8084         vectors.
8085
8086 2002-02-09  Richard Henderson  <rth@redhat.com>
8087
8088         * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP.
8089         (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise.
8090         (elf64_alpha_relocate_section): Likewise.
8091         * reloc.c (BFD_RELOC_ALPHA_BRSGP): New.
8092         * bfd-in2.h, libbfd.h: Rebuild.
8093
8094 2002-02-09  Hans-Peter Nilsson  <hp@bitrange.com>
8095
8096         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check
8097         that base-plus-offset reloc accounting is consistent.
8098         (mmix_elf_relax_section): Keep base-plus-offset reloc accounting
8099         up to date for undefined symbols.
8100
8101 2002-02-08  Eric Christopher  <echristo@redhat.com>
8102
8103         From Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
8104
8105         * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
8106         sections for the O32 ABI.
8107
8108 2002-02-08  Chris Demetriou  <cgd@broadcom.com>
8109
8110         * elf32-arm.h: Fix formatting of _("...").
8111         * elf32-d10v.c: Likewise.
8112         * elf32-m68k.c: Likewise.
8113         * elf32-mips.c: Likewise.
8114
8115 2002-02-08  Ivan Guzvinec <ivang@opencores.org>
8116
8117         * coff-or32.c: Fix compile time warning messages.
8118
8119 2002-02-08  Alexandre Oliva  <aoliva@redhat.com>
8120
8121         Contribute sh64-elf.
8122         2002-01-23  Alexandre Oliva  <aoliva@redhat.com>
8123         * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16,
8124         R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16,
8125         R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16,
8126         R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16,
8127         R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16,
8128         R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16,
8129         R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16,
8130         R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8,
8131         R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64):
8132         New relocs.
8133         * libbfd.h, bfd-in2.h: Rebuilt.
8134         * elf32-sh.c (sh_elf_howto_table): Define new relocs.
8135         (sh_reloc_map): Map them.
8136         (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
8137         elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be,
8138         elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry,
8139         elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
8140         elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset,
8141         elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset,
8142         movi_shori_putval) [INCLUDE_SHMEDIA]: New.
8143         (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add
8144         datalabel_got_offset.
8145         (sh_elf_link_hash_newfunc): Initialize it.
8146         (sh_elf_relocate_section): Augment the scope of
8147         seen_stt_datalabel.  Introduce GOTPLT support.  Extend GOTPC, PLT,
8148         GOT and GOTOFF handling to new SHmedia relocation types.  Support
8149         GOT_BIAS.
8150         (sh_elf_check_relocs): Likewise.
8151         (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in
8152         PLT entries using movi_shori_putval.  Support GOT_BIAS.
8153         (sh_elf_finish_dynamic_sections): Likewise.
8154         * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to
8155         relocation, it's now done by the caller.
8156         (GOT_BIAS): New.
8157         * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt,
8158         elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset,
8159         elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset,
8160         elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER,
8161         elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry,
8162         elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse,
8163         sh64_elf64_hash_table): New.
8164         (sh_elf64_howto_table): Introduce new relocs.
8165         (sh_elf64_info_to_howto): Accept new PIC relocs.
8166         (sh_elf64_relocate_section): Augment the scope of
8167         seen_stt_datalabel.  Support new PIC relocs.
8168         (sh_elf64_check_relocs): Support new PIC relocs.
8169         (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le,
8170         elf_sh64_plt_entry_be, elf_sh64_plt_entry_le,
8171         elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le,
8172         elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry,
8173         sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create,
8174         movi_shori_putval, movi_3shori_putval,
8175         sh64_elf64_create_dynamic_sections,
8176         sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies,
8177         sh64_elf64_size_dynamic_sections,
8178         sh64_elf64_finish_dynamic_symbol,
8179         sh64_elf64_finish_dynamic_sections): New.
8180         (elf_backend_create_dynamic-sections,
8181         bfd_elf64_bfd_link_hash_table_create,
8182         elf_backend_adjust_dynamic_symbol,
8183         elf_backend_size_dynamic_sections,
8184         elf_backend_finish_dynamic_symbol,
8185         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
8186         elf_backend_plt_readonly, elf_backend_want_plt_sym,
8187         elf_backend_got_header_size, elf_backend_plt_header_size):
8188         Define.
8189         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
8190         * elf32-sh.c: Renumbered and renamed some SH5 relocations to
8191         match official numbers and names; moved unmaching ones to the
8192         range 0xf2-0xff.
8193         * elf32-sh64.c, elf64-sh64.c: Likewise.
8194         2001-03-12  DJ Delorie  <dj@redhat.com>
8195         * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia
8196         sections.
8197         2001-03-12  DJ Delorie  <dj@redhat.com>
8198         * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must
8199         be aligned.
8200         * elf64-sh64.c (sh_elf64_relocate_section): Ditto.
8201         2001-01-14  Hans-Peter Nilsson  <hpn@cygnus.com>
8202         * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define.
8203         (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a
8204         .cranges section with SEC_SORT_ENTRIES set.
8205         (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an
8206         incoming sorted .cranges section.
8207         (sh64_bfd_elf_copy_private_section_data): New.
8208         (sh64_elf_final_write_processing): Only sort .cranges and modify
8209         start address if called by linker.
8210         2001-01-08  Ben Elliston  <bje@redhat.com>
8211         * elf32-sh64.c (sh64_elf_final_write_processing): Activate
8212         Hans-Peter Nilsson's set bit 0 patch from 2001-01-06.
8213         * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto.
8214         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
8215         * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of
8216         line.  Add comments before all entries.
8217         <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct and clarify describing
8218         comment.
8219         (sh_elf64_reloc): Correct head comment.
8220         (sh_elf64_relocate_section): Correct spacing.
8221         <relocating for a local symbol>: Do not honour STO_SH5_ISA32;
8222         instead call reloc_dangerous callback.
8223         <case R_SH_SHMEDIA_CODE>: New case.
8224         (sh_elf64_gc_mark_hook): Correct spacing.
8225         (sh_elf64_check_relocs): Ditto.
8226         * elf32-sh64.c (shmedia_prepare_reloc) <case R_SH_SHMEDIA_CODE>:
8227         New case.
8228         * elf32-sh.c: Correct #endif comments for #ifndef-wrapped
8229         functions.
8230         (sh_elf_howto_table) <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct,
8231         clarify describing comment.  Add comments before all entries.
8232         (sh_elf_relocate_section) <relocating for a local symbol>: Do not
8233         honour STO_SH5_ISA32; instead call reloc_dangerous callback.
8234         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
8235         Sort .cranges section in final link.  Prepare to set bit 0 on
8236         entry address.
8237         * elf32-sh64.c (struct sh64_find_section_vma_data): New.
8238         (sh64_elf_link_output_symbol_hook): Fix typo in prototype.
8239         (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming
8240         .cranges section.
8241         (sh64_backend_section_from_shdr): New, to recognize
8242         SHT_SH5_CR_SORTED on incoming .cranges section.
8243         (elf_backend_section_from_shdr): Define.
8244         (sh64_elf_final_write_processing): Sort outgoing .cranges
8245         section.  (New, temporarily disabled:) Set bit 0 on entry address
8246         according to ISA type.
8247         (sh64_find_section_for_address): New.
8248         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb,
8249         crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c.
8250         (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c.  Use
8251         bfd_malloc, not xmalloc.
8252         (sh64_get_contents_type): Move here from opcodes/sh64-dis.c.  Make
8253         global.
8254         * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but
8255         temporarily disabled) setting bit 0 on entry address.
8256         (elf_backend_final_write_processing): Define.
8257         2001-01-05  Hans-Peter Nilsson  <hpn@cygnus.com>
8258         * elf32-sh.c (sh_elf_howto_table) <R_SH_PT_16>: Adjust fields to
8259         be a proper relocation for PTA and PTB rather than a marker.
8260         <R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2,
8261         R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16,
8262         R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16,
8263         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL,
8264         R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL>:
8265         Zero src_mask.
8266         * elf64-sh64.c: Ditto.
8267         (sh_elf64_relocate_section) <case R_SH_PT_16>: New case.
8268         * elf32-sh64.c: Include opcodes/sh64-opc.h
8269         (shmedia_prepare_reloc): Take a bfd_link_info pointer as first
8270         argument.  Drop const qualifiers from "bfd *" and "bfd_byte *"
8271         parameters.  No unused parameters.  Caller changed.
8272         <case R_SH_PT_16>: New case.
8273         * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h.
8274         * Makefile.in: Regenerate.
8275         2000-12-30  Hans-Peter Nilsson  <hpn@cygnus.com>
8276         * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for
8277         all code sections.
8278         (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
8279         (sh64_elf_merge_private_data): Ditto.
8280         * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data
8281         to access stored section flags.
8282         (sh64_elf_final_write_processing): Return immediately unless
8283         called by linker.  Use sh64_elf_section_data (cranges) to get size
8284         of linker-generated cranges entries.
8285         (sh64_elf_copy_private_data): Add missing "return true".
8286         (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
8287         (sh_elf64_merge_private_data): Ditto.
8288         2000-12-19  Hans-Peter Nilsson  <hpn@cygnus.com>
8289         * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of
8290         elf64-sh64.c:sh64_elf_fake_sections.
8291         (elf_backend_fake_sections): Define as sh64_elf64_fake_sections.
8292         2000-12-18  Hans-Peter Nilsson  <hpn@cygnus.com>
8293         * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete.
8294         (sh64_elf_final_write_processing): New.
8295         (elf_backend_final_write_processing): Define.
8296         (sh64_elf_fake_sections): Get header flags from tdata field.
8297         (sh64_elf_copy_private_data): Do not call
8298         sh64_elf_copy_private_data_internal, just copy e_flags field.
8299         (sh64_elf_merge_private_data): Do not call
8300         sh64_elf_copy_private_data_internal.
8301         2000-12-12  Hans-Peter Nilsson  <hpn@cygnus.com>
8302         Remove EF_SH64_ABI64, let ELF size make difference.
8303         Remove SH64-specific BFD section flag.
8304         * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as
8305         containing SHmedia through elf_section_data (asect)->tdata
8306         non-zero, not using a BFD section flag.
8307         (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64.
8308         (sh64_elf_merge_private_data): Similar.
8309         (elf_backend_section_flags): Don't define.
8310         (sh64_elf_backend_section_flags): Delete.
8311         * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64,
8312         not EF_SH64_ABI64.
8313         (sh_elf64_merge_private_data): Similar.
8314         * section.c (Section flags definitions): Don't define
8315         SEC_SH_ISA_SHMEDIA.
8316         (bfd-in2.h): Regenerate.
8317         2000-12-09  Hans-Peter Nilsson  <hpn@cygnus.com>
8318         Make DataLabel references work with partial linking.
8319         * elf32-sh64.c: Fix formatting.
8320         (sh64_elf_link_output_symbol_hook): New.
8321         (elf_backend_link_output_symbol_hook): Define to
8322         sh64_elf_link_output_symbol_hook.
8323         (sh64_elf_add_symbol_hook): Make DataLabel symbol just global
8324         undefined if partial linking.  Adjust sanity check.
8325         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New.
8326         (elf_backend_link_output_symbol_hook): Define to
8327         sh64_elf64_link_output_symbol_hook.
8328         (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global
8329         undefined if partial linking.  Adjust sanity check.
8330         2000-12-07  Hans-Peter Nilsson  <hpn@cygnus.com>
8331         Implement semantics for inter-file DataLabel references.
8332         * elf64-sh64.c (DATALABEL_SUFFIX): Define.
8333         (sh64_elf64_add_symbol_hook): New.
8334         (sh_elf64_relocate_section): If passing an indirect symbol with
8335         st_type STT_DATALABEL on the way to a symbol with st_other
8336         STO_SH5_ISA32, do not bitor 1 to the relocation.
8337         (elf_backend_add_symbol_hook): Define to
8338         sh64_elf64_add_symbol_hook.
8339         * elf64-sh32.c: Tweak comments.
8340         (DATALABEL_SUFFIX): Define.
8341         (sh64_elf_add_symbol_hook): New.
8342         (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook.
8343         * elf32-sh.c (sh_elf_relocate_section): If passing an indirect
8344         symbol with st_type STT_DATALABEL on the way to a symbol with
8345         st_other STO_SH5_ISA32, do not bitor 1 to the relocation.
8346         2000-12-05  Hans-Peter Nilsson  <hpn@cygnus.com>
8347         Pass through STT_DATALABEL.
8348         * elf32-sh64.c (sh64_elf_get_symbol_type): New.
8349         (elf_backend_get_symbol_type): Define.
8350         * elf64-sh64.c (sh64_elf64_get_symbol_type): New.
8351         (elf_backend_get_symbol_type): Define.
8352         2000-11-30  Hans-Peter Nilsson  <hpn@cygnus.com>
8353         * elf32-sh64.c: Tweak comments.
8354         (sh64_elf_copy_private_data_internal): Add prototype.
8355         (bfd_elf32_bfd_set_private_flags): Define.
8356         (sh64_elf_copy_private_data_internal): Compare machine name, not
8357         textual BFD target name, to check whether to copy section flag
8358         SHF_SH5_ISA32.
8359         (sh64_elf_merge_private_data): Validize bfd_get_arch_size.
8360         Tweak section-contents-type-mismatch message.
8361         (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers.
8362         Validize reloc-types.
8363         * elf64-sh64.c: New file.
8364         * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare.
8365         * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo.
8366         (BFD64_BACKENDS_CFILES): Add elf64-sh64.c.
8367         Regenerate dependencies.
8368         * Makefile.in: Regenerate.
8369         * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and
8370         bfd_elf64_sh64l_vec.
8371         * configure.in: Handle bfd_elf64_sh64_vec and
8372         bfd_elf64_sh64l_vec.
8373         * configure: Regenerate.
8374         * po/POTFILES.in: Regenerate.
8375         * po/bfd.pot: Regenerate.
8376         2000-11-29  Hans-Peter Nilsson  <hpn@cygnus.com>
8377         * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize
8378         anything else but EF_SH64 and EF_SH64_ABI64.
8379         (sh64_elf_merge_private_data): Emit error for anything else but
8380         EF_SH64 and EF_SH64_ABI64.
8381         * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec
8382         from targ_selvecs.
8383         * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and
8384         bfd_elf32_sh64l_vec as a temporary measure.
8385         * configure: Regenerate.
8386         2000-11-27  Hans-Peter Nilsson  <hpn@cygnus.com>
8387         * cpu-sh.c (arch_info_struct): Include sh5 item
8388         unconditionalized.
8389         * config.bfd (sh64-*-elf*): Do not set targ_cflags.
8390         Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec,
8391         bfd_elf32_shblin_vec and bfd_elf32_shlin_vec.
8392         * elf32-sh64.c: Tweak comments.
8393         (sh64_elf_set_mach_from_flags): Recognize all machine flags that
8394         are proper subsets of SH64 as bfd_mach_sh5.  Add EF_SH64_ABI64.
8395         (sh64_elf_copy_private_data_internal): Wrap long line.
8396         (sh64_elf_merge_private_data): Rewrite to allow objects from
8397         SH64 subsets to be linked together.
8398         (INCLUDE_SHMEDIA): Define.
8399         * elf32-sh.c (sh_elf_relocate_section) <local symbol>:
8400         Parenthesize plus-expression inside or-expression.
8401         <global symbol>: Ditto.
8402         (sh_elf_set_mach_from_flags): Remove code refusing
8403         deleted EF_SH64_32BIT_ABI flag.
8404         2000-11-26  Hans-Peter Nilsson  <hpn@cygnus.com>
8405         * elf32-sh.c (sh_elf_howto_table) <R_SH_IMM_LOW16_PCREL,
8406         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16_PCREL,
8407         R_SH_IMM_HI16_PCREL, R_SH_64_PCREL>: Set pcrel_offset to true.
8408         (sh_elf_relocate_section) <local symbol>: Or 1 in
8409         calculation of relocation if sym->st_other & STO_SH5_ISA32.
8410         <global symbol>: Ditto if h->other & STO_SH5_ISA32.
8411         * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to
8412         relocation.
8413         2000-11-24  Hans-Peter Nilsson  <hpn@cygnus.com>
8414         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo.
8415         (BFD32_BACKENDS_CFILES): Add elf32-sh64.c.
8416         Regenerate dependencies.
8417         * Makefile.in: Regenerate.
8418         * archures.c: Add bfd_mach_sh5.
8419         * config.bfd: Map targ_cpu sh* to bfd_sh_arch.
8420         Handle sh64-*-elf*.  Set targ_cflags to -DINCLUDE_SHMEDIA.
8421         * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec.
8422         * configure: Regenerate.
8423         * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5,
8424         BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6,
8425         BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2,
8426         BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8,
8427         BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16,
8428         BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16,
8429         BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16,
8430         BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16,
8431         BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations.
8432         * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link
8433         in item for SH5.
8434         * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items
8435         for SHmedia relocs.
8436         [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs.
8437         [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call
8438         shmedia_prepare_reloc, goto final_link_relocate if it returns
8439         non-zero, else fail as before.
8440         (sh_elf_set_mach_from_flags): Provide function only if not defined
8441         as macro.  Do not recognize objects with EF_SH64_32BIT_ABI set.
8442         (sh_elf_set_private_flags): Provide function only if not defined
8443         as a macro.
8444         (sh_elf_copy_private_data): Similar.
8445         (sh_elf_merge_private_data): Similar.
8446         * section.c (SEC_SH_ISA_SHMEDIA): New.
8447         * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare.
8448         * elf32-sh64.c: New file.
8449         * libbfd.h: Regenerate.
8450         * bfd-in2.h: Regenerate.
8451         * po/POTFILES.in: Regenerate.
8452         * po/bfd.pot: Regenerate.
8453         * bfd-in2.h: Regenerate.
8454         * libbfd.h: Regenerate.
8455
8456 2002-02-07  Daniel Jacobowitz  <drow@mvista.com>
8457
8458         * bfd-in.h: Update <stdbool.h> check to only see if <stdbool.h> has
8459         been included, not drag it in.
8460         * bfd-in2.h: Regenerate.
8461
8462 2002-02-06  H.J. Lu  (hjl@gnu.org)
8463
8464         * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update
8465         the mach and ISA fields if necessary.
8466
8467 2002-02-06  Nick Clifton  <nickc@cambridge.redhat.com>
8468
8469         * coffcode.h (coff_set_arch_mach_hook): Select the highest known
8470         ARM architecture when an F_ARM_5 flag is detected, since we cannot
8471         be sure exactly which architecture this represents.
8472
8473 2002-02-05  Nick Clifton  <nickc@redhat.com>
8474
8475         * po/tr.po: Updated translation.
8476
8477 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
8478
8479         From Jimi X <jimix@watson.ibm.com>
8480         * archures (bfd_mach_ppc64): Define.
8481         (bfd_powerpc_arch): Rename to bfd_powerpc_archs.
8482         (bfd_powerpc_arch): Define.
8483         * bfd-in2.h: Regenerate.
8484         * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs.
8485         (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs.
8486         (bfd_powerpc_archs): Add default powerpc64 arch.
8487
8488 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
8489
8490         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
8491         against section syms in readonly sections.  Don't do the global
8492         sym check if we find one.
8493         * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
8494         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
8495         * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
8496         * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
8497         (elf_s390_grok_prstatus): Add missing prototype.
8498
8499 2002-02-04  Hans-Peter Nilsson  <hp@bitrange.com>
8500
8501         * elf64-mmix.c (mmix_dump_bpo_gregs): New function.
8502         (mmix_elf_check_common_relocs) <case R_MMIX_BASE_PLUS_OFFSET>:
8503         Call bfd_get_section_by_name only once.  Initialize
8504         bpodata->n_bpo_relocs_this_section.
8505         (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment
8506         referring to DSOs.
8507         (bpo_reloc_request_sort_fn): Don't use difference of values as
8508         return-value.
8509
8510 2002-02-02  David O'Brien  <obrien@FreeBSD>
8511
8512         * configure.in: Tweak the FreeBSD 4.x recognition more.  Only treat
8513         version 4.5 and later the same as 5-CURRENT.
8514         * configure: Re-generate.
8515
8516 2002-02-02  Jason Thorpe  <thorpej@wasabisystems.com>
8517
8518         * config.bfd (hppa*-*-netbsd*): New target.
8519
8520 2002-01-31  Philipp Thomas  <pthomas@suse.de>
8521
8522         * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
8523         to front of message. Unify messages with elf32-arm.h. Use
8524         commas where neccessary.
8525         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
8526         ERROR in messages. Unify messages with coff-arm.c. Correct
8527         VFP/FPA error message.
8528         (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
8529         APCS-32 for translation.
8530
8531 2002-02-01  Hans-Peter Nilsson  <hp@bitrange.com>
8532
8533         Perform on-demand global register allocation from
8534         R_MMIX_BASE_PLUS_OFFSET relocs.
8535         * elf64-mmix.c (struct bpo_reloc_section_info, struct
8536         bpo_reloc_request, struct bpo_greg_section_info): New.
8537         (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook,
8538         bpo_reloc_request_sort_fn, mmix_elf_relax_section,
8539         _bfd_mmix_check_all_relocs,
8540         _bfd_mmix_prepare_linker_allocated_gregs,
8541         _bfd_mmix_finalize_linker_allocated_gregs): New functions.
8542         (elf_mmix_howto_table): Correct src_mask for most relocs.
8543         (mmix_elf_perform_relocation) <case R_MMIX_BASE_PLUS_OFFSET>: New
8544         case.
8545         (mmix_final_link_relocate) <case R_MMIX_BASE_PLUS_OFFSET>: New
8546         case.  Fix typo in comment.  New label do_mmix_reloc.
8547         (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to
8548         store first object file with a base-plus-offset reloc.  Call
8549         mmix_elf_check_common_relocs for the part common with mmo.
8550         (mmix_elf_final_link): Write out linker-allocated register
8551         contents section.
8552         (elf_backend_gc_sweep_hook): Define.
8553         (bfd_elf64_bfd_relax_section): Define.
8554
8555         * mmo.c: Don't include <ctype.h>
8556         (mmo_init): Correct init-once logic.
8557
8558 2002-02-01  Tom Rix  <trix@redhat.com>
8559
8560         * config.bfd: Conditionally support <aiaff> for pre AIX 4.3.
8561
8562 2002-02-01  Alan Modra  <amodra@bigpond.net.au>
8563
8564         * Makefile.am: Run "make dep-am"
8565         * Makefile.in: Regenerate.
8566
8567 2002-01-31  David O'Brien  <obrien@FreeBSD>
8568
8569         * configure.in: Recognize the differences in core files from FreeBSD
8570         4.{0,1} and later versions of 4.x.  This treats 4.2+ the same as
8571         5-CURRENT.
8572         * configure: Regenerate.
8573
8574 2002-01-31  Ivan Guzvinec  <ivang@opencores.org>
8575
8576         * coff-or32.c: New file.
8577         * cpu-or32.c: New file.
8578         * elf32-or32.c: New file.
8579         * archures.c: Add support for or32.
8580         * targets.c: Add support for or32.
8581         * bfd-in2.h: Regenerate.
8582         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
8583         coff_write_object_contents): Add support for or32.
8584         * config.bfd: Add target.
8585         * configure.in: Add support for or32.
8586         * configure: Regenerate.
8587         * Makefile.am: Add support for or32.
8588         * Makefile.in: Regenerate.
8589         * po/SRC-POTFILES.in: Add or32 files.
8590         * po/bfd.pot: Regenerate.
8591
8592 2002-01-31  Nick Clifton  <nickc@cambridge.redhat.com>
8593             Don Lindsay  <lindsayd@cisco.com>
8594
8595         * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return
8596         false' with a return of a bfd_reloc_ error code.
8597
8598 2002-01-31  Hans-Peter Nilsson  <hp@axis.com>
8599
8600         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
8601         unexport unreferenced symbols when --export-dynamic.  Call
8602         _bfd_elf_strtab_delref when unexporting.
8603
8604 2002-01-30  Daniel Jacobowitz  <drow@mvista.com>
8605
8606         * bfd-in.h: Include <stdbool.h> if it is available.
8607         * bfd-in2.h: Regenerated.
8608
8609 2002-01-31  Alan Modra  <amodra@bigpond.net.au>
8610
8611         * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should
8612         not go via the plt.
8613
8614 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
8615
8616         * archures.c: Tidy up formatting of embedded comments.
8617         * bfd.c: Tidy up formatting of embedded comments.
8618         * bfd-in.h: Fix formatting of comments.
8619         * reloc.c: Tidy up formatting of ordinary & embedded comments.
8620         * section.c: Tidy up formatting of embedded comments.
8621         * syms.c: Tidy up formatting of embedded comments.
8622         * targets.c: Tidy up formatting of embedded comments.
8623
8624         * bfd-in2.h: Regenerate.
8625
8626 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
8627
8628         * vms-tir.c (cmd_name): New function.
8629         (tir_cmd_name): New function.
8630         (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name().
8631         (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name().
8632         Fix formatting.
8633
8634         * peXXigen.c (pe_print_idata): Rearrange message to aid in
8635         translation.
8636         (pe_print_pdata): Rearrange message to aid in translation.
8637
8638         * libbfd.c (warn_deprecated): Rearrange error message to aid in
8639         translation.
8640
8641         * ihex.c (ihex_write_object_contents): Fix spelling typo.
8642
8643         * ieee.c (ieee_slurp_external_symbols): Remove spurious space.
8644
8645         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error
8646         message to aid in translation.
8647
8648         * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message
8649         to aid in translation.
8650
8651         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo.
8652
8653 2002-01-30  Philipp Thomas  <pthomas@suse.de>
8654
8655         * coff-arm.c, elf32-elf.h: Unify messages.
8656
8657 2002-01-30  Nick Clifton <nickc@redhat.com>
8658
8659         * po/sv.po: Updated translation.
8660
8661 2002-01-30  Philipp Thomas  <pthomas@suse.de>
8662
8663         * dwarf2.c (read_abbrev): Use full section name in error message.
8664         (decode_line_info): Likewise.
8665
8666         * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging
8667         message.
8668
8669 2002-01-30  Alan Modra  <amodra@bigpond.net.au>
8670
8671         * elf64-ppc.c (func_desc_adjust): Only provide missing function
8672         descriptor symbols for undefined function code syms.  Clear
8673         ELF_LINK_NON_ELF so that they can stay weak.
8674
8675 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
8676             Mitch Lichtenberg  <mpl@broadcom.com>
8677
8678         * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype.
8679         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function
8680         to handle 32-bit ELF embedded reloc (ld --embedded-relocs)
8681         generation.
8682         * bfd-in2.h: Regenerate.
8683
8684 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
8685
8686         * elf32-mips.c: Add additional comments about HI16 relocation
8687         processing.
8688         (_bfd_mips_elf_hi16_reloc): Don't subtract address here for
8689         pc-relative relocations.  (Reverts change made on 2001-10-31.)
8690         (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here
8691         for pc-relative relocations.
8692         (mips_elf_calculate_relocation): Add a comment about a kludge
8693         in the R_MIPS_GNU_REL_HI16 handling.
8694         (_bfd_mips_elf_relocate_section): Implement that kludge;
8695         adjust pc-relative HI16 relocation for difference in HI16 and
8696         LO16 addresses, since it can't easily be done in
8697         mips_elf_calculate_relocation.
8698
8699 2002-01-29  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8700
8701         * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32
8702         relocations with PC32 relocations for undefined or weak symbols.
8703         * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise.
8704         * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise.
8705
8706 2002-01-28  Jason Thorpe  <thorpej@wasabisystems.com>
8707
8708         * elfcore.h (elf_core_file_p): Improve comment for last change.
8709
8710 2002-01-27  Daniel Jacobowitz  <drow@mvista.com>
8711
8712         * configure: Regenerated.
8713
8714 2002-01-27  Jason Thorpe  <thorpej@wasabisystems.com>
8715
8716         * elfcore.h (elf_core_file_p): Set the machine architecture
8717         before processing the program headers.
8718
8719 2002-01-26  Hans-Peter Nilsson  <hp@bitrange.com>
8720
8721         * configure.in <64-bit configuration>: If using gcc, check and
8722         emit error for egcs-1.1.2.
8723         * configure: Regenerate.
8724
8725 2002-01-26  Egor Duda  <deo@logos-m.ru>
8726
8727         * elf.c (elfcore_grok_win32pstatus): Copy only as much information
8728         as possible to avoid stack corruption.
8729
8730 2002-01-26  Richard Henderson  <rth@redhat.com>
8731
8732         * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext
8733         for non-allocated sections.
8734
8735 2002-01-25  Mark Kettenis  <kettenis@gnu.org>
8736
8737         * elf.c (elfcore_write_prstatus): Make sure we pass the address of
8738         prstat.pr_reg even if it is a struct.
8739
8740 2002-01-25  Steve Ellcey <sje@cup.hp.com>
8741
8742         * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX.
8743
8744 2002-01-25  Philipp Thomas  <pthomas@suse.de>
8745
8746         * coffgen.c (coff_print_symbol): Don't mark info message
8747         for translation.
8748
8749 2002-01-25  Nick Clifton <nickc@redhat.com>
8750
8751         * po/fr.po: Updated translation.
8752         * po/es.po: Updated translation.
8753
8754 2002-01-25  Philipp Thomas  <pthomas@suse.de>
8755
8756         * coff-alpha.c (alpha_relocate_section): Unify warning message
8757         for GP relative relocations without GP defined.
8758         * coff-mips.c (mips_relocate_section): Likewise.
8759
8760 2002-01-25  Alan Modra  <amodra@bigpond.net.au>
8761
8762         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid
8763         unsigned overflow when new_offset < old_offset.
8764
8765 2002-01-24  Philipp Thomas  <pthomas@suse.de>
8766
8767         * bfd.c (_bfd_abort): Fix typo.
8768
8769 2002-01-23  Richard Henderson  <rth@redhat.com>
8770
8771         * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress
8772         plt entries for undefweak symbols.
8773
8774 2002-01-23  Steve Ellcey <sje@cup.hp.com>
8775
8776         * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR.
8777         (bfd_elf64_ia64_hpux_big_vec): Ditto.
8778         (bfd_elf32_h8300_vec): Ditto.
8779
8780 2002-01-23  Alan Modra  <amodra@bigpond.net.au>
8781
8782         * elf64-ppc.c: Remove stale part of ABI comment.
8783         (NO_OPD_RELOCS): Define.
8784         (ppc64_elf_check_relocs): Use it.
8785         (ppc64_elf_relocate_section): Here too.
8786         (build_one_stub): Don't point function syms at the stub.  Instead,
8787         hijack plt.offset.
8788         (ppc64_elf_relocate_section): Check whether REL24 relocs should
8789         really go to the stub.  Make all dynamic relocs in opd against
8790         locals.
8791         (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of
8792         plt.offset.
8793
8794 2002-01-22  Richard Henderson  <rth@redhat.com>
8795
8796         * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp.
8797
8798 2002-01-22  Alan Modra  <amodra@bigpond.net.au>
8799
8800         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of
8801         TOC_BASE_OFF adjustment.
8802
8803         * Makefile.am: Run "make dep-am".
8804         * Makefile.in: Regenerate.
8805         * po/SRC-POTFILES.in: Regenerate.
8806
8807 2002-01-22  John David Anglin  <dave@hiauly1.hia.nrc.ca>
8808
8809         * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new
8810         host defines.
8811
8812 2002-01-21  Hans-Peter Nilsson  <hp@axis.com>
8813
8814         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
8815         Check for and emit error if sgot is NULL at this point.
8816
8817 2002-01-21  Jason Thorpe  <thorpej@wasabisystems.com>
8818
8819         * config.bfd (ia64*-*-netbsd*): New target.
8820
8821 2002-01-21  Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
8822
8823         * som.c (som_write_space_strings): Comment typo fix.
8824
8825 2002-01-21  Alan Modra  <amodra@bigpond.net.au>
8826
8827         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and
8828         is_func_descriptor fields.
8829         (link_hash_newfunc): Init them.
8830         (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a
8831         dot are candidates for plt entries.  When processing .opd relocs,
8832         set function descriptor strings to point inside function code
8833         string, and set new ppc_link_hash_entry fields.
8834         (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs.
8835         (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with
8836         function descriptors.  It's now done in..
8837         (func_desc_adjust): New.
8838         (ppc64_elf_func_desc_adjust): New.
8839         (define elf_backend_always_size_sections): Define.
8840         (ppc64_elf_hide_symbol): New.
8841         (define elf_backend_hide_symbol): Define.
8842         (allocate_dynrelocs): Remove code looking up function descriptors
8843         as that has been done earlier.
8844         (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash
8845         table.
8846         (ppc64_elf_finish_dynamic_symbol): Likewise.  Remove code looking
8847         up function descriptor.
8848         (build_one_stub): Look up the function code sym.  Check for
8849         invalid plt offsets.
8850         (ppc64_elf_relocate_section): Tweak calls to undefined weak syms.
8851         Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs.
8852
8853         * elf-bfd.h (elf_backend_data <elf_backend_hide_symbol>): Add
8854         boolean param.
8855         (_bfd_elf_link_hash_hide_symbol): Likewise.
8856         * elflink.h (elf_link_add_object_symbols): Adjust call to
8857         elf_backend_hide_symbol.
8858         (elf_fix_symbol_flags): Likewise.
8859         (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather
8860         than bfd_alloc.
8861         * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param.
8862         Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref.
8863         * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
8864         (clobber_millicode_symbols): Adjust to suit new hide_symbol.
8865         * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param
8866         and adjust to suit.
8867         * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call
8868         _bfd_elf_link_hash_hide_symbol rather than duplicating code.
8869         * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
8870
8871 2002-01-18  Alan Modra  <amodra@bigpond.net.au>
8872
8873         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a
8874         dynamic function descriptor symbol, not the associated function
8875         symbol.
8876
8877 2002-01-17  Eric Christopher  <echristo@redhat.com>
8878
8879         * elf32-mips.c (mips_elf_calculate_relocation): Fix typo.
8880
8881 2002-01-17  Nick Clifton  <nickc@cambridge.redhat.com>
8882
8883         * po/bfd.pot: Regenerate.
8884         * po/fr.po: Regenerate.
8885
8886 2002-01-17  Alan Modra  <amodra@bigpond.net.au>
8887
8888         * elf-bfd.h (elf_backend_data <elf_backend_section_from_bfd_section>):
8889         Remove "Elf_Internal_Shdr *" param.
8890         (_bfd_mips_elf_section_from_bfd_section): Ditto.
8891         * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto.
8892         * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto.
8893         * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto.
8894         * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto.
8895         * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto.
8896         * elf.c (_bfd_elf_section_from_bfd_section): Allow backend
8897         function to override special sections.  Remove hdr arg from
8898         backend call, and don't loop.
8899
8900 2002-01-16  Eric Christopher  <echristo@redhat.com>
8901
8902         * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp
8903         on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of
8904         relocations requiring gp0 and gp.
8905
8906 2002-01-16  Richard Earnshaw  <rearnsha@arm.com>
8907
8908         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle
8909         EF_ARM_VFP_FLOAT.
8910         (elf32_arm_print_private_bfd_data): Likewise.
8911
8912 2002-01-16  Nick Clifton  <nickc@cambridge.redhat.com>
8913
8914         * po/tr.po: Import new version.
8915
8916 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
8917
8918         * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs.
8919         (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc.
8920         (ORI_R0_R0_0): Correct.
8921
8922 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
8923
8924         * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE
8925         when plt_not_loaded.
8926         * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to
8927         clear .plt SEC_CODE here.  Create .stub and correct .glink flags.
8928         (PLT_INITIAL_ENTRY_SIZE): Set to 24.
8929         (ppc64_elf_glink_code): Delete.
8930         (PPC64_ELF_GLINK_SIZE): Delete.
8931         (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11,
8932         BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0,
8933         ORI_R0_R0_0): Define.
8934         (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define.
8935         (struct ppc_link_hash_table): Add sstub and plt_overflow.
8936         (ppc64_elf_link_hash_table_create): Init them.
8937         (ppc64_elf_check_relocs <R_PPC64_REL24>): Refcount .plt entry.
8938         Don't copy to shared lib.
8939         (ppc64_elf_check_relocs): Call bfd_set_error on errors.
8940         (ppc64_elf_gc_sweep_hook <R_PPC64_REL24>): Sweep plt refcount.
8941         (allocate_dynrelocs <plt>): Don't change function sym here.  Make
8942         room for .stub and .glink code.
8943         (ppc64_elf_size_dynamic_sections): Handle .stub.  Make entry for
8944         DT_PPC64_GLINK.
8945         (ppc64_elf_final_link): Rename to ppc64_elf_set_toc.  Don't call
8946         bfd_elf64_bfd_final_link.
8947         (bfd_elf64_bfd_final_link): Don't define.
8948         (ppc64_elf_size_stubs): New.
8949         (build_plt_stub): New.
8950         (build_one_stub): New.
8951         (ppc64_elf_build_stubs): New.
8952         (ppc64_elf_relocate_section <toc relocs>): Remove assert.
8953         (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs.
8954         (ppc64_elf_finish_dynamic_symbol): Don't build stubs here.  Set
8955         DT_PPC64_GLINK entry.  Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in
8956         case output sections not separate.  Adjust DT_RELASZ to not
8957         include plt relocs.  Set reserved got entry.  Set got and plt
8958         entry size.
8959         (elf_backend_got_header_size): Set to 8.
8960         * elf64-ppc.h: New file.
8961
8962 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
8963
8964         * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
8965         sections, use bfd_section_list_remove.
8966         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
8967         * elflink.h (elf_link_add_object_symbols): When removing all
8968         sections, use bfd_section_list_clear.
8969
8970 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
8971
8972         * po/sv.po: New file: Swedish translation.
8973         * configure.in (ALL_LINGUAS): Add sv.
8974         * configure: Regenerate.
8975
8976 2002-01-15  Jakub Jelinek  <jakub@redhat.com>
8977
8978         * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change.
8979         * elf.c (merge_sections_remove_hook): New function.
8980         (_bfd_elf_merge_sections): Pass it as 3rd argument to
8981         _bfd_merge_sections.
8982         * libbfd-in.h (_bfd_merge_sections): Add 3rd argument.
8983         * libbfd.h: Rebuilt.
8984         * merge.c (_bfd_merge_sections): Add remove_hook argument.
8985         Call remove_hook if a SEC_EXCLUDE section is encountered.
8986
8987 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
8988
8989         * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'.
8990         (xstormy16_reloc_map): Initialise new field with correct howto
8991         table.
8992         (xstormy16_reloc_type_lookup): Use 'table' field to locate correct
8993         howto entry.
8994
8995 2002-01-10  Michael Snyder  <msnyder@redhat.com>
8996
8997         * elf.c (elfcore_write_prstatus): Use long instead of pid_t;
8998         (elfcore_write_pstatus): Use long instead of pid_t;
8999         * elf-bfd.h: Change prototypes to use long instead of pid_t;
9000
9001 2002-01-09  Jason Thorpe  <thorpej@wasabisystems.com>
9002
9003         * elf.c: Update copyright years.
9004         (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO
9005         and NT_NETBSDCORE_FIRSTMACH.  Improve a comment.
9006
9007 2002-01-08  Michael Snyder  <msnyder@redhat.com>
9008
9009         Add capability to write corefile note sections, for gdb.
9010         * elf.c (elfcore_write_note): New function.
9011         (elfcore_write_prpsinfo): New function.
9012         (elfcore_write_prstatus): New function.
9013         (elfcore_write_pstatus): New function.
9014         (elfcore_write_prfpreg): New function.
9015         (elfcore_write_prxfpreg): New function.
9016         * elf-bfd.h: Add prototypes for above functions.
9017
9018 2002-01-08  Alexandre Oliva  <aoliva@redhat.com>
9019
9020         * elf.c (elf_fake_sections): Propagate errors from
9021         elf_backend_fake_section.
9022
9023 2002-01-07  Jason Thorpe  <thorpej@wasabisystems.com>
9024
9025         * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo.
9026         (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c.
9027         (elf32-sh-nbsd.lo): New rule.
9028         * Makefile.in: Regenerate.
9029         * config.bfd (sh*le-*-netbsdelf*): New target.
9030         (sh*-*-netbsdelf*): New target.
9031         * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*.
9032         (bfd_elf32_shnbsd_vec): New vector.
9033         (bfd_elf32_shlnbsd_vec): New vector.
9034         * configure: Regenerate.
9035         * elf32-sh-nbsd.c: New file.
9036         * targets.c: Update copyright years.
9037         (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and
9038         bfd_elf32_shnbsd_vec.
9039
9040 2002-01-07  Aldy Hernandez  <aldyh@redhat.com>
9041
9042         * coff-rs6000.c (READ20): Use bfd_scan_vma.
9043
9044 2002-01-07  Geoffrey Keating  <geoffk@redhat.com>
9045
9046         * elflink.h (elf_link_input_bfd): Don't ask for the merged offset
9047         of a symbol in a section that will be deleted.
9048
9049 2002-01-07  Nick Clifton  <nickc@cambridge.redhat.com>
9050
9051         * po/es.po: New file: Spanish translation.
9052         * configure.in (ALL_LINGUAS): Add es.
9053         * configure: Regenerate.
9054
9055 2002-01-06  Steve Ellcey  <sje@cup.hp.com>
9056
9057         * elfxx-ia64.c (is_unwind_section_name): Add target vector as
9058         argument so we can handle HP-UX specially.
9059         (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name.
9060         (elfNN_hpux_backend_section_from_bfd_section): New for support
9061         of SHN_IA_64_ANSI_COMMON.
9062         (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON.
9063         (is_unwind_section_name): Add special HP-UX support.
9064         (elfNN_ia64_section_from_shdr): Add support for more sections.
9065         (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and
9066         add support for more sections.
9067         (elfNN_ia64_additional_program_headers): Modify
9068         is_unwind_section_name call.
9069         (elfNN_ia64_modify_segment_map): Remove assumption that there is
9070         only one unwind section in segment.
9071
9072 2002-01-06  Alan Modra  <amodra@bigpond.net.au>
9073
9074         * syms.c (_bfd_generic_make_empty_symbol): New function.
9075         * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
9076         _bfd_generic_make_empty_symbol.
9077         * libbfd.h: Regenerate.
9078         * bfd-in2.h: Regenerate.
9079         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
9080         (hppabsd_core_get_symtab_upper_bound): Don't define.
9081         (hppabsd_core_get_symtab): Likewise.
9082         (hppabsd_core_print_symbol): Likewise.
9083         (hppabsd_core_get_symbol_info): Likewise.
9084         (hppabsd_core_bfd_is_local_label_name): Likewise.
9085         (hppabsd_core_get_lineno): Likewise.
9086         (hppabsd_core_find_nearest_line): Likewise.
9087         (hppabsd_core_bfd_make_debug_symbol): Likewise.
9088         (hppabsd_core_read_minisymbols): Likewise.
9089         (hppabsd_core_minisymbol_to_symbol): Likewise.
9090         (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
9091         Formatting fixes.
9092         * hpux-core.c: Similarly.
9093         * irix-core.c: Similarly.
9094         * osf-core.c: Similarly.
9095         * sco5-core.c: Similarly.
9096         * binary.c (binary_make_empty_symbol): Remove function, define as
9097         _bfd_generic_make_empty_symbol.
9098         * ihex.c (ihex_make_empty_symbol): Likewise.
9099         * mmo.c (mmo_make_empty_symbol): Likewise.
9100         * ppcboot.c (ppcboot_make_empty_symbol): Likewise.
9101         * srec.c (srec_make_empty_symbol): Likewise.
9102         * versados.c (versados_make_empty_symbol): Likewise.
9103         * vms.c (_bfd_vms_make_empty_symbol): Remove.
9104         (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
9105         * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
9106         rather than _bfd_vms_make_empty_symbol.
9107         * vms-misc.c (new_symbol): Likewise.
9108
9109 2002-01-05  Alan Modra  <amodra@bigpond.net.au>
9110
9111         * section.c (bfd_section_init): Remove unnecessary initialisations.
9112         (bfd_section_list_clear): New function.
9113         (bfd_section_list_remove, bfd_section_list_insert): New macros.
9114         (_bfd_strip_section_from_output): Use them.
9115         * coffcode.h (coff_set_alignment_hook): Likewise.
9116         * elf32-mips.c (_bfd_mips_elf_final_link): Likewise.
9117         * elf64-mips.c (mips_elf64_final_link): Likewise.
9118         * elf64-mmix.c (mmix_elf_final_link): Likewise.
9119         * sunos.c (sunos_add_dynamic_symbols): Likewise.
9120         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
9121         * bfd-in2.h: Regenerate.
9122
9123         * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway
9124         rather than doing our own section handling.  Clean up after errors
9125         with bfd_release and bfd_section_list_clear.  Handle unexpected
9126         flags.
9127         * aoutf1.h (sunos4_core_file_p): Likewise.
9128         * aix386-core.c (aix386_core_file_p): Likewise.
9129         * cisco-core.c (cisco_core_file_validate): Likewise.
9130         * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
9131         * trad-core.c (trad_unix_core_file_p): Likewise.
9132
9133         * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors
9134         with bfd_release and bfd_section_list_clear.
9135         * hpux-core.c (hpux_core_core_file_p): Likewise.
9136         * irix-core.c (irix_core_core_file_p): Likewise.
9137         * lynx-core.c (lynx_core_file_p): Likewise.
9138         * osf-core.c (osf_core_core_file_p): Likewise.
9139         * rs6000-core.c (rs6000coff_core_p): Likewise.
9140         * sco5-core.c (sco5_core_file_p): Likewise.
9141
9142         * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform
9143         sign extension adjustments without conditionals.
9144
9145 2002-01-04  Jakub Jelinek  <jakub@redhat.com>
9146
9147         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if
9148         CIE at .eh_frame start is removed due to no FDEs referencing it.
9149
9150 2002-01-04  Jason Thorpe  <thorpej@wasabisystems.com>
9151
9152         * config.bfd (x86_64-*-netbsd*): New target.
9153         * configure.in (x86_64-*-netbsd*): Set COREFILE
9154         to netbsd-core.lo.
9155         * configure: Regenerated.
9156
9157 2002-01-03  Tom Rix  <trix@redhat.com>
9158
9159         * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering
9160         for recent bfd_make_section_anyway change.
9161
9162 2002-01-03  Nick Clifton  <nickc@cambridge.redhat.com>
9163
9164         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
9165         R_ARM_THM_PC11 reloc.
9166
9167 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
9168
9169         * configure.in (LINGUAS): Add ja.
9170         * configure: Regenerate.
9171         * po/ja.po: Import from translation project's web site.
9172
9173 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
9174
9175         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error
9176         messages to ease translation into other languages.
9177
9178 For older changes see ChangeLog-0001
9179 \f
9180 Local Variables:
9181 mode: change-log
9182 left-margin: 8
9183 fill-column: 74
9184 version-control: never
9185 End: