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