ad3d9ac726aa7486f4c68ad78567b2d9f24a4aa9
[external/binutils.git] / bfd / ChangeLog
1 2003-11-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2
3         * elf32-s390.c (elf_s390_relocate_section): Don't recalculate symbol
4         section for reloc output and subtract the output section's address
5         from the addend when converting a relocation into one against a
6         section symbol.
7         * elf64-s390.c (elf_s390_relocate_section): Likewise.
8
9 2003-11-18  James E Wilson  <wilson@specifixinc.com>
10
11         * elfxx-ia64.c (get_fptr): For fptr_rel, use dynobj not abfd.
12         (elfNN_ia64_size_dynamic_sections): When stripping sections, check
13         for ia64_info->rel_fptr_sec.
14
15 2003-11-18  Alan Modra  <amodra@bigpond.net.au>
16
17         * elf64-ppc.c (toc_adjusting_stub_needed): Exit early if section
18         size is zero.
19
20 2003-11-17  Daniel Jacobowitz  <drow@mvista.com>
21
22         * elf.c (_bfd_elf_link_hash_copy_indirect): Copy
23         ELF_LINK_HASH_NEEDS_PLT.  Fix formatting.
24         * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
25         * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
26         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise.
27         * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
28         * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
29         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
30         * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
31         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise.
32         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
33         * elf32-xtensa.c (elf_xtensa_copy_indirect_symbol): Remove.
34         (elf_backend_copy_indirect_symbol): Don't define.
35
36 2003-11-14  Daniel Jacobowitz  <drow@mvista.com>
37
38         * elfxx-mips.c (mips_elf_merge_gots): Weaken assert for local
39         GOT entries.
40
41 2003-11-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
42
43         * elf32-s390.c (elf_s390_relocate_section): Only convert R_390_32
44         to R_390_RELATIVE. Convert the other relocations against local
45         symbols to relocations against the start of the section.
46         * elf64-s390.c (elf_s390_relocate_section): Only convert R_390_64
47         to R_390_RELATIVE. Convert the other relocations against local
48         symbols to relocations against the start of the section.
49
50 2003-11-11  Nick Clifton  <nickc@redhat.com>
51
52         * elf-m10300.c (bfd_mn10300_elf_size_dynamic_sections): Use
53         info->executable not info->shared to decide if a .interp section
54         should be present.
55         * elf32-arm.h (elf32_arm_size_dynamic_sections): Likewise.
56         * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise.
57         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
58         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
59         * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
60         * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
61         * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise.
62         * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
63         * elfxx-mips.c (_bfd_mips_size_dynamic_sections): Likewise.
64         * elflink.h (size_dynamic_sections): Likewise.
65
66 2003-11-10  Jonathan Wilson <jonwil@tpgi.com.au>
67
68         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Swap out tls pointer.
69         (_bfd_XXi_final_link_postscript): Look for __tks_used symbol.  If
70         found initialise the tls data directory entry.
71
72 2003-11-07  Alan Modra  <amodra@bigpond.net.au>
73
74         * elf32-ppc.c (ppc_elf_install_value): Delete.
75         (shared_stub_entry, stub_entry): Make them arrays of ints.
76         Remove initial branch.
77         (ppc_elf_relax_section): Write one branch around all trampolines
78         instead.  Correct bogus R_PPC_PLTREL24 handling.  Correct
79         branch range check.  Only use shared_stub_entry when shared.
80         Test that branches can reach stubs.  Write trampolines out at
81         end so that just one realloc is used.  Handle little-endian
82         mode.  Move relevant code from ppc_elf_install_value to here.
83         (ppc_elf_relocate_section): Move code handling RELAX32 from
84         ppc_elf_install_value to here.
85
86 2003-11-06  Alan Modra  <amodra@bigpond.net.au>
87
88         * elf32-ppc.c (ppc_elf_howto_raw); Add entry for R_PPC_RELAX32PC.
89         (ppc_elf_install_value): Handle R_PPC_RELAX32PC.  Merge duplicate
90         cases.
91         (shared_stub_entry): Correct opcode.
92         (ppc_elf_relax_section): Generate R_PPC_RELAX32PC relocs.
93         (ppc_elf_relocate_section): Handle them.
94
95 2003-11-05  Alan Modra  <amodra@bigpond.net.au>
96
97         * elf.c (_bfd_elf_rela_local_sym): Accept asection **, and return
98         updated section in case of merged section.
99         * elf-bfd.h (_bfd_elf_rela_local_sym): Update declaration.
100         * elf-hppa.h (elf_hppa_relocate_section): Adjust call.
101         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
102         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
103         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
104         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
105         * elf32-cris.c (cris_elf_relocate_section): Likewise.
106         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
107         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
108         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
109         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
110         * elf32-i370.c (i370_elf_relocate_section): Likewise.
111         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
112         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
113         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
114         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
115         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
116         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
117         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
118         * elf32-s390.c (elf_s390_relocate_section): Likewise.
119         * elf32-sh.c (sh_elf_relocate_section): Likewise.
120         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
121         * elf32-v850.c (v850_elf_relocate_section) Likewise.
122         * elf32-vax.c (elf_vax_relocate_section): Likewise.
123         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
124         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
125         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
126         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
127         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
128         * elf64-s390.c (elf_s390_relocate_section): Likewise.
129         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
130         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
131         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
132         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
133
134         * elf32-cris.c (cris_elf_relocate_section): Don't recalculate symbol
135         section for reloc output.
136         * elf32-i370.c (i370_elf_relocate_section): Likewise.
137         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
138         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
139         * elf32-vax.c (elf_vax_relocate_section): Likewise.
140         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
141         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
142
143         * elf32-ppc.c (ppc_elf_relocate_section): Don't recalculate everything
144         for R_PPC_RELAX32 reloc.  Don't bother checking ppc_elf_install_value
145         return value.
146         * elf64-ppc.c (ppc64_elf_relocate_section <R_PPC64_TOC>): Sanity check
147         sec->id.
148
149 2003-11-05  Alan Modra  <amodra@bigpond.net.au>
150
151         * elf32-d10v.c (extract_rel_addend, insert_rel_addend): New functions.
152         (elf32_d10v_relocate_section): Use them to handle -r reloc
153         adjustments, and in place of _bfd_elf_rela_local_sym.
154
155         * cpu-iq2000.c (arch_info_struct): Warning fix.
156
157 2003-11-05  Alan Modra  <amodra@bigpond.net.au>
158
159         * elf32-hppa.c (ELIMINATE_COPY_RELOCS): Define.
160         (elf32_hppa_copy_indirect_symbol): Don't copy NON_GOT_REF on
161         weakdefs.
162         (elf32_hppa_check_relocs): Use ELIMINATE_COPY_RELOCS.
163         (elf32_hppa_adjust_dynamic_symbol): Likewise.  Copy weakdef
164         NON_GOT_REF.
165         (allocate_dynrelocs): Use ELIMINATE_COPY_RELOCS and
166         SYMBOL_CALLS_LOCAL.  Discard relocs for undef weak syms with
167         non-default visibility.
168         (elf32_hppa_relocate_section): Use ELIMINATE_COPY_RELOCS and
169         SYMBOL_CALLS_LOCAL.
170
171 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
172
173         * aout-target.h, aoutf1.h, bfdio.c, bfdwin.c: Update copyright date.
174         * coff-apollo.c, coff-sparc.c, coff-w65.c, coff-we32k.c: Ditto.
175         * coff-z8k.c, coffgen.c, cpu-frv.c, cpu-h8500.c, cpu-hppa.c: Ditto.
176         * cpu-ia64-opc.c, cpu-m10300.c, cpu-mips.c, cpu-msp430.c: Ditto.
177         * cpu-rs6000.c, cpu-z8k.c, efi-app-ia32.c, elf32-am33lin.c: Ditto.
178         * gen-aout.c, hash.c, hp300hpux.c, init.c, mach-o.c: Ditto.
179         * nlm-target.h, nlm.c, som.h, stabs.c, sysdep.h, xsym.h: Ditto.
180
181         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix
182         "dereferencing type-punned pointer" warnings.
183
184         * aout-adobe.c (aout_adobe_set_section_contents): Constify location.
185         * aoutx.h (NAME(aout,set_section_contents)): Ditto.
186         * bfd-in2.h: Regenerate.
187         * binary.c (binary_set_section_contents): Ditto.
188         * bout.c (b_out_set_section_contents): Ditto.
189         * coff-tic54x.c (tic54x_set_section_contents): Ditto.
190         * coffcode.h (coff_set_section_contents): Ditto.
191         * ecoff.c (_bfd_ecoff_set_section_contents): Ditto.
192         * elf-bfd.h (_bfd_elf_set_section_contents): Ditto.
193         * elf.c (_bfd_elf_set_section_contents): Ditto.
194         * elfxx-mips.c (_bfd_mips_elf_set_section_contents): Ditto.
195         * elfxx-mips.h (_bfd_mips_elf_set_section_contents): Ditto.
196         * i386msdos.c (msdos_set_section_contents): Ditto.
197         * ieee.c (ieee_set_section_contents): Ditto.
198         * ihex.c (ihex_set_section_contents): Ditto.
199         * libaout.h (NAME(aout,set_section_contents)): Ditto.
200         * libbfd-in.h (_bfd_nowrite_set_section_contents): Ditto.
201         (_bfd_generic_set_section_contents): Ditto.
202         * libbfd.h: Regenerate.
203         * libbfd.c (_bfd_generic_set_section_contents): Ditto.
204         * libecoff.h (_bfd_ecoff_set_section_contents): Ditto.
205         * libnlm.h (nlmNAME(set_section_contents)): Ditto.
206         (struct nlm_backend_data <nlm_mangle_relocs>): Ditto.
207         * mmo.c (mmo_set_section_contents): Ditto.
208         * nlm32-alpha.c (nlm_alpha_mangle_relocs): Ditto.
209         * nlm32-i386.c (nlm_i386_mangle_relocs): Ditto.
210         * nlm32-ppc.c (nlm_powerpc_mangle_relocs): Ditto.
211         * nlm32-sparc.c (nlm_sparc_mangle_relocs): Ditto.
212         * nlmcode.h (nlm_set_section_contents): Ditto.
213         * oasys.c (oasys_set_section_contents): Ditto.
214         * pdp11.c (NAME(aout,set_section_contents)): Ditto.
215         * ppcboot.c (ppcboot_set_section_contents): Ditto.
216         * srec.c (srec_set_section_contents): Ditto.
217         * targets.c (BFD_JUMP_TABLE_WRITE <_bfd_set_section_contents>): Ditto.
218         * tekhex.c (tekhex_set_section_contents): Ditto.
219         (move_section_contents): Ditto.
220         * versados.c (versados_set_section_contents): Ditto.
221         * vms-misc.c (_bfd_save_vms_section): Ditto.
222         * vms.c (vms_set_section_contents): Ditto.
223         * vms.h (_bfd_save_vms_section): Ditto.
224
225 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
226
227         * elf64-ppc.c (ppc_size_one_stub): Size relbrlt.  Accept info arg
228         rather than htab.
229         (ppc64_elf_size_stubs): Adjust ppc_size_one_stub traversal.  Zero
230         relbrlt size.
231         (ppc64_elf_build_stubs): Allocate space for relbrlt.
232
233 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
234
235         * bfd-in.h (_bfd_elf_tls_setup): Declare.
236         * bfd-in2.h: Regenerate.
237         * elf-bfd.h (struct elf_link_tls_segment): Delete.
238         (struct elf_link_hash_table): Add tls_sec and tls_size.
239         * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size.
240         * elflink.c (_bfd_elf_tls_setup): New function.
241         * elflink.h (struct elf_final_link_info): Remove first_tls_sec.
242         (elf_bfd_final_link): Don't set first_tls_sec here.  Update code
243         saving tls segment info, round segment size up.
244         (elf_link_output_extsym): Adjust code using tls segment info.
245         (elf_link_input_bfd): Likewise.
246         * elf32-i386.c (dtpoff_base, tpoff): Likewise.
247         * elf32-s390.c (dtpoff_base, tpoff): Likewise.
248         * elf32-sh.c (dtpoff_base, tpoff): Likewise.
249         * elf32-sparc.c (dtpoff_base, tpoff): Likewise.
250         * elf64-s390.c (dtpoff_base, tpoff): Likewise.
251         * elf64-x86-64.c (dtpoff_base, tpoff): Likewise.
252         * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise.
253         (elfNN_ia64_dtprel_base): Likewise.
254         * elf64-alpha.c (alpha_get_dtprel_base): Likewise.
255         (alpha_get_tprel_base): Likewise.
256         (struct alpha_relax_info): Remove tls_segment.
257         (elf64_alpha_relax_got_load): Adjust invocation of
258         alpha_get_dtprel_base and alpha_get_tprel_base.
259         (elf64_alpha_relax_tls_get_addr): Likewise.
260         (elf64_alpha_relax_section): Likewise.
261         (elf64_alpha_relocate_section): Likewise.
262         (elf64_alpha_relax_find_tls_segment): Delete.
263         * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec.
264         (ppc_elf_tls_setup): Call _bfd_elf_tls_setup.  Return section.
265         (ppc_elf_relocate_section): Adjust to use elf.tls_sec.
266         * elf32-ppc.h (ppc_elf_tls_setup): Update.
267         * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec.
268         (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup.  Return section.
269         (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec.
270         (ppc64_elf_relocate_section): Likewise.
271         * elf64-ppc.h (ppc64_elf_tls_setup): Update.
272
273 2003-11-03  Daniel Jacobowitz  <drow@mvista.com>
274
275         * elf-bfd.h (struct elf_backend_data): Remove plt_header_size.
276         * elf-m10300.c (elf_backend_plt_header_size): Don't define.
277         * elf32-arm.h (elf_backend_plt_header_size): Don't define.
278         * elf32-cris.c (elf_backend_plt_header_size): Don't define.
279         * elf32-i386.c (elf_backend_plt_header_size): Don't define.
280         * elf32-mips.c (elf_backend_plt_header_size): Don't define.
281         * elf32-ppc.c (elf_backend_plt_header_size): Don't define.
282         * elf32-s390.c (elf_backend_plt_header_size): Don't define.
283         * elf32-sh.c (elf_backend_plt_header_size): Don't define.
284         * elf32-sparc.c (elf_backend_plt_header_size): Don't define.
285         * elf64-alpha.c (elf_backend_plt_header_size): Don't define.
286         * elf64-hppa.c (elf_backend_plt_header_size): Don't define.
287         * elf64-mips.c (elf_backend_plt_header_size): Don't define.
288         * elf64-ppc.c (elf_backend_plt_header_size): Don't define.
289         * elf64-s390.c (elf_backend_plt_header_size): Don't define.
290         * elf64-sh64.c (elf_backend_plt_header_size): Don't define.
291         * elf64-sparc.c (elf_backend_plt_header_size): Don't define.
292         * elf64-x86-64.c (elf_backend_plt_header_size): Don't define.
293         * elfn32-mips.c (elf_backend_plt_header_size): Don't define.
294         * elfxx-ia64.c (elf_backend_plt_header_size): Don't define.
295         * elfxx-target.h (elf_backend_plt_header_size): Don't define
296         or include in target initializer.
297
298 2003-11-03  Andrew Cagney  <cagney@redhat.com>
299
300         * section.c (bfd_set_section_contents): Make the "location" buffer
301         constant.
302         * bfd-in2.h: Re-generate.
303
304 2003-10-30  Andrew Cagney  <cagney@redhat.com>
305
306         * syms.c: Replace "struct symbol_cache_entry" with "struct
307         bfd_symbol".
308         * vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
309         * mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
310         * cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
311         * bfd-in2.h: Re-generate.
312
313 2003-10-30  Jakub Jelinek  <jakub@redhat.com>
314
315         * elfxx-ia64.c: Include objalloc.h, hashtab.h.
316         (struct elfNN_ia64_local_hash_entry): Remove root. Add id and r_sym
317         fields.
318         (struct elfNN_ia64_local_hash_table): Remove.
319         (struct elfNN_ia64_link_hash_table): Change loc_hash_table's type
320         to htab_t.  Add loc_hash_memory field.
321         (elfNN_ia64_local_hash_table_init, elfNN_ia64_new_loc_hash_entry):
322         Removed.
323         (elfNN_ia64_local_htab_hash, elfNN_ia64_local_htab_eq): New
324         functions.
325         (elfNN_ia64_hash_table_create): Use hashtab.h hashtable for
326         loc_hash_table.  Initialize loc_hash_memory.
327         (elfNN_ia64_hash_table_free): New function.
328         (elfNN_ia64_local_hash_lookup): Remove.
329         (elfNN_ia64_local_dyn_sym_thunk): Change into htab_traverse
330         callback.
331         (elfNN_ia64_dyn_sym_traverse): Use htab_traverse.
332         (get_local_sym_hash): Use hashtab.h hashtable for loc_hash_table.
333         (bfd_elfNN_bfd_link_hash_table_free): Define.
334
335 2003-10-30  Alan Modra  <amodra@bigpond.net.au>
336
337         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Modify versioned
338         symbol string in place.
339
340 2003-10-30  Jim Blandy  <jimb@redhat.com>
341
342         * cpu-rs6000.c (rs6000_compatible): Check the correct arch_info
343         object's mach field: all PowerPC machines are supersets of the
344         original rs6000, but not later rs6000 machines.
345
346 2003-10-30  Alan Modra  <amodra@bigpond.net.au>
347
348         * dwarf2.c (struct attribute): Delete "unsnd", "snd" and "addr".
349         Add "val" and "sval" fields.
350         (DW_STRING, DW_UNSND, DW_BLOCK, DW_SND, DW_ADDR): Delete.
351         (read_attribute_value): Expand and adjust DW_* occurrences.
352         (scan_unit_for_functions, parse_comp_unit): Likewise.
353
354 2003-10-30  Phil Edwards  <phil@codesourcery.com>
355
356         * config.bfd (arm-*-vxworks):  Remove separate stanza; merge with
357         other common ELF triples.
358         (i[3-7]86-*-vxworks):  Change to ELF format.
359         (mips*-*-windiss):  New triple, add to common MIPS/ELF stanza.
360         (sh-*-vxworks):  New stanza.
361
362 2003-10-30  Lars Knoll  <lars@trolltech.com>
363             Michael Matz  <matz@suse.de>
364             Jakub Jelinek  <jakub@redhat.com>
365             Alan Modra  <amodra@bigpond.net.au>
366
367         * merge.c (struct sec_merge_sec_info): Update comment.
368         (struct sec_merge_hash_entry): Remove entsize.
369         (sec_merge_hash_lookup): Only adjust alignment when creating.
370         (sec_merge_emit): Remove register keyword.
371         (cmplengthentry, last4_eq, last_eq): Delete.
372         (strrevcmp, strrevcmp_align, is_suffix): New.
373         (merge_strings): Use them to implement fast suffix merging.
374         * elf-strtab.c (struct elf_strtab_hash_entry): Update comments.
375         Make "len" signed.
376         (_bfd_elf_strtab_add): Lose on >2G strings.
377         (_bfd_elf_strtab_emit): Don't emit strings with len < 0.
378         (cmplengthentry, last4_eq): Delete.
379         (strrevcmp, is_suffix): New.
380         (_bfd_elf_strtab_finalize): Rework to implement fast suffix merging.
381
382 2003-10-29  Daniel Jacobowitz  <drow@mvista.com>
383
384         * elf32-arm.h (elf32_arm_final_link_relocate): Move check for
385         SEC_ALLOC.
386
387 2003-10-29  Philip Blundell  <philb@gnu.org>
388
389         * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New
390         code sequence.
391         (PLT_HEADER_SIZE): New.
392         (struct elf32_arm_pcrel_relocs_copied): Rename to ...
393         (struct elf32_arm_relocs_copied): ... this.  Count both
394         pcrel and non-pcrel relocs.  All uses updated.
395         (struct elf32_arm_link_hash_table): Add pointers to dynamic linker
396         sections and symbol/section mapping cache.
397         (create_got_section): New.
398         (elf32_arm_create_dynamic_sections): New.
399         (elf_backend_create_dynamic_sections): Use it.
400         (elf32_arm_final_link_relocate): Support garbage collection of relocs.
401         (elf32_arm_check_relocs): Likewise.
402         (elf32_arm_adjust_dynamic_symbol): Likewise.
403         (elf32_arm_copy_indirect_symbol): New.
404         (elf32_arm_link_hash_table_create): Initialise new fields.
405         (elf32_arm_gc_sweep_hook): Implement.
406         (elf32_arm_discard_copies): Delete.
407         (elf32_arm_finish_dynamic_symbol): Use new PLT code.
408         (elf32_arm_finish_dynamic_sections): Likewise.
409         (elf_backend_can_refcount): Define.
410         (elf_backend_copy_indirect_symbol): Likewise.
411         (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE.
412
413 2003-10-29  Alan Modra  <amodra@bigpond.net.au>
414
415         * elf64-ppc.c (elf_backend_grok_prstatus): Define.
416         (elf_backend_grok_psinfo): Define.
417         (ppc64_elf_grok_prstatus, ppc64_elf_grok_psinfo): New functions.
418
419         * elf.c (_bfd_elfcore_make_pseudosection): Allow multiple
420         sections with the same name.
421         (elfcore_grok_lwpstatus): Likewise.
422         (elfcore_grok_win32pstatus): Likewise.
423         (elfcore_grok_note): Likewise.
424         (elfcore_grok_nto_status): Likewise.
425         (elfcore_grok_nto_gregs): Likewise.
426
427 2003-10-27  Daniel Jacobowitz  <drow@mvista.com>
428
429         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Never skip dynamic
430         objects.
431
432 2003-10-14  Richard Sandiford  <rsandifo@redhat.com>
433
434         * elfxx-mips.c (mips_elf_create_got_section): Initialize global_gotno.
435
436 2003-10-24  H.J. Lu  <hongjiu.lu@intel.com>
437
438         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up
439         hash table for real symbols.
440
441 2003-10-23  Michael Snyder  <msnyder@redhat.com>
442
443         * section.c (asection): Fix typo in comment.
444
445 2003-10-23  Alan Modra  <amodra@bigpond.net.au>
446
447         * elf64-ppc.c (get_tls_mask): Add toc_symndx param, save toc
448         reloc symbol index to it.  Don't allow gd syms in shared libs
449         to be optimized.
450         (ppc64_elf_tls_optimize): Adjust get_tls_mask call.
451         (ppc64_elf_size_stubs): Likewise.
452         (ppc64_elf_relocate_section): Check that tls relocs are only used
453         with tls syms, and similarly for non-tls.  Correct symbol used
454         when optimizing toc tls code.
455
456 2003-10-22  Nick Clifton  <nickc@redhat.com>
457
458         * peicode.h (coff_swap_scnhdr_in): Only remove padding when
459         processing an executable.
460
461 2003-10-22  Jakub Jelinek  <jakub@redhat.com>
462
463         * elflink.c (_bfd_elf_export_symbol): Adjust for globals and locals
464         field changes.
465         (_bfd_elf_link_assign_sym_version): Likewise.
466         * elflink.h (size_dynamic_sections): Likewise.
467
468 2003-10-21  Alexandre Oliva  <aoliva@redhat.com>,
469             Michael Snyder  <msnyder@redhat.com>
470
471         * archures.c (bfd_mach_sh4a, bfd_mach_sh4al_dsp, bfd_mach_sh4_nofpu,
472         bfd_mach_sh4a_nofpu): New machine types.
473         * bfd-in2.h: Rebuilt.
474         * cpu-sh.c (compatible): Remove unused function.
475         (SH4A_NEXT, SH4AL_DSP_NEXT, SH4_NOFPU_NEXT, SH4A_NOFPU_NEXT): New.
476         (arch_info_struct): Add sh4a, sh4al_dsp, sh4-nofpu and sh4a-nofpu.
477         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle them.
478
479 2003-10-21  Wouter van Heyst <wouter@vidicode.nl>
480
481         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Correct text
482         describing mismatched formats involving the Maverick FP type.
483
484 2003-10-21  Anil Paranjpe  <anilp1@KPITCummins.com>
485
486         * binary.c (binary_object_p): Pass machine flag along with
487         architecture.
488
489 2003-10-21  Thorsten Brehm  <brehm@gmx.net>
490
491         * archures.c (bfd_default_scan): Add support for mcf528x.
492         * ieee.c (ieee_write_processor): Likewise.
493
494 2003-10-21  Peter Barada  <pbarada@mail.wm.sps.mot.com>
495             Bernardo Innocenti  <bernie@develer.com>
496
497         * archures.c: Add MCF528x (MCFv4) support.
498         * bfd/cpu-m68k.c (arch_info_struct): Likewise.
499         * bfd-in2.h: Regenerate.
500
501 2003-10-20  Andrew Cagney  <cagney@redhat.com>
502
503         * targets.c: Replace "struct sec" with "struct bfd_section"
504         * syms.c, sparclynx.c, section.c, opncls.c: Ditto.
505         * libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
506         * elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
507         * aout-tic30.c, aout-target.h:
508         * bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
509
510 2003-10-18  Hans-Peter Nilsson  <hp@bitrange.com>
511
512         Support linker relaxation of new R_MMIX_PUSHJ_STUBBABLE relocs.
513         * elf64-mmix.c (MAX_PUSHJ_STUB_SIZE): New macro.
514         (struct _mmix_elf_section_data): New member pjs.
515         (mmix_set_relaxable_size, mmix_elf_get_section_contents): New
516         functions.
517         (elf_mmix_howto_table): New entry for R_MMIX_PUSHJ_STUBBABLE.
518         (mmix_reloc_map): Ditto.
519         (mmix_elf_relocate_section): Handle R_MMIX_PUSHJ_STUBBABLE.
520         (mmix_final_link_relocate, mmix_elf_check_common_relocs): Ditto.
521         (mmix_elf_perform_relocation): Ditto.  Don't mark parameter addr
522         unused.
523         (mmix_elf_check_relocs): Move early return to after
524         mmix_elf_check_common_relocs call.
525         (mmix_elf_symbol_processing): Fix cut-and-pasto in head comment.
526         (_bfd_mmix_before_linker_allocation): Rename from
527         _bfd_mmix_prepare_linker_allocated_gregs.  All referers changed.
528         Arrange to set the initial relaxable size of sections.
529         (_bfd_mmix_after_linker_allocation): Rename from
530         _bfd_mmix_finalize_linker_allocated_gregs.
531         (mmix_elf_relax_section): Relax a R_MMIX_PUSHJ_STUBBABLE reloc.
532         (bfd_elf64_get_section_contents): Define.
533         * reloc.c: Add ENUMX for BFD_RELOC_MMIX_PUSHJ_STUBBABLE.
534         * libbfd.h, bfd-in2.h: Regenerate.
535
536         * reloc.c (bfd_generic_relax_section): Default-set
537         section->_cooked_size here.
538         (bfd_generic_get_relocated_section_contents): Don't set it here.
539         Explain why.
540
541 2003-10-17  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
542
543         * elf32-hppa.c (elf32_hppa_relocate_section): Skip relocation if
544         output section has been discarded.
545
546 2003-10-17  Shrinivas Atre  <shrinivasa@KPITCummins.com>
547
548         * coff-h8300.c (funcvec_hash_newfunc): Handle normal mode.
549         (h8300_reloc16_extra_cases): Likewise.
550         (h8300_bfd_link_add_symbols): Likewise.
551
552 2003-10-17 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
553
554         * cpu-h8300.c (h8300sxn_info_struct): Correct address size.
555         (h8300sn_info_struct): Likewise.
556         (h8300hn_info_struct): Likewise.
557
558 2003-10-16  Pavel Roskin  <proski@gnu.org>
559
560         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size
561         for sections which lack size info.
562
563 2003-10-17  Danny Smith  <dannysmith@users.sourceforge.net>
564
565         * configure.host: Add __USE_MINGW_FSEEK to HDEFINES for
566          mingw32.
567
568 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
569
570         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also warn
571         undefined patterns with '*'.
572
573 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
574
575         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't
576         use the last CIE from a different section.
577         (_bfd_elf_write_section_eh_frame): Don't pad beyond the raw
578         size of the output section.
579
580 2003-10-07  Roland McGrath  <roland@redhat.com>
581
582         * elf.c (_bfd_elf_make_section_from_phdr): Set alignment_power of
583         new section from p_align header field.
584
585 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
586
587         * elf32-xtensa.c (xtensa_read_table_entries): The external size
588         of entry is 8 bytes.
589
590 2003-10-15  Andrew Cagney  <cagney@redhat.com>
591
592         * targets.c (BFD_JUMP_TABLE_SYMBOLS): Replace NAME##_get_symtab
593         with NAME##_canonicalize_symtab.
594         * libcoff-in.h (coff_canonicalize_symtab): Update.
595         * xsym.h (bfd_sym_canonicalize_symtab): Update.
596         * elf-bfd.h (_bfd_elf_canonicalize_symtab): Update.
597         * coffgen.c (coff_canonicalize_symtab): Update.
598         * libbfd-in.h (_bfd_nosymbols_canonicalize_symtab): Update.
599         * libnlm.h (nlmNAME(canonicalize_symtab)): Update.
600         * ieee.c (ieee_vec): Update comment.
601         * libecoff.h (_bfd_ecoff_canonicalize_symtab): Update.
602         * mmo.c (mmo_canonicalize_symtab): Update.
603         * nlm-target.h (nlm_canonicalize_symtab): Update.
604         * nlmcode.h (nlm_canonicalize_symtab): Update.
605         * i386msdos.c (msdos_canonicalize_symtab): Update.
606         * hp300hpux.c (MY (canonicalize_symtab)): Update.
607         * oasys.c (oasys_canonicalize_symtab): Update.
608         * som.c (som_canonicalize_symtab): Update.
609         * pef.c (bfd_pef_canonicalize_symtab): Update.
610         * nlmcode.h (nlm_canonicalize_symtab): Update.
611         * xsym.c (bfd_sym_canonicalize_symtab): Update.
612         * vms.c (vms_canonicalize_symtab): Update.
613         * versados.c (versados_canonicalize_symtab): Update.
614         * mach-o.c (bfd_mach_o_canonicalize_symtab): Update.
615         * ieee.c (ieee_canonicalize_symtab): Update.
616         * pdp11.c (NAME(aout,canonicalize_symtab)): Update.
617         * reloc.c: Update comment.
618         * libaout.h (NAME(aout,canonicalize_symtab)): Update.
619         * coff64-rs6000.c (aix5coff64_vec): Update.
620         * coff64-rs6000.c (bfd_xcoff_aix5_backend_data): Update.
621         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update.
622         * aoutx.h (NAME(aout,canonicalize_symtab)): Update.
623         * elfxx-target.h (bfd_elfNN_canonicalize_symtab): Update.
624         * hp300hpux.c (MY_canonicalize_symtab): Update.
625         * ecoff.c (_bfd_ecoff_canonicalize_symtab): Update.
626         * aout-tic30.c (MY_canonicalize_symtab): Update.
627         * aout-target.h (MY_canonicalize_symtab): Update.
628         * ppcboot.c (ppcboot_canonicalize_symtab): Update.
629         * elf.c (_bfd_elf_canonicalize_symtab): Update.
630         * elfcode.h (elf_canonicalize_symtab): Update.
631         * ihex.c (ihex_canonicalize_symtab): Update.
632         * tekhex.c (tekhex_canonicalize_symtab): Update.
633         * binary.c (binary_canonicalize_symtab): Update.
634         * srec.c (srec_canonicalize_symtab): Update.
635
636 2003-10-15  Kazu Hirata  <kazu@cs.umass.edu>
637
638         * elf32-h8300.c (elf_reloc_map): Fix a comment typo.
639
640 2003-10-15  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
641
642         * elf32-sh.c (sh_elf_relocate_section): Handle R_SH_IMM_*_PCREL
643         relocations.
644         (sh_elf_check_relocs): Likewise.
645
646         * elf32-sh64.c (elf_backend_merge_symbol_attribute): Define.
647         (sh64_elf_merge_symbol_attribute): New.
648         * elf64-sh64.c (elf_backend_merge_symbol_attribute): Define.
649         (sh64_elf64_merge_symbol_attribute): New.
650
651 2003-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
652
653         * elf-bfd.h (struct elf_backend_data): New function pointer member
654         elf_backend_merge_symbol_attribute.
655         * elflink.h (elf_link_add_object_symbols): Adjust call to
656         elf_backend_merge_symbol_attribute if the backend defined it.
657         * elfxx-target.h (elf_backend_merge_symbol_attribute): New macro.
658         (elfNN_bed): Add that to the initializer.
659
660 2003-10-14  Bob Wilson  <bob.wilson@acm.org>
661
662         * elf32-xtensa.c (get_is_linkonce_section): Delete.
663         (xtensa_is_property_section, xtensa_is_littable_section): Use
664         XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros.  Do not recognize
665         linkonce sections containing ".xt.insn" and ".xt.lit" substrings.
666         (xtensa_get_property_section_name): Check section name instead of
667         calling get_is_linkonce_section.  Remove unused bfd parameter.  Use
668         XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros.  Never generate
669         linkonce section names by appending ".xt.insn" or ".xt.lit".
670         (xtensa_read_table_entries): Remove bfd argument in call to
671         xtensa_get_property_section_name.  Free section name when done.
672         (elf_xtensa_combine_prop_entries): Free leaking table.
673
674 2003-10-13  Richard Sandiford  <rsandifo@redht.com>
675
676         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add
677         DT_MIPS_LIBLIST or DT_MIPS_CONFLICT entries.
678         (_bfd_mips_elf_finish_dynamic_symbol): Don't handle them.  Don't
679         handle DT_MIPS_MSYM.  Set DT_RELSZ based on the number of relocations
680         that were needed.
681         (_bfd_mips_elf_modify_segment_map): Fix placement of PT_MIPS_OPTIONS.
682         (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_UCODE.
683
684 2003-10-13  H.J. Lu  <hongjiu.lu@intel.com>
685
686         * bfd-in.h (bfd_elf32_ia64_after_parse): New prototype.
687         (bfd_elf64_ia64_after_parse): Likewise.
688         * bfd-in2.h: Regenerated.
689
690         * elfxx-ia64.c (oor_ip): New.
691         (oor_branch_size): Likewise.
692         (bfd_elfNN_ia64_after_parse): Likewise.
693         (elfNN_ia64_relax_section): Use oor_ip if oor_branch_size
694         equals sizeof (oor_ip).
695
696 2003-10-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
697
698         * elf64-sh64.c (sh_elf64_relocate_section): Tidy up for the
699         renumbering of some relocation numbers.
700
701 2003-10-11  Alan Modra  <amodra@bigpond.net.au>
702
703         * coff-sh.c: Move definition of MAP and guard more code with
704         COFF_IMAGE_WITH_PE.
705
706         * section.c (bfd_get_section_size_before_reloc): Ignore reloc_done.
707         * bfd-in2.h: Regenerate.
708
709 2003-10-10  H.J. Lu  <hongjiu.lu@intel.com>
710
711         * Makefile.am: Run "make dep-am".
712         * Makefile.in: Regenerate.
713         * doc/Makefile.in: Likewise.
714
715 2003-10-09  H.J. Lu  <hongjiu.lu@intel.com>
716
717         * cofflink.c: Include "safe-ctype.h".
718         (coff_link_add_symbols): Use ISDIGIT instead of isdigit.
719
720 2003-10-08  Dave Brolley  <brolley@redhat.com>
721         On behalf of Michael Snyder  <msnyder@redhat.com>
722
723         * archures.c: Add FRV fr550 machine.
724         * cpu-frv.c: Ditto.
725         * elf32-frv.c: Ditto.
726         * bfd-in2.h: Regenerate.
727
728 2003-10-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
729
730         * elfxx-mips.c (STUB_MOVE,STUB_LI16): Fix stub code
731         for non-SGI N64 ABI. Improve code consitency.
732
733 2003-10-07  Alexandre Oliva  <aoliva@redhat.com>
734
735         * elf32-frv.c (elf32_frv_howto_table): Set R_FRV_LABEL16's
736         rightshift to 2.
737
738 2003-10-07  Nathan Sidwell  <nathan@codesourcery.com>
739
740         * libbfd-in.h (_bfd_link_section_stabs): Add string offset
741         parameter.
742         * cofflink.c (coff_link_add_symbols): Deal with split stab
743         sections.
744         * elflink.h (elf_link_add_object_symbols): Deal with split stab
745         sections.
746         * stabs.c (_bfd_link_section_stabs): Add string offset parameter.
747         * libbfd.h: Regenerated.
748
749         * coffcode.h (coff_set_alignment_hook): With PE_COFF reloc
750         overflow, set reloc start position to after the count
751         reloc. Subtract one from num relocs. Give error on 0xffff relocs
752         and no overflow.
753         * cofflink.c (_bfd_coff_final_link): Deal with PE_COFF reloc
754         overflow.
755         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Do overflow if >=
756         0xffff.
757
758 2003-10-06  H.J. Lu  <hongjiu.lu@intel.com>
759
760         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Pad the
761         last CIE/FDE if needed.
762
763 2003-10-06  Nick Clifton  <nickc@redhat.com>
764
765         * targets.c (_bfd_target_vector): Include bfd_elf64_sparc_vec if
766         BFD64 is enabled.
767
768 2003-10-06  Matt Thomas <matt@3am-software.com>
769
770         * config.bfd: Move the hppa*-*-netbsd* case to the hppa*-*-linux* case.
771
772 2003-10-06  Robert Millan  <robertmh@gnu.org>
773
774         * configure.in: Match GNU/KNetBSD with new knetbsd*-gnu triplet.
775         * config.bfd: Likewise.
776         * configure: Regenerate.
777
778 2003-10-04  Christian Groessler  <chris@groessler.org>
779
780         * coff-z8k.c (extra_case): Fix displacement length check for R_JR
781         and R_CALLR.
782
783 2003-10-04  Stephane Carrez  <stcarrez@nerim.fr>
784
785         * elf32-m68hc1x.c: Update to ISO C90; replace PTR with void*.
786         * elf32-m68hc11.c: Likewise.
787         * elf32-m68hc12.c: Likewise.
788         * elf32-m68hc1x.h: Likewise.
789
790 2003-10-04  Stephane Carrez  <stcarrez@nerim.fr>
791
792         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Fix merge
793         of flags between HC12 and HCS12.
794
795 2003-10-04  Bryce McKinlay  <bryce@mckinlay.net.nz>
796
797         * merge.c (_bfd_merge_sections): Set SEC_EXCLUDE flag on sections
798         which become empty after merging.
799
800 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
801
802         * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB,
803         R_IA64_DTPREL{32,64}[LM]SB and R_IA64_DTPMOD64[LM]SB.
804
805 2003-09-30  Chris Demetriou  <cgd@broadcom.com>
806
807         * archures.c (bfd_mach_mipsisa64r2): New define.
808         * bfd-in2.h: Regenerate.
809         * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2.
810         * cpu-mips.c (I_mipsisa64r2): New enum value.
811         (arch_info_struct): Add entry for I_mipsisa64r2.
812         * elfxx-mips.c (_bfd_elf_mips_mach)
813         (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2.
814         (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case.
815         (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2.
816
817 2003-09-29  H.J. Lu  <hongjiu.lu@intel.com>
818
819         * elfxx-ia64.c (elfNN_hpux_backend_symbol_processing): New.
820         Handle SHN_IA_64_ANSI_COMMON.
821         (elf_backend_section_from_bfd_section): Defined.
822
823 2003-09-26  H.J. Lu  <hongjiu.lu@intel.com>
824
825         * elflink.c (elf_link_read_relocs_from_section): Add an argument
826         of a pointer to section. Check bad symbol index.
827         (_bfd_elf_link_read_relocs): Modify calls to
828         elf_link_read_relocs_from_section.
829
830 2003-09-23  DJ Delorie  <dj@redhat.com>
831
832         * elf32-sh.c (sh_elf_howto_table): R_SH_SWITCH8,
833         R_SH_GNU_VTINHERIT, R_SH_GNU_VTENTRY,
834         R_SH_LOOP_START,R_SH_LOOP_END moved to "reserved" spaces,
835         R_SH_DIR16, R_SH_DIR8, R_SH_DIR8UL, R_SH_DIR8UW, R_SH_DIR8U,
836         R_SH_DIR8SW, R_SH_DIR8S, R_SH_DIR4UL, R_SH_DIR4UW, R_SH_DIR4U,
837         R_SH_PSHA, R_SH_PSHL added.
838         (sh_reloc_map): Add R_SH_DIR16 and R_SH_DIR8.
839         (sh_elf_relocate_section): Support new relocs.
840
841 2003-09-23  Bob Wilson  <bob.wilson@acm.org>
842
843         * elf32-xtensa.c (elf_xtensa_relocate_section): Fix typo that clobbered
844         dynamic relocation offsets.
845
846 2003-09-23  Alan Modra  <amodra@bigpond.net.au>
847
848         * simple.c (bfd_simple_get_relocated_section_contents): Free the
849         hash table using _bfd_generic_link_hash_table_free.
850
851 2003-09-23  Alan Modra  <amodra@bigpond.net.au>
852
853         * elf-bfd.h (struct bfd_elf_special_section): Remove "suffix".  Change
854         type of prefix_length and suffix_length to int.  Rename "attributes"
855         to "attr".  Comment.
856         (_bfd_elf_get_sec_type_attr): Update prototype.
857         * elf.c (get_special_section): Rewrite.
858         (_bfd_elf_get_sec_type_attr): Return struct rather than passing in
859         attr and type pointers.
860         (_bfd_elf_new_section_hook): Adjust for above.
861         (special_sections): Merge suffix with prefix.  Set
862         prefix_length for all entries.  Set suffix_length appropriately.
863         * elf32-m32r.c (m32r_elf_special_sections): Likewise.
864         * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise.
865         * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise.
866         * elf32-mcore.c (mcore_elf_special_sections): Likewise.
867         * elf32-sh64.c (sh64_elf_special_sections): Likewise.
868         * elf32-v850.c (v850_elf_special_sections): Likewise.
869         * elf32-xtensa.c (elf_xtensa_special_sections): Likewise.
870         * elf64-alpha.c (elf64_alpha_special_sections): Likewise.
871         * elf64-hppa.c (elf64_hppa_special_sections): Likewise.
872         * elf64-ppc.c (ppc64_elf_special_sections): Likewise.
873         * elf64-sh64.c (sh64_elf64_special_sections): Likewise.
874         * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise.
875         * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise.
876         * elf32-ppc.c (ppc_elf_special_sections): Likewise.  Fix .plt flags.
877
878 2003-09-21  Daniel Jacobowitz  <drow@mvista.com>
879
880         * elf64-alpha.c (elf64_alpha_create_got_section): Initialize
881         ->got if the section already exists.
882
883 2003-09-19  Nathan Sidwell  <nathan@codesourcery.com>
884
885         * dwarf2.c (decode_line_info): Cope with an initially empty
886         filename table.
887
888 2003-09-18  H.J. Lu  <hongjiu.lu@intel.com>
889
890         * acinclude.m4: Include ../config/accross.m4.
891         * aclocal.m4: Regenerated.
892
893         * configure.host (HOST_64BIT_TYPE): Remove if it is set to long
894         or long long.
895         (HOST_U_64BIT_TYPE): Remove if it is set to unsigned long long.
896         (host64): Remove if HOST_64BIT_TYPE is set to long.
897
898         * configure.in (HOST_64BIT_TYPE): Set according to the size of
899         long and long long.
900         (HOST_U_64BIT_TYPE): Likewise.
901         (host64): Likewise.
902         * configure: Regenerated.
903
904 2003-09-19  Alan Modra  <amodra@bigpond.net.au>
905
906         * elf.c (elfcore_write_note): Don't use sizeof(Elf_External_note)
907         since some ABIs round up the size of the struct.
908
909 2003-09-18  H.J. Lu  <hongjiu.lu@intel.com>
910
911         * elflink.c (_bfd_elf_merge_symbol): Allow type change if
912         the old symbol is undefined and the new symbol is defined.
913
914 2003-09-18  Andreas Schwab  <schwab@suse.de>
915
916         * simple.c (bfd_simple_get_relocated_section_contents): Use
917         _bfd_generic_link_hash_table_create instead of
918         bfd_link_hash_table_create.
919
920 2003-09-10  H.J. Lu  <hongjiu.lu@intel.com>
921
922         * elfxx-ia64.c (elfNN_ia64_special_sections): Mark all sections
923         started with ".sbss" or "".sdata" as SHF_IA_64_SHORT.
924
925 2003-09-10  John David Anglin   <dave.anglin@nrc-cnrc.nrc.ca>
926             Randolph Chung      <randolph@tausq.org>
927
928         * elf32-hppa.c (struct elf32_hppa_link_hash_entry,
929         hppa_link_hash_newfunc, hppa_build_one_stub,
930         elf32_hppa_adjust_dynamic_symbol, mark_PIC_calls, allocate_plt_static,
931         allocate_dynrelocs, elf32_hppa_size_dynamic_sections,
932         elf32_hppa_finish_dynamic_symbol): Remove pic_call field and all code
933         for generating import stubs for calls to statically linked PIC
934         functions.
935         (hppa_type_of_stub): Don't generate an import stub for calls to
936         statically linked pic functions.  Generate import stubs for calls
937         in a shared object, to functions not in a regular file, and to
938         defined weak functions.  Add new argument INFO.
939         (hppa_build_one_stub): Don't undef ADDIL_DP.
940         (elf32_hppa_check_relocs): Don't set SEC_HAS_GOT_REF flag.
941         (elf32_hppa_size_stubs): Pass info to hppa_type_of_stub.
942         (final_link_relocate): Change all DLTIND relocs to DPREL relocs in a
943         non-shared link.  Convert instructions that use the the linkage table
944         pointer, or a facsimile thereof, to use the global data pointer when
945         the reloc has been changed.
946
947 2003-09-08  Joel Brobecker  <brobecker@gnat.com>
948
949         * archures.c: Add new machine names for hppa.
950         * bfd-in2.h: Regenerate.
951         * cpu-hppa.c: Use the new machine names.
952
953 2003-09-06  Stephane Carrez  <stcarrez@nerim.fr>
954
955         * elf32-m68hc1x.h (struct m68hc11_elf_link_hash_table): Remove
956         all_local_syms member.
957         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Use bfd_elf_get_elf_syms
958         to get the local symbols.
959
960 2003-09-06  Stephane Carrez  <stcarrez@nerim.fr>
961
962         * elf32-m68hc12.c (elf32_m68hc12_special_sections): New for hc11.
963         (elf_backend_special_sections): Define.a
964
965         PR savannah/4950:
966         * elf32-m68hc11.c (elf32_m68hc11_special_sections): The .vectors
967         section is read-only.
968
969 2003-09-04  Nick Clifton  <nickc@redhat.com>
970
971         * archures.c (bfd_mach_v850e1): Define.
972         * bfd-in2.h: Regenerate.
973         * cpu-v850.h (scan): Accept bfd_mach_v850e1.
974         (arch_info_struct): Include an entry for bfd_mach_v850e1.
975         * elf32-v850.c (v850_elf_object_p): Accept E_V850E1_ARCH flag.
976         (v850_elf_final_write_processing): Accept bfd_mach_v850e1.
977         (v850_elf_print_private_bfd_data): Interpret E_V850E1_ARCH flag.
978         (v850_elf_merge_private_bfd_data): Allow v850e1 binaries to be
979         linked with v850e binaries.  Mark the output as v850e.
980
981 2003-09-03  Nick Clifton  <nickc@redhat.com>
982
983         * cofflink.c (_bfd_coff_link_input_bfd): Do not skip section
984         symbols that are used in relocs.
985
986 2003-08-30  Robert Millan  <robertmh@gnu.org>
987
988         * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet.
989         * config.bfd: Likewise.
990         * configure: Regenerate.
991
992 2003-08-31  Christian Groessler  <chris@groessler.org>
993
994         * elf32-i860.c (i860_howto_pc26_reloc): Finish relocation here
995         instead of returning bfd_reloc_continue.
996
997 2003-08-31  Andreas Jaeger  <aj@suse.de>
998
999         * merge.c: Update to ISO C90.
1000
1001 2003-08-27  Ian Lance Taylor  <ian@airs.com>
1002
1003         * configure.in: Check for strtoull.
1004         * bfd.c (bfd_scan_vma): Use strtoull when available.
1005         * configure, config.in: Regenerate.
1006
1007         * configure.in: Define and substitute BFD_HOST_LONG_LONG.
1008         * bfd-in.h: Define BFD_HOST_LONG_LONG.  Test it rather than
1009         __GNUC__ when deciding whether to use long long for
1010         BFD_HOST_64_BIT.
1011         * configure, Makefile.in, doc/Makefile.in, bfd-in2.h: Regenerate.
1012
1013 2003-08-27  Christian Groessler  <chris@groessler.org>
1014
1015         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
1016         i860_howto_splitn_reloc, i860_howto_highadj_reloc): New
1017         functions.
1018         (elf32_i860_howto_table): Insert the new functions as
1019         'special_function's in the proper reloc type entries.
1020
1021 2003-08-27  Richard Sandiford  <rsandifo@redhat.com>
1022
1023         * elf32-frv.c (elf32_frv_relocate_section): Use
1024         _bfd_elf_rela_local_sym.
1025
1026 2003-08-26  Michael Snyder  <msnyder@redhat.com>
1027
1028         * cpu-frv.c: Remove unused enum.
1029
1030 2003-08-25  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
1031
1032         * reloc.c: Fix documentation for MIPS ELF relocations.
1033         libbfd.h: Regenerate.
1034         bfd-in2.h: Regenerate.
1035
1036 2003-08-24  Jason Eckhardt  <jle@rice.edu>
1037
1038         * coff-i860.c (CALC_ADDEND): Define to be a no-op.
1039
1040 2003-08-24  Jason Eckhardt  <jle@rice.edu>
1041
1042         * elf32-i860.c (elf32_i860_relocate_pc16): Subtract 4 and
1043         shift by 2 before storing the relocated value.
1044
1045 2003-08-23  Jason Eckhardt  <jle@rice.edu>
1046
1047         * coff-i860.c (coff_i860_reloc_nyi): New function.
1048         (howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH,
1049         LOWn, SPLITn, and BRADDR.
1050         (RTYPE2HOWTO): Check that the r_type is within the howto_table
1051         before trying to access the entry.
1052         (coff_i860_rtype_to_howto): Likewise.
1053         (coff_i860_reloc_type_lookup): New function.
1054         (i860_reloc_processing): New function.
1055         (coff_bfd_reloc_type_lookup): Define macro.
1056         (RELOC_PROCESSING): Define macro.
1057         Minor formatting adjustments.
1058
1059 2003-08-23  Alan Modra  <amodra@bigpond.net.au>
1060
1061         * elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner.
1062
1063 2003-08-22  H.J. Lu  <hongjiu.lu@intel.com>
1064
1065         * elfxx-ia64.c (elfNN_ia64_create_dynamic_sections): Align the
1066         .got section at 8 bytes.
1067
1068 2003-08-21  Nick Clifton  <nickc@redhat.com>
1069
1070         * cofflink.c: Update to ISO C90 and tidy up formatting.
1071
1072 2003-08-21  Randolph Chung  <tausq@debian.org>
1073
1074         * elf32-hppa.c (elf32_hppa_object_p): For elf32-hppa-linux, objects
1075         can have OSABI=Linux or OSABI=SysV.  Check for both.
1076         * elf64-hppa.c (elf64_hppa_object_p): Likewise.
1077
1078 2003-08-21  Nick Clifton  <nickc@redhat.com>
1079
1080         * po/sv.po: Updated Swedish translation.
1081
1082 2003-08-20  Richard Sandiford  <rsandifo@redhat.com>
1083
1084         * elf64-mips.c (elf_backend_copy_indirect_symbol): Define.
1085
1086 2003-08-20  Nick Clifton  <nickc@redhat.com>
1087
1088         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): New macro used to
1089         replace some duplicated code in most elfxx-xxxx.c files.  This
1090         version uses the new fields in bfd_link_info.
1091
1092         * elf-m10300.c (mn10300_elf_relocate_section): Use new macro.
1093         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
1094         * elf32-cris.c (cris_elf_relocate_section): Likewise.
1095         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
1096         * elf32-i386.c (elf_i386_relocate_section): Likewise.
1097         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
1098         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
1099         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1100         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1101         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1102         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1103         * elf32-vax.c (elf_vax_relocate_section): Likewise.
1104         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1105         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1106         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1107         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1108         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1109         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1110         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1111
1112         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols,
1113         elf_hppa_remark_useless_dynamic_symbols,
1114         elf_hppa_relocate_section): Use the new fields in
1115         bfd_link_info structure.
1116         * elf32-sh.c (sh_elf_relocate_section): Likewise.
1117         * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1118         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
1119         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1120         * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise.
1121         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1122
1123         * elflink.h (elf_link_output_extsym): Fix test for reporting
1124         undefined symbols in shared libraries.  Remove redundant test
1125         of shlib_undefined when reporting references to forced local
1126         symbols.
1127
1128 2003-08-18  Andreas Schwab  <schwab@suse.de>
1129
1130         * libpei.h (bfd_pe_executable_p): Also recognize efi-app
1131         executables.
1132
1133 2003-08-17  Hans-Peter Nilsson  <hp@bitrange.com>
1134
1135         * simple.c (bfd_simple_get_relocated_section_contents): Move
1136         reloc_done hack to before first bfd_section_size call.  Change all
1137         returns to use new wrapper macro RETURN, restoring sec->reloc_done.
1138
1139 2003-08-16  Alan Modra  <amodra@bigpond.net.au>
1140
1141         * elf64-ppc.c: Don't include elf/ppc.h.
1142
1143 2003-08-14  Richard Sandiford  <rsandifo@redhat.com>
1144
1145         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC
1146         code to work with 64-bit bfds.
1147
1148 2003-08-14  Alan Modra  <amodra@bigpond.net.au>
1149
1150         * dep-in.sed: Remove libintl.h.
1151         * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Unset LC_COLLATE.
1152         (POTFILES.in): Remove target.
1153         * Makefile.in: Regenerate.
1154
1155 2003-08-12  Alan Modra  <amodra@bigpond.net.au>
1156
1157         * elf64-ppc.c (ppc64_elf_next_input_section): Update comment.
1158         (ppc64_elf_relocate_section): For zero sym R_PPC64_TOC relocs,
1159         use the function sym from the previous reloc.
1160
1161 2003-08-11  Jakub Jelinek  <jakub@redhat.com>
1162
1163         * elf32-i386.c (elf_i386_relocate_section): Make undefined symbols
1164         fatal if -pie.
1165         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1166         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1167         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1168         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1169         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1170         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1171         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1172         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1173         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1174         (ppc_elf_relocate_section) <case R_PPC_RELAX32>: Issue fatal error
1175         on undefined symbols if -pie.
1176         * elf32-sh.c (sh_elf_relocate_section): Likewise.
1177
1178 2003-08-11  Alan Modra  <amodra@bigpond.net.au>
1179
1180         * elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o
1181         branch to __libc_start_main.
1182
1183 2003-08-08 Dmitry Diky <diwil@mail.ru>
1184
1185         * archures.c: Add xW42 and xE42 parts. Sort MPU list according to
1186         gcc order.
1187         * cpu-msp430.c: Likewise.
1188         * elf32-msp430.c: Likewise.
1189         * bfd-in2.h: Regenerate.
1190
1191 2003-08-07  Alan Modra  <amodra@bigpond.net.au>
1192
1193         * elfxx-target.h: Remove PTR cast.
1194         * targets.c (bfd_target): Make backend_data const void *.
1195         * elf-bfd.h: Constify all occurrences of struct elf_backend_data.
1196         * elf-m10300.c: Likewise.
1197         * elf.c: Likewise.
1198         * elf32-hppa.c: Likewise.
1199         * elf32-i386.c: Likewise.
1200         * elf32-m68hc1x.c: Likewise.
1201         * elf32-ppc.c: Likewise.
1202         * elf32-s390.c: Likewise.
1203         * elf32-sh.c: Likewise.
1204         * elf32-sh64.c: Likewise.
1205         * elf32-sparc.c: Likewise.
1206         * elf32-xtensa.c: Likewise.
1207         * elf64-mips.c: Likewise.
1208         * elf64-ppc.c: Likewise.
1209         * elf64-s390.c: Likewise.
1210         * elf64-sh64.c: Likewise.
1211         * elf64-sparc.c: Likewise.
1212         * elf64-x86-64.c: Likewise.
1213         * elfcode.h: Likewise.
1214         * elfcore.h: Likewise.
1215         * elflink.c: Likewise.
1216         * elflink.h: Likewise.
1217         * elfxx-ia64.c: Likewise.
1218         * elfxx-mips.c: Likewise.
1219         * elfxx-mips.h: Likewise.
1220         * elf.c (prep_headers): Remove useless check for null backend_data.
1221         * bfd-in2.h: Regenerate.
1222
1223         * elf-bfd.h: Remove PARAMS macro.  Replace PTR with void *.
1224         (NAME): Use ## rather than CONCAT4 macro.
1225         * elfcode.h: Remove one remaining PARAMS macro.
1226         * elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes.
1227         * elf-strtab.c: Likewise.
1228         * elf-hppa.h: Likewise.
1229         * elf32-hppa.h: Likewise.
1230         * elf32-hppa.c: Likewise.
1231         (elf32_hppa_add_symbol_hook): Delete.
1232         (elf_backend_add_symbol_hook): Don't define.
1233         * libhppa.h: Convert to C90.  Replace INLINE with inline.
1234
1235 2003-08-06  Alan Modra  <amodra@bigpond.net.au>
1236
1237         * elf64-ppc.c (ppc_stub_name): Tweak names for better readability.
1238         (ppc64_elf_adjust_dynamic_symbol): Allow copy relocs against
1239         function descriptors, but warn.
1240         (ppc_build_one_stub): Remove a couple of vars.  Move code creating
1241         stub syms so that we can avoid a stub sym if we already have a
1242         plt sym.  Do not redefine an existing symbol.
1243         (ppc64_elf_build_stubs): When --emit-stub-syms, print a symbol for
1244         glink.
1245
1246 2003-08-06  Nick Clifton  <nickc@redhat.com>
1247
1248         * po/fr.po: Updated French translation.
1249
1250 2003-08-06  Alan Modra  <amodra@bigpond.net.au>
1251
1252         * elflink.c (_bfd_elf_create_dynamic_sections): Mark .dynbss with
1253         SEC_LINKER_CREATED.
1254
1255 2003-08-05  Daniel Jacobowitz  <drow@mvista.com>
1256
1257         * elf32-arm.h (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
1258         (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Use it.
1259
1260 2003-08-03  Jeff Muizelaar  <muizelaar@rogers.com>
1261
1262         * coffcode.h (coff_slurp_line_table): Return with a warning
1263         message if the line number table could not be read.
1264
1265 2003-08-04  Nick Clifton  <nickc@redhat.com>
1266
1267         * elflink.h (elf_link_add_object_symbols): Prepend "warning: "
1268         to messages produced for .gnu.warning.SYMBOL sections.
1269
1270 2003-08-04  Alan Modra  <amodra@bigpond.net.au>
1271
1272         * elfcode.h: Convert to C90, remove unneeded casts and prototypes.
1273         * elfcore.h: Likewise.
1274         * elflink.c: Likewise.
1275         * elflink.h: Likewise.
1276         * elf.c (sym_is_global): Remove INLINE.
1277         (align_file_position): Replace INLINE with inline.
1278         * elfcode.h (elf_swap_dyn_in, elf_swap_dyn_out): Remove INLINE.
1279         (elf_file_p): Replace INLINE with inline.
1280
1281 2003-08-02  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1282
1283         * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here.
1284
1285 2003-08-01  H.J. Lu  <hongjiu.lu@intel.com>
1286
1287         * elfxx-ia64.c (get_got): Align the .got section at 8 bytes.
1288
1289 2003-08-01  H.J. Lu  <hongjiu.lu@intel.com>
1290
1291         * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Use
1292         ElfNN_External_Rela instead of Elf64_External_Rela.
1293
1294 2003-08-01  Nick Clifton  <nickc@redhat.com>
1295
1296         * config.bfd: Add code to catch obsolete configurations and warn
1297         about them unless --enable-obsolete is used.  Use this to mark
1298         vax-vms port as obsolete.
1299
1300 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1301
1302         * elf32-ppc.c (ppc_elf_install_value): Tidy.
1303         (ppc_elf_relax_section): Remove dead code.  Remove unnecessary casts.
1304         Formatting.
1305         * elfxx-target.h: Remove PARAMS macro.  Formatting.
1306
1307 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1308
1309         * elf.c (bfd_section_from_r_symndx): Test for SHN_UNDEF.
1310         * elf64-ppc.c (get_fdh): New function, split out from
1311         ppc64_elf_edit_opd.
1312         (ppc64_elf_check_relocs): Use get_fdh.
1313         (func_desc_adjust): Likewise.  Tidy.
1314         (ppc64_elf_edit_opd): Tighten reloc checks.  Free local_syms on error
1315         exit.  Use get_fdh.  Account for superfluous dynamic relocs.
1316         (ppc64_elf_relocate_section): Warning fix.
1317
1318 2003-07-30  Jason Eckhardt  <jle@rice.edu>
1319
1320         * coff-i860.c: Convert to ISO C90.  Remove superflous prototypes.
1321
1322 2003-07-30  Jason Eckhardt  <jle@rice.edu>
1323
1324         * elf32-i860.c: Convert to ISO C90.  Remove superflous prototypes.
1325
1326 2003-07-30  Randolph Chung  <tausq@debian.org>
1327
1328         * elf-hppa.h (elf_hppa_relocate_section): Look up dyn_h for undefweak.
1329         * elf64-hppa.c (elf64_hppa_finalize_dlt): Check h->root.type.
1330
1331 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1332
1333         * elf.c: Convert to C90, remove unnecessary prototypes and casts.
1334         Replace PTR with void *.  Formatting.
1335         (_bfd_elf_assign_file_position_for_section): Remove INLINE.
1336         (make_mapping): Likewise.
1337
1338 2003-07-29  Alan Modra  <amodra@bigpond.net.au>
1339
1340         * elf64-ppc.c (func_desc_adjust): Give linker created function
1341         descriptor symbols a size and type.
1342         (ppc64_elf_relocate_section): Correct lq insn test.
1343
1344 2003-07-28  Eric Christopher  <echristo@redhat.com>
1345
1346         * elf32-ppc.c (R_PPC_RELAX32): New relocation.
1347         (ppc_elf_install_value): New function.
1348         (ppc_elf_sort_rela): Remove.
1349         (ppc_elf_relax_section): Rewrite. Remove old relaxation
1350         and replace with out of range branch stubs.
1351         (ppc_elf_relocate_section): Handle R_PPC_RELAX32.
1352
1353 2003-07-29  Alexandre Oliva  <aoliva@redhat.com>
1354
1355         * elf-m10300.c (mn10300_elf_relax_section): Take symbol hash table
1356         from input_bfd.
1357
1358 2003-07-28  Alan Modra  <amodra@bigpond.net.au>
1359
1360         * elf.c (special_sections): Set attributes for .got and .plt.
1361
1362 2003-07-27  Alan Modra  <amodra@bigpond.net.au>
1363
1364         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Ensure no copy relocs
1365         on function descriptors.
1366         (ELIMINATE_COPY_RELOCS): Expand comment.
1367         (ppc64_elf_special_sections): Move.  Don't include non-ppc64 sections.
1368         Do include ".toc1".
1369
1370 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1371
1372         * elf.c (_bfd_elf_new_section_hook): Set the default section
1373         type to SHT_NULL.
1374         (elf_fake_sections): Set the section type based on asect->flags
1375         if it is SHT_NULL. Don't abort on processor specific section
1376         types.
1377
1378 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1379
1380         * bfd-in2.h: Regenerated.
1381
1382 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1383
1384         * elf-bfd.h (bfd_elf_special_section): New.
1385         (elf_backend_data): Add special_sections, a pointer to
1386         bfd_elf_special_section.
1387         (elf_section_type). New.
1388         (elf_section_flags): New.
1389         (_bfd_elf_get_sec_type_attr): New.
1390
1391         * elf.c (_bfd_elf_make_section_from_shdr): Always use the
1392         real section type/flags.
1393         (special_sections): New.
1394         (get_special_section): New.
1395         (_bfd_elf_get_sec_type_attr): New.
1396         (_bfd_elf_new_section_hook): Check special_section to set
1397         elf_section_type and elf_section_flags.
1398         (elf_fake_sections): Don't use section name to set ELF section
1399         data.
1400
1401         * elf32-m32r.c (m32r_elf_special_sections): New.
1402         (elf_backend_special_sections): Defined.
1403
1404         * elf32-m68hc11.c (elf32_m68hc11_special_sections): New.
1405         (elf_backend_special_sections): Defined.
1406
1407         * elf32-mcore.c (mcore_elf_special_sections): New.
1408         (elf_backend_special_sections): Defined.
1409
1410         * elf32-ppc.c (ppc_elf_special_sections): New.
1411         (elf_backend_special_sections): Defined.
1412
1413         * elf32-sh64.c (sh64_elf_special_sections): New.
1414         (elf_backend_special_sections): Defined.
1415
1416         * elf32-v850.c (v850_elf_special_sections): New.
1417         (elf_backend_special_sections): Defined.
1418
1419         * elf32-xtensa.c (elf_xtensa_special_sections): New.
1420         (elf_backend_special_sections): Defined.
1421
1422         * elf64-alpha.c (elf64_alpha_special_sections): New.
1423         (elf_backend_special_sections): Defined.
1424
1425         * elf64-hppa.c (elf64_hppa_special_sections): New.
1426         (elf_backend_special_sections): Defined.
1427
1428         * elf64-ppc.c (ppc64_elf_special_sections): New.
1429         (elf_backend_special_sections): Defined.
1430
1431         * elf64-sh64.c (sh64_elf64_special_sections): New.
1432         (elf_backend_special_sections): Defined.
1433
1434         * elfxx-ia64.c (elfNN_ia64_special_sections): New.
1435         (elf_backend_special_sections): Defined.
1436
1437         * elfxx-mips.c (_bfd_mips_elf_special_sections): New.
1438
1439         * elfxx-mips.h (_bfd_mips_elf_special_sections): New.
1440         (elf_backend_special_sections): Defined.
1441
1442         * elfxx-target.h (elf_backend_special_sections): New. Default
1443         to NULL.
1444         (elfNN_bed): Initialize special_sections.
1445
1446         * section.c (bfd_abs_section): Remove const.
1447         (bfd_und_section): Likewise.
1448         (bfd_com_section): Likewise.
1449         (bfd_ind_section): Likewise.
1450
1451 2003-07-24  Nick Clifton  <nickc@redhat.com>
1452
1453         * coff-arm.c (EXTRA_S_FLAGS): Include SEC_CODE so that code
1454         sections are assigned the LOAD attribute.
1455
1456 2003-07-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1457
1458         * elf32-sh.c: Convert to C90.  Replace PTR with void *.
1459         * elf32-sh64-com.c: Likewise.
1460         * elf32-sh64.c: Likewise.
1461         * elf32-sh64.h: Likewise.
1462         * elf64-sh64.c: Likewise.
1463
1464 2003-07-24  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1465
1466         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL.
1467         (allocate_dynrelocs): Likewise.
1468         (sh_elf_relocate_section): Likewise. Use SYMBOL_REFERENCES_LOCAL.
1469         (sh_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL.
1470
1471 2003-07-24  Nick Clifton  <nickc@redhat.com>
1472
1473         * po/fr.po: Updated French translation.
1474
1475 2003-07-23  Bob Wilson  <bob.wilson@acm.org>
1476
1477         * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Make inline and move
1478         near the beginning of the file.  Swap order of arguments.  Call
1479         _bfd_elf_dynamic_symbol_p with "ignore_protected" set to 0.
1480         (elf_xtensa_fix_refcounts): Adjust xtensa_elf_dynamic_symbol_p call.
1481         (elf_xtensa_relocate_section): Likewise.
1482         (shrink_dynamic_reloc_sections): Likewise.
1483
1484 2003-07-23  Bob Wilson  <bob.wilson@acm.org>
1485
1486         * elf32-xtensa.c (plt_reloc_count): Fix typo in comment.
1487         (elf_xtensa_size_dynamic_sections): Use elf_discarded_section.
1488         (elf_xtensa_combine_prop_entries): Avoid returning non-zero without
1489         first printing an error message.
1490         (elf_xtensa_finish_dynamic_sections): Likewise.
1491         (elf_xtensa_discard_info_for_section): Adjust size of .got.loc when
1492         discarding literal table entries.
1493         (elf_xtensa_merge_private_bfd_data): Remove newline from error message.
1494         (elf_xtensa_do_asm_simplify): Likewise.
1495
1496 2003-07-23  Stephane Carrez  <stcarrez@nerim.fr>
1497
1498         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
1499         we have a local symbol in common section.
1500
1501 2003-07-22  H.J. Lu <hongjiu.lu@intel.com>
1502
1503         * elflink.c (_bfd_elf_dynamic_symbol_p): Don't return TRUE for
1504         weak symbols.
1505
1506 2003-07-22  Nick Clifton  <nickc@redhat.com>
1507
1508         * coffcode.h (coff_slurp_symbol_table): Add C_TCSYM and C_ECOML to
1509         expected RS6000 storage classes.
1510
1511 2003-07-21  H.J. Lu <hongjiu.lu@intel.com>
1512
1513         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Mark
1514         output_bfd unused to silence gcc.
1515
1516 2003-07-21  Nick Clifton  <nickc@redhat.com>
1517
1518         * po/sv.po: Updated Swedish translation.
1519
1520 2003-07-21  Alan Modra  <amodra@bigpond.net.au>
1521
1522         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use..
1523         (_bfd_elf_symbol_refs_local_p): ..this.  Declare.
1524         * elflink.c (_bfd_elf_symbol_refs_local_p): New function.
1525         * elf32-i386.c (elf_i386_relocate_section): Remove h NULL test
1526         now done in _bfd_elf_symbol_refs_local_p.
1527         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1528         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1529         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1530
1531 2003-07-18  H.J. Lu <hongjiu.lu@intel.com>
1532
1533         * elflink.c (_bfd_elf_dynamic_symbol_p): Undo the last change.
1534
1535 2003-07-18  H.J. Lu <hongjiu.lu@intel.com>
1536
1537         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo.
1538         (SYMBOL_CALLS_LOCAL): Likewise.
1539
1540         * elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE
1541         immediately if symbol isn't defined locally.
1542
1543 2003-07-18  Richard Henderson  <rth@redhat.com>
1544
1545         * elflink.c (_bfd_elf_dynamic_symbol_p): New.
1546         * elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it.
1547         (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it.
1548         * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise.
1549         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
1550         * elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise.
1551         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise.
1552         Update all callers to provide the relocation being resolved.
1553
1554 2003-07-17  Shaun Jackman <sjackman@pathwayconnect.com>
1555
1556         * config.bfd (arm-wince-pe): Add -DARM_COFF_BUGFIX to
1557         targ_cflags.
1558
1559 2003-07-17  Nick Clifton  <nickc@redhat.com>
1560
1561         * po/es.po: New Spanish translation.
1562         * po/sv.po: New Swedish translation.
1563         * po/opcodes.pot: Regenerate.
1564
1565 2003-07-16  Richard Henderson  <rth@redhat.com>
1566
1567         * config.bfd, configure.host, configure.in: Remove ia64-aix support.
1568         * elfxx-ia64.c, targets.c: Likewise.
1569
1570 2003-07-16  Richard Henderson  <rth@redhat.com>
1571
1572         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Properly return false
1573         for symbols defined locally plus -Bsymbolic.  Tidy logic.
1574
1575 2003-07-15  Richard Sandiford  <rsandifo@redhat.com>
1576
1577         * archures.c (bfd_mach_mips7000): New.
1578         * bfd-in2.h: Regenerated.
1579         * cpu-mips.c (arch_info_struct): Add an entry for mips:7000.
1580         * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips7000.
1581         (mips_mach_extensions): Add an entry for it.
1582
1583 2003-07-14  Nick Clifton  <nickc@redhat.com>
1584
1585         * po/tr.po: Update with latest version.
1586         * po/SRC-POTFILES.in: Regenerate.
1587         * po/bfd.pot: Regenerate.
1588         * Makfile.in: Regenerate.
1589         * configure: Regenerate.
1590
1591 2003-07-12  Jeff Baker  <jbaker@qnx.com>
1592
1593         * bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures.
1594         * bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1595         * bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1596         * bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1597
1598 2003-07-12  Jeff Muizelaar  <muizelaar@rogers.com>
1599
1600         * coffcode.h (coff_set_section_contents): Set the
1601         IMAGE_FILE_32BIT_MACHINE flag for PE targets.
1602
1603 2003-07-11  Richard Sandiford  <rsandifo@redhat.com>
1604
1605         * bfd-in.h (bfd_h8300_pad_address): Declare.
1606         * bfd-in2.h: Regenerate.
1607         * cpu-h8300.c (bfd_h8300_pad_address): New function.
1608         * coff-h8300.c (h8300_reloc16_estimate): Use it to canonicalize
1609         addresses before checking whether they can be relaxed.
1610         (h8300_reloc16_extra_cases): Likewise for the R_MOVL2 sanity check.
1611         Don't complain about overflows in general 8-bit relocations.
1612         * elf32-h8300.c (elf32_h8_relax_section): Use bfd_h8300_pad_address.
1613         Fix handling of R_H8_DIR24A8.
1614
1615 2003-07-11  Richard Sandiford  <rsandifo@redhat.com>
1616
1617         * elf32-h8300.c: Convert function prototypes and definitions
1618         to C90 syntax.
1619         * coff-h8300.c: Likewise.
1620         * cpu-h8300.c: Likewise.
1621
1622 2003-07-11  Alan Modra  <amodra@bigpond.net.au>
1623
1624         * po/SRC-POTFILES.in: Regenerate.
1625         * po/bfd.pot: Likewise.
1626
1627 2003-07-10  Bob Wilson  <bob.wilson@acm.org>
1628
1629         * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Create new
1630         .got.loc section.  Do not set SEC_ALLOC or SEC_LOAD flags for the
1631         .xt.lit.plt section.
1632         (elf_xtensa_size_dynamic_sections): Set size of the .got.loc section
1633         and allocate memory for it.
1634         (elf_xtensa_combine_prop_entries): Copy contents of .xt.lit output
1635         section to the .got.loc section.
1636         (elf_xtensa_finish_dynamic_sections): Fix up call to
1637         elf_xtensa_combine_prop_entries and set DT_XTENSA_GOT_LOC_OFF to
1638         the address of .got.loc.
1639         (relax_property_section): Shrink .got.loc to match changes in any
1640         literal table section.
1641         (xtensa_is_property_section): Change to match
1642         xtensa_get_property_section_name.
1643         (xtensa_is_littable_section): New.
1644
1645 2003-07-10  H.J. Lu <hongjiu.lu@intel.com>
1646
1647         * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1 instead of
1648         -1LL.
1649
1650 2003-07-10  Alan Modra  <amodra@bigpond.net.au>
1651
1652         * Makefile.am (BFD32_BACKENDS): Add elf32-am33lin.lo.
1653         (BFD32_BACKENDS_CFILES): elf32-am33lin.c not elf32-am33lin.lo.
1654         Run "make dep-am".
1655         * Makefile.in: Regenerate.
1656
1657 2003-07-10  Alexandre Oliva  <aoliva@redhat.com>
1658
1659         2001-09-12  Alexandre Oliva  <aoliva@redhat.com>
1660         * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
1661         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
1662         2001-06-02  Nick Clifton  <nickc@cambridge.redhat.com>
1663         * elf32-am33lin.c: Rename global functions.
1664         2001-05-09  Alexandre Oliva  <aoliva@redhat.com>
1665         * config.bfd (am33_2.0, am33_2.0-*-linux*): Added.
1666         * configure.in (bfd_elf32_am33lin_vec): Added.
1667         * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo.
1668         (elf32-am33lin.lo): List dependencies.
1669         * aclocal.m4, configure, Makefile.in: Rebuilt.
1670         * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME,
1671         ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if
1672         ELF_ARCH was not defined before.
1673         (elf_symbol_leading_char): Define if not defined.
1674         * elf32-am33lin.c: Override the definitions above.
1675         * targets.c (bfd_elf32_am33lin_vec): New.
1676
1677 2003-07-09  Alexandre Oliva  <aoliva@redhat.com>
1678
1679         2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
1680         * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Initialize
1681         pcrel_relocs_copied.
1682         2001-12-13  Alexandre Oliva  <aoliva@redhat.com>
1683         * elf-m10300.c (ELF_DYNAMIC_INTERPRETER): Renamed from
1684         ld-linux.so.2 to ld.so.1.
1685         2001-10-10  Alexandre Oliva  <aoliva@redhat.com>
1686         * elf-m10300.c (elf_mn10300_sizeof_plt0): New macro.
1687         (_bfd_mn10300_elf_adjust_dynamic_symbol): Use it.
1688         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
1689         * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Allocate
1690         .rela.* section contents with bfd_zalloc.
1691         2001-09-25  Alexandre Oliva  <aoliva@redhat.com>
1692         * elf-m10300.c: Added declarations for functions missing them.
1693         Merge some shared-library changes from the i386 back-end.  Use
1694         R_MN10300_RELATIVE instead of R_MN10300_PCREL32 and
1695         R_MN10300_GLOB_DAT instead of R_MN10300_32 where appropriate.
1696         (struct elf32_mn10300_link_hash_entry): Remove duplicates of
1697         members of elf_link_hash_entry.  Adjusted references.
1698         (mn10300_elf_final_link_relocate): dynobj was already loaded
1699         into a local variable, use it.
1700         2001-09-21  Nick Clifton  <nickc@cambridge.redhat.com>
1701         * elf-m10300.c: Add missing function prototypes.
1702         2001-08-24  Alexandre Oliva  <aoliva@redhat.com>
1703         * elf-m10300.c (mn10300_elf_relocate_section): Don't compute
1704         relocation for dynamic relocations.
1705         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
1706         * reloc.c (BFD_RELOC_MN10300_GOTOFF24): New.
1707         * elf-m10300.c: Introduce GOTPC16, GOTOFF24, GOTOFF16 and
1708         PLT16, and rename GOTPC to GOTPC32 and GOTOFF to GOTOFF32.
1709         (_bfd_mn10300_elf_create_dynamic_sections): Move creation ot PLT...
1710         (_bfd_mn10300_elf_create_got_section): ... here, so that its
1711         adress is already known at the time we compute relaxations.
1712         (mn10300_elf_relax_section): Relax GOTPC32, GOTOFF32, GOT32
1713         and PLT32 to narrower relocations.
1714         * libbfd.h, bfd-in2.h: Rebuilt.
1715         2001-04-12  Alexandre Oliva  <aoliva@redhat.com>
1716         * reloc.c (BFD_RELOC_MN10300_GOT32, BFD_RELOC_MN10300_GOT24,
1717         BFD_RELOC_MN10300_GOT16, BFD_RELOC_MN10300_COPY,
1718         BFD_RELOC_MN10300_GLOB_DAT, BFD_RELOC_MN10300_JMP_SLOT,
1719         BFD_RELOC_MN10300_RELATIVE): New relocs.
1720         * libbfd.h, bfd-in2.h: Rebuilt.
1721         * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): New.
1722         (struct elf32_mn10300_link_hash_entry): Added DSO-related
1723         fields.
1724         (elf_mn10300_howto): Defined new relocation types.
1725         (mn10300_reloc_map): Map them.
1726         (_bfd_mn10300_elf_create_got_section): New fn.
1727         (mn10300_elf_check_relocs): Handle PIC relocs.
1728         (mn10300_elf_final_link_relocate): Likewise.
1729         (mn10300_elf_relocate_section): Handle DSOs.
1730         (PLT0_ENTRY_SIZE, PLT_ENTRY_SIZE, PIC_PLT_ENTRY_SIZE): New macros.
1731         (elf_mn10300_plt0_entry, elf_mn10300_plt_entry,
1732         elf_mn10300_pic_plt_entry): New.
1733         (elf_mn10300_sizeof_plt, elf_mn10300_plt_plt0_offset,
1734         elf_mn10300_plt0_linker_offset, elf_mn10300_plt0_gotid_offset,
1735         elf_mn10300_plt_temp_offset, elf_mn10300_plt_symbol_offset,
1736         elf_mn10300_plt_reloc_offset: New macros.
1737         (ELF_DYNAMIC_INTERPRETER): Likewise.
1738         (_bfd_mn10300_elf_create_dynamic_sections): New function.
1739         (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise.
1740         (_bfd_mn10300_elf_discard_copies): Likewise.
1741         (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
1742         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
1743         (_bfd_mn10300_elf_finish_dynamic_sections): Likewise.
1744         (elf_backend_can_gc_sections,
1745         elf_backend_create_dynamic_sections,
1746         elf_backend_adjust_dynamic_sections,
1747         elf_backend_size_dynamic_sections,
1748         elf_backend_finish_dynamic_symbol,
1749         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
1750         elf_backend_plt_readonly, elf_backend_want_plt_sym,
1751         elf_backend_got_header_size, elf_backend_plt_header_size): New
1752         macros.
1753
1754 2003-07-09  Alexandre Oliva  <aoliva@redhat.com>
1755
1756         2001-05-06  Alexandre Oliva  <aoliva@redhat.com>
1757         * elf-m10300.c (compute_function_info): Account for AM33
1758         registers in `movm' when computing stack space for `call' when
1759         linking for AM33/2.0 link.
1760         2000-04-01  Alexandre Oliva  <aoliva@cygnus.com>
1761         * archures.c (bfd_mach_am33_2): Renamed from bfd_mach_am332.
1762         * bfd-in2.h: Rebuilt.
1763         * cpu-m10300.c (bfd_am33_2_arch): Renamed from bfd_am332_arch.
1764         * elf-m10300.c: Updated.
1765         2000-03-31  Alexandre Oliva  <aoliva@cygnus.com>
1766         * archures.c (bfd_mach_am332): Defined.
1767         * bfd-in2.h: Rebuilt.
1768         * cpu-m10300.c (bfd_am332_arch): Defined.
1769         (bfd_am33_arch): Chained with am33-2.
1770         * elf-m10300.c (elf_mn10300_mach): Handle am332.
1771         (_bfd_mn10300_elf_final_write_processing): Likewise.
1772
1773 2003-07-09  H.J. Lu <hongjiu.lu@intel.com>
1774
1775         * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1LL.
1776
1777 2003-07-10  Alan Modra  <amodra@bigpond.net.au>
1778
1779         * elf64-ppc.c (bfd_elf64_mkobject): Define.
1780         (struct ppc64_elf_obj_tdata): New.
1781         (ppc64_elf_tdata, ppc64_tlsld_got): Define.
1782         (ppc64_elf_mkobject): New function.
1783         (struct got_entry): Add "owner".  Move "tls_type".
1784         (struct ppc_link_hash_table): Delete "relgot", "tlsld_got".
1785         (ppc64_elf_init_stub_bfd): New function.
1786         (create_got_section): Create header .got in dynobj.  Create .got
1787         and .rela.got in each bfd.  Stash pointers in ppc64_elf_obj_tdata.
1788         (ppc64_elf_create_dynamic_sections): Don't call create_got_section.
1789         Look for dynobj .got, and test it.
1790         (ppc64_elf_copy_indirect_symbol): Adjust for changed got.
1791         (update_local_sym_info): Likewise.
1792         (ppc64_elf_check_relocs): Likewise.
1793         (ppc64_elf_gc_sweep_hook): Likewise.
1794         (ppc64_elf_tls_optimize): Likewise.
1795         (allocate_dynrelocs): Likewise.
1796         (ppc64_elf_size_dynamic_sections): Likewise.
1797         (ppc64_elf_relocate_section): Likewise.
1798         (ppc64_elf_next_toc_section): Update comment.
1799         (toc_adjusting_stub_needed): Remove unneeded cast.
1800         (ppc64_elf_build_stubs): Check for stub sections in stub bfd by
1801         testing section flags.
1802         (ppc64_elf_build_stubs): Likewise.
1803         (ppc64_elf_size_stubs): Likewise.  Remove stub_bfd param.
1804         (ppc64_elf_finish_dynamic_sections): Write out got sections.
1805         (func_desc_adjust): Copy over dynamic info for undef weaks.
1806         * elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare.
1807         (ppc64_elf_size_stubs): Update prototype.
1808         * elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn
1809         input sections rather than scanning dynobj.
1810
1811 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1812
1813         * elfxx-mips.c (mips_elf_link_hash_entry): Remove min_dyn_reloc_index.
1814         (bfd_mips_elf_swap_msym_in, bfd_mips_elf_swap_msym_out): Delete.
1815         (mips_elf_create_msym_section): Delete.
1816         (mips_elf_create_dynamic_relocation): Don't set min_dyn_reloc_index.
1817         (_bfd_mips_elf_copy_indirect_symbol): Likewise.
1818         (_bfd_mips_elf_create_dynamic_sections): Don't create .msym.
1819         (_bfd_mips_elf_size_dynamic_sections): Don't calculate its size.
1820         (_bfd_mips_elf_size_dynamic_sections): Don't add DT_MIPS_MSYM.
1821         (_bfd_mips_elf_finish_dynamic_symbol): Don't add symbols to .msym.
1822         (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1823
1824 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1825
1826         * elfxx-mips.c (mips_elf_irix6_finish_dynamic_symbol): Make the
1827         symbols protected.
1828
1829 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1830
1831         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Fix handling
1832         of relocations whose offset is -2.
1833
1834 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1835
1836         * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat
1837         forced-local symbols like other locals.  Don't create relocations
1838         against STN_UNDEF in irix objects.
1839
1840 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1841
1842         * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI-
1843         compatible objects, add the values of defined external symbols
1844         to the addend.
1845
1846 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1847
1848         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Always
1849         initialize a GOT entry to the symbol's st_value.
1850
1851 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
1852
1853         * elf-bfd.h (struct elf_obj_tdata): Move linker_section_pointers..
1854         * elf32-ppc.c (struct ppc_elf_obj_tdata): ..to here.  New.
1855         (ppc_elf_tdata): Define.
1856         (elf_local_ptr_offsets): Adjust.
1857         (ppc_elf_mkobject): New function.
1858         (bfd_elf32_mkobject): Define.
1859
1860         * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format.
1861         * elfcore.h (elf_core_file_p): Likewise.
1862         * section.c (bfd_section_init): Remove prototype.
1863
1864 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
1865
1866         * elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer
1867         field.
1868         (enum elf_linker_section_enum): Delete.
1869         (struct elf_linker_section): Delete.
1870         (struct elf_linker_section_pointers): Delete.
1871         (struct elf_obj_tdata): Remove #if 0 chunk.  Remove linker_section.
1872         Make linker_section_pointers a void**.
1873         (elf_local_ptr_offsets, elf_linker_section): Don't define.
1874         * elf32-ppc.c (enum elf_linker_section_enum): New, cut-down version
1875         of old item in elf-bfd.h.
1876         (struct elf_linker_section): Likewise.
1877         (struct elf_linker_section_pointers): Likewise.
1878         (elf_local_ptr_offsets): Define.
1879         (struct ppc_elf_link_hash_entry): Add linker_section_pointer.
1880         (ppc_elf_link_hash_newfunc): Init it.
1881         (struct ppc_elf_link_hash_table): Add sbss.
1882         (ppc_elf_link_hash_table_create): zmalloc rather than clearing
1883         individual fields.
1884         (elf_create_linker_section): Fold into..
1885         (ppc_elf_create_linker_section): ..here.  Remove hole_size code.
1886         Make rela section here if shared.
1887         (elf_find_pointer_linker_section): Pass lsect rather than enum.
1888         (elf_create_pointer_linker_section): Adjust.  zalloc rather than
1889         clearing in a loop.
1890         (elf_finish_pointer_linker_section): Adjust.  Don't make rela
1891         section here.
1892         (ppc_elf_check_relocs): Adjust.
1893         (ppc_elf_add_symbol_hook): Tighten hash creator test.  Remove code
1894         creating .sbss by hand.
1895         * elf.c (_bfd_elf_link_hash_newfunc): Adjust.
1896
1897 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1898
1899         * elf32-s390.c (elf_howto_table): Change R_390_GOT12 to
1900         complain_overflow_bitfield.
1901         * elf64-s390.c (elf_howto_table): Change R_390_GOT12 to
1902         complain_overflow_bitfield.
1903
1904 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1905
1906         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Return
1907         true even if -pie.
1908
1909 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1910
1911         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec.
1912         (elfNN_ia64_dynamic_symbol_p): Change info->shared into
1913         !info->executable.
1914         (get_fptr): For -pie create .opd as writable section and create
1915         .rela.opd as well.
1916         (elfNN_ia64_check_relocs): Change info->shared into
1917         !info->executable.
1918         (allocate_fptr): Likewise.
1919         (allocate_dynrel_entries): Account for a relative reloc for -pie
1920         @fptr().  Don't account for a relative reloc if -pie want_ltoff_fptr
1921         for undefweak symbol.  Account for an IPLT reloc in .rela.opd
1922         section if -pie.
1923         (set_got_entry): Don't create a relative reloc if -pie
1924         want_ltoff_fptr for undefweak symbol.
1925         (set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie.
1926         (elfNN_ia64_relocate_section): Emit a relative reloc for -pie
1927         @fptr().
1928
1929         * elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol
1930         even if -pie.
1931         * elf32-i386.c (elf_i386_relocate_section): Likewise.
1932         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1933         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1934         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1935         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1936         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1937         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1938         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1939         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1940
1941 2003-07-04  Paul Clarke <paulc@senet.com.au>
1942
1943         * elf32-h8300.c (R_H8_DIR32A16): Fix name field.
1944         (elf32_h8_relax_section) <R_H8_DIR16A8>: Adjust position of relocation.
1945         <R_H8_DIR32A16>: Fix type of relocation.
1946
1947 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1948
1949         * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic
1950         sections were created already.  Remove unnecessary tests of
1951         the previous change.
1952
1953 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1954
1955         * elf32-sh.c (sh_elf_create_dynamic_sections): Don't call
1956         bfd_make_section for existing sections.
1957
1958 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
1959
1960         * elf32-sparc.c (elf32_sparc_check_relocs): Don't call
1961         create_got_section if we already have done so.
1962         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
1963         (sh_elf_check_relocs): Likewise.
1964         (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var.  Use
1965         htab->root.dynobj instead.
1966         (sh_elf_check_relocs): Likewise.
1967         (sh_elf_finish_dynamic_sections): Likewise.
1968
1969         * section.c (bfd_make_section): Return NULL for existing section.
1970
1971 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
1972
1973         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Don't call
1974         ppc_elf_create_got if we've already done so.
1975
1976         * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare.
1977         (_bfd_elf_find_pointer_linker_section): Likewise.
1978         (bfd_elf32_create_pointer_linker_section): Likewise.
1979         (bfd_elf32_finish_pointer_linker_section): Likewise.
1980         (bfd_elf64_create_pointer_linker_section): Likewise.
1981         (bfd_elf64_finish_pointer_linker_section): Likewise.
1982         (_bfd_elf_make_linker_section_rela): Likewise.
1983         * elfcode.h (elf_create_pointer_linker_section): Don't define.
1984         (elf_finish_pointer_linker_section): Likewise.
1985         * elflink.c (_bfd_elf_make_linker_section_rela): Delete.
1986         (_bfd_elf_create_linker_section): Move this function..
1987         (_bfd_elf_find_pointer_linker_section): ..and this..
1988         * elflink.h (elf_create_pointer_linker_section): ..and this..
1989         (elf_finish_pointer_linker_section): ..and this..
1990         * elf32-ppc.c: ..to here, renaming to the following, and adjusting
1991         calls.
1992         (elf_create_linker_section): Convert to C90, tidy.
1993         (elf_find_pointer_linker_section): Likewise.
1994         (elf_create_pointer_linker_section): Likewise.
1995         (elf_finish_pointer_linker_section): Likewise.
1996         * elf32-i370.c: Delete #if 0 code.
1997
1998 2003-07-02  Alan Modra  <amodra@bigpond.net.au>
1999
2000         * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't allow _savef* and
2001         _restf* to be satisfied by shared libs, and always force them local.
2002         (toc_adjusting_stub_needed): Avoid scanning linker created sections.
2003         Correct test for "bl".
2004         (ppc64_elf_relocate_section <R_PPC64_TLS>): Correct test for
2005         primary opcode 31.
2006
2007 2003-07-01  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2008
2009         * elf32-s390.c (s390_elf_ldisp_reloc): New prototype.
2010         (s390_tls_reloc): New function.
2011         (elf_howto_table): Add long displacement relocations R_390_20,
2012         R_390_GOT20, R_390_GOTPLT20 and R_390_TLS_GOTIE20.
2013         (elf_s390_reloc_type_lookup): Likewise.
2014         (elf_s390_check_relocs): Likewise.
2015         (elf_s390_gc_sweep_hook): Likewise.
2016         (elf_s390_relocate_section): Likewise.
2017         * elf64-s390.c: Same changes as for elf32-s390.c.
2018         * reloc.c: Add long displacement relocations BFD_RELOC_390_20,
2019         BFD_RELOC_390_GOT20, BFD_RELOC_390_GOTPLT20 and
2020         BFD_RELOC_390_TLS_GOTIE20.
2021         * bfd-in2.h: Regenerate.
2022         * libbfd.h: Likewise.
2023
2024 2003-06-30  Alan Modra  <amodra@bigpond.net.au>
2025
2026         * cpu-ia64-opc.c (ext_imms_scaled): Don't sign extend using shifts.
2027         (ins_imms, ins_immsm1u4): Likewise.  Warning fix.
2028
2029 2003-06-29  Alan Modra  <amodra@bigpond.net.au>
2030
2031         * archive.c: Convert to C90, remove unnecessary prototypes and casts.
2032         Replace PTR with void *.  Formatting.
2033         * archive64.c: Likewise.
2034         * archures.c: Likewise.
2035         * bfd-in.h: Likewise.
2036         * bfd.c: Likewise.
2037         * bfdio.c: Likewise.
2038         * bfdwin.c: Likewise.
2039         * cache.c: Likewise.
2040         * corefile.c: Likewise.
2041         * format.c: Likewise.
2042         * init.c: Likewise.
2043         * libbfd-in.h: Likewise.
2044         * libbfd.c: Likewise.
2045         * linker.c: Likewise.
2046         * opncls.c: Likewise.
2047         * reloc.c: Likewise.
2048         * section.c: Likewise.
2049         * simple.c: Likewise.
2050         * syms.c: Likewise.
2051         * targets.c: Likewise.
2052         * bfd-in2.h: Regenerate.
2053         * libbfd.h: Regenerate.
2054
2055         * ecoff.c (bfd_debug_section): Add missing kept_section initialization.
2056         * libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined.
2057         * libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify.
2058         (bfd_getb64): Rewrite without parens.
2059         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
2060         * cache.c (insert, snip): Remove INLINE.
2061         * linker.c (bfd_link_add_undef): Likewise.
2062
2063 2003-06-29  Andreas Jaeger  <aj@suse.de>
2064
2065         * elf64-x86-64.c: Convert to ISO C90 prototypes, remove
2066         unnecessary prototypes.  Replace PTR with void *.
2067         (elf64_x86_64_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to
2068         trim plt entries.  Move undefweak non-default visibility test ...
2069         (allocate_dynrelocs): ... from here.
2070         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2071         Change all callers.
2072         (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.  Use
2073         SYMBOL_REFERENCES_LOCAL for dynreloc check.
2074         (elf64_x86_64_relocate_section): Use SYMBOL_CALLS_LOCAL for
2075         dynreloc and .got relocs.
2076         (elf64_x86_64_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL
2077         for .got relocs.
2078
2079 2003-06-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2080
2081         * elfxx-mips.c: Allow lazy binding for R_MIPS_JALR.
2082
2083 2003-06-27  Nick Clifton  <nickc@redhat.com>
2084
2085         * opncls.c (bfd_add_gnu_debuglink_section): Rename to
2086         bfd_add_gnu_debuglink_section and only create the section, do not
2087         fill in its contents.
2088         (bfd_fill_in_gnu_debuglink_section): New function.  Fill in the
2089         contents of a .gnu-debuglink section.
2090         * bfd-in2.h: Regenerate.
2091
2092 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2093
2094         * elfxx-mips.c: Revert .got alignment to 2**4.
2095
2096 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2097
2098         * elf32-mips.c: Fix addend for _gp_disp special symbol.
2099
2100 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2101
2102         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default
2103         relocation header setup.
2104
2105 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
2106
2107         * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast.
2108         (ppc_elf_reloc_type_lookup): Modify comment.
2109         (ppc_elf_info_to_howto): Ditto.
2110         (ppc_elf_relocate_section): Ditto.
2111         (ppc_elf_check_relocs): Call ppc_elf_howto_init.
2112
2113 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
2114
2115         * aout-ns32k.c: Correct spelling of "relocatable".
2116         * aoutx.h: Likewise.
2117         * bfd-in.h: Likewise.
2118         * bfd.c: Likewise.
2119         * bout.c: Likewise.
2120         * coff-a29k.c: Likewise.
2121         * coff-alpha.c: Likewise.
2122         * coff-arm.c: Likewise.
2123         * coff-i386.c: Likewise.
2124         * coff-i860.c: Likewise.
2125         * coff-i960.c: Likewise.
2126         * coff-m68k.c: Likewise.
2127         * coff-m88k.c: Likewise.
2128         * coff-mcore.c: Likewise.
2129         * coff-mips.c: Likewise.
2130         * coff-or32.c: Likewise.
2131         * coff-ppc.c: Likewise.
2132         * coff-rs6000.c: Likewise.
2133         * coff-sh.c: Likewise.
2134         * coff-tic80.c: Likewise.
2135         * coff64-rs6000.c: Likewise.
2136         * cofflink.c: Likewise.
2137         * cpu-ns32k.c: Likewise.
2138         * ecoff.c: Likewise.
2139         * ecofflink.c: Likewise.
2140         * elf-bfd.h: Likewise.
2141         * elf-eh-frame.c: Likewise.
2142         * elf-hppa.h: Likewise.
2143         * elf-m10200.c: Likewise.
2144         * elf-m10300.c: Likewise.
2145         * elf.c: Likewise.
2146         * elf32-arm.h: Likewise.
2147         * elf32-avr.c: Likewise.
2148         * elf32-cris.c: Likewise.
2149         * elf32-d10v.c: Likewise.
2150         * elf32-dlx.c: Likewise.
2151         * elf32-fr30.c: Likewise.
2152         * elf32-frv.c: Likewise.
2153         * elf32-h8300.c: Likewise.
2154         * elf32-hppa.c: Likewise.
2155         * elf32-i370.c: Likewise.
2156         * elf32-i386.c: Likewise.
2157         * elf32-i860.c: Likewise.
2158         * elf32-i960.c: Likewise.
2159         * elf32-ip2k.c: Likewise.
2160         * elf32-iq2000.c: Likewise.
2161         * elf32-m32r.c: Likewise.
2162         * elf32-m68hc11.c: Likewise.
2163         * elf32-m68hc1x.c: Likewise.
2164         * elf32-m68k.c: Likewise.
2165         * elf32-mcore.c: Likewise.
2166         * elf32-mips.c: Likewise.
2167         * elf32-msp430.c: Likewise.
2168         * elf32-openrisc.c: Likewise.
2169         * elf32-ppc.c: Likewise.
2170         * elf32-s390.c: Likewise.
2171         * elf32-sh.c: Likewise.
2172         * elf32-sh64.c: Likewise.
2173         * elf32-sparc.c: Likewise.
2174         * elf32-v850.c: Likewise.
2175         * elf32-vax.c: Likewise.
2176         * elf32-xstormy16.c: Likewise.
2177         * elf32-xtensa.c: Likewise.
2178         * elf64-alpha.c: Likewise.
2179         * elf64-hppa.c: Likewise.
2180         * elf64-mips.c: Likewise.
2181         * elf64-mmix.c: Likewise.
2182         * elf64-ppc.c: Likewise.
2183         * elf64-s390.c: Likewise.
2184         * elf64-sh64.c: Likewise.
2185         * elf64-sparc.c: Likewise.
2186         * elf64-x86-64.c: Likewise.
2187         * elfcode.h: Likewise.
2188         * elflink.h: Likewise.
2189         * elfn32-mips.c: Likewise.
2190         * elfxx-ia64.c: Likewise.
2191         * elfxx-mips.c: Likewise.
2192         * i386linux.c: Likewise.
2193         * ieee.c: Likewise.
2194         * libcoff-in.h: Likewise.
2195         * linker.c: Likewise.
2196         * m68klinux.c: Likewise.
2197         * pdp11.c: Likewise.
2198         * pe-mips.c: Likewise.
2199         * peXXigen.c: Likewise.
2200         * reloc.c: Likewise.
2201         * reloc16.c: Likewise.
2202         * sparclinux.c: Likewise.
2203         * sunos.c: Likewise.
2204         * syms.c: Likewise.
2205         * versados.c: Likewise.
2206         * vms.c: Likewise.
2207         * xcofflink.c: Likewise.
2208         * bfd-in2.h: Regenerate.
2209         * libcoff.h: Regenerate.
2210         * libbfd.h: Regenerate.
2211
2212 2003-06-24  Alan Modra  <amodra@bigpond.net.au>
2213
2214         * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against
2215         local sym errors.
2216
2217         * elf32-i386.c: Convert to C90 function definitions, remove unnecessary
2218         prototypes and casts.  Replace PTR with void *.  Formatting.
2219         * elf32-ppc.c: Likewise.  Break long strings too.
2220         (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type.
2221         (ppc_elf_unhandled_reloc): Internationalize error message.
2222         * elf32-ppc.h: Remove PARAMS.
2223
2224 2003-06-23  Mark Mitchell  <mark@codesourcery.com>
2225
2226         * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count
2227         APUinfo slots.
2228         (ppc_elf_final_write_processing): Likewise.
2229
2230 2003-06-23  H.J. Lu <hongjiu.lu@intel.com>
2231
2232         * elflink.h (elf_link_input_bfd): Check raw size when using
2233         kept_section to preserve debug information discarded by
2234         linkonce.
2235
2236 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
2237
2238         * elf64-ppc.c (struct ppc_link_hash_table): Add top_id.
2239         (ppc64_elf_setup_section_lists): Set it.
2240         (ppc64_elf_relocate_section): Check sym section id against top_id.
2241         (ppc_build_one_stub): Comment on top_id.
2242
2243 2003-06-20  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
2244
2245         * config.bfd: Add tic4x-*-rtems*.
2246
2247 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
2248
2249         * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary
2250         prototypes and casts.  Replace PTR with void *.  Format copyright.
2251         Mention ABI links.
2252         (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt,
2253         sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt.
2254         (ppc_type_of_stub): Make r_type an enum.
2255         (ppc64_elf_size_stubs): Likewise.
2256         * elf64-ppc.h: Remove PARAMS macro.
2257
2258 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2259
2260         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of
2261         elf hash tab fields.
2262
2263         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype.
2264         (ppc64_elf_info_to_howto): Likewise.
2265         (ppc64_elf_build_stubs): Add "stats" param, and print statistics.
2266         * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype.
2267
2268 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2269
2270         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32
2271         reloc overflow on discarded eh_frame entries.
2272
2273 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2274
2275         * elf64-ppc.c (toc_adjusting_stub_needed): New function.
2276         (ppc64_elf_next_input_section): Use it here to set has_gp_reloc.
2277         Return error condition.
2278         (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections
2279         that have has_gp_reloc set.
2280         (struct ppc_link_hash_table): Add stub_count.
2281         (ppc_build_one_stub): Increment it.
2282         (ppc64_elf_link_hash_table_create): zmalloc rather than clearing
2283         individual fields.
2284         * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype.
2285
2286 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
2287
2288         * elflink.h (elf_gc_record_vtentry): Revert last change.  Correct
2289         size calculation from addend.  Round size up.
2290
2291 2003-06-18  Hans-Peter Nilsson  <hp@axis.com>
2292
2293         * elf32-cris.c (cris_elf_relocate_section) <case
2294         R_CRIS_32_GOTREL>: When linking a program, don't complain about a
2295         symbol from a normal object or an undefined weak symbol.
2296
2297 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
2298
2299         * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on
2300         R_PPC64_TOC relocs.
2301
2302 2003-06-17  H.J. Lu <hongjiu.lu@intel.com>
2303
2304         * section.c (struct sec): Put back kept_section.
2305         (STD_SECTION): Put back kept_section initialization.
2306         * bfd-in2.h: Regenerate.
2307
2308         * elflink.h (elf_link_input_bfd): Also check discarded linkonce
2309         sections for relocateable output. Use kept_section to preserve
2310         debug information discarded by linkonce.
2311
2312 2003-06-17  Roland McGrath  <roland@redhat.com>
2313
2314         * elfxx-ia64.c (elfNN_ia64_relocate_section): Support
2315         segment-relative relocation between different segments.
2316
2317 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2318
2319         * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc
2320         optimizations earlier.
2321
2322         * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index.
2323         Restore previous input_list type.
2324         (ppc64_elf_link_hash_table_create): Undo last change.
2325         (ppc64_elf_setup_section_lists): Reinstate code setting up input lists
2326         per output section, but don't bother with bfd_abs_section marker.
2327         (ppc64_elf_next_input_section): Adjust for multiple input section
2328         lists.
2329         (group_sections): Likewise.
2330
2331 2003-06-17  Jakub Jelinek  <jakub@redhat.com>
2332
2333         * elf64-ppc.c (ppc64_elf_relocation_section): Ensure
2334         *r_offset == r_addend for RELATIVE relocs against .got.
2335
2336 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2337
2338         * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs.
2339
2340 2003-06-17  Nick Clifton  <nickc@redhat.com>
2341
2342         * elflink.h (elf_gc_record_vtentry): Allocate an extra element
2343         in the vtable_entries_used array to allow for the accessing
2344         the largest element.
2345
2346 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2347
2348         * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index.  Modify
2349         input_list.
2350         (ppc64_elf_link_hash_table_create): Init input_list here.
2351         (ppc64_elf_setup_section_lists): Remove code setting up input lists
2352         per output section.  Set toc_off for abs and other standard sections.
2353         (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc.
2354         (ppc64_elf_next_input_section): Adjust for single input section list.
2355         Don't set toc_curr from input bfds that haven't set elf_gp.
2356         (group_sections): Adjust for single input section list.
2357
2358         * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero.
2359
2360 2003-06-16  Alan Modra  <amodra@bigpond.net.au>
2361
2362         * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel
2363         tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a
2364         dtprel entry.  Ensure TLS_LD DTPMOD reloc has a zero addend.  Write
2365         got section for RELATIVE relocs.  Fix wrong comment.  Change condition
2366         under which dynamic relocs update the section contents.
2367
2368 2003-06-13  Robert Millan  <zeratul2@wanadoo.es>
2369
2370         * config.bfd: Add i386-netbsd-gnu target.
2371
2372 2003-06-12  Nick Clifton  <nickc@redhat.com>
2373
2374         * opncls.c (calc_crc32): Rename to
2375         bfd_calc_gnu_debuglink_crc32 and export.
2376         (GNU_DEBUGLINK): Define and use to replace occurrences of
2377         hard-coded ".gnu_debuglink" in the code.
2378         (get_debug_link_info): Prevent aborts by replacing call to
2379         xmalloc with a call to malloc.
2380         (find_separate_debug_file): Prevent aborts by replacing calls
2381         to xmalloc and xstrdup with calls to malloc and strdup.
2382         (bfd_add_gnu_debuglink): New function.  Add a .gnu_debuglink
2383         section to a bfd.
2384         * bfd-in2.h: Regenerate.
2385
2386 2003-06-12 Federico G. Schwindt <fgsch@lodoss.net>
2387
2388         * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]):
2389         New target (was i[3-7]86-*-openbsd* before).
2390         (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec.
2391         (vax-*-openbsd*): New target.
2392
2393 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2394
2395         * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options
2396         for n32, too.
2397         (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too.
2398         (mips_elf_rel_dyn_section): Use appropriate section alignment.
2399         (mips_elf_create_got_section): Likewise.
2400         (_bfd_mips_elf_create_dynamic_sections): Likewise.
2401
2402 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2403
2404         * elf32-mips.c (mips_elf_generic_reloc): New Function.
2405         (elf_mips_howto_table_rel): Use it.
2406         (gprel32_with_gp): Move prototype.
2407         (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend.
2408         Use mips_elf_generic_reloc.
2409         (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend.
2410         Code cleanup.
2411         (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of
2412         zero addend.
2413         (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic
2414         as in the other *_gprel*_reloc functions.
2415         (gprel32_with_gp): Handle partial_inplace properly.
2416         (mips32_64bit_reloc): Use mips_elf_generic_reloc.
2417         (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend.
2418         Do addend handling directly instead of calling
2419         _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly.
2420         * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead
2421         of zero addend. Handle partial_inplace properly.
2422         (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero
2423         addend.
2424         (mips_elf64_gprel16_reloc): Likewise.
2425         (mips_elf64_literal_reloc): Likewise.
2426         (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment
2427         logic as in the other *_gprel*_reloc functions. Handle
2428         partial_inplace properly.
2429         (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero
2430         addend. Handle partial_inplace properly.
2431         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
2432         of calling _bfd_mips_elf_gprel16_with_gp.
2433         * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL.
2434         (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead
2435         of zero addend.
2436         (mips_elf_shift6_reloc): Handle partial_inplace properly.
2437         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
2438         of calling _bfd_mips_elf_gprel16_with_gp.
2439         * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle
2440         partial_inplace properly. Fix wrong addend handling. Fix overflow
2441         check.
2442         (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and
2443         exported.
2444         (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend.
2445         (_bfd_mips_elf_relocate_section): Likewise.
2446         (mips_elf_create_dynamic_relocation): Update sec_info_type access.
2447         * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration.
2448         (_bfd_mips_elf_sign_extend): New prototype.
2449
2450 2003-06-11 Federico G. Schwindt <fgsch@lodoss.net>
2451
2452         * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]):
2453         New target (was sparc-*-openbsd* before).
2454         (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec.
2455
2456         * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo.
2457         * configure: Regenerate.
2458
2459 2003-06-11  H.J. Lu <hongjiu.lu@intel.com>
2460
2461         * po/Make-in (DESTDIR): New.
2462         (install-data-yes): Support $(DESTDIR).
2463         (uninstall): Likewise.
2464
2465 2003-06-11  Alan Modra  <amodra@bigpond.net.au>
2466
2467         * Makefile.am (config.status): Depend on version.h.
2468         Run "make dep-am".
2469         * Makefile.in: Regenerate.
2470         * po/SRC-POTFILES.in: Regenerate.
2471
2472 2003-06-10  Alan Modra  <amodra@bigpond.net.au>
2473             Gary Hade <garyhade@us.ibm.com>
2474
2475         * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq.
2476
2477 2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
2478
2479         * archures.c (bfd_mach_h8300sxn): New architecture.
2480         * bfd-in2.h: Regenerate.
2481         * cpu-h8300.c (h8300_scan): Check for 'sxn'.
2482         (h8300sxn_info_struct): New.
2483         (h8300sx_info_struct): Link to it.
2484         * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case.
2485         (elf32_h8_final_write_processing): Likewise.
2486
2487 2003-06-08  Alan Modra  <amodra@bigpond.net.au>
2488
2489         * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by
2490         elfxx-target.h so that we can use elf_backend_got_header_size.
2491         (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete.
2492         (GLINK_CALL_STUB_SIZE): Modify.  Define new glink call stub and
2493         associated macros.
2494         (ppc64_elf_howto_raw <GOT_TPREL16_DS, GOT_TPREL16_LO_DS>): Correct
2495         dst_mask.
2496         (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and
2497         ppc_stub_plt_branch_r2off.
2498         (struct ppc_stub_hash_entry): Reorganize.
2499         (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed,
2500         toc_curr, toc_off and emit_stub_syms.
2501         (ppc64_elf_link_hash_table_create): Init them.
2502         (ppc_stub_name): Correct string size.
2503         (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs.
2504         (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries
2505         used.
2506         (ppc_type_of_stub): Tweak root.type test.
2507         (build_plt_stub): Remove glink code.  Adjust for insn macro changes.
2508         (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and
2509         ppc_stub_plt_branch_r2off.
2510         (ppc_build_one_stub): Likewise.  Fix var shadowing.  Correct addis,addi
2511         range test.  Use toc_off to calculte r2 values.  Handle emit_stub_syms.
2512         (ppc64_elf_setup_section_lists): Remove htab creator flavour test.
2513         Initialize elf_gp and toc_curr.
2514         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions.
2515         (ppc64_elf_next_input_section): Set toc_off.
2516         (group_sections): Ensure groups have the same TOC.
2517         (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub.
2518         (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab.
2519         Build new glink stub.
2520         (ppc64_elf_relocate_section): Handle multiple TOCs.  Fix comments.
2521         (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK.
2522         * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype.
2523         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare.
2524         * section.c (struct sec): Rename flag12 to has_gp_reloc.
2525         (STD_SECTION): Update.
2526         * ecoff.c (bfd_debug_section): Update comment.
2527         * bfd-in2.h: Regenerate.
2528
2529 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
2530
2531         * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference
2532         NULL function pointers.
2533
2534 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
2535
2536         * simple.c (bfd_simple_get_relocated_section_contents): Call
2537         _bfd_generic_link_add_symbols instead of bfd_link_add_symbols.
2538
2539 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
2540
2541         * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and
2542         ticoff1_bad_format_hook() functions. Removed the coff0 and coff1
2543         swaptables.
2544         * coff-tic4x.c: Ditto
2545         * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC
2546         and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro
2547         CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(),
2548         ticoff1_bad_format_hook() functions. Created the coff0 and coff1
2549         swap tables.
2550         * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros.
2551         * coff-a29k.c: Append COFF_SWAP_TABLE argument
2552         * coff-apollo.c: Ditto
2553         * coff-arm.c: Ditto
2554         * coff-h8300.c: Ditto
2555         * coff-h8500.c: Ditto
2556         * coff-i960.c: Ditto
2557         * coff-m68k.c: Ditto
2558         * coff-m88k.c: Ditto
2559         * coff-mcore.c: Ditto
2560         * coff-sh.c: Ditto
2561         * coff-sparc.c: Ditto
2562         * coff-tic80.c: Ditto
2563         * coff-we32k.c: Ditto
2564         * coff-z8k.c: Ditto
2565         * coff-w65.c: Ditto
2566
2567 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
2568
2569         * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed
2570         initialization bug
2571
2572 2003-06-03  Jakub Jelinek  <jakub@redhat.com>
2573
2574         * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK.
2575         (bfd_section_from_phdr): Likewise.
2576         (map_sections_to_segments): Create PT_GNU_STACK segment header.
2577         (get_program_header_size): Count with PT_GNU_STACK.
2578         * elf-bfd.h (struct elf_obj_tdata): Add stack_flags.
2579         * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags.
2580
2581 2003-06-03  H.J. Lu <hongjiu.lu@intel.com>
2582
2583         * elflink.h (elf_link_input_bfd): Call linker error_handler
2584         for discarded definitions.
2585
2586 2003-06-03  Elias Athanasopoulos  <elathan@phys.uoa.gr>
2587
2588         * syms.c (decode_section_type): Return 'n' if section flags are
2589         SEC_HAS_CONTENTS && SEC_READONLY.
2590
2591 2003-06-03  Nick Clifton  <nickc@redhat.com>
2592
2593         * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to
2594         R_V850_ABS32.  Add entry for R_V850_REL32.
2595         (v850_elf_reloc_map): Likewise.
2596         (v850_elf_check_relocs): Likewise.
2597         (v850_elf_perform_relocation): Likewise.
2598         (v850_elf_final_link_relocate): Likewise.  Include computation
2599         to make R_V850_REl32 pc-relative.
2600
2601 2003-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2602
2603         * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section
2604         and DT_DEBUG dynamic tag even for position independent executables.
2605         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize.
2606
2607 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
2608
2609         * config.bfd: Move obsolete entries out of the range of the
2610         targmatch sed script.
2611
2612 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
2613
2614         * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete.
2615
2616 2003-05-31  Jakub Jelinek  <jakub@redhat.com>
2617
2618         * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192
2619         plt entries, not just 8191.
2620
2621 2003-05-30  Daniel Jacobowitz  <drow@mvista.com>
2622
2623         * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index.
2624         Reported by Ken Faiczak <kfaiczak@SANDVINE.com>.
2625
2626 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2627             Jakub Jelinek  <jakub@redhat.com>
2628
2629         * elflink.h (elf_link_add_object_symbols): Use !info->executable
2630         instead of info->shared where appropriate.
2631         (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise.
2632         * elflink.c (_bfd_elf_create_got_section): Likewise.
2633         (_bfd_elf_link_create_dynamic_sections): Likewise.
2634         (_bfd_elf_link_assign_sym_version): Likewise.
2635         * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section
2636         and DT_DEBUG dynamic tag even for position independent executables.
2637         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
2638         * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise.
2639         * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise.
2640         * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise.
2641         * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise.
2642         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise.
2643         * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise.
2644         * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise.
2645         * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise.
2646
2647 2003-05-30  Kris Warkentin <kewarken@qnx.com>
2648
2649         * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
2650         signalled thread.
2651         (elfcore_grok_nto_gregs): Only make .reg section for the active thread.
2652
2653 2003-05-29  Nick Clifton  <nickc@redhat.com>
2654
2655         * pef.c: Include "safe-ctype.h" instead of <ctype.h>.
2656         Tidy up formatting.
2657         * Makefile.am: Add dependency on safe-ctype.h.
2658         * Makefile.in: Regenerate.
2659
2660 2003-05-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2661
2662         * elfxx-mips.c: Don't force symbols local unconditionally.
2663
2664 2003-05-28  Alan Modra  <amodra@bigpond.net.au>
2665
2666         * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus
2667         undefined_symbol call.
2668
2669 2003-05-27  Richard Sandiford  <rsandifo@redhat.com>
2670
2671         * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting.
2672         (mips_elf_link_hash_table): Likewise.
2673
2674 2003-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2675
2676         * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
2677         R_MIPS_GNU_REL16_S2 support.
2678         (bfd_elf64_bfd_reloc_type_lookup): Use it.
2679         (mips_elf64_rtype_to_howto): Use it.
2680         * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used
2681         R_MIPS_GNU_REL16_S2 support.
2682         (bfd_elf32_bfd_reloc_type_lookup): Use it.
2683         (mips_elf_n32_rtype_to_howto): Use it.
2684
2685 2003-05-21  Stuart F. Downing  <sdowning@fame.com>
2686
2687         * som.h: Define PA_2_0 before including a.out.h
2688
2689 2003-05-07  Eric Christopher  <echristo@redhat.com>
2690             Alexandre Oliva   <aoliva@redhat.com>
2691
2692         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
2693         pic tests, change to warning.
2694         (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.
2695
2696 2003-05-21  Marcus Comstedt  <marcus@mc.pp.se>
2697
2698         * config.bfd: Check for a target triplet of shl-...-netbsdelf as
2699         well as shle-...-netbsdelf.  Remove duplicate entry.
2700
2701 2003-05-21  Nick Clifton  <nickc@redhat.com>
2702
2703         * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask
2704         for X_STORMY16_REL_12 reloc.
2705
2706         * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check
2707         the type of the hash table in the bfd_link_info structure.
2708         (bfd_elf_get_runpath_list): Likewise.
2709
2710 2003-05-19  Roland McGrath  <roland@redhat.com>
2711
2712         * elf.c (bfd_elf_bfd_from_remote_memory): New function.
2713         * bfd-in.h: Declare it.
2714         * bfd-in2.h: Regenerated.
2715         * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
2716         * elf-bfd.h (struct elf_backend_data): New function pointer member
2717         elf_backend_bfd_from_remote_memory.
2718         (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
2719         Declare them.
2720         * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
2721         (elfNN_bed): Add that to the initializer.
2722
2723 2003-05-15  Roland McGrath  <roland@redhat.com>
2724
2725         * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section.
2726
2727 2003-05-20  Jakub Jelinek  <jakub@redhat.com>
2728
2729         * elflink.h (elf_link_output_extsym): Only issue error about !=
2730         STV_DEFAULT symbols if they are bfd_link_hash_undefined.
2731
2732 2003-05-20  H.J. Lu <hongjiu.lu@intel.com>
2733
2734         * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF
2735         when removing the old definition for symbols with non-default
2736         visibility.
2737
2738 2003-05-18  Jason Eckhardt  <jle@rice.edu>
2739
2740         * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation.
2741
2742 2003-05-17  Andreas Schwab  <schwab@suse.de>
2743
2744         * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in
2745         elf_section_data during processing of pc-relative and absolute
2746         relocations.
2747         (elf_m68k_relocate_section): Use the cached reloc section instead
2748         of computing it again.  Fix handling of visibility.  Don't modify
2749         addend when copying over a relocation into the output.
2750
2751 2003-05-17  Alan Modra  <amodra@bigpond.net.au>
2752
2753         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
2754         to trim plt entries.  Move undefweak non-default visibility test..
2755         (allocate_dynrelocs): ..from here.
2756         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test
2757         dynamic_sections_created here.  Update comment.  Move undefweak
2758         non-default visibility test..
2759         (allocate_dynrelocs): ..from here.  Fix comment.
2760         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
2761         to trim plt entries.  Move undefweak non-default visibility test..
2762         (allocate_dynrelocs): ..from here.  Fix comment.
2763         * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with
2764         STV_DEFAULT rather than comparing with zero.
2765         * elflink.c (_bfd_elf_merge_symbol): Likewise.
2766         (_bfd_elf_fix_symbol_flags): Likewise.  Format comment.
2767
2768 2003-05-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2769
2770         * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
2771         pointers.
2772         (_bfd_set_gp_value): Likewise.
2773
2774 2003-05-16  Michael Snyder  <msnyder@redhat.com>
2775         From Bernd Schmidt  <bernds@redhat.com>
2776         * archures.c (bfd_mach_h8300sx): New.
2777         * bfd-in2.h: Regenerate.
2778         * cpu-h8300.c (h8300_scan)): Add support for h8300sx.
2779         (h8300sx_info_struct): New.
2780         (h8300s_info_struct): Link to it.
2781         * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx.
2782         (elf32_h8_final_write_processing): Likewise.
2783         (elf32_h8_relax_section): Likewise.
2784
2785 2003-05-16  Kelley Cook  <kelleycook@wideopenwest.com>
2786
2787         * config.bfd: Accept i[3-7]86 variants.
2788         * configure.host: Likewise.
2789         * configure.in: Likewise.
2790         * configure: Regenerate.
2791
2792 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
2793
2794         * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
2795         symbol.
2796
2797 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
2798
2799         * elflink.h (elf_link_check_versioned_symbol): Also allow
2800         the base version.
2801
2802 2003-05-15  Alan Modra  <amodra@bigpond.net.au>
2803             H.J. Lu <hongjiu.lu@intel.com>
2804
2805         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
2806         (elf_i386_relocate_section): Likewise.
2807         * elf32-ppc.c (allocate_dynrelocs): Likewise.
2808         (ppc_elf_relocate_section): Likewise.
2809         * elf64-ppc.c (allocate_dynrelocs): Likewise.
2810         (ppc64_elf_relocate_section): Likewise.
2811
2812 2003-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2813
2814         * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case.
2815
2816 2003-05-13  Stephane Carrez  <stcarrez@nerim.fr>
2817
2818         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for
2819         processor capability, allow merge of HC12 and HCS12 in some cases.
2820         (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc.
2821         * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct.
2822         (bfd_m68hc12_arch): Link it.
2823         (scan_mach): New function.
2824
2825 2003-05-13  Andrew Haley  <aph@redhat.com>
2826
2827         * elf.c (bfd_elf_hash): Mask lower 32 bits of hash.
2828
2829 2003-05-13  Alan Modra  <amodra@bigpond.net.au>
2830             H.J. Lu  <hongjiu.lu@intel.com>
2831
2832         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from
2833         elf32-ppc.c.  Add ELF_LINK_FORCED_LOCAL check.
2834         * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete.
2835         (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check.
2836         (ppc_elf_relocate_section): Likewise.
2837         * elf64-ppc.c (allocate_dynrelocs): Likewise.
2838         (ppc64_elf_relocate_section): Likewise.  Use for .got relocs too.
2839         (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt
2840         relocs need no other types.
2841         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for
2842         dynreloc check.
2843         (elf_i386_relocate_section): Likewise.  Use for .got relocs too.
2844         (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for
2845         .got relocs.
2846
2847 2003-05-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2848
2849         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols,
2850         copy ELF_LINK_NON_GOT_REF from weakdef.
2851         (allocate_dynrelocs): For undef weak syms with non-default
2852         visibility, a) don't allocate plt entries, b) don't allocate
2853         .got relocs, c) discard dyn rel space
2854         (sh_elf_relocate_section): d) don't generate .got relocs, e)
2855         don't generate dynamic relocs.
2856         (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF
2857         for weakdefs when symbol already adjusted.
2858
2859 2003-05-12  Nick Clifton  <nickc@redhat.com>
2860
2861         * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield'
2862         overflow detection for R_XSTORMY16_16 reloc.
2863
2864 2003-05-12  Paul Clarke  <paulc@senet.com.au>
2865
2866         * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc.
2867
2868 2003-05-11  Jason Eckhardt  <jle@rice.edu>
2869
2870         * elf32-i860.c (elf32_i860_relocate_highadj): Properly
2871         adjust upper bits.
2872         (elf32_i860_relocate_splitn): Obtain upper 5 bits from the
2873         proper place.
2874         (elf32_i860_relocate_pc16): Obtain upper 5 bits from the
2875         proper place.
2876
2877 2003-05-11  Andreas Schwab  <schwab@suse.de>
2878
2879         * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly
2880         complicated tests for unresolvable relocs with a simple direct
2881         scheme using "unresolved_reloc" var.  Report some detail on
2882         bfd_reloc_outofrange and similar errors.
2883
2884 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2885
2886         * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):
2887         Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call.
2888         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2889         * elf64-s390.c: Likewise.
2890
2891 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2892
2893         * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one.
2894         (elf_s390_adjust_dynamic_symbol): For weak symbols, copy
2895         ELF_LINK_NON_GOT_REF from weakdef.
2896         (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has
2897         already been adjusted before treating it specially.
2898         * el64-s390.c: Likwise.
2899
2900 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2901
2902         * elf32-s390.c (allocate_dynrelocs): For undef weak syms with
2903         non-default visibility, a) don't make them dynamic, b) discard
2904         space for dynamic relocs.
2905         (elf_s390_relocate_section): Initialize the GOT entries and skip
2906         R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined
2907         symbols with non-default visibility.
2908         * elf64-s390.c: Likewise.
2909
2910 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
2911
2912         * cpu-arm.c (arm_check_note): Warning fix.
2913         * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes.  Arrange
2914         to keep relocs if edited.
2915         (iq2000_elf_print_private_bfd_data): Return TRUE.
2916         * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
2917         ELF64_R_SYM.
2918         (elfNN_ia64_relax_ldxmov): Warning fix.
2919         * xtensa-isa.c (xtensa_add_isa): Warning fix.
2920         * xtensa-modules.c (get_num_opcodes): Warning fix.
2921
2922 2003-05-09  Andrey Petrov <petrov@netbsd.org>
2923
2924         * elf.c (elf_fake_sections): Use correct cast for sh_name.
2925
2926 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
2927
2928         * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from
2929         elflink.h.  Replace LOG_FILE_ALIGN with bed->s->log_file_align.
2930         (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align.
2931         (bfd_elf_record_link_assignment): Move from elflink.h.
2932         (_bfd_elf_merge_symbol): Likewise.
2933         (_bfd_elf_add_default_symbol): Likewise.
2934         (_bfd_elf_export_symbol): Likewise.
2935         (_bfd_elf_link_find_version_dependencies): Likewise.
2936         (_bfd_elf_link_assign_sym_version): Likewise.
2937         (_bfd_elf_link_read_relocs): Likewise.
2938         (_bfd_elf_link_size_reloc_section): Likewise.
2939         (_bfd_elf_fix_symbol_flags): Likewise.
2940         (_bfd_elf_adjust_dynamic_symbol): Likewise.
2941         (_bfd_elf_link_sec_merge_syms): Likewise.
2942         (elf_link_read_relocs_from_section): Likewise.  Use bed->s->sizeof_rel
2943         and bed->s->sizeof_rela.
2944         (_bfd_elf_link_output_relocs): Likewise.
2945         * elf-bfd.h (struct elf_size_info): Rename file_align to
2946         log_file_align.
2947         (struct elf_info_failed): Move from elflink.h.
2948         (struct elf_assign_sym_version_info): Likewise.
2949         (struct elf_find_verdep_info): Likewise.
2950         (_bfd_elf_create_dynamic_sections): Delete duplicate declaration.
2951         (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol,
2952         _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies,
2953         _bfd_elf_link_assign_sym_version,
2954         _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs,
2955         _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs,
2956         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
2957         _bfd_elf_link_sec_merge_syms): Declare.
2958         (bfd_elf32_link_create_dynamic_sections): Don't declare.
2959         (_bfd_elf32_link_read_relocs): Likewise.
2960         (bfd_elf64_link_create_dynamic_sections): Likewise.
2961         (_bfd_elf64_link_read_relocs): Likewise.
2962         * elflink.h: Move lots o' stuff elsewhere.
2963         * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare.
2964         (bfd_elf64_record_link_assignment): Likewise.
2965         (bfd_elf_record_link_assignment): Declare.
2966         * bfd-in2.h: Regenerate.
2967         * elfcode.h (elf_link_create_dynamic_sections): Don't declare.
2968         (NAME(_bfd_elf,size_info)): Adjust for log_file_align.
2969         * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align.
2970         (assign_file_positions_for_segments): Likewise.
2971         (assign_file_positions_except_relocs): Likewise.
2972         (swap_out_syms, elfcore_write_note): Likewise.
2973         * elf-m10200.c: Adjust for changed function names.
2974         * elf-m10300.c: Likewise.
2975         * elf32-arm.h: Likewise.
2976         * elf32-h8300.c: Likewise.
2977         * elf32-hppa.c: Likewise.
2978         * elf32-ip2k.c: Likewise.
2979         * elf32-m32r.c: Likewise.
2980         * elf32-m68hc11.c: Likewise.
2981         * elf32-m68hc1x.c: Likewise.
2982         * elf32-m68k.c: Likewise.
2983         * elf32-mips.c: Likewise.
2984         * elf32-ppc.c: Likewise.
2985         * elf32-sh.c: Likewise.
2986         * elf32-v850.c: Likewise.
2987         * elf32-xtensa.c: Likewise.
2988         * elf64-alpha.c: Likewise.
2989         * elf64-hppa.c: Likewise.
2990         * elf64-mmix.c: Likewise.
2991         * elf64-ppc.c: Likewise.
2992         * elf64-sh64.c: Likewise.
2993         * elfxx-ia64.c: Likewise.
2994         * elfxx-mips.c: Likewise.
2995         (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align.
2996         * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align.
2997         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
2998         * elf64-mips.c (mips_elf64_size_info): Likewise.
2999         * elf64-s390.c (s390_elf64_size_info): Likewise.
3000         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
3001
3002 2003-05-08  H.J. Lu <hongjiu.lu@intel.com>
3003
3004         * elflink.h (elf_add_default_symbol): After skipping the
3005         unversioned symbol, go to non-default one.
3006
3007 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
3008
3009         * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
3010         want_plt field.
3011         (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
3012         for symbols with non-default visibility.
3013
3014 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
3015
3016         * elflink.h (elf_link_check_versioned_symbol): Also handle the
3017         case that a DSO references a hidden symbol which may be
3018         satisfied by a versioned symbol in another DSO.
3019         (elf_link_output_extsym): Check versioned definition for hidden
3020         symbol referenced by a DSO.
3021
3022 2003-05-07  Nick Clifton  <nickc@redhat.com>
3023
3024         * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset
3025         R_XSTORMY16_16 reloc to ignore overflows.
3026
3027 2003-05-06  Alexandre Oliva  <aoliva@redhat.com>
3028
3029         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve
3030         error message for mixing different-endian files.  Check for ABI
3031         compatibility of input files with the selected emulation.
3032
3033 2003-05-05  Alan Modra  <amodra@bigpond.net.au>
3034
3035         * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
3036         non-default visibility, a) don't make them dynamic, b) discard
3037         space for dynamic relocs.
3038         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
3039
3040         * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
3041         non-default visibility, a) don't allocate plt entries, b) don't
3042         allocate .got relocs, c) discard dyn rel space,
3043         (ppc_elf_relocate_section): d) don't generate .got relocs, e)
3044         don't generate dynamic relocs.
3045         * elf64-ppc.c (allocate_dynrelocs): As above.
3046         (ppc64_elf_relocate_section): As above.
3047
3048 2003-05-05  Andreas Jaeger  <aj@suse.de>
3049
3050         * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
3051         relocation entries for weak undefined symbols with non-default
3052         visibility.
3053         (elf64_x86_64_relocate_section): Initialize the GOT entries and
3054         skip R_386_32/R_386_PC32 for weak undefined symbols with
3055         non-default visibility.
3056
3057 2003-05-04  H.J. Lu <hjl@gnu.org>
3058
3059         * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
3060         relocation entries for weak undefined symbols with non-default
3061         visibility.
3062         (elf_i386_relocate_section): Initialize the GOT entries and
3063         skip R_386_32/R_386_PC32 for weak undefined symbols with
3064         non-default visibility.
3065
3066         * elfxx-ia64.c (allocate_fptr): Don't allocate function
3067         descriptors for weak undefined symbols with non-default
3068         visibility.
3069         (allocate_dynrel_entries): Don't allocate relocation entries
3070         for symbols resolved to 0.
3071         (set_got_entry): Don't install dynamic relocation for weak
3072         undefined symbols with non-default visibility.
3073         (set_pltoff_entry): Likewise.
3074
3075         * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
3076         with non-default visibility.
3077         (elf_link_output_extsym): Don't make weak undefined symbols
3078         with non-default visibility dynamic.
3079
3080 2003-05-04  H.J. Lu <hjl@gnu.org>
3081
3082         * elflink.h (elf_merge_symbol): Correctly handle weak definiton.
3083
3084 2003-05-04  H.J. Lu <hjl@gnu.org>
3085
3086         * elflink.h (elf_merge_symbol): Don't record a hidden/internal
3087         symbol dynamic. Check indirection when removing the old
3088         definition for symbols with non-default visibility.
3089         (elf_add_default_symbol): Skip when told by elf_merge_symbol.
3090
3091 2003-05-02  Nick Clifton  <nickc@redhat.com>
3092
3093         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the
3094         R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about
3095         unsigned overflow.
3096
3097 2003-05-02  Andreas Jaeger  <aj@suse.de>
3098
3099         * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy
3100         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
3101         (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
3102         (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy
3103         ELF_LINK_NON_GOT_REF from weakdef.
3104
3105 2003-05-02  Charles Lepple <clepple@ghz.cc>
3106             Nick Clifton <nickc@redhat.com>
3107
3108         * acinclude.m4: Fix name of --enable-install-libbfd switch.
3109         * aclocal.m4: Regenerate.
3110         * configure: Regenerate.
3111         * Makefile.in: Regenerate.
3112
3113 2003-05-01  Alan Modra  <amodra@bigpond.net.au>
3114
3115         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the
3116         weakdef sym has already been adjusted before treating it specially.
3117         * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy
3118         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
3119         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
3120         (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF.
3121
3122 2003-04-28  H.J. Lu <hjl@gnu.org>
3123
3124         * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during
3125         the relax finalize pass.
3126
3127         * section.c (struct sec): Add need_finalize_relax and remove
3128         flag11.
3129         (STD_SECTION): Update struct sec initializer.
3130         * bfd-in2.h: Regenerated.
3131
3132 2003-04-28  H.J. Lu <hjl@gnu.org>
3133
3134         * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol
3135         to copy any information related to dynamic linking when we flip
3136         the indirection.
3137
3138 2003-04-27  H.J. Lu <hjl@gnu.org>
3139
3140         * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New.
3141         (ELF_LINK_DYNAMIC_WEAK): New.
3142
3143         * elflink.h (elf_merge_symbol): Add one argument to indicate if
3144         a symbol should be skipped. Ignore definitions in dynamic
3145         objects for symbols with non-default visibility.
3146         (elf_add_default_symbol): Adjusted.
3147         (elf_link_add_object_symbols): Check if a symbol should be
3148         skipped. Don't merge the visibility field with the one from
3149         a dynamic object.
3150         (elf_link_check_versioned_symbol): Use undef_bfd.
3151         (elf_link_output_extsym): Warn if a forced local symbol is
3152         referenced from dynamic objects. Make non-weak undefined symbol
3153         with non-default visibility a fatal error.
3154
3155 2003-04-27  Daniel Jacobowitz  <drow@mvista.com>
3156
3157         * configure.in: Bump version on HEAD to 2.14.90.
3158         * configure: Regenerated.
3159
3160 2003-04-26  Stephane Carrez  <stcarrez@nerim.fr>
3161
3162         PR savannah/3331:
3163         * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
3164         when we couldn't relax something.
3165
3166 2003-04-25  Alan Modra  <amodra@bigpond.net.au>
3167
3168         * elflink.h (elf_merge_symbol): When we find a regular definition
3169         for an indirect symbol, flip the indirection so that the old
3170         direct symbol now points to the new definition.
3171
3172 2003-04-24  Roland McGrath  <roland@redhat.com>
3173
3174         * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr".
3175
3176 2003-04-24  Alan Modra  <amodra@bigpond.net.au>
3177
3178         * elf32-ppc.c: Formatting and comment fixes.
3179         (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
3180         (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
3181
3182 2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
3183
3184         * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
3185         * bfd-in2.h: Rebuilt.
3186         * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG.
3187         * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC
3188         & H8300SNMAGIC.
3189         (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn.
3190         * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn.
3191         (h8300sn_info_struct, h8300hn_info_struct): New.
3192         * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn
3193         (elf32_h8_final_write_processing): Likewise.
3194
3195 2003-04-23  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3196
3197         * elf32-sh.c (tpoff): New.
3198         (struct elf_sh_dyn_relocs): Remove tls_tpoff32.
3199         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3200         (allocate_dynrelocs): Don't make unnecessary dynamic TLS
3201         relocations.  Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
3202         (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
3203         (dtpoff_base): Fix wrong indentation.
3204         (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
3205         relocations.  Don't set tls_tpoff32 flag.  Don't make unnecessary
3206         R_SH_TLS_TPOFF32 relocations.
3207
3208 2003-04-23  J"orn Rennecke <joern.rennecke@superh.com>
3209
3210         * archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
3211         * cpu-sh.c: Likewise.
3212         * elf32-sh.c: Likewise.
3213         * reloc.c (bfd_reloc_code_real): Likewise.
3214         * elf32-sh64-com.c: Change comment to refer to SuperH.
3215         * elf32-sh64.c: Likewise.
3216         * elf64-sh64.c: Likewise.
3217         * bfd-in2.h (enum bfd_architecture): Regenerate.
3218
3219 2003-04-23  Alan Modra  <amodra@bigpond.net.au>
3220
3221         From Julien LEMOINE <speedblue@debian.org>
3222         * elf32-i386.c (elf_i386_info_to_howto): Delete.
3223         (elf_info_to_howto): Define as elf_i386_info_to_howto_rel.
3224
3225 2003-04-22  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
3226
3227         * archures.c: Replace references to Mitsubishi M32R with references
3228         to Renesas M32R.
3229         * relocs.c: Likewise.
3230         * bfd-in2.h: Regenerate.
3231
3232 2003-04-21  Richard Henderson  <rth@redhat.com>
3233
3234         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an
3235         executable when a symbol is defined both regular and dynamic.
3236
3237 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
3238
3239         * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo.
3240         (elf32-m68hc1x.lo): Update dependencies
3241         * configure.in: Add elf32-m68hc1x.lo.
3242         * configure: Rebuild.
3243         * Makefile.in: Rebuild.
3244
3245 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
3246
3247         * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
3248         (m68hc11_elf_hash_table_create): New function.
3249         (elf32_m68hc11_link_hash_table_free): New function.
3250         (stub_hash_newfunc): New function.
3251         (m68hc11_add_stub): New function.
3252         (elf32_m68hc11_add_symbol_hook): New function.
3253         (elf32_m68hc11_setup_section_lists): New function.
3254         (elf32_m68hc11_next_input_section): New function.
3255         (elf32_m68hc11_size_stubs): New function.
3256         (elf32_m68hc11_build_stubs): New function.
3257         (m68hc11_get_relocation_value): New function.
3258         (elf32_m68hc11_relocate_section): Call the above to redirect
3259         some relocations to the trampoline code.
3260         (m68hc11_elf_export_one_stub): New function.
3261         (m68hc11_elf_set_symbol): New function.
3262         (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse.
3263         (m68hc11_elf_get_bank_parameters): Get parameters only when the info
3264         is not yet initialized.
3265
3266         * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
3267         (elf32_m68hc11_stub_hash_entry): New struct.
3268         (m68hc11_page_info): Add trampoline handler address.
3269         (m68hc11_elf_link_hash_table): Add stubs generation members.
3270         (elf32_m68hc11_add_symbol_hook): Declare.
3271         (elf32_m68hc11_setup_section_lists): Declare.
3272         (elf32_m68hc11_size_stubs): Declare.
3273         (elf32_m68hc11_build_stubs): Declare.
3274
3275         * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c.
3276         (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise.
3277         (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto.
3278         (_bfd_m68hc11_elf_set_private_flags): Ditto.
3279         (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto.
3280         (_bfd_m68hc11_elf_print_private_bfd_data): Ditto.
3281         (bfd_elf32_bfd_link_hash_table_create): Define.
3282         (elf_backend_add_symbol_hook): Define.
3283         (m68hc11_elf_bfd_link_hash_table_create): New function.
3284         (m68hc11_elf_build_one_stub): New function.
3285         (m68hc11_elf_size_one_stub): New function.
3286         (m68hc11_elf_bfd_link_hash_table_create): Install the above.
3287         (bfd_elf32_bfd_link_hash_table_create): Define.
3288
3289         * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove.
3290         (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked.
3291         (m68hc12_phys_addr): Ditto.
3292         (m68hc12_phys_page): Ditto.
3293         (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c.
3294         (elf32_m68hc11_gc_mark_hook): Likewise.
3295         (elf32_m68hc11_gc_sweep_hook): Likewise.
3296         (elf32_m68hc11_check_relocs): Likewise.
3297         (elf32_m68hc11_relocate_section): Likewise.
3298         (_bfd_m68hc12_elf_set_private_flags): Likewise.
3299         (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise.
3300         (_bfd_m68hc12_elf_print_private_bfd_data): Likewise.
3301         (m68hc12_elf_build_one_stub): New function.
3302         (m68hc12_elf_size_one_stub): New function.
3303         (m68hc12_elf_bfd_link_hash_table_create): New function, use the above.
3304         (elf_backend_add_symbol_hook): Define.
3305         (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
3306
3307 2003-04-18  Nick Clifton  <nickc@redhat.com>
3308
3309         * format.c (bfd_check_format_matches): Only check associated
3310         vector if the matching_vector has been created.
3311
3312 2003-04-15  Alexandre Oliva  <aoliva@redhat.com>
3313
3314         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in
3315         2003-04-09's change.
3316
3317 2003-04-15  Brian Ford  <ford@vss.fsi.com>
3318
3319         * peicode.h (coff_swap_scnhdr_in): If a section holds
3320         uninitialized data and is from an object file or from an
3321         executable image that has not initialized the s_size field, or if
3322         the physical size is padded, use the virtual size (stored in
3323         s_paddr) instead.
3324
3325 2003-04-15  H.J. Lu <hjl@gnu.org>
3326
3327         * elflink.h (elf_link_add_object_symbols): Properly report
3328         filename for alignment reduction.
3329
3330 2003-04-15  Rohit Kumar Srivastava <rohits@kpitcummins.com>
3331
3332         * archures.c: Replace occurrances of 'Hitachi' with 'Renesas'.
3333         * reloc.c: Likewise.
3334         * coff-h8300.c: Likewise.
3335         * coff-h8500.c: Likewise.
3336         * coff-sh.c: Likewise.
3337         * cpu-h8300.c: Likewise.
3338         * cpu-sh.c: Likewise.
3339         * elf32-h8300.c: Likewise.
3340         * elf32-sh.c: Likewise.
3341         * elf32-sh64-com.c: Likewise.
3342         * elf32-sh64.c: Likewise.
3343         * elf64-sh64.c: Likewise.
3344         * bfd-in2.h: Regenerate.
3345
3346 2003-04-14  H.J. Lu <hjl@gnu.org>
3347
3348         * elflink.h (elf_link_add_object_symbols): Maintain maximum
3349         alignment for common symbols. Warn reducing alignment for
3350         common symbols. Report old filename when symbol size changes.
3351
3352 2003-04-12  Alexandre Oliva  <aoliva@redhat.com>
3353
3354         * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other
3355         occurrences of the same test changed in the previous patch.
3356         Optimize.
3357
3358 2003-04-11  Alexandre Oliva  <aoliva@redhat.com>
3359
3360         * elfxx-mips.c (mips_elf_get_global_gotsym_index): New.
3361         (mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to
3362         GOT_DISP/addend only if the symbol got a global GOT entry.
3363
3364 2003-04-10  Alexandre Oliva  <aoliva@redhat.com>
3365
3366         * elfxx-mips.c (mips_elf_calculate_relocation): Decay
3367         GOT_PAGE/GOT_OFST referencing overridable symbol to
3368         GOT_DISP/addend.
3369         (_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing
3370         global symbol as GOT_DISP.
3371
3372 2003-04-10  Bob Wilson  <bob.wilson@acm.org>
3373
3374         * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
3375         next relocation on an undefined symbol.
3376
3377 2003-04-09  Richard Henderson  <rth@redhat.com>
3378
3379         * elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
3380         Ignore relocations against r_symndx == 0.
3381
3382 2003-04-09  H.J. Lu <hjl@gnu.org>
3383
3384         * elf64-alpha.c (elf64_alpha_relocate_section): Don't return
3385         FALSE for undefined symbols.
3386         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
3387
3388 2003-04-09  Alexandre Oliva  <aoliva@redhat.com>
3389
3390         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
3391         and IRIX-specific shift-to-64-bit 4-byte lengths before following
3392         addr_size.
3393
3394 2003-04-08  Alexandre Oliva  <aoliva@redhat.com>
3395
3396         * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
3397         pointer size from ABI, not arch_bits_per_address.
3398
3399 2003-04-07  Kevin Buettner  <kevinb@redhat.com>
3400
3401         * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
3402         constants for n32 ABI.
3403
3404 2003-04-06  Andrew Cagney  <cagney@redhat.com>
3405
3406         * simple.c (bfd_simple_get_relocated_section_contents): Disable
3407         free that leads to GDB vs BFD memory corruption.
3408
3409 2003-04-04  Stephane Carrez  <stcarrez@nerim.fr>
3410
3411         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust
3412         symbols that mark the end of the section.
3413         (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when
3414         converting to a relative branch so that the offset is computed after
3415         the relaxation; also relocate a jsr into a bsr if possible but don't
3416         relax them if they are to a far symbol as we need to call the
3417         trampoline code.
3418         (elf_m68hc11_howto_table): Set pcrel_offset to true.
3419
3420 2003-04-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
3421
3422         * archures.c: Namespace cleanup. Rename bfd_mach_c3x to
3423         bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x
3424         * bfd-in2.h: Regenerate
3425         * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/
3426         * cpu-tic4x.c: Ditto
3427
3428 2003-04-03  Nick Clifton  <nickc@redhat.com>
3429
3430         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss
3431         differently for object files and executables.
3432         * peicode.h (coff_swap_scnhdr_in): Only set the s_size field
3433         for object files or for executables who have not already
3434         initialised the field.
3435         * libpei.h (bfd_pe_executable_p): New macro.  Return true if
3436         the PE format bfd is an executable.
3437
3438 2003-04-03  Alan Modra  <amodra@bigpond.net.au>
3439
3440         * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL
3441         here as it's too early to reliably determine locality.
3442         (ppc_elf_gc_sweep_hook): Likewise.
3443         (SYMBOL_REFERENCES_LOCAL): Expand comment.
3444
3445 2003-04-02  Bob Wilson  <bob.wilson@acm.org>
3446
3447         * xtensa-modules.c: Remove comment indicating that this is a
3448         generated file.
3449
3450 2003-04-02  Alan Modra  <amodra@bigpond.net.au>
3451
3452         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
3453
3454 2003-04-01  Bob Wilson  <bob.wilson@acm.org>
3455
3456         * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
3457         (ALL_MACHINES_CFILES): Add cpu-xtensa.c.
3458         (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
3459         xtensa-modules.lo.
3460         (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
3461         xtensa-modules.c.
3462         (cpu-xtensa.lo): New target.
3463         (elf32-xtensa.lo): Likewise.
3464         (xtensa-isa.lo): Likewise.
3465         (xtensa-modules.lo): Likewise.
3466         * Makefile.in: Regenerate.
3467         * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
3468         (bfd_archures_list): Add bfd_xtensa_arch.
3469         * config.bfd: Handle xtensa-*-*.
3470         * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
3471         * configure: Regenerate.
3472         * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
3473         PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
3474         * targets.c (bfd_elf32_xtensa_be_vec): Declare.
3475         (bfd_elf32_xtensa_le_vec): Likewise.
3476         (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
3477         * cpu-xtensa.c: New file.
3478         * elf32-xtensa.c: Likewise.
3479         * xtensa-isa.c: Likewise.
3480         * xtensa-modules.c: Likewise.
3481         * libbfd.h: Regenerate.
3482         * bfd-in2.h: Likewise.
3483
3484 2003-04-01  Nick Clifton  <nickc@redhat.com>
3485
3486         * archures.c (bfd_mach_arm_unknown): Define.
3487         * bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes,
3488         bfd_arm_get_mach_from_notes): Prototype.
3489         * bfd-in2.h: Regenerate.
3490         * coff-arm.c (coff_arm_merge_private_bfd_data): Call
3491         bfd_arm_merge_machines.
3492         (coff_arm_final_link_postscript): Call bfd_arm_update_notes.
3493         * coffcode.h (coff_set_arch_mach_hook): Call
3494         bfd_arm_get_mach_from_notes.
3495         * coffgen.c (coff_real_object_p): Revert previous delta.
3496         * cpu_arm.c (arm_check_note): New function.  Examine a note in a
3497         .note section.
3498         (bfd_arm_merge_machines): New function: Handle the merging of ARM
3499         binaries compiled for different architectures..
3500         (bfd_arm_update_notes): New function: Update an ARM note section.
3501         (bfd_arm_get_mach_from_notes): New function: Extract a bfd machine
3502         number from an ARM note section.
3503         * elf32-arm.h (elf32_arm_object_p): Use
3504         bfd_arm_get_mach_from_notes.
3505         (elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines.
3506         (elf32_arm_final_write_processing): Use bfd_arm_update_notes.
3507
3508 2003-04-01  Ben Elliston  <bje@wasabisystems.com>
3509
3510         * dwarf2.c (read_attribute_value): Correct typo in comment.
3511
3512 2003-04-01  Nick Clifton  <nickc@redhat.com>
3513
3514         * dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
3515         instead of concat().
3516         (decode_line_info): Only free filename if it is not NULL.
3517         (add_line_info): Make a copy of the filename when storing it into
3518         the info structure.
3519
3520 2003-03-31  Andreas Schwab  <schwab@suse.de>
3521             Daniel Jacobowitz  <drow@mvista.com>
3522
3523         * simple.c (bfd_simple_get_relocated_section_contents): Add
3524         parameter symbol_table.  Optionally use it instead of the symbol
3525         table from the bfd.  Save and restore output offsets and output
3526         sections  around bfd_get_relocated_section_contents.  Fix a memory
3527         leak.
3528         (simple_save_output_info, simple_restore_output_info): New
3529         functions.
3530         * bfd-in2.h: Regenerate.
3531         * dwarf2.c (read_abbrevs): Use
3532         bfd_simple_get_relocated_section_contents instead of
3533         bfd_get_section_contents.
3534         (decode_line_info): Likewise.
3535         (_bfd_dwarf2_find_nearest_line): Likewise.  Don't call
3536         find_rela_addend.
3537         (find_rela_addend): Remove.
3538         * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for
3539         debugging sections.
3540         (elfNN_ia64_hash_table_create): Create the hash table with malloc,
3541         not bfd_zalloc.
3542
3543 2003-03-31  David Heine  <dlheine@suif.stanford.edu>
3544
3545         * aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of
3546         bfd_alloc.
3547         * dwarf2.c (concat_filename): Always allocate space for the
3548         returned filename.
3549         (decode_line_info): Free the allocated filename returned by
3550         concat_filename.
3551         * elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks.
3552         * elf.c (copy_private_bfd_data): Likewise.
3553         (_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer.
3554         * elflink.h (elf_link_sort_relocs): Fix memory leak.
3555         * format.c (bfd_check_format_matches): Likewise.
3556         * linker.c (bfd_generic_final_link): Likewise.
3557         * opncls.c (find_separate_debug_info): Likewise.
3558         * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
3559
3560 2003-03-28  H.J. Lu <hjl@gnu.org>
3561
3562         * elflink.h (elf_link_add_object_symbols): Correctly combine
3563         visibilities.
3564
3565 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3566
3567         * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
3568         to -1 before recomputing got offsets.
3569
3570 2003-03-26  Andreas Schwab  <schwab@suse.de>
3571
3572         * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
3573         (elf_m68k_relocate_section): Use it to correctly handle symbols
3574         forced to be local.
3575         (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got
3576         entries for symbols that are forced to be local.
3577
3578 2003-03-25  Alexandre Oliva  <aoliva@redhat.com>
3579
3580         * elfxx-mips.c (_bfd_mips_relax_section): New function.
3581         * elfxx-mips.h (_bfd_mips_relax_section): Declare.
3582         * elfn32-mips.c, elf64-mips.c: Use it.
3583
3584 2003-03-25  Stan Cox   <scox@redhat.com>
3585             Nick Clifton  <nickc@redhat.com>
3586
3587         Contribute support for Intel's iWMMXt chip - an ARM variant:
3588
3589         * archures.c: Add bfd_mach_arm_iWMMXt.
3590         * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2.
3591         * bfd-in2.h: Regenerate.
3592         * libbfd.h: Regenerate.
3593         * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt
3594         object files to be linked with XScale ones.
3595         (coff_arm_final_link_postscript): Update note section.
3596         * coffcode.h (coff_set_arch_mach_hook): Handle note section.
3597         * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook
3598         after identifying a coff binary.
3599         * cpu-arm.c (processors): Add iWMMXt.
3600         (arch_inf): Likewise.
3601         * elf32-arm.h (arm_object_p): Handle note section.
3602         (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to
3603         be linked with XScale ones.
3604         (elf32_arm_section_flags): New function: Set flags on note section.
3605         (elf32_arm_final_write_processing): Handle note section.
3606
3607 2003-03-21  DJ Delorie  <dj@redhat.com>
3608
3609         * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call
3610         _bfd_elf_rela_local_sym.
3611
3612 2003-03-20  H.J. Lu <hjl@gnu.org>
3613
3614         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for
3615         non-ELF outputs.
3616
3617 2003-03-20  Nick Clifton  <nickc@redhat.com>
3618
3619         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and
3620         $idata5 in case bfd_coff_final_link is not called.
3621
3622 2003-03-19  Jakub Jelinek  <jakub@redhat.com>
3623
3624         * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count
3625         field.
3626         (canon_reloc_count): Define.
3627         (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
3628         sparc64_elf_canonicalize_dynamic_reloc): Use it instead of
3629         reloc_count.
3630         (sparc64_elf_canonicalize_reloc): New routine.
3631         (bfd_elf64_canonicalize_reloc): Define.
3632
3633 2003-03-18  Jakub Jelinek  <jakub@redhat.com>
3634
3635         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation
3636         againt mergeable sections.  Take r_addend into account when caching
3637         trampolines.
3638
3639 2003-03-18  Richard Henderson  <rth@redhat.com>
3640
3641         * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
3642         local symbols that have no dyninfo.
3643
3644 2003-03-14  Gene Smith  <gene.smith@siemens.com>
3645
3646         * ieee.c (ieee_write_expression): Handle the case where symbol is
3647         NULL.
3648         General formatting improvements.
3649
3650 2003-03-13  Nick Clifton  <nickc@redhat.com>
3651
3652         * configure.in (LINGUAS): Add zh_CN.
3653         * configure: Regenerate.
3654         * po/zh_CN.po: New file.
3655
3656 2003-03-13  Elias Athanasopoulos  <elathan@phys.uoa.gr>
3657
3658         * aout-cris.c (BYTES_IN_WORD): Don't define.
3659         aout-encap.c: Likewise.
3660         aout-ns32k.c: Likewise.
3661         aout-tic30.c: Likewise.
3662         hp300bsd.c: Likewise.
3663         i386aout.c: Likewise.
3664         i386dynix.c: Likewise.
3665         i386linux.c: Likewise.
3666         i386lynx.c: Likewise.
3667         i386mach3.c: Likewise.
3668         m68k4knetbsd.c: Likewise.
3669         m68klinux.c: Likewise.
3670         m68klynx.c: Likewise.
3671         m68knetbsd.c: Likewise.
3672         m88kmach3.c: Likewise.
3673         mipsbsd.c: Likewise.
3674         newsos3.c: Likewise.
3675         sparclinux.c: Likewise.
3676         sparclynx.c: Likewise.
3677         sparcnetbsd.c: Likewise.
3678         vaxbsd.c: Likewise. Fix comment formatting.
3679
3680 2003-03-12  Alexandre Oliva  <aoliva@redhat.com>
3681
3682         * Reverted 2003-03-02's patch.
3683
3684         * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
3685         overridable.
3686         * elf64-mips.c (mips_elf64_canonicalize_reloc,
3687         mips_elf64_get_dynamic_reloc_upper_bound,
3688         mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
3689         (bfd_elf64_get_canonicalize_reloc,
3690         bfd_elf64_get_dynamic_reloc_upper_bound,
3691         bfd_elf64_canonicalize_dynamic_reloc): Define.
3692         (mips_elf64_slurp_reloc_table): Support dynamic.
3693         (mips_elf64_slurp_one_reloc_table): Adjust.
3694
3695 2003-03-12  Nick Clifton  <nickc@redhat.com>
3696
3697         * xsym.c (bfd_sym_fetch_type_information_table_entry): Change
3698         'index' to 'offset' in test for zero value.
3699
3700 2003-03-11  Alexandre Oliva  <aoliva@redhat.com>
3701
3702         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
3703         dynamic relocations pointing to local or section symbols, use the
3704         NULL symbol instead.  Document the choice to not emit an
3705         additional R_MIPS_64 relocation.
3706
3707 2003-03-11  Alan Modra  <amodra@bigpond.net.au>
3708
3709         * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
3710         zero index dynamic tls relocs generated for the GOT.  Tidy code.
3711         Set "relocation" to 1 on DTPMOD32 relocs.  Optimize HA adjustment.
3712         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3713
3714 2003-03-07  Alan Modra  <amodra@bigpond.net.au>
3715
3716         * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
3717         a tls_get_addr call.
3718
3719         * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
3720         (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
3721         ELF_LINK_NON_GOT_REF from weakdef.
3722         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
3723         (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
3724         ELF_LINK_NON_GOT_REF from weakdef.
3725         * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
3726         (elf_i386_adjust_dynamic_symbol): For weak symbols, copy
3727         ELF_LINK_NON_GOT_REF from weakdef.
3728
3729 2003-03-06  Jakub Jelinek <jakub@redhat.com>
3730         Andrew Haley  <aph@redhat.com>
3731
3732         * elflink.h (elf_bfd_discard_info): Don't process eh frames if
3733         output is relocateable.
3734
3735 2003-03-06  Steven Konopa <skonopa@kgo.csc.com>
3736
3737         * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and
3738         R_COMMENT.
3739
3740 2003-03-06  Alan Modra  <amodra@bigpond.net.au>
3741
3742         * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
3743         error messages.
3744         (ELIMINATE_COPY_RELOCS): Define to zero.
3745         (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
3746         TLSLD relocs.  Report reloc types on a number of errors.  Optimize
3747         LOCAL24PC check for non-local syms.  Don't capitalize error messages.
3748         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
3749         (ppc64_elf_relocate_section): Don't deref htab->tls_sec when
3750         calculating TLSLD relocs.  Report reloc types on a number of errors.
3751         Don't capitalize error messages.
3752
3753 2003-03-03  H.J. Lu <hjl@gnu.org>
3754
3755         * elfxx-ia64.c (USE_BRL): Removed.
3756         (oor_ip): Removed.
3757
3758 2003-03-03  J"orn Rennecke <joern.rennecke@superh.com>
3759
3760         * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
3761         relocation (no special function), and make it non-partial_inplace.
3762         (sh_elf_relax_section): When creating a bsr, use a consistent value
3763         no matter if the symbol is extern or not;  set addend to -4.
3764         Don't swap load / non-load instructions for SH4.
3765         (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
3766         rather than if the symbol is external to determine if adjusting the
3767         offset makes sense.  Adjust the addend too if appropriate.
3768         (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
3769         relocation.
3770
3771 2003-03-03  Nick Clifton  <nickc@redhat.com>
3772
3773         * po/da.po: Installed latest translation.
3774
3775 2003-03-02  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
3776
3777         * elf32-mips.c (elf_mips_howto_table_rel): Change definition of
3778         R_MIPS_PC16 to rightshift 2.
3779         (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
3780         (bfd_elf32_bfd_reloc_type_lookup): Support
3781         BFD_RELOC_MIPSEMB_16_PCREL_S2.
3782         * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
3783         R_MIPS_PC16 to rightshift 2.
3784         (mips_elf64_howto_table_rela): Likewise.
3785         (mips_reloc_map): Map to rightshifted BFD reloc.
3786         * elfn32-mips.c: The same as in elf64-mips.c.
3787         * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
3788         (mips_elf_calculate_relocation): Handle rightshifted addends for
3789         R_MIPS_PC16.
3790         * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
3791         MIPS Embedded PIC. Remove superfluous empty COMMENT.
3792         * libbfd.h: Regenerate.
3793         * bfd-in2.h: Regenerate.
3794
3795 2003-02-28  Richard Henderson  <rth@redhat.com>
3796
3797         * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
3798         for ltoff22x relaxation.
3799
3800 2003-03-01  Alan Modra  <amodra@bigpond.net.au>
3801
3802         * bfd-in.h (_bfd): Don't define.
3803         * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
3804         * syms.c: Likewise.
3805         * bfd-in2.h: Regenerate.
3806
3807 2003-02-27  Richard Henderson  <rth@redhat.com>
3808
3809         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
3810         (elfNN_ia64_check_relocs): Set it.
3811         (allocate_global_data_got): Check it.
3812         (allocate_local_got): Likewise.
3813         (allocate_dynrel_entries): Likewise.
3814         (elfNN_ia64_relax_ldxmov): New.
3815         (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
3816         (elfNN_ia64_choose_gp): Split out from ...
3817         (elfNN_ia64_final_link): ... here.
3818
3819 2003-02-27  Andrew Cagney  <cagney@redhat.com>
3820
3821         * bfd.c (struct bfd): Rename "struct _bfd".
3822         * bfd-in.h: Update copyright.
3823         (struct bfd): Rename "struct _bfd".
3824         (_bfd): Define for backward compatibility.
3825         * bfd-in2.h: Regenerate.
3826
3827 2003-02-25  Alan Modra  <amodra@bigpond.net.au>
3828
3829         * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
3830         and rel_hdr2 when initially counting input relocs rather than after
3831         creating output reloc sections.
3832         (elf_link_read_relocs_from_section): Don't abort with wrong reloc
3833         sizes.
3834
3835         * Makefile.am: Run "make dep-am".
3836         * Makefile.in: Regenerate.
3837
3838 2003-02-24  Kris Warkentin  <kewarken@qnx.com>
3839
3840         * elf.c (elfcore_read_notes): Add check for QNX style core file.
3841         (elfcore_grog_nto_note): New function.
3842         (elfcore_grog_nto_gregs): New function.
3843         (elfcore_grog_nto_status): New function.
3844
3845 2003-02-24  Alan Modra  <amodra@bigpond.net.au>
3846
3847         * elflink.c (_bfd_elf_create_got_section): Check existing .got
3848         section flags before concluding that we've already been called.
3849         Don't use register keyword.
3850         (_bfd_elf_create_dynamic_sections): Don't use register keyword.
3851         (_bfd_elf_create_linker_section): Formatting.
3852
3853 2003-02-20  jmc  <jmc@prioris.mini.pw.edu.pl>
3854
3855         * coff-h8300.c: Fix typo: intial -> initial.
3856         * coff-ppc.c: Likewise.
3857
3858 2003-02-20  Alan Modra  <amodra@bigpond.net.au>
3859
3860         * elf32-ppc.c: Formatting.
3861         (allocate_dynrelocs): LD and GD relocs against the same sym need
3862         separate GOT entries.
3863         (ppc_elf_relocate_section): Correct GOT handling for multiple GOT
3864         entries per symbol.
3865
3866 2003-02-19  Alan Modra  <amodra@bigpond.net.au>
3867
3868         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
3869         removal.  Localize vars.  Remove unnecessary dynobj test.
3870         * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
3871         of INFO.
3872         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3873         and optimize.
3874         (elf_i386_relocate_section): Likewise.
3875         (elf_i386_gc_sweep_hook): Simplify dyn reloc removal.  Localize vars.
3876         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
3877         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
3878         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
3879         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
3880         * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.  Remove
3881         local_dynrel for section too.  Don't touch HIPLT22, LOPLT10, PCPLT32
3882         or PCPLT10 relocs.  Don't subtract twice on PLT32 relocs.
3883         Formatting.
3884
3885         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
3886         (ppc64_elf_check_relocs): Use it.  Correct comment.  Move SEC_ALLOC
3887         test.
3888         (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
3889         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3890         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3891         and optimize.  Use ELIMINATE_COPY_RELOCS.
3892         (ppc64_elf_relocate_section): Likewise.
3893
3894         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
3895         (ppc_elf_copy_indirect_symbol): Copy pc_count field.
3896         (ELIMINATE_COPY_RELOCS): Define.
3897         (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
3898         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3899         (MUST_BE_DYN_RELOC): Define.
3900         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3901         and optimize.  Trim dyn_relocs.
3902         (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
3903         not be used.  Do generate dyn_relocs for copy reloc avoidance.  Keep
3904         track of pc_rel dyn relocs.
3905         (ppc_elf_relocate_section): Remove "will_become_local".  Adjust
3906         WILL_CALL_FINISH_DYNAMIC_SYMBOL use.  Trim dyn relocs as per
3907         allocate_dynrelocs.  Don't recalculate "sec".
3908
3909 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
3910
3911         * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
3912         * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
3913         on invalid LD relocs.
3914         (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
3915         (ppc64_elf_relocate_section): Unify new handling of LD relocs and
3916         tlsld_got entry.  Use IS_PPC64_TLS_RELOC.
3917
3918         * elf32-ppc.h: New file.
3919         * elf32-ppc.c: Include elf32-ppc.h.
3920         (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
3921         (struct ppc_elf_link_hash_entry): Rename "root" to "elf".  Adjust uses.
3922         Add "tls_mask" field.
3923         (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
3924         (struct ppc_elf_link_hash_table): Rename "root" to "elf".  Adjust uses.
3925         Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
3926         sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
3927         Make use of htab shortcuts throughout file.
3928         (ppc_elf_link_hash_newfunc): Init tls_mask field.
3929         (ppc_elf_link_hash_table_create): Init new fields.
3930         (ppc_elf_copy_indirect_symbol): Copy tls_mask.
3931         (ppc_elf_howto_raw): Add tls relocs.
3932         (ppc_elf_reloc_type_lookup): Handle them.
3933         (ppc_elf_unhandled_reloc): New function.
3934         (ppc_elf_create_got): Stash got section pointer in hash table,
3935         return status.  Make .rela.got too.
3936         (ppc_elf_create_dynamic_sections): Stash section pointers in htab.
3937         (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
3938         NON_GOT_REF set.  Don't allocate space in .plt here..
3939         (allocate_dynrelocs): ..do so here instead, properly ref-counting and
3940         not allocating plt entries unnecessarily.  Allocate got entries here.
3941         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
3942         (ppc_elf_size_dynamic_sections): Allocate local got entries.  Pass
3943         "info" during allocate_dynrelocs hash traversal.  Use htab section
3944         shortcuts rather than searching for named sections.  Get rid of
3945         "plt" and "strip" booleans.
3946         (update_local_sym_info, bad_shared_reloc): New functions.
3947         (ppc_elf_check_relocs): Handle TLS relocs.  Move .rela.got creation to
3948         ppc_elf_create_got.  Don't mark got or plt reloc syms dynamic, do so
3949         in allocate_dynreloc.  Use update_local_sym_info and bad_shared_reloc.
3950         Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16,
3951         R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA
3952         in shared libs.  R_PPC_PLTREL32 is a plt reloc too.  Refcount all
3953         relocs that might use a plt entry.  Set NON_GOT_REF too.
3954         Enumerate all do-nothing relocs.
3955         (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs.  Handle
3956         tls relocs and all plt relocs.
3957         (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions.
3958         (ppc_elf_finish_dynamic_symbol): Don't build got entries here.
3959         (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab
3960         shortcuts.
3961         (ppc_elf_relocate_section): Tidy.  Handle TLS relocs.  Use
3962         bfd_elf_local_sym_name.  Simplify unresolved reloc code.  Build got
3963         entries and got relocs here.  Warn on non-zero got reloc addend.
3964         Split out branch taken/not taken reloc code into a separate switch
3965         and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs.
3966         Split out HA reloc adjustments to separate switch statement.  Don't
3967         warn on reloc overflow if we've already warned about undefined.
3968         Don't rebuild sym name when reporting errors.  Report all possible
3969         errors from _bfd_final_link_relocate.
3970         (bfd_elf32_bfd_final_link): Don't define.
3971
3972 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
3973
3974         * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r".  Don't
3975         rebuild sym name when reporting errors.
3976
3977 2003-02-17  Nick Clifton  <nickc@redhat.com>
3978
3979         * elflink.h (elf_link_output_extsym): Only check
3980         allow_shlib_undefined for shared libraries.
3981         * elf32-i386.c (elf_i386_relocate_section): Remove bogus check
3982         of allow_shlib_undefined.
3983         * elf32-cris.c (cris_elf_relocate_section): Likewise.
3984         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
3985         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
3986         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
3987         * elf32-s390.c (elf_s390_relocate_section): Likewise.
3988         * elf32-sh.c (sh_elf_relocate_section): Likewise.
3989         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
3990         * elf32-vax.c (elf_vax_relocate_section): Likewise.
3991         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
3992         * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
3993         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3994         * elf64-s390.c (elf_s390_relocate_section): Likewise.
3995         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
3996         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
3997         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
3998         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
3999
4000 2003-02-17  Nick Clifton  <nickc@redhat.com>
4001
4002         * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the
4003         address field to use in the comparison.
4004         (SEGMENT_OVERLAPS): Check that LMAs overlap as well.
4005
4006 2003-02-14  Bob Wilson  <bob.wilson@acm.org>
4007
4008         * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF
4009         backends when checking if the generic ELF target should be used.
4010
4011         * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs
4012         outside of functions, treat values as absolute addresses.
4013
4014         * bfd.c: Change embedded documentation to use consistent indentation
4015         and to split up long lines.  Change informal style of description
4016         for functions lacking real documentation.
4017         * coffcode.h: Break up long lines in embedded documentation.
4018         * format.c: Likewise.
4019         * targets.c: Likewise.
4020         * libcoff.h: Regenerate.
4021         * bfd-in2.h: Regenerate.
4022
4023 2003-02-14  Alan Modra  <amodra@bigpond.net.au>
4024
4025         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
4026         (ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
4027         (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
4028         (allocate_dynrelocs): Don't treat undefined and undefweak specially.
4029         (ppc_size_one_stub): Fix warning, and tighten plt entry check.
4030         (group_sections): Don't share a stub section if stubs are for a large
4031         section.  Adjust comment.
4032         (ppc64_elf_size_stubs): Roughly double the size left for stubs if
4033         !stubs_always_before_branch.
4034         (ppc64_elf_relocate_section): Initialize tlsld GOT entry once.  Don't
4035         treat undefined and undefweak specially when processing dyn relocs.
4036
4037 2003-02-13  Jakub Jelinek  <jakub@redhat.com>
4038
4039         * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
4040
4041 2003-02-13  Nick Clifton  <nickc@redhat.com>
4042
4043         * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs
4044         in computation of offset to insert into BL instruction.
4045
4046 2003-02-11  Uwe Stieber  <uwe@wwws.de>
4047
4048         * config.bfd: Add support for kaOS as cross build target system.
4049
4050 2003-02-11  Alan Modra  <amodra@bigpond.net.au>
4051
4052         * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
4053         .__tls_get_addr too.
4054         (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
4055
4056 2003-02-10  Kaz kojima  <kkojima@rr.iij4u.or.jp>
4057
4058         * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
4059         (elf_sh_link_hash_entry): Remove tls_tpoff32 field.
4060         (sh_elf_link_hash_newfunc): Remove the initialization of
4061         tls_tpoff32 field.
4062         (allocate_dynrelocs): Keep dyn_relocs if it includes the entry
4063         for which tls_tpoff32 flag is set.
4064         (sh_elf_relocate_section): Covert to LE only if the dyn_relocs
4065         of the symbol includes the entry matched with the input_section
4066         and having tls_tpoff32 flag on.  When linking statically, set
4067         symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
4068         is defined in this executable.
4069         (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
4070
4071 2003-02-10  Jakub Jelinek  <jakub@redhat.com>
4072
4073         * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
4074         even if there is just non-empty .rela.plt.
4075
4076 2003-02-10  Nick Clifton  <nickc@redhat.com>
4077
4078         * archures.c (bfd_mach_arm_ep9312): Define.
4079         * bfd-in2.h: Regenerate.
4080         * cpu-arm.c (processors[]): Add ep9312.
4081         (bfd_arm_arch): Add ep9312.
4082         * elf32-arm.h (elf32_arm_merge_private_data): Update error
4083         messages and add test for Maverick floating point support.
4084         (elf32_arm_print_private_bfd_data): Handle
4085         EF_ARM_MAVERICK_FLOAT flag.
4086         (elf32_arm_object_p): New function.
4087         (elf_backend_object_p): Define.
4088
4089 2003-02-10  Alan Modra  <amodra@bigpond.net.au>
4090
4091         * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
4092         variables, structure fields or function params to tls_mask or
4093         similar to better reflect usage.
4094         (struct got_entry): Comment.
4095         (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*.
4096         (get_tls_mask): Rename from get_tls_type.
4097
4098 2003-02-09  Alan Modra  <amodra@bigpond.net.au>
4099
4100         * elf64-ppc.c (TLS_GD_LD): Don't define..
4101         (TLS_GD): ..define this instead and update all uses.
4102         (TLS_TPRELGD): Define.
4103         (ppc64_elf_link_hash_table_create): Tweak initialization of
4104         init_refcount and init_offset.
4105         (ppc64_elf_check_relocs): Add one extra element to t_symndx array.
4106         Mark second slot of GD or LD toc entries.
4107         (get_tls_type): Return an int.  Distinguish toc GD and LD entries
4108         from other tls types.
4109         (ppc64_elf_tls_setup): New function, split out from..
4110         (ppc64_elf_tls_optimize): ..here.  Don't optimize when symbols are
4111         defined in a dynamic object.  Fix LD optimization.  Don't set TLS_TPREL
4112         on GD->IE optimization, use TLS_TPRELGD instead.  Use get_tls_type
4113         return value to properly decide whether toc GD and LD entries can
4114         optimize away __tls_get_addr call.  Check next reloc after DTPMOD64
4115         to determine GD or LD rather than looking at TLS_LD flag.  Don't
4116         attempt to adjust got entry tls_type here..
4117         (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
4118         look for possible merges.
4119         (ppc64_elf_size_dynamic_sections): Adjust local got entries for
4120         optimization.
4121         (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
4122         (ppc64_elf_relocate_section): Rename some vars to better reflect usage.
4123         Make use of return value from get_tls_type to properly detect GD and
4124         LD optimizations.  Split tlsld/gd hi/ha from lo/ds case.  Don't
4125         handle tls_get_addr removal when looking at REL24 relocs, do it when
4126         looking at the previous reloc.  Check reloc after DTPMOD64 to determine
4127         GD or LD.
4128         * elf64-ppc.h (ppc64_elf_tls_setup): Declare.
4129
4130 2003-02-08  Alan Modra  <amodra@bigpond.net.au>
4131
4132         * elf32-hppa.c (group_sections): Don't share a stub section if
4133         stubs are for a large section.
4134
4135         * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for
4136         stubs if !stubs_always_before_branch.
4137
4138 2003-02-07  Nick Clifton  <nickc@redhat.com>
4139
4140         * elf.c (swap_out_syms): Generate an error message if an
4141         equivalent output section cannot be found for a symbol.
4142
4143 2003-02-07  Jakub Jelinek  <jakub@redhat.com>
4144
4145         * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
4146         local_got_entries is NULL.
4147
4148 2003-02-06  Andreas Schwab  <schwab@suse.de>
4149
4150         * elf-eh-frame.c (get_DW_EH_PE_signed): Define.
4151         (read_value): Add parameter is_signed, use signed extraction if
4152         the value is signed.
4153         (_bfd_elf_write_section_eh_frame): Pass signed flag of the
4154         encoding to read_value.
4155
4156 2003-02-06  Alan Modra  <amodra@bigpond.net.au>
4157
4158         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and
4159         plt info when called to transfer weak sym info.
4160
4161 2003-02-05  Alan Modra  <amodra@bigpond.net.au>
4162
4163         * reloc.c: Add PPC and PPC64 TLS relocs.
4164         * libbfd.h: Regenerate.
4165         * bfd-in2.h: Regenerate.
4166         * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare.
4167         (ppc64_elf_howto_raw): Add TLS howto's.  Adjust R_PPC64_NONE to be
4168         against a 32 bit field.
4169         (ppc64_elf_reloc_type_lookup): Handle TLS relocs.
4170         (_ppc64_elf_section_data): Add t_symndx and comments.
4171         (ppc64_elf_section_data): Use elf_section_data macro.
4172         (ppc64_elf_new_section_hook): American spelling.
4173         (struct got_entry, struct plt_entry): New.
4174         (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC.
4175         (struct ppc_stub_hash_entry): Add "addend" field.
4176         (struct ppc_link_hash_entry): Add "tls_type".
4177         (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL,
4178         TLS_EXPLICIT): Define.
4179         (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got.
4180         (link_hash_newfunc): Init new fields.
4181         (ppc64_elf_link_hash_table_create): Likewise.  Set init_refcount and
4182         init_offset to NULL.
4183         (ppc64_elf_copy_indirect_symbol): Copy got and plt info.  Don't call
4184         _bfd_elf_link_hash_copy_indirect, rather insert relevant code from
4185         there.
4186         (update_local_sym_info, update_plt_info): New functions.
4187         (ppc64_elf_check_relocs): Use them.  Handle TLS relocs.  Adjust GOT
4188         handling to use got.glist rather than got.refcount.  Likewise for PLT.
4189         (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists.
4190         (func_desc_adjust): Adjust for new PLT list.
4191         (ppc64_elf_adjust_dynamic_symbol): Likewise.
4192         (get_sym_h, get_tls_type): New functions.
4193         (ppc64_elf_edit_opd): Remove unused variable.  Use get_sym_h.
4194         (ppc64_elf_tls_optimize): New function.
4195         (allocate_dynrelocs): Adjust for new PLT and GOT lists.  Allocate
4196         TLS relocs.
4197         (ppc64_elf_size_dynamic_sections): Likewise.
4198         (ppc_type_of_stub): Adjust for new PLT list.
4199         (ppc_build_one_stub): Likewise.
4200         (ppc64_elf_size_stubs): Likewise.  Use get_sym_h.  Treat __tls_get_addr
4201         calls specially.
4202         (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists.  Handle
4203         TLS relocs.  Report local syms using bfd_elf_local_sym_name.  Don't
4204         init GOT entries that have a reloc.  Generate GOT relocs here..
4205         (ppc64_elf_finish_dynamic_symbol): ..not here.  Adjust for PLT list.
4206         * elf64-ppc.h (ppc64_elf_tls_optimize): Declare.
4207
4208 2003-02-04  Andreas Schwab  <schwab@suse.de>
4209
4210         * elf32-m68k.c (elf_m68k_hash_entry): Define.
4211         (elf_m68k_link_hash_traverse): Remove.
4212         (elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and
4213         elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to
4214         reduce casting.
4215         (elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of
4216         casting.
4217         (elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse
4218         instead of elf_m68k_link_hash_traverse.
4219         (elf_m68k_discard_copies): Change first parameter to pointer to
4220         struct elf_link_hash_entry and use elf_m68k_hash_entry when struct
4221         elf_m68k_link_hash_entry is needed.
4222
4223 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
4224
4225         * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare.
4226         (struct elf_link_hash_entry): Add "glist" and "plist" fields to
4227         "got" union, and declare as gotplt_union.  Use gotplt_uinion for
4228         "plt" field.
4229         (struct elf_link_hash_table): Make "init_refcount" a gotplt_union.
4230         Add "init_offset" field.
4231         (struct elf_obj_tdata <local_got>): Add "struct got_entry **" to union.
4232         (elf_local_got_ents): Declare.
4233         * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got"
4234         and "plt".
4235         (_bfd_elf_link_hash_hide_symbol): Use "init_offset".
4236         (_bfd_elf_link_hash_table_init): Set "init_offset".
4237         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount
4238         from init_offset.
4239         (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset.
4240
4241         * elf.c (bfd_elf_local_sym_name): Split out from..
4242         (group_signature): ..here.
4243         * elf-bfd.h (bfd_elf_local_sym_name): Declare.
4244
4245 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
4246
4247         * elf-bfd.h (enum elf_link_info_type): Remove.
4248         (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields
4249         to struct sec.  Remove linkonce_p field.
4250         (elf_linkonce_p): Delete.
4251         (elf_discarded_section): Update for sec_info_type change.
4252         * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc,
4253         flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24.
4254         (ELF_INFO_TYPE_NONE): Define.
4255         (ELF_INFO_TYPE_STABS): Define.
4256         (ELF_INFO_TYPE_MERGE): Define.
4257         (ELF_INFO_TYPE_EH_FRAME): Define.
4258         (ELF_INFO_TYPE_JUST_SYMS): Define.
4259         (STD_SECTION): Update struct sec initializer.
4260         * ecoff.c (bfd_debug_section): Likewise.
4261         * elf.c: Likewise.  Update occurrences of sec_info_type and use_rela_p.
4262         * elflink.h: Likewise.
4263         * elf-eh-frame.c: Likewise.
4264         * elf64-alpha.c: Likewise.
4265         * elfxx-ia64.c: Likewise.
4266         * elfxx-mips.c: Likewise.
4267         * bfd-in2.h: Regenerate.
4268
4269         * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than
4270         referring to used_by_bfd.
4271         * elf64-sparc.c (sec_do_relax): Likewise.
4272         * elf64-mmix.c (mmix_elf_section_data): Likewise.
4273         * elfxx-mips.c (mips_elf_section_data): Likewise.
4274         * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro.
4275         (ieee_get_section_contents): Likewise.
4276         (ieee_new_section_hook): Formatting.
4277         (ieee_canonicalize_reloc): Remove commented out code.
4278         * mmo.c (mmo_section_data): Define.  Use throughout file.
4279         * oasys.c (oasys_get_section_contents): Use oasys_per_section macro.
4280
4281 2003-01-31  Graydon Hoare <graydon@redhat.com>
4282
4283         * Makefile.am (opncls.lo): Add dependency upon libiberty.h.
4284         * Makefile.in: Regenerate.
4285         * opncls.c (calc_crc32, get_debug_link_info,
4286         seperate_debug_file_exists, find_seperate_debug_file): New
4287         internal functions.
4288         (bfd_follow_gnu_debuglink): New function.  Follow the pointer
4289         contained inside a .gnu_debuglink section.
4290         * bfd-in2.h: Regenerate.
4291
4292 2003-01-29  Alexandre Oliva  <aoliva@redhat.com>
4293
4294         * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference
4295         entry->abfd when it's NULL.
4296
4297 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
4298
4299         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle
4300         _bfd_elf_section_offset returning -2 the same way as -1.
4301
4302         * elfxx-mips.c (mips_elf_multi_got): New function.
4303         (struct mips_got_entry): Make symndx and gotidx signed.  Moved
4304         addend into union along with address and link hash entry.
4305         (struct mips_got_info): Added bfd2got and next.
4306         (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx.
4307         (mips_elf_got_section, mips_elf_create_got_section): Use
4308         SEC_EXCLUDE bit to tell whether we really need the got
4309         section.  Take boolean arguments to disregard an excluded
4310         section, or to create it as excluded.  Adjust all callers.
4311         Use mips_elf_got_section all over.
4312         (mips_elf_local_got_index, mips_elf_got_page,
4313         mips_elf_got16_entry): Take input bfd as argument, and pass it
4314         on to mips_elf_create_local_got_entry.
4315         (mips_elf_global_got_index, mips_elf_create_local_got_entry):
4316         Take input bfd as argument, and manage entries in the
4317         appropriate GOT.
4318         (mips_elf_got_offset_from_index): Take input bfd as argument,
4319         and use it to adjust the GP offset of the bfd.
4320         (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move
4321         unreferenced GOT entries of global symbols to the end.
4322         (mips_elf_record_global_got_symbol): Take input bfd as
4323         argument.  Add entries to the master GOT hash table.
4324         (struct mips_elf_bfd2got_hash): New.
4325         (struct mips_elf_got_per_bfd_arg): New.
4326         (struct mips_elf_set_global_got_offset_arg): New.
4327         (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash,
4328         mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash,
4329         mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd,
4330         mips_elf_merge_gots, mips_elf_set_global_got_offset,
4331         mips_elf_resolve_final_got_entry,
4332         mips_elf_resolve_final_got_entries, mips_elf_adjust_gp,
4333         mips_elf_got_for_ibfd): New functions.
4334         (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT.
4335         (MIPS_ELF_GOT_MAX_SIZE): New macro.
4336         (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT.
4337         (mips_elf_got_entry_hash): Take new fields into account.  Use
4338         mips_elf_hash_bfd_vma.
4339         (mips_elf_got_entry_eq): Take new fields into account.
4340         (mips_elf_create_got_section): Initialize new fields.
4341         (mips_elf_calculate_relocation): Pass input_bfd to functions
4342         that now take it.  Adjust gp for the input_bfd.
4343         (mips_elf_allocate_dynamic_relocation,
4344         mips_elf_create_dynamic_relocation,
4345         _bfd_mips_elf_create_dynamic_sections): Use...
4346         (mips_elf_rel_dyn_section): New function.  Borrow code from...
4347         (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that
4348         now take it.  Create the got section if needed, even if
4349         excluded, before recording a global got symbol.  Move some
4350         code to...
4351         (mips_elf_record_local_got_symbol): New fn.
4352         (_bfd_mips_elf_size_dynamic_sections): Disable combreloc.
4353         Compute multi-got global entries offsets.  Move GOT code to...
4354         (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got
4355         if the GOT is too big.
4356         (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of
4357         undefweak symbol to zero.  Generate dynamic relocations for
4358         non-primary GOT entries for global symbols.
4359         (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got
4360         case.  Generate dynamic relocations for local got entries.
4361         Sort dynamic relocations on N64 too, using...
4362         (sort_dynamic_relocs_64): New fns.
4363         (_bfd_mips_elf_hide_symbol): Adjust multi-got counters.
4364         (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT.
4365
4366 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
4367
4368         * bfd.c (struct _bfd): Added id field.
4369         * opncls.c (_bfd_id_counter): New static variable.
4370         (_bfd_new_bfd): Use it.
4371         * bfd-in2.h: Rebuilt.
4372
4373 2003-01-25  Alan Modra  <amodra@bigpond.net.au>
4374
4375         * elf32-sparc.c (bfd_elf32_new_section_hook): Define.
4376
4377 2003-01-25  Jakub Jelinek  <jakub@redhat.com>
4378
4379         * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs.
4380         (elf32_sparc_rev32_howto): New variable.
4381         (sparc_reloc_map): Add TLS relocs.
4382         (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto):
4383         Handle REV32.
4384         (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject):
4385         New functions.
4386         (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry,
4387         struct elf32_sparc_link_hash_table):
4388         New structures.
4389         (elf32_sparc_tdata, elf32_sparc_local_got_tls_type,
4390         elf32_sparc_hash_table): Define.
4391         (link_hash_newfunc, elf32_sparc_link_hash_table_create,
4392         create_got_section, elf32_sparc_create_dynamic_sections,
4393         elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New
4394         functions.
4395         (elf32_sparc_check_relocs): Handle TLS relocs.  Add dynamic reloc
4396         reference counting.
4397         (elf32_sparc_gc_sweep_hook): Likewise.
4398         (elf32_sparc_adjust_dynamic_symbol): Likewise.
4399         (elf32_sparc_size_dynamic_sections): Likewise.
4400         (elf32_sparc_relocate_section): Likewise.
4401         (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff):
4402         New functions.
4403         (elf32_sparc_object_p): Allocate backend private object data.
4404         (bfd_elf32_bfd_link_hash_table_create,
4405         elf_backend_copy_indirect_symbol, bfd_elf32_mkobject,
4406         elf_backend_can_refcount): Define.
4407         (elf_backend_create_dynamic_sections): Define to
4408         elf32_sparc_create_dynamic_sections.
4409         * reloc.c: Add SPARC TLS relocs.
4410         * bfd-in2.h, libbfd.h: Rebuilt.
4411         * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs.
4412         (sparc_reloc_map): Likewise.
4413
4414 2003-01-24  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4415
4416         * bfd-in2.h: Regenerate.
4417         * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition,
4418         s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions.
4419         (elf_howto_table): Add TLS relocs.
4420         (elf_s390_reloc_type_lookup): Likewise.
4421         (elf_s390_link_hash_entry): Add tls_type.
4422         (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type):
4423         New macros.
4424         (elf_s390_link_hash_table): Add tls_ldm_got.
4425         (link_hash_newfunc): Initialize tls_type.
4426         (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got.
4427         (elf_s390_copy_indirect_symbol): Copy tls_type information.
4428         (elf_s390_check_relocs): Support TLS relocs.
4429         (elf_s390_gc_sweep_hook): Likewise.
4430         (allocate_dynrelocs): Likewise.
4431         (elf_s390_size_dynamic_sections): Likewise.
4432         (elf_s390_relocate_section): Likewise.
4433         (elf_s390_finish_dynamic_symbol): Likewise.
4434         (bfd_elf32_mkobject): Define for TLS.
4435         * elf64-s390.c: Same changes as for elf32-s390.c.
4436         * libbfd.h: Regenerate.
4437         * reloc.c: Add s390 TLS relocations.
4438
4439 2003-01-24  Charles Lepple  <clepple@ghz.cc>
4440
4441         * aclocal.m4: Fix name of --enable-install-libbfd switch.
4442
4443 2003-01-23  Nick Clifton  <nickc@redhat.com>
4444
4445         * Add sh2e support:
4446         2002-04-02  Elena Zannoni  <ezannoni@redhat.com>
4447         * archures.c (bfd_mach_sh2e): Added.
4448         * bfd-in2.h: Rebuilt.
4449         * cpu-sh.c (arch_info_struct): Added SH2e.
4450         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E.
4451
4452 2003-01-23  Alan Modra  <amodra@bigpond.net.au>
4453
4454         * elf-bfd.h (struct bfd_elf_section_data): Remove tdata.  Change
4455         dynindx to an int.  Rearrange for better packing.
4456         * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
4457         * elf32-mips.c (bfd_elf32_new_section_hook): Define.
4458         * elf32-sh64.h: New.  Split out from include/elf/sh.h.
4459         (struct _sh64_elf_section_data): New struct.
4460         (sh64_elf_section_data): Don't dereference sh64_info (was tdata).
4461         * elf32-sh64-com.c: Include elf32-sh64.h.
4462         * elf32-sh64.c: Likewise.
4463         (sh64_elf_new_section_hook): New function.
4464         (bfd_elf32_new_section_hook): Define.
4465         (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
4466         (sh64_bfd_elf_copy_private_section_data): Likewise.
4467         (sh64_elf_final_write_processing): Likewise.
4468         * elf32-sparc.c (struct elf32_sparc_section_data): New.
4469         (elf32_sparc_new_section_hook): New function.
4470         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
4471         (sec_do_relax): Define.
4472         (elf32_sparc_relax_section): Adjust to use sec_do_relax.
4473         (elf32_sparc_relocate_section): Likewise.
4474         * elf64-mips.c (bfd_elf64_new_section_hook): Define.
4475         * elf64-mmix.c (struct _mmix_elf_section_data): New.
4476         (mmix_elf_section_data): Define.  Use throughout file.
4477         (mmix_elf_new_section_hook): New function.
4478         (bfd_elf64_new_section_hook): Define.
4479         * elf64-ppc.c (struct _ppc64_elf_section_data): New.
4480         (ppc64_elf_section_data): Define.  Use throughout.
4481         (ppc64_elf_new_section_hook): New function.
4482         (bfd_elf64_new_section_hook): Define.
4483         * elf64-sparc.c (struct sparc64_elf_section_data): New.
4484         (sparc64_elf_new_section_hook): New function.
4485         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
4486         (sec_do_relax): Define.
4487         (sparc64_elf_relax_section): Adjust to use sec_do_relax.
4488         (sparc64_elf_relocate_section): Likewise.
4489         (bfd_elf64_new_section_hook): Define.
4490         * elfn32-mips.c (bfd_elf32_new_section_hook): Define.
4491         * elfxx-mips.c (struct _mips_elf_section_data): New.
4492         (mips_elf_section_data): Define.  Use throughout.
4493         (_bfd_mips_elf_new_section_hook): New function.
4494         (mips_elf_create_got_section): Don't alloc used_by_bfd.
4495         * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
4496         * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
4497         * Makefile.am: Run "make dep-am".
4498         * Makefile.in: Regenerate.
4499
4500 2003-01-21  Richard Henderson  <rth@redhat.com>
4501
4502         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New.
4503         (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value.
4504         (elf64_alpha_adjust_dynamic_symbol): Set them.
4505         (elf64_alpha_size_plt_section_1): Reset them when plt entry removed.
4506         (elf64_alpha_relax_tls_get_addr): Handle LDM relocs.  Frob the
4507         symbol index when relaxing LDM to TPREL.
4508         (elf64_alpha_relax_section): Likewise.  Allow relaxation of GD
4509         relocs, even if the target isn't locally defined.
4510         (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero.
4511         (elf64_alpha_relocate_section): Likewise.  Force TP-relative
4512         relocs vs symndx 0 to the tp base.
4513
4514 2003-01-21  Fabio Alemagna  <falemagn@aros.org>
4515
4516         * config.bfd: Handle i[3456]86-*-aros*.
4517
4518 2003-01-21  Andreas Schwab  <schwab@suse.de>
4519
4520         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define.
4521         (struct ppc_elf_link_hash_entry): Define.
4522         (ppc_elf_hash_entry): New function.
4523         (struct ppc_elf_link_hash_table): Define.
4524         (ppc_elf_hash_table): New function.
4525         (ppc_elf_link_hash_newfunc): New function.
4526         (ppc_elf_link_hash_table_create): New function.
4527         (ppc_elf_copy_indirect_symbol): New function.
4528         (allocate_dynrelocs): New function.
4529         (readonly_dynrelocs): New function.
4530         (ppc_elf_size_dynamic_sections): Allocate space for dynamic
4531         relocs and determine DT_TEXTREL.
4532         (ppc_elf_check_relocs): Don't do that here, just count the
4533         dynamic relocs.
4534         (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the
4535         removed section.
4536         (bfd_elf32_bfd_link_hash_table_create): Define.
4537         (elf_backend_copy_indirect_symbol): Define.
4538
4539 2003-01-21  Richard Henderson  <rth@redhat.com>
4540
4541         * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and
4542         TPREL also get a reloc if shared.  Remove SREL support.
4543         (elf64_alpha_emit_dynrel): New.
4544         (elf64_alpha_relocate_section): Use it.  Resolve dynamic TPREL
4545         and GOTTPREL relocs to local symbols against the tp base.
4546         (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel.
4547
4548         * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got
4549         use count before clobbering r_type.
4550         (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn
4551         ordering would mean dataflow inspection is necessary.
4552
4553 2003-01-20  Svein E. Seldal  <Svein.Seldal@solidas.com>
4554
4555         * coffcode.h (coff_set_flags): Added get/set arch hooks.
4556
4557 2003-01-20  Fabio Alemagna  <falemagn@aros.org>
4558
4559         * elf32-sh.c: Treat elfNN_bed like other macros defined in
4560           elfxx-target.h and #undef it before #define'ing it.
4561         * elf32-i386.c: Likewise.
4562         * elf32-sh64.c: Likewise.
4563         * elf64-alpha.c: Likewise.
4564         * elf64-sh64.c: Likewise.
4565
4566 2003-01-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4567
4568         * bfd-in2.h: Regenerate.
4569         * elf32-s390.c (elf_s390_adjust_gotplt): New prototype.
4570         (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add
4571         R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16,
4572         R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16,
4573         R_390_PLTOFF32 and R_390_PLTOFF64.
4574         (elf_s390_reloc_type_lookup): Likewise.
4575         (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track
4576         of GOTPLT references to a function.
4577         (link_hash_newfunc): Initialize gotplt_refcount.
4578         (elf_s390_check_relocs): Move allocation of local_got_refcounts array
4579         and creation of the got section out of the main switch. Add support
4580         for the gotoff, gotplt and pltoff relocations.
4581         (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt
4582         and pltoff.
4583         (elf_s390_adjust_gotplt): New function.
4584         (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed
4585         plt entries.
4586         (allocate_dynrelocs): Add comment.
4587         (elf_s390_relocate_section): Change r_type to unsigned. Add support
4588         for gotoff, gotplt and pltoff relocations.
4589         * elf64-s390.c: Same changes as for elf32-s390.c.
4590         * libbfd.h: Regenerate.
4591         * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12,
4592         BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64,
4593         BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32
4594         and BFD_RELOC_390_PLTOFF64.
4595
4596 2003-01-18  Jakub Jelinek  <jakub@redhat.com>
4597
4598         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
4599         R_IA64_TPREL64[LM]SB against non-global symbol properly.
4600
4601 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
4602
4603         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add
4604         self_dtpmod_done and self_dtpmod_offset.
4605         (allocate_global_data_got): Only use one got entry for all
4606         dtpmod relocs against local symbols.
4607         (allocate_dynrel_entries): Only need .rela.got entry for
4608         dtpmod against global symbol.
4609         (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset.
4610         Reserve space in .rela.got for the local dtpmod entry.
4611         (set_got_entry): Initialize the common local dtpmod .got entry.
4612         (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB
4613         and R_IA_64_DTPREL64MSB.
4614
4615 2003-01-16  Alan Modra  <amodra@bigpond.net.au>
4616
4617         * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h.
4618         (R_PPC_*): Rename all occurrences to R_PPC64_*.
4619         (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30.
4620         (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type.
4621         (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other
4622         relative relocs, not with absolute ones.
4623         * Makefile.am: Run "make dep-am".
4624         * Makefile.in: Regenerate.
4625         * po/SRC-POTFILES.in: Regenerate.
4626
4627 2003-01-15  Andreas Schwab  <schwab@suse.de>
4628
4629         * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a
4630         relocation against a non-allocated readonly section.
4631
4632 2003-01-10  Alan Modra  <amodra@bigpond.net.au>
4633
4634         * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
4635         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.  PLTGOT16_HA too.
4636
4637 2002-01-08  Klee Dienes  <kdienes@apple.com>
4638
4639         * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
4640         (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
4641         * Makefile.in: Regenerate.
4642
4643 2003-01-08  Alexandre Oliva  <aoliva@redhat.com>
4644
4645         * elfn32-mips.c (prev_reloc_section): New.
4646         (GET_RELOC_ADDEND): Use it.  Parenthesize macro arguments.
4647         (SET_RELOC_ADDEND): Parenthesize macro argument.
4648
4649 2003-01-07  John David Anglin  <dave.anglin@nrc.gc.ca>
4650
4651         * elf32-hppa.c (final_link_relocate): For all DP relative relocations,
4652         adjust addil instructions if the symbol has no section.
4653
4654 2003-01-07  DJ Delorie  <dj@redhat.com>
4655
4656         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not
4657         partial_inplace.
4658
4659 2003-01-07  Andreas Schwab  <schwab@suse.de>
4660
4661         * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for
4662         PC relative relocations.
4663         (elf_m68k_discard_copies): Set it here instead.
4664
4665 2002-01-02  Ben Elliston  <bje@redhat.com>
4666             Jeff Johnston  <jjohnstn@redhat.com>
4667
4668         * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo.
4669         (ALL_MACHINES_CFILES): Add cpu-iq2000.c.
4670         (BFD32_BACKENDS): Add elf32-iq2000.lo.
4671         (BFD32_BACKENDS_CFILES): Add elf32-iq2000.c.
4672         (cpu-iq2000.lo): New target.
4673         * Makefile.in: Regenerate.
4674         * config.bfd: Handle iq2000-*-elf.
4675         * archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000.
4676         (bfd_archures_list): Add bfd_iq2000_arch.
4677         * configure.in: Handle bfd_elf32_iq2000_vec.
4678         * configure: Regenerate.
4679         * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
4680         and BFD_RELOC_IQ2000_UHI16.
4681         * targets.c (bfd_elf32_iq2000_vec): Declare.
4682         (bfd_target_vector): Add bfd_elf32_iq2000_vec.
4683         * elf.c (prep_headers): Set e_machine to EM_IQ2000.
4684         * cpu-iq2000.c: New file.
4685         * elf32-iq2000.c: Likewise.
4686         * libbfd.h: Regenerate.
4687         * bfd-in2.h: Likewise.
4688
4689 2003-01-02  Richard Sandiford  <rsandifo@redhat.com>
4690
4691         * elfxx-mips.c: Include libiberty.h.
4692         (elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove.
4693         (mips_set_isa_flags): New function, split out from...
4694         (_bfd_mips_elf_final_write_processing): ...here.  Only call
4695         mips_set_isa_flags if the EF_MIPS_MACH bits are clear.
4696         (mips_mach_extensions): New array.
4697         (mips_32bit_flags_p): New function.
4698         (_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks.
4699         Use mips_32bit_flags_p to check if one binary is 32-bit and the
4700         other is 64-bit.  When adopting IBFD's architecture, adopt the
4701         bfd_mach as well as the flags.
4702
4703 2003-01-02  Nick Kelsey  <nickk@ubicom.com>
4704
4705         * elf32-ip2k.c: Re-work of linker relaxation code for the ip2k to
4706         fix internal errors, fix bad code generation, fix incorrect stabs
4707         information, and improve ability to eliminate redundant page
4708         instructions. Added code to ip2k_final_link_relocate to self-verify
4709         the linker relaxation.  Fix formatting problems.
4710
4711 2002-12-30  Chris Demetriou  <cgd@broadcom.com>
4712
4713         * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case.
4714         * archures.c (bfd_mach_mipsisa32r2): New define.
4715         * bfd-in2.h: Regenerate.
4716         * cpu-mips.c (I_mipsisa32r2): New enum value.
4717         (arch_info_struct): Add entry for I_mipsisa32r2.
4718         * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach)
4719         (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2.
4720         (_bfd_mips_elf_final_write_processing): Add
4721         bfd_mach_mipsisa32r2 case.
4722         (_bfd_mips_elf_merge_private_bfd_data): Handle merging of
4723         binaries marked as using MIPS32 Release 2.
4724
4725 2002-12-30    Dmitry Diky <diwil@mail.ru>
4726
4727         * Makefile.am: Add msp430 target.
4728         * configure.in: Likewise.
4729         * Makefile.in: Regenerate.
4730         * configure: Regenerate.
4731         * archures.c: Add msp430 architecture vector.
4732         * config.bfd: Likewise.
4733         * reloc.c: Add msp430 relocs.
4734         * targets.c: Add msp320 target.
4735         * cpu-msp430.c: New file: msp430 cpu detection.
4736         * elf32-msp430.c: New file: msp430 reloc processing.
4737         * bfd-in2.h: Regenerate.
4738         * libbfd.h: Regenerate.
4739
4740 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
4741
4742         * elf.c (elf_sort_sections): Don't reorder .tbss.
4743         (assign_file_positions_for_segments): Only adjust off/voff
4744         for increased alignment in PT_LOAD or PT_NOTE segment,
4745         but adjust p_filesz for .tbss too.  in PT_LOAD consider
4746         .tbss to have zero memory size.
4747         (copy_private_bfd_data) [SECTION_SIZE]: Define.
4748         [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it.
4749         [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections
4750         into PT_TLS segment.  Never put SHF_TLS sections in
4751         segments other than PT_TLS or PT_LOAD.
4752
4753         * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Clear .plt
4754         sh_entsize.
4755
4756 2002-12-23  DJ Delorie  <dj@redhat.com>
4757
4758         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Fix logic reversal.
4759
4760 2002-12-23  Alan Modra  <amodra@bigpond.net.au>
4761
4762         * elflink.h (elf_link_output_extsym): Heed strip_discarded.
4763
4764 2002-12-23  Nick Clifton  <nickc@redhat.com>
4765
4766         * archures.c (bfd_arch_get_compatible): Add third parameter
4767         'accept_unknowns'.  Only accept unknown format BFDs if
4768         accept_unknowns is true, or if the format is "binary".
4769         * bfd-in2.h: Regenerate.
4770
4771 2002-12-21  Nick Clifton  <nickc@redhat.com>
4772
4773         * coff-arm.c (coff_arm_relocate_section): Disable WINCE workaround
4774         that subtracted 8 from pc relative relocations.
4775
4776 2002-12-20  Kazu Hirata  <kazu@cs.umass.edu>
4777
4778         * coff-h8300.c: Fix comment typos.
4779         * coffcode.h: Likewise.
4780         * cpu-cris.c: Likewise.
4781         * elf32-vax.c: Likewise.
4782         * genlink.h: Likewise.
4783         * linker.c: Likewise.
4784         * som.c: Likewise.
4785         * tekhex.c: Likewise.
4786         * vms-misc.c: Likewise.
4787
4788 2002-12-20  DJ Delorie  <dj@redhat.com>
4789
4790         * reloc.c: Add BFD_RELOC_XSTORMY16_12.
4791         * libbfd.h: Regenerate.
4792         * bfd-in2.h: Regenerate.
4793         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12.
4794         (xstormy16_reloc_map): Add R_XSTORMY16_12.
4795
4796 2002-12-19  Kazu Hirata  <kazu@cs.umass.edu>
4797
4798         * doc/bfdint.texi: Fix typos.
4799
4800 2002-12-20  Paul Eggert  <eggert@twinsun.com>
4801
4802         Port to POSIX 1003.1-2001.
4803         * acinclude.m4 (AM_INSTALL_LIBBFD): Do not rely on "test -o".
4804         * configure.in (build-warnings): Likewise.
4805         (Horrible hacks to build DLLs on Windows): Do not rely on "tail -1".
4806         * aclocal.m4: Regenerate.
4807         * config.in: Regenerate.
4808         * configure: Regenerate.
4809
4810 2002-12-19  Alan Modra  <amodra@bigpond.net.au>
4811
4812         * coff-h8300.c: Include libiberty.h.
4813         (h8300_reloc16_extra_cases): Check the hash table creator before
4814         referencing h8300 specific fields.  Stash the hash table pointer
4815         in a local var.  Comment typo fixes.
4816         (h8300_bfd_link_add_symbols): Likewise.
4817
4818         * reloc.c (struct reloc_howto_struct): Revise src_mask and
4819         dst_mask comments.
4820         * bfd-in2.h: Regenerate.
4821
4822 2002-12-18  Alan Modra  <amodra@bigpond.net.au>
4823
4824         * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc
4825         code a little.  Comment on dynamic relocs against section symbols.
4826
4827 2002-12-17  Roger Sayle  <roger@eyesopen.com>
4828
4829         * configure.host (ia64-*-hpux*): Support 64 bit targets using
4830         the HP compiler's "long long".
4831
4832 2002-12-16  Andrew MacLeod  <amacleod@redhat.com>
4833
4834         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_LO16
4835         and R_XSTORMY16_HI16) howto entries.
4836         (xstormy16_reloc_map): Map R_XSTORMY16_{LO,HI}16 to BFD_RELOC_{LO,HI}16.
4837         (xstormy16_info_to_howto_rela): Use R_XSTORMY16_GNU_VTINHERIT to
4838         determine the start of the second reloc table.
4839
4840 2002-12-16  Nathan Tallent  <eraxxon@alumni.rice.edu>
4841
4842         * ecofflink.c: Fix the reading of the debugging information
4843         of Tru64/Alpha binaries that are produced by recent Compaq
4844         compilers.
4845         (mk_fdrtab): Fix error in creating the FDR (file descriptor)
4846         table.
4847         (lookup_line): Because of the strange information sometimes
4848         generated by Compaq's recent compilers, change how the FDR
4849         table is searched so that PDRs (procedure descriptors) are
4850         correctly found.  Note that this change is really more of a hack;
4851         however, I have included extensive documentation as to why
4852         this is the best solution short of an extensive rewrite or
4853         another hack.
4854         (fdrtab_lookup): Add comments to explain the algorithm.
4855
4856 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4857
4858         * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Reorder
4859         initializers to match struct declaration.
4860
4861 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
4862
4863         * dwarf2.c (comp_unit_contains_address): Comment typo fix.
4864         * elf.c (get_program_header_size): Likewise.
4865         * elf32-m32r.c (m32r_elf_lo16_reloc): Likewise.
4866         (m32r_elf_generic_reloc): Likewise.
4867         * elf32-ppc.c (ppc_elf_howto_init): Likewise.
4868         * elflink.h (elf_bfd_discard_info): Likewise.
4869
4870 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
4871
4872         * elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset
4873         to DT_JMPREL.  Use srelplt input section size for DT_PLTRELSZ and
4874         DT_RELSZ adjustment, not output section.  Avoid writing tags when
4875         unchanged.  Don't assume linker script is sane, adjust DT_REL too.
4876         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw
4877         size of srelplt for DT_PLTRELSZ.  Use srelplt input section size for
4878         DT_RELASZ adjustment, not output section.  Avoid writing tags when
4879         unchanged.  Adjust DT_RELA.
4880         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better
4881         formatting.  Avoid writing tags when unchanged.  Adjust DT_RELA.
4882
4883 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4884
4885         * elfxx-mips.c (mips_elf_calculate_relocation): Don't divide
4886         addend by 4.
4887
4888 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4889
4890         * elfxx-mips.c (struct mips_got_entry): New.
4891         (struct mips_got_info): Added got_entries field.
4892         (mips_elf_got_entry_hash, mips_elf_got_entry_eq): New functions.
4893         (mips_elf_local_got_index, mips_elf_got_page,
4894         mips_elf_got16_entry): Re-implement in terms of new...
4895         (mips_elf_create_local_got_entry): Rewrite to use got_entries.
4896         Change return type.
4897         (mips_elf_highest): Warning clean-up.
4898         (mips_elf_create_got_section): Initialize got_entries.
4899         (_bfd_mips_elf_check_relocs): Use got_entries to estimate
4900         local got size.
4901         (_bfd_mips_elf_size_dynamic_sections): Do not account for
4902         GOT_PAGE entries, since we now reuse GOT16 entries.
4903
4904 2002-12-10  Jason Thorpe  <thorpej@wasabisystems.com>
4905
4906         * aoutx.h (set_section_contents): Allow an otherwise unrepresentable
4907         read-only section that lies after .text and before .data to be
4908         written into the output file and included in a_text.
4909         (translate_to_native_sym_flags): If an otherwise unrepresentable
4910         section was merged with .text, convert its symbols to N_TEXT
4911         symbols.
4912         * libaout.h (aout_section_merge_with_text_p): New macro.
4913
4914 2002-12-08  Alan Modra  <amodra@bigpond.net.au>
4915
4916         * bfd-in.h: Comment typo fix.  Formatting.
4917         * bfd-in2.h: Regenerate.
4918         * coff64-rs6000.c (xcoff64_openr_next_archived_file): Warning fix.
4919         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): Prototype.
4920         * elf64-mmix.c (mmix_dump_bpo_gregs): Warning fix.
4921
4922 2002-12-05  Richard Henderson  <rth@redhat.com>
4923
4924         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21BI.
4925         Only send PCREL21B though the plt.  Fix installed reloc type.
4926         (elfNN_ia64_relocate_section): Give error for dynamic reloc
4927         against PCREL22 or PCREL64I; clean up error messages for
4928         branch relocs.
4929
4930 2002-12-04  Kevin Buettner  <kevinb@redhat.com>
4931
4932         * elf64-mips.c (elf64_mips_grok_prstatus, elf64_mips_grok_psinfo):
4933         New functions.
4934         (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
4935
4936 2002-12-04  David Mosberger  <davidm@hpl.hp.com>
4937
4938         * cpu-ia64-opc.c: Add operand constant "ar.csd".
4939
4940 2002-12-04  H.J. Lu <hjl@gnu.org>
4941
4942         * elfxx-ia64.c (get_local_sym_hash): Use section ID instead of
4943         BFD address when constructing local name.
4944
4945 2002-12-04  Andreas Schwab  <schwab@suse.de>
4946
4947         * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec
4948         member.
4949         (elf_m68k_link_hash_table_create): Initialize it.
4950         (elf_m68k_check_relocs): Handle symbols that are forced to be
4951         local due to visibility changes.
4952         (elf_m68k_adjust_dynamic_symbol): Likewise.
4953         (elf_m68k_size_dynamic_sections): Likewise.
4954         (elf_m68k_discard_copies): Likewise.
4955         (elf_m68k_relocate_section): Likewise.
4956
4957 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
4958
4959         * elf64-ppc.c (ppc64_elf_edit_opd): Correct typo.
4960
4961 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
4962
4963         * srec.c (srec_write_symbols): Restore '$' prefix to address
4964         accidentally removed in 2002-04-04 change.
4965         (srec_get_symtab): Use 0 instead of `(long) FALSE'.
4966
4967 2002-12-03  Nick Clifton  <nickc@redhat.com>
4968
4969         * elf32-ppc.c (apuinfo_list_init): New function.
4970         (apuinfo_list_add): New function: Add a value to the list.
4971         (apuinfo_list_length): New function: Return the number of
4972         values on the list.
4973         (apuinfo_list_element): New function: Return a value on the
4974         list.
4975         (apuinfo_list_finish): New function: Free the resources used
4976         by the list.
4977         (ppc_elf_begin_write_processing): New function.  Scan the
4978         input bfds for apuinfo sections.
4979         (ppc_elf_write_section): New function: Delay the creation of
4980         the contents of an apuinfo section in an output bfd.
4981         (ppc_elf_final_write_processing): New function.  Create the
4982         contents of an apuinfo section in an output bfd.
4983         (elf_backend_begin_write_processing): Define.
4984         (elf_backend_final_write_processing): Define.
4985         (elf_backend_write_section): Define.
4986
4987 2002-12-03  Richard Henderson  <rth@redhat.com>
4988
4989         * cpu-ia64-opc.c (elf64_ia64_operands): Add ldxmov entry.
4990
4991 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
4992
4993         Fix PR savannah/1417:
4994         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Don't adjust
4995         branch if it goes to the start of the deleted region.
4996
4997 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
4998
4999         * bfd-in2.h (bfd_mach_m6812): Rebuild.
5000         * archures.c (bfd_mach_m6812_default, bfd_mach_m6812,
5001         bfd_mach_m6812s): Declare.
5002
5003         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): New function.
5004         (_bfd_m68hc12_elf_set_private_flags): Call it.
5005         (_bfd_m68hc12_elf_print_private_bfd_data): Report processor version.
5006         (_bfd_m68hc12_elf_merge_private_bfd_data): Merge the flags and
5007         report microcontroller incompatibilities (HC12 vs HCS12).
5008         (elf_backend_object_p): Update.
5009
5010 2002-11-30  Alan Modra  <amodra@bigpond.net.au>
5011
5012         * bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete.
5013         (enum bfd_boolean, boolean): Delete.
5014         (bfd_boolean): Typedef to an int.
5015         (FALSE, TRUE): Define.
5016         * aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c,
5017         aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h,
5018         aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c,
5019         binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
5020         coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c,
5021         coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c,
5022         coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c,
5023         coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c,
5024         coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c,
5025         coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c,
5026         corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c,
5027         cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c,
5028         cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c,
5029         cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c,
5030         cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c,
5031         cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c,
5032         cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c,
5033         cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c,
5034         cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c,
5035         cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c,
5036         dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c,
5037         elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
5038         elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c,
5039         elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
5040         elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h,
5041         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
5042         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
5043         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
5044         elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c,
5045         elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
5046         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
5047         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
5048         elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c,
5049         elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h,
5050         elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
5051         elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c,
5052         hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c,
5053         i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c,
5054         libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h,
5055         libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c,
5056         m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c,
5057         mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c,
5058         nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
5059         pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c,
5060         pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c,
5061         pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c,
5062         reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c,
5063         som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c,
5064         syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c,
5065         vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h,
5066         xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with
5067         bfd_boolean, true with TRUE, false with FALSE.  Simplify comparisons
5068         of bfd_boolean vars with TRUE/FALSE.  Formatting.
5069         * bfd-in2.h, libbfd.h, libcoff.h: Regenerate
5070
5071 2002-11-28  Alan Modra  <amodra@bigpond.net.au>
5072
5073         * elf-bfd.h: Replace occurrences of Elf32_Internal_* and
5074         Elf64_Internal_* with Elf_Internal_*.  Replace Elf_Internal_Rel
5075         with Elf_Internal_Rela.
5076         * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
5077         elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
5078         elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
5079         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
5080         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
5081         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
5082         elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
5083         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
5084         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
5085         elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
5086         elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
5087         * elf-hppa.h (elf_hppa_internal_shdr): Delete.  Use Elf_Internal_Shdr
5088         throughout instead.
5089         * elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
5090         * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
5091         Remove INLINE keyword.
5092         (elf_swap_reloc_in): Likewise.  Also clear r_addend.
5093         (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
5094         as a bfd_byte *.
5095         (elf_write_relocs): Consolidate REL and RELA code.
5096         (elf_slurp_reloc_table_from_section): Simplify REL code.
5097         (NAME(_bfd_elf,size_info)): Populate reloc swap entries.
5098         * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
5099         * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
5100         RELA code.
5101         (elf_link_adjust_relocs): Likewise.  Don't malloc space for temp
5102         reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
5103         (elf_link_output_relocs): Likewise.
5104         (elf_reloc_link_order): Likewise.
5105         (elf_finish_pointer_linker_section): Likewise.
5106         (struct elf_link_sort_rela): Remove union.
5107         (elf_link_sort_cmp1): Update to suit.
5108         (elf_link_sort_cmp2): Here too.
5109         (elf_link_sort_relocs): Consolidate REL and RELA code.  Fix memory
5110         over-allocation for int_rels_per_ext_rel != 1 case.
5111         * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
5112         * elf32-i386.c: Likewise.
5113         * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
5114         * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
5115         elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
5116         * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
5117         * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
5118         elf64-sparc.c, elf64-x86-64.c: Likewise.
5119         * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
5120         * elfxx-mips.c (sort_dynamic_relocs): Likewise for
5121         bfd_elf32_swap_reloc_in.
5122
5123         * elf32-arm.h: Update elf32_arm_info_to_howto calls.
5124         * elf32-mips.c: Likewise for mips_info_to_howto_rel.
5125         (mips_elf64_swap_reloc_in): Zero r_addend.
5126         (mips_elf64_be_swap_reloc_in): Likewise.
5127         (mips_elf64_slurp_one_reloc_table): Simplify.
5128
5129         * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
5130         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
5131         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
5132
5133 2002-11-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5134
5135         * elf32-sh.c (sh_elf_relocate_section): Don't complain about
5136         unresolved debugging relocs in dynamic applications.
5137         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
5138
5139 2002-11-26  Alan Modra  <amodra@bigpond.net.au>
5140
5141         * elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
5142         (_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs
5143         on a relocatable link.  Comment typos.
5144         * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure
5145         in the order they are declared.  Clear elf_hash_value too.
5146         (_bfd_elf_link_hash_table_init): Likewise assign in order.  Clear
5147         eh_info and tls_segment.
5148         * elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets
5149         sorted when discarding relocs by turning them into R_*_NONE.
5150
5151         * libbfd.c (warn_deprecated): Comment spelling.
5152         * po/SRC-POTFILES.in: Regenerate.
5153
5154 2002-11-21  Richard Henderson  <rth@redhat.com>
5155
5156         * elflink.h (elf_link_add_object_symbols): Don't overwrite the
5157         arch's st_other bits when merging visibilities.
5158         (elf_link_output_extsym): Tidy clearing of visibility field.
5159
5160 2002-11-21  Alan Modra  <amodra@bigpond.net.au>
5161
5162         * coff-mcore.c (SWAP_IN_RELOC_OFFSET): Define.
5163         (SWAP_OUT_RELOC_OFFSET): Define.
5164
5165 2002-11-20  Alexandre Oliva  <aoliva@redhat.com>
5166
5167         * elf.c (_bfd_elf_link_hash_table_init): Make sure
5168         can_refcount is properly extended to the type of
5169         init_refcount.
5170
5171 2002-11-19  Alexandre Oliva  <aoliva@redhat.com>
5172
5173         * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro.
5174         (_bfd_mips_elf_relocate_section): Use it.
5175
5176         * elfxx-mips.c (MNAME): New macro.
5177         (_bfd_mips_elf_check_relocs): Use it.
5178         (_bfd_mips_elf_discard_info): Likewise.
5179         (_bfd_mips_elf_final_link): Likewise.
5180
5181 2002-11-19  Alan Modra  <amodra@bigpond.net.au>
5182
5183         * elf64-ppc.c (ppc64_elf_edit_opd): When deleting relocs, adjust
5184         rel_hdr.sh_size too.
5185
5186 2002-11-18  Klee Dienes  <kdienes@apple.com>
5187
5188         * Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo.
5189         (BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c.
5190         (BFD_H_FILES): Add bfdwin.c, bfdio.c.
5191         (LIBBFD_H_FILES): Add bfdwin.c, bfdio.c.
5192         Add dependencies for bfdwin.c, bfdio.c.
5193         * bfd.c: Remove bfd_get_mtime, bfd_get_size.
5194         * libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal,
5195         bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite,
5196         bfd_tell, bfd_flush, bfd_stat, bfd_seek.
5197         * bfdio.c: New file.  Contains real_read, bfd_bread, bfd_write,
5198         bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime,
5199         bfd_get_size (moved from libbfd.c and bfd.c).
5200         * bfdwin.c New file.  Contains _bfd_window_internal,
5201         bfd_init_window, bfd_free_window, bfd_get_file_window (moved from
5202         libbfd.c and bfd.c).
5203         * po/SRC-POTFILES.in: Regenerate.
5204         * po/bfd.pot: Regenerate.
5205         * libbfd.h: Regenerate.
5206         * bfd-in2.h: Regenerate.
5207         * aclocal.m4: Regenerate.
5208         * Makefile.in: Regenerate.
5209         * configure: Regenerate.
5210
5211 2002-11-18  Klee Dienes  <kdienes@apple.com>
5212
5213         * bfd.c (bfd_preserve_save): Don't zero BFD_IN_MEMORY.
5214
5215 2002-11-15  Kazu Hirata  <kazu@cs.umass.edu>
5216
5217         * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away
5218         jsr after a short jump.
5219         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
5220
5221 2002-11-15  Klee Dienes  <kdienes@apple.com>
5222
5223         * pef.c (bfd_pef_convert_architecture): Move declaration of
5224         ARCH_POWERPC and ARCH_M68K to the start of the function.
5225
5226 2002-11-14  Svein E. Seldal  <Svein.Seldal@solidas.com>
5227
5228         * coff-tic4x.c (tic4x_howto_table): Formatting fixup
5229
5230 2002-11-14  Hans-Peter Nilsson  <hp@bitrange.com>
5231
5232         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs):
5233         For bpo_gregs_section->contents, allocate _raw_size, not
5234         _cooked_size.
5235
5236 2002-11-13  Klee Dienes  <kdienes@apple.com>
5237
5238         * config.bfd: Add entries for powerpc-*-darwin and cousins.
5239
5240 2002-11-13  H.J. Lu <hjl@gnu.org>
5241
5242         * elfcode.h (elf_object_p): Don't restore abfd->arch_info.
5243
5244 2002-11-13  Klee Dienes  <kdienes@apple.com>
5245             Alan Modra  <amodra@bigpond.net.au>
5246
5247         * bfd.c (struct bfd_preserve): New.
5248         (bfd_preserve_save): New function.
5249         (bfd_preserve_restore): Ditto.
5250         (bfd_preserve_finish): Ditto.
5251         * bfd-in2.h: Regenerate.
5252         * mach-o.c: Formatting.
5253         (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned.
5254         (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish.
5255         (bfd_mach_o_core_p): Ditto.
5256         (bfd_mach_o_scan): Pass in mdata.
5257         * mach-o.h (bfd_mach_o_scan): Update prototype.
5258         * pef.c: Formatting.
5259         (bfd_pef_object_p): Use bfd_preserve_save/restore/finish.
5260         (bfd_pef_xlib_object_p): Ditto.
5261         (bfd_pef_scan): Pass in mdata.  Move version check to bfd_pef_object_p.
5262         * pef.h (bfd_pef_scan): Update prototype.
5263         * xsym.c: Formatting, K&R fixes.
5264         (bfd_sym_object_p): Use bfd_preserve_save/restore/finish.
5265         (bfd_sym_scan): New function split out from bfd_sym_object_p.
5266         * xsym.h (bfd_sym_scan): Declare.
5267         * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish.
5268         * elfcore.h (elf_core_file_p): Likewise.
5269         * targets.c (_bfd_target_vector): Revert 2002-11-08 change.
5270
5271 2002-11-12  Nick Clifton  <nickc@redhat.com>
5272
5273         * po/da.po: Updated Danish translation.
5274
5275 2002-11-12  Alan Modra  <amodra@bigpond.net.au>
5276
5277         * elflink.h (elf_link_add_object_symbols): Optimize stabs for
5278         relocatable link too.
5279         (elf_link_input_bfd): When emitting relocs, adjust offsets for
5280         eh_frame and stab sections.  Zap deleted relocs.
5281         (elf_reloc_symbol_deleted_p): Return true for zero r_symndx.
5282         (elf_bfd_discard_info): Run for relocatable link too.
5283         * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd.  Make global.
5284         Handle ld -r case.
5285         (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here.
5286         * elf64-ppc.h (ppc64_elf_edit_opd): Declare.
5287
5288         * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c.
5289         (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise.
5290         (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise.
5291         (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR.
5292         (struct eh_frame_hdr_info): Add "hdr_sec", remove "split".
5293         (struct elf_link_hash_table): Add eh_info.
5294         (struct elf_obj_tdata): Change eh_frame_hdr to an asection *.
5295         (_bfd_elf_discard_section_eh_frame): Update prototype.
5296         (_bfd_elf_discard_section_eh_frame_hdr): Likewise.
5297         (_bfd_elf_write_section_eh_frame): Likewise.
5298         (_bfd_elf_write_section_eh_frame_hdr): Likewise.
5299         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec"
5300         param.  Get "hdr_info" from link hash table.
5301         (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param.  Get
5302         header section from link hash table.  Save header section to elf_tdata.
5303         (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec".  Use
5304         header section from link hash table.  Don't alloc hdr_info.  Clear
5305         hdr_sec instead of setting "strip".
5306         (_bfd_elf_eh_frame_section_offset): Formatting.
5307         (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param.
5308         Get header section from link hash table.
5309         (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param.
5310         Get header section from link hash table.
5311         * elf.c (map_sections_to_segments): Use cached eh_frame_hdr.
5312         (get_program_header_size): Likewise.
5313         (_bfd_elf_section_offset): Formatting.
5314         * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header
5315         section pointer in link hash table.
5316         (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr
5317         and _bfd_elf_write_section_eh_frame calls.  Update comment about
5318         eh_frame entries.
5319         (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and
5320         _bfd_elf_discard_section_eh_frame_hdr calls.  Remove "ehdr".
5321
5322         * po/SRC-POTFILES.in: Regenerate.
5323
5324         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero
5325         relocs for discarded FDEs.  Remove dead code.
5326         (_bfd_elf_write_section_eh_frame_hdr): Remove dead code.
5327         * elflink.h (elf_bfd_discard_info): Don't save edited relocs.
5328         Tidy conditions under which stabs are edited.  Formatting.
5329         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
5330         from discarded relocs.
5331         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output
5332         section adjustments after testing magic values.
5333
5334 2002-11-12  Thomas Moestl <tmm@FreeBSD.org>
5335
5336         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct
5337         references to large plt symbols.
5338
5339 2002-11-12  Klee Dienes  <kdienes@apple.com>
5340
5341         * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when
5342         looking for an unused section name.
5343
5344 2002-11-11  Kazu Hirata  <kazu@cs.umass.edu>
5345
5346         * coff-h8300.c: Fix formatting.
5347         * elf32-h8300.c: Likewise.
5348         * reloc16.c: Likewise.
5349
5350 2002-11-09  Jeroen Dobbelaere  <jeroen.dobbelaere@acunia.com>
5351
5352         * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output
5353         section when dynamic section unused;  _bfd_strip_section_from_output
5354         instead.
5355
5356 2002-11-08  Alan Modra  <amodra@bigpond.net.au>
5357
5358         * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec
5359         and sym_vec.
5360
5361         * dwarf2.c: Revert last change.
5362
5363 2002-11-07  Michal Ludvig  <mludvig@suse.cz>
5364
5365         * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
5366         _bfd_dwarf2_find_nearest_line): Use
5367         bfd_simple_get_relocated_section_contents() instead of
5368         bfd_get_section_contents().
5369         * reloc.c (bfd_perform_relocation): Add sanity check.
5370         * simple.c (simple_get_relocated_section_contents): If the section
5371         does not have any relocs associated with it, just return the
5372         unadjusted contents.
5373
5374 2002-11-07  Hans-Peter Nilsson  <hp@axis.com>
5375
5376         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOT,
5377         case R_CRIS_32_GOT>: Correct test for filling in constant .got
5378         contents, enabling for a non-DSO, for symbols defined in the
5379         program with --export-dynamic.
5380
5381 2002-11-07  Alan Modra  <amodra@bigpond.net.au>
5382
5383         * elf64-ppc.c: Comment typo fixes.
5384         (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input.
5385
5386 2002-11-07  Nick Clifton  <nickc@redhat.com>
5387
5388         * po/da.po: Updated Danish translation.
5389
5390 2002-11-06  Alexandre Oliva  <aoliva@redhat.com>
5391
5392         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate
5393         exactly three internal relocs per external reloc.  Set reloc_count
5394         to the external reloc count.
5395
5396 2002-11-06  Klee Dienes  <kdienes@apple.com>
5397
5398          * coff-stgo32.c (stub_bytes): Mark as const.
5399          Fix comment formatting.
5400
5401 2002-11-06  Klee Dienes  <kdienes@apple.com>
5402
5403         * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and
5404         xsym.lo.
5405         (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c.
5406         (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h
5407         * archures.c (enum bfd_architecture): Add bfd_arch_m98k.
5408         * bfd.c (struct bfd): Add private data for mach-o, pef, and sym.
5409         * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and
5410         sym.
5411         (_bfd_target_vector): Add target vectors for mach-o, pef, and sym.
5412         * Makefile.in: Regenerate.
5413         * doc/Makefile.in: Regenerate.
5414         * bfd-in2.h: Regenerate.
5415         * xsym.c: New file.  Contains support for the Apple/Metrowerks
5416         xSYM debugging format.
5417         * xsym.h: New file.
5418         * pef.c: New file.  Contains support for the Apple Code Fragment
5419         Manager Preferred Executable Format
5420         * pef.h: New file.
5421         * pef-traceback.h: New file.  Contains support for parsing PowerPC
5422         traceback tables as used by PEF executables (and perhaps other
5423         systems as well).
5424         * mach-o.c: New file.  Contains support for the Mach-O object file
5425         format.
5426         * mach-o.h: New file.
5427         * mach-o-target.c: New file.  Declares the mach-o targets
5428         themselves.  Included three times by mach-o.c; each time with a
5429         different set of macros set.
5430
5431 2002-11-06  Graeme Peterson  <gp@qnx.com>
5432
5433         * Makefile.am: Remove entries for elf32-qnx.[ch].
5434         * Makefile.in: Regenerate.
5435         * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec,
5436         ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use
5437         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
5438         * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec,
5439         bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec,
5440         and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets.
5441         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
5442         * configure: Regenerate.
5443         * elf32-qnx.c: Remove.
5444         * elf32-qnx.h: Remove.
5445         * elf.c: Remove calls to QNX specific set_nonloadable_filepos,
5446         is_contained_by_filepos, and copy_private_bfd_data_p.
5447         * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos,
5448         is_contained_by_filepos, and copy_private_bfd_data_p.
5449         * elf32-i386.c: Remove QNX extended bfd support.
5450         * elf32-ppc.c: Remove QNX extended bfd support.
5451         * elf32-sh.c: Remove QNX extended bfd support.
5452         * elfarm-nabi.c: Remove QNX extended bfd support.
5453         * targets.c: Remove qnx vectors.
5454         * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove
5455         (elf_backend_is_contained_by_filepos): Remove.
5456         (elf_backend_copy_private_bfd_data_p): Remove.
5457         * po/SRC-POTFILES.in: Regenerate.
5458
5459 2002-11-06  David O'Brien  <obrien@FreeBSD.org>
5460             Alan Modra  <amodra@bigpond.net.au>
5461
5462         * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of
5463         dynamic relocs against section symbols for the output section vma.
5464
5465 2002-11-05  Alan Modra  <amodra@bigpond.net.au>
5466
5467         * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn,
5468         t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove.
5469
5470 2002-11-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5471             Alan Modra  <amodra@bigpond.net.au>
5472
5473         * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64
5474         vectors in target_selvecs.
5475         (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors
5476         in target_selvecs.
5477         (sh-*-netbsdelf*): Likewise.
5478         * configure.in (assocvecs): New variable.  Handle assocvecs like
5479         selvecs.
5480         * configure: Regenerate.
5481         * format.c (bfd_check_format_matches): Store bfd_target pointers
5482         in matching_vector instead of target names.  Select first target
5483         from bfd_associated_vector that matches a list of ambiguous targets.
5484         * targets.c (_bfd_associated_vector): New array.
5485         (bfd_associated_vector): New variable.
5486         (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec.
5487         * libbfd-in.h (bfd_associated_vector): Declare.
5488         * libbfd.h: Regenerate.
5489
5490 2002-11-05  Elias Athanasopoulos  <eathan@otenet.gr>
5491
5492         * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
5493         non-NULL before dereferencing.
5494
5495 2002-11-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5496
5497         * vms.c (vms_object_p): Restore the start address when returning
5498         NULL.
5499
5500 2002-11-04  Alan Modra  <amodra@bigpond.net.au>
5501             Hans-Peter Nilsson  <hp@axis.com>
5502
5503         * elflink.h (struct elf_final_link_info): Add shndxbuf_size.
5504         (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields.
5505         Set up a larger symshndxbuf, and write it out.  Free it on
5506         exit rather than freeing symbuf twice.  Correct section index
5507         on output section symbol loop.
5508         (elf_link_output_sym): Accumulate symbol extension section
5509         indices, reallocating symshndxbuf rather than writing it out.
5510         (elf_link_flush_output_syms): Don't flush symshndxbuf.
5511         * elf.c (assign_section_numbers): Init i_shdrp to all zero.
5512         Use bfd_zalloc to clear i_shdrp[0] too.
5513
5514 2002-11-03  Stephen Clarke <stephen.clarke@earthling.net>
5515
5516          * elf32-sh64-com.c (sh64_address_in_cranges): Use
5517         _raw_size of cranges section if _cooked_size not yet set.
5518
5519 2002-11-03  Hans-Peter Nilsson  <hp@axis.com>
5520
5521         * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters
5522         for bfd_elf32_swap_symbol_out.
5523
5524 2002-10-31  David O'Brien  <obrien@FreeBSD.org>
5525
5526         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
5527         signed and unsigned in comparison.
5528
5529 2002-10-30  Daniel Jacobowitz  <drow@mvista.com>
5530
5531         * coffcode.h: Remove extraneous '\'.
5532
5533 2002-10-28  H.J. Lu <hjl@gnu.org>
5534
5535         * Makefile.am (targets.lo): Depend on Makefile instead of
5536         config.status.
5537         (archures.lo): Likewise.
5538         * Makefile.in: Regenerated.
5539
5540 2002-10-25  Jason Thorpe  <thorpej@wasabisystems.com>
5541
5542         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add
5543         bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to
5544         targ_selvecs.
5545
5546 2002-10-25  Jim Wilson  <wilson@redhat.com>
5547
5548         * elf64-sh64.c (sh_elf64_relocate_section): Call
5549         _bfd_elf_rela_local_sym.  Handle relocs against STT_SECTION symbol
5550         of SHF_MERGE section.
5551
5552 2002-10-25  Hans-Peter Nilsson  <hp@axis.com>
5553
5554         * simple.c: Correct placement of ATTRIBUTE_UNUSED.
5555
5556 2002-10-24  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5557
5558         * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to
5559         unsigned int.  Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to
5560         unsigned int.
5561         (NAME(aout,final_link)): Cast enum used in assignment.
5562         (aout_link_write_symbols): Cast enums in comparisons, int values to
5563         boolean, enums in assignments to int.
5564         (aout_link_input_section_std): Cast rel->r_index to unsigned int.
5565         (aout_link_input_section_ext): Likewise.  Cast enums used in
5566         comparisons with unsigned ints.
5567         (aout_link_reloc_link_order): Cast enum to int in assignment.
5568         * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr
5569         calls to char *.
5570         * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in
5571         assignment.
5572         * bfd-in2.h (bfd_set_section_vma): Likewise.
5573         * bfd.c (bfd_record_phdr): Cast enums in assignments.
5574         * binary.c (bfd_alloc): Cast enum to long.
5575         * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean.
5576         * dwarf2.c (read_abbrevs): Add casts to enum types.
5577         (read_attribute_value): Likewise.
5578         (arange_add): Cast result of bfd_zalloc call.
5579         (comp_unit_contains_address): Return true and false.
5580         (comp_unit_find_nearest_line): Cast return to boolean.
5581         * format.c (bfd_check_format_matches, bfd_set_format): Likewise.
5582         * gen-aout.c: define macro '_' if not defined.
5583         * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR.
5584         (bfd_bwrite): Cast bfd_realloc to bfd_byte *.
5585         (bfd_write_bigendian_4byte_int): Cast return to boolean.
5586         (bfd_seek): Cast bfd_realloc to bfd_byte *.
5587         (bfd_generic_is_local_label_name): Cast return to boolean.
5588         * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'.
5589         * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to
5590         struct bfd_hash_entry *.
5591         (_bfd_generic_link_hash_newfunc): likewise.
5592         (_bfd_generic_final_link): Cast enum to unsigned int.
5593         * merge.c (sec_merge_emit): Cast return to boolean.
5594         (merge_strings): Add casts to const unsigned char *.
5595         * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int.
5596         (bfd_generic_get_relocated_section_content): Cast enum to unsigned int.
5597         * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result
5598         to struct bfd_hash_entry *.
5599         (bfd_set_section_content): Add cast to PTR in comparison.
5600         * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol,
5601         simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous,
5602         simple_dummy_unattached_reloc,
5603         bfd_simple_get_relocated_section_contents): Add K&R declarations and
5604         function definitions.
5605         * srec.c (S3Forced): Initialize to false.
5606         (srec_get_symtab): Cast return value from bfd_alloc to asymbol *.
5607         * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons.
5608         (_bfd_discard_section_stabs): Likewise.  Also cast return to boolean.
5609         * syms.c (bfd_is_undefined_symclass): Cast return to boolean.
5610         (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in
5611         comparisons.
5612
5613 2002-10-23  Jakub Jelinek  <jakub@redhat.com>
5614
5615         * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic
5616         relocs into shared lib non-allocated reloc sections.
5617
5618 2002-10-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
5619
5620         * dwarf2.c (add_line_info): Ensure that the line_info_table is
5621         sorted even when given an out-of-order line sequence.
5622         (lookup_address_in_line_info_table): When an exact VMA match is
5623         not found, return line information with the closest VMA.
5624
5625 2002-10-23 Ross Alexander <ross.alexander@uk.neceur.com>
5626
5627         * elf64-hppa.c: Force DT_FLAGS to always be set.  Required by
5628         HPUX 11.00 patch PHSS_26559.
5629
5630 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
5631
5632         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move
5633         the options section into a separate section unless IRIX 6
5634         compatibility is enabled.
5635
5636 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
5637
5638         * elflink.h (struct elf_link_sort_rela): Turn rel and rela
5639         into arrays.
5640         (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust.
5641         (elf_link_sort_relocs): Likewise.  Take int_rels_per_ext_rel
5642         into account.
5643         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose
5644         R_MIPS_REL32 with R_MIPS64 if ABI_64_P.
5645
5646 2002-10-21  Graeme Peterson  <gp@qnx.com>
5647
5648         * targets.c (_bfd_target_vector): Add missing qnx vectors.
5649
5650 2002-10-21  Alan Modra  <amodra@bigpond.net.au>
5651
5652         * targets.c (bfd_target_list): Don't return the default target twice.
5653
5654 2002-10-21  Elias Athanasopoulos  <eathan@otenet.gr>
5655
5656         * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace
5657         perror with bfd_perror.
5658
5659 2002-10-19  H.J. Lu <hjl@gnu.org>
5660
5661         * elflink.h (elf_link_add_object_symbols): Correctly handle
5662         DT_RPATH and DT_RUNPATH.
5663
5664 2002-10-19  Mark Kettenis  <kettenis@gnu.org>
5665
5666         * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes.
5667
5668 2002-10-17  Denis Chertykov  <denisc@overta.ru>
5669
5670         * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code
5671         for ip2k port.
5672
5673 2002-10-17  Alan Modra  <amodra@bigpond.net.au>
5674
5675         * elfxx-target.h (USE_REL): Don't define as 1.
5676         * elf32-arm.h (USE_REL): Provide a default define of 0.
5677         Use #if rather than #ifdef when testing USE_REL.
5678         * elf32-m32r.c: Likewise.
5679
5680         * elf32-arc.c (USE_REL): Define as 1.
5681         * elf32-d10v.c (USE_REL): Likewise.
5682         * elf32-m32r.c (USE_REL): Likewise.
5683         * elf32-m68hc11.c (USE_REL): Likewise.
5684         * elf32-m68hc12.c (USE_REL): Likewise.
5685         * elf32-or32.c (USE_REL): Likewise.
5686         * elfarm-nabi.c (USE_REL): Likewise.
5687
5688 2002-10-16  Jakub Jelinek  <jakub@redhat.com>
5689
5690         * config.bfd (s390-*-linux*): Add targ64_selvecs.
5691         (s390x-*-linux*): Add targ_selvecs.
5692
5693 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
5694
5695         * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,
5696         elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo,
5697         elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo,
5698         elf32-sh64-nbsd.lo, elf32-shqnx.lo.  Add elf32-qnx.lo.
5699         (BFD32_BACKENDS_CFILES): Likewise for corresponding C files.
5700         (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo.
5701         (BFD64_BACKENDS_CFILES): Likewise for corresponding C files.
5702         (SOURCE_HFILES): Add elf32-qnx.h.
5703         (BUILD_HFILES): Add bfdver.h.
5704         Run "make dep-am".
5705         * Makefile.in: Regenerate.
5706         * configure.in Update bfd vector dependencies.
5707         * configure: Regenerate.
5708         * elf32-i386-fbsd.c: Delete.  Move code to elf32-i386.c.
5709         * elf32-i386qnx.c: Likewise.
5710         * elf32-ppcqnx.c: Delete.  Move code to elf32-ppc.c.
5711         * elf32-sh-nbsd.c: Delete.  Move code to elf32-sh.c.
5712         * elf32-sh-lin.c: Likewise.
5713         * elf32-shqnx.c: Likewise.
5714         * elf32-sh64-lin.c: Delete.  Move code to elf32-sh64.c.
5715         * elf32-sh64-nbsd.c: Likewise.
5716         * elf64-sh64-lin.c: Delete.  Move code to elf64-sh64.c.
5717         * elf64-sh64-nbsd.c: Likewise.
5718         * elfarmqnx-nabi.c: Delete.  Move code to elfarm-nabi.c.
5719         * elf32-arm.h (ELF_MAXPAGESIZE): Always define.
5720         * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests.
5721         * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests.
5722         * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define.
5723         (elf_backend_is_contained_by_filepos): Likewise.
5724         (elf_backend_copy_private_bfd_data_p): Likewise.
5725         Globalize and move functions to..
5726         * elf32-qnx.c: ..here.  New file.
5727         * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests.  Don't
5728         emit target vectors when INCLUDE_SHMEDIA.
5729         * elf32-sh64.c: Remove ELF_ARCH test.  Move TARGET_* etc. defines to
5730         end of file.
5731         * elf64-sh64.c: Remove ELF_ARCH test.
5732         * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test.
5733         * po/BLD-POTFILES.in: Regenerate.
5734         * po/SRC-POTFILES.in: Regenerate.
5735
5736 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
5737
5738         * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects
5739         loaded with --just-symbols.
5740
5741         * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define.
5742         * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5743         * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5744         * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5745
5746 2002-10-15  Richard Henderson  <rth@redhat.com>
5747
5748         * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd.
5749         (BFD64_BACKENDS_CFILES): Likewise.
5750         * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha.
5751         * elf64-alpha-fbsd.c: Remove file, move code ...
5752         * elf64-alpha.c: ... here.
5753         * Makefile.in, configure: Rebuild.
5754
5755 2002-10-14  Richard Henderson  <rth@redhat.com>
5756
5757         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment
5758         VALUE, not ADDEND.
5759
5760 2002-10-14  Stephen Clarke <stephen.clarke@superh.com>
5761
5762         * elf32-sh.c (elf_sh_link_hash_entry): Replace
5763         datalabel_got_offset with union of datalabel_got
5764         offset and refcount.
5765         (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount.
5766         (allocate_dynrelocs): Delete unnecessary code for
5767         STT_DATALABEL type.  Create entry in got for
5768         datalabel version of symbol if datalabel_got.refcount > 0.
5769         (sh_elf_relocate_section): Use datalabel_got union.
5770         (sh_elf_gc_sweep_hook): Pull common code to initialize
5771         h and eh out of switch statement.  Declare seen_stt_datalabel.
5772         Initialize it.  Decrement datalabel_got.refcount for
5773         got relocs when seen_stt_datalabel is true.
5774         Decrement local_got_refcounts entry for datalabel got relocs
5775         of local symbols.
5776         (sh_elf_copy_indirect_symbol): Copy datalabel_got field over.
5777         (sh_elf_check_relocs): Declare seen_stt_datalabel.
5778         Initialize it.  When seen_stt_datalabel is true, increment
5779         datalabel_got refcount rather than got.refcount.
5780         (sh_elf_finish_dynamic_symbol): Create relocs to
5781         initialize got entry for datalabel version of symbol.
5782
5783 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
5784
5785         * Makefile.am: Run "make dep-am".
5786         (BFD_H_FILES): Remove version.h.
5787         * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move..
5788         * version.h: ..to here.
5789         * configure.in (bfd_version_date): Remove.
5790         (AC_OUTPUT): Make bfdver.h from version.h.
5791         * bfd.c: #include "bfdver.h".
5792         * vms-hdr.c: Likewise.
5793         * Makefile.in: Regenerate.
5794         * bfd-in2.h: Regenerate.
5795         * configure: Regenerate.
5796         * po/SRC-POTFILES.in: Regenerate.
5797
5798 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
5799
5800         * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
5801         bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
5802         bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
5803         bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
5804         bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
5805         bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
5806         bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
5807         bfd_mach_ip2022, bfd_mach_ip2022ext,
5808         bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
5809         * bfd-in2.h: Regenerate.
5810
5811 2002-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5812
5813         * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative
5814         endian vector to targ_selvecs.
5815
5816 2002-10-13  Alexandre Oliva  <aoliva@redhat.com>
5817
5818         * elfxx-mips.c (mips_elf_calculate_relocation): Take
5819         save_addend argument.  Don't apply the 32-bit mask to a
5820         GPREL32 value if it's to be used in another relocation.  Don't
5821         use forced-check computation of local_p to decide whether to
5822         add gp0 to GPREL16 value.  Don't use only the lowest 16 bits
5823         of the addend of a non-in-place GPREL16 relocation.
5824         (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to
5825         mips_elf_calculate_relocation().
5826
5827 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
5828
5829         * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs
5830         with symbols in other sections if we relaxed something;  the sections
5831         output offsets must be re-computed before.
5832
5833 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
5834
5835         * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols
5836         handling to use Elf_Internal_Sym.
5837         (m68hc11_elf_relax_delete_bytes): Likewise.
5838
5839 2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5840
5841         * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,
5842         sh_elf_object_p, dtpoff_base): New functions.
5843         (sh_elf_howto_table): Add TLS relocs.
5844         (sh_reloc_map): Likewise.
5845         (sh_elf_info_to_howto): Support TLS relocs.
5846         (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32.
5847         (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type):
5848         New macros.
5849         (sh_elf_obj_tdata): New.
5850         (elf_sh_link_hash_table): Add tls_ldm_got.
5851         (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got.
5852         (allocate_dynrelocs): Support TLS relocs.
5853         (sh_elf_size_dynamic_sections): Likewise.
5854         (sh_elf_relocate_section): Support TLS relocs.  Don't try to find
5855         .rela.got section when found already.  Return false after printing
5856         error about unresolvable relocation.
5857         (sh_elf_gc_sweep_hook): Support TLS relocs.
5858         (sh_elf_check_relocs): Likewise.
5859         (sh_elf_finish_dynamic_symbol): Likewise.
5860         (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case.
5861         * reloc.c: Add SH TLS relocs.
5862         * bfd-in2.h, libbfd.h: Regenerate.
5863
5864 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
5865
5866         * Makefile.in: Regenerated.
5867
5868 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
5869
5870         * Makefile.am: Run dep-am.
5871         (BFD_H_DEP): Add simple.c and linker.c.
5872         (BFD32_LIBS): Add simple.lo.
5873         (BFD32_LIBS_CFILES): Add simple.c.
5874         * Makefile.in: Regenerated.
5875         * bfd-in2.h: Regenerated.
5876         * simple.c: New file.
5877
5878 2002-10-11  Alan Modra  <amodra@bigpond.net.au>
5879
5880         * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers.
5881         (record_thumb_to_arm_glue): Likewise.
5882         * ecoff.c (ecoff_link_add_externals): Likewise.
5883         * elf32-arm.h (record_arm_to_thumb_glue): Likewise.
5884         (record_thumb_to_arm_glue): Likewise.
5885         * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
5886         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
5887         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
5888         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
5889         * elf64-ppc.c (func_desc_adjust): Likewise.
5890         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
5891         (sh64_elf64_create_dynamic_sections): Likewise.
5892         * elflink.c (_bfd_elf_create_got_section): Likewise.
5893         (_bfd_elf_create_dynamic_sections): Likewise.
5894         (_bfd_elf_create_linker_section): Likewise.
5895         * elflink.h (elf_add_default_symbol): Likewise.
5896         (elf_link_create_dynamic_sections): Likewise.
5897         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
5898         * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise.
5899         * elfxx-mips.c (mips_elf_create_got_section): Likewise.
5900         (_bfd_mips_elf_add_symbol_hook): Likewise.
5901         (_bfd_mips_elf_create_dynamic_sections): Likewise.
5902         * linker.c (generic_link_add_symbol_list): Likewise.
5903         * xcofflink.c (xcoff_link_add_symbols): Likewise.
5904
5905         * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define.
5906
5907         * elf64-ppc.c (edit_opd): Only zero opd syms when function is
5908         completely removed.  Correct local sym adjustment.
5909
5910 2002-10-10  Stephen Clarke <stephen.clarke@superh.com>
5911
5912         * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
5913         Correct mistake in calculation of address of .got.
5914         * elf64-sh64.c (elf_sh64_pic_plt_entry_be,
5915         elf_sh64_pic_plt_entry_le): Likewise.
5916
5917 2002-10-09  Richard Shann <richard.shann@superh.com>
5918             Stephen Clarke <stephen.clarke@superh.com>
5919
5920         * Makefile.am: Add entries for elf32-sh64-lin.c and
5921         elf64-sh64-lin.c. Regenerate.
5922         * Makefile.in: Regenerate.
5923         * config.bfd: Change sh64eb-*-linux* and sh64-*-linux*
5924         to use sh64 vectors rather than sh vectors.
5925         * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
5926         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
5927         * configure: Regenerate.
5928         * elf32-sh64-lin.c: New file.
5929         * elf64-sh64-lin.c: New file.
5930         * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
5931         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
5932
5933 2002-10-08  H.J. Lu <hjl@gnu.org>
5934
5935         * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
5936         IE->LE transition for R_386_TLS_IE.
5937
5938 2002-10-08  Alan Modra  <amodra@bigpond.net.au>
5939
5940         * elf64-ppc.c (edit_opd): Correct test for discarded sections.
5941
5942 2002-10-07  Mark Elbrecht  <snowball3@softhome.net>
5943
5944         * cofflink.c (mark_relocs): Don't mark relocations in excluded
5945         sections.
5946
5947 2002-10-07  Alan Modra  <amodra@bigpond.net.au>
5948
5949         * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent
5950         code.
5951
5952         * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx.
5953
5954 2002-10-06  Alan Modra  <amodra@bigpond.net.au>
5955
5956         * opncls.c: Formatting.
5957         (_bfd_new_bfd): Use a smaller section hash table.
5958
5959 2002-10-05  Alexandre Oliva  <aoliva@redhat.com>
5960
5961         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type
5962         of the other two relocations packed with a REL32 to NONE.
5963
5964 2002-10-02  Stephen Clarke <stephen.clarke@superh.com>
5965
5966         * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
5967         (sh_elf_link_hash_newfunc): Initialize it.
5968         (allocate_dynrelocs): Transfer gotplt refs from plt.refcount
5969         to got.refcount for symbols that are forced local or when
5970         we have direct got refs.
5971         (sh_elf_gc_sweep_hook): Adjust gotplt_refcount.  Use it
5972         to correctly adjust got.refcount and plt.refcount.
5973         (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across.
5974         (sh_elf_check_relocs): Increment gotplt_refcount.
5975
5976 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5977
5978         * elf32-i386.c (elf_i386_relocate_section): Fix
5979         movl foo@indntpoff, %eax IE->LE transition.
5980
5981 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5982
5983         * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD
5984         sequence and its transitions.
5985
5986 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5987
5988         * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
5989         to st_value + addend in non-code sections.
5990         * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
5991         R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
5992
5993 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
5994             Ken Raeburn  <raeburn@cygnus.com>
5995             Aldy Hernandez  <aldyh@redhat.com>
5996             Eric Christopher  <echristo@redhat.com>
5997             Richard Sandiford  <rsandifo@redhat.com>
5998
5999         * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
6000         (bfd_mach_mips5500): New.
6001         * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New.
6002         (arch_info_struct): Add corresponding entries here.
6003         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120,
6004         E_MIPS_MACH_5400 and E_MIPS_MACH_5500.
6005         (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120,
6006         bfd_mach_mips5400 and bfd_mach_mips5500.
6007         (_bfd_mips_elf_mach_extends_p): New function.
6008         (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge
6009         the EF_MIPS_MACH flags.
6010         * bfd-in2.h: Regenerate.
6011
6012 2002-09-28  Jason Thorpe  <thorpej@wasabisystems.com>
6013
6014         * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip
6015         .got sections.
6016
6017 2002-09-28  Alan Modra  <amodra@bigpond.net.au>
6018
6019         * elf.c (map_sections_to_segments): Correct test for start of
6020         writable section in the same page as end of read-only section.
6021
6022 2002-09-27  Matt Thomas  <matt@3am-software.com>
6023
6024         * elf32-vax.c (elf_vax_check_relocs): Remove unused
6025         local_got_refcounts usage.  Remove allocation of got slot.
6026         (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage.
6027         Remove de-allocation of got slot.
6028         (elf_vax_size_dynamic_section): Fix some indentation.  Add hash
6029         traversal for elf_vax_instantiate_got_entries.  Allow empty .got
6030         sections to be GC'ed.
6031         (elf_vax_instantiate_got_entries): New function.
6032         (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling.  Remove
6033         tests that are now handled by elf_vax_instantiate_got_entries.
6034         Assert GOT entry falls within .got section size.  Remove redundant
6035         comparisions.  Fix comments.
6036
6037 2002-09-27  Jakub Jelinek  <jakub@redhat.com>
6038
6039         * reloc.c: Add x86-64 TLS relocs.
6040         * bfd-in2.h, libbfd.h: Rebuilt.
6041         * elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit
6042         relocs.  Add TLS relocs.
6043         (x86_64_reloc_map): Add TLS relocs.
6044         (elf64_x86_64_info_to_howto): Adjust for added TLS relocs.
6045         (struct elf64_x86_64_link_hash_entry): Add tls_type field.
6046         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define.
6047         (elf64_x86_64_hash_entry): Define.
6048         (struct elf64_x86_64_obj_tdata): New.
6049         (elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define.
6050         (struct elf64_x86_64_link_hash_table): Add tls_ld_got.
6051         (link_hash_newfunc): Initialize tls_type.
6052         (elf64_x86_64_link_hash_table_create): Initialize tls_ld_got.
6053         (elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary.
6054         (elf64_x86_64_mkobject): New.
6055         (elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata.
6056         (elf64_x86_64_tls_transition): New.
6057         (elf64_x86_64_check_relocs): Add r_type variable and use it.
6058         Handle TLS relocs.
6059         (elf64_x86_64_gc_sweep_hook): Handle TLS relocs.
6060         (allocate_dynrelocs): Allocate GOT space for TLS relocs.
6061         (elf64_x86_64_size_dynamic_sections): Likewise.
6062         (dtpoff_base, tpoff): New.
6063         (elf64_x86_64_relocate_section): Handle TLS relocs.
6064         (elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT
6065         entries.
6066         (bfd_elf64_mkobject): Define.
6067
6068         * elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set
6069         DF_STATIC_TLS if shared.
6070
6071 2002-09-26  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6072
6073         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Don't emit unneeded
6074         empty relocation sections.
6075
6076 2002-09-26  Alan Modra  <amodra@bigpond.net.au>
6077
6078         * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here.
6079         (ppc64_elf_build_stubs): Build them here instead.
6080
6081 2002-09-24  Jakub Jelinek  <jakub@redhat.com>
6082
6083         * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE
6084         addend into r_addend, not *r_offset.
6085         (elf32_sparc_finish_dynamic_symbol): Likewise.
6086         * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at
6087         R_SPARC_RELATIVE's r_offset.
6088
6089 2002-09-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
6090
6091         * dwarf2.c (decode_line_info): Update to correctly decode
6092         the (non-standard DWARF2) out-of-order address sequences
6093         generated by the Intel C++ 6.0 compiler for ia64-Linux.
6094
6095 2002-09-23  Mark Elbrecht  <snowball3@softhome.net>
6096
6097         * config.bfd: For DJGPP targets, match with any cpu and any machine.
6098
6099 2002-09-23  Alan Modra  <amodra@bigpond.net.au>
6100
6101         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs
6102         for discarded FDEs.  Remove redundant assignment.
6103         * elflink.h (elf_bfd_discard_info): Save edited relocs.
6104
6105 2002-09-22  H.J. Lu <hjl@gnu.org>
6106
6107         * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge
6108         the relocation count between different .reloc sections.
6109
6110 2002-09-21  Alan Modra  <amodra@bigpond.net.au>
6111
6112         * elf32-ppc.c (ppc_elf_relocate_section): Allow ".sbss.*" and
6113         ".sdata.*" for R_PPC_SDAREL16, ".sbss2*" and ".sdata2*" for
6114         R_PPC_EMB_SDA2REL.  Similarly for R_PPC_EMB_SDA21 and
6115         R_PPC_EMB_RELSDA.
6116
6117         * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount"
6118         unsigned.  Move "symcount" assignment out of loop.
6119         * Makefile.am: Run "make dep-am".
6120         * Makefile.in: Regenerate.
6121         * configure: Regenerate.
6122         * po/SRC-POTFILES.in: Regnerate.
6123
6124 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
6125
6126         * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is
6127         zero, set it to 8 for (non-standard) 64-bit DWARF2 formats
6128         (e.g. IRIX64).
6129
6130 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
6131
6132         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word
6133         even if generating R_PPC_RELATIVE reloc.
6134         (ppc_elf_relocate_section): Make sure relocation is performed
6135         if skip == -2.  Clear memory at r_offset when creating dynamic
6136         relocation.
6137
6138 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
6139
6140         * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE,
6141         BFD_RELOC_386_TLS_GOTIE): Add.
6142         * bfd-in2.h, libbfd.h: Rebuilt.
6143         * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE
6144         and R_386_TLS_GOTIE.
6145         (elf_i386_reloc_type_lookup): Handle it.
6146         (struct elf_i386_link_hash_entry): Change tls_type type to unsigned
6147         char instead of enum, change GOT_* into defines.
6148         (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define.
6149         (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
6150         (elf_i386_check_relocs): Likewise.  Avoid crash if local symbol is
6151         accessed both as normal and TLS symbol.  Move R_386_TLS_LDM and
6152         R_386_PLT32 cases so that R_386_TLS_IE can fall through.
6153         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
6154         (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
6155         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
6156         (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if
6157         tls_type is GOT_TLS_IE_BOTH.
6158         (elf_i386_size_dynamic_sections): Likewise.
6159         (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
6160         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
6161         (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch
6162         all 4 GOT_TLS_* TLS types.
6163
6164 2002-09-19  Nick Clifton  <nickc@redhat.com>
6165
6166         * elflink.h (elf_fix_symbol_flags): When examining weak symbols,
6167         follow indirect links.
6168
6169 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
6170
6171         * ecoffswap.h (ecoff_swap_pdr_in) <isym, iline>: Update to
6172         correctly sign-extend 32-bit ECOFF null values (0xffffffff, -1)
6173         on 64 bit machines.
6174         (ecoff_swap_sym_in) <iss>: Likewise.
6175         * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Fix error reading
6176         ECOFF information: 'ioptMax' refers to the actual *size*
6177         of the optimization symtab, not the number of entries.
6178
6179 2002-09-19  Daniel Jacobowitz  <drow@mvista.com>
6180
6181         * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update
6182         ELF_LINK_HASH_NEEDS_PLT logic.
6183
6184 2002-09-18  Daniel Jacobowitz  <drow@mvista.com>
6185
6186         * elfcode.h (elf_slurp_reloc_table_from_section): Check
6187         correct relocation count.
6188
6189 2002-09-17  Daniel Jacobowitz  <drow@mvista.com>
6190
6191         * bfd-in.h (bfd_get_dynamic_symcount): Define.
6192         * bfd.c (struct _bfd): Add dynsymcount.
6193         * bfd-in2.h: Regenerated.
6194         * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set
6195         abfd->dynsymcount.
6196         * elfcode.h (elf_slurp_reloc_table_from_section): Check
6197         for overflow.
6198
6199 2002-09-17  Stan Cox <scox@redhat.com>
6200
6201         * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
6202         (mips_elf64_final_gp): Don't make up gp value.
6203         * elfn32-mips.c (mips_elf_final_gp): Likewise.
6204         * elfxx-mips.c (_bfd_mips_elf_final_link): Always create
6205         .MIPS.options/.options section.
6206
6207 2002-09-17  David O'Brien  <obrien@FreeBSD.org>
6208
6209         * elf32-i386-fbsd.c: Always label using the EI_OSABI method.
6210         It is benign for FreeBSD < 4.1.  Minor reformatting.
6211         * elf64-alpha-fbsd.c: Likewise.
6212
6213 2002-09-17  Jakub Jelinek  <jakub@redhat.com>
6214
6215         * elf32-i386.c (elf_i386_relocate_section) [R_386_TLS_TPOFF32]: Negate
6216         addend.
6217
6218 2002-09-17  Alan Modra  <amodra@bigpond.net.au>
6219
6220         * elf64-alpha.c (alpha_elf_size_info): Make static.
6221
6222 2002-09-17  Svein E. Seldal  <Svein.Seldal@solidas.com>
6223
6224         * coff-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED.
6225         * cpu-tic4x.c: Ditto.
6226
6227 2002-09-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6228
6229         * elf64-mips.c (define elf_backend_ignore_discarded_relocs): Remove
6230         duplicate define.
6231
6232 2002-09-16  Bruno Haible  <bruno@clisp.org>
6233
6234         * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included
6235         by a target variant implementation.
6236         * elf64-alpha.c: Likewise.
6237         * elf32-i386-fbsd.c: New file.
6238         * elf64-alpha-fbsd.c: New file.
6239         * targets.c: Support bfd_elf32_i386_freebsd_vec and
6240         bfd_elf64_alpha_freebsd_vec.
6241         * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec,
6242         bfd_elf64_alpha_freebsd_vec.
6243         * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo.
6244         (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c.
6245         (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo.
6246         (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c.
6247         (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies.
6248         * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD
6249         specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate.
6250
6251 2002-09-12  Jakub Jelinek  <jakub@redhat.com>
6252
6253         * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is
6254         NULL.
6255         (elf_i386_relocate_section): Return false after printing error about
6256         unresolvable relocation.
6257
6258 2002-09-12  Nick Clifton  <nickc@redhat.com>
6259
6260         * elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of
6261         R_ARM_THM_PC11.
6262
6263 2002-09-11  Jeffrey Law  <law@redhat.com>
6264
6265         * elf32-h8300.c (elf32_h8_relax_section): Fix typo.
6266
6267 2002-09-11  Andrew Haley  <aph@cambridge.redhat.com>
6268
6269         * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and
6270         line_ptr before deciding we've found a symbol.
6271
6272 2002-09-11  Nick Clifton  <nickc@redhat.com>
6273
6274         * po/da.po: New Danish translation file.
6275         * configure.in (LINGUAS): Add 'da'.
6276         * configure: Regenerate.
6277
6278 2002-09-10  Michael Snyder  <msnyder@redhat.com>
6279
6280         * irix-core.c (do_sections, do_sections64): New functions.
6281         (irix_core_core_file_p): Call new functions do_sections,
6282         do_sections64, depending on corefile (32-bit or 64-bit).
6283
6284 2002-09-09  Richard Henderson  <rth@redhat.com>
6285
6286         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21M
6287         and PCREL21F like PCREL21B.
6288
6289 2002-09-04  Kevin Buettner  <kevinb@redhat.com>
6290
6291         * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
6292         vector.
6293
6294 2002-09-02  Nick Clifton  <nickc@redhat.com>
6295
6296         * elf32-v850.c (v850_elf_final_link_relocate): Use helpful
6297         names instead of cryptically overloaded bfd_reloc error
6298         codes.
6299         (v850_elf_relocate_section): Likewise.
6300         (v850_elf_relax_section): Replace caching of external symbols
6301         with caching of internal symbols obtained from calling
6302         bfd_elf_get_elf_syms().
6303         Fixup problems with freeing cached allocated memory blocks.
6304
6305 2002-09-02  Alan Modra  <amodra@bigpond.net.au>
6306
6307         * cpu-pj.c (scan_mach, compatible, arch_info_struct): Remove.
6308         (bfd_pj_arch): Use bfd_default_scan.
6309         * cpu-v850.c (scan): Remove.
6310         (N): Use bfd_default_scan.
6311         * cpu-z8k.c (scan_mach): Remove.
6312         (arch_info_struct, bfd_z8k_arch): Reorganize so that the default is
6313         first.  Use bfd_default_scan.
6314
6315         * ecoff.c (_bfd_ecoff_set_arch_mach_hook): Don't use hard-coded
6316         bfd_mach constants.
6317         (ecoff_get_magic): Likewise.
6318         * elf32-v850.c (v850_elf_object_p): Likewise.
6319         (v850_elf_final_write_processing): Likewise.
6320         * mipsbsd.c (MY(set_arch_mach)): Likewise.
6321         (MY(write_object_contents)): Likewise.
6322         * coff64-rs6000.c (xcoff64_write_object_contents): Likewise.
6323         * coffcode.h (coff_write_object_contents): Likewise.
6324         (coff_set_arch_mach_hook): Add comment describing machine == 0.
6325         Remove unnecessary "machine" assignments.
6326         (coff_write_relocs): Test for the absolute section sym by testing
6327         section and flags.
6328
6329         * aoutx.h (NAME(aout,machine_type)): Recognize bfd_mach_i386_i386
6330         and bfd_mach_i386_i386_intel_syntax.
6331         * pdp11.c (NAME(aout,machine_type)): Likewise.
6332
6333 2002-08-30  John David Anglin  <dave@hiauly1.hia.nrc.ca>
6334
6335         * bfd-in.h (align_power): Cast constants to bfd_vma type.
6336         * bfd-in2.h (align_power): Likewise.
6337
6338 2002-08-30  Alan Modra  <amodra@bigpond.net.au>
6339
6340         * Makefile.am: Run "make dep-am".
6341         * Makefile.in: Regenerate.
6342
6343         * cpu-avr.c (compatible): Don't use hard-coded mach constants.
6344         * cpu-powerpc.c (powerpc_compatible): Likewise.
6345         * cpu-rs6000.c (rs6000_compatible): Likewise.
6346
6347 2002-08-28  Catherine Moore  <clm@redhat.com>
6348
6349         * elf32-v850.c (v850_elf_reloc_map): Add new relocs.
6350         (v850-elf-reloc): Don't resolve pc relative relocs.
6351         (v850_elf_ignore_reloc): New routine.
6352         (v850_elf_final_link_relocate): Handle new relocs.
6353         (v850_elf_relax_delete_bytes ): New routine.
6354         (v850_elf_relax_section): New routine.
6355         (bfd_elf32_bfd_relax_section): Define.
6356         (HOWTO): New entries for new relocs.
6357         * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc.
6358         (BFD_RELOC_V850_LONGJUMP): New reloc.
6359         (BFD_RELOC_V850_ALIGN): New reloc.
6360         * archures.c: Remove redundant v850ea architecture.
6361         * cpu-v850.c: Remove redundant v850ea support.
6362         * libbfd.h: Regenerate.
6363         * bfd-in2.h: Regenerated.
6364
6365 2002-08-28  Svein E. Seldal  <Svein.Seldal@solidas.com>
6366
6367         * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target.
6368         * configure.in: Add tic4x_coff vector files.
6369         * configure: Regenerate.
6370         * Makefile.am: Add tic4x target.
6371         * Makefile.in: Regenerate.
6372
6373 2002-08-27  Michael Hayes <m.hayes@elec.canterbury.ac.nz>
6374
6375         * archures.c: Add the BFD arch type tic4x.
6376         * bfd-in.h: Add BFD_IN_MEMORY flag.
6377         * coff-tic4x.c: New file.
6378         * coffswap.h (coff_swap_sym_out): Add preadjuster.
6379         * cpu-tic4x.c: New file.
6380         * targets.c: Added tic4x- in list of xvecs.
6381         * ticoff.h: New file.
6382         * bfd-in2.h: Regenerate.
6383
6384 2002-08-27  Adam Nemet  <anemet@lnxw.com>
6385
6386         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last
6387         bit of DT_INIT and DT_FINI for Thumb functions.
6388
6389 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
6390
6391         * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC.
6392
6393 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
6394
6395         * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8.
6396
6397 2002-08-24  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6398
6399         * elf32-sh.c (sh_elf_copy_indirect_symbol): New.
6400         (create_got_section, allocate_dynrelocs, readonly_dynrelocs):
6401         Likewise.
6402         (struct elf_sh_pcrel_relocs_copied): Removed.
6403         (struct elf_sh_dyn_relocs): New.
6404         (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied
6405         field with dyn_relocs.
6406         (struct elf_sh_link_hash_table): Add short-cuts to get dynamic
6407         sections and sym_sec.
6408         (sh_elf_link_hash_newfunc): Clear dyn_relocs.
6409         (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec.
6410         (sh_elf_create_dynamic_sections): Use create_got_section instead
6411         of _bfd_elf_create_got_section.
6412         (sh_elf_check_relocs): Likewise.
6413         (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic
6414         sections.
6415         (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections,
6416         sh_elf_relocate_section, sh_elf_check_relocs,
6417         sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections):
6418         Likewise.
6419         (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the
6420         dynamic relocations and avoiding the copy relocation when we
6421         didn't find any dynamic relocations in the section which has
6422         contents or is read-only.
6423         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
6424         (sh_elf_size_dynamic_sections): Don't reset the size of
6425         .rela.got section even if dynamic_sections_created flag is off.
6426         Don't use sh_elf_discard_copies. Scan all input bfd and use
6427         allocate_dynrelocs. Call readonly_dynrelocs to determine
6428         whether we need DT_TEXTREL.
6429         (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine
6430         whether the symbol was never referred to.
6431         (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL.
6432         (sh_elf_gc_sweep_hook): Fill with the real sweep function.
6433         (sh_elf_check_relocs): Call create_got_section if the short-cut
6434         to .got is null. Increment reference counters only instead of
6435         allocating space on dynamic sections here. Don't conditionalize
6436         uninitialized got.offset value when marking the symbol as a
6437         global offset table entry. Keep relocations for symbols satisfied
6438         by a dynamic library to avoid copy relocations for the symbol.
6439         Set dynobj field of an elf hash table if needed.
6440         (sh_elf_finish_dynamic_sections): Handle null section pointer
6441         correctly.
6442         (elf_backend_copy_indirect_symbol): Defined.
6443         (elf_backend_can_refcount): Defined.
6444
6445 2002-08-23  Nick Clifton  <nickc@redhat.com>
6446
6447         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo
6448         previous change.  Add comment explaining why.
6449
6450 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
6451
6452         * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy
6453         contents of .got.plt[2] to tr0, not address of .got.plt.
6454         (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when
6455         patching absolute plt entry. For shmedia plt entry, set bottom bit
6456         of branch to plt0 as this is a branch to an shmedia instruction.
6457         * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le):
6458         Copy contents of .got.plt[2] to tr0, not address of .got.plt.
6459         (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to
6460         branch to plt0.
6461         (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when
6462         patching absolute plt entry. For shmedia plt entry, branch to
6463         plt0 is now ptrel, so use relative offset.  Set bottom bit of
6464         branch target as it is a branch to an shmedia instruction.
6465
6466 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>,
6467             Richard Shann <richard.shann@superh.com>
6468
6469         * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
6470         value if .init is an SHmedia function.  Similarly for DT_FINI.
6471         * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
6472
6473 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
6474
6475         * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
6476         dynamic section.
6477         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
6478
6479 2002-08-22  Kaz Kojima <kkojima@rr.iij4u.or.jp>
6480
6481         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
6482         byte read when reading the return address register column.
6483
6484 2002-08-22  Nick Clifton  <nickc@redhat.com>
6485
6486         * config.bfd: Add powepc64-*-*bsd* target.
6487
6488 2002-08-22  Graeme Peterson  <gp@qnx.com>
6489
6490         * Makefile.am: Add entries for elf32-shqnx.c
6491         * Makefile.in: Regenerate.
6492         * config.bfd: Add support sh-*-nto* target.
6493         * configure.in: Add support for bfd_elf32_sh{l}qnx_vec.
6494         * configure: Regenerate.
6495         * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" .
6496         * elf32-sh.c: Do not include elf32-target.h if
6497         ELF32_SH_C_INCLUDED is defined.
6498         * elf32-shqnx.c: New file: Support for QNX.
6499         * targets.c: Add bfd_elf32_sh{l}qnx_vec.
6500
6501 2002-08-22  Nick Clifton  <nickc@redhat.com>
6502
6503         * po/tr.po: Updated Turkish translation.
6504
6505         * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the
6506         symbols are not read.
6507
6508 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6509
6510         * elf32-m68hc11.c: Formatting fixes.
6511         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
6512         * elf32-m68hc12.c: Formatting fixes.
6513         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
6514
6515 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6516
6517         * coff-rs6000.c (rs6000coff_vec <object_flags>): Add SEC_CODE and
6518         SEC_DATA.
6519         (pmac_xcoff_vec): Likewise.
6520         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
6521         (aix5coff64_vec): Likewise.
6522
6523 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6524
6525         * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data
6526         param to elf_backend_copy_indirect_symbol.
6527         (_bfd_elf_link_hash_copy_indirect): Likewise.
6528         * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust
6529         calls to copy_indirect_symbol.
6530         * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
6531         * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
6532         * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
6533         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
6534         * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
6535         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise.
6536         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
6537         * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
6538         * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise.
6539         * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise.  Properly
6540         test refcounts for "used" values.
6541
6542 2002-08-21  John David Anglin  <dave@hiauly1.hia.nrc.ca>
6543
6544         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to
6545         argument declaration.
6546
6547 2002-08-19  Elena Zannoni <ezannoni@redhat.com>
6548
6549         * archures.c (bfd_mach_ppc_e500): Added.
6550         * bfd-in2.h: Rebuilt.
6551         * cpu-powerpc.c (bfd_powerpc_archs): Added e500.
6552
6553 2002-08-19  Alan Modra  <amodra@bigpond.net.au>
6554
6555         * elf32-m68hc12.c (elf_backend_can_gc_sections): False.
6556
6557 2002-08-17  Andrew Cagney  <ac131313@redhat.com>
6558
6559         * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
6560         `bfd_byte'.
6561
6562 2002-08-17  Stan Cox  <scox@redhat.com>
6563
6564         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the
6565         IRIX 6 segment layout for NEWABI.
6566
6567 2002-08-16  Stephen Clarke <stephen.clarke@superh.com>
6568
6569         * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
6570         symbols when looking for section referred to by a relocation.
6571         * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
6572
6573 2002-08-15  Alan Modra  <amodra@bigpond.net.au>
6574
6575         * elf32-i370.c: Move reloc enum to include/elf/i370.h.
6576
6577 2002-08-15  Hans-Peter Nilsson  <hp@axis.com>
6578
6579         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add
6580         missing check for whether the symbol is referenced by DSO before
6581         unexporting it as an unneeded dynamic symbol.
6582
6583 2002-08-14  H.J. Lu <hjl@gnu.org>
6584
6585         * libbfd.h: Regenerate.
6586
6587 2002-08-14  H.J. Lu <hjl@gnu.org>
6588
6589         * config.bfd: Always add 64bit vectors to 32bit Linux/mips.
6590
6591 2002-08-14  Stephane Carrez  <stcarrez@nerim.fr>
6592
6593         * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of
6594         instructions.
6595         (m68hc11_direct_relax): New to define table of relaxable instructions.
6596         (find_relaxable_insn): New, find a relaxable insn.
6597         (compare_reloc): New to compare two relocs.
6598         (m68hc11_elf_relax_section): New, relax text sections.
6599         (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs.
6600         (elf32_m68hc11_check_relocs): New function for GC support.
6601         (elf32_m68hc11_relocate_section): New function for GC support.
6602         (bfd_elf32_bfd_relax_section): Define to support linker relaxation.
6603         (elf_backend_check_relocs): Likewise.
6604         (elf_backend_relocate_section): Likewise.
6605
6606 2002-08-13  H.J. Lu <hjl@gnu.org>
6607
6608         * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count
6609         definitions in shared objects when checking symbol with
6610         undefined version.
6611
6612 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6613
6614         * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC.
6615         (elf32_m68hc11_gc_sweep_hook): Likewise.
6616         (elf_backend_gc_mark_hook): Define for GC section support.
6617         (elf_backend_gc_sweep_hook): Likewise.
6618         (elf_backend_can_gc_sections): Likewise.
6619
6620         * elf32-m68hc12.c: Likewise.
6621
6622 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6623
6624         * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New.
6625         (_bfd_m68hc11_elf_merge_private_bfd_data): New function.
6626         (_bfd_m68hc11_elf_set_private_flags): New function.
6627         Use them to set/check/print ELF flags specific to 68HC11.
6628
6629         * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New.
6630         (_bfd_m68hc12_elf_merge_private_bfd_data): New function.
6631         (_bfd_m68hc12_elf_set_private_flags): New function.
6632         Use them to set/check/print ELF flags specific to 68HC12.
6633
6634 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6635
6636         * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs;
6637         fix masks for PC-rel relocs.
6638         (m68hc11_elf_ignore_reloc): New function.
6639
6640         * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific
6641         68HC12 banked addressing relocs.
6642         (m68hc12_phys_addr): New to compute physical address of banked memory.
6643         (m68hc12_phys_page): Likewise for page.
6644         (m68hc12_addr_is_banked): New to see if address is in banked area.
6645         (elf_m68hc12_howto_table): Add new relocs and rename to xx12.
6646
6647 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6648
6649         * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP,
6650         BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE,
6651         BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12.
6652         * bfd-in2.h: Regenerate.
6653
6654 2002-08-12  H.J. Lu <hjl@gnu.org>
6655
6656         * elflink.h (elf_add_default_symbol): Preserve section across
6657         elf_merge_symbol.
6658
6659 2002-08-09  Graeme Peterson  <gp@qnx.com>
6660
6661         * Makefile.am: Add entries for elf32-ppcqnx.c, and add
6662         elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c.
6663         * Makefile.in: Regenerate.
6664         * config.bfd: Add support for powerpc{le}-*-nto targets.
6665         * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec.
6666         * configure: Regenerate.
6667         * elf32-i386qnx.c: Moved backend functions into a QNX specific
6668         common file "elf32-qnx.h", and now include that file.
6669         * elf32-qnx.h: New file: QNX specific common elf backend.
6670         * elf32-ppc.c: Do not include elf32-target.h if
6671         ELF32_PPC_C_INCLUDED is defined.
6672         * elf32-ppcqnx.c: New file: Support for QNX.
6673         * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend.
6674         * targets.c: Add bfd_elf32_powerpc{le}qnx_vec.
6675
6676 2002-08-09  Nick Clifton  <nickc@redhat.com>
6677
6678         * po/sv.po: Updated Swedish translation.
6679
6680 2002-08-09  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6681
6682         * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if
6683         g->global_gotsym is NULL.
6684
6685 2002-08-08  H.J. Lu <hjl@gnu.org>
6686
6687         * elflink.h (elf_add_default_symbol): Don't warn if a definition
6688         overrides an indirect versioned symbol.
6689
6690 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
6691
6692         * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
6693         for R_386_TLS_TPOFF32 relocs against symndx 0.
6694
6695 2002-08-07  H.J. Lu <hjl@gnu.org>
6696
6697         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol
6698         with undefined version if needed.
6699         (elf_link_assign_sym_version): Match a default symbol with a
6700         version without definition. No need to hide the default
6701         definition separately.
6702
6703 2002-08-08  Alan Modra  <amodra@bigpond.net.au>
6704
6705         * elflink.h (elf_link_output_extsym): Don't output symbols from
6706         SEC_EXCLUDE sections.
6707
6708         * aoutx.h (aout_link_write_symbols): Correct handling of warning syms.
6709
6710 2002-08-07  Alan Modra  <amodra@bigpond.net.au>
6711
6712         * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd
6713         entries.
6714
6715 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6716
6717         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness
6718         mismatch.
6719
6720 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6721
6722         * elfxx-mips.c (ABI_64_P): Remove superfluous check.
6723
6724 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6725
6726         * elf32-mips.c (mips_reloc_map): Fix typo.
6727
6728 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6729
6730         * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section.
6731
6732 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6733
6734         * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries.
6735
6736 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6737
6738         * libxcoff.h: Use PARAMS on function declarations.
6739         * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc.
6740         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
6741
6742         * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in
6743         addend.
6744         * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise.
6745
6746 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6747
6748         * coff-rs6000.c: Formatting fixes.
6749         (xcoff_calculate_relocation): Use PARAMS in declaration.
6750         (xcoff_complain_overflow): Likewise.
6751         (xcoff_ppc_relocate_section): Use old-style function pointer call.
6752         (bfd_xcoff_backend_data): Remove useless comments.
6753         (rs6000coff_vec): Likewise.
6754         (bfd_pmac_xcoff_backend_data): Likewise.
6755         (pmac_xcoff_vec): Likewise.
6756
6757         * coff64-rs6000.c: Formatting fixes.
6758         (xcoff64_calculate_relocation): Use PARAMS in declaration.
6759         (xcoff64_ppc_relocate_section): Use old-style function pointer call.
6760         (bfd_xcoff_backend_data): Remove useless comments.
6761         (rs6000coff64_vec): Likewise.
6762         (bfd_xcoff_aix5_backend_data): Likewise.
6763         (aix5coff64_vec): Likewise.
6764
6765 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6766
6767         * coff-rs6000.c (xcoff_howto_table): Revert some of last change to
6768         mask entries.  Use complain_overflow_dont for R_REF.
6769         (xcoff_reloc_type_ba): Revert last change.
6770         (xcoff_reloc_type_br): Likewise.
6771         (xcoff_reloc_type_crel): Likewise.
6772         (xcoff_ppc_relocate_section): Likewise.
6773         * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise.
6774         (xcoff64_ppc_relocate_section): Likewise.
6775         (xcoff64_howto_table): Revert some of last change to mask entries.
6776         Use complain_overflow_dont for R_REF.
6777
6778         * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries.  Make all
6779         relocs with bitsize == 16 have size = 1.
6780         (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment.
6781         (xcoff_reloc_type_br): Likewise.
6782         (xcoff_reloc_type_crel): Likewise.
6783         (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly.
6784         * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and
6785         dst_mask adjustment.
6786         (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly.
6787         (xcoff64_howto_table): Fix src_mask entries.  Make all relocs with
6788         bitsize == 16 have size = 1.
6789
6790 2002-08-01  Denis Chertykov  <denisc@overta.ru>
6791
6792         * elf32-ip2k.c: Processor manufacturer changed to Ubicom.
6793         (struct misc): New field isymbuf. All free_* fields removed.
6794         (symbol_value): Pass in internal syms. No need to swap syms in.
6795         (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free
6796         possibly cached info.
6797         (tidyup_after_error): Removed.
6798         (ip2k_elf_relax_section_pass1): Don't use removed fields of struct
6799         misc. Use new field.
6800         (adjust_all_relocations): Use internal syms. No need to swap syms
6801         in and out.
6802         (add_page_insn): Don't use removed fields of struct misc.
6803
6804 2002-08-01  Nick Clifton  <nickc@redhat.com>
6805
6806         * elf32-arm.h: Revert previous delta.
6807
6808 2002-08-01  Nick Clifton  <nickc@redhat.com>
6809
6810         * configure.in (AM_INIT_AUTOMAKE): Bump version number.
6811         * configure: Regenerate.
6812
6813 2002-07-31  H.J. Lu <hjl@gnu.org>
6814
6815         * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is
6816         selected.
6817
6818 2002-07-31  H.J. Lu <hjl@gnu.org>
6819
6820         * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD
6821         is selected.
6822
6823 2002-07-31  Jakub Jelinek  <jakub@redhat.com>
6824
6825         * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type
6826         if _bfd_elf_link_hash_copy_indirect will swap got.refcount.
6827
6828 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
6829
6830         * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate):
6831         There is no 8 byte relocation type for this architecture.
6832         (do_ns32k_reloc): Use bfd_vma instead of native types.
6833         (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data
6834         returns void.
6835         (_bfd_ns32k_put_displacement): Don't check for overflow. We can
6836         rely on generic code to do that.
6837         * aout-ns32k.c (howto_table): Add appropriate overflow detection
6838         to all table entries.
6839         (_bfd_ns32k_relocate_contents): put_data returns void.
6840         * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate)
6841         (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions
6842         return void.
6843
6844 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
6845
6846         * aoutx.h (aout_link_check_ar_symbols): Whether to include an
6847         archive object is target dependant.
6848
6849 2002-07-31  Adam Nemet  <anemet@lnxw.com>
6850
6851         * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE.
6852         (THUMB_PLT_ENTRY_SIZE): New macro.
6853         (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE.
6854         (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to
6855         ARM_PLT_ENTRY_SIZE.
6856         (elf32_arm_plt_entry): Likewise.
6857         (elf_backend_plt_header_size): Likewise.
6858         (elf32_thumb_plt0_entry): New global.
6859         (elf32_arm_finish_dynamic_sections): Use it.  Put Thumb entries
6860         into .plt.thumb.
6861         (elf32_thumb_plt_entry): New global.
6862         (elf32_arm_finish_dynamic_symbol): Use it.  Use .thumb.plt for
6863         Thumb entries.  Set the bottom bit of the corresponding GOT entry
6864         for a Thumb PLT entry.
6865         (struct elf32_arm_plt_entry_info): New structure.
6866         (struct elf32_arm_link_hash_entry, plt_info): New member of this
6867         type.
6868         (elf32_arm_link_hash_newfunc): Initialize new member.
6869         (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle
6870         relocations against the PLT.
6871         (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set
6872         first_rel_type if this is the first time we encounter the symbol.
6873         (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case.
6874         Determine if relocation needs a PLT entry.  Set first_rel_type if
6875         this is the first time we encounter the symbol
6876         (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb
6877         functions as well.
6878         (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt.
6879         (elf32_arm_create_dynamic_sections): New function.  Create the
6880         .plt.thumb section.
6881         (elf_backend_create_dynamic_sections): Call it.
6882
6883 2002-07-31  Nick Clifton  <nickc@redhat.com>
6884
6885         * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to
6886         'alternative' in order to avoid shadowing global symbol of the
6887         same name.
6888         * bfd-in2.h: Regenerate.
6889         * libbfd.h: Regenerate.
6890         * libcoff.h: Regenerate.
6891
6892 2002-07-31  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6893
6894         * Makefile.am: Add n32 ABI support.
6895         * Makefile.in: Regenerate.
6896         * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64
6897         bit vectors for mips*-*-linux targets as optional.
6898         * configure.in: Add n32 ABI vectors.
6899         * configure: Regenerate.
6900         * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files.
6901         * elfn32-mips.c: New file, n32 ABI support.
6902         * targets.c: Add n32 ABI vectors.
6903
6904 2002-07-30  Graeme Peterson  <gp@qnx.com>
6905
6906         * elfarmqnx-nabi.c: New file: Support for QNX.
6907         * config.bfd: Add support for arm-*-nto target.
6908         * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec.
6909         * configure: Regenerate.
6910         * Makefile.am: Add entries for elfarmqnx-nabi.c.
6911         * Makefile.in: Regenerate.
6912         * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined.
6913         Do not define global function if ELFARM_NABI_C_INCLUDED is defined.
6914         * elfarm-nabi.c: Do not include elf32-arm.h if
6915         ELFARM_NABI_C_INCLUDED is defined.
6916         * targets.c: Add bfd_elf32_{big|little}armqnx_vec.
6917
6918 2002-07-30  Nick Clifton  <nickc@redhat.com>
6919
6920         * po/sv.po: Updated Swedish translation.
6921
6922 2002-07-30  Jakub Jelinek  <jakub@redhat.com>
6923
6924         * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type.
6925
6926 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
6927
6928         * aoutx.h (some_aout_object_p): Clean up tdata properly on error.
6929         * archive.c (bfd_generic_archive_p): Likewise.
6930         * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise.
6931         (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol.
6932         * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
6933         (xcoff64_archive_p): Likewise.
6934         (xcoff64_openr_next_archived_file): Likewise.
6935         (xcoff64_archive_p): Clean up tdata properly on error.
6936         * coffgen.c (coff_real_object_p): Likewise.
6937         (coff_object_p): Release filehdr and opthdr.
6938         * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error.
6939         * ieee.c (ieee_archive_p): Likewise.
6940         * ihex.c (ihex_object_p): Likewise.
6941         (ihex_mkobject): Always allocate tdata.
6942         * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error.
6943         * srec.c (srec_mkobject): Always allocate tdata.
6944         (srec_object_p): Clean up tdata properly on error.
6945         (symbolsrec_object_p): Likewise.
6946         * versados.c (versados_object_p): Likewise.
6947         * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc,
6948         and bfd_realloc instead of realloc.
6949         (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections.
6950         * vms.c (vms_initialize): Always allocate tdata.  Use bfd_alloc in
6951         place of bfd_malloc, simplifying error freeing.  Free hash table too.
6952         (vms_object_p): Clean up tdata on error.
6953         (vms_mkobject): Don't complain on stderr if vms_initialize fails.
6954         (vms_close_and_cleanup): Adjust for bfd_alloc use.
6955
6956 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
6957
6958         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags.
6959
6960 2002-07-26  Chris Demetriou  <cgd@broadcom.com>
6961
6962         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE
6963         flags into resulting BFD.
6964
6965 2002-07-26  Alan Modra  <amodra@bigpond.net.au>
6966
6967         From John Reiser <jreiser@BitWagon.com>
6968         * elf32-i386.c (elf_i386_link_hash_table_create): Clear
6969         tls_ldm_got.refcount.
6970
6971 2002-07-25  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6972
6973         * elf64-mips.c: Update TODO comment.
6974         (mips_elf64_higher_reloc,mips_elf64_highest_reloc,
6975         mips_elf64_gprel16_reloca): Remove prototypes.
6976         (mips16_jump_reloc,mips16_gprel_reloc): Add functions.
6977         (UNUSED_RELOC): Replace by EMPTY_RELOC.
6978         (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove
6979         wrong comments. Remove disfunctional support of R_MIPS_HIGHER and
6980         R_MIPS_HIGHEST.
6981         (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and
6982         R_MIPS_GOT16. Remove wrong comments.
6983         (elf_mips16_jump_howto,elf_mips16_gprel_howto,
6984         elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code
6985         from elf32-mips.c.
6986         (mips_elf64_hi16_reloc): Fix formatting.
6987         (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove.
6988         (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code.
6989         Better comment. Fall back to R_MIPS_GOT_DISP instead of abort().
6990         (mips_elf64_gprel16_reloc): Make static. Add check for
6991         partial_inplace.
6992         (mips_elf64_gprel16_reloca): Remove.
6993         (mips_elf64_literal_reloc): New function.
6994         (mips_elf64_gprel32_reloc): Fix formatting.
6995         (mips_elf64_shift6_reloc): Fix comment. Make static.
6996         (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from
6997         elf32-mips.c.
6998         (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in
6999         elf32-mips.c
7000         (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU
7001         specific relocations.
7002         (mips_elf64_rtype_to_howto): Enable GNU specific relocations.
7003         (mips_elf64_object_p): Invert logic to check for SGI-ish ABI.
7004         (ELF_MAXPAGESIZE): Add comment.
7005
7006 2002-07-25  Nick Clifton  <nickc@redhat.com>
7007
7008         * po/sv.po: Updated Swedish translation.
7009         * po/es.po: Updated Spanish translation.
7010         * po/fr.po: Updated French translation.
7011
7012 2002-07-25  Alan Modra  <amodra@bigpond.net.au>
7013
7014         * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define
7015         as elf_link_record_local_dynamic_symbol.
7016         (_bfd_elf64_link_record_local_dynamic_symbol): Likewise.
7017         (elf_link_record_local_dynamic_symbol): Declare.  Now returns int.
7018         * elflink.h (elf_link_record_local_dynamic_symbol): Move to..
7019         * elflink.c: .. here.  Use bfd_elf_get_elf_syms.  Check whether an
7020         attempt is made to record a symbol in a discarded section, and
7021         return `2' in that case.
7022
7023 2002-07-24  Nick Clifton  <nickc@redhat.com>
7024
7025         * po/sv.po: Updated Swedish translation.
7026         * po/es.po: Updated Spanish translation.
7027
7028 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
7029
7030         * po/SRC-POTFILES.in: Regenerate.
7031
7032         * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
7033         immediately.  Remove code handling relocatable linking.
7034         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
7035         * elf32-cris.c (cris_elf_relocate_section): Likewise.
7036         * elf32-fr30.c (elf32_frv_relocate_section): Likewise.
7037         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
7038         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
7039         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
7040         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
7041         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
7042         * elf32-v850.c (v850_elf_relocate_section): Likewise.
7043         * elf32-vax.c (elf_vax_relocate_section): Likewise.
7044         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7045         * elf32-avr.c (elf_backend_rela_normal): Define.
7046         * elf32-cris.c: Likewise.
7047         * elf32-fr30.c: Likewise.
7048         * elf32-frv.c: Likewise.
7049         * elf32-h8300.c: Likewise.
7050         * elf32-hppa.c: Likewise.
7051         * elf32-ip2k.c: Likewise.
7052         * elf32-sparc.c: Likewise.
7053         * elf32-v850.c: Likewise.
7054         * elf32-vax.c: Likewise.
7055         * elf64-hppa.c: Likewise.
7056         * elf64-sparc.c: Likewise.
7057         * elf32-fr30.c (elf32_frv_relocate_section): Edit comment.
7058         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
7059         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
7060         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
7061         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
7062         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
7063         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
7064         * elf-m10200.c (USE_RELA): Don't define.
7065         * elf-m10300.c: Likewise.
7066         * elfarm-oabi.c: Likewise.
7067         * elf32-i370.c: Likewise.
7068         * elf32-ip2k.c: Likewise.
7069         * elf32-m68k.c: Likewise.
7070         * elf32-mcore.c: Likewise.
7071         * elf32-ppc.c: Likewise.
7072         * elf32-s390.c: Likewise.
7073         * elf32-vax.c: Likewise.
7074         * elf64-ppc.c: Likewise.
7075         * elf64-s390.c: Likewise.
7076         * elf64-x86-64.c: Likewise.
7077         * elfxx-ia64.c: Likewise.
7078         * elf32-avr.c (USE_REL): Don't undef.
7079         * elf32-ip2k.c: Likewise.
7080
7081 2002-07-23  Nick Clifton  <nickc@redhat.com>
7082
7083         * elf-bfd.h (struct elf_backend_data): Add new bitfield
7084         'want_p_paddr_set_to_zero'.
7085         * elfxx-target.h: Set default value for want_p_paddr_set_to_zero
7086         to false;
7087         * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target.
7088         * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero.
7089
7090 2002-07-23  Gabor Keresztfalvi  <keresztg@mail.com>
7091
7092         * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of
7093         the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to
7094         show the Copyright string.
7095         Minor formatting tidy ups.
7096
7097 2002-07-23  Nick Clifton  <nickc@redhat.com>
7098
7099         * po/fr.po: Updated French translation.
7100         * po/sv.po: Updated Swedish translation.
7101
7102 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
7103
7104         * elflink.h (elf_link_input_bfd): Don't change internal symbols
7105         when outputting relocs.
7106
7107 2002-07-20  Jason Thorpe  <thorpej@wasabisystems.com>
7108
7109         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert
7110         DT_PLTGOT into the dynamic section if there is a PLT.
7111
7112 2002-07-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7113
7114         * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from
7115         elf32-mips.c.
7116         (_bfd_mips_elf_write_section): Likewise.
7117         * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype.
7118         (_bfd_mips_elf_write_section): Likewise.
7119         * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c.
7120         (elf32_mips_write_section): Likewise.
7121         * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it.
7122         (_bfd_mips_elf_write_section): Likewise.
7123
7124 2002-07-19  Alan Modra  <amodra@bigpond.net.au>
7125
7126         * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan
7127         PT_IA_64_UNWIND segments for a given section.
7128
7129 2002-07-17  H.J. Lu <hjl@gnu.org>
7130
7131         * Makefile.am: Fix a typo.
7132         * Makefile.in: Regenerate.
7133
7134 2002-07-15  Denis Chertykov  <denisc@overta.ru>
7135             Frank Ch. Eigler  <fche@redhat.com>
7136             Ben Elliston  <bje@redhat.com>
7137             Alan Lehotsky  <alehotsky@cygnus.com>
7138             John Healy  <jhealy@redhat.com>
7139             Graham Stott  <grahams@redhat.com>
7140             Jeff Johnston  <jjohnstn@redhat.com>
7141
7142         * Makefile.am: Add support for ip2k.
7143         * Makefile.in: Regenerate.
7144         * doc/Makefile.in: Regenerate.
7145         * archures.c: Add support for ip2k.
7146         * config.bfd: Add support for ip2k.
7147         * configure.in: Add support for ip2k.
7148         * configure: Regenerate.
7149         * reloc.c: Add support for ip2k.
7150         * targets.c: Add support for ip2k.
7151         * bfd-in2.h: Regenerate.
7152         * libbfd.h: Regenerate.
7153         * cpu-ip2k.c: New file.
7154         * elf32-ip2k.c: New file.
7155
7156 2002-07-17  Ian Rickards  <irickard@arm.com>
7157
7158         * dwarf2.c (concat_filename): If we can't establish the directory
7159         just return the filename.
7160
7161 2002-07-16  Moritz Jodeit  <moritz@jodeit.org>
7162
7163         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args.
7164
7165 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
7166
7167         * elflink.h: Formatting fixes, tidy prototypes.
7168         (elf_link_assign_sym_version): Move common code out of loop.
7169
7170 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
7171
7172         * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
7173         reloc section size is zero.  Correct reloc output location.
7174
7175 2002-07-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7176
7177         * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
7178         the final type for the e_fsel selector when generating PA2.0W code.
7179         (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1
7180         relocations.
7181
7182 2002-07-14  H.J. Lu <hjl@gnu.org>
7183
7184         * elflink.h (elf_link_assign_sym_version): Hide the default
7185         definition if there is a hidden versioned definition.
7186
7187 2002-07-12  Hans-Peter Nilsson  <hp@axis.com>
7188
7189         * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical
7190         dynamic reference test in assertion when initializing GOT with
7191         static contents.  Just assert that there are either no dynamic
7192         sections, the symbol is defined in the regular objects or that the
7193         symbol is undef weak.  Tweak comment.
7194         (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program
7195         only if the symbol isn't defined in the program and isn't undef
7196         weak.
7197         (elf_cris_adjust_dynamic_symbol): Simplify condition for getting
7198         rid of PLT entry: only do it if the symbol isn't defined in a DSO.
7199         When doing so, clear ELF_LINK_HASH_NEEDS_PLT.  Tweak comments.
7200         (elf_cris_discard_excess_program_dynamics): Don't consider
7201         ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs.
7202
7203 2002-07-11  Alan Modra  <amodra@bigpond.net.au>
7204
7205         * elf32-i386.c (elf_i386_relocate_section): Don't complain about
7206         unresolved debugging relocs in dynamic applications.
7207         * elf32-s390.c (elf_s390_relocate_section): Likewise.
7208         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
7209         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
7210         * elf64-s390.c (elf_s390_relocate_section): Likewise.
7211         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7212         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
7213
7214 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
7215
7216         * elf64-ppc.c (ONES): Define.
7217         (ppc64_elf_howto_table): Use ONES here to avoid warnings.  Fill in
7218         missing src_mask fields.  Tweak R_PPC64_NONE, R_PPC64_COPY.  Fill
7219         in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32.
7220
7221         * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete.
7222         (ppc64_elf_set_private_flags): Delete.
7223         (ppc64_elf_section_from_shdr): Delete.
7224         (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code.
7225         (ppc64_elf_fake_sections): Delete.
7226         (bfd_elf64_bfd_set_private_flags): Don't define.
7227         (bfd_elf64_get_symbol_info): Likewise.
7228         (elf_backend_section_from_shdr): Likewise.
7229         (elf_backend_fake_sections): Likewise.
7230
7231 2002-07-10  Marco Walther  <Marco.Walther@sun.com>
7232
7233         * elf.c: (assign_section_numbers) Set sh_entsize for .stab only
7234         when not already set.
7235         * elf64-sparc.c: (sparc64_elf_fake_sections): New function.
7236         (elf_backend_fake_sections): Define.
7237
7238 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
7239
7240         * merge.c (_bfd_merge_section): Remove redundant output_section check.
7241         Formatting.
7242         (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections.
7243
7244 2002-07-09  Hans-Peter Nilsson  <hp@axis.com>
7245
7246         * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for
7247         NULL sym_hashes to just before use.
7248         <case R_CRIS_32_GOTREL>: In test for local symbol, accept also
7249         symbol with non-default visibility.
7250         <case R_CRIS_32_GOTREL, case R_CRIS_32_PLT_GOTREL>: Ditto.
7251         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
7252         Ditto.
7253         (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for
7254         symbol with non-default visibility.
7255         (cris_elf_check_relocs): At tests for local symbol before
7256         increasing h->plt.refcount, also check for non-default
7257         visibility.  Ditto when checking for local symbol to eliminate
7258         pc-relative runtime relocs.
7259
7260 2002-07-08  Alan Modra  <amodra@bigpond.net.au>
7261
7262         * elf.c: Formatting.
7263         (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks.
7264         (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP.
7265         (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP
7266         segments.
7267
7268 2002-07-07  Mark Mitchell  <mark@codesourcery.com>
7269             Alan Modra  <amodra@bigpond.net.au>
7270
7271         * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into
7272         account the impact of relocation count overflow when computing
7273         section offsets.
7274         * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether
7275         or not to apply the PE COFF reloc overflow handling.  Fix a
7276         fencepost error in deciding whether or not to use that technique.
7277
7278 2002-07-07  Alan Modra  <amodra@bigpond.net.au>
7279
7280         * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx,
7281         change type of locsyms.
7282         (bfd_elf_get_elf_syms): Declare.
7283         * elf.c (bfd_elf_get_elf_syms): New function.
7284         (group_signature): Use bfd_elf_get_elf_syms.
7285         (bfd_section_from_r_symndx): Likewise.
7286         * elfcode.h (elf_slurp_symbol_table): Likewise.
7287         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7288         (elf_link_add_object_symbols): Likewise.  Reorganise to increase
7289         locality of various data structures.  Properly free internal relocs.
7290         (elf_bfd_final_link): Properly free internal relocs.
7291         (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms.
7292         (elf_link_input_bfd): Likewise.
7293         (elf_gc_mark): Likewise.  Properly free internal relocs.
7294         (elf_gc_sweep): Properly free internal relocs.
7295         (elf_reloc_symbol_deleted_p): No need to swap syms in.
7296         (elf_bfd_discard_info): Use bfd_elf_get_elf_syms.  Properly free
7297         internal relocs.
7298         * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms.
7299         Properly free possibly cached info.
7300         (mn10200_elf_relax_delete_bytes): Remove symbol swapping code.
7301         (mn10200_elf_symbol_address_p): Pass in internal syms.  Remove
7302         symbol swapping code.
7303         (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms.
7304         Properly free possibly cached info.
7305         * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c.
7306         (mn10300_elf_relax_delete_bytes): Likewise.
7307         (mn10300_elf_symbol_address_p): Likewise.
7308         (mn10300_elf_get_relocated_section_contents): Likewise.
7309         * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c.
7310         (elf32_h8_relax_delete_bytes): Likewise.
7311         (elf32_h8_symbol_address_p): Likewise.
7312         (elf32_h8_get_relocated_section_contents): Likewise.
7313         * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c.
7314         (m32r_elf_relax_delete_bytes): Likewise.
7315         (m32r_elf_get_relocated_section_contents): Likewise.
7316         * elf32-sh.c (sh_elf_reloc_loop): Free section contents using
7317         elf_section_data to determine whether cached.
7318         (sh_elf_relax_section): As above for elf-m10200.c.
7319         (sh_elf_relax_delete_bytes): Likewise.
7320         (sh_elf_get_relocated_section_contents): Likewise.
7321         * elf32-xstormy16.c (xstormy16_elf_relax_section): As above.
7322         * elf64-alpha.c (elf64_alpha_relax_section): As above.  Also delay
7323         reading of local syms.
7324         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7325         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above.
7326         * elfxx-ia64.c (elfNN_ia64_relax_section): As above.
7327         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal
7328         relocs.
7329         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly
7330         free internal relocs and section contents.  Don't read symbols.
7331         * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms.
7332         (elf32_hppa_size_stubs): Don't free local syms.
7333         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay
7334         reading of local syms.  Use bfd_elf_get_elf_syms.  Properly free
7335         possibly cached info.
7336         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7337         * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms.
7338         * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and
7339         all_local_syms.
7340         (get_local_syms): Delete function.
7341         (edit_opd): Use bfd_elf_get_elf_syms.  Free on error exit.  Cache
7342         on exit.
7343         (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms.  Free/cache on exit.
7344
7345 2002-07-05  Jim Wilson  <wilson@redhat.com>
7346
7347         * syms.c (decode_section_type): New.
7348         (bfd_decode_symclass): Call decode_section_type.
7349
7350 2002-07-04  Jakub Jelinek  <jakub@redhat.com>
7351
7352         * merge.c (_bfd_merged_section_offset): Avoid accessing byte before
7353         section content start.
7354         Reported by Michael Schumacher <mike@hightec-rt.com>.
7355
7356 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
7357
7358         * section.c (_bfd_strip_section_from_output): Remove unnecessary
7359         link order code.  Don't actually remove the output section here;
7360         Just set a flag for the linker to do so.
7361         * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed
7362         sections when setting up output section dynsyms.
7363
7364 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
7365
7366         * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux
7367         fudge.
7368         * elf.c (bfd_section_from_shdr): Work around broken hpux shared
7369         libs here instead.
7370
7371 2002-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
7372
7373         * elf64-s390.c (create_got_section): Set .got section alignment to
7374         8 bytes.
7375         (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes.
7376
7377 2002-07-02  Alan Modra  <amodra@bigpond.net.au>
7378
7379         * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar.
7380
7381 2002-07-01  Matt Thomas  <matt@3am-software.com>
7382
7383         * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_*
7384         to EF_VAX_*.
7385
7386 2002-07-01  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7387
7388         * elfxx-mips.c (ABI_64_P): Fix comment.
7389         (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the
7390         new section names for N64 ABI.
7391         (mips_elf_output_extsym): No special _gp_disp handling for NewABI.
7392         (mips_elf_calculate_relocation): Code formatting.
7393         (mips_elf_create_dynamic_relocation): Likewise.
7394         (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too.
7395         (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI.
7396         (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64
7397         in any NewABI.
7398         (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling
7399         for NewABI.
7400         (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI.
7401         (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled
7402         here, too.
7403
7404 2002-07-01  Andreas Schwab  <schwab@suse.de>
7405
7406         * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert
7407         R_X86_64_64 to R_X86_64_RELATIVE.
7408
7409 2002-07-01  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7410
7411         * vaxbsd.c: New BFD backend for VAX BSD and Ultrix.
7412         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend.
7413         Run "make dep-am".
7414         * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of
7415         host_aout_vec.
7416         * configure.in (vaxbsd_vec): Add.
7417         * targets.c (vaxbsd_vec): Add.
7418         * Makefile.in: Rebuild.
7419         * configure: Rebuild.
7420         * po/SRC-POTFILES.in: Rebuild.
7421
7422 2002-07-01  Alan Modra  <amodra@bigpond.net.au>
7423
7424         * elflink.h (elf_gc_mark): Pass in the section whose relocs we are
7425         examining to gc_mark_hook, rather than the bfd.
7426         (elf_gc_sections): Adjust.
7427         * elf-bfd.h (struct elf_backend_data <gc_mark_hook>): Likewise.
7428         * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise.
7429         * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
7430         * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
7431         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
7432         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
7433         * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
7434         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
7435         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
7436         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
7437         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
7438         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
7439         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
7440         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
7441         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
7442         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
7443         * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
7444         * elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
7445         * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
7446         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
7447         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
7448         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
7449         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
7450         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
7451         * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
7452         * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise.
7453         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
7454         * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise.  Also remove
7455         redundant local sym tests.
7456         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry.
7457         (link_hash_newfunc): Init is_entry.
7458         (ppc64_elf_copy_indirect_symbol): Copy is_entry.
7459         (ppc64_elf_link_hash_table_create): Init all_local_syms.
7460         (create_linkage_sections): Use bfd_make_section_anyway rather than
7461         bfd_make_section.
7462         (ppc64_elf_mark_entry_syms): New function.
7463         (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab.  Set
7464         up opd entry to function section map.
7465         (ppc64_elf_gc_mark_hook): Special case opd section relocs, and
7466         relocs that reference the opd section.
7467         (edit_opd): New function.
7468         (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd.
7469         (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here.
7470         (get_local_syms): Do so here.  Exit if we already have local syms.
7471         Remove bogus comment imported from elf32-hppa.c.  Don't attempt to
7472         read local syms on non-ELF input.
7473         (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather
7474         than duplicating it's function here.  Adjust free of internal
7475         relocs to suit.
7476         (ppc64_elf_relocate_section): Adjust local syms in opd section.
7477         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare.
7478         * elf32-hppa.c (elf32_hppa_size_stubs): Call
7479         _bfd_elf32_link_read_relocs rather than duplicating it's function
7480         here.  Adjust free of internal relocs to suit.
7481
7482 2002-07-01  Andreas Jaeger  <aj@suse.de>
7483
7484         * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations
7485         are not allowed in shared libs code, enforce -fPIC.
7486
7487 2002-06-29  Hans-Peter Nilsson  <hp@bitrange.com>
7488
7489         * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and
7490         trailing zero-sequences when there's previous left-over data.
7491
7492 2002-06-27  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7493
7494         * elf64-hppa.c (elf64_hppa_reloc_type_class): New function.
7495         (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec
7496         and opd_rel_sec in order for starting rela section.  Check _raw_size.
7497         (elf_backend_reloc_type_class): Define.
7498
7499 2002-06-27  Kevin Buettner <kevinb@redhat.com>
7500
7501         * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
7502         DWARF2 formats.
7503
7504 2002-06-27  Alan Modra  <amodra@bigpond.net.au>
7505
7506         * cpu-powerpc.c: Comment on ordering of arch_info.
7507         * elf32-ppc.c (ppc_elf_object_p): New function.
7508         (elf_backend_object_p): Define.
7509         * elf64-ppc.c (ppc64_elf_object_p): New function.
7510         (elf_backend_object_p): Define.
7511
7512 2002-06-26  Jason Thorpe  <thorpej@wasabisystems.com>
7513
7514         * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo.
7515         * configure: Regenerate.
7516
7517 2002-06-25  Jason Eckhardt  <jle@rice.edu>
7518
7519         * dwarf2.c (decode_line_info): Check unit->addr_size
7520         to read in the proper number of prologue bytes.
7521
7522 2002-06-25  Nick Clifton  <nickc@cambridge.redhat.com>
7523
7524         * config.bfd (powerpc-*-aix5*): Only create a selvecs for
7525         aix5coff64_vec if 64-bit bfd support has been enabled.
7526         (powerpc64-*-aix5*): Only define if 64-bit bfd support has
7527         been enabled.
7528
7529         * targets.c (_bfd_target_vector[]): Only include
7530         aix5coff64_vec if 64-bit bfd support has been enabled.
7531
7532 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7533
7534         * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy.
7535         * elf32-hppa.c (hppa_add_stub): Likewise.
7536         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
7537         * elflink.h (elf_add_default_symbol): Fix comment typo.
7538         (elf_add_default_symbol): Replace strcpy and strncpy with memcpy.
7539         (elf_link_add_object_symbols): Likewise.
7540         (elf_link_assign_sym_version): Likewise.
7541         * hash.c (bfd_hash_lookup): Likewise.
7542         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
7543         * section.c (bfd_get_unique_section_name): Likewise.
7544         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
7545         * elf.c (_bfd_elf_make_section_from_phdr): Likewise.
7546         (assign_section_numbers): Likewise.
7547         (_bfd_elfcore_make_pseudosection): Likewise.
7548         (elfcore_grok_lwpstatus): Likewise.
7549         (elfcore_grok_win32pstatus): Likewise.
7550         (elfcore_write_note): Constify input params.  Use PTR instead of
7551         void *.  Include terminating NUL in namesz.  Correct padding.
7552         Support NULL "name" param.  Use memcpy instead of strcpy.
7553         (elfcore_write_prpsinfo): Constify input params.
7554         (elfcore_write_prstatus): Likewise.  Use PTR instead of void *.
7555         (elfcore_write_lwpstatus): Likewise.
7556         (elfcore_write_pstatus): Likewise.
7557         (elfcore_write_prfpreg): Likewise.
7558         (elfcore_write_prxfpreg): Likewise.
7559         * elf-bfd.h (elfcore_write_note): Update declaration.
7560         (elfcore_write_prpsinfo): Likewise.
7561         (elfcore_write_prstatus): Likewise.
7562         (elfcore_write_pstatus): Likewise.
7563         (elfcore_write_prfpreg): Likewise.
7564         (elfcore_write_prxfpreg): Likewise.
7565         (elfcore_write_lwpstatus): Likewise.
7566
7567 2002-06-25  Jason Eckhardt  <jle@rice.edu>
7568
7569         * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for
7570         symbols of type stProc and stStaticProc.
7571
7572 2002-06-25  Nick Clifton  <nickc@redhat.com>
7573
7574         * ecoff.c: VArious formatting fixes.
7575
7576 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7577
7578         * coff-rs6000.c (xcoff_generate_rtinit): Fix typo.
7579
7580 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7581
7582         * aout-adobe.c: Don't compare against "true" or "false.
7583         * aout-target.h: Likewise.
7584         * aoutx.h: Likewise.
7585         * archive.c: Likewise.
7586         * bout.c: Likewise.
7587         * cache.c: Likewise.
7588         * coff-a29k.c: Likewise.
7589         * coff-alpha.c: Likewise.
7590         * coff-i386.c: Likewise.
7591         * coff-mips.c: Likewise.
7592         * coff-or32.c: Likewise.
7593         * coff64-rs6000.c: Likewise.
7594         * coffcode.h: Likewise.
7595         * coffgen.c: Likewise.
7596         * cpu-ns32k.c: Likewise.
7597         * ecoff.c: Likewise.
7598         * ecofflink.c: Likewise.
7599         * elf.c: Likewise.
7600         * elf32-arm.h: Likewise.
7601         * elf32-cris.c: Likewise.
7602         * elf32-d30v.c: Likewise.
7603         * elf32-i386.c: Likewise.
7604         * elf32-mcore.c: Likewise.
7605         * elf32-ppc.c: Likewise.
7606         * elf32-sh.c: Likewise.
7607         * elf32-sh64.c: Likewise.
7608         * elf32-v850.c: Likewise.
7609         * elf64-alpha.c: Likewise.
7610         * elf64-sh64.c: Likewise.
7611         * elfcode.h: Likewise.
7612         * elfcore.h: Likewise.
7613         * elflink.h: Likewise.
7614         * elfxx-mips.c: Likewise.
7615         * i386os9k.c: Likewise.
7616         * ieee.c: Likewise.
7617         * libbfd.c: Likewise.
7618         * linker.c: Likewise.
7619         * mmo.c: Likewise.
7620         * nlm32-alpha.c: Likewise.
7621         * nlm32-i386.c: Likewise.
7622         * nlm32-ppc.c: Likewise.
7623         * nlm32-sparc.c: Likewise.
7624         * nlmcode.h: Likewise.
7625         * oasys.c: Likewise.
7626         * pdp11.c: Likewise.
7627         * peicode.h: Likewise.
7628         * reloc.c: Likewise.
7629         * som.c: Likewise.
7630         * srec.c: Likewise.
7631         * tekhex.c: Likewise.
7632         * vms.c: Likewise.
7633         * xcofflink.c: Likewise.
7634         * elf64-sparc.c: Edit comment to not use "== false".
7635
7636         * aoutf1.h: Don't use "? true : false".
7637         * ecoff.c: Likewise.
7638         * format.c: Likewise.
7639         * ieee.c: Likewise.
7640         * linker.c: Likewise.
7641         * mmo.c: Likewise.
7642         * oasys.c: Likewise.
7643
7644 2002-06-23  H.J. Lu  <hjl@gnu.org>
7645
7646         * elflink.h (elf_link_add_archive_symbols): For the default
7647         version, check references with only one `@' first.
7648
7649 2002-06-23  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7650
7651         * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New
7652         function.
7653         (allocate_global_data_dlt): Don't add millicode symbols to dynamic
7654         symbol table.
7655         (allocate_global_data_opd, allocate_dynrel_entries): Likewise.
7656         (elf64_hppa_size_dynamic_sections): Revise to use
7657         elf64_hppa_mark_milli_and_exported_functions.
7658         (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode
7659         symbols out of dynamic symbol table.
7660
7661 2002-06-23  Alan Modra  <amodra@bigpond.net.au>
7662
7663         * Makefile.in: Regenerate.
7664         * libbfd.h: Regenerate.
7665         * bfd-in2.h: Regenerate.
7666         * configure: Regenerate.
7667         * po/SRC-POTFILES.in: Regenerate.
7668
7669         * elflink.h: Comment typo fixes.
7670
7671 2002-06-23  H.J. Lu  <hjl@gnu.org>
7672
7673         * elf-bfd.h (elf_link_loaded_list): New structure.
7674         (elf_link_hash_table): Add "loaded".
7675         * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded".
7676         * elflink.h (elf_link_check_versioned_symbol): New function.
7677         (elf_link_output_extsym): Call elf_link_check_versioned_symbol.
7678
7679 2002-06-19  Nick Clifton  <nickc@cambridge.redhat.com>
7680
7681         * elflink.h (size_dynamic_sections): If the target does not
7682         support an ELF style hash table, return true, indicating that
7683         nothing needed to be done, rather than false, indicating that the
7684         section's size could not be computed.
7685
7686 2002-06-18  Dave Brolley  <brolley@redhat.com>
7687
7688         From Catherine Moore, Michael Meissner, Dave Brolley:
7689         * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c
7690         * targets.c: Support bfd_elf32_frv_vec.
7691         * reloc.c: Add FRV relocs.
7692         * configure.in: Add support for bfd-elf32-frv-vec.
7693         * config.bfd (targ_cpu): Add support for frv-*-elf.
7694         * archures.c: Add frv arch and machines.
7695         * Makefile.am (ALL_MACHINES): Add cpu-frv.lo.
7696         (ALL_MACHINES_CFILES): Add cpu-frv.c.
7697         (BFD32_BACKENDS): Add elf32-frv.lo.
7698         (BFD32_BACKENDS_CFILES): Add elf32-frv.c
7699         (cpu-frv.lo): New target.
7700         (elf32-frv.lo): New target.
7701         * cpu-frv.c: New file.
7702         * elf32-frv.c: New file.
7703
7704 2002-06-18  Jakub Jelinek  <jakub@redhat.com>
7705
7706         * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies
7707         e_shnum == 0.
7708         Only read the first section header if e_shoff is non-zero.
7709         Don't consider e_shstrndx if there are no sections.
7710
7711 2002-06-17  Tom Rix <trix@redhat.com>
7712
7713         * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R,
7714         R_D10V_10_PCREL_L and R_D10V_18_PCREL to use
7715         complain_overflow_bitfield.
7716
7717 2002-06-17  Alan Modra  <amodra@bigpond.net.au>
7718
7719         * opncls.c (bfd_openr): Remove redundant bfd_set_error.
7720         (bfd_fdopenr): Likewise.
7721         (bfd_openstreamr): Likewise.
7722         (bfd_openw): Likewise.
7723
7724         * targets.c: Sort target vecs.
7725         (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec,
7726         bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec,
7727         bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec,
7728         bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec.
7729         * configure.in: Sort target vecs.  Add m88kmach3_vec.
7730         * configure: Regenerate.
7731
7732 2002-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
7733
7734         * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
7735         bpo_reloc_no to break sort order ties, not address of items.
7736
7737 2002-06-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7738
7739         * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
7740         Skip excluded sections in determing __gp value.
7741         (elf_hppa_final_link_relocate): Use the symbol's address in
7742         R_PARISC_FPTR64 relocations that don't need an opd entry.
7743         * elf64-hppa.c (allocate_dynrel_entries): Simplify code.
7744         (elf64_hppa_finalize_dynreloc): Likewise.
7745         (elf64_hppa_size_dynamic_sections): Move comments and fix typo.
7746         (elf64_hppa_finish_dynamic_symbol): Break up assert.
7747
7748 2002-06-14  Sergey Grigoriev  <serge@leopold.Physik.Uni-Augsburg.DE>
7749
7750         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
7751         alignment for .bss, .data and .text sections so that sse and sse2
7752         code will work.
7753         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
7754
7755 2002-06013  J"orn Rennecke  <joern.rennecke@superh.com>
7756
7757         config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*,
7758         sh[1234]*-elf*.
7759
7760 2002-06-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7761
7762         * elflink.h (elf_bfd_final_link): Improve error handling for missing
7763         dynamic sections.
7764
7765         * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry
7766         for a symbol that has no output section.
7767         (allocate_dynrel_entries): Correct comment.
7768         (elf64_hppa_finalize_dynreloc): Likewise.  Don't create an opd entry
7769         unless we want one.
7770         (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL.
7771         (elf64_hppa_finalize_dlt): Likewise.  Prevent segfault for symbols
7772         with no section.  Remove unnecessary parentheses.
7773
7774 2002-06-11  Tom Rix  <trix@redhat.com>
7775
7776         * coffcode.h (coff_compute_section_file_positions): Add data
7777         section to AIX loader alignment check.
7778
7779         * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section
7780         alignment to 4 bytes.
7781         (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment
7782         power accessor macro.
7783         (do_shared_object_padding): Remove invalid assertion.
7784
7785 2002-06-10  Richard Sandiford  <rsandifo@redhat.com>
7786
7787         * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE
7788         for removed output sections.
7789
7790 2002-06-10  Geoffrey Keating  <geoffk@redhat.com>
7791
7792         * merge.c (merge_strings): Use htab_create_alloc with calloc, not
7793         htab_alloc.
7794         * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise.
7795
7796 2002-06-08  H.J. Lu <hjl@gnu.org>
7797
7798         * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to
7799         work around a long long bug in gcc 2.96 on mips.
7800
7801 2002-06-08  Jason Thorpe  <thorpej@wasabisystems.com>
7802
7803         * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo.
7804         (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c.
7805         Regenerate dependency lists.
7806         * Makefile.in: Regenerate.
7807         * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add
7808         vax1knetbsd_vec to targ_selvecs.
7809         * configure.in: Add vax1knetbsd_vec.
7810         * configure: Regenerate.
7811         * targets.c (_bfd_target_vector): Add vax1knetbsd_vec.
7812         * vax1knetbsd.c: New file.
7813         * vaxnetbsd.c: Update copyright years.
7814         (TARGET_PAGE_SIZE): Set to 0x1000.
7815         (DEFAULT_MID): Set to M_VAX4K_NETBSD.
7816
7817 2002-06-08  Matt Thomas  <matt@3am-software.com>
7818
7819         * libaout.h (enum machine_type): Add M_VAX4K_NETBSD.
7820
7821 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
7822
7823         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static.
7824
7825 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
7826
7827         * Makefile.am: Run "make dep-am".
7828         * Makefile.in: Regenerate.
7829
7830         * armnetbsd.c: Replace CONST with const.
7831         * corefile.c: Likewise.
7832         * elf32-dlx.c: Likewise.
7833         * elf64-mips.c: Likewise.
7834         * mmo.c: Likewise.
7835         * ns32knetbsd.c: Likewise.
7836
7837         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash
7838         table is elf64-sparc.
7839
7840 2002-06-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7841
7842         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code.
7843         Fix RELA addends to get not shifted in the result. Don't do special
7844         handling of R_MIPS_64 for NewABI.
7845
7846 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7847
7848         * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
7849         (NAME(aout,slurp_reloc_table)): Likewise.
7850         * coff-mips.c (mips_relax_section): Use bfd_zalloc.
7851         * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc.
7852         (xcoff_write_archive_contents_big): Likewise.
7853         (xcoff_generate_rtinit): Likewise.
7854         (xcoff_generate_rtinit): Likewise, and check error return.
7855         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
7856         * coffgen.c (coff_section_symbol): Use bfd_zalloc.
7857         (coff_get_normalized_symtab): Likewise.
7858         (coff_make_empty_symbol): Likewise.
7859         (bfd_coff_set_symbol_class): Likewise.
7860         * cofflink.c (coff_link_add_symbols): Likewise.
7861         * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise.
7862         * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc.
7863         (bfd_ecoff_write_accumulated_debug): Likewise.
7864         * elf64-alpha.c (get_got_entry): Use bfd_zalloc.
7865         * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise.
7866         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc.
7867         * ieee.c (do_with_relocs): Use bfd_zalloc.
7868         * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise.
7869         * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
7870         (NAME(aout,slurp_reloc_table)): Likewise.
7871         (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd.
7872         * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc.
7873         * som.c (som_build_and_write_symbol_table): Likewise.
7874         (som_slurp_string_table): Likewise.
7875         (som_slurp_symbol_table): Likewise.
7876         (som_bfd_ar_write_symbol_stuff): Likewise.
7877         * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc.
7878         * sunos.c (bfd_sunos_size_dynamic_sections): Likewise.
7879         * tekhex.c (find_chunk): Likewise.  Get rid of unused "sname".
7880         * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc.
7881         * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc.
7882
7883 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7884
7885         * elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with
7886         "group" union.
7887         (elf_group_name): Update.
7888         (elf_group_id): Define.
7889         (bfd_elf_set_group_contents): Declare.
7890         * elf.c (elf_fake_sections): Qualify use of elf_group_name.
7891         (set_group_contents): Rename to bfd_elf_set_group_contents.  Remove
7892         ATTRIBUTE_UNUSED from failedptrarg.  If elf_group_id is set, use
7893         that sym for the signature.
7894         (_bfd_elf_compute_section_file_positions): Don't call
7895         set_group_contents for "ld -r" case.
7896         (swap_out_syms): Use bfd_zalloc.
7897         * elflink.h (elf_link_add_archive_symbols): Likewise.
7898         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
7899         (elf_bfd_final_link): Call bfd_elf_set_group_contents.
7900
7901 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7902
7903         * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
7904         relocs in opd for non-shared too.
7905
7906 2002-06-06  Jeffrey Law  <law@redhat.com>
7907
7908         * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
7909         relocations.
7910
7911 2002-06-06  Nick Clifton  <nickc@cambridge.redhat.com>
7912
7913         * merge.c: Include libiberty.h.
7914         * elf-strtab.c: Include libiberty.h.
7915
7916 2002-06-06  Elias Athanasopoulos  <eathan@otenet.gr>
7917
7918         * peXXigen.c (pe_print_idata): Remove unused variable.
7919
7920 2002-06-06  David Heine <dlheine@tensilica.com>
7921
7922         * elf.c (assign_file_positions_for_segments): Remove unallocated
7923         sections from the section to segment mapping for PT_LOAD segments.
7924         Update comment about empty loadable segments.
7925
7926 2002-06-06  Richard Sandiford  <rsandifo@redhat.com>
7927
7928         * stabs.c (_bfd_link_section_stabs): Check that the symbol offset
7929         is within the .stabstr section.
7930
7931 2002-06-06  Alan Modra  <amodra@bigpond.net.au>
7932
7933         * elf-bfd.h (struct elf_size_info <swap_symbol_in>): Function args
7934         are "const PTR", not "const PTR *".
7935         (bfd_elf32_swap_symbol_in): Likewise.
7936         (bfd_elf64_swap_symbol_in): Likewise.
7937         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR.
7938         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
7939         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7940         (elf_link_add_object_symbols): Likewise.
7941         (elf_link_record_local_dynamic_symbol): Likewise.
7942         (elf_link_input_bfd): Likewise.
7943         (elf_gc_mark): Likewise.
7944         (elf_reloc_symbol_deleted_p): Likewise.
7945         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
7946         (mn10200_elf_relax_delete_bytes): Likewise.
7947         (mn10200_elf_symbol_address_p): Likewise.
7948         (mn10200_elf_get_relocated_section_contents): Likewise.
7949         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
7950         (mn10300_elf_relax_section): Likewise.
7951         (mn10300_elf_relax_delete_bytes): Likewise.
7952         (mn10300_elf_symbol_address_p): Likewise.
7953         (mn10300_elf_get_relocated_section_contents): Likewise.
7954         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
7955         (elf32_h8_relax_delete_bytes): Likewise.
7956         (elf32_h8_symbol_address_p): Likewise.
7957         (elf32_h8_get_relocated_section_contents): Likewise.
7958         * elf32-hppa.c (get_local_syms): Likewise.
7959         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
7960         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7961         * elf32-sh.c (sh_elf_relax_section): Likewise.
7962         (sh_elf_relax_delete_bytes): Likewise.
7963         (sh_elf_get_relocated_section_contents): Likewise.
7964         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
7965         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
7966         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
7967         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7968         * elf64-ppc.c (get_local_syms): Likewise.
7969         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
7970         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
7971
7972 2002-06-05  J"orn Rennecke <joern.rennecke@superh.com>
7973
7974         * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations.
7975
7976 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
7977
7978         * elf.c (group_signature): Swap in the whole symbol, and handle
7979         extracting section symbol names.
7980         (setup_group): Add comment.
7981         (set_group_contents): When called from objcopy or ld, arrange for
7982         section contents to be written.  Write group member output section
7983         indices to allow objcopy to reorganize sections.
7984         (_bfd_elf_copy_private_section_data): Copy group info.
7985
7986         * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field.
7987         (bfd_elf32_swap_symbol_in): Update prototype.
7988         (bfd_elf64_swap_symbol_in): Likewise.
7989         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *.
7990         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
7991         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7992         (elf_link_add_object_symbols): Likewise.
7993         (elf_link_record_local_dynamic_symbol): Likewise.
7994         (elf_link_input_bfd): Likewise.
7995         (elf_gc_mark): Likewise.
7996         (elf_reloc_symbol_deleted_p): Likewise.
7997         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
7998         (mn10200_elf_relax_delete_bytes): Likewise.
7999         (mn10200_elf_symbol_address_p): Likewise.
8000         (mn10200_elf_get_relocated_section_contents): Likewise.
8001         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
8002         (mn10300_elf_relax_section): Likewise.
8003         (mn10300_elf_relax_delete_bytes): Likewise.
8004         (mn10300_elf_symbol_address_p): Likewise.
8005         (mn10300_elf_get_relocated_section_contents): Likewise.
8006         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
8007         (elf32_h8_relax_delete_bytes): Likewise.
8008         (elf32_h8_symbol_address_p): Likewise.
8009         (elf32_h8_get_relocated_section_contents): Likewise.
8010         * elf32-hppa.c (get_local_syms): Likewise.
8011         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
8012         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
8013         * elf32-sh.c (sh_elf_relax_section): Likewise.
8014         (sh_elf_relax_delete_bytes): Likewise.
8015         (sh_elf_get_relocated_section_contents): Likewise.
8016         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
8017         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
8018         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
8019         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
8020         * elf64-ppc.c (get_local_syms): Likewise.
8021         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
8022         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
8023         * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser.
8024         * elf64-alpha.c (alpha_elf_size_info): Likewise.
8025         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
8026         * elf64-mips.c (mips_elf64_size_info): Likewise.
8027         * elf64-s390.c (s390_elf64_size_info): Likewise.
8028         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
8029
8030 2002-06-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
8031
8032         * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to...
8033         elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here.
8034         elf64-mips.c (elf_backend_ignore_discarded_relocs): Use
8035         _bfd_mips_elf_ignore_discarded_relocs.
8036         elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare.
8037
8038 2002-06-05  H.J. Lu <hjl@gnu.org>
8039
8040         * elfxx-mips.c (mips_elf_calculate_relocation): Call
8041         _bfd_elf_rel_local_sym for STT_SECTION relocations against
8042         the SEC_MERGE section.
8043
8044 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
8045
8046         * coff-alpha.c: Update copyright date.
8047         * coff-mips.c: Likewise.
8048         * xcoff-target.h: Likewise.
8049
8050         * bfd-in.h: Remove "taken from the source" comment.
8051         * libbfd-in.h: Likewise.
8052         * libcoff-in.h: Likewise.
8053         * bfd-in2.h: Regenerate.
8054         * libbfd.h: Regenerate.
8055         * libcoff.h: Regenerate.
8056
8057         * elf.c (bfd_elf_discard_group): Return true.
8058         * elf-bfd.h (bfd_elf_discard_group): Declare.
8059         * bfd-in.h (bfd_elf_discard_group): Don't declare here.
8060         * section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
8061         * bfd.c (bfd_discard_group): Define.
8062         * targets.c (struct bfd_target): Add _bfd_discard_group.
8063         (BFD_JUMP_TABLE_LINK): Here too.
8064         * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
8065         * aout-adobe.c (aout_32_bfd_discard_group): Define.
8066         * aout-target.h (MY_bfd_discard_group): Define.
8067         * aout-tic30.c (MY_bfd_discard_group): Define.
8068         * binary.c (binary_bfd_discard_group): Define.
8069         * bout.c (b_out_bfd_discard_group): Define.
8070         * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
8071         * coffcode.h (coff_bfd_discard_group): Define.
8072         * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
8073         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
8074         * i386msdos.c (msdos_bfd_discard_group): Define.
8075         * i386os9k.c (os9k_bfd_discard_group): Define.
8076         * ieee.c (ieee_bfd_discard_group): Define.
8077         * ihex.c (ihex_bfd_discard_group): Define.
8078         * mmo.c (mmo_bfd_discard_group): Define.
8079         * nlm-target.h (nlm_bfd_discard_group): Define.
8080         * oasys.c (oasys_bfd_discard_group): Define.
8081         * ppcboot.c (ppcboot_bfd_discard_group): Define.
8082         * som.c (som_bfd_discard_group): Define.
8083         * srec.c (srec_bfd_discard_group): Define.
8084         * tekhex.c (tekhex_bfd_discard_group): Define.
8085         * versados.c (versados_bfd_discard_group): Define.
8086         * vms.c (vms_bfd_discard_group): Define.
8087         * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
8088         * coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
8089         (aix5coff64_vec): Likewise.
8090         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
8091
8092 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
8093
8094         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo.
8095         (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c.
8096         (elf32-sh64-com.lo): New dependency list.
8097         * Makefile.in: Regenerate.
8098         * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec)
8099         (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add
8100         elf32-sh64-com.lo.
8101         * configure: Regenerate.
8102         * elf32-sh64.c (sh64_address_in_cranges)
8103         (sh64_get_contents_type, sh64_address_is_shmedia): Move to...
8104         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb):
8105         (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to...
8106         * elf32-sh64-com.c: ...here.  New file.
8107
8108 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
8109
8110         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove
8111         ATTRIBUTE_UNUSED on used params.
8112         * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks
8113         before calling bfd_section_from_elf_index on local syms.
8114         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
8115
8116 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
8117
8118         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo.
8119         (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c.
8120         (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo.
8121         (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c.
8122         (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules.
8123         * Makefile.in: Regenerate.
8124         * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
8125         (sh64-*-netbsd*): New targets.
8126         * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec,
8127         bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec.
8128         * configure: Regenerate.
8129         * elf32-sh64-nbsd.c: New file.
8130         * elf64-sh64-nbsd.c: New file.
8131         * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec,
8132         bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and
8133         bfd_elf64_sh64lnbsd_vec.
8134
8135 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
8136
8137         * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups.
8138         (bfd_section_from_shdr): Likewise.  Set section name of group
8139         sections from signature.
8140         (group_signature): Split out from setup_group.  Ensure symbol table
8141         is available.
8142         (bfd_elf_discard_group): New function.
8143         (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on
8144         .gnu.linkonce* sections if they are members of a group.
8145         (set_group_contents): Set GRP_COMDAT flag.
8146         * section.c (bfd_discard_group): New function.
8147         * bfd-in.h (bfd_elf_discard_group): Declare.
8148         * bfd-in2.h: Regenerate.
8149         * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field.
8150         (elf_linkonce_p): Define.
8151
8152 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
8153
8154         * elf.c (bfd_section_from_shdr): Make "name" const.
8155         * elf-bfd.h (elf_backend_section_from_shdr): Likewise.
8156         * elf32-i370.c (i370_elf_section_from_shdr): Likewise.
8157         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
8158         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
8159         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
8160         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
8161         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
8162         * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise.
8163         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
8164         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
8165         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
8166
8167 2002-06-03  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
8168
8169         * elfxx-mips.c (ABI_64_P): Use backend's data to determine the
8170         ABI.
8171
8172 2002-06-02  Kazu Hirata  <kazu@cs.umass.edu>
8173
8174         * elf32-arc.c: Fix formatting.
8175         * elf32-arm.h: Likewise.
8176         * elf32-cris.c: Likewise.
8177         * elf32-dlx.c: Likewise.
8178         * elf32-hppa.c: Likewise.
8179         * elf32-i386.c: Likewise.
8180         * elf32-i386qnx.c: Likewise.
8181         * elf32-or32.c: Likewise.
8182         * elf32-s390.c: Likewise.
8183         * elf32-sh64.c: Likewise.
8184         * elf32-vax.c: Likewise.
8185         * elf32-xstormy16.c: Likewise.
8186         * elf64-alpha.c: Likewise.
8187         * elf64-mmix.c: Likewise.
8188         * elf64-ppc.c: Likewise.
8189         * elf64-s390.c: Likewise.
8190         * elf64-sh64.c: Likewise.
8191         * elf64-x86-64.c: Likewise.
8192
8193 2002-06-02  Richard Henderson  <rth@redhat.com>
8194
8195         * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
8196         null when there are no got entries for a symbol.
8197         (elf64_alpha_relax_find_tls_segment): Rearrange to avoid
8198         uninitialized variable warning.
8199
8200 2002-06-01  Richard Henderson  <rth@redhat.com>
8201
8202         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for
8203         undefined symbols here.
8204         (elf64_alpha_relax_section): Do it here.  Also test for not
8205         defined in the current module.
8206         (elf64_alpha_relocate_section_r): Split out of ...
8207         (elf64_alpha_relocate_section): ... here.  Don't dereference
8208         NULL when looking up local got entries.
8209
8210 2002-06-01  Richard Henderson  <rth@redhat.com>
8211
8212         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined
8213         symbols from JSR relaxation.
8214         (elf64_alpha_size_plt_section_1): New.
8215         (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ...
8216         (elf64_alpha_size_rela_got_1): ... here.
8217         (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ...
8218         (elf64_alpha_size_rela_got_section): ... here.
8219         (elf64_alpha_size_plt_section): New.
8220         (elf64_alpha_relax_section): Call them.
8221         (elf64_alpha_size_got_sections): Remove output_bfd arg.
8222         (elf64_alpha_finish_dynamic_symbol): Check gotent use_count.
8223
8224 2002-06-01  Richard Henderson  <rth@redhat.com>
8225
8226         * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New.
8227         (elf64_alpha_relocate_section): Use them.  Reject LE TLS relocs
8228         in shared libraries.  Fix DTPRELHI and TPRELHI value.
8229         (INSN_ADDQ, INSN_RDUNIQ): New.
8230         (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent.
8231         (elf64_alpha_relax_with_lituse): Return boolean.  Remove irelend
8232         argument.  Reject dynamic symbols.  Use LITUSE symbolic constants.
8233         (elf64_alpha_relax_got_load): Rename from relax_without_lituse.
8234         Handle GOTDTPREL and GOTTPREL relocations.
8235         (elf64_alpha_relax_gprelhilo): New.
8236         (elf64_alpha_relax_tls_get_addr): New.
8237         (elf64_alpha_relax_find_tls_segment): New.
8238         (elf64_alpha_relax_section): Handle TLS relocations.
8239         (ALPHA_ELF_LINK_HASH_TLS_IE): New.
8240         (elf64_alpha_check_relocs): Set it.
8241
8242 2002-06-01  Richard Henderson  <rth@redhat.com>
8243
8244         * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp.
8245
8246         * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic
8247         check; don't suppress dynamic relocs for non-allocated sections.
8248
8249         * elf64-alpha.c: Remove dead code.
8250
8251 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
8252
8253         * bfd-in2.h: Regenerate.
8254         * libbfd.h: Regenerate.
8255         * po/SRC-POTFILES.in: Regenerate.
8256
8257         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
8258         space for bss .plt.
8259
8260 2002-05-31  Graeme Peterson  <gp@qnx.com>
8261
8262         * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
8263         (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
8264         Run "make dep-am".
8265         * Makefile.in: Regenerate.
8266         * config.bfd: Add i[3456]86-*-nto-qnx* support.
8267         * configure.in: Add bfd_elf32_i386qnx_vec support.
8268         * configure: Regenerate.
8269         * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
8270         is_contained_by_filepos, and copy_private_bfd_data_p.
8271         * elf.c (assign_file_positions_for_segments): Call backend
8272         set_nonloadable_filepos.  Fix non-K&R call to _bfd_error_handler.
8273         (IS_CONTAINED_BY_FILEPOS): Define.
8274         (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
8275         (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS.  Typo fix.
8276         Fix non-K&R call to _bfd_error_handler.
8277         (_bfd_elf_copy_private_section_data): Use backend
8278         copy_private_bfd_data_p.
8279         * elf32-i386.c: Don't include elfxx-target.h when
8280         ELF32_I386_C_INCLUDED is defined.
8281         * elf32-i386qnx.c: New QNX elf backend file.
8282         * elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
8283         elf_backend_is_contained_by_filepos, and
8284         elf_backend_do_copy_private_bfd_data.
8285         * targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
8286
8287 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
8288
8289         * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define.
8290         Move other similar defines to start of file.
8291
8292 2002-05-30  Tom Rix  <trix@redhat.com>
8293
8294         * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA.
8295         * coff64-rs6000.c (xcoff64_rtype2howto): Same.
8296
8297 2002-05-30  Richard Henderson  <rth@redhat.com>
8298
8299         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD,
8300         ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New.
8301         (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove.
8302         (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove.
8303         (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated.
8304         (struct alpha_elf_obj_tdata): Rename total_got_entries and
8305         n_local_got_entries to total_got_size and local_got_size.
8306         (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs.
8307         (alpha_got_entry_size): New.
8308         (elf64_alpha_relax_with_lituse): Use it.
8309         (elf64_alpha_relax_without_lituse): Likewise.
8310         (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES.
8311         (get_got_entry): New.
8312         (elf64_alpha_check_relocs): Handle TLS relocs.  Reorganize.
8313         (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask.
8314         (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type.
8315         (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise.
8316         (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size.
8317         (elf64_alpha_calc_got_offsets): Likewise.
8318         (alpha_dynamic_entries_for_reloc): New.
8319         (elf64_alpha_calc_dynrel_sizes): Use it.
8320         (elf64_alpha_size_dynamic_sections): Likewise.
8321         (elf64_alpha_relocate_section): Handle TLS relocations.
8322         * reloc.c: Add Alpha TLS relocations.
8323         * bfd-in2.h, libbfd.h: Rebuild.
8324
8325 2002-05-29 Ralf Habacker <ralf.habacker@freenet.de>
8326
8327         * peXXigen.c (pe_print_idata): Remove double printed
8328         import table lines; add Bound-To comment.
8329
8330 2002-05-29  Matt Thomas  <matt@3am-software.com>
8331
8332         * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo.
8333         (BFD32_BACKENDS_CFILES): Add elf32-vax.c.
8334         (elf32-vax.lo): New rule.
8335         * Makefile.in: Regenerate.
8336         * configure.in (bfd_elf32_vax_vec)
8337         (vaxnetbsd_vec): New vectors.
8338         * configure: Regenerate.
8339         * config.bfd (vax-*-netbsdelf*)
8340         (vax-*-netbsdaout*)
8341         (vax-*-netbsd*): New targets.
8342         * elf32-vax.c: New file.
8343         * reloc.c: Add VAX relocations.
8344         * bfd-in2.h: Regenerate.
8345         * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec.
8346
8347 2002-05-29  Jason Thorpe  <thorpej@wasabisystems.com>
8348
8349         * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec
8350         and bfd_elf32_bigarm_vec to targ_selvecs.
8351
8352 2002-05-29  Ralf Habacker  <ralf.habacker@freenet.de>
8353
8354         * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables
8355         with auto-imported symbols.
8356
8357 2002-05-29  Adam Nemet  <anemet@lnxw.com>
8358
8359         * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue
8360         sections only record bfd.
8361         (bfd_elf32_arm_add_glue_sections_to_bfd): New function.
8362         * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it.
8363         * bfd-in2.h: Regenerate.
8364
8365 2002-05-28  Nick Clifton  <nickc@cambridge.redhat.com>
8366
8367         * syms.c (_bfd_stab_section_find_nearest_line): Move
8368         declaration and initialisation of saw_line and saw_func out of
8369         for loop.
8370
8371 2002-05-29  Alan Modra  <amodra@bigpond.net.au>
8372
8373         * elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
8374         (bfd_elf64_get_symbol_info): Define.
8375         * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
8376
8377 2002-05-29  Andrey Volkov  <avolkov@transas.com>
8378
8379         * cpu-h8300.c: Make default h8300 machine first in machine list.
8380
8381 2002-05-28  Kuang Hwa Lin <kuang@sbcglobal.net>
8382
8383         * config.bfd: Added DLX configuraton.
8384         * Makefile.am: Added DLX configuraton.
8385         * configure.in: Added DLX configuraton.
8386         * archures.c: Add DLX architecure.
8387         * reloc.c: Add DLX relocs.
8388         * targets.c: Added DLX target vector.
8389         * configure: Regenerate.
8390         * Makefile.in: Regenreate.
8391         * bfd-in2.h: Regenreate.
8392         * elf32-dlx.c: New file: Support DLX target.
8393         * cpu-dlx.c: New file: Support DLX target.
8394
8395 2002-05-25  Alan Modra  <amodra@bigpond.net.au>
8396
8397         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting.
8398
8399         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change.
8400         (ppc64_elf_check_relocs): Don't set up function descriptor symbol
8401         strings to point inside function code sym string.
8402         (func_desc_adjust): Likewise.
8403         (ppc64_elf_hide_symbol): Rewrite code to look up function code sym.
8404
8405 2002-05-24  Michal Ludvig  <mludvig@suse.cz>
8406
8407         * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added.
8408         (elf64_x86_64_grok_psinfo): Added.
8409
8410 2002-05-24  TAMURA Kent <kent@netbsd.org>
8411
8412         * config.bfd: Add a target for i386-netbsdpe.
8413
8414 2002-05-24  Alan Modra  <amodra@bigpond.net.au>
8415
8416         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func
8417         and is_func_descriptor.
8418         (func_desc_adjust): Hide function code sym in shared libs unless
8419         there is a matching exported function descriptor sym.
8420
8421 2002-05-23  Jakub Jelinek  <jakub@redhat.com>
8422
8423         * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
8424         for symbols from SHF_TLS section.
8425         (_bfd_elf_print_private_bfd_data): Add PT_TLS.
8426         (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
8427         (map_sections_to_segments): Build PT_TLS segment if necessary.
8428         (assign_file_positions_for_segments): Likewise.
8429         (get_program_header_size): Account for PT_TLS segment.
8430         (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
8431         SEC_THREAD_LOCAL sections to STT_TLS.
8432         * reloc.c: Add 386 and IA-64 TLS relocs.
8433         * section.c (SEC_THREAD_LOCAL): Define.
8434         (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
8435         Remove.
8436         * elflink.h (elf_link_add_object_symbols): Support .tcommon.
8437         (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
8438         unconditionally.
8439         (struct elf_final_link_info): Add first_tls_sec.
8440         (elf_bfd_final_link): Set first_tls_sec.
8441         Compute elf_hash_table (info)->tls_segment.
8442         (elf_link_output_extsym): Handle STT_TLS symbols.
8443         (elf_link_input_bfd): Likewise.
8444         * syms.c (BSF_THREAD_LOCAL): Define.
8445         * bfd-in2.h: Rebuilt.
8446         * libbfd.h: Rebuilt.
8447         * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
8448         elf_i386_mkobject, elf_i386_object_p): New functions.
8449         (elf_howto_table): Add TLS relocs.
8450         (elf_i386_reloc_type_lookup): Support TLS relocs.
8451         (elf_i386_info_to_howto_rel): Likewise.
8452         (struct elf_i386_link_hash_entry): Add tls_type.
8453         (struct elf_i386_obj_tdata): New.
8454         (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
8455         New macros.
8456         (struct elf_i386_link_hash_table): Add tls_ldm_got.
8457         (link_hash_newfunc): Clear tls_type.
8458         (elf_i386_check_relocs): Support TLS relocs.
8459         (elf_i386_gc_sweep_hook): Likewise.
8460         (allocate_dynrelocs): Likewise.
8461         (elf_i386_size_dynamic_sections): Likewise.
8462         (elf_i386_relocate_section): Likewise.
8463         (elf_i386_finish_dynamic_symbol): Likewise.
8464         (bfd_elf32_mkobject, elf_backend_object_p): Define.
8465         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
8466         dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
8467         want_tprel, want_dtpmod, want_dtprel.
8468         (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
8469         (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
8470         R_IA64_LTOFF_TPREL22.
8471         (elf_code_to_howto_index): Add TLS relocs.
8472         (elfNN_ia64_check_relocs): Support TLS relocs.
8473         (allocate_global_data_got): Account for TLS .got data.
8474         (allocate_dynrel_entries): Account for TLS dynamic relocations.
8475         (elfNN_ia64_install_value): Supprt TLS relocs.
8476         (set_got_entry): Support TLS relocs.
8477         (elfNN_ia64_relocate_section): Likewise.
8478
8479 2002-05-23  Nick Clifton  <nickc@cambridge.redhat.com>
8480
8481         * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb
8482         BLX reloc round the relocation up rather than down.
8483         * coff-arm.c (coff_arm_relocate_section): Likewise.
8484
8485 2002-05-21  H.J. Lu  (hjl@gnu.org)
8486
8487         * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple
8488         definition.
8489
8490 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
8491
8492         * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt.
8493         (ppc64_elf_relocate_section): Handle unresolved relocs in opd.
8494
8495 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
8496
8497         * elf64-ppc.c (ppc64_elf_relocate_section): Return false for
8498         unresolved relocs.
8499         (ppc64_elf_size_dynamic_sections): Check for splt NULL.
8500
8501 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8502
8503         * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
8504         non-ELF targets.
8505
8506 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8507
8508         * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return
8509         an error value.
8510         * elflink.h (elf_link_output_relocs): Likewise. Improve error message.
8511         return with false on error.
8512         (elf_link_input_bfd): Check reloc_emitter return value.
8513
8514 2002-05-21  Jason Thorpe  <thorpej@wasabisystems.com>
8515
8516         * config.bfd (armeb-*-netbsdelf*): New target.
8517
8518 2002-05-20  Alan Modra  <amodra@bigpond.net.au>
8519
8520         * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
8521         at the plt call stub.
8522
8523 2002-05-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8524
8525         * cpu-mips.c (mips_compatible): Don't try to check machine
8526         compatibility.
8527
8528 2002-05-18  Tom Rix  <trix@redhat.com>
8529
8530         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent.
8531
8532 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
8533
8534         * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting.
8535         (ppc64_elf_relocate_section): Don't warn about reloc overflow when
8536         we've already warned about an undefined symbol.  Report more
8537         detail on reloc errors.
8538
8539 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
8540
8541         * acinclude.m4 (AM_INSTALL_LIBBFD): New.
8542         * configure.in: Invoke AM_INSTALL_LIBBFD.
8543         * Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
8544         (install_libbfd): .. New target.
8545         (uninstall_libbfd): Likewise.
8546         (install-bfdlibLTLIBRARIES): Likewise.
8547         (uninstall-bfdlibLTLIBRARIES): Likewise.
8548         (bfdlibdir): New.
8549         (bfdincludedir): New.
8550         (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
8551         * aclocal.m4: Regenerate.
8552         * configure: Regenerate.
8553         * Makefile.in: Regenerate.
8554
8555 2002-05-17  Stuart Balfour <sbalfour@cisco.com>
8556
8557         * hash.c (bfd_hash_lookup): Remove computation of len from inside
8558         hash loop.
8559
8560 2002-05-16  Nick Clifton  <nickc@cambridge.redhat.com>
8561
8562         * config.bfd: Add targets for sh64-linux (little endian and
8563         big endian).
8564
8565 2002-05-15  Laurent Pinchart <laurent.pinchart@skynet.be>
8566
8567         * peXXigen.c (pe_print_idata): Do not assume that the first thunk
8568         is located in the same section as the import table.  Instead
8569         check, and if necessary load the section containing the thunk.
8570
8571 2002-05-15  Nick Clifton  <nickc@cambridge.redhat.com>
8572
8573         * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with
8574         bfd_bread.
8575         (xcoff64_core_file_matches_executable_p): Replace bfd_read
8576         with bfd_bread.
8577
8578 2002-05-15  Alan Modra  <amodra@bigpond.net.au>
8579
8580         * aix5ppc-core.c: Warning fixes.
8581         * aout-adobe.c (aout_32_bfd_link_just_syms): Define.
8582         * aout-target.h (MY_bfd_link_just_syms): Define.
8583         * aout-tic30.c (MY_bfd_link_just_syms): Define.
8584         * bfd.c (bfd_link_just_syms): Define.
8585         * binary.c (binary_bfd_link_just_syms): Define.
8586         * bout.c (b_out_bfd_link_just_syms): Define.
8587         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
8588         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
8589         * coffcode.h (coff_bfd_link_just_syms): Define.
8590         * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
8591         (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
8592         (_bfd_elf_link_just_syms): Declare.
8593         * elf.c (_bfd_elf_link_just_syms): New function.
8594         * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
8595         sections haven't already been discarded by the linker.
8596         * elflink.h (elf_link_add_object_symbols): Likewise for stab
8597         sections and SEC_MERGE sections.
8598         (elf_bfd_discard_info): Similarly here.
8599         * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
8600         * i386msdos.c (msdos_bfd_link_just_syms): Define.
8601         * i386os9k.c (os9k_bfd_link_just_syms): Define.
8602         * ieee.c (ieee_bfd_link_just_syms): Define.
8603         * ihex.c (ihex_bfd_link_just_syms): Define.
8604         * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
8605         (_bfd_generic_link_just_syms): Declare.
8606         * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
8607         * linker.c (_bfd_generic_link_just_syms): New function.
8608         * mmo.c (mmo_bfd_link_just_syms): Define.
8609         * nlm-target.h (nlm_bfd_link_just_syms): Define.
8610         * oasys.c (oasys_bfd_link_just_syms): Define.
8611         * ppcboot.c (ppcboot_bfd_link_just_syms): Define.
8612         * som.c (som_bfd_link_just_syms): Define.
8613         * srec.c (srec_bfd_link_just_syms): Define.
8614         * targets.c (struct bfd_target): Add _bfd_link_just_syms.
8615         (BFD_JUMP_TABLE_LINK): And here.
8616         * tekhex.c (tekhex_bfd_link_just_syms): Define.
8617         * versados.c (versados_bfd_link_just_syms): Define.
8618         * vms.c (vms_bfd_link_just_syms): Define.
8619         * libbfd.h: Regenerate.
8620         * bfd-in2.h: Regenerate.
8621
8622 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8623
8624         * elf32-mips.c: Remove superfluous definitions copied from
8625         elfxx-mips.c.
8626         (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the
8627         SGIish vectors to check the special case.
8628         (mips_elf_hi16_reloc): Fix comment.
8629         (mips_elf_got16_reloc): Likewise.
8630         (_bfd_mips_elf32_gprel16_reloc): Likewise.
8631         (elf_reloc_map): Code cleanup.
8632         (mips_reloc_map): Add comment.
8633         (bfd_elf23_bfd_reloc_type_lookup): Code cleanup.
8634         (mips_elf32_rtype_to_howto): Likewise.
8635         (mips_elf32_discard_info): Likewise.
8636         (elf32_mips_irix_compat): Invert logic: Only SGIish vectors
8637         lead to IRIX compatibility now.
8638
8639 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8640
8641         * elfxx-mips.c: Call it IRIX, not Irix in comments.
8642
8643 2002-05-13  Jason Thorpe  <thorpej@wasabisystems.com>
8644
8645         * config.bfd (shle-*-netbsdelf*): Add target which includes
8646         sh64 support.
8647
8648 2002-05-13  David Edelsohn  <edelsohn@gnu.org>
8649
8650         * configure.in: Revert 2002-04-07.  Instead, auto-configure
8651         HAVE_ST_C_IMPL.
8652         * configure: Regenerate.
8653         * config.in: Regenerate.
8654         * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL
8655         or AIX_5_CORE.
8656
8657 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
8658
8659         * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd
8660         corefiles as well.2
8661         * configure: Regenerate.
8662
8663 2002-05-13  Alan Modra  <amodra@bigpond.net.au>
8664
8665         * Makefile.am (install-data-local): Install headers to
8666         $(exec_prefix)/include.
8667         * Makefile.in: Regenerate.
8668
8669 2002-05-11  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
8670             Daniel Jacobowitz  <drow@mvista.com>
8671
8672         * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE.  Don't
8673         map BFD_RELOC_RVA.
8674
8675 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
8676
8677         * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*,
8678         hppa*-*-openbsd*): New targets.
8679         * configure.in (alpha*-*-openbsd*): Set COREFILE.
8680         * configure: Regenerate.
8681
8682 2002-05-10  Tom Rix  <trix@redhat.com>
8683
8684         * coff64-rs6000.c (xcoff64_reloc_type_br): New function for
8685         xcoff64_ppc_relocate_section.
8686         * coff-rs6000.c : Extern common xcoff_reloc_type functions.
8687         * libxcoff.h: Common xcoff_reloc_type function declaration.
8688
8689 2002-05-10  Alan Modra  <amodra@bigpond.net.au>
8690
8691         * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks
8692         added in 2002-05-09 commit.
8693
8694         * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04,
8695         don't look for stubs on all undefined syms.
8696
8697 2002-05-09  Alan Modra  <amodra@bigpond.net.au>
8698
8699         * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete.
8700         (ppc64_elf_howto_raw <R_PPC64_RELATIVE>): Not pc_relative or
8701         pcrel_offset.
8702
8703         * elf32-i386.c (elf_howto_table): Comments.
8704         (elf_i386_relocate_section): Handle more relocs for relocatable
8705         linking and against SEC_MERGE sections.
8706
8707 2002-05-08  Alan Modra  <amodra@bigpond.net.au>
8708
8709         * elf32-ppc.c (ppc_elf_create_got): New function.
8710         (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before
8711         _bfd_elf_create_dynamic_sections.  Correct .plt flags.
8712         (ppc_elf_check_relocs): Use ppc_elf_create_got in place of
8713         _bfd_elf_create_got_section.
8714
8715 2002-05-07  Alan Modra  <amodra@bigpond.net.au>
8716
8717         * elf-bfd.h (struct elf_backend_data): Add rela_normal.
8718         * elfxx-target.h (elf_backend_rela_normal): Define.
8719         (elfNN_bed): Init rela_normal.
8720         * elflink.h (elf_link_input_bfd <emit_relocs>): Handle adjustment
8721         for section symbols here if rela_normal.  Simplify abs section test.
8722         * elf-m10200.c (mn10200_elf_relocate_section): If relocatable,
8723         return immediately.  Remove code handling relocatable linking.
8724         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
8725         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
8726         * elf32-i370.c (i370_elf_relocate_section): Likewise.
8727         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
8728         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
8729         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
8730         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
8731         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
8732         * elf32-s390.c (elf_s390_relocate_section): Likewise.
8733         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
8734         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
8735         * elf64-s390.c (elf_s390_relocate_section): Likewise.
8736         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
8737         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
8738         * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL.
8739         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
8740         * elf-m10200.c (elf_backend_rela_normal): Define.
8741         * elf-m10300.c (elf_backend_rela_normal): Define.
8742         * elf32-fr30.c (elf_backend_rela_normal): Define.
8743         * elf32-i370.c (elf_backend_rela_normal): Define.
8744         * elf32-i860.c (elf_backend_rela_normal): Define.
8745         * elf32-m68k.c (elf_backend_rela_normal): Define.
8746         * elf32-mcore.c (elf_backend_rela_normal): Define.
8747         * elf32-openrisc.c (elf_backend_rela_normal): Define.
8748         * elf32-ppc.c (elf_backend_rela_normal): Define.
8749         * elf32-s390.c (elf_backend_rela_normal): Define.
8750         * elf32-xstormy16.c (elf_backend_rela_normal): Define.
8751         * elf64-ppc.c (elf_backend_rela_normal): Define.
8752         * elf64-s390.c (elf_backend_rela_normal): Define.
8753         * elf64-x86-64.c (elf_backend_rela_normal): Define.
8754         * elfxx-ia64.c (elf_backend_rela_normal): Define.
8755         * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL.
8756         * elf32-m32r.c (elf_backend_rela_normal): Likewise.
8757
8758 2002-05-06  Nick Clifton  <nickc@cambridge.redhat.com>
8759
8760         * elf32-arm.h (elf32_arm_final_link_relocate): Convert
8761         'reloc_signed_max' and 'reloc_signed_min' into half-word offsets.
8762
8763 2002-05-06  Alan Modra  <amodra@bigpond.net.au>
8764
8765         * elflink.h (elf_link_input_bfd <emit_relocs>): Adjust r_offset
8766         when not relocatable.  Fix reloc_emitter call for K&R.
8767
8768 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
8769
8770         * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code
8771         reloading local sym addend mistakenly removed in 2002-05-01 change.
8772
8773         * dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
8774         (read_abbrevs): Change "offset" param to bfd_vma.
8775         (parse_comp_unit): Change "version" and addr_size to unsigned ints.
8776         Change "abbrev_offset" to bfd_vma.
8777         (read_indirect_string): Use correct conversion chars in error
8778         message format string, cast bfd_vma's to unsigned long.
8779         (read_abbrevs): Likewise.
8780         (read_attribute_value): Likewise.
8781         (decode_line_info): Likewise.
8782         (scan_unit_for_functions): Likewise.
8783         (parse_comp_unit): Likewise.
8784
8785 2002-05-04  Tom Rix  <trix@redhat.com>
8786
8787         * coffswap.h (coff_swap_reloc_in): Remove XCOFF support.
8788         (coff_swap_reloc_out): Same.
8789         * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h.
8790         (xcoff_swap_reloc_out): Same.
8791         (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special
8792         case some 16 bit relocs. Add reloc value to output.
8793         (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit
8794         R_RBR. Improve names.
8795         (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS.
8796         (bfd_xcoff_backend_data): Update with new reloc swap names.
8797         (bfd_pmac_xcoff_backend_data) : Same.
8798         * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h.
8799         (xcoff64_swap_reloc_out): Same.
8800         (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit
8801         R_POS. Add reloc value to output.
8802         (xcoff64_howto_table): Move 64 bit R_POS to first entry.  Add 16
8803         bit R_RBR. Improve names, masks.
8804         (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS.
8805         (bfd_xcoff_backend_data): Update with new reloc swap names.
8806         (bfd_xcoff_aix5_backend_data) : Same.
8807
8808 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
8809
8810         * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add
8811         bfd_count top_index, input_list, all_local_syms.
8812         (elf32_hppa_setup_section_lists): New function, split from
8813         elf32_hppa_size_stubs.
8814         (elf32_hppa_next_input_section): Likewise.
8815         (group_sections): Likewise.
8816         (get_local_syms): Likewise.
8817         (elf32_hppa_size_stubs): Adjust for split out functions.  Look for
8818         stubs on undefined syms too.
8819         (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*.
8820         Only access htab elf fields when we have an elf hash table.
8821         * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare.
8822         (elf32_hppa_next_input_section): Declare.
8823
8824 2002-05-04  Bob Byrnes  <byrnes@curl.com>
8825
8826         * opncls.c (_bfd_new_bfd_contained_in): Check return value of
8827         _bfd_new_bfd.
8828
8829 2002-05-03  H.J. Lu  (hjl@gnu.org)
8830
8831         * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
8832         (mips_elf_link_hash_newfunc): Initialize forced_local to false.
8833         (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
8834         to hide a global symbol.
8835         (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
8836         forced_local to true.
8837
8838 2002-05-02  Richard Henderson  <rth@redhat.com>
8839
8840         * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs
8841         vs SHN_UNDEF to zero.
8842
8843 2002-05-02  Alan Modra  <amodra@bigpond.net.au>
8844
8845         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_SECTOFF>): Change to a
8846         16 bit reloc.
8847         <R_PPC64_SECTOFF_DS>: Likewise.
8848         (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
8849         SECTOFF reloc.
8850         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_SECTOFF>): Correct.
8851         (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
8852         SECTOFF reloc.
8853
8854         * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete.
8855         (ppc64_elf_ha_reloc): New function.
8856         (ppc64_elf_brtaken_reloc): New function.
8857         (ppc64_elf_sectoff_reloc): New function.
8858         (ppc64_elf_sectoff_ha_reloc): New function.
8859         (ppc64_elf_toc_reloc): New function.
8860         (ppc64_elf_toc_ha_reloc): New function.
8861         (ppc64_elf_toc64_reloc): New function.
8862         (ppc64_elf_unhandled_reloc): New function.
8863         (ppc64_elf_howto_raw): Use the above.
8864         <R_PPC64_RELATIVE>: Mark pc_relative, pcrel_offset.
8865         <R_PPC64_SECTOFF>: Not pc_relative or pcrel_offset.  Fix dst_mask.
8866         <R_PPC64_SECTOFF_DS>: Likewise.
8867         (IS_ABSOLUTE_RELOC): Update.
8868         (struct ppc_link_hash_table): Add have_undefweak.
8869         (ppc64_elf_link_hash_table_create): Init.
8870         (func_desc_adjust): Set have_undefweak.
8871         (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier.  Only
8872         add the .sfpr blr when have_undefweak.
8873         (ppc64_elf_setup_section_lists): Check hash table flavour.
8874         (ppc64_elf_next_input_section): Move output_section->owner test to
8875         ppc64elf.em.
8876         (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param
8877         and relocatable test.  Return TOCstart and don't set elf_gp.
8878         (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch
8879         offset calculation.  Add assert on weak sym branch tweaks.
8880         * elf64-ppc.h (ppc64_elf_set_toc): Delete.
8881         (ppc64_elf_toc): Declare.
8882         (ppc64_elf_next_input_section): Update.
8883
8884 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
8885
8886         * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL
8887         file_name.
8888
8889 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
8890
8891         * elf64-ppc.c (CROR_151515, CROR_313131): Define.
8892         (ppc64_elf_relocate_section): Use them.  Don't look for plt calls
8893         on R_PPC64_ADDR24 relocs.  Require a nop or no link reg on plt
8894         call branches.  Correct undefined weak destination.
8895         (ppc64_elf_func_desc_adjust): Always create at least one blr in
8896         .sfpr, and correct case where either only savef* or restf* is
8897         needed.
8898
8899         Long branch stubs, multiple stub sections.
8900         * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare.
8901         (ppc64_elf_next_input_section): Declare.
8902         * elf64-ppc.c: Move linker-only prototypes.
8903         (STUB_SUFFIX): Define.
8904         (enum ppc_stub_type): New.
8905         (struct ppc_stub_hash_entry): New.
8906         (struct ppc_branch_hash_entry): New.
8907         (struct ppc_link_hash_entry): Add stub_cache, oh.
8908         (struct ppc_link_hash_table): Add stub_hash_table etc.  Remove
8909         sstub.  Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration.
8910         Rename plt_overflow to stub_error.
8911         (ppc_stub_hash_lookup): Define.
8912         (ppc_branch_hash_lookup): Define.
8913         (stub_hash_newfunc): New function.
8914         (branch_hash_newfunc): New function.
8915         (link_hash_newfunc): Init new fields.
8916         (ppc64_elf_link_hash_table_create): Likewise.
8917         (ppc64_elf_link_hash_table_free): New function.
8918         (ppc_stub_name): New function.
8919         (ppc_get_stub_entry): New function.
8920         (ppc_add_stub): New function.
8921         (create_linkage_sections): Use bfd_make_section_anyway.  Create
8922         .branch_lt and .rela.branch_lt sections.  Don't create .stub.
8923         (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*,
8924         and set up for plt call stubs.  Link func and func desc syms.
8925         (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24.
8926         (func_desc_adjust): Avoid hash lookup when func desc sym available
8927         via shortcut, and set links when processing.
8928         (ppc64_elf_hide_symbol): Likewise.
8929         (allocate_dynrelocs): Don't allocate stub section here.
8930         (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt.
8931         Remove sstub code.
8932         (ppc_type_of_stub): New function.
8933         (build_one_stub): Delete.
8934         (ppc_build_one_stub): New function.
8935         (ppc_size_one_stub): New function.
8936         (ppc64_elf_setup_section_lists): New function.
8937         (ppc64_elf_next_input_section): New function.
8938         (group_sections): New function.
8939         (get_local_syms): New function.
8940         (ppc64_elf_size_stubs): Rewrite.
8941         (ppc64_elf_build_stubs): Rewrite.
8942         (ppc64_elf_relocate_section): Look up stub entry for REL24
8943         relocs.  Don't propagate REL14* to dynamic objects.  Look for long
8944         branch stubs if REL14* or REL24 relocs won't reach.
8945         (bfd_elf64_bfd_link_hash_table_free): Define.
8946
8947 2002-04-30  Mark Mitchell  <mark@codesourcery.com>
8948
8949         * config.bfd: Add support for powerpc-*-windiss.
8950
8951 2002-04-30  Tom Rix  <trix@redhat.com>
8952
8953         * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT
8954         symbol names into the hash table.
8955
8956 2002-04-28  Tom Rix  <trix@redhat.com>
8957
8958         * coff-rs6000.c (xcoff_calculate_relocation) : Function table for
8959         calulating relocations.
8960         (xcoff_complain_overflow) : Function table for relocation errors.
8961         (xcoff_ppc_relocate_section): Use relocation and complain function
8962         tables.
8963         (xcoff_complain_overflow_unsigned_func): New complain function.
8964         (xcoff_complain_overflow_signed_func): Same.
8965         (xcoff_complain_overflow_bitfield_func): Same.
8966         (xcoff_complain_overflow_dont_func): Same.
8967         (xcoff_reloc_type_crel): New recot function.
8968         (xcoff_reloc_type_br): Same.
8969         (xcoff_reloc_type_ba): Same.
8970         (xcoff_reloc_type_toc): Same.
8971         (xcoff_reloc_type_rel): Same.
8972         (xcoff_reloc_type_neg): Same.
8973         (xcoff_reloc_type_pos): Same.
8974         (xcoff_reloc_type_fail): Same.
8975         (xcoff_reloc_type_noop): Same.
8976         * libxcoff.h : Declare common parts for xcoff64.
8977         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation
8978         and complain function tables.
8979
8980 2002-04-28  Alan Modra  <amodra@bigpond.net.au>
8981
8982         * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo.
8983         * elf32-hppa.c (elf32_hppa_final_link): Formatting.
8984
8985 2002-04-26  Alan Modra  <amodra@bigpond.net.au>
8986
8987         * opncls.c (bfd_make_readable): Call bfd_section_list_clear.
8988         * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
8989
8990         * elflink.h (elf_bfd_final_link): Ensure input bfd class is the
8991         same as the output before calling elf_link_input_bfd.
8992
8993         * coffcode.h (coff_compute_section_file_positions): Set
8994         section_tail after shuffling section list.
8995
8996 2002-04-24  Christian Groessler <chris@groessler.org>
8997
8998         * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The
8999         addresses are 23bit with a special layout, not plain 32bit
9000         values.  Prevent relocation of immediate values.
9001
9002 2002-04-24  Chris G. Demetriou  <cgd@broadcom.com>
9003
9004         * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or
9005         MIPS-16 ASE flags are set, print something to indicate that.
9006
9007 2002-04-23  Alan Modra  <amodra@bigpond.net.au>
9008
9009         * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition
9010         under which a plt call stub is used.
9011         (final_link_relocate): Similarly.
9012         (allocate_plt_static): Clear h-plabel except when plt entry is
9013         exclusively used for a plabel.
9014         (allocate_dynrelocs): Use the above to simplify plt sizing.
9015         (struct elf32_hppa_link_hash_table): Add has_22bit_branch.
9016         (elf32_hppa_link_hash_table_create): Init.
9017         (BL22_RP): Define.
9018         (hppa_build_one_stub): Use BL22_RP if has_22bit_branch.
9019         (elf32_hppa_check_relocs): Set has_22bit_branch.
9020
9021         * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message.
9022         (final_link_relocate): Likewise.
9023
9024 2002-04-22  Jakub Jelinek  <jakub@redhat.com>
9025
9026         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build
9027         search table if some FDE is DW_EH_PE_aligned encoded either.
9028         (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially.
9029
9030 2002-04-22  Richard Smith  <richard@ex-parrot.com>
9031             Jakub Jelinek  <jakub@redhat.com>
9032
9033         * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative.
9034         (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel
9035         encoded personality.
9036         (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality
9037         for CIE/FDE removal.
9038
9039 2002-04-20  Tom Rix  <trix@redhat.com>
9040
9041         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent.
9042
9043 2002-04-20  Alan Modra  <amodra@bigpond.net.au>
9044
9045         * archures.c (bfd_lookup_arch): Move the list order comment..
9046         (struct bfd_arch_info): ..to where it belongs.
9047         * bfd-in2.h: Regenerate.
9048
9049         * archures.c (bfd_lookup_arch): Add comment on list order.
9050         (bfd_default_set_arch_mach): Use bfd_lookup_arch.
9051         * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default
9052         is always at head of list.
9053
9054 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
9055
9056         * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9,
9057         insert_thumb_branch, record_thumb_to_arm_glue): Suppress
9058         definition of these functions for ARM_WINCE builds as they are
9059         not used.
9060         (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define
9061         for ARM_WINCE builds.
9062
9063 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
9064
9065         * coff-arm.c (bfd_arm_process_before_allocation):
9066
9067 2002-04-17  J"orn Rennecke <joern.rennecke@superh.com>
9068
9069         * cpu-sh.c (scan_mach): Delete.
9070         (arch_info_struct): Replace scan_mach with bfd_default_scan.
9071         (bfd_sh_arch): Likewise.
9072
9073 2002-04-16  Nick Clifton  <nickc@cambridge.redhat.com>
9074
9075         * ihex.c (ihex_write_object_contents): Fix check for records
9076         crossing 64K boundaries.
9077
9078 2002-04-16  Alan Modra  <amodra@bigpond.net.au>
9079
9080         * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
9081         type rather than just assuming entries are ELF.
9082         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
9083         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
9084         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
9085         * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
9086         rather than elf_link_hash_entry.
9087
9088 2002-04-15  Richard Henderson  <rth@redhat.com>
9089
9090         * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow
9091         n32 binaries.
9092
9093 2002-04-15  Michael Snyder  <msnyder@redhat.com>
9094
9095         * opncls.c (bfd_close): Write contents if writeable.
9096         Minor formatting tidy-ups.
9097
9098 2002-04-15  Alan Modra  <amodra@bigpond.net.au>
9099
9100         * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.
9101
9102 2002-04-12  Michael Snyder  <msnyder@redhat.com>
9103
9104         * bfd-in.h (bfd_get_section_lma): New access macro.
9105         Minor white-space fix-up.
9106
9107 2002-04-12  Alan Modra  <amodra@bigpond.net.au>
9108
9109         * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or
9110         header pad.
9111
9112 2002-04-09  DJ Delorie  <dj@redhat.com>
9113
9114         * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks.
9115
9116 2002-04-09  Casper S. Hornstrup <chorns@users.sourceforge.net>
9117
9118         * coffcode.h (coff_read_word): New.
9119         (coff_compute_checksum): New.
9120         (coff_apply_checksum): New.
9121         (coff_write_object_contents): Call coff_apply_checksum () to
9122         apply checksum to PE image.
9123
9124 2002-04-08  Randolph Chung  <tausq@debian.org>
9125
9126         * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h.
9127         (elf32_hppa_final_link): Split out sorting logic to..
9128         * elf-hppa.h (elf_hppa_sort_unwind): ..here.
9129         (elf_hppa_final_link): Call elf_hppa_sort_unwind.
9130
9131 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
9132
9133         * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]*
9134         pattern.
9135         * configure: Re-generate.
9136
9137 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
9138
9139         * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version
9140         is greater or equal to 4.3.3.
9141         * configure: Regenerate.
9142         Fix PR gdb/344.
9143
9144 2002-04-05  Hans-Peter Nilsson  <hp@axis.com>
9145
9146         * elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
9147         R_CRIS_32_PCREL>: Fix typo in name.
9148         (cris_elf_check_relocs): Always create .rela.got here when
9149         R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen.
9150         (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here;
9151         assume it's created.
9152
9153 2002-04-04  Daniel Jacobowitz  <drow@mvista.com>
9154
9155         * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define.
9156         * aout-target.h (MY_bfd_link_hash_table_free): Conditionally
9157         define.
9158         * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise.
9159         * bfd.c (bfd_link_hash_table_free): Define.
9160         * binary.c (binary_bfd_link_hash_table_free): Define.
9161         * bout.c (b_out_bfd_link_hash_table_free): Define.
9162         * coff-rs6000.c (rs6000coff_vec): Include
9163         _bfd_generic_link_hash_table_free.
9164         (pmac_xcoff_vec): Likewise.
9165         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
9166         (aix5coff64_vec): Likewise.
9167         * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define.
9168         * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function.
9169         (bfd_elf32_bfd_link_hash_table_free): Define.
9170         * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function.
9171         (bfd_elf32_bfd_link_hash_table_free): Define.
9172         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally
9173         define.
9174         * i386msdos.c (msdos_bfd_link_hash_table_free): Define.
9175         * i386os9k.c (os9k_bfd_link_hash_table_free): Define.
9176         * ieee.c (ieee_bfd_link_hash_table_free): Define.
9177         * ihex.c (ihex_bfd_link_hash_table_free): Define.
9178         * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define.
9179         (_bfd_generic_link_hash_table_free): Add prototype.
9180         * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype.
9181         * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define.
9182         * linker.c (_bfd_generic_link_hash_table_free): New function.
9183         * mmo.c (mmo_bfd_link_hash_table_free): Define.
9184         * nlm-target.h (nlm_bfd_link_hash_table_free): Define.
9185         * oasys.c (oasys_bfd_link_hash_table_free): Define.
9186         * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define.
9187         * som.c (som_bfd_link_hash_table_free): Define.
9188         * srec.c (srec_bfd_link_hash_table_free): Define.
9189         * tekhex.c (tekhex_bfd_link_hash_table_free): Define.
9190         * versados.c (versados_bfd_link_hash_table_free): Define.
9191         * vms.c (vms_bfd_link_hash_table_free): New function.
9192         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function.
9193
9194         * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc
9195         instead of bfd_alloc.
9196         * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
9197         * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise.
9198         * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise.
9199         * cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
9200         * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
9201         * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
9202         * elf.c (_bfd_elf_link_hash_table_create): Likewise.
9203         * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise.
9204         * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
9205         * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
9206         * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
9207         * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
9208         * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
9209         * elf32-sh.c (sh_elf_link_hash_table_create): Likewise.
9210         * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise.
9211         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
9212         * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
9213         * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
9214         * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise.
9215         * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise.
9216         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
9217         * linker.c (_bfd_generic_link_hash_table_create): Likewise.
9218         * m68klinux.c (linux_link_hash_table_create): Likewise.
9219         * sparclinux.c (linux_link_hash_table_create): Likewise.
9220         * sunos.c (sunos_link_hash_table_create): Likewise.
9221         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
9222
9223         * targets.c: Add _bfd_link_hash_table_free to xvec.
9224
9225         * bfd-in2.h: Regenerate.
9226         * libbfd.h: Regenerate.
9227         * libcoff.h: Regenerate.
9228
9229 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
9230
9231         * dep-in.sed: Cope with absolute paths.
9232         * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR.
9233         Run "make dep-am".
9234         * Makefile.in: Regenerate.
9235         * coff-arm.c: Fix copyright date.
9236         * cpu-h8300.c: Likewise.
9237         * cpu-i370.c: Likewise.
9238         * cpu-s390.c: Likewise.
9239         * cpu-mips.c: Likewise.
9240         * po/SRC-POTFILES.in: Regenerate.
9241
9242 2002-04-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
9243
9244         * Makefile.am: Add elfxx-mips.c to the known backends.
9245         (elf32-mips.lo): remove dependency to coff/external.h.
9246         * Makefile.in: Regenerate.
9247         * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo
9248         Remove elf32-mips.lo from 64 bit vectors. Update dependencies
9249         accordingly.
9250         * configure: Regenerate.
9251         * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h.
9252         (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c.
9253         (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New
9254         MIPS specific backend functions.
9255         * elf32-mips.c: Moved most code to elfxx-mips.c.
9256         (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make
9257         static.
9258         (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc.
9259         (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc.
9260         (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc.
9261         (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed
9262         interface to allow selection of the right REL or RELA howto table.
9263         (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made
9264         static. Let it refuse n32 objects.
9265         (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus.
9266         (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo.
9267         (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info.
9268         (elf32_mips_ignore_discarded_relocs): Rename from
9269         _bfd_elf32_mips_ignore_discarded_relocs.
9270         (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section.
9271         (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT.
9272         (elf_mips_howto_table_rela): Remove.
9273         * elf64-mips.c: Moved most code to elfxx-mips.c.
9274         (bfd_elf64_bfd_reloc_type_lookup): Make static.
9275         (mips_elf64_rtype_to_howto): New function.
9276         (mips_elf64_object_p): Likewise.
9277         (elf64_mips_irix_compat): Likewise.
9278         * elfxx-mips.c: New file containing common code merged together from
9279         elf32-mips.c and elf64-mips.c.
9280         * elfxx-mips.h: New file containing MIPS specific prototypes from
9281         elf-bfd.h.
9282         * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and
9283         elf_backend_mips_rtype_to_howto.
9284
9285 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
9286
9287         * srec.c (MAXCHUNK, Chunk): Revise comments.
9288         (srec_write_record): Correct buffer size.
9289         (srec_write_header): Do without intermediate buffer.
9290         (srec_write_section): Validate Chunk.
9291         (srec_write_terminator): Pass NULL instead of dummy buffer.
9292         (srec_write_symbols): Pass file and symbol names directly to
9293         bfd_bwrite so sprintf won't overflow buffer.
9294
9295 2002-04-03  Jakub Jelinek  <jakub@redhat.com>
9296
9297         * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic
9298         PC relative relocs against hidden symbols.
9299         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
9300
9301 2002-04-03  Alan Modra  <amodra@bigpond.net.au>
9302
9303         * elf.c (_bfd_elf_make_section_from_shdr): When setting section
9304         LMAs, loop over segments until p_vaddr and p_memsz specify an
9305         extent enclosing the section.
9306
9307 2002-04-02  Nick Clifton  <nickc@cambridge.redhat.com>
9308
9309         * ihex.c (ihex_write_object_contents): Do not allow records to
9310         cross a 64K boundary - wrap if necessary.
9311
9312 2002-04-01  Nathan Williams  <nathanw@wasabisystems.com>
9313
9314         * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
9315         which caused the returned LWP ID to always be 0.
9316
9317 2002-04-01  Richard Henderson  <rth@redhat.com>
9318
9319         * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
9320         (elf32_sparc_relocate_section): Use it to figure out when to
9321         initialize .got entries.
9322         * elf64-sparc.c: Similarly.
9323
9324 2002-03-28  Alan Modra  <amodra@bigpond.net.au>
9325
9326         * linker.c (link_action): Ignore duplicate warning syms.
9327         (_bfd_generic_link_write_global_symbol): Follow warning symbol link.
9328         * elflink.h (elf_adjust_dynstr_offsets): Likewise.
9329         (elf_adjust_dynamic_symbol): Likewise.
9330         (elf_export_symbol): Likewise.
9331         (elf_link_find_version_dependencies): Likewise.
9332         (elf_link_assign_sym_version): Likewise.
9333         (elf_link_sec_merge_syms): Likewise.
9334         (elf_link_output_extsym): Likewise.
9335         (elf_gc_sweep_symbol): Likewise.
9336         (elf_gc_propagate_vtable_entries_used): Likewise.
9337         (elf_gc_smash_unused_vtentry_relocs): Likewise.
9338         (elf_gc_allocate_got_offsets): Likewise.
9339         (elf_collect_hash_codes): Likewise.
9340         * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
9341         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
9342         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
9343         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
9344         * elf32-arm.h (elf32_arm_discard_copies): Likewise.
9345         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
9346         (elf_cris_discard_excess_dso_dynamics): Likewise.
9347         * elf32-hppa.c (clobber_millicode_symbols): Likewise.
9348         (mark_PIC_calls): Likewise.
9349         (allocate_plt_static): Likewise.
9350         (allocate_dynrelocs): Likewise.
9351         (readonly_dynrelocs): Likewise.
9352         * elf32-i386.c (allocate_dynrelocs): Likewise.
9353         (readonly_dynrelocs): Likewise.
9354         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
9355         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
9356         * elf32-mips.c (mips_elf_output_extsym): Likewise.
9357         (mips_elf_sort_hash_table_f): Likewise.
9358         (mips_elf_check_mips16_stubs): Likewise.
9359         * elf32-s390.c (allocate_dynrelocs): Likewise.
9360         (readonly_dynrelocs): Likewise.
9361         * elf32-sh.c (sh_elf_discard_copies): Likewise.
9362         * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
9363         (xstormy16_relax_plt_realloc): Likewise.
9364         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
9365         (elf64_alpha_output_extsym): Likewise.
9366         * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
9367         * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
9368         (mips_elf64_check_mips16_stubs): Likewise.
9369         (mips_elf64_output_extsym): Likewise.
9370         * elf64-ppc.c (func_desc_adjust): Likewise.
9371         (allocate_dynrelocs): Likewise.
9372         (readonly_dynrelocs): Likewise.
9373         * elf64-s390.c (allocate_dynrelocs): Likewise.
9374         (readonly_dynrelocs): Likewise.
9375         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
9376         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
9377         (readonly_dynrelocs): Likewise.
9378         * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
9379         * aoutx.h (aout_link_write_other_symbol): Likewise.
9380         * cofflink.c (_bfd_coff_write_task_globals): Likewise.
9381         (_bfd_coff_write_global_sym): Likewise.
9382         * i386linux.c (linux_tally_symbols): Likewise.
9383         * m68klinux.c (linux_tally_symbols): Likewise.
9384         * sparclinux.c (linux_tally_symbols): Likewise.
9385         * pdp11.c (aout_link_write_other_symbol): Likewise.
9386         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
9387         * xcofflink.c (xcoff_build_ldsyms): Likewise.
9388         (xcoff_write_global_symbol): Likewise.
9389
9390         * cofflink.c (_bfd_coff_final_link): Formatting.
9391         * cpu-mips.c (mips_compatible): Make static, prototype.
9392         * elf32-i386.c (elf_i386_check_relocs): Formatting.
9393         * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
9394         * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
9395         * elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
9396         (mips_elf64_final_link): Likewise.
9397         * elflink.h (elf_link_find_version_dependencies): Remove duplicate
9398         prototype.
9399
9400 2002-03-27  Nick Clifton  <nickc@cambridge.redhat.com>
9401
9402         * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define.
9403         (SWAP_OUT_RELOC_OFFSET): Define.
9404
9405 2002-03-27  Gregory Steuck <greg@nest.cx>
9406
9407         * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for
9408         terminating NULL if empty symbol table.
9409         (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
9410
9411 2002-03-26  H.J. Lu  (hjl@gnu.org)
9412
9413         * elflink.h (elf_link_input_bfd): Revert the last change since
9414         the gcc exception handling isn't fixed yet.
9415
9416 2002-03-26  H.J. Lu  (hjl@gnu.org)
9417
9418         * elflink.h (elf_link_input_bfd): Complain about relocations
9419         against local symbols in discarded sections.
9420
9421 2002-03-26  Alan Modra  <amodra@bigpond.net.au>
9422
9423         * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections.
9424
9425 2002-03-23  Alan Modra  <amodra@bigpond.net.au>
9426
9427         * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
9428         section file offset for !SEC_LOAD sections.
9429
9430 2002-03-21  Richard Earnshaw  <rearnsha@arm.com>
9431
9432         * elf32-arm.h (elf32_arm_final_link_relocate <case R_ARM_GOTOFF>,
9433         <case R_ARM_GOT>): Handle relocations to Thumb functions.
9434
9435 2002-03-21  Alan Modra  <amodra@bigpond.net.au>
9436
9437         * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
9438         Whitespace changes.
9439         * archive.c: Update copyright date.
9440         * bfd-in2.h: Regenerate.
9441         * libbfd.h: Regenerate.
9442         * Makefile.am: Run "make dep-am"
9443         * Makefile.in: Regenerate.
9444         * po/SRC-POTFILES.in: Regenerate.
9445
9446 2002-03-20  Daniel Jacobowitz  <drow@mvista.com>
9447
9448         * dwarf2.c (struct funcinfo): Move up.
9449         (lookup_address_in_function_table): New argument function_ptr.
9450         Set it.
9451         (lookup_address_in_line_table): New argument function.  If function
9452         is non-NULL, use it to handle ``addr'' before the first line note of
9453         the function.
9454         (comp_unit_find_nearest_line): Update and swap calls to
9455         lookup_address_in_function_table and lookup_address_in_line_table.
9456         * syms.c (_bfd_stab_section_find_nearest_line): Use the first
9457         N_SLINE encountered if we see an N_FUN before any N_SLINE.
9458
9459 2002-03-20  Tom Rix  <trix@redhat.com>
9460
9461         * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from
9462         _bfd_xcoff_generic_stat_arch_elt.  Fix format check.
9463         * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt.
9464
9465 2002-03-19  Tom Rix  <trix@redhat.com>
9466
9467         * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all
9468         dynamic objects in archives.
9469
9470 2002-03-19  Hans-Peter Nilsson  <hp@bitrange.com>
9471
9472         * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
9473         STT_NOTYPE symbols to STT_OBJECT.
9474
9475 2002-03-18  Jan Hubicka  <jh@suse.cz>
9476
9477         * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64"
9478
9479 2002-03-18  Tom Rix  <trix@redhat.com>
9480
9481         * aix5ppc.core.c : New file for AIX 5 64 bit core support.
9482         * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration.
9483         * coff-rs6000 (do_pad) : New function for archive padding.
9484         (do_copy) : New function for object file copying in archives.
9485         (do_shared_object_padding) : New function for padding shared
9486         objects to their text section alignment in archives.
9487         (bfd_xcoff_ar_achive_set_magic) : Stub.
9488         (xcoff_write_armap_big) : Use do_copy and do_pad.
9489         (xcoff_write_archive_contents_big) : Use do_shared_object_padding,
9490         do_copy and do_pad.
9491         * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use
9492         bfd_xcoff_magic_number.
9493         (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook
9494         fop.
9495         (xcoff_backend_data_r) : Use xcoff64_bad_format_hook.
9496         (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data.
9497         (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000.
9498         * rs6000-core.c : Update copyright date.
9499         * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL
9500         csectpp.
9501         * coffcode.h (coff_new_section_hook) : Use new accessor macros.
9502         (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #.
9503         (coff_set_flags) : Use bfd_xcoff_magic_number.
9504         * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC.
9505         * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support.
9506         * Makefile.am : Same.
9507         * config.bfd : Same.
9508         * targets.c : Same.
9509         * configure : Regnerate.
9510         * Makefile.in : Same.
9511         * bfd-in2.h : Same.
9512
9513 2002-03-18  Nick Clifton  <nickc@cambridge.redhat.com>
9514
9515         * po/fr.po: Updated version.
9516
9517 2002-03-18  Alan Modra  <amodra@bigpond.net.au>
9518
9519         * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success.
9520         * libbfd.h: Regenerate.
9521         * archive.c (coff_write_armap): Pass on failures from
9522         bfd_write_bigendian_4byte_int.
9523
9524 2002-03-14  H.J. Lu <hjl@gnu.org>
9525
9526         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD
9527         error to bfd_error_nonrepresentable_section for reinit_array
9528         section in DSO.
9529
9530 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
9531
9532         * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag,
9533         OR it in rather than replacing previously selected flags.
9534
9535         * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15.
9536         (TARGET_LITTLE_SYM): Set ar_max_namelen to 15.
9537
9538 2002-03-14  Alan Modra  <amodra@bigpond.net.au>
9539
9540         * cpu-mips.c (mips_compatible): New.  Don't check bits_per_word.
9541         (N): Use the above.
9542         * elflink.h (elf_bfd_final_link): Revert last change.  Instead,
9543         ensure reloc size matches before calling elf_link_input_bfd.
9544         Add an assert to check reloc size when counting output relocs.
9545
9546 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
9547
9548         * mmo.c (mmo_get_loc): Return NULL rather than false.
9549
9550 2002-03-13  Nick Clifton  <nickc@cambridge.redhat.com>
9551
9552         * po/fr.po: Updated version.
9553
9554 2002-03-13  Alan Modra  <amodra@bigpond.net.au>
9555
9556         * archures.c (bfd_default_compatible): Test bits_per_word.
9557         * cpu-i386.c (i386_compatible): Remove.  Replace occurrences with
9558         bfd_default_compatible.
9559         * cpu-i370.c (i370_compatible): Likewise.
9560         * cpu-sparc.c (sparc_compatible): Likewise.
9561         * cpu-h8300.c (compatible): Test in->arch == out->arch.
9562
9563         * elflink.h: Formatting fixes.
9564         (elf_link_output_extsym): Merge undefined and undef weak cases.
9565
9566         * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd
9567         when word size of input matches output word size.
9568
9569 2002-03-12  Andreas Jaeger  <aj@suse.de>
9570
9571         * cpu-i386.c (i386_compatible): New.  Use it instead of
9572         bfd_default_compatible.
9573
9574 2002-03-07  H.J. Lu  (hjl@gnu.org)
9575
9576         * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type
9577         as the type for bfd_reloc_val.
9578
9579 2002-03-05  John David Anglin  <dave@hiauly1.hia.nrc.ca>
9580
9581         * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
9582         (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols.
9583         (elf_hppa_final_link_relocate): Correct relocations for indirect
9584         references to local data through the DLT.  Fix .opd creation for
9585         local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64
9586         relocations.  Use e_lsel selector for R_PARISC_DLTIND21L,
9587         R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per
9588         "Processor-Specific ELF for PA_RISC, Version 1.43" document.
9589         Similarly, use e_rsel for DLT and LTOFF 'R' relocations.
9590         * elf32-hppa.c (final_link_relocate): Revise relocation selectors
9591         as per "Processor-Specific ELF for PA_RISC, Version 1.43" document.
9592
9593 2002-03-05  Jakub Jelinek  <jakub@redhat.com>
9594
9595         * merge.c (_bfd_merge_sections): Don't segfault if there
9596         is nothing to merge due to GC.
9597
9598 2002-03-05  Alan Modra  <amodra@bigpond.net.au>
9599
9600         * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep
9601         symbols that have been forced local.
9602
9603         * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
9604         to output forced local syms for non-shared link.
9605         (elf_link_output_extsym): Tweak condition for calling backend
9606         adjust_dynamic_symbol so that previous behaviour is kept.
9607         Whitespace changes throughout file.
9608
9609 2002-03-04  H.J. Lu <hjl@gnu.org>
9610
9611         * elf.c (bfd_section_from_shdr): Handle special sections,
9612         .init_array, .fini_array and .preinit_array.
9613         (elf_fake_sections): Likewise.
9614
9615         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the
9616         DT entry only if the section is in output for .init_array,
9617         .fini_array and .preinit_array. Complain about .preinit_array
9618         section in DSO.
9619         (elf_bfd_final_link): Warn zero size for .init_array,
9620         .fini_array and .preinit_array sections.
9621
9622         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
9623         SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
9624         (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
9625         .preinit_array.
9626
9627 2002-03-04  Alan Modra  <amodra@bigpond.net.au>
9628
9629         * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment.
9630         * configure: Regenerate.
9631
9632 2002-03-02  Tom Rix  <trix@redhat.com>
9633
9634         * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with
9635         symbolic equiv.
9636         * coff-rs6000.c (xcoff_howto_table): Same.
9637
9638 2002-03-01  David Mosberger  <davidm@hpl.hp.com>
9639
9640         * elflink.h (size_dynamic_sections): If section named
9641         ".preinit_array" exists, create DT_PREINIT_ARRAY and
9642         DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
9643         ".init_array" and ".fini_array".
9644         (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
9645         DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
9646         DT_FINI_ARRAY.
9647
9648 2002-02-26  Andrew Macleod  <amacleod@cygnus.com>
9649
9650         * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
9651         dynsyms.
9652
9653 2002-02-25  Alan Modra  <amodra@bigpond.net.au>
9654
9655         * elf64-hppa.h: Update copyright date.
9656
9657         * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix.
9658         (ppc64_elf_relocate_section): Don't generate power4 style branch
9659         hints for *_BRTAKEN and *_BRNTAKEN relocs.
9660
9661 2002-02-22  Jakub Jelinek  <jakub@redhat.com>
9662
9663         * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my
9664         last patch.
9665         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
9666
9667 2002-02-21  Andreas Jaeger  <aj@suse.de>
9668
9669         * elf64-x86-64.c: Major rework that introduces all recent changes
9670         to the x86-64 backend.  Get a closer match to elf32-i386.
9671         (struct elf64_x86_64_dyn_relocs): Rename from
9672         elf64_x86_64_pcrel_relocs_copied, add additional fields.  Change
9673         all users.
9674         (struct elf64_x86_64_link_hash_table): Add short cuts to some
9675         sections.
9676         (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc,
9677         remove casts, initialize new hash members.
9678         (create_got_section): New.
9679         (elf64_x86_64_create_dynamic_sections): New.
9680         (elf64_x86_64_copy_indirect_symbol): New.
9681         (elf64_x86_64_check_relocs): Don't allocate space for dynamic
9682         relocs, .got or .relgot here but do it in allocate_dynrelocs.
9683         Reference count possible .plt and .got entries.  Don't test input
9684         section SEC_READONLY here to try to avoid copy relocs, and keep
9685         dyn_relocs regardless of ELF_LINK_NON_GOT_REF.  Don't set
9686         DF_TEXTREL here.  Delay setting of variables until needed.  Cache
9687         pointer to "sreloc" section in elf_section_data. Tweak condition
9688         under which .got created.  Report files with bad relocation
9689         section names.
9690         (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
9691         Reference count possible .plt entries.  Don't deallocate .got and
9692         .relgot space here.
9693         (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc.  Don't
9694         do copy reloc processing for weakdefs.  Remove redundant casts and
9695         aborts.  Delay setting of vars until needed.  Move creation of
9696         dynamic symbols and allocation of .plt and .rela.plt to
9697         allocate_dynrelocs.  Replace BFD_ASSERT with abort.
9698         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
9699         (allocate_dynrelocs): New.
9700         (readonly_dynrelocs): New.
9701         (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs.
9702         Allocate space for dyn relocs.  Replace BFD_ASSERT with abort.
9703         Zero out the dynamic allocated content space.
9704         (elf64_x86_64_discard_copies): Removed.
9705         (elf64_x86_64_relocate_section): Make use of dynamic section
9706         short-cuts.  Localise vars, and delay setting.  Better error
9707         reporting, replace BFD_ASSERT with abort.  Check
9708         ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the
9709         regular object file and tread the weak definition as the normal
9710         one.  Don't discard relocs for undefweak or undefined symbols and
9711         check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy
9712         relocs.
9713         (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for
9714         symbols that have been forced local.  Use same test to decide if
9715         we can use a relative reloc for got as relocate_section.  Expand
9716         SHN_UNDEF comment.  Move expressions out of function calls.
9717         Replace BFD_ASSERT with abort.
9718         (bfd_elf64_bfd_final_link): Removed.
9719         (elf_backend_copy_indirect_symbol): Define.
9720
9721 2002-02-20  Tom Rix  <trix@redhat.com>
9722
9723         * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA.
9724         (_bfd_xcoff_reloc_type_lookup): Use it.
9725         * coff64-rs6000.c (xcoff64_howto_table): Same.
9726         (xcoff64_reloc_type_lookup): Same.
9727
9728 2002-02-20  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>
9729
9730         * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are
9731         little endian.
9732
9733 2002-02-19  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9734
9735         * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31.
9736         (bfd_mach_s390_esame): Rename to bfd_mach_s390_64.
9737         * bfd-in2.h: Regenerate.
9738         * cpu-s390.c (arch_info_struct): Use renamed architecture defines.
9739         Replace architecture name "s390" with "s390:31-bit" and "s390:esame"
9740         with "s390:64-bit".
9741         * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations.
9742         (elf_s390_reloc_type_lookup): Likewise.
9743         (elf_s390_check_relocs): Likewise.
9744         (elf_s390_gc_sweep_hook): Likewise.
9745         (elf_s390_relocate_section): Likewise.
9746         (elf_s390_object_p): Use renamed architecture define.
9747         * elf64-s390.c (elf_s390_object_p): Use renamed architecture define.
9748
9749 2002-02-19  Frank Ch. Eigler  <fche@redhat.com>
9750
9751         * syms.c (stt[]): Sorted.  Added .init/.fini -> "t" mapping.
9752
9753 2002-02-19  Jakub Jelinek  <jakub@redhat.com>
9754
9755         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable
9756         absptr -> pcrel optimization for shared libs.
9757         Only create minimal .eh_frame_hdr if absptr FDE encoding in shared
9758         library cannot be converted to pcrel.
9759         (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr
9760         relative.
9761         * elf32-i386.c (elf_i386_relocate_section): If
9762         _bfd_elf_section_offset returned -2, skip, but make sure the
9763         relocation is installed.
9764         * elf32-arm.h (elf32_arm_final_link_relocate): Likewise.
9765         * elf32-cris.c (cris_elf_relocate_section): Likewise.
9766         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
9767         * elf32-i370.c (i370_elf_relocate_section): Likewise.
9768         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
9769         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
9770         * elf32-s390.c (elf_s390_relocate_section): Likewise.
9771         * elf32-sh.c (sh_elf_relocate_section): Likewise.
9772         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
9773         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
9774         * elf64-s390.c (elf_s390_relocate_section): Likewise.
9775         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
9776         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
9777         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
9778         * elf64-alpha.c (elf64_alpha_relocate_section): Handle
9779         _bfd_elf_section_offset returning -2 the same way as -1.
9780         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
9781         * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME
9782         and BFD_ASSERT.
9783         * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise.
9784
9785 2002-02-18  Tom Rix  <trix@redhat.com>
9786
9787         * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support.
9788         (bfd_xcoff_size_dynamic_sections): Same.
9789         * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same.
9790         (bfd_xcoff_size_dynamic_sections): Same.
9791         * coff-rs6000.c (xcoff_generate_rtinit): Same.
9792         * coff-rs646000.c (xcoff64_generate_rtinit): Same.
9793         * libxcoff.h (struct xcoff_backend_data_rec): Same.
9794         * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean.
9795         * bfd-in2.h: Regenerate.
9796
9797 2002-02-18  Alan Modra  <amodra@bigpond.net.au>
9798
9799         * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define.
9800         (struct ppc_link_hash_table): Add sfpr.
9801         (ppc64_elf_link_hash_table_create): Init it.
9802         (ppc64_elf_create_dynamic_sections): Split creation of .stub and
9803         .glink out to..
9804         (create_linkage_sections): ..here.  Make .sfpr too.
9805         (ppc64_elf_check_relocs): Call create_linkage_sections, and set
9806         dynobj early.
9807         (MIN_SAVE_FPR, MAX_SAVE_FPR): Define.
9808         (ppc64_elf_func_desc_adjust): Look for missing ._savef* and
9809         ._restf* functions, and create as needed.
9810         (func_desc_adjust): Only force_local for shared libs.
9811
9812 2002-02-18  David O'Brien  <obrien@FreeBSD.org>
9813
9814         * configure.in: Bump version number post 2.12 branching.
9815         * configure: Regenerate.
9816
9817 2002-02-17  Hans-Peter Nilsson  <hp@bitrange.com>
9818
9819         * mmo.c: Correct and improve comments.
9820         (mmo_write_chunk): Store trailing byte in bfd buffer; don't
9821         zero-pad.  Use input to fill up non-empty bfd buffer.
9822         (mmo_flush_chunk): New function.
9823         (mmo_write_loc_chunk): Add parameter last_vmap, all callers
9824         changed.  Don't emit location specifier if VMA is same as
9825         *LAST_VMAP after omitting leading zero contents.  Call
9826         mmo_flush_chunk before emitting location specifier.
9827         (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished
9828         with mmo_write_loc_chunk calls.
9829         (mmo_internal_write_section): Call mmo_flush_chunk after
9830         mmo_write_chunk.
9831         (mmo_write_symbols_and_terminator): Move :Main to first position
9832         in symbol array.  Add faked one if it does not exist if there are
9833         other symbols.  Don't add it if there are no symbols at all.  Move
9834         out test for value of :Main from symbol loop.  Rename table
9835         fakemain to maintable and variable mainsym to fakemain.
9836
9837 2002-02-15  Richard Henderson  <rth@redhat.com>
9838
9839         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target
9840         section with no got matches any got.  Simplify error generaion.
9841
9842 2002-02-15  Alan Modra  <amodra@bigpond.net.au>
9843
9844         Support arbitrary length fill patterns.
9845         * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc.
9846         (_bfd_default_link_order): Remove bfd_fill_link_order code.
9847         Call default_data_link_order.
9848         (default_fill_link_order): Delete.
9849         (default_data_link_order): New function.
9850         * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences
9851         of bfd_fill_link_order with bfd_data_link_order.
9852         * elf64-alpha.c (elf64_alpha_final_link): Likewise.
9853         * elf64-mips.c (mips_elf64_final_link): Likewise.
9854
9855         * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value.
9856         Correct value returned in "end" for "0x<non-hex>".
9857
9858 2002-02-14  Nick Clifton  <nickc@cambridge.redhat.com>
9859
9860         * cpu-arm.c (processors): Replace 'arch' field with 'mach'.
9861         (scan): Test against 'mach' field in info structure.
9862
9863 2002-02-14  Alan Modra  <amodra@bigpond.net.au>
9864
9865         * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD.
9866
9867 2002-02-14  Matt Fredette  <fredette@netbsd.org>
9868
9869         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize
9870         EF_M68000.
9871
9872 2002-02-13  Nick Clifton  <nickc@cambridge.redhat.com>
9873
9874         * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on
9875         non-zero physical addresses when adjusting the LMAs of new
9876         sections.
9877
9878 2002-02-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
9879
9880         * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped
9881         from _bfd_elf_hppa_gen_reloc_type.
9882         (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype.
9883         * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype.
9884         * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h.
9885         * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype.
9886
9887 2002-02-12  Alexandre Oliva  <aoliva@redhat.com>
9888
9889         * elf-m10300.c (mn10300_elf_relax_section): Skip section before
9890         loading its contents if there's nothing to do in it.
9891
9892 2002-02-12  Alan Modra  <amodra@bigpond.net.au>
9893
9894         * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
9895         64k boundary.
9896
9897         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic
9898         DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
9899         (ppc64_elf_finish_dynamic_sections): Set values for them.
9900
9901 2002-02-11  Michael Snyder  <msnyder@redhat.com>
9902
9903         * elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
9904         * elf.c (elfcore_grok_pstatus): Add prototype.
9905         (elfcore_grok_lwpstatus): Add prototype.
9906         (elfcore_write_lwpstatus): New function.
9907         (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
9908
9909 2002-02-11  Alexandre Oliva  <aoliva@redhat.com>
9910
9911         * elf32-sh.c: Added missing prototypes.
9912         * elf32-sh64.c: Likewise.
9913         (sh_elf_align_loads): Mark unused args as such.
9914         * elf64-sh64.c: Added missing prototypes.
9915         (struct elf_sh64_link_hash_entry): Fix typo.
9916         (sh_elf64_relocate_section): Fix info argument passed to
9917         _bfd_elf_section_offset.
9918
9919 2002-02-11  Alan Modra  <amodra@bigpond.net.au>
9920
9921         * Makefile.am: "make dep-am".
9922         * Makefile.in: Regenerate.
9923         * aclocal.m4: Regenerate.
9924         * config.in: Regenerate.
9925         * configure: Regenerate.
9926
9927 2002-02-10  Daniel Jacobowitz  <drow@mvista.com>
9928
9929         * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized
9930         variable warnings.
9931         * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned
9932         comparison warning.
9933         * trad-core.c (trad_unix_core_file_p): Silence pointer/integer
9934         cast warnings for the common case.
9935
9936 2002-02-10  Hans-Peter Nilsson  <hp@bitrange.com>
9937
9938         * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64
9939         vectors.
9940         (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64
9941         vectors.
9942
9943 2002-02-09  Richard Henderson  <rth@redhat.com>
9944
9945         * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP.
9946         (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise.
9947         (elf64_alpha_relocate_section): Likewise.
9948         * reloc.c (BFD_RELOC_ALPHA_BRSGP): New.
9949         * bfd-in2.h, libbfd.h: Rebuild.
9950
9951 2002-02-09  Hans-Peter Nilsson  <hp@bitrange.com>
9952
9953         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check
9954         that base-plus-offset reloc accounting is consistent.
9955         (mmix_elf_relax_section): Keep base-plus-offset reloc accounting
9956         up to date for undefined symbols.
9957
9958 2002-02-08  Eric Christopher  <echristo@redhat.com>
9959
9960         From Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
9961
9962         * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
9963         sections for the O32 ABI.
9964
9965 2002-02-08  Chris Demetriou  <cgd@broadcom.com>
9966
9967         * elf32-arm.h: Fix formatting of _("...").
9968         * elf32-d10v.c: Likewise.
9969         * elf32-m68k.c: Likewise.
9970         * elf32-mips.c: Likewise.
9971
9972 2002-02-08  Ivan Guzvinec <ivang@opencores.org>
9973
9974         * coff-or32.c: Fix compile time warning messages.
9975
9976 2002-02-08  Alexandre Oliva  <aoliva@redhat.com>
9977
9978         Contribute sh64-elf.
9979         2002-01-23  Alexandre Oliva  <aoliva@redhat.com>
9980         * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16,
9981         R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16,
9982         R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16,
9983         R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16,
9984         R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16,
9985         R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16,
9986         R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16,
9987         R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8,
9988         R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64):
9989         New relocs.
9990         * libbfd.h, bfd-in2.h: Rebuilt.
9991         * elf32-sh.c (sh_elf_howto_table): Define new relocs.
9992         (sh_reloc_map): Map them.
9993         (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
9994         elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be,
9995         elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry,
9996         elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
9997         elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset,
9998         elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset,
9999         movi_shori_putval) [INCLUDE_SHMEDIA]: New.
10000         (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add
10001         datalabel_got_offset.
10002         (sh_elf_link_hash_newfunc): Initialize it.
10003         (sh_elf_relocate_section): Augment the scope of
10004         seen_stt_datalabel.  Introduce GOTPLT support.  Extend GOTPC, PLT,
10005         GOT and GOTOFF handling to new SHmedia relocation types.  Support
10006         GOT_BIAS.
10007         (sh_elf_check_relocs): Likewise.
10008         (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in
10009         PLT entries using movi_shori_putval.  Support GOT_BIAS.
10010         (sh_elf_finish_dynamic_sections): Likewise.
10011         * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to
10012         relocation, it's now done by the caller.
10013         (GOT_BIAS): New.
10014         * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt,
10015         elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset,
10016         elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset,
10017         elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER,
10018         elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry,
10019         elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse,
10020         sh64_elf64_hash_table): New.
10021         (sh_elf64_howto_table): Introduce new relocs.
10022         (sh_elf64_info_to_howto): Accept new PIC relocs.
10023         (sh_elf64_relocate_section): Augment the scope of
10024         seen_stt_datalabel.  Support new PIC relocs.
10025         (sh_elf64_check_relocs): Support new PIC relocs.
10026         (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le,
10027         elf_sh64_plt_entry_be, elf_sh64_plt_entry_le,
10028         elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le,
10029         elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry,
10030         sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create,
10031         movi_shori_putval, movi_3shori_putval,
10032         sh64_elf64_create_dynamic_sections,
10033         sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies,
10034         sh64_elf64_size_dynamic_sections,
10035         sh64_elf64_finish_dynamic_symbol,
10036         sh64_elf64_finish_dynamic_sections): New.
10037         (elf_backend_create_dynamic-sections,
10038         bfd_elf64_bfd_link_hash_table_create,
10039         elf_backend_adjust_dynamic_symbol,
10040         elf_backend_size_dynamic_sections,
10041         elf_backend_finish_dynamic_symbol,
10042         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
10043         elf_backend_plt_readonly, elf_backend_want_plt_sym,
10044         elf_backend_got_header_size, elf_backend_plt_header_size):
10045         Define.
10046         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
10047         * elf32-sh.c: Renumbered and renamed some SH5 relocations to
10048         match official numbers and names; moved unmaching ones to the
10049         range 0xf2-0xff.
10050         * elf32-sh64.c, elf64-sh64.c: Likewise.
10051         2001-03-12  DJ Delorie  <dj@redhat.com>
10052         * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia
10053         sections.
10054         2001-03-12  DJ Delorie  <dj@redhat.com>
10055         * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must
10056         be aligned.
10057         * elf64-sh64.c (sh_elf64_relocate_section): Ditto.
10058         2001-01-14  Hans-Peter Nilsson  <hpn@cygnus.com>
10059         * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define.
10060         (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a
10061         .cranges section with SEC_SORT_ENTRIES set.
10062         (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an
10063         incoming sorted .cranges section.
10064         (sh64_bfd_elf_copy_private_section_data): New.
10065         (sh64_elf_final_write_processing): Only sort .cranges and modify
10066         start address if called by linker.
10067         2001-01-08  Ben Elliston  <bje@redhat.com>
10068         * elf32-sh64.c (sh64_elf_final_write_processing): Activate
10069         Hans-Peter Nilsson's set bit 0 patch from 2001-01-06.
10070         * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto.
10071         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
10072         * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of
10073         line.  Add comments before all entries.
10074         <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct and clarify describing
10075         comment.
10076         (sh_elf64_reloc): Correct head comment.
10077         (sh_elf64_relocate_section): Correct spacing.
10078         <relocating for a local symbol>: Do not honour STO_SH5_ISA32;
10079         instead call reloc_dangerous callback.
10080         <case R_SH_SHMEDIA_CODE>: New case.
10081         (sh_elf64_gc_mark_hook): Correct spacing.
10082         (sh_elf64_check_relocs): Ditto.
10083         * elf32-sh64.c (shmedia_prepare_reloc) <case R_SH_SHMEDIA_CODE>:
10084         New case.
10085         * elf32-sh.c: Correct #endif comments for #ifndef-wrapped
10086         functions.
10087         (sh_elf_howto_table) <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct,
10088         clarify describing comment.  Add comments before all entries.
10089         (sh_elf_relocate_section) <relocating for a local symbol>: Do not
10090         honour STO_SH5_ISA32; instead call reloc_dangerous callback.
10091         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
10092         Sort .cranges section in final link.  Prepare to set bit 0 on
10093         entry address.
10094         * elf32-sh64.c (struct sh64_find_section_vma_data): New.
10095         (sh64_elf_link_output_symbol_hook): Fix typo in prototype.
10096         (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming
10097         .cranges section.
10098         (sh64_backend_section_from_shdr): New, to recognize
10099         SHT_SH5_CR_SORTED on incoming .cranges section.
10100         (elf_backend_section_from_shdr): Define.
10101         (sh64_elf_final_write_processing): Sort outgoing .cranges
10102         section.  (New, temporarily disabled:) Set bit 0 on entry address
10103         according to ISA type.
10104         (sh64_find_section_for_address): New.
10105         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb,
10106         crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c.
10107         (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c.  Use
10108         bfd_malloc, not xmalloc.
10109         (sh64_get_contents_type): Move here from opcodes/sh64-dis.c.  Make
10110         global.
10111         * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but
10112         temporarily disabled) setting bit 0 on entry address.
10113         (elf_backend_final_write_processing): Define.
10114         2001-01-05  Hans-Peter Nilsson  <hpn@cygnus.com>
10115         * elf32-sh.c (sh_elf_howto_table) <R_SH_PT_16>: Adjust fields to
10116         be a proper relocation for PTA and PTB rather than a marker.
10117         <R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2,
10118         R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16,
10119         R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16,
10120         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL,
10121         R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL>:
10122         Zero src_mask.
10123         * elf64-sh64.c: Ditto.
10124         (sh_elf64_relocate_section) <case R_SH_PT_16>: New case.
10125         * elf32-sh64.c: Include opcodes/sh64-opc.h
10126         (shmedia_prepare_reloc): Take a bfd_link_info pointer as first
10127         argument.  Drop const qualifiers from "bfd *" and "bfd_byte *"
10128         parameters.  No unused parameters.  Caller changed.
10129         <case R_SH_PT_16>: New case.
10130         * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h.
10131         * Makefile.in: Regenerate.
10132         2000-12-30  Hans-Peter Nilsson  <hpn@cygnus.com>
10133         * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for
10134         all code sections.
10135         (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
10136         (sh64_elf_merge_private_data): Ditto.
10137         * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data
10138         to access stored section flags.
10139         (sh64_elf_final_write_processing): Return immediately unless
10140         called by linker.  Use sh64_elf_section_data (cranges) to get size
10141         of linker-generated cranges entries.
10142         (sh64_elf_copy_private_data): Add missing "return true".
10143         (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
10144         (sh_elf64_merge_private_data): Ditto.
10145         2000-12-19  Hans-Peter Nilsson  <hpn@cygnus.com>
10146         * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of
10147         elf64-sh64.c:sh64_elf_fake_sections.
10148         (elf_backend_fake_sections): Define as sh64_elf64_fake_sections.
10149         2000-12-18  Hans-Peter Nilsson  <hpn@cygnus.com>
10150         * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete.
10151         (sh64_elf_final_write_processing): New.
10152         (elf_backend_final_write_processing): Define.
10153         (sh64_elf_fake_sections): Get header flags from tdata field.
10154         (sh64_elf_copy_private_data): Do not call
10155         sh64_elf_copy_private_data_internal, just copy e_flags field.
10156         (sh64_elf_merge_private_data): Do not call
10157         sh64_elf_copy_private_data_internal.
10158         2000-12-12  Hans-Peter Nilsson  <hpn@cygnus.com>
10159         Remove EF_SH64_ABI64, let ELF size make difference.
10160         Remove SH64-specific BFD section flag.
10161         * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as
10162         containing SHmedia through elf_section_data (asect)->tdata
10163         non-zero, not using a BFD section flag.
10164         (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64.
10165         (sh64_elf_merge_private_data): Similar.
10166         (elf_backend_section_flags): Don't define.
10167         (sh64_elf_backend_section_flags): Delete.
10168         * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64,
10169         not EF_SH64_ABI64.
10170         (sh_elf64_merge_private_data): Similar.
10171         * section.c (Section flags definitions): Don't define
10172         SEC_SH_ISA_SHMEDIA.
10173         (bfd-in2.h): Regenerate.
10174         2000-12-09  Hans-Peter Nilsson  <hpn@cygnus.com>
10175         Make DataLabel references work with partial linking.
10176         * elf32-sh64.c: Fix formatting.
10177         (sh64_elf_link_output_symbol_hook): New.
10178         (elf_backend_link_output_symbol_hook): Define to
10179         sh64_elf_link_output_symbol_hook.
10180         (sh64_elf_add_symbol_hook): Make DataLabel symbol just global
10181         undefined if partial linking.  Adjust sanity check.
10182         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New.
10183         (elf_backend_link_output_symbol_hook): Define to
10184         sh64_elf64_link_output_symbol_hook.
10185         (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global
10186         undefined if partial linking.  Adjust sanity check.
10187         2000-12-07  Hans-Peter Nilsson  <hpn@cygnus.com>
10188         Implement semantics for inter-file DataLabel references.
10189         * elf64-sh64.c (DATALABEL_SUFFIX): Define.
10190         (sh64_elf64_add_symbol_hook): New.
10191         (sh_elf64_relocate_section): If passing an indirect symbol with
10192         st_type STT_DATALABEL on the way to a symbol with st_other
10193         STO_SH5_ISA32, do not bitor 1 to the relocation.
10194         (elf_backend_add_symbol_hook): Define to
10195         sh64_elf64_add_symbol_hook.
10196         * elf64-sh32.c: Tweak comments.
10197         (DATALABEL_SUFFIX): Define.
10198         (sh64_elf_add_symbol_hook): New.
10199         (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook.
10200         * elf32-sh.c (sh_elf_relocate_section): If passing an indirect
10201         symbol with st_type STT_DATALABEL on the way to a symbol with
10202         st_other STO_SH5_ISA32, do not bitor 1 to the relocation.
10203         2000-12-05  Hans-Peter Nilsson  <hpn@cygnus.com>
10204         Pass through STT_DATALABEL.
10205         * elf32-sh64.c (sh64_elf_get_symbol_type): New.
10206         (elf_backend_get_symbol_type): Define.
10207         * elf64-sh64.c (sh64_elf64_get_symbol_type): New.
10208         (elf_backend_get_symbol_type): Define.
10209         2000-11-30  Hans-Peter Nilsson  <hpn@cygnus.com>
10210         * elf32-sh64.c: Tweak comments.
10211         (sh64_elf_copy_private_data_internal): Add prototype.
10212         (bfd_elf32_bfd_set_private_flags): Define.
10213         (sh64_elf_copy_private_data_internal): Compare machine name, not
10214         textual BFD target name, to check whether to copy section flag
10215         SHF_SH5_ISA32.
10216         (sh64_elf_merge_private_data): Validize bfd_get_arch_size.
10217         Tweak section-contents-type-mismatch message.
10218         (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers.
10219         Validize reloc-types.
10220         * elf64-sh64.c: New file.
10221         * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare.
10222         * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo.
10223         (BFD64_BACKENDS_CFILES): Add elf64-sh64.c.
10224         Regenerate dependencies.
10225         * Makefile.in: Regenerate.
10226         * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and
10227         bfd_elf64_sh64l_vec.
10228         * configure.in: Handle bfd_elf64_sh64_vec and
10229         bfd_elf64_sh64l_vec.
10230         * configure: Regenerate.
10231         * po/POTFILES.in: Regenerate.
10232         * po/bfd.pot: Regenerate.
10233         2000-11-29  Hans-Peter Nilsson  <hpn@cygnus.com>
10234         * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize
10235         anything else but EF_SH64 and EF_SH64_ABI64.
10236         (sh64_elf_merge_private_data): Emit error for anything else but
10237         EF_SH64 and EF_SH64_ABI64.
10238         * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec
10239         from targ_selvecs.
10240         * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and
10241         bfd_elf32_sh64l_vec as a temporary measure.
10242         * configure: Regenerate.
10243         2000-11-27  Hans-Peter Nilsson  <hpn@cygnus.com>
10244         * cpu-sh.c (arch_info_struct): Include sh5 item
10245         unconditionalized.
10246         * config.bfd (sh64-*-elf*): Do not set targ_cflags.
10247         Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec,
10248         bfd_elf32_shblin_vec and bfd_elf32_shlin_vec.
10249         * elf32-sh64.c: Tweak comments.
10250         (sh64_elf_set_mach_from_flags): Recognize all machine flags that
10251         are proper subsets of SH64 as bfd_mach_sh5.  Add EF_SH64_ABI64.
10252         (sh64_elf_copy_private_data_internal): Wrap long line.
10253         (sh64_elf_merge_private_data): Rewrite to allow objects from
10254         SH64 subsets to be linked together.
10255         (INCLUDE_SHMEDIA): Define.
10256         * elf32-sh.c (sh_elf_relocate_section) <local symbol>:
10257         Parenthesize plus-expression inside or-expression.
10258         <global symbol>: Ditto.
10259         (sh_elf_set_mach_from_flags): Remove code refusing
10260         deleted EF_SH64_32BIT_ABI flag.
10261         2000-11-26  Hans-Peter Nilsson  <hpn@cygnus.com>
10262         * elf32-sh.c (sh_elf_howto_table) <R_SH_IMM_LOW16_PCREL,
10263         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16_PCREL,
10264         R_SH_IMM_HI16_PCREL, R_SH_64_PCREL>: Set pcrel_offset to true.
10265         (sh_elf_relocate_section) <local symbol>: Or 1 in
10266         calculation of relocation if sym->st_other & STO_SH5_ISA32.
10267         <global symbol>: Ditto if h->other & STO_SH5_ISA32.
10268         * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to
10269         relocation.
10270         2000-11-24  Hans-Peter Nilsson  <hpn@cygnus.com>
10271         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo.
10272         (BFD32_BACKENDS_CFILES): Add elf32-sh64.c.
10273         Regenerate dependencies.
10274         * Makefile.in: Regenerate.
10275         * archures.c: Add bfd_mach_sh5.
10276         * config.bfd: Map targ_cpu sh* to bfd_sh_arch.
10277         Handle sh64-*-elf*.  Set targ_cflags to -DINCLUDE_SHMEDIA.
10278         * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec.
10279         * configure: Regenerate.
10280         * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5,
10281         BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6,
10282         BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2,
10283         BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8,
10284         BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16,
10285         BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16,
10286         BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16,
10287         BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16,
10288         BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations.
10289         * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link
10290         in item for SH5.
10291         * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items
10292         for SHmedia relocs.
10293         [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs.
10294         [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call
10295         shmedia_prepare_reloc, goto final_link_relocate if it returns
10296         non-zero, else fail as before.
10297         (sh_elf_set_mach_from_flags): Provide function only if not defined
10298         as macro.  Do not recognize objects with EF_SH64_32BIT_ABI set.
10299         (sh_elf_set_private_flags): Provide function only if not defined
10300         as a macro.
10301         (sh_elf_copy_private_data): Similar.
10302         (sh_elf_merge_private_data): Similar.
10303         * section.c (SEC_SH_ISA_SHMEDIA): New.
10304         * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare.
10305         * elf32-sh64.c: New file.
10306         * libbfd.h: Regenerate.
10307         * bfd-in2.h: Regenerate.
10308         * po/POTFILES.in: Regenerate.
10309         * po/bfd.pot: Regenerate.
10310         * bfd-in2.h: Regenerate.
10311         * libbfd.h: Regenerate.
10312
10313 2002-02-07  Daniel Jacobowitz  <drow@mvista.com>
10314
10315         * bfd-in.h: Update <stdbool.h> check to only see if <stdbool.h> has
10316         been included, not drag it in.
10317         * bfd-in2.h: Regenerate.
10318
10319 2002-02-06  H.J. Lu  (hjl@gnu.org)
10320
10321         * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update
10322         the mach and ISA fields if necessary.
10323
10324 2002-02-06  Nick Clifton  <nickc@cambridge.redhat.com>
10325
10326         * coffcode.h (coff_set_arch_mach_hook): Select the highest known
10327         ARM architecture when an F_ARM_5 flag is detected, since we cannot
10328         be sure exactly which architecture this represents.
10329
10330 2002-02-05  Nick Clifton  <nickc@redhat.com>
10331
10332         * po/tr.po: Updated translation.
10333
10334 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
10335
10336         From Jimi X <jimix@watson.ibm.com>
10337         * archures (bfd_mach_ppc64): Define.
10338         (bfd_powerpc_arch): Rename to bfd_powerpc_archs.
10339         (bfd_powerpc_arch): Define.
10340         * bfd-in2.h: Regenerate.
10341         * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs.
10342         (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs.
10343         (bfd_powerpc_archs): Add default powerpc64 arch.
10344
10345 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
10346
10347         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
10348         against section syms in readonly sections.  Don't do the global
10349         sym check if we find one.
10350         * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
10351         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
10352         * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
10353         * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
10354         (elf_s390_grok_prstatus): Add missing prototype.
10355
10356 2002-02-04  Hans-Peter Nilsson  <hp@bitrange.com>
10357
10358         * elf64-mmix.c (mmix_dump_bpo_gregs): New function.
10359         (mmix_elf_check_common_relocs) <case R_MMIX_BASE_PLUS_OFFSET>:
10360         Call bfd_get_section_by_name only once.  Initialize
10361         bpodata->n_bpo_relocs_this_section.
10362         (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment
10363         referring to DSOs.
10364         (bpo_reloc_request_sort_fn): Don't use difference of values as
10365         return-value.
10366
10367 2002-02-02  David O'Brien  <obrien@FreeBSD>
10368
10369         * configure.in: Tweak the FreeBSD 4.x recognition more.  Only treat
10370         version 4.5 and later the same as 5-CURRENT.
10371         * configure: Re-generate.
10372
10373 2002-02-02  Jason Thorpe  <thorpej@wasabisystems.com>
10374
10375         * config.bfd (hppa*-*-netbsd*): New target.
10376
10377 2002-01-31  Philipp Thomas  <pthomas@suse.de>
10378
10379         * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
10380         to front of message. Unify messages with elf32-arm.h. Use
10381         commas where neccessary.
10382         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
10383         ERROR in messages. Unify messages with coff-arm.c. Correct
10384         VFP/FPA error message.
10385         (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
10386         APCS-32 for translation.
10387
10388 2002-02-01  Hans-Peter Nilsson  <hp@bitrange.com>
10389
10390         Perform on-demand global register allocation from
10391         R_MMIX_BASE_PLUS_OFFSET relocs.
10392         * elf64-mmix.c (struct bpo_reloc_section_info, struct
10393         bpo_reloc_request, struct bpo_greg_section_info): New.
10394         (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook,
10395         bpo_reloc_request_sort_fn, mmix_elf_relax_section,
10396         _bfd_mmix_check_all_relocs,
10397         _bfd_mmix_prepare_linker_allocated_gregs,
10398         _bfd_mmix_finalize_linker_allocated_gregs): New functions.
10399         (elf_mmix_howto_table): Correct src_mask for most relocs.
10400         (mmix_elf_perform_relocation) <case R_MMIX_BASE_PLUS_OFFSET>: New
10401         case.
10402         (mmix_final_link_relocate) <case R_MMIX_BASE_PLUS_OFFSET>: New
10403         case.  Fix typo in comment.  New label do_mmix_reloc.
10404         (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to
10405         store first object file with a base-plus-offset reloc.  Call
10406         mmix_elf_check_common_relocs for the part common with mmo.
10407         (mmix_elf_final_link): Write out linker-allocated register
10408         contents section.
10409         (elf_backend_gc_sweep_hook): Define.
10410         (bfd_elf64_bfd_relax_section): Define.
10411
10412         * mmo.c: Don't include <ctype.h>
10413         (mmo_init): Correct init-once logic.
10414
10415 2002-02-01  Tom Rix  <trix@redhat.com>
10416
10417         * config.bfd: Conditionally support <aiaff> for pre AIX 4.3.
10418
10419 2002-02-01  Alan Modra  <amodra@bigpond.net.au>
10420
10421         * Makefile.am: Run "make dep-am"
10422         * Makefile.in: Regenerate.
10423
10424 2002-01-31  David O'Brien  <obrien@FreeBSD>
10425
10426         * configure.in: Recognize the differences in core files from FreeBSD
10427         4.{0,1} and later versions of 4.x.  This treats 4.2+ the same as
10428         5-CURRENT.
10429         * configure: Regenerate.
10430
10431 2002-01-31  Ivan Guzvinec  <ivang@opencores.org>
10432
10433         * coff-or32.c: New file.
10434         * cpu-or32.c: New file.
10435         * elf32-or32.c: New file.
10436         * archures.c: Add support for or32.
10437         * targets.c: Add support for or32.
10438         * bfd-in2.h: Regenerate.
10439         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
10440         coff_write_object_contents): Add support for or32.
10441         * config.bfd: Add target.
10442         * configure.in: Add support for or32.
10443         * configure: Regenerate.
10444         * Makefile.am: Add support for or32.
10445         * Makefile.in: Regenerate.
10446         * po/SRC-POTFILES.in: Add or32 files.
10447         * po/bfd.pot: Regenerate.
10448
10449 2002-01-31  Nick Clifton  <nickc@cambridge.redhat.com>
10450             Don Lindsay  <lindsayd@cisco.com>
10451
10452         * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return
10453         false' with a return of a bfd_reloc_ error code.
10454
10455 2002-01-31  Hans-Peter Nilsson  <hp@axis.com>
10456
10457         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
10458         unexport unreferenced symbols when --export-dynamic.  Call
10459         _bfd_elf_strtab_delref when unexporting.
10460
10461 2002-01-30  Daniel Jacobowitz  <drow@mvista.com>
10462
10463         * bfd-in.h: Include <stdbool.h> if it is available.
10464         * bfd-in2.h: Regenerated.
10465
10466 2002-01-31  Alan Modra  <amodra@bigpond.net.au>
10467
10468         * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should
10469         not go via the plt.
10470
10471 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
10472
10473         * archures.c: Tidy up formatting of embedded comments.
10474         * bfd.c: Tidy up formatting of embedded comments.
10475         * bfd-in.h: Fix formatting of comments.
10476         * reloc.c: Tidy up formatting of ordinary & embedded comments.
10477         * section.c: Tidy up formatting of embedded comments.
10478         * syms.c: Tidy up formatting of embedded comments.
10479         * targets.c: Tidy up formatting of embedded comments.
10480
10481         * bfd-in2.h: Regenerate.
10482
10483 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
10484
10485         * vms-tir.c (cmd_name): New function.
10486         (tir_cmd_name): New function.
10487         (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name().
10488         (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name().
10489         Fix formatting.
10490
10491         * peXXigen.c (pe_print_idata): Rearrange message to aid in
10492         translation.
10493         (pe_print_pdata): Rearrange message to aid in translation.
10494
10495         * libbfd.c (warn_deprecated): Rearrange error message to aid in
10496         translation.
10497
10498         * ihex.c (ihex_write_object_contents): Fix spelling typo.
10499
10500         * ieee.c (ieee_slurp_external_symbols): Remove spurious space.
10501
10502         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error
10503         message to aid in translation.
10504
10505         * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message
10506         to aid in translation.
10507
10508         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo.
10509
10510 2002-01-30  Philipp Thomas  <pthomas@suse.de>
10511
10512         * coff-arm.c, elf32-elf.h: Unify messages.
10513
10514 2002-01-30  Nick Clifton <nickc@redhat.com>
10515
10516         * po/sv.po: Updated translation.
10517
10518 2002-01-30  Philipp Thomas  <pthomas@suse.de>
10519
10520         * dwarf2.c (read_abbrev): Use full section name in error message.
10521         (decode_line_info): Likewise.
10522
10523         * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging
10524         message.
10525
10526 2002-01-30  Alan Modra  <amodra@bigpond.net.au>
10527
10528         * elf64-ppc.c (func_desc_adjust): Only provide missing function
10529         descriptor symbols for undefined function code syms.  Clear
10530         ELF_LINK_NON_ELF so that they can stay weak.
10531
10532 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
10533             Mitch Lichtenberg  <mpl@broadcom.com>
10534
10535         * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype.
10536         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function
10537         to handle 32-bit ELF embedded reloc (ld --embedded-relocs)
10538         generation.
10539         * bfd-in2.h: Regenerate.
10540
10541 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
10542
10543         * elf32-mips.c: Add additional comments about HI16 relocation
10544         processing.
10545         (_bfd_mips_elf_hi16_reloc): Don't subtract address here for
10546         pc-relative relocations.  (Reverts change made on 2001-10-31.)
10547         (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here
10548         for pc-relative relocations.
10549         (mips_elf_calculate_relocation): Add a comment about a kludge
10550         in the R_MIPS_GNU_REL_HI16 handling.
10551         (_bfd_mips_elf_relocate_section): Implement that kludge;
10552         adjust pc-relative HI16 relocation for difference in HI16 and
10553         LO16 addresses, since it can't easily be done in
10554         mips_elf_calculate_relocation.
10555
10556 2002-01-29  Martin Schwidefsky  <schwidefsky@de.ibm.com>
10557
10558         * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32
10559         relocations with PC32 relocations for undefined or weak symbols.
10560         * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise.
10561         * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise.
10562
10563 2002-01-28  Jason Thorpe  <thorpej@wasabisystems.com>
10564
10565         * elfcore.h (elf_core_file_p): Improve comment for last change.
10566
10567 2002-01-27  Daniel Jacobowitz  <drow@mvista.com>
10568
10569         * configure: Regenerated.
10570
10571 2002-01-27  Jason Thorpe  <thorpej@wasabisystems.com>
10572
10573         * elfcore.h (elf_core_file_p): Set the machine architecture
10574         before processing the program headers.
10575
10576 2002-01-26  Hans-Peter Nilsson  <hp@bitrange.com>
10577
10578         * configure.in <64-bit configuration>: If using gcc, check and
10579         emit error for egcs-1.1.2.
10580         * configure: Regenerate.
10581
10582 2002-01-26  Egor Duda  <deo@logos-m.ru>
10583
10584         * elf.c (elfcore_grok_win32pstatus): Copy only as much information
10585         as possible to avoid stack corruption.
10586
10587 2002-01-26  Richard Henderson  <rth@redhat.com>
10588
10589         * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext
10590         for non-allocated sections.
10591
10592 2002-01-25  Mark Kettenis  <kettenis@gnu.org>
10593
10594         * elf.c (elfcore_write_prstatus): Make sure we pass the address of
10595         prstat.pr_reg even if it is a struct.
10596
10597 2002-01-25  Steve Ellcey <sje@cup.hp.com>
10598
10599         * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX.
10600
10601 2002-01-25  Philipp Thomas  <pthomas@suse.de>
10602
10603         * coffgen.c (coff_print_symbol): Don't mark info message
10604         for translation.
10605
10606 2002-01-25  Nick Clifton <nickc@redhat.com>
10607
10608         * po/fr.po: Updated translation.
10609         * po/es.po: Updated translation.
10610
10611 2002-01-25  Philipp Thomas  <pthomas@suse.de>
10612
10613         * coff-alpha.c (alpha_relocate_section): Unify warning message
10614         for GP relative relocations without GP defined.
10615         * coff-mips.c (mips_relocate_section): Likewise.
10616
10617 2002-01-25  Alan Modra  <amodra@bigpond.net.au>
10618
10619         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid
10620         unsigned overflow when new_offset < old_offset.
10621
10622 2002-01-24  Philipp Thomas  <pthomas@suse.de>
10623
10624         * bfd.c (_bfd_abort): Fix typo.
10625
10626 2002-01-23  Richard Henderson  <rth@redhat.com>
10627
10628         * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress
10629         plt entries for undefweak symbols.
10630
10631 2002-01-23  Steve Ellcey <sje@cup.hp.com>
10632
10633         * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR.
10634         (bfd_elf64_ia64_hpux_big_vec): Ditto.
10635         (bfd_elf32_h8300_vec): Ditto.
10636
10637 2002-01-23  Alan Modra  <amodra@bigpond.net.au>
10638
10639         * elf64-ppc.c: Remove stale part of ABI comment.
10640         (NO_OPD_RELOCS): Define.
10641         (ppc64_elf_check_relocs): Use it.
10642         (ppc64_elf_relocate_section): Here too.
10643         (build_one_stub): Don't point function syms at the stub.  Instead,
10644         hijack plt.offset.
10645         (ppc64_elf_relocate_section): Check whether REL24 relocs should
10646         really go to the stub.  Make all dynamic relocs in opd against
10647         locals.
10648         (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of
10649         plt.offset.
10650
10651 2002-01-22  Richard Henderson  <rth@redhat.com>
10652
10653         * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp.
10654
10655 2002-01-22  Alan Modra  <amodra@bigpond.net.au>
10656
10657         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of
10658         TOC_BASE_OFF adjustment.
10659
10660         * Makefile.am: Run "make dep-am".
10661         * Makefile.in: Regenerate.
10662         * po/SRC-POTFILES.in: Regenerate.
10663
10664 2002-01-22  John David Anglin  <dave@hiauly1.hia.nrc.ca>
10665
10666         * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new
10667         host defines.
10668
10669 2002-01-21  Hans-Peter Nilsson  <hp@axis.com>
10670
10671         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
10672         Check for and emit error if sgot is NULL at this point.
10673
10674 2002-01-21  Jason Thorpe  <thorpej@wasabisystems.com>
10675
10676         * config.bfd (ia64*-*-netbsd*): New target.
10677
10678 2002-01-21  Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
10679
10680         * som.c (som_write_space_strings): Comment typo fix.
10681
10682 2002-01-21  Alan Modra  <amodra@bigpond.net.au>
10683
10684         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and
10685         is_func_descriptor fields.
10686         (link_hash_newfunc): Init them.
10687         (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a
10688         dot are candidates for plt entries.  When processing .opd relocs,
10689         set function descriptor strings to point inside function code
10690         string, and set new ppc_link_hash_entry fields.
10691         (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs.
10692         (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with
10693         function descriptors.  It's now done in..
10694         (func_desc_adjust): New.
10695         (ppc64_elf_func_desc_adjust): New.
10696         (define elf_backend_always_size_sections): Define.
10697         (ppc64_elf_hide_symbol): New.
10698         (define elf_backend_hide_symbol): Define.
10699         (allocate_dynrelocs): Remove code looking up function descriptors
10700         as that has been done earlier.
10701         (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash
10702         table.
10703         (ppc64_elf_finish_dynamic_symbol): Likewise.  Remove code looking
10704         up function descriptor.
10705         (build_one_stub): Look up the function code sym.  Check for
10706         invalid plt offsets.
10707         (ppc64_elf_relocate_section): Tweak calls to undefined weak syms.
10708         Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs.
10709
10710         * elf-bfd.h (elf_backend_data <elf_backend_hide_symbol>): Add
10711         boolean param.
10712         (_bfd_elf_link_hash_hide_symbol): Likewise.
10713         * elflink.h (elf_link_add_object_symbols): Adjust call to
10714         elf_backend_hide_symbol.
10715         (elf_fix_symbol_flags): Likewise.
10716         (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather
10717         than bfd_alloc.
10718         * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param.
10719         Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref.
10720         * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
10721         (clobber_millicode_symbols): Adjust to suit new hide_symbol.
10722         * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param
10723         and adjust to suit.
10724         * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call
10725         _bfd_elf_link_hash_hide_symbol rather than duplicating code.
10726         * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
10727
10728 2002-01-18  Alan Modra  <amodra@bigpond.net.au>
10729
10730         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a
10731         dynamic function descriptor symbol, not the associated function
10732         symbol.
10733
10734 2002-01-17  Eric Christopher  <echristo@redhat.com>
10735
10736         * elf32-mips.c (mips_elf_calculate_relocation): Fix typo.
10737
10738 2002-01-17  Nick Clifton  <nickc@cambridge.redhat.com>
10739
10740         * po/bfd.pot: Regenerate.
10741         * po/fr.po: Regenerate.
10742
10743 2002-01-17  Alan Modra  <amodra@bigpond.net.au>
10744
10745         * elf-bfd.h (elf_backend_data <elf_backend_section_from_bfd_section>):
10746         Remove "Elf_Internal_Shdr *" param.
10747         (_bfd_mips_elf_section_from_bfd_section): Ditto.
10748         * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto.
10749         * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto.
10750         * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto.
10751         * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto.
10752         * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto.
10753         * elf.c (_bfd_elf_section_from_bfd_section): Allow backend
10754         function to override special sections.  Remove hdr arg from
10755         backend call, and don't loop.
10756
10757 2002-01-16  Eric Christopher  <echristo@redhat.com>
10758
10759         * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp
10760         on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of
10761         relocations requiring gp0 and gp.
10762
10763 2002-01-16  Richard Earnshaw  <rearnsha@arm.com>
10764
10765         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle
10766         EF_ARM_VFP_FLOAT.
10767         (elf32_arm_print_private_bfd_data): Likewise.
10768
10769 2002-01-16  Nick Clifton  <nickc@cambridge.redhat.com>
10770
10771         * po/tr.po: Import new version.
10772
10773 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10774
10775         * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs.
10776         (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc.
10777         (ORI_R0_R0_0): Correct.
10778
10779 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10780
10781         * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE
10782         when plt_not_loaded.
10783         * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to
10784         clear .plt SEC_CODE here.  Create .stub and correct .glink flags.
10785         (PLT_INITIAL_ENTRY_SIZE): Set to 24.
10786         (ppc64_elf_glink_code): Delete.
10787         (PPC64_ELF_GLINK_SIZE): Delete.
10788         (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11,
10789         BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0,
10790         ORI_R0_R0_0): Define.
10791         (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define.
10792         (struct ppc_link_hash_table): Add sstub and plt_overflow.
10793         (ppc64_elf_link_hash_table_create): Init them.
10794         (ppc64_elf_check_relocs <R_PPC64_REL24>): Refcount .plt entry.
10795         Don't copy to shared lib.
10796         (ppc64_elf_check_relocs): Call bfd_set_error on errors.
10797         (ppc64_elf_gc_sweep_hook <R_PPC64_REL24>): Sweep plt refcount.
10798         (allocate_dynrelocs <plt>): Don't change function sym here.  Make
10799         room for .stub and .glink code.
10800         (ppc64_elf_size_dynamic_sections): Handle .stub.  Make entry for
10801         DT_PPC64_GLINK.
10802         (ppc64_elf_final_link): Rename to ppc64_elf_set_toc.  Don't call
10803         bfd_elf64_bfd_final_link.
10804         (bfd_elf64_bfd_final_link): Don't define.
10805         (ppc64_elf_size_stubs): New.
10806         (build_plt_stub): New.
10807         (build_one_stub): New.
10808         (ppc64_elf_build_stubs): New.
10809         (ppc64_elf_relocate_section <toc relocs>): Remove assert.
10810         (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs.
10811         (ppc64_elf_finish_dynamic_symbol): Don't build stubs here.  Set
10812         DT_PPC64_GLINK entry.  Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in
10813         case output sections not separate.  Adjust DT_RELASZ to not
10814         include plt relocs.  Set reserved got entry.  Set got and plt
10815         entry size.
10816         (elf_backend_got_header_size): Set to 8.
10817         * elf64-ppc.h: New file.
10818
10819 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10820
10821         * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
10822         sections, use bfd_section_list_remove.
10823         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
10824         * elflink.h (elf_link_add_object_symbols): When removing all
10825         sections, use bfd_section_list_clear.
10826
10827 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
10828
10829         * po/sv.po: New file: Swedish translation.
10830         * configure.in (ALL_LINGUAS): Add sv.
10831         * configure: Regenerate.
10832
10833 2002-01-15  Jakub Jelinek  <jakub@redhat.com>
10834
10835         * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change.
10836         * elf.c (merge_sections_remove_hook): New function.
10837         (_bfd_elf_merge_sections): Pass it as 3rd argument to
10838         _bfd_merge_sections.
10839         * libbfd-in.h (_bfd_merge_sections): Add 3rd argument.
10840         * libbfd.h: Rebuilt.
10841         * merge.c (_bfd_merge_sections): Add remove_hook argument.
10842         Call remove_hook if a SEC_EXCLUDE section is encountered.
10843
10844 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
10845
10846         * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'.
10847         (xstormy16_reloc_map): Initialise new field with correct howto
10848         table.
10849         (xstormy16_reloc_type_lookup): Use 'table' field to locate correct
10850         howto entry.
10851
10852 2002-01-10  Michael Snyder  <msnyder@redhat.com>
10853
10854         * elf.c (elfcore_write_prstatus): Use long instead of pid_t;
10855         (elfcore_write_pstatus): Use long instead of pid_t;
10856         * elf-bfd.h: Change prototypes to use long instead of pid_t;
10857
10858 2002-01-09  Jason Thorpe  <thorpej@wasabisystems.com>
10859
10860         * elf.c: Update copyright years.
10861         (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO
10862         and NT_NETBSDCORE_FIRSTMACH.  Improve a comment.
10863
10864 2002-01-08  Michael Snyder  <msnyder@redhat.com>
10865
10866         Add capability to write corefile note sections, for gdb.
10867         * elf.c (elfcore_write_note): New function.
10868         (elfcore_write_prpsinfo): New function.
10869         (elfcore_write_prstatus): New function.
10870         (elfcore_write_pstatus): New function.
10871         (elfcore_write_prfpreg): New function.
10872         (elfcore_write_prxfpreg): New function.
10873         * elf-bfd.h: Add prototypes for above functions.
10874
10875 2002-01-08  Alexandre Oliva  <aoliva@redhat.com>
10876
10877         * elf.c (elf_fake_sections): Propagate errors from
10878         elf_backend_fake_section.
10879
10880 2002-01-07  Jason Thorpe  <thorpej@wasabisystems.com>
10881
10882         * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo.
10883         (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c.
10884         (elf32-sh-nbsd.lo): New rule.
10885         * Makefile.in: Regenerate.
10886         * config.bfd (sh*le-*-netbsdelf*): New target.
10887         (sh*-*-netbsdelf*): New target.
10888         * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*.
10889         (bfd_elf32_shnbsd_vec): New vector.
10890         (bfd_elf32_shlnbsd_vec): New vector.
10891         * configure: Regenerate.
10892         * elf32-sh-nbsd.c: New file.
10893         * targets.c: Update copyright years.
10894         (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and
10895         bfd_elf32_shnbsd_vec.
10896
10897 2002-01-07  Aldy Hernandez  <aldyh@redhat.com>
10898
10899         * coff-rs6000.c (READ20): Use bfd_scan_vma.
10900
10901 2002-01-07  Geoffrey Keating  <geoffk@redhat.com>
10902
10903         * elflink.h (elf_link_input_bfd): Don't ask for the merged offset
10904         of a symbol in a section that will be deleted.
10905
10906 2002-01-07  Nick Clifton  <nickc@cambridge.redhat.com>
10907
10908         * po/es.po: New file: Spanish translation.
10909         * configure.in (ALL_LINGUAS): Add es.
10910         * configure: Regenerate.
10911
10912 2002-01-06  Steve Ellcey  <sje@cup.hp.com>
10913
10914         * elfxx-ia64.c (is_unwind_section_name): Add target vector as
10915         argument so we can handle HP-UX specially.
10916         (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name.
10917         (elfNN_hpux_backend_section_from_bfd_section): New for support
10918         of SHN_IA_64_ANSI_COMMON.
10919         (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON.
10920         (is_unwind_section_name): Add special HP-UX support.
10921         (elfNN_ia64_section_from_shdr): Add support for more sections.
10922         (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and
10923         add support for more sections.
10924         (elfNN_ia64_additional_program_headers): Modify
10925         is_unwind_section_name call.
10926         (elfNN_ia64_modify_segment_map): Remove assumption that there is
10927         only one unwind section in segment.
10928
10929 2002-01-06  Alan Modra  <amodra@bigpond.net.au>
10930
10931         * syms.c (_bfd_generic_make_empty_symbol): New function.
10932         * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
10933         _bfd_generic_make_empty_symbol.
10934         * libbfd.h: Regenerate.
10935         * bfd-in2.h: Regenerate.
10936         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
10937         (hppabsd_core_get_symtab_upper_bound): Don't define.
10938         (hppabsd_core_get_symtab): Likewise.
10939         (hppabsd_core_print_symbol): Likewise.
10940         (hppabsd_core_get_symbol_info): Likewise.
10941         (hppabsd_core_bfd_is_local_label_name): Likewise.
10942         (hppabsd_core_get_lineno): Likewise.
10943         (hppabsd_core_find_nearest_line): Likewise.
10944         (hppabsd_core_bfd_make_debug_symbol): Likewise.
10945         (hppabsd_core_read_minisymbols): Likewise.
10946         (hppabsd_core_minisymbol_to_symbol): Likewise.
10947         (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
10948         Formatting fixes.
10949         * hpux-core.c: Similarly.
10950         * irix-core.c: Similarly.
10951         * osf-core.c: Similarly.
10952         * sco5-core.c: Similarly.
10953         * binary.c (binary_make_empty_symbol): Remove function, define as
10954         _bfd_generic_make_empty_symbol.
10955         * ihex.c (ihex_make_empty_symbol): Likewise.
10956         * mmo.c (mmo_make_empty_symbol): Likewise.
10957         * ppcboot.c (ppcboot_make_empty_symbol): Likewise.
10958         * srec.c (srec_make_empty_symbol): Likewise.
10959         * versados.c (versados_make_empty_symbol): Likewise.
10960         * vms.c (_bfd_vms_make_empty_symbol): Remove.
10961         (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
10962         * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
10963         rather than _bfd_vms_make_empty_symbol.
10964         * vms-misc.c (new_symbol): Likewise.
10965
10966 2002-01-05  Alan Modra  <amodra@bigpond.net.au>
10967
10968         * section.c (bfd_section_init): Remove unnecessary initialisations.
10969         (bfd_section_list_clear): New function.
10970         (bfd_section_list_remove, bfd_section_list_insert): New macros.
10971         (_bfd_strip_section_from_output): Use them.
10972         * coffcode.h (coff_set_alignment_hook): Likewise.
10973         * elf32-mips.c (_bfd_mips_elf_final_link): Likewise.
10974         * elf64-mips.c (mips_elf64_final_link): Likewise.
10975         * elf64-mmix.c (mmix_elf_final_link): Likewise.
10976         * sunos.c (sunos_add_dynamic_symbols): Likewise.
10977         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
10978         * bfd-in2.h: Regenerate.
10979
10980         * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway
10981         rather than doing our own section handling.  Clean up after errors
10982         with bfd_release and bfd_section_list_clear.  Handle unexpected
10983         flags.
10984         * aoutf1.h (sunos4_core_file_p): Likewise.
10985         * aix386-core.c (aix386_core_file_p): Likewise.
10986         * cisco-core.c (cisco_core_file_validate): Likewise.
10987         * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
10988         * trad-core.c (trad_unix_core_file_p): Likewise.
10989
10990         * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors
10991         with bfd_release and bfd_section_list_clear.
10992         * hpux-core.c (hpux_core_core_file_p): Likewise.
10993         * irix-core.c (irix_core_core_file_p): Likewise.
10994         * lynx-core.c (lynx_core_file_p): Likewise.
10995         * osf-core.c (osf_core_core_file_p): Likewise.
10996         * rs6000-core.c (rs6000coff_core_p): Likewise.
10997         * sco5-core.c (sco5_core_file_p): Likewise.
10998
10999         * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform
11000         sign extension adjustments without conditionals.
11001
11002 2002-01-04  Jakub Jelinek  <jakub@redhat.com>
11003
11004         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if
11005         CIE at .eh_frame start is removed due to no FDEs referencing it.
11006
11007 2002-01-04  Jason Thorpe  <thorpej@wasabisystems.com>
11008
11009         * config.bfd (x86_64-*-netbsd*): New target.
11010         * configure.in (x86_64-*-netbsd*): Set COREFILE
11011         to netbsd-core.lo.
11012         * configure: Regenerated.
11013
11014 2002-01-03  Tom Rix  <trix@redhat.com>
11015
11016         * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering
11017         for recent bfd_make_section_anyway change.
11018
11019 2002-01-03  Nick Clifton  <nickc@cambridge.redhat.com>
11020
11021         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
11022         R_ARM_THM_PC11 reloc.
11023
11024 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
11025
11026         * configure.in (LINGUAS): Add ja.
11027         * configure: Regenerate.
11028         * po/ja.po: Import from translation project's web site.
11029
11030 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
11031
11032         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error
11033         messages to ease translation into other languages.
11034
11035 For older changes see ChangeLog-0001
11036 \f
11037 Local Variables:
11038 mode: change-log
11039 left-margin: 8
11040 fill-column: 74
11041 version-control: never
11042 End: