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