Fix typo in ChangeLog entry: s/R_390_RELAVITE/R_390_RELATIVE/.
[external/binutils.git] / bfd / ChangeLog
1 2003-11-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2
3         * elf32-s390.c (elf_s390_relocate_section): Only convert R_390_32
4         to R_390_RELATIVE. Convert the other relocations against local
5         symbols to relocations against the start of the section.
6         * elf64-s390.c (elf_s390_relocate_section): Only convert R_390_64
7         to R_390_RELATIVE. Convert the other relocations against local
8         symbols to relocations against the start of the section.
9
10 2003-11-11  Nick Clifton  <nickc@redhat.com>
11
12         * elf-m10300.c (bfd_mn10300_elf_size_dynamic_sections): Use
13         info->executable not info->shared to decide if a .interp section
14         should be present.
15         * elf32-arm.h (elf32_arm_size_dynamic_sections): Likewise.
16         * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise.
17         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
18         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
19         * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
20         * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
21         * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise.
22         * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
23         * elfxx-mips.c (_bfd_mips_size_dynamic_sections): Likewise.
24         * elflink.h (size_dynamic_sections): Likewise.
25
26 2003-11-10  Jonathan Wilson <jonwil@tpgi.com.au>
27
28         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Swap out tls pointer.
29         (_bfd_XXi_final_link_postscript): Look for __tks_used symbol.  If
30         found initialise the tls data directory entry.
31
32 2003-11-07  Alan Modra  <amodra@bigpond.net.au>
33
34         * elf32-ppc.c (ppc_elf_install_value): Delete.
35         (shared_stub_entry, stub_entry): Make them arrays of ints.
36         Remove initial branch.
37         (ppc_elf_relax_section): Write one branch around all trampolines
38         instead.  Correct bogus R_PPC_PLTREL24 handling.  Correct
39         branch range check.  Only use shared_stub_entry when shared.
40         Test that branches can reach stubs.  Write trampolines out at
41         end so that just one realloc is used.  Handle little-endian
42         mode.  Move relevant code from ppc_elf_install_value to here.
43         (ppc_elf_relocate_section): Move code handling RELAX32 from
44         ppc_elf_install_value to here.
45
46 2003-11-06  Alan Modra  <amodra@bigpond.net.au>
47
48         * elf32-ppc.c (ppc_elf_howto_raw); Add entry for R_PPC_RELAX32PC.
49         (ppc_elf_install_value): Handle R_PPC_RELAX32PC.  Merge duplicate
50         cases.
51         (shared_stub_entry): Correct opcode.
52         (ppc_elf_relax_section): Generate R_PPC_RELAX32PC relocs.
53         (ppc_elf_relocate_section): Handle them.
54
55 2003-11-05  Alan Modra  <amodra@bigpond.net.au>
56
57         * elf.c (_bfd_elf_rela_local_sym): Accept asection **, and return
58         updated section in case of merged section.
59         * elf-bfd.h (_bfd_elf_rela_local_sym): Update declaration.
60         * elf-hppa.h (elf_hppa_relocate_section): Adjust call.
61         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
62         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
63         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
64         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
65         * elf32-cris.c (cris_elf_relocate_section): Likewise.
66         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
67         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
68         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
69         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
70         * elf32-i370.c (i370_elf_relocate_section): Likewise.
71         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
72         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
73         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
74         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
75         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
76         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
77         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
78         * elf32-s390.c (elf_s390_relocate_section): Likewise.
79         * elf32-sh.c (sh_elf_relocate_section): Likewise.
80         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
81         * elf32-v850.c (v850_elf_relocate_section) Likewise.
82         * elf32-vax.c (elf_vax_relocate_section): Likewise.
83         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
84         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
85         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
86         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
87         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
88         * elf64-s390.c (elf_s390_relocate_section): Likewise.
89         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
90         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
91         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
92         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
93
94         * elf32-cris.c (cris_elf_relocate_section): Don't recalculate symbol
95         section for reloc output.
96         * elf32-i370.c (i370_elf_relocate_section): Likewise.
97         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
98         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
99         * elf32-vax.c (elf_vax_relocate_section): Likewise.
100         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
101         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
102
103         * elf32-ppc.c (ppc_elf_relocate_section): Don't recalculate everything
104         for R_PPC_RELAX32 reloc.  Don't bother checking ppc_elf_install_value
105         return value.
106         * elf64-ppc.c (ppc64_elf_relocate_section <R_PPC64_TOC>): Sanity check
107         sec->id.
108
109 2003-11-05  Alan Modra  <amodra@bigpond.net.au>
110
111         * elf32-d10v.c (extract_rel_addend, insert_rel_addend): New functions.
112         (elf32_d10v_relocate_section): Use them to handle -r reloc
113         adjustments, and in place of _bfd_elf_rela_local_sym.
114
115         * cpu-iq2000.c (arch_info_struct): Warning fix.
116
117 2003-11-05  Alan Modra  <amodra@bigpond.net.au>
118
119         * elf32-hppa.c (ELIMINATE_COPY_RELOCS): Define.
120         (elf32_hppa_copy_indirect_symbol): Don't copy NON_GOT_REF on
121         weakdefs.
122         (elf32_hppa_check_relocs): Use ELIMINATE_COPY_RELOCS.
123         (elf32_hppa_adjust_dynamic_symbol): Likewise.  Copy weakdef
124         NON_GOT_REF.
125         (allocate_dynrelocs): Use ELIMINATE_COPY_RELOCS and
126         SYMBOL_CALLS_LOCAL.  Discard relocs for undef weak syms with
127         non-default visibility.
128         (elf32_hppa_relocate_section): Use ELIMINATE_COPY_RELOCS and
129         SYMBOL_CALLS_LOCAL.
130
131 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
132
133         * aout-target.h, aoutf1.h, bfdio.c, bfdwin.c: Update copyright date.
134         * coff-apollo.c, coff-sparc.c, coff-w65.c, coff-we32k.c: Ditto.
135         * coff-z8k.c, coffgen.c, cpu-frv.c, cpu-h8500.c, cpu-hppa.c: Ditto.
136         * cpu-ia64-opc.c, cpu-m10300.c, cpu-mips.c, cpu-msp430.c: Ditto.
137         * cpu-rs6000.c, cpu-z8k.c, efi-app-ia32.c, elf32-am33lin.c: Ditto.
138         * gen-aout.c, hash.c, hp300hpux.c, init.c, mach-o.c: Ditto.
139         * nlm-target.h, nlm.c, som.h, stabs.c, sysdep.h, xsym.h: Ditto.
140
141         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix
142         "dereferencing type-punned pointer" warnings.
143
144         * aout-adobe.c (aout_adobe_set_section_contents): Constify location.
145         * aoutx.h (NAME(aout,set_section_contents)): Ditto.
146         * bfd-in2.h: Regenerate.
147         * binary.c (binary_set_section_contents): Ditto.
148         * bout.c (b_out_set_section_contents): Ditto.
149         * coff-tic54x.c (tic54x_set_section_contents): Ditto.
150         * coffcode.h (coff_set_section_contents): Ditto.
151         * ecoff.c (_bfd_ecoff_set_section_contents): Ditto.
152         * elf-bfd.h (_bfd_elf_set_section_contents): Ditto.
153         * elf.c (_bfd_elf_set_section_contents): Ditto.
154         * elfxx-mips.c (_bfd_mips_elf_set_section_contents): Ditto.
155         * elfxx-mips.h (_bfd_mips_elf_set_section_contents): Ditto.
156         * i386msdos.c (msdos_set_section_contents): Ditto.
157         * ieee.c (ieee_set_section_contents): Ditto.
158         * ihex.c (ihex_set_section_contents): Ditto.
159         * libaout.h (NAME(aout,set_section_contents)): Ditto.
160         * libbfd-in.h (_bfd_nowrite_set_section_contents): Ditto.
161         (_bfd_generic_set_section_contents): Ditto.
162         * libbfd.h: Regenerate.
163         * libbfd.c (_bfd_generic_set_section_contents): Ditto.
164         * libecoff.h (_bfd_ecoff_set_section_contents): Ditto.
165         * libnlm.h (nlmNAME(set_section_contents)): Ditto.
166         (struct nlm_backend_data <nlm_mangle_relocs>): Ditto.
167         * mmo.c (mmo_set_section_contents): Ditto.
168         * nlm32-alpha.c (nlm_alpha_mangle_relocs): Ditto.
169         * nlm32-i386.c (nlm_i386_mangle_relocs): Ditto.
170         * nlm32-ppc.c (nlm_powerpc_mangle_relocs): Ditto.
171         * nlm32-sparc.c (nlm_sparc_mangle_relocs): Ditto.
172         * nlmcode.h (nlm_set_section_contents): Ditto.
173         * oasys.c (oasys_set_section_contents): Ditto.
174         * pdp11.c (NAME(aout,set_section_contents)): Ditto.
175         * ppcboot.c (ppcboot_set_section_contents): Ditto.
176         * srec.c (srec_set_section_contents): Ditto.
177         * targets.c (BFD_JUMP_TABLE_WRITE <_bfd_set_section_contents>): Ditto.
178         * tekhex.c (tekhex_set_section_contents): Ditto.
179         (move_section_contents): Ditto.
180         * versados.c (versados_set_section_contents): Ditto.
181         * vms-misc.c (_bfd_save_vms_section): Ditto.
182         * vms.c (vms_set_section_contents): Ditto.
183         * vms.h (_bfd_save_vms_section): Ditto.
184
185 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
186
187         * elf64-ppc.c (ppc_size_one_stub): Size relbrlt.  Accept info arg
188         rather than htab.
189         (ppc64_elf_size_stubs): Adjust ppc_size_one_stub traversal.  Zero
190         relbrlt size.
191         (ppc64_elf_build_stubs): Allocate space for relbrlt.
192
193 2003-11-04  Alan Modra  <amodra@bigpond.net.au>
194
195         * bfd-in.h (_bfd_elf_tls_setup): Declare.
196         * bfd-in2.h: Regenerate.
197         * elf-bfd.h (struct elf_link_tls_segment): Delete.
198         (struct elf_link_hash_table): Add tls_sec and tls_size.
199         * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size.
200         * elflink.c (_bfd_elf_tls_setup): New function.
201         * elflink.h (struct elf_final_link_info): Remove first_tls_sec.
202         (elf_bfd_final_link): Don't set first_tls_sec here.  Update code
203         saving tls segment info, round segment size up.
204         (elf_link_output_extsym): Adjust code using tls segment info.
205         (elf_link_input_bfd): Likewise.
206         * elf32-i386.c (dtpoff_base, tpoff): Likewise.
207         * elf32-s390.c (dtpoff_base, tpoff): Likewise.
208         * elf32-sh.c (dtpoff_base, tpoff): Likewise.
209         * elf32-sparc.c (dtpoff_base, tpoff): Likewise.
210         * elf64-s390.c (dtpoff_base, tpoff): Likewise.
211         * elf64-x86-64.c (dtpoff_base, tpoff): Likewise.
212         * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise.
213         (elfNN_ia64_dtprel_base): Likewise.
214         * elf64-alpha.c (alpha_get_dtprel_base): Likewise.
215         (alpha_get_tprel_base): Likewise.
216         (struct alpha_relax_info): Remove tls_segment.
217         (elf64_alpha_relax_got_load): Adjust invocation of
218         alpha_get_dtprel_base and alpha_get_tprel_base.
219         (elf64_alpha_relax_tls_get_addr): Likewise.
220         (elf64_alpha_relax_section): Likewise.
221         (elf64_alpha_relocate_section): Likewise.
222         (elf64_alpha_relax_find_tls_segment): Delete.
223         * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec.
224         (ppc_elf_tls_setup): Call _bfd_elf_tls_setup.  Return section.
225         (ppc_elf_relocate_section): Adjust to use elf.tls_sec.
226         * elf32-ppc.h (ppc_elf_tls_setup): Update.
227         * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec.
228         (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup.  Return section.
229         (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec.
230         (ppc64_elf_relocate_section): Likewise.
231         * elf64-ppc.h (ppc64_elf_tls_setup): Update.
232
233 2003-11-03  Daniel Jacobowitz  <drow@mvista.com>
234
235         * elf-bfd.h (struct elf_backend_data): Remove plt_header_size.
236         * elf-m10300.c (elf_backend_plt_header_size): Don't define.
237         * elf32-arm.h (elf_backend_plt_header_size): Don't define.
238         * elf32-cris.c (elf_backend_plt_header_size): Don't define.
239         * elf32-i386.c (elf_backend_plt_header_size): Don't define.
240         * elf32-mips.c (elf_backend_plt_header_size): Don't define.
241         * elf32-ppc.c (elf_backend_plt_header_size): Don't define.
242         * elf32-s390.c (elf_backend_plt_header_size): Don't define.
243         * elf32-sh.c (elf_backend_plt_header_size): Don't define.
244         * elf32-sparc.c (elf_backend_plt_header_size): Don't define.
245         * elf64-alpha.c (elf_backend_plt_header_size): Don't define.
246         * elf64-hppa.c (elf_backend_plt_header_size): Don't define.
247         * elf64-mips.c (elf_backend_plt_header_size): Don't define.
248         * elf64-ppc.c (elf_backend_plt_header_size): Don't define.
249         * elf64-s390.c (elf_backend_plt_header_size): Don't define.
250         * elf64-sh64.c (elf_backend_plt_header_size): Don't define.
251         * elf64-sparc.c (elf_backend_plt_header_size): Don't define.
252         * elf64-x86-64.c (elf_backend_plt_header_size): Don't define.
253         * elfn32-mips.c (elf_backend_plt_header_size): Don't define.
254         * elfxx-ia64.c (elf_backend_plt_header_size): Don't define.
255         * elfxx-target.h (elf_backend_plt_header_size): Don't define
256         or include in target initializer.
257
258 2003-11-03  Andrew Cagney  <cagney@redhat.com>
259
260         * section.c (bfd_set_section_contents): Make the "location" buffer
261         constant.
262         * bfd-in2.h: Re-generate.
263
264 2003-10-30  Andrew Cagney  <cagney@redhat.com>
265
266         * syms.c: Replace "struct symbol_cache_entry" with "struct
267         bfd_symbol".
268         * vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
269         * mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
270         * cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
271         * bfd-in2.h: Re-generate.
272
273 2003-10-30  Jakub Jelinek  <jakub@redhat.com>
274
275         * elfxx-ia64.c: Include objalloc.h, hashtab.h.
276         (struct elfNN_ia64_local_hash_entry): Remove root. Add id and r_sym
277         fields.
278         (struct elfNN_ia64_local_hash_table): Remove.
279         (struct elfNN_ia64_link_hash_table): Change loc_hash_table's type
280         to htab_t.  Add loc_hash_memory field.
281         (elfNN_ia64_local_hash_table_init, elfNN_ia64_new_loc_hash_entry):
282         Removed.
283         (elfNN_ia64_local_htab_hash, elfNN_ia64_local_htab_eq): New
284         functions.
285         (elfNN_ia64_hash_table_create): Use hashtab.h hashtable for
286         loc_hash_table.  Initialize loc_hash_memory.
287         (elfNN_ia64_hash_table_free): New function.
288         (elfNN_ia64_local_hash_lookup): Remove.
289         (elfNN_ia64_local_dyn_sym_thunk): Change into htab_traverse
290         callback.
291         (elfNN_ia64_dyn_sym_traverse): Use htab_traverse.
292         (get_local_sym_hash): Use hashtab.h hashtable for loc_hash_table.
293         (bfd_elfNN_bfd_link_hash_table_free): Define.
294
295 2003-10-30  Alan Modra  <amodra@bigpond.net.au>
296
297         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Modify versioned
298         symbol string in place.
299
300 2003-10-30  Jim Blandy  <jimb@redhat.com>
301
302         * cpu-rs6000.c (rs6000_compatible): Check the correct arch_info
303         object's mach field: all PowerPC machines are supersets of the
304         original rs6000, but not later rs6000 machines.
305
306 2003-10-30  Alan Modra  <amodra@bigpond.net.au>
307
308         * dwarf2.c (struct attribute): Delete "unsnd", "snd" and "addr".
309         Add "val" and "sval" fields.
310         (DW_STRING, DW_UNSND, DW_BLOCK, DW_SND, DW_ADDR): Delete.
311         (read_attribute_value): Expand and adjust DW_* occurrences.
312         (scan_unit_for_functions, parse_comp_unit): Likewise.
313
314 2003-10-30  Phil Edwards  <phil@codesourcery.com>
315
316         * config.bfd (arm-*-vxworks):  Remove separate stanza; merge with
317         other common ELF triples.
318         (i[3-7]86-*-vxworks):  Change to ELF format.
319         (mips*-*-windiss):  New triple, add to common MIPS/ELF stanza.
320         (sh-*-vxworks):  New stanza.
321
322 2003-10-30  Lars Knoll  <lars@trolltech.com>
323             Michael Matz  <matz@suse.de>
324             Jakub Jelinek  <jakub@redhat.com>
325             Alan Modra  <amodra@bigpond.net.au>
326
327         * merge.c (struct sec_merge_sec_info): Update comment.
328         (struct sec_merge_hash_entry): Remove entsize.
329         (sec_merge_hash_lookup): Only adjust alignment when creating.
330         (sec_merge_emit): Remove register keyword.
331         (cmplengthentry, last4_eq, last_eq): Delete.
332         (strrevcmp, strrevcmp_align, is_suffix): New.
333         (merge_strings): Use them to implement fast suffix merging.
334         * elf-strtab.c (struct elf_strtab_hash_entry): Update comments.
335         Make "len" signed.
336         (_bfd_elf_strtab_add): Lose on >2G strings.
337         (_bfd_elf_strtab_emit): Don't emit strings with len < 0.
338         (cmplengthentry, last4_eq): Delete.
339         (strrevcmp, is_suffix): New.
340         (_bfd_elf_strtab_finalize): Rework to implement fast suffix merging.
341
342 2003-10-29  Daniel Jacobowitz  <drow@mvista.com>
343
344         * elf32-arm.h (elf32_arm_final_link_relocate): Move check for
345         SEC_ALLOC.
346
347 2003-10-29  Philip Blundell  <philb@gnu.org>
348
349         * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New
350         code sequence.
351         (PLT_HEADER_SIZE): New.
352         (struct elf32_arm_pcrel_relocs_copied): Rename to ...
353         (struct elf32_arm_relocs_copied): ... this.  Count both
354         pcrel and non-pcrel relocs.  All uses updated.
355         (struct elf32_arm_link_hash_table): Add pointers to dynamic linker
356         sections and symbol/section mapping cache.
357         (create_got_section): New.
358         (elf32_arm_create_dynamic_sections): New.
359         (elf_backend_create_dynamic_sections): Use it.
360         (elf32_arm_final_link_relocate): Support garbage collection of relocs.
361         (elf32_arm_check_relocs): Likewise.
362         (elf32_arm_adjust_dynamic_symbol): Likewise.
363         (elf32_arm_copy_indirect_symbol): New.
364         (elf32_arm_link_hash_table_create): Initialise new fields.
365         (elf32_arm_gc_sweep_hook): Implement.
366         (elf32_arm_discard_copies): Delete.
367         (elf32_arm_finish_dynamic_symbol): Use new PLT code.
368         (elf32_arm_finish_dynamic_sections): Likewise.
369         (elf_backend_can_refcount): Define.
370         (elf_backend_copy_indirect_symbol): Likewise.
371         (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE.
372
373 2003-10-29  Alan Modra  <amodra@bigpond.net.au>
374
375         * elf64-ppc.c (elf_backend_grok_prstatus): Define.
376         (elf_backend_grok_psinfo): Define.
377         (ppc64_elf_grok_prstatus, ppc64_elf_grok_psinfo): New functions.
378
379         * elf.c (_bfd_elfcore_make_pseudosection): Allow multiple
380         sections with the same name.
381         (elfcore_grok_lwpstatus): Likewise.
382         (elfcore_grok_win32pstatus): Likewise.
383         (elfcore_grok_note): Likewise.
384         (elfcore_grok_nto_status): Likewise.
385         (elfcore_grok_nto_gregs): Likewise.
386
387 2003-10-27  Daniel Jacobowitz  <drow@mvista.com>
388
389         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Never skip dynamic
390         objects.
391
392 2003-10-14  Richard Sandiford  <rsandifo@redhat.com>
393
394         * elfxx-mips.c (mips_elf_create_got_section): Initialize global_gotno.
395
396 2003-10-24  H.J. Lu  <hongjiu.lu@intel.com>
397
398         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up
399         hash table for real symbols.
400
401 2003-10-23  Michael Snyder  <msnyder@redhat.com>
402
403         * section.c (asection): Fix typo in comment.
404
405 2003-10-23  Alan Modra  <amodra@bigpond.net.au>
406
407         * elf64-ppc.c (get_tls_mask): Add toc_symndx param, save toc
408         reloc symbol index to it.  Don't allow gd syms in shared libs
409         to be optimized.
410         (ppc64_elf_tls_optimize): Adjust get_tls_mask call.
411         (ppc64_elf_size_stubs): Likewise.
412         (ppc64_elf_relocate_section): Check that tls relocs are only used
413         with tls syms, and similarly for non-tls.  Correct symbol used
414         when optimizing toc tls code.
415
416 2003-10-22  Nick Clifton  <nickc@redhat.com>
417
418         * peicode.h (coff_swap_scnhdr_in): Only remove padding when
419         processing an executable.
420
421 2003-10-22  Jakub Jelinek  <jakub@redhat.com>
422
423         * elflink.c (_bfd_elf_export_symbol): Adjust for globals and locals
424         field changes.
425         (_bfd_elf_link_assign_sym_version): Likewise.
426         * elflink.h (size_dynamic_sections): Likewise.
427
428 2003-10-21  Alexandre Oliva  <aoliva@redhat.com>,
429             Michael Snyder  <msnyder@redhat.com>
430
431         * archures.c (bfd_mach_sh4a, bfd_mach_sh4al_dsp, bfd_mach_sh4_nofpu,
432         bfd_mach_sh4a_nofpu): New machine types.
433         * bfd-in2.h: Rebuilt.
434         * cpu-sh.c (compatible): Remove unused function.
435         (SH4A_NEXT, SH4AL_DSP_NEXT, SH4_NOFPU_NEXT, SH4A_NOFPU_NEXT): New.
436         (arch_info_struct): Add sh4a, sh4al_dsp, sh4-nofpu and sh4a-nofpu.
437         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle them.
438
439 2003-10-21  Wouter van Heyst <wouter@vidicode.nl>
440
441         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Correct text
442         describing mismatched formats involving the Maverick FP type.
443
444 2003-10-21  Anil Paranjpe  <anilp1@KPITCummins.com>
445
446         * binary.c (binary_object_p): Pass machine flag along with
447         architecture.
448
449 2003-10-21  Thorsten Brehm  <brehm@gmx.net>
450
451         * archures.c (bfd_default_scan): Add support for mcf528x.
452         * ieee.c (ieee_write_processor): Likewise.
453
454 2003-10-21  Peter Barada  <pbarada@mail.wm.sps.mot.com>
455             Bernardo Innocenti  <bernie@develer.com>
456
457         * archures.c: Add MCF528x (MCFv4) support.
458         * bfd/cpu-m68k.c (arch_info_struct): Likewise.
459         * bfd-in2.h: Regenerate.
460
461 2003-10-20  Andrew Cagney  <cagney@redhat.com>
462
463         * targets.c: Replace "struct sec" with "struct bfd_section"
464         * syms.c, sparclynx.c, section.c, opncls.c: Ditto.
465         * libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto.
466         * elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto.
467         * aout-tic30.c, aout-target.h:
468         * bfd-in2.h, libcoff.h, libbfd.h: Regenerate.
469
470 2003-10-18  Hans-Peter Nilsson  <hp@bitrange.com>
471
472         Support linker relaxation of new R_MMIX_PUSHJ_STUBBABLE relocs.
473         * elf64-mmix.c (MAX_PUSHJ_STUB_SIZE): New macro.
474         (struct _mmix_elf_section_data): New member pjs.
475         (mmix_set_relaxable_size, mmix_elf_get_section_contents): New
476         functions.
477         (elf_mmix_howto_table): New entry for R_MMIX_PUSHJ_STUBBABLE.
478         (mmix_reloc_map): Ditto.
479         (mmix_elf_relocate_section): Handle R_MMIX_PUSHJ_STUBBABLE.
480         (mmix_final_link_relocate, mmix_elf_check_common_relocs): Ditto.
481         (mmix_elf_perform_relocation): Ditto.  Don't mark parameter addr
482         unused.
483         (mmix_elf_check_relocs): Move early return to after
484         mmix_elf_check_common_relocs call.
485         (mmix_elf_symbol_processing): Fix cut-and-pasto in head comment.
486         (_bfd_mmix_before_linker_allocation): Rename from
487         _bfd_mmix_prepare_linker_allocated_gregs.  All referers changed.
488         Arrange to set the initial relaxable size of sections.
489         (_bfd_mmix_after_linker_allocation): Rename from
490         _bfd_mmix_finalize_linker_allocated_gregs.
491         (mmix_elf_relax_section): Relax a R_MMIX_PUSHJ_STUBBABLE reloc.
492         (bfd_elf64_get_section_contents): Define.
493         * reloc.c: Add ENUMX for BFD_RELOC_MMIX_PUSHJ_STUBBABLE.
494         * libbfd.h, bfd-in2.h: Regenerate.
495
496         * reloc.c (bfd_generic_relax_section): Default-set
497         section->_cooked_size here.
498         (bfd_generic_get_relocated_section_contents): Don't set it here.
499         Explain why.
500
501 2003-10-17  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
502
503         * elf32-hppa.c (elf32_hppa_relocate_section): Skip relocation if
504         output section has been discarded.
505
506 2003-10-17  Shrinivas Atre  <shrinivasa@KPITCummins.com>
507
508         * coff-h8300.c (funcvec_hash_newfunc): Handle normal mode.
509         (h8300_reloc16_extra_cases): Likewise.
510         (h8300_bfd_link_add_symbols): Likewise.
511
512 2003-10-17 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
513
514         * cpu-h8300.c (h8300sxn_info_struct): Correct address size.
515         (h8300sn_info_struct): Likewise.
516         (h8300hn_info_struct): Likewise.
517
518 2003-10-16  Pavel Roskin  <proski@gnu.org>
519
520         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size
521         for sections which lack size info.
522
523 2003-10-17  Danny Smith  <dannysmith@users.sourceforge.net>
524
525         * configure.host: Add __USE_MINGW_FSEEK to HDEFINES for
526          mingw32.
527
528 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
529
530         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also warn
531         undefined patterns with '*'.
532
533 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
534
535         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't
536         use the last CIE from a different section.
537         (_bfd_elf_write_section_eh_frame): Don't pad beyond the raw
538         size of the output section.
539
540 2003-10-07  Roland McGrath  <roland@redhat.com>
541
542         * elf.c (_bfd_elf_make_section_from_phdr): Set alignment_power of
543         new section from p_align header field.
544
545 2003-10-16  H.J. Lu  <hongjiu.lu@intel.com>
546
547         * elf32-xtensa.c (xtensa_read_table_entries): The external size
548         of entry is 8 bytes.
549
550 2003-10-15  Andrew Cagney  <cagney@redhat.com>
551
552         * targets.c (BFD_JUMP_TABLE_SYMBOLS): Replace NAME##_get_symtab
553         with NAME##_canonicalize_symtab.
554         * libcoff-in.h (coff_canonicalize_symtab): Update.
555         * xsym.h (bfd_sym_canonicalize_symtab): Update.
556         * elf-bfd.h (_bfd_elf_canonicalize_symtab): Update.
557         * coffgen.c (coff_canonicalize_symtab): Update.
558         * libbfd-in.h (_bfd_nosymbols_canonicalize_symtab): Update.
559         * libnlm.h (nlmNAME(canonicalize_symtab)): Update.
560         * ieee.c (ieee_vec): Update comment.
561         * libecoff.h (_bfd_ecoff_canonicalize_symtab): Update.
562         * mmo.c (mmo_canonicalize_symtab): Update.
563         * nlm-target.h (nlm_canonicalize_symtab): Update.
564         * nlmcode.h (nlm_canonicalize_symtab): Update.
565         * i386msdos.c (msdos_canonicalize_symtab): Update.
566         * hp300hpux.c (MY (canonicalize_symtab)): Update.
567         * oasys.c (oasys_canonicalize_symtab): Update.
568         * som.c (som_canonicalize_symtab): Update.
569         * pef.c (bfd_pef_canonicalize_symtab): Update.
570         * nlmcode.h (nlm_canonicalize_symtab): Update.
571         * xsym.c (bfd_sym_canonicalize_symtab): Update.
572         * vms.c (vms_canonicalize_symtab): Update.
573         * versados.c (versados_canonicalize_symtab): Update.
574         * mach-o.c (bfd_mach_o_canonicalize_symtab): Update.
575         * ieee.c (ieee_canonicalize_symtab): Update.
576         * pdp11.c (NAME(aout,canonicalize_symtab)): Update.
577         * reloc.c: Update comment.
578         * libaout.h (NAME(aout,canonicalize_symtab)): Update.
579         * coff64-rs6000.c (aix5coff64_vec): Update.
580         * coff64-rs6000.c (bfd_xcoff_aix5_backend_data): Update.
581         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update.
582         * aoutx.h (NAME(aout,canonicalize_symtab)): Update.
583         * elfxx-target.h (bfd_elfNN_canonicalize_symtab): Update.
584         * hp300hpux.c (MY_canonicalize_symtab): Update.
585         * ecoff.c (_bfd_ecoff_canonicalize_symtab): Update.
586         * aout-tic30.c (MY_canonicalize_symtab): Update.
587         * aout-target.h (MY_canonicalize_symtab): Update.
588         * ppcboot.c (ppcboot_canonicalize_symtab): Update.
589         * elf.c (_bfd_elf_canonicalize_symtab): Update.
590         * elfcode.h (elf_canonicalize_symtab): Update.
591         * ihex.c (ihex_canonicalize_symtab): Update.
592         * tekhex.c (tekhex_canonicalize_symtab): Update.
593         * binary.c (binary_canonicalize_symtab): Update.
594         * srec.c (srec_canonicalize_symtab): Update.
595
596 2003-10-15  Kazu Hirata  <kazu@cs.umass.edu>
597
598         * elf32-h8300.c (elf_reloc_map): Fix a comment typo.
599
600 2003-10-15  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
601
602         * elf32-sh.c (sh_elf_relocate_section): Handle R_SH_IMM_*_PCREL
603         relocations.
604         (sh_elf_check_relocs): Likewise.
605
606         * elf32-sh64.c (elf_backend_merge_symbol_attribute): Define.
607         (sh64_elf_merge_symbol_attribute): New.
608         * elf64-sh64.c (elf_backend_merge_symbol_attribute): Define.
609         (sh64_elf64_merge_symbol_attribute): New.
610
611 2003-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
612
613         * elf-bfd.h (struct elf_backend_data): New function pointer member
614         elf_backend_merge_symbol_attribute.
615         * elflink.h (elf_link_add_object_symbols): Adjust call to
616         elf_backend_merge_symbol_attribute if the backend defined it.
617         * elfxx-target.h (elf_backend_merge_symbol_attribute): New macro.
618         (elfNN_bed): Add that to the initializer.
619
620 2003-10-14  Bob Wilson  <bob.wilson@acm.org>
621
622         * elf32-xtensa.c (get_is_linkonce_section): Delete.
623         (xtensa_is_property_section, xtensa_is_littable_section): Use
624         XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros.  Do not recognize
625         linkonce sections containing ".xt.insn" and ".xt.lit" substrings.
626         (xtensa_get_property_section_name): Check section name instead of
627         calling get_is_linkonce_section.  Remove unused bfd parameter.  Use
628         XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros.  Never generate
629         linkonce section names by appending ".xt.insn" or ".xt.lit".
630         (xtensa_read_table_entries): Remove bfd argument in call to
631         xtensa_get_property_section_name.  Free section name when done.
632         (elf_xtensa_combine_prop_entries): Free leaking table.
633
634 2003-10-13  Richard Sandiford  <rsandifo@redht.com>
635
636         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add
637         DT_MIPS_LIBLIST or DT_MIPS_CONFLICT entries.
638         (_bfd_mips_elf_finish_dynamic_symbol): Don't handle them.  Don't
639         handle DT_MIPS_MSYM.  Set DT_RELSZ based on the number of relocations
640         that were needed.
641         (_bfd_mips_elf_modify_segment_map): Fix placement of PT_MIPS_OPTIONS.
642         (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_UCODE.
643
644 2003-10-13  H.J. Lu  <hongjiu.lu@intel.com>
645
646         * bfd-in.h (bfd_elf32_ia64_after_parse): New prototype.
647         (bfd_elf64_ia64_after_parse): Likewise.
648         * bfd-in2.h: Regenerated.
649
650         * elfxx-ia64.c (oor_ip): New.
651         (oor_branch_size): Likewise.
652         (bfd_elfNN_ia64_after_parse): Likewise.
653         (elfNN_ia64_relax_section): Use oor_ip if oor_branch_size
654         equals sizeof (oor_ip).
655
656 2003-10-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
657
658         * elf64-sh64.c (sh_elf64_relocate_section): Tidy up for the
659         renumbering of some relocation numbers.
660
661 2003-10-11  Alan Modra  <amodra@bigpond.net.au>
662
663         * coff-sh.c: Move definition of MAP and guard more code with
664         COFF_IMAGE_WITH_PE.
665
666         * section.c (bfd_get_section_size_before_reloc): Ignore reloc_done.
667         * bfd-in2.h: Regenerate.
668
669 2003-10-10  H.J. Lu  <hongjiu.lu@intel.com>
670
671         * Makefile.am: Run "make dep-am".
672         * Makefile.in: Regenerate.
673         * doc/Makefile.in: Likewise.
674
675 2003-10-09  H.J. Lu  <hongjiu.lu@intel.com>
676
677         * cofflink.c: Include "safe-ctype.h".
678         (coff_link_add_symbols): Use ISDIGIT instead of isdigit.
679
680 2003-10-08  Dave Brolley  <brolley@redhat.com>
681         On behalf of Michael Snyder  <msnyder@redhat.com>
682
683         * archures.c: Add FRV fr550 machine.
684         * cpu-frv.c: Ditto.
685         * elf32-frv.c: Ditto.
686         * bfd-in2.h: Regenerate.
687
688 2003-10-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
689
690         * elfxx-mips.c (STUB_MOVE,STUB_LI16): Fix stub code
691         for non-SGI N64 ABI. Improve code consitency.
692
693 2003-10-07  Alexandre Oliva  <aoliva@redhat.com>
694
695         * elf32-frv.c (elf32_frv_howto_table): Set R_FRV_LABEL16's
696         rightshift to 2.
697
698 2003-10-07  Nathan Sidwell  <nathan@codesourcery.com>
699
700         * libbfd-in.h (_bfd_link_section_stabs): Add string offset
701         parameter.
702         * cofflink.c (coff_link_add_symbols): Deal with split stab
703         sections.
704         * elflink.h (elf_link_add_object_symbols): Deal with split stab
705         sections.
706         * stabs.c (_bfd_link_section_stabs): Add string offset parameter.
707         * libbfd.h: Regenerated.
708
709         * coffcode.h (coff_set_alignment_hook): With PE_COFF reloc
710         overflow, set reloc start position to after the count
711         reloc. Subtract one from num relocs. Give error on 0xffff relocs
712         and no overflow.
713         * cofflink.c (_bfd_coff_final_link): Deal with PE_COFF reloc
714         overflow.
715         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Do overflow if >=
716         0xffff.
717
718 2003-10-06  H.J. Lu  <hongjiu.lu@intel.com>
719
720         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Pad the
721         last CIE/FDE if needed.
722
723 2003-10-06  Nick Clifton  <nickc@redhat.com>
724
725         * targets.c (_bfd_target_vector): Include bfd_elf64_sparc_vec if
726         BFD64 is enabled.
727
728 2003-10-06  Matt Thomas <matt@3am-software.com>
729
730         * config.bfd: Move the hppa*-*-netbsd* case to the hppa*-*-linux* case.
731
732 2003-10-06  Robert Millan  <robertmh@gnu.org>
733
734         * configure.in: Match GNU/KNetBSD with new knetbsd*-gnu triplet.
735         * config.bfd: Likewise.
736         * configure: Regenerate.
737
738 2003-10-04  Christian Groessler  <chris@groessler.org>
739
740         * coff-z8k.c (extra_case): Fix displacement length check for R_JR
741         and R_CALLR.
742
743 2003-10-04  Stephane Carrez  <stcarrez@nerim.fr>
744
745         * elf32-m68hc1x.c: Update to ISO C90; replace PTR with void*.
746         * elf32-m68hc11.c: Likewise.
747         * elf32-m68hc12.c: Likewise.
748         * elf32-m68hc1x.h: Likewise.
749
750 2003-10-04  Stephane Carrez  <stcarrez@nerim.fr>
751
752         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Fix merge
753         of flags between HC12 and HCS12.
754
755 2003-10-04  Bryce McKinlay  <bryce@mckinlay.net.nz>
756
757         * merge.c (_bfd_merge_sections): Set SEC_EXCLUDE flag on sections
758         which become empty after merging.
759
760 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
761
762         * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB,
763         R_IA64_DTPREL{32,64}[LM]SB and R_IA64_DTPMOD64[LM]SB.
764
765 2003-09-30  Chris Demetriou  <cgd@broadcom.com>
766
767         * archures.c (bfd_mach_mipsisa64r2): New define.
768         * bfd-in2.h: Regenerate.
769         * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2.
770         * cpu-mips.c (I_mipsisa64r2): New enum value.
771         (arch_info_struct): Add entry for I_mipsisa64r2.
772         * elfxx-mips.c (_bfd_elf_mips_mach)
773         (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2.
774         (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case.
775         (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2.
776
777 2003-09-29  H.J. Lu  <hongjiu.lu@intel.com>
778
779         * elfxx-ia64.c (elfNN_hpux_backend_symbol_processing): New.
780         Handle SHN_IA_64_ANSI_COMMON.
781         (elf_backend_section_from_bfd_section): Defined.
782
783 2003-09-26  H.J. Lu  <hongjiu.lu@intel.com>
784
785         * elflink.c (elf_link_read_relocs_from_section): Add an argument
786         of a pointer to section. Check bad symbol index.
787         (_bfd_elf_link_read_relocs): Modify calls to
788         elf_link_read_relocs_from_section.
789
790 2003-09-23  DJ Delorie  <dj@redhat.com>
791
792         * elf32-sh.c (sh_elf_howto_table): R_SH_SWITCH8,
793         R_SH_GNU_VTINHERIT, R_SH_GNU_VTENTRY,
794         R_SH_LOOP_START,R_SH_LOOP_END moved to "reserved" spaces,
795         R_SH_DIR16, R_SH_DIR8, R_SH_DIR8UL, R_SH_DIR8UW, R_SH_DIR8U,
796         R_SH_DIR8SW, R_SH_DIR8S, R_SH_DIR4UL, R_SH_DIR4UW, R_SH_DIR4U,
797         R_SH_PSHA, R_SH_PSHL added.
798         (sh_reloc_map): Add R_SH_DIR16 and R_SH_DIR8.
799         (sh_elf_relocate_section): Support new relocs.
800
801 2003-09-23  Bob Wilson  <bob.wilson@acm.org>
802
803         * elf32-xtensa.c (elf_xtensa_relocate_section): Fix typo that clobbered
804         dynamic relocation offsets.
805
806 2003-09-23  Alan Modra  <amodra@bigpond.net.au>
807
808         * simple.c (bfd_simple_get_relocated_section_contents): Free the
809         hash table using _bfd_generic_link_hash_table_free.
810
811 2003-09-23  Alan Modra  <amodra@bigpond.net.au>
812
813         * elf-bfd.h (struct bfd_elf_special_section): Remove "suffix".  Change
814         type of prefix_length and suffix_length to int.  Rename "attributes"
815         to "attr".  Comment.
816         (_bfd_elf_get_sec_type_attr): Update prototype.
817         * elf.c (get_special_section): Rewrite.
818         (_bfd_elf_get_sec_type_attr): Return struct rather than passing in
819         attr and type pointers.
820         (_bfd_elf_new_section_hook): Adjust for above.
821         (special_sections): Merge suffix with prefix.  Set
822         prefix_length for all entries.  Set suffix_length appropriately.
823         * elf32-m32r.c (m32r_elf_special_sections): Likewise.
824         * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise.
825         * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise.
826         * elf32-mcore.c (mcore_elf_special_sections): Likewise.
827         * elf32-sh64.c (sh64_elf_special_sections): Likewise.
828         * elf32-v850.c (v850_elf_special_sections): Likewise.
829         * elf32-xtensa.c (elf_xtensa_special_sections): Likewise.
830         * elf64-alpha.c (elf64_alpha_special_sections): Likewise.
831         * elf64-hppa.c (elf64_hppa_special_sections): Likewise.
832         * elf64-ppc.c (ppc64_elf_special_sections): Likewise.
833         * elf64-sh64.c (sh64_elf64_special_sections): Likewise.
834         * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise.
835         * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise.
836         * elf32-ppc.c (ppc_elf_special_sections): Likewise.  Fix .plt flags.
837
838 2003-09-21  Daniel Jacobowitz  <drow@mvista.com>
839
840         * elf64-alpha.c (elf64_alpha_create_got_section): Initialize
841         ->got if the section already exists.
842
843 2003-09-19  Nathan Sidwell  <nathan@codesourcery.com>
844
845         * dwarf2.c (decode_line_info): Cope with an initially empty
846         filename table.
847
848 2003-09-18  H.J. Lu  <hongjiu.lu@intel.com>
849
850         * acinclude.m4: Include ../config/accross.m4.
851         * aclocal.m4: Regenerated.
852
853         * configure.host (HOST_64BIT_TYPE): Remove if it is set to long
854         or long long.
855         (HOST_U_64BIT_TYPE): Remove if it is set to unsigned long long.
856         (host64): Remove if HOST_64BIT_TYPE is set to long.
857
858         * configure.in (HOST_64BIT_TYPE): Set according to the size of
859         long and long long.
860         (HOST_U_64BIT_TYPE): Likewise.
861         (host64): Likewise.
862         * configure: Regenerated.
863
864 2003-09-19  Alan Modra  <amodra@bigpond.net.au>
865
866         * elf.c (elfcore_write_note): Don't use sizeof(Elf_External_note)
867         since some ABIs round up the size of the struct.
868
869 2003-09-18  H.J. Lu  <hongjiu.lu@intel.com>
870
871         * elflink.c (_bfd_elf_merge_symbol): Allow type change if
872         the old symbol is undefined and the new symbol is defined.
873
874 2003-09-18  Andreas Schwab  <schwab@suse.de>
875
876         * simple.c (bfd_simple_get_relocated_section_contents): Use
877         _bfd_generic_link_hash_table_create instead of
878         bfd_link_hash_table_create.
879
880 2003-09-10  H.J. Lu  <hongjiu.lu@intel.com>
881
882         * elfxx-ia64.c (elfNN_ia64_special_sections): Mark all sections
883         started with ".sbss" or "".sdata" as SHF_IA_64_SHORT.
884
885 2003-09-10  John David Anglin   <dave.anglin@nrc-cnrc.nrc.ca>
886             Randolph Chung      <randolph@tausq.org>
887
888         * elf32-hppa.c (struct elf32_hppa_link_hash_entry,
889         hppa_link_hash_newfunc, hppa_build_one_stub,
890         elf32_hppa_adjust_dynamic_symbol, mark_PIC_calls, allocate_plt_static,
891         allocate_dynrelocs, elf32_hppa_size_dynamic_sections,
892         elf32_hppa_finish_dynamic_symbol): Remove pic_call field and all code
893         for generating import stubs for calls to statically linked PIC
894         functions.
895         (hppa_type_of_stub): Don't generate an import stub for calls to
896         statically linked pic functions.  Generate import stubs for calls
897         in a shared object, to functions not in a regular file, and to
898         defined weak functions.  Add new argument INFO.
899         (hppa_build_one_stub): Don't undef ADDIL_DP.
900         (elf32_hppa_check_relocs): Don't set SEC_HAS_GOT_REF flag.
901         (elf32_hppa_size_stubs): Pass info to hppa_type_of_stub.
902         (final_link_relocate): Change all DLTIND relocs to DPREL relocs in a
903         non-shared link.  Convert instructions that use the the linkage table
904         pointer, or a facsimile thereof, to use the global data pointer when
905         the reloc has been changed.
906
907 2003-09-08  Joel Brobecker  <brobecker@gnat.com>
908
909         * archures.c: Add new machine names for hppa.
910         * bfd-in2.h: Regenerate.
911         * cpu-hppa.c: Use the new machine names.
912
913 2003-09-06  Stephane Carrez  <stcarrez@nerim.fr>
914
915         * elf32-m68hc1x.h (struct m68hc11_elf_link_hash_table): Remove
916         all_local_syms member.
917         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Use bfd_elf_get_elf_syms
918         to get the local symbols.
919
920 2003-09-06  Stephane Carrez  <stcarrez@nerim.fr>
921
922         * elf32-m68hc12.c (elf32_m68hc12_special_sections): New for hc11.
923         (elf_backend_special_sections): Define.a
924
925         PR savannah/4950:
926         * elf32-m68hc11.c (elf32_m68hc11_special_sections): The .vectors
927         section is read-only.
928
929 2003-09-04  Nick Clifton  <nickc@redhat.com>
930
931         * archures.c (bfd_mach_v850e1): Define.
932         * bfd-in2.h: Regenerate.
933         * cpu-v850.h (scan): Accept bfd_mach_v850e1.
934         (arch_info_struct): Include an entry for bfd_mach_v850e1.
935         * elf32-v850.c (v850_elf_object_p): Accept E_V850E1_ARCH flag.
936         (v850_elf_final_write_processing): Accept bfd_mach_v850e1.
937         (v850_elf_print_private_bfd_data): Interpret E_V850E1_ARCH flag.
938         (v850_elf_merge_private_bfd_data): Allow v850e1 binaries to be
939         linked with v850e binaries.  Mark the output as v850e.
940
941 2003-09-03  Nick Clifton  <nickc@redhat.com>
942
943         * cofflink.c (_bfd_coff_link_input_bfd): Do not skip section
944         symbols that are used in relocs.
945
946 2003-08-30  Robert Millan  <robertmh@gnu.org>
947
948         * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet.
949         * config.bfd: Likewise.
950         * configure: Regenerate.
951
952 2003-08-31  Christian Groessler  <chris@groessler.org>
953
954         * elf32-i860.c (i860_howto_pc26_reloc): Finish relocation here
955         instead of returning bfd_reloc_continue.
956
957 2003-08-31  Andreas Jaeger  <aj@suse.de>
958
959         * merge.c: Update to ISO C90.
960
961 2003-08-27  Ian Lance Taylor  <ian@airs.com>
962
963         * configure.in: Check for strtoull.
964         * bfd.c (bfd_scan_vma): Use strtoull when available.
965         * configure, config.in: Regenerate.
966
967         * configure.in: Define and substitute BFD_HOST_LONG_LONG.
968         * bfd-in.h: Define BFD_HOST_LONG_LONG.  Test it rather than
969         __GNUC__ when deciding whether to use long long for
970         BFD_HOST_64_BIT.
971         * configure, Makefile.in, doc/Makefile.in, bfd-in2.h: Regenerate.
972
973 2003-08-27  Christian Groessler  <chris@groessler.org>
974
975         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
976         i860_howto_splitn_reloc, i860_howto_highadj_reloc): New
977         functions.
978         (elf32_i860_howto_table): Insert the new functions as
979         'special_function's in the proper reloc type entries.
980
981 2003-08-27  Richard Sandiford  <rsandifo@redhat.com>
982
983         * elf32-frv.c (elf32_frv_relocate_section): Use
984         _bfd_elf_rela_local_sym.
985
986 2003-08-26  Michael Snyder  <msnyder@redhat.com>
987
988         * cpu-frv.c: Remove unused enum.
989
990 2003-08-25  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
991
992         * reloc.c: Fix documentation for MIPS ELF relocations.
993         libbfd.h: Regenerate.
994         bfd-in2.h: Regenerate.
995
996 2003-08-24  Jason Eckhardt  <jle@rice.edu>
997
998         * coff-i860.c (CALC_ADDEND): Define to be a no-op.
999
1000 2003-08-24  Jason Eckhardt  <jle@rice.edu>
1001
1002         * elf32-i860.c (elf32_i860_relocate_pc16): Subtract 4 and
1003         shift by 2 before storing the relocated value.
1004
1005 2003-08-23  Jason Eckhardt  <jle@rice.edu>
1006
1007         * coff-i860.c (coff_i860_reloc_nyi): New function.
1008         (howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH,
1009         LOWn, SPLITn, and BRADDR.
1010         (RTYPE2HOWTO): Check that the r_type is within the howto_table
1011         before trying to access the entry.
1012         (coff_i860_rtype_to_howto): Likewise.
1013         (coff_i860_reloc_type_lookup): New function.
1014         (i860_reloc_processing): New function.
1015         (coff_bfd_reloc_type_lookup): Define macro.
1016         (RELOC_PROCESSING): Define macro.
1017         Minor formatting adjustments.
1018
1019 2003-08-23  Alan Modra  <amodra@bigpond.net.au>
1020
1021         * elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner.
1022
1023 2003-08-22  H.J. Lu  <hongjiu.lu@intel.com>
1024
1025         * elfxx-ia64.c (elfNN_ia64_create_dynamic_sections): Align the
1026         .got section at 8 bytes.
1027
1028 2003-08-21  Nick Clifton  <nickc@redhat.com>
1029
1030         * cofflink.c: Update to ISO C90 and tidy up formatting.
1031
1032 2003-08-21  Randolph Chung  <tausq@debian.org>
1033
1034         * elf32-hppa.c (elf32_hppa_object_p): For elf32-hppa-linux, objects
1035         can have OSABI=Linux or OSABI=SysV.  Check for both.
1036         * elf64-hppa.c (elf64_hppa_object_p): Likewise.
1037
1038 2003-08-21  Nick Clifton  <nickc@redhat.com>
1039
1040         * po/sv.po: Updated Swedish translation.
1041
1042 2003-08-20  Richard Sandiford  <rsandifo@redhat.com>
1043
1044         * elf64-mips.c (elf_backend_copy_indirect_symbol): Define.
1045
1046 2003-08-20  Nick Clifton  <nickc@redhat.com>
1047
1048         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): New macro used to
1049         replace some duplicated code in most elfxx-xxxx.c files.  This
1050         version uses the new fields in bfd_link_info.
1051
1052         * elf-m10300.c (mn10300_elf_relocate_section): Use new macro.
1053         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
1054         * elf32-cris.c (cris_elf_relocate_section): Likewise.
1055         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
1056         * elf32-i386.c (elf_i386_relocate_section): Likewise.
1057         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
1058         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
1059         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1060         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1061         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1062         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1063         * elf32-vax.c (elf_vax_relocate_section): Likewise.
1064         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1065         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1066         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1067         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1068         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1069         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1070         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1071
1072         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols,
1073         elf_hppa_remark_useless_dynamic_symbols,
1074         elf_hppa_relocate_section): Use the new fields in
1075         bfd_link_info structure.
1076         * elf32-sh.c (sh_elf_relocate_section): Likewise.
1077         * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1078         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
1079         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1080         * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise.
1081         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1082
1083         * elflink.h (elf_link_output_extsym): Fix test for reporting
1084         undefined symbols in shared libraries.  Remove redundant test
1085         of shlib_undefined when reporting references to forced local
1086         symbols.
1087
1088 2003-08-18  Andreas Schwab  <schwab@suse.de>
1089
1090         * libpei.h (bfd_pe_executable_p): Also recognize efi-app
1091         executables.
1092
1093 2003-08-17  Hans-Peter Nilsson  <hp@bitrange.com>
1094
1095         * simple.c (bfd_simple_get_relocated_section_contents): Move
1096         reloc_done hack to before first bfd_section_size call.  Change all
1097         returns to use new wrapper macro RETURN, restoring sec->reloc_done.
1098
1099 2003-08-16  Alan Modra  <amodra@bigpond.net.au>
1100
1101         * elf64-ppc.c: Don't include elf/ppc.h.
1102
1103 2003-08-14  Richard Sandiford  <rsandifo@redhat.com>
1104
1105         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC
1106         code to work with 64-bit bfds.
1107
1108 2003-08-14  Alan Modra  <amodra@bigpond.net.au>
1109
1110         * dep-in.sed: Remove libintl.h.
1111         * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Unset LC_COLLATE.
1112         (POTFILES.in): Remove target.
1113         * Makefile.in: Regenerate.
1114
1115 2003-08-12  Alan Modra  <amodra@bigpond.net.au>
1116
1117         * elf64-ppc.c (ppc64_elf_next_input_section): Update comment.
1118         (ppc64_elf_relocate_section): For zero sym R_PPC64_TOC relocs,
1119         use the function sym from the previous reloc.
1120
1121 2003-08-11  Jakub Jelinek  <jakub@redhat.com>
1122
1123         * elf32-i386.c (elf_i386_relocate_section): Make undefined symbols
1124         fatal if -pie.
1125         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1126         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1127         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1128         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1129         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1130         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1131         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1132         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1133         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1134         (ppc_elf_relocate_section) <case R_PPC_RELAX32>: Issue fatal error
1135         on undefined symbols if -pie.
1136         * elf32-sh.c (sh_elf_relocate_section): Likewise.
1137
1138 2003-08-11  Alan Modra  <amodra@bigpond.net.au>
1139
1140         * elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o
1141         branch to __libc_start_main.
1142
1143 2003-08-08 Dmitry Diky <diwil@mail.ru>
1144
1145         * archures.c: Add xW42 and xE42 parts. Sort MPU list according to
1146         gcc order.
1147         * cpu-msp430.c: Likewise.
1148         * elf32-msp430.c: Likewise.
1149         * bfd-in2.h: Regenerate.
1150
1151 2003-08-07  Alan Modra  <amodra@bigpond.net.au>
1152
1153         * elfxx-target.h: Remove PTR cast.
1154         * targets.c (bfd_target): Make backend_data const void *.
1155         * elf-bfd.h: Constify all occurrences of struct elf_backend_data.
1156         * elf-m10300.c: Likewise.
1157         * elf.c: Likewise.
1158         * elf32-hppa.c: Likewise.
1159         * elf32-i386.c: Likewise.
1160         * elf32-m68hc1x.c: Likewise.
1161         * elf32-ppc.c: Likewise.
1162         * elf32-s390.c: Likewise.
1163         * elf32-sh.c: Likewise.
1164         * elf32-sh64.c: Likewise.
1165         * elf32-sparc.c: Likewise.
1166         * elf32-xtensa.c: Likewise.
1167         * elf64-mips.c: Likewise.
1168         * elf64-ppc.c: Likewise.
1169         * elf64-s390.c: Likewise.
1170         * elf64-sh64.c: Likewise.
1171         * elf64-sparc.c: Likewise.
1172         * elf64-x86-64.c: Likewise.
1173         * elfcode.h: Likewise.
1174         * elfcore.h: Likewise.
1175         * elflink.c: Likewise.
1176         * elflink.h: Likewise.
1177         * elfxx-ia64.c: Likewise.
1178         * elfxx-mips.c: Likewise.
1179         * elfxx-mips.h: Likewise.
1180         * elf.c (prep_headers): Remove useless check for null backend_data.
1181         * bfd-in2.h: Regenerate.
1182
1183         * elf-bfd.h: Remove PARAMS macro.  Replace PTR with void *.
1184         (NAME): Use ## rather than CONCAT4 macro.
1185         * elfcode.h: Remove one remaining PARAMS macro.
1186         * elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes.
1187         * elf-strtab.c: Likewise.
1188         * elf-hppa.h: Likewise.
1189         * elf32-hppa.h: Likewise.
1190         * elf32-hppa.c: Likewise.
1191         (elf32_hppa_add_symbol_hook): Delete.
1192         (elf_backend_add_symbol_hook): Don't define.
1193         * libhppa.h: Convert to C90.  Replace INLINE with inline.
1194
1195 2003-08-06  Alan Modra  <amodra@bigpond.net.au>
1196
1197         * elf64-ppc.c (ppc_stub_name): Tweak names for better readability.
1198         (ppc64_elf_adjust_dynamic_symbol): Allow copy relocs against
1199         function descriptors, but warn.
1200         (ppc_build_one_stub): Remove a couple of vars.  Move code creating
1201         stub syms so that we can avoid a stub sym if we already have a
1202         plt sym.  Do not redefine an existing symbol.
1203         (ppc64_elf_build_stubs): When --emit-stub-syms, print a symbol for
1204         glink.
1205
1206 2003-08-06  Nick Clifton  <nickc@redhat.com>
1207
1208         * po/fr.po: Updated French translation.
1209
1210 2003-08-06  Alan Modra  <amodra@bigpond.net.au>
1211
1212         * elflink.c (_bfd_elf_create_dynamic_sections): Mark .dynbss with
1213         SEC_LINKER_CREATED.
1214
1215 2003-08-05  Daniel Jacobowitz  <drow@mvista.com>
1216
1217         * elf32-arm.h (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
1218         (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Use it.
1219
1220 2003-08-03  Jeff Muizelaar  <muizelaar@rogers.com>
1221
1222         * coffcode.h (coff_slurp_line_table): Return with a warning
1223         message if the line number table could not be read.
1224
1225 2003-08-04  Nick Clifton  <nickc@redhat.com>
1226
1227         * elflink.h (elf_link_add_object_symbols): Prepend "warning: "
1228         to messages produced for .gnu.warning.SYMBOL sections.
1229
1230 2003-08-04  Alan Modra  <amodra@bigpond.net.au>
1231
1232         * elfcode.h: Convert to C90, remove unneeded casts and prototypes.
1233         * elfcore.h: Likewise.
1234         * elflink.c: Likewise.
1235         * elflink.h: Likewise.
1236         * elf.c (sym_is_global): Remove INLINE.
1237         (align_file_position): Replace INLINE with inline.
1238         * elfcode.h (elf_swap_dyn_in, elf_swap_dyn_out): Remove INLINE.
1239         (elf_file_p): Replace INLINE with inline.
1240
1241 2003-08-02  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1242
1243         * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here.
1244
1245 2003-08-01  H.J. Lu  <hongjiu.lu@intel.com>
1246
1247         * elfxx-ia64.c (get_got): Align the .got section at 8 bytes.
1248
1249 2003-08-01  H.J. Lu  <hongjiu.lu@intel.com>
1250
1251         * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Use
1252         ElfNN_External_Rela instead of Elf64_External_Rela.
1253
1254 2003-08-01  Nick Clifton  <nickc@redhat.com>
1255
1256         * config.bfd: Add code to catch obsolete configurations and warn
1257         about them unless --enable-obsolete is used.  Use this to mark
1258         vax-vms port as obsolete.
1259
1260 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1261
1262         * elf32-ppc.c (ppc_elf_install_value): Tidy.
1263         (ppc_elf_relax_section): Remove dead code.  Remove unnecessary casts.
1264         Formatting.
1265         * elfxx-target.h: Remove PARAMS macro.  Formatting.
1266
1267 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1268
1269         * elf.c (bfd_section_from_r_symndx): Test for SHN_UNDEF.
1270         * elf64-ppc.c (get_fdh): New function, split out from
1271         ppc64_elf_edit_opd.
1272         (ppc64_elf_check_relocs): Use get_fdh.
1273         (func_desc_adjust): Likewise.  Tidy.
1274         (ppc64_elf_edit_opd): Tighten reloc checks.  Free local_syms on error
1275         exit.  Use get_fdh.  Account for superfluous dynamic relocs.
1276         (ppc64_elf_relocate_section): Warning fix.
1277
1278 2003-07-30  Jason Eckhardt  <jle@rice.edu>
1279
1280         * coff-i860.c: Convert to ISO C90.  Remove superflous prototypes.
1281
1282 2003-07-30  Jason Eckhardt  <jle@rice.edu>
1283
1284         * elf32-i860.c: Convert to ISO C90.  Remove superflous prototypes.
1285
1286 2003-07-30  Randolph Chung  <tausq@debian.org>
1287
1288         * elf-hppa.h (elf_hppa_relocate_section): Look up dyn_h for undefweak.
1289         * elf64-hppa.c (elf64_hppa_finalize_dlt): Check h->root.type.
1290
1291 2003-07-30  Alan Modra  <amodra@bigpond.net.au>
1292
1293         * elf.c: Convert to C90, remove unnecessary prototypes and casts.
1294         Replace PTR with void *.  Formatting.
1295         (_bfd_elf_assign_file_position_for_section): Remove INLINE.
1296         (make_mapping): Likewise.
1297
1298 2003-07-29  Alan Modra  <amodra@bigpond.net.au>
1299
1300         * elf64-ppc.c (func_desc_adjust): Give linker created function
1301         descriptor symbols a size and type.
1302         (ppc64_elf_relocate_section): Correct lq insn test.
1303
1304 2003-07-28  Eric Christopher  <echristo@redhat.com>
1305
1306         * elf32-ppc.c (R_PPC_RELAX32): New relocation.
1307         (ppc_elf_install_value): New function.
1308         (ppc_elf_sort_rela): Remove.
1309         (ppc_elf_relax_section): Rewrite. Remove old relaxation
1310         and replace with out of range branch stubs.
1311         (ppc_elf_relocate_section): Handle R_PPC_RELAX32.
1312
1313 2003-07-29  Alexandre Oliva  <aoliva@redhat.com>
1314
1315         * elf-m10300.c (mn10300_elf_relax_section): Take symbol hash table
1316         from input_bfd.
1317
1318 2003-07-28  Alan Modra  <amodra@bigpond.net.au>
1319
1320         * elf.c (special_sections): Set attributes for .got and .plt.
1321
1322 2003-07-27  Alan Modra  <amodra@bigpond.net.au>
1323
1324         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Ensure no copy relocs
1325         on function descriptors.
1326         (ELIMINATE_COPY_RELOCS): Expand comment.
1327         (ppc64_elf_special_sections): Move.  Don't include non-ppc64 sections.
1328         Do include ".toc1".
1329
1330 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1331
1332         * elf.c (_bfd_elf_new_section_hook): Set the default section
1333         type to SHT_NULL.
1334         (elf_fake_sections): Set the section type based on asect->flags
1335         if it is SHT_NULL. Don't abort on processor specific section
1336         types.
1337
1338 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1339
1340         * bfd-in2.h: Regenerated.
1341
1342 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1343
1344         * elf-bfd.h (bfd_elf_special_section): New.
1345         (elf_backend_data): Add special_sections, a pointer to
1346         bfd_elf_special_section.
1347         (elf_section_type). New.
1348         (elf_section_flags): New.
1349         (_bfd_elf_get_sec_type_attr): New.
1350
1351         * elf.c (_bfd_elf_make_section_from_shdr): Always use the
1352         real section type/flags.
1353         (special_sections): New.
1354         (get_special_section): New.
1355         (_bfd_elf_get_sec_type_attr): New.
1356         (_bfd_elf_new_section_hook): Check special_section to set
1357         elf_section_type and elf_section_flags.
1358         (elf_fake_sections): Don't use section name to set ELF section
1359         data.
1360
1361         * elf32-m32r.c (m32r_elf_special_sections): New.
1362         (elf_backend_special_sections): Defined.
1363
1364         * elf32-m68hc11.c (elf32_m68hc11_special_sections): New.
1365         (elf_backend_special_sections): Defined.
1366
1367         * elf32-mcore.c (mcore_elf_special_sections): New.
1368         (elf_backend_special_sections): Defined.
1369
1370         * elf32-ppc.c (ppc_elf_special_sections): New.
1371         (elf_backend_special_sections): Defined.
1372
1373         * elf32-sh64.c (sh64_elf_special_sections): New.
1374         (elf_backend_special_sections): Defined.
1375
1376         * elf32-v850.c (v850_elf_special_sections): New.
1377         (elf_backend_special_sections): Defined.
1378
1379         * elf32-xtensa.c (elf_xtensa_special_sections): New.
1380         (elf_backend_special_sections): Defined.
1381
1382         * elf64-alpha.c (elf64_alpha_special_sections): New.
1383         (elf_backend_special_sections): Defined.
1384
1385         * elf64-hppa.c (elf64_hppa_special_sections): New.
1386         (elf_backend_special_sections): Defined.
1387
1388         * elf64-ppc.c (ppc64_elf_special_sections): New.
1389         (elf_backend_special_sections): Defined.
1390
1391         * elf64-sh64.c (sh64_elf64_special_sections): New.
1392         (elf_backend_special_sections): Defined.
1393
1394         * elfxx-ia64.c (elfNN_ia64_special_sections): New.
1395         (elf_backend_special_sections): Defined.
1396
1397         * elfxx-mips.c (_bfd_mips_elf_special_sections): New.
1398
1399         * elfxx-mips.h (_bfd_mips_elf_special_sections): New.
1400         (elf_backend_special_sections): Defined.
1401
1402         * elfxx-target.h (elf_backend_special_sections): New. Default
1403         to NULL.
1404         (elfNN_bed): Initialize special_sections.
1405
1406         * section.c (bfd_abs_section): Remove const.
1407         (bfd_und_section): Likewise.
1408         (bfd_com_section): Likewise.
1409         (bfd_ind_section): Likewise.
1410
1411 2003-07-24  Nick Clifton  <nickc@redhat.com>
1412
1413         * coff-arm.c (EXTRA_S_FLAGS): Include SEC_CODE so that code
1414         sections are assigned the LOAD attribute.
1415
1416 2003-07-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1417
1418         * elf32-sh.c: Convert to C90.  Replace PTR with void *.
1419         * elf32-sh64-com.c: Likewise.
1420         * elf32-sh64.c: Likewise.
1421         * elf32-sh64.h: Likewise.
1422         * elf64-sh64.c: Likewise.
1423
1424 2003-07-24  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1425
1426         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL.
1427         (allocate_dynrelocs): Likewise.
1428         (sh_elf_relocate_section): Likewise. Use SYMBOL_REFERENCES_LOCAL.
1429         (sh_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL.
1430
1431 2003-07-24  Nick Clifton  <nickc@redhat.com>
1432
1433         * po/fr.po: Updated French translation.
1434
1435 2003-07-23  Bob Wilson  <bob.wilson@acm.org>
1436
1437         * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Make inline and move
1438         near the beginning of the file.  Swap order of arguments.  Call
1439         _bfd_elf_dynamic_symbol_p with "ignore_protected" set to 0.
1440         (elf_xtensa_fix_refcounts): Adjust xtensa_elf_dynamic_symbol_p call.
1441         (elf_xtensa_relocate_section): Likewise.
1442         (shrink_dynamic_reloc_sections): Likewise.
1443
1444 2003-07-23  Bob Wilson  <bob.wilson@acm.org>
1445
1446         * elf32-xtensa.c (plt_reloc_count): Fix typo in comment.
1447         (elf_xtensa_size_dynamic_sections): Use elf_discarded_section.
1448         (elf_xtensa_combine_prop_entries): Avoid returning non-zero without
1449         first printing an error message.
1450         (elf_xtensa_finish_dynamic_sections): Likewise.
1451         (elf_xtensa_discard_info_for_section): Adjust size of .got.loc when
1452         discarding literal table entries.
1453         (elf_xtensa_merge_private_bfd_data): Remove newline from error message.
1454         (elf_xtensa_do_asm_simplify): Likewise.
1455
1456 2003-07-23  Stephane Carrez  <stcarrez@nerim.fr>
1457
1458         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
1459         we have a local symbol in common section.
1460
1461 2003-07-22  H.J. Lu <hongjiu.lu@intel.com>
1462
1463         * elflink.c (_bfd_elf_dynamic_symbol_p): Don't return TRUE for
1464         weak symbols.
1465
1466 2003-07-22  Nick Clifton  <nickc@redhat.com>
1467
1468         * coffcode.h (coff_slurp_symbol_table): Add C_TCSYM and C_ECOML to
1469         expected RS6000 storage classes.
1470
1471 2003-07-21  H.J. Lu <hongjiu.lu@intel.com>
1472
1473         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Mark
1474         output_bfd unused to silence gcc.
1475
1476 2003-07-21  Nick Clifton  <nickc@redhat.com>
1477
1478         * po/sv.po: Updated Swedish translation.
1479
1480 2003-07-21  Alan Modra  <amodra@bigpond.net.au>
1481
1482         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use..
1483         (_bfd_elf_symbol_refs_local_p): ..this.  Declare.
1484         * elflink.c (_bfd_elf_symbol_refs_local_p): New function.
1485         * elf32-i386.c (elf_i386_relocate_section): Remove h NULL test
1486         now done in _bfd_elf_symbol_refs_local_p.
1487         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1488         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1489         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1490
1491 2003-07-18  H.J. Lu <hongjiu.lu@intel.com>
1492
1493         * elflink.c (_bfd_elf_dynamic_symbol_p): Undo the last change.
1494
1495 2003-07-18  H.J. Lu <hongjiu.lu@intel.com>
1496
1497         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo.
1498         (SYMBOL_CALLS_LOCAL): Likewise.
1499
1500         * elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE
1501         immediately if symbol isn't defined locally.
1502
1503 2003-07-18  Richard Henderson  <rth@redhat.com>
1504
1505         * elflink.c (_bfd_elf_dynamic_symbol_p): New.
1506         * elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it.
1507         (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it.
1508         * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise.
1509         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
1510         * elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise.
1511         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise.
1512         Update all callers to provide the relocation being resolved.
1513
1514 2003-07-17  Shaun Jackman <sjackman@pathwayconnect.com>
1515
1516         * config.bfd (arm-wince-pe): Add -DARM_COFF_BUGFIX to
1517         targ_cflags.
1518
1519 2003-07-17  Nick Clifton  <nickc@redhat.com>
1520
1521         * po/es.po: New Spanish translation.
1522         * po/sv.po: New Swedish translation.
1523         * po/opcodes.pot: Regenerate.
1524
1525 2003-07-16  Richard Henderson  <rth@redhat.com>
1526
1527         * config.bfd, configure.host, configure.in: Remove ia64-aix support.
1528         * elfxx-ia64.c, targets.c: Likewise.
1529
1530 2003-07-16  Richard Henderson  <rth@redhat.com>
1531
1532         * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Properly return false
1533         for symbols defined locally plus -Bsymbolic.  Tidy logic.
1534
1535 2003-07-15  Richard Sandiford  <rsandifo@redhat.com>
1536
1537         * archures.c (bfd_mach_mips7000): New.
1538         * bfd-in2.h: Regenerated.
1539         * cpu-mips.c (arch_info_struct): Add an entry for mips:7000.
1540         * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips7000.
1541         (mips_mach_extensions): Add an entry for it.
1542
1543 2003-07-14  Nick Clifton  <nickc@redhat.com>
1544
1545         * po/tr.po: Update with latest version.
1546         * po/SRC-POTFILES.in: Regenerate.
1547         * po/bfd.pot: Regenerate.
1548         * Makfile.in: Regenerate.
1549         * configure: Regenerate.
1550
1551 2003-07-12  Jeff Baker  <jbaker@qnx.com>
1552
1553         * bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures.
1554         * bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1555         * bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1556         * bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
1557
1558 2003-07-12  Jeff Muizelaar  <muizelaar@rogers.com>
1559
1560         * coffcode.h (coff_set_section_contents): Set the
1561         IMAGE_FILE_32BIT_MACHINE flag for PE targets.
1562
1563 2003-07-11  Richard Sandiford  <rsandifo@redhat.com>
1564
1565         * bfd-in.h (bfd_h8300_pad_address): Declare.
1566         * bfd-in2.h: Regenerate.
1567         * cpu-h8300.c (bfd_h8300_pad_address): New function.
1568         * coff-h8300.c (h8300_reloc16_estimate): Use it to canonicalize
1569         addresses before checking whether they can be relaxed.
1570         (h8300_reloc16_extra_cases): Likewise for the R_MOVL2 sanity check.
1571         Don't complain about overflows in general 8-bit relocations.
1572         * elf32-h8300.c (elf32_h8_relax_section): Use bfd_h8300_pad_address.
1573         Fix handling of R_H8_DIR24A8.
1574
1575 2003-07-11  Richard Sandiford  <rsandifo@redhat.com>
1576
1577         * elf32-h8300.c: Convert function prototypes and definitions
1578         to C90 syntax.
1579         * coff-h8300.c: Likewise.
1580         * cpu-h8300.c: Likewise.
1581
1582 2003-07-11  Alan Modra  <amodra@bigpond.net.au>
1583
1584         * po/SRC-POTFILES.in: Regenerate.
1585         * po/bfd.pot: Likewise.
1586
1587 2003-07-10  Bob Wilson  <bob.wilson@acm.org>
1588
1589         * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Create new
1590         .got.loc section.  Do not set SEC_ALLOC or SEC_LOAD flags for the
1591         .xt.lit.plt section.
1592         (elf_xtensa_size_dynamic_sections): Set size of the .got.loc section
1593         and allocate memory for it.
1594         (elf_xtensa_combine_prop_entries): Copy contents of .xt.lit output
1595         section to the .got.loc section.
1596         (elf_xtensa_finish_dynamic_sections): Fix up call to
1597         elf_xtensa_combine_prop_entries and set DT_XTENSA_GOT_LOC_OFF to
1598         the address of .got.loc.
1599         (relax_property_section): Shrink .got.loc to match changes in any
1600         literal table section.
1601         (xtensa_is_property_section): Change to match
1602         xtensa_get_property_section_name.
1603         (xtensa_is_littable_section): New.
1604
1605 2003-07-10  H.J. Lu <hongjiu.lu@intel.com>
1606
1607         * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1 instead of
1608         -1LL.
1609
1610 2003-07-10  Alan Modra  <amodra@bigpond.net.au>
1611
1612         * Makefile.am (BFD32_BACKENDS): Add elf32-am33lin.lo.
1613         (BFD32_BACKENDS_CFILES): elf32-am33lin.c not elf32-am33lin.lo.
1614         Run "make dep-am".
1615         * Makefile.in: Regenerate.
1616
1617 2003-07-10  Alexandre Oliva  <aoliva@redhat.com>
1618
1619         2001-09-12  Alexandre Oliva  <aoliva@redhat.com>
1620         * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
1621         (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
1622         2001-06-02  Nick Clifton  <nickc@cambridge.redhat.com>
1623         * elf32-am33lin.c: Rename global functions.
1624         2001-05-09  Alexandre Oliva  <aoliva@redhat.com>
1625         * config.bfd (am33_2.0, am33_2.0-*-linux*): Added.
1626         * configure.in (bfd_elf32_am33lin_vec): Added.
1627         * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo.
1628         (elf32-am33lin.lo): List dependencies.
1629         * aclocal.m4, configure, Makefile.in: Rebuilt.
1630         * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME,
1631         ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if
1632         ELF_ARCH was not defined before.
1633         (elf_symbol_leading_char): Define if not defined.
1634         * elf32-am33lin.c: Override the definitions above.
1635         * targets.c (bfd_elf32_am33lin_vec): New.
1636
1637 2003-07-09  Alexandre Oliva  <aoliva@redhat.com>
1638
1639         2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
1640         * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Initialize
1641         pcrel_relocs_copied.
1642         2001-12-13  Alexandre Oliva  <aoliva@redhat.com>
1643         * elf-m10300.c (ELF_DYNAMIC_INTERPRETER): Renamed from
1644         ld-linux.so.2 to ld.so.1.
1645         2001-10-10  Alexandre Oliva  <aoliva@redhat.com>
1646         * elf-m10300.c (elf_mn10300_sizeof_plt0): New macro.
1647         (_bfd_mn10300_elf_adjust_dynamic_symbol): Use it.
1648         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
1649         * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Allocate
1650         .rela.* section contents with bfd_zalloc.
1651         2001-09-25  Alexandre Oliva  <aoliva@redhat.com>
1652         * elf-m10300.c: Added declarations for functions missing them.
1653         Merge some shared-library changes from the i386 back-end.  Use
1654         R_MN10300_RELATIVE instead of R_MN10300_PCREL32 and
1655         R_MN10300_GLOB_DAT instead of R_MN10300_32 where appropriate.
1656         (struct elf32_mn10300_link_hash_entry): Remove duplicates of
1657         members of elf_link_hash_entry.  Adjusted references.
1658         (mn10300_elf_final_link_relocate): dynobj was already loaded
1659         into a local variable, use it.
1660         2001-09-21  Nick Clifton  <nickc@cambridge.redhat.com>
1661         * elf-m10300.c: Add missing function prototypes.
1662         2001-08-24  Alexandre Oliva  <aoliva@redhat.com>
1663         * elf-m10300.c (mn10300_elf_relocate_section): Don't compute
1664         relocation for dynamic relocations.
1665         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
1666         * reloc.c (BFD_RELOC_MN10300_GOTOFF24): New.
1667         * elf-m10300.c: Introduce GOTPC16, GOTOFF24, GOTOFF16 and
1668         PLT16, and rename GOTPC to GOTPC32 and GOTOFF to GOTOFF32.
1669         (_bfd_mn10300_elf_create_dynamic_sections): Move creation ot PLT...
1670         (_bfd_mn10300_elf_create_got_section): ... here, so that its
1671         adress is already known at the time we compute relaxations.
1672         (mn10300_elf_relax_section): Relax GOTPC32, GOTOFF32, GOT32
1673         and PLT32 to narrower relocations.
1674         * libbfd.h, bfd-in2.h: Rebuilt.
1675         2001-04-12  Alexandre Oliva  <aoliva@redhat.com>
1676         * reloc.c (BFD_RELOC_MN10300_GOT32, BFD_RELOC_MN10300_GOT24,
1677         BFD_RELOC_MN10300_GOT16, BFD_RELOC_MN10300_COPY,
1678         BFD_RELOC_MN10300_GLOB_DAT, BFD_RELOC_MN10300_JMP_SLOT,
1679         BFD_RELOC_MN10300_RELATIVE): New relocs.
1680         * libbfd.h, bfd-in2.h: Rebuilt.
1681         * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): New.
1682         (struct elf32_mn10300_link_hash_entry): Added DSO-related
1683         fields.
1684         (elf_mn10300_howto): Defined new relocation types.
1685         (mn10300_reloc_map): Map them.
1686         (_bfd_mn10300_elf_create_got_section): New fn.
1687         (mn10300_elf_check_relocs): Handle PIC relocs.
1688         (mn10300_elf_final_link_relocate): Likewise.
1689         (mn10300_elf_relocate_section): Handle DSOs.
1690         (PLT0_ENTRY_SIZE, PLT_ENTRY_SIZE, PIC_PLT_ENTRY_SIZE): New macros.
1691         (elf_mn10300_plt0_entry, elf_mn10300_plt_entry,
1692         elf_mn10300_pic_plt_entry): New.
1693         (elf_mn10300_sizeof_plt, elf_mn10300_plt_plt0_offset,
1694         elf_mn10300_plt0_linker_offset, elf_mn10300_plt0_gotid_offset,
1695         elf_mn10300_plt_temp_offset, elf_mn10300_plt_symbol_offset,
1696         elf_mn10300_plt_reloc_offset: New macros.
1697         (ELF_DYNAMIC_INTERPRETER): Likewise.
1698         (_bfd_mn10300_elf_create_dynamic_sections): New function.
1699         (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise.
1700         (_bfd_mn10300_elf_discard_copies): Likewise.
1701         (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
1702         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
1703         (_bfd_mn10300_elf_finish_dynamic_sections): Likewise.
1704         (elf_backend_can_gc_sections,
1705         elf_backend_create_dynamic_sections,
1706         elf_backend_adjust_dynamic_sections,
1707         elf_backend_size_dynamic_sections,
1708         elf_backend_finish_dynamic_symbol,
1709         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
1710         elf_backend_plt_readonly, elf_backend_want_plt_sym,
1711         elf_backend_got_header_size, elf_backend_plt_header_size): New
1712         macros.
1713
1714 2003-07-09  Alexandre Oliva  <aoliva@redhat.com>
1715
1716         2001-05-06  Alexandre Oliva  <aoliva@redhat.com>
1717         * elf-m10300.c (compute_function_info): Account for AM33
1718         registers in `movm' when computing stack space for `call' when
1719         linking for AM33/2.0 link.
1720         2000-04-01  Alexandre Oliva  <aoliva@cygnus.com>
1721         * archures.c (bfd_mach_am33_2): Renamed from bfd_mach_am332.
1722         * bfd-in2.h: Rebuilt.
1723         * cpu-m10300.c (bfd_am33_2_arch): Renamed from bfd_am332_arch.
1724         * elf-m10300.c: Updated.
1725         2000-03-31  Alexandre Oliva  <aoliva@cygnus.com>
1726         * archures.c (bfd_mach_am332): Defined.
1727         * bfd-in2.h: Rebuilt.
1728         * cpu-m10300.c (bfd_am332_arch): Defined.
1729         (bfd_am33_arch): Chained with am33-2.
1730         * elf-m10300.c (elf_mn10300_mach): Handle am332.
1731         (_bfd_mn10300_elf_final_write_processing): Likewise.
1732
1733 2003-07-09  H.J. Lu <hongjiu.lu@intel.com>
1734
1735         * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1LL.
1736
1737 2003-07-10  Alan Modra  <amodra@bigpond.net.au>
1738
1739         * elf64-ppc.c (bfd_elf64_mkobject): Define.
1740         (struct ppc64_elf_obj_tdata): New.
1741         (ppc64_elf_tdata, ppc64_tlsld_got): Define.
1742         (ppc64_elf_mkobject): New function.
1743         (struct got_entry): Add "owner".  Move "tls_type".
1744         (struct ppc_link_hash_table): Delete "relgot", "tlsld_got".
1745         (ppc64_elf_init_stub_bfd): New function.
1746         (create_got_section): Create header .got in dynobj.  Create .got
1747         and .rela.got in each bfd.  Stash pointers in ppc64_elf_obj_tdata.
1748         (ppc64_elf_create_dynamic_sections): Don't call create_got_section.
1749         Look for dynobj .got, and test it.
1750         (ppc64_elf_copy_indirect_symbol): Adjust for changed got.
1751         (update_local_sym_info): Likewise.
1752         (ppc64_elf_check_relocs): Likewise.
1753         (ppc64_elf_gc_sweep_hook): Likewise.
1754         (ppc64_elf_tls_optimize): Likewise.
1755         (allocate_dynrelocs): Likewise.
1756         (ppc64_elf_size_dynamic_sections): Likewise.
1757         (ppc64_elf_relocate_section): Likewise.
1758         (ppc64_elf_next_toc_section): Update comment.
1759         (toc_adjusting_stub_needed): Remove unneeded cast.
1760         (ppc64_elf_build_stubs): Check for stub sections in stub bfd by
1761         testing section flags.
1762         (ppc64_elf_build_stubs): Likewise.
1763         (ppc64_elf_size_stubs): Likewise.  Remove stub_bfd param.
1764         (ppc64_elf_finish_dynamic_sections): Write out got sections.
1765         (func_desc_adjust): Copy over dynamic info for undef weaks.
1766         * elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare.
1767         (ppc64_elf_size_stubs): Update prototype.
1768         * elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn
1769         input sections rather than scanning dynobj.
1770
1771 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1772
1773         * elfxx-mips.c (mips_elf_link_hash_entry): Remove min_dyn_reloc_index.
1774         (bfd_mips_elf_swap_msym_in, bfd_mips_elf_swap_msym_out): Delete.
1775         (mips_elf_create_msym_section): Delete.
1776         (mips_elf_create_dynamic_relocation): Don't set min_dyn_reloc_index.
1777         (_bfd_mips_elf_copy_indirect_symbol): Likewise.
1778         (_bfd_mips_elf_create_dynamic_sections): Don't create .msym.
1779         (_bfd_mips_elf_size_dynamic_sections): Don't calculate its size.
1780         (_bfd_mips_elf_size_dynamic_sections): Don't add DT_MIPS_MSYM.
1781         (_bfd_mips_elf_finish_dynamic_symbol): Don't add symbols to .msym.
1782         (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1783
1784 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1785
1786         * elfxx-mips.c (mips_elf_irix6_finish_dynamic_symbol): Make the
1787         symbols protected.
1788
1789 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1790
1791         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Fix handling
1792         of relocations whose offset is -2.
1793
1794 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1795
1796         * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat
1797         forced-local symbols like other locals.  Don't create relocations
1798         against STN_UNDEF in irix objects.
1799
1800 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1801
1802         * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI-
1803         compatible objects, add the values of defined external symbols
1804         to the addend.
1805
1806 2003-07-09  Richard Sandiford  <rsandifo@redhat.com>
1807
1808         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Always
1809         initialize a GOT entry to the symbol's st_value.
1810
1811 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
1812
1813         * elf-bfd.h (struct elf_obj_tdata): Move linker_section_pointers..
1814         * elf32-ppc.c (struct ppc_elf_obj_tdata): ..to here.  New.
1815         (ppc_elf_tdata): Define.
1816         (elf_local_ptr_offsets): Adjust.
1817         (ppc_elf_mkobject): New function.
1818         (bfd_elf32_mkobject): Define.
1819
1820         * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format.
1821         * elfcore.h (elf_core_file_p): Likewise.
1822         * section.c (bfd_section_init): Remove prototype.
1823
1824 2003-07-08  Alan Modra  <amodra@bigpond.net.au>
1825
1826         * elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer
1827         field.
1828         (enum elf_linker_section_enum): Delete.
1829         (struct elf_linker_section): Delete.
1830         (struct elf_linker_section_pointers): Delete.
1831         (struct elf_obj_tdata): Remove #if 0 chunk.  Remove linker_section.
1832         Make linker_section_pointers a void**.
1833         (elf_local_ptr_offsets, elf_linker_section): Don't define.
1834         * elf32-ppc.c (enum elf_linker_section_enum): New, cut-down version
1835         of old item in elf-bfd.h.
1836         (struct elf_linker_section): Likewise.
1837         (struct elf_linker_section_pointers): Likewise.
1838         (elf_local_ptr_offsets): Define.
1839         (struct ppc_elf_link_hash_entry): Add linker_section_pointer.
1840         (ppc_elf_link_hash_newfunc): Init it.
1841         (struct ppc_elf_link_hash_table): Add sbss.
1842         (ppc_elf_link_hash_table_create): zmalloc rather than clearing
1843         individual fields.
1844         (elf_create_linker_section): Fold into..
1845         (ppc_elf_create_linker_section): ..here.  Remove hole_size code.
1846         Make rela section here if shared.
1847         (elf_find_pointer_linker_section): Pass lsect rather than enum.
1848         (elf_create_pointer_linker_section): Adjust.  zalloc rather than
1849         clearing in a loop.
1850         (elf_finish_pointer_linker_section): Adjust.  Don't make rela
1851         section here.
1852         (ppc_elf_check_relocs): Adjust.
1853         (ppc_elf_add_symbol_hook): Tighten hash creator test.  Remove code
1854         creating .sbss by hand.
1855         * elf.c (_bfd_elf_link_hash_newfunc): Adjust.
1856
1857 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1858
1859         * elf32-s390.c (elf_howto_table): Change R_390_GOT12 to
1860         complain_overflow_bitfield.
1861         * elf64-s390.c (elf_howto_table): Change R_390_GOT12 to
1862         complain_overflow_bitfield.
1863
1864 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1865
1866         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Return
1867         true even if -pie.
1868
1869 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
1870
1871         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec.
1872         (elfNN_ia64_dynamic_symbol_p): Change info->shared into
1873         !info->executable.
1874         (get_fptr): For -pie create .opd as writable section and create
1875         .rela.opd as well.
1876         (elfNN_ia64_check_relocs): Change info->shared into
1877         !info->executable.
1878         (allocate_fptr): Likewise.
1879         (allocate_dynrel_entries): Account for a relative reloc for -pie
1880         @fptr().  Don't account for a relative reloc if -pie want_ltoff_fptr
1881         for undefweak symbol.  Account for an IPLT reloc in .rela.opd
1882         section if -pie.
1883         (set_got_entry): Don't create a relative reloc if -pie
1884         want_ltoff_fptr for undefweak symbol.
1885         (set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie.
1886         (elfNN_ia64_relocate_section): Emit a relative reloc for -pie
1887         @fptr().
1888
1889         * elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol
1890         even if -pie.
1891         * elf32-i386.c (elf_i386_relocate_section): Likewise.
1892         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1893         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1894         * elf64-s390.c (elf_s390_relocate_section): Likewise.
1895         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1896         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1897         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1898         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1899         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1900
1901 2003-07-04  Paul Clarke <paulc@senet.com.au>
1902
1903         * elf32-h8300.c (R_H8_DIR32A16): Fix name field.
1904         (elf32_h8_relax_section) <R_H8_DIR16A8>: Adjust position of relocation.
1905         <R_H8_DIR32A16>: Fix type of relocation.
1906
1907 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1908
1909         * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic
1910         sections were created already.  Remove unnecessary tests of
1911         the previous change.
1912
1913 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1914
1915         * elf32-sh.c (sh_elf_create_dynamic_sections): Don't call
1916         bfd_make_section for existing sections.
1917
1918 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
1919
1920         * elf32-sparc.c (elf32_sparc_check_relocs): Don't call
1921         create_got_section if we already have done so.
1922         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
1923         (sh_elf_check_relocs): Likewise.
1924         (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var.  Use
1925         htab->root.dynobj instead.
1926         (sh_elf_check_relocs): Likewise.
1927         (sh_elf_finish_dynamic_sections): Likewise.
1928
1929         * section.c (bfd_make_section): Return NULL for existing section.
1930
1931 2003-07-04  Alan Modra  <amodra@bigpond.net.au>
1932
1933         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Don't call
1934         ppc_elf_create_got if we've already done so.
1935
1936         * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare.
1937         (_bfd_elf_find_pointer_linker_section): Likewise.
1938         (bfd_elf32_create_pointer_linker_section): Likewise.
1939         (bfd_elf32_finish_pointer_linker_section): Likewise.
1940         (bfd_elf64_create_pointer_linker_section): Likewise.
1941         (bfd_elf64_finish_pointer_linker_section): Likewise.
1942         (_bfd_elf_make_linker_section_rela): Likewise.
1943         * elfcode.h (elf_create_pointer_linker_section): Don't define.
1944         (elf_finish_pointer_linker_section): Likewise.
1945         * elflink.c (_bfd_elf_make_linker_section_rela): Delete.
1946         (_bfd_elf_create_linker_section): Move this function..
1947         (_bfd_elf_find_pointer_linker_section): ..and this..
1948         * elflink.h (elf_create_pointer_linker_section): ..and this..
1949         (elf_finish_pointer_linker_section): ..and this..
1950         * elf32-ppc.c: ..to here, renaming to the following, and adjusting
1951         calls.
1952         (elf_create_linker_section): Convert to C90, tidy.
1953         (elf_find_pointer_linker_section): Likewise.
1954         (elf_create_pointer_linker_section): Likewise.
1955         (elf_finish_pointer_linker_section): Likewise.
1956         * elf32-i370.c: Delete #if 0 code.
1957
1958 2003-07-02  Alan Modra  <amodra@bigpond.net.au>
1959
1960         * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't allow _savef* and
1961         _restf* to be satisfied by shared libs, and always force them local.
1962         (toc_adjusting_stub_needed): Avoid scanning linker created sections.
1963         Correct test for "bl".
1964         (ppc64_elf_relocate_section <R_PPC64_TLS>): Correct test for
1965         primary opcode 31.
1966
1967 2003-07-01  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1968
1969         * elf32-s390.c (s390_elf_ldisp_reloc): New prototype.
1970         (s390_tls_reloc): New function.
1971         (elf_howto_table): Add long displacement relocations R_390_20,
1972         R_390_GOT20, R_390_GOTPLT20 and R_390_TLS_GOTIE20.
1973         (elf_s390_reloc_type_lookup): Likewise.
1974         (elf_s390_check_relocs): Likewise.
1975         (elf_s390_gc_sweep_hook): Likewise.
1976         (elf_s390_relocate_section): Likewise.
1977         * elf64-s390.c: Same changes as for elf32-s390.c.
1978         * reloc.c: Add long displacement relocations BFD_RELOC_390_20,
1979         BFD_RELOC_390_GOT20, BFD_RELOC_390_GOTPLT20 and
1980         BFD_RELOC_390_TLS_GOTIE20.
1981         * bfd-in2.h: Regenerate.
1982         * libbfd.h: Likewise.
1983
1984 2003-06-30  Alan Modra  <amodra@bigpond.net.au>
1985
1986         * cpu-ia64-opc.c (ext_imms_scaled): Don't sign extend using shifts.
1987         (ins_imms, ins_immsm1u4): Likewise.  Warning fix.
1988
1989 2003-06-29  Alan Modra  <amodra@bigpond.net.au>
1990
1991         * archive.c: Convert to C90, remove unnecessary prototypes and casts.
1992         Replace PTR with void *.  Formatting.
1993         * archive64.c: Likewise.
1994         * archures.c: Likewise.
1995         * bfd-in.h: Likewise.
1996         * bfd.c: Likewise.
1997         * bfdio.c: Likewise.
1998         * bfdwin.c: Likewise.
1999         * cache.c: Likewise.
2000         * corefile.c: Likewise.
2001         * format.c: Likewise.
2002         * init.c: Likewise.
2003         * libbfd-in.h: Likewise.
2004         * libbfd.c: Likewise.
2005         * linker.c: Likewise.
2006         * opncls.c: Likewise.
2007         * reloc.c: Likewise.
2008         * section.c: Likewise.
2009         * simple.c: Likewise.
2010         * syms.c: Likewise.
2011         * targets.c: Likewise.
2012         * bfd-in2.h: Regenerate.
2013         * libbfd.h: Regenerate.
2014
2015         * ecoff.c (bfd_debug_section): Add missing kept_section initialization.
2016         * libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined.
2017         * libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify.
2018         (bfd_getb64): Rewrite without parens.
2019         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
2020         * cache.c (insert, snip): Remove INLINE.
2021         * linker.c (bfd_link_add_undef): Likewise.
2022
2023 2003-06-29  Andreas Jaeger  <aj@suse.de>
2024
2025         * elf64-x86-64.c: Convert to ISO C90 prototypes, remove
2026         unnecessary prototypes.  Replace PTR with void *.
2027         (elf64_x86_64_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to
2028         trim plt entries.  Move undefweak non-default visibility test ...
2029         (allocate_dynrelocs): ... from here.
2030         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2031         Change all callers.
2032         (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.  Use
2033         SYMBOL_REFERENCES_LOCAL for dynreloc check.
2034         (elf64_x86_64_relocate_section): Use SYMBOL_CALLS_LOCAL for
2035         dynreloc and .got relocs.
2036         (elf64_x86_64_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL
2037         for .got relocs.
2038
2039 2003-06-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2040
2041         * elfxx-mips.c: Allow lazy binding for R_MIPS_JALR.
2042
2043 2003-06-27  Nick Clifton  <nickc@redhat.com>
2044
2045         * opncls.c (bfd_add_gnu_debuglink_section): Rename to
2046         bfd_add_gnu_debuglink_section and only create the section, do not
2047         fill in its contents.
2048         (bfd_fill_in_gnu_debuglink_section): New function.  Fill in the
2049         contents of a .gnu-debuglink section.
2050         * bfd-in2.h: Regenerate.
2051
2052 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2053
2054         * elfxx-mips.c: Revert .got alignment to 2**4.
2055
2056 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2057
2058         * elf32-mips.c: Fix addend for _gp_disp special symbol.
2059
2060 2003-06-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2061
2062         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default
2063         relocation header setup.
2064
2065 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
2066
2067         * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast.
2068         (ppc_elf_reloc_type_lookup): Modify comment.
2069         (ppc_elf_info_to_howto): Ditto.
2070         (ppc_elf_relocate_section): Ditto.
2071         (ppc_elf_check_relocs): Call ppc_elf_howto_init.
2072
2073 2003-06-25  Alan Modra  <amodra@bigpond.net.au>
2074
2075         * aout-ns32k.c: Correct spelling of "relocatable".
2076         * aoutx.h: Likewise.
2077         * bfd-in.h: Likewise.
2078         * bfd.c: Likewise.
2079         * bout.c: Likewise.
2080         * coff-a29k.c: Likewise.
2081         * coff-alpha.c: Likewise.
2082         * coff-arm.c: Likewise.
2083         * coff-i386.c: Likewise.
2084         * coff-i860.c: Likewise.
2085         * coff-i960.c: Likewise.
2086         * coff-m68k.c: Likewise.
2087         * coff-m88k.c: Likewise.
2088         * coff-mcore.c: Likewise.
2089         * coff-mips.c: Likewise.
2090         * coff-or32.c: Likewise.
2091         * coff-ppc.c: Likewise.
2092         * coff-rs6000.c: Likewise.
2093         * coff-sh.c: Likewise.
2094         * coff-tic80.c: Likewise.
2095         * coff64-rs6000.c: Likewise.
2096         * cofflink.c: Likewise.
2097         * cpu-ns32k.c: Likewise.
2098         * ecoff.c: Likewise.
2099         * ecofflink.c: Likewise.
2100         * elf-bfd.h: Likewise.
2101         * elf-eh-frame.c: Likewise.
2102         * elf-hppa.h: Likewise.
2103         * elf-m10200.c: Likewise.
2104         * elf-m10300.c: Likewise.
2105         * elf.c: Likewise.
2106         * elf32-arm.h: Likewise.
2107         * elf32-avr.c: Likewise.
2108         * elf32-cris.c: Likewise.
2109         * elf32-d10v.c: Likewise.
2110         * elf32-dlx.c: Likewise.
2111         * elf32-fr30.c: Likewise.
2112         * elf32-frv.c: Likewise.
2113         * elf32-h8300.c: Likewise.
2114         * elf32-hppa.c: Likewise.
2115         * elf32-i370.c: Likewise.
2116         * elf32-i386.c: Likewise.
2117         * elf32-i860.c: Likewise.
2118         * elf32-i960.c: Likewise.
2119         * elf32-ip2k.c: Likewise.
2120         * elf32-iq2000.c: Likewise.
2121         * elf32-m32r.c: Likewise.
2122         * elf32-m68hc11.c: Likewise.
2123         * elf32-m68hc1x.c: Likewise.
2124         * elf32-m68k.c: Likewise.
2125         * elf32-mcore.c: Likewise.
2126         * elf32-mips.c: Likewise.
2127         * elf32-msp430.c: Likewise.
2128         * elf32-openrisc.c: Likewise.
2129         * elf32-ppc.c: Likewise.
2130         * elf32-s390.c: Likewise.
2131         * elf32-sh.c: Likewise.
2132         * elf32-sh64.c: Likewise.
2133         * elf32-sparc.c: Likewise.
2134         * elf32-v850.c: Likewise.
2135         * elf32-vax.c: Likewise.
2136         * elf32-xstormy16.c: Likewise.
2137         * elf32-xtensa.c: Likewise.
2138         * elf64-alpha.c: Likewise.
2139         * elf64-hppa.c: Likewise.
2140         * elf64-mips.c: Likewise.
2141         * elf64-mmix.c: Likewise.
2142         * elf64-ppc.c: Likewise.
2143         * elf64-s390.c: Likewise.
2144         * elf64-sh64.c: Likewise.
2145         * elf64-sparc.c: Likewise.
2146         * elf64-x86-64.c: Likewise.
2147         * elfcode.h: Likewise.
2148         * elflink.h: Likewise.
2149         * elfn32-mips.c: Likewise.
2150         * elfxx-ia64.c: Likewise.
2151         * elfxx-mips.c: Likewise.
2152         * i386linux.c: Likewise.
2153         * ieee.c: Likewise.
2154         * libcoff-in.h: Likewise.
2155         * linker.c: Likewise.
2156         * m68klinux.c: Likewise.
2157         * pdp11.c: Likewise.
2158         * pe-mips.c: Likewise.
2159         * peXXigen.c: Likewise.
2160         * reloc.c: Likewise.
2161         * reloc16.c: Likewise.
2162         * sparclinux.c: Likewise.
2163         * sunos.c: Likewise.
2164         * syms.c: Likewise.
2165         * versados.c: Likewise.
2166         * vms.c: Likewise.
2167         * xcofflink.c: Likewise.
2168         * bfd-in2.h: Regenerate.
2169         * libcoff.h: Regenerate.
2170         * libbfd.h: Regenerate.
2171
2172 2003-06-24  Alan Modra  <amodra@bigpond.net.au>
2173
2174         * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against
2175         local sym errors.
2176
2177         * elf32-i386.c: Convert to C90 function definitions, remove unnecessary
2178         prototypes and casts.  Replace PTR with void *.  Formatting.
2179         * elf32-ppc.c: Likewise.  Break long strings too.
2180         (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type.
2181         (ppc_elf_unhandled_reloc): Internationalize error message.
2182         * elf32-ppc.h: Remove PARAMS.
2183
2184 2003-06-23  Mark Mitchell  <mark@codesourcery.com>
2185
2186         * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count
2187         APUinfo slots.
2188         (ppc_elf_final_write_processing): Likewise.
2189
2190 2003-06-23  H.J. Lu <hongjiu.lu@intel.com>
2191
2192         * elflink.h (elf_link_input_bfd): Check raw size when using
2193         kept_section to preserve debug information discarded by
2194         linkonce.
2195
2196 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
2197
2198         * elf64-ppc.c (struct ppc_link_hash_table): Add top_id.
2199         (ppc64_elf_setup_section_lists): Set it.
2200         (ppc64_elf_relocate_section): Check sym section id against top_id.
2201         (ppc_build_one_stub): Comment on top_id.
2202
2203 2003-06-20  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
2204
2205         * config.bfd: Add tic4x-*-rtems*.
2206
2207 2003-06-20  Alan Modra  <amodra@bigpond.net.au>
2208
2209         * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary
2210         prototypes and casts.  Replace PTR with void *.  Format copyright.
2211         Mention ABI links.
2212         (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt,
2213         sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt.
2214         (ppc_type_of_stub): Make r_type an enum.
2215         (ppc64_elf_size_stubs): Likewise.
2216         * elf64-ppc.h: Remove PARAMS macro.
2217
2218 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2219
2220         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of
2221         elf hash tab fields.
2222
2223         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype.
2224         (ppc64_elf_info_to_howto): Likewise.
2225         (ppc64_elf_build_stubs): Add "stats" param, and print statistics.
2226         * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype.
2227
2228 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2229
2230         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32
2231         reloc overflow on discarded eh_frame entries.
2232
2233 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
2234
2235         * elf64-ppc.c (toc_adjusting_stub_needed): New function.
2236         (ppc64_elf_next_input_section): Use it here to set has_gp_reloc.
2237         Return error condition.
2238         (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections
2239         that have has_gp_reloc set.
2240         (struct ppc_link_hash_table): Add stub_count.
2241         (ppc_build_one_stub): Increment it.
2242         (ppc64_elf_link_hash_table_create): zmalloc rather than clearing
2243         individual fields.
2244         * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype.
2245
2246 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
2247
2248         * elflink.h (elf_gc_record_vtentry): Revert last change.  Correct
2249         size calculation from addend.  Round size up.
2250
2251 2003-06-18  Hans-Peter Nilsson  <hp@axis.com>
2252
2253         * elf32-cris.c (cris_elf_relocate_section) <case
2254         R_CRIS_32_GOTREL>: When linking a program, don't complain about a
2255         symbol from a normal object or an undefined weak symbol.
2256
2257 2003-06-18  Alan Modra  <amodra@bigpond.net.au>
2258
2259         * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on
2260         R_PPC64_TOC relocs.
2261
2262 2003-06-17  H.J. Lu <hongjiu.lu@intel.com>
2263
2264         * section.c (struct sec): Put back kept_section.
2265         (STD_SECTION): Put back kept_section initialization.
2266         * bfd-in2.h: Regenerate.
2267
2268         * elflink.h (elf_link_input_bfd): Also check discarded linkonce
2269         sections for relocateable output. Use kept_section to preserve
2270         debug information discarded by linkonce.
2271
2272 2003-06-17  Roland McGrath  <roland@redhat.com>
2273
2274         * elfxx-ia64.c (elfNN_ia64_relocate_section): Support
2275         segment-relative relocation between different segments.
2276
2277 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2278
2279         * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc
2280         optimizations earlier.
2281
2282         * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index.
2283         Restore previous input_list type.
2284         (ppc64_elf_link_hash_table_create): Undo last change.
2285         (ppc64_elf_setup_section_lists): Reinstate code setting up input lists
2286         per output section, but don't bother with bfd_abs_section marker.
2287         (ppc64_elf_next_input_section): Adjust for multiple input section
2288         lists.
2289         (group_sections): Likewise.
2290
2291 2003-06-17  Jakub Jelinek  <jakub@redhat.com>
2292
2293         * elf64-ppc.c (ppc64_elf_relocation_section): Ensure
2294         *r_offset == r_addend for RELATIVE relocs against .got.
2295
2296 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2297
2298         * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs.
2299
2300 2003-06-17  Nick Clifton  <nickc@redhat.com>
2301
2302         * elflink.h (elf_gc_record_vtentry): Allocate an extra element
2303         in the vtable_entries_used array to allow for the accessing
2304         the largest element.
2305
2306 2003-06-17  Alan Modra  <amodra@bigpond.net.au>
2307
2308         * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index.  Modify
2309         input_list.
2310         (ppc64_elf_link_hash_table_create): Init input_list here.
2311         (ppc64_elf_setup_section_lists): Remove code setting up input lists
2312         per output section.  Set toc_off for abs and other standard sections.
2313         (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc.
2314         (ppc64_elf_next_input_section): Adjust for single input section list.
2315         Don't set toc_curr from input bfds that haven't set elf_gp.
2316         (group_sections): Adjust for single input section list.
2317
2318         * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero.
2319
2320 2003-06-16  Alan Modra  <amodra@bigpond.net.au>
2321
2322         * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel
2323         tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a
2324         dtprel entry.  Ensure TLS_LD DTPMOD reloc has a zero addend.  Write
2325         got section for RELATIVE relocs.  Fix wrong comment.  Change condition
2326         under which dynamic relocs update the section contents.
2327
2328 2003-06-13  Robert Millan  <zeratul2@wanadoo.es>
2329
2330         * config.bfd: Add i386-netbsd-gnu target.
2331
2332 2003-06-12  Nick Clifton  <nickc@redhat.com>
2333
2334         * opncls.c (calc_crc32): Rename to
2335         bfd_calc_gnu_debuglink_crc32 and export.
2336         (GNU_DEBUGLINK): Define and use to replace occurrences of
2337         hard-coded ".gnu_debuglink" in the code.
2338         (get_debug_link_info): Prevent aborts by replacing call to
2339         xmalloc with a call to malloc.
2340         (find_separate_debug_file): Prevent aborts by replacing calls
2341         to xmalloc and xstrdup with calls to malloc and strdup.
2342         (bfd_add_gnu_debuglink): New function.  Add a .gnu_debuglink
2343         section to a bfd.
2344         * bfd-in2.h: Regenerate.
2345
2346 2003-06-12 Federico G. Schwindt <fgsch@lodoss.net>
2347
2348         * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]):
2349         New target (was i[3-7]86-*-openbsd* before).
2350         (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec.
2351         (vax-*-openbsd*): New target.
2352
2353 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2354
2355         * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options
2356         for n32, too.
2357         (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too.
2358         (mips_elf_rel_dyn_section): Use appropriate section alignment.
2359         (mips_elf_create_got_section): Likewise.
2360         (_bfd_mips_elf_create_dynamic_sections): Likewise.
2361
2362 2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2363
2364         * elf32-mips.c (mips_elf_generic_reloc): New Function.
2365         (elf_mips_howto_table_rel): Use it.
2366         (gprel32_with_gp): Move prototype.
2367         (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend.
2368         Use mips_elf_generic_reloc.
2369         (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend.
2370         Code cleanup.
2371         (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of
2372         zero addend.
2373         (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic
2374         as in the other *_gprel*_reloc functions.
2375         (gprel32_with_gp): Handle partial_inplace properly.
2376         (mips32_64bit_reloc): Use mips_elf_generic_reloc.
2377         (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend.
2378         Do addend handling directly instead of calling
2379         _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly.
2380         * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead
2381         of zero addend. Handle partial_inplace properly.
2382         (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero
2383         addend.
2384         (mips_elf64_gprel16_reloc): Likewise.
2385         (mips_elf64_literal_reloc): Likewise.
2386         (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment
2387         logic as in the other *_gprel*_reloc functions. Handle
2388         partial_inplace properly.
2389         (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero
2390         addend. Handle partial_inplace properly.
2391         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
2392         of calling _bfd_mips_elf_gprel16_with_gp.
2393         * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL.
2394         (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead
2395         of zero addend.
2396         (mips_elf_shift6_reloc): Handle partial_inplace properly.
2397         (mips16_gprel_reloc): Likewise. Do addend handling directly instead
2398         of calling _bfd_mips_elf_gprel16_with_gp.
2399         * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle
2400         partial_inplace properly. Fix wrong addend handling. Fix overflow
2401         check.
2402         (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and
2403         exported.
2404         (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend.
2405         (_bfd_mips_elf_relocate_section): Likewise.
2406         (mips_elf_create_dynamic_relocation): Update sec_info_type access.
2407         * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration.
2408         (_bfd_mips_elf_sign_extend): New prototype.
2409
2410 2003-06-11 Federico G. Schwindt <fgsch@lodoss.net>
2411
2412         * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]):
2413         New target (was sparc-*-openbsd* before).
2414         (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec.
2415
2416         * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo.
2417         * configure: Regenerate.
2418
2419 2003-06-11  H.J. Lu <hongjiu.lu@intel.com>
2420
2421         * po/Make-in (DESTDIR): New.
2422         (install-data-yes): Support $(DESTDIR).
2423         (uninstall): Likewise.
2424
2425 2003-06-11  Alan Modra  <amodra@bigpond.net.au>
2426
2427         * Makefile.am (config.status): Depend on version.h.
2428         Run "make dep-am".
2429         * Makefile.in: Regenerate.
2430         * po/SRC-POTFILES.in: Regenerate.
2431
2432 2003-06-10  Alan Modra  <amodra@bigpond.net.au>
2433             Gary Hade <garyhade@us.ibm.com>
2434
2435         * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq.
2436
2437 2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
2438
2439         * archures.c (bfd_mach_h8300sxn): New architecture.
2440         * bfd-in2.h: Regenerate.
2441         * cpu-h8300.c (h8300_scan): Check for 'sxn'.
2442         (h8300sxn_info_struct): New.
2443         (h8300sx_info_struct): Link to it.
2444         * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case.
2445         (elf32_h8_final_write_processing): Likewise.
2446
2447 2003-06-08  Alan Modra  <amodra@bigpond.net.au>
2448
2449         * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by
2450         elfxx-target.h so that we can use elf_backend_got_header_size.
2451         (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete.
2452         (GLINK_CALL_STUB_SIZE): Modify.  Define new glink call stub and
2453         associated macros.
2454         (ppc64_elf_howto_raw <GOT_TPREL16_DS, GOT_TPREL16_LO_DS>): Correct
2455         dst_mask.
2456         (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and
2457         ppc_stub_plt_branch_r2off.
2458         (struct ppc_stub_hash_entry): Reorganize.
2459         (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed,
2460         toc_curr, toc_off and emit_stub_syms.
2461         (ppc64_elf_link_hash_table_create): Init them.
2462         (ppc_stub_name): Correct string size.
2463         (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs.
2464         (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries
2465         used.
2466         (ppc_type_of_stub): Tweak root.type test.
2467         (build_plt_stub): Remove glink code.  Adjust for insn macro changes.
2468         (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and
2469         ppc_stub_plt_branch_r2off.
2470         (ppc_build_one_stub): Likewise.  Fix var shadowing.  Correct addis,addi
2471         range test.  Use toc_off to calculte r2 values.  Handle emit_stub_syms.
2472         (ppc64_elf_setup_section_lists): Remove htab creator flavour test.
2473         Initialize elf_gp and toc_curr.
2474         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions.
2475         (ppc64_elf_next_input_section): Set toc_off.
2476         (group_sections): Ensure groups have the same TOC.
2477         (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub.
2478         (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab.
2479         Build new glink stub.
2480         (ppc64_elf_relocate_section): Handle multiple TOCs.  Fix comments.
2481         (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK.
2482         * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype.
2483         (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare.
2484         * section.c (struct sec): Rename flag12 to has_gp_reloc.
2485         (STD_SECTION): Update.
2486         * ecoff.c (bfd_debug_section): Update comment.
2487         * bfd-in2.h: Regenerate.
2488
2489 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
2490
2491         * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference
2492         NULL function pointers.
2493
2494 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
2495
2496         * simple.c (bfd_simple_get_relocated_section_contents): Call
2497         _bfd_generic_link_add_symbols instead of bfd_link_add_symbols.
2498
2499 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
2500
2501         * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and
2502         ticoff1_bad_format_hook() functions. Removed the coff0 and coff1
2503         swaptables.
2504         * coff-tic4x.c: Ditto
2505         * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC
2506         and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro
2507         CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(),
2508         ticoff1_bad_format_hook() functions. Created the coff0 and coff1
2509         swap tables.
2510         * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros.
2511         * coff-a29k.c: Append COFF_SWAP_TABLE argument
2512         * coff-apollo.c: Ditto
2513         * coff-arm.c: Ditto
2514         * coff-h8300.c: Ditto
2515         * coff-h8500.c: Ditto
2516         * coff-i960.c: Ditto
2517         * coff-m68k.c: Ditto
2518         * coff-m88k.c: Ditto
2519         * coff-mcore.c: Ditto
2520         * coff-sh.c: Ditto
2521         * coff-sparc.c: Ditto
2522         * coff-tic80.c: Ditto
2523         * coff-we32k.c: Ditto
2524         * coff-z8k.c: Ditto
2525         * coff-w65.c: Ditto
2526
2527 2003-06-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
2528
2529         * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed
2530         initialization bug
2531
2532 2003-06-03  Jakub Jelinek  <jakub@redhat.com>
2533
2534         * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK.
2535         (bfd_section_from_phdr): Likewise.
2536         (map_sections_to_segments): Create PT_GNU_STACK segment header.
2537         (get_program_header_size): Count with PT_GNU_STACK.
2538         * elf-bfd.h (struct elf_obj_tdata): Add stack_flags.
2539         * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags.
2540
2541 2003-06-03  H.J. Lu <hongjiu.lu@intel.com>
2542
2543         * elflink.h (elf_link_input_bfd): Call linker error_handler
2544         for discarded definitions.
2545
2546 2003-06-03  Elias Athanasopoulos  <elathan@phys.uoa.gr>
2547
2548         * syms.c (decode_section_type): Return 'n' if section flags are
2549         SEC_HAS_CONTENTS && SEC_READONLY.
2550
2551 2003-06-03  Nick Clifton  <nickc@redhat.com>
2552
2553         * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to
2554         R_V850_ABS32.  Add entry for R_V850_REL32.
2555         (v850_elf_reloc_map): Likewise.
2556         (v850_elf_check_relocs): Likewise.
2557         (v850_elf_perform_relocation): Likewise.
2558         (v850_elf_final_link_relocate): Likewise.  Include computation
2559         to make R_V850_REl32 pc-relative.
2560
2561 2003-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2562
2563         * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section
2564         and DT_DEBUG dynamic tag even for position independent executables.
2565         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize.
2566
2567 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
2568
2569         * config.bfd: Move obsolete entries out of the range of the
2570         targmatch sed script.
2571
2572 2003-06-02  Daniel Jacobowitz  <drow@mvista.com>
2573
2574         * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete.
2575
2576 2003-05-31  Jakub Jelinek  <jakub@redhat.com>
2577
2578         * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192
2579         plt entries, not just 8191.
2580
2581 2003-05-30  Daniel Jacobowitz  <drow@mvista.com>
2582
2583         * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index.
2584         Reported by Ken Faiczak <kfaiczak@SANDVINE.com>.
2585
2586 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
2587             Jakub Jelinek  <jakub@redhat.com>
2588
2589         * elflink.h (elf_link_add_object_symbols): Use !info->executable
2590         instead of info->shared where appropriate.
2591         (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise.
2592         * elflink.c (_bfd_elf_create_got_section): Likewise.
2593         (_bfd_elf_link_create_dynamic_sections): Likewise.
2594         (_bfd_elf_link_assign_sym_version): Likewise.
2595         * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section
2596         and DT_DEBUG dynamic tag even for position independent executables.
2597         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
2598         * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise.
2599         * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise.
2600         * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise.
2601         * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise.
2602         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise.
2603         * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise.
2604         * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise.
2605         * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise.
2606
2607 2003-05-30  Kris Warkentin <kewarken@qnx.com>
2608
2609         * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
2610         signalled thread.
2611         (elfcore_grok_nto_gregs): Only make .reg section for the active thread.
2612
2613 2003-05-29  Nick Clifton  <nickc@redhat.com>
2614
2615         * pef.c: Include "safe-ctype.h" instead of <ctype.h>.
2616         Tidy up formatting.
2617         * Makefile.am: Add dependency on safe-ctype.h.
2618         * Makefile.in: Regenerate.
2619
2620 2003-05-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2621
2622         * elfxx-mips.c: Don't force symbols local unconditionally.
2623
2624 2003-05-28  Alan Modra  <amodra@bigpond.net.au>
2625
2626         * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus
2627         undefined_symbol call.
2628
2629 2003-05-27  Richard Sandiford  <rsandifo@redhat.com>
2630
2631         * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting.
2632         (mips_elf_link_hash_table): Likewise.
2633
2634 2003-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2635
2636         * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
2637         R_MIPS_GNU_REL16_S2 support.
2638         (bfd_elf64_bfd_reloc_type_lookup): Use it.
2639         (mips_elf64_rtype_to_howto): Use it.
2640         * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used
2641         R_MIPS_GNU_REL16_S2 support.
2642         (bfd_elf32_bfd_reloc_type_lookup): Use it.
2643         (mips_elf_n32_rtype_to_howto): Use it.
2644
2645 2003-05-21  Stuart F. Downing  <sdowning@fame.com>
2646
2647         * som.h: Define PA_2_0 before including a.out.h
2648
2649 2003-05-07  Eric Christopher  <echristo@redhat.com>
2650             Alexandre Oliva   <aoliva@redhat.com>
2651
2652         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
2653         pic tests, change to warning.
2654         (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.
2655
2656 2003-05-21  Marcus Comstedt  <marcus@mc.pp.se>
2657
2658         * config.bfd: Check for a target triplet of shl-...-netbsdelf as
2659         well as shle-...-netbsdelf.  Remove duplicate entry.
2660
2661 2003-05-21  Nick Clifton  <nickc@redhat.com>
2662
2663         * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask
2664         for X_STORMY16_REL_12 reloc.
2665
2666         * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check
2667         the type of the hash table in the bfd_link_info structure.
2668         (bfd_elf_get_runpath_list): Likewise.
2669
2670 2003-05-19  Roland McGrath  <roland@redhat.com>
2671
2672         * elf.c (bfd_elf_bfd_from_remote_memory): New function.
2673         * bfd-in.h: Declare it.
2674         * bfd-in2.h: Regenerated.
2675         * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
2676         * elf-bfd.h (struct elf_backend_data): New function pointer member
2677         elf_backend_bfd_from_remote_memory.
2678         (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
2679         Declare them.
2680         * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
2681         (elfNN_bed): Add that to the initializer.
2682
2683 2003-05-15  Roland McGrath  <roland@redhat.com>
2684
2685         * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section.
2686
2687 2003-05-20  Jakub Jelinek  <jakub@redhat.com>
2688
2689         * elflink.h (elf_link_output_extsym): Only issue error about !=
2690         STV_DEFAULT symbols if they are bfd_link_hash_undefined.
2691
2692 2003-05-20  H.J. Lu <hongjiu.lu@intel.com>
2693
2694         * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF
2695         when removing the old definition for symbols with non-default
2696         visibility.
2697
2698 2003-05-18  Jason Eckhardt  <jle@rice.edu>
2699
2700         * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation.
2701
2702 2003-05-17  Andreas Schwab  <schwab@suse.de>
2703
2704         * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in
2705         elf_section_data during processing of pc-relative and absolute
2706         relocations.
2707         (elf_m68k_relocate_section): Use the cached reloc section instead
2708         of computing it again.  Fix handling of visibility.  Don't modify
2709         addend when copying over a relocation into the output.
2710
2711 2003-05-17  Alan Modra  <amodra@bigpond.net.au>
2712
2713         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
2714         to trim plt entries.  Move undefweak non-default visibility test..
2715         (allocate_dynrelocs): ..from here.
2716         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test
2717         dynamic_sections_created here.  Update comment.  Move undefweak
2718         non-default visibility test..
2719         (allocate_dynrelocs): ..from here.  Fix comment.
2720         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
2721         to trim plt entries.  Move undefweak non-default visibility test..
2722         (allocate_dynrelocs): ..from here.  Fix comment.
2723         * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with
2724         STV_DEFAULT rather than comparing with zero.
2725         * elflink.c (_bfd_elf_merge_symbol): Likewise.
2726         (_bfd_elf_fix_symbol_flags): Likewise.  Format comment.
2727
2728 2003-05-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2729
2730         * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
2731         pointers.
2732         (_bfd_set_gp_value): Likewise.
2733
2734 2003-05-16  Michael Snyder  <msnyder@redhat.com>
2735         From Bernd Schmidt  <bernds@redhat.com>
2736         * archures.c (bfd_mach_h8300sx): New.
2737         * bfd-in2.h: Regenerate.
2738         * cpu-h8300.c (h8300_scan)): Add support for h8300sx.
2739         (h8300sx_info_struct): New.
2740         (h8300s_info_struct): Link to it.
2741         * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx.
2742         (elf32_h8_final_write_processing): Likewise.
2743         (elf32_h8_relax_section): Likewise.
2744
2745 2003-05-16  Kelley Cook  <kelleycook@wideopenwest.com>
2746
2747         * config.bfd: Accept i[3-7]86 variants.
2748         * configure.host: Likewise.
2749         * configure.in: Likewise.
2750         * configure: Regenerate.
2751
2752 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
2753
2754         * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
2755         symbol.
2756
2757 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
2758
2759         * elflink.h (elf_link_check_versioned_symbol): Also allow
2760         the base version.
2761
2762 2003-05-15  Alan Modra  <amodra@bigpond.net.au>
2763             H.J. Lu <hongjiu.lu@intel.com>
2764
2765         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
2766         (elf_i386_relocate_section): Likewise.
2767         * elf32-ppc.c (allocate_dynrelocs): Likewise.
2768         (ppc_elf_relocate_section): Likewise.
2769         * elf64-ppc.c (allocate_dynrelocs): Likewise.
2770         (ppc64_elf_relocate_section): Likewise.
2771
2772 2003-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
2773
2774         * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case.
2775
2776 2003-05-13  Stephane Carrez  <stcarrez@nerim.fr>
2777
2778         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for
2779         processor capability, allow merge of HC12 and HCS12 in some cases.
2780         (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc.
2781         * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct.
2782         (bfd_m68hc12_arch): Link it.
2783         (scan_mach): New function.
2784
2785 2003-05-13  Andrew Haley  <aph@redhat.com>
2786
2787         * elf.c (bfd_elf_hash): Mask lower 32 bits of hash.
2788
2789 2003-05-13  Alan Modra  <amodra@bigpond.net.au>
2790             H.J. Lu  <hongjiu.lu@intel.com>
2791
2792         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from
2793         elf32-ppc.c.  Add ELF_LINK_FORCED_LOCAL check.
2794         * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete.
2795         (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check.
2796         (ppc_elf_relocate_section): Likewise.
2797         * elf64-ppc.c (allocate_dynrelocs): Likewise.
2798         (ppc64_elf_relocate_section): Likewise.  Use for .got relocs too.
2799         (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt
2800         relocs need no other types.
2801         * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for
2802         dynreloc check.
2803         (elf_i386_relocate_section): Likewise.  Use for .got relocs too.
2804         (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for
2805         .got relocs.
2806
2807 2003-05-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2808
2809         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols,
2810         copy ELF_LINK_NON_GOT_REF from weakdef.
2811         (allocate_dynrelocs): For undef weak syms with non-default
2812         visibility, a) don't allocate plt entries, b) don't allocate
2813         .got relocs, c) discard dyn rel space
2814         (sh_elf_relocate_section): d) don't generate .got relocs, e)
2815         don't generate dynamic relocs.
2816         (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF
2817         for weakdefs when symbol already adjusted.
2818
2819 2003-05-12  Nick Clifton  <nickc@redhat.com>
2820
2821         * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield'
2822         overflow detection for R_XSTORMY16_16 reloc.
2823
2824 2003-05-12  Paul Clarke  <paulc@senet.com.au>
2825
2826         * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc.
2827
2828 2003-05-11  Jason Eckhardt  <jle@rice.edu>
2829
2830         * elf32-i860.c (elf32_i860_relocate_highadj): Properly
2831         adjust upper bits.
2832         (elf32_i860_relocate_splitn): Obtain upper 5 bits from the
2833         proper place.
2834         (elf32_i860_relocate_pc16): Obtain upper 5 bits from the
2835         proper place.
2836
2837 2003-05-11  Andreas Schwab  <schwab@suse.de>
2838
2839         * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly
2840         complicated tests for unresolvable relocs with a simple direct
2841         scheme using "unresolved_reloc" var.  Report some detail on
2842         bfd_reloc_outofrange and similar errors.
2843
2844 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2845
2846         * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):
2847         Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call.
2848         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2849         * elf64-s390.c: Likewise.
2850
2851 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2852
2853         * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one.
2854         (elf_s390_adjust_dynamic_symbol): For weak symbols, copy
2855         ELF_LINK_NON_GOT_REF from weakdef.
2856         (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has
2857         already been adjusted before treating it specially.
2858         * el64-s390.c: Likwise.
2859
2860 2003-05-09  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2861
2862         * elf32-s390.c (allocate_dynrelocs): For undef weak syms with
2863         non-default visibility, a) don't make them dynamic, b) discard
2864         space for dynamic relocs.
2865         (elf_s390_relocate_section): Initialize the GOT entries and skip
2866         R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined
2867         symbols with non-default visibility.
2868         * elf64-s390.c: Likewise.
2869
2870 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
2871
2872         * cpu-arm.c (arm_check_note): Warning fix.
2873         * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes.  Arrange
2874         to keep relocs if edited.
2875         (iq2000_elf_print_private_bfd_data): Return TRUE.
2876         * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
2877         ELF64_R_SYM.
2878         (elfNN_ia64_relax_ldxmov): Warning fix.
2879         * xtensa-isa.c (xtensa_add_isa): Warning fix.
2880         * xtensa-modules.c (get_num_opcodes): Warning fix.
2881
2882 2003-05-09  Andrey Petrov <petrov@netbsd.org>
2883
2884         * elf.c (elf_fake_sections): Use correct cast for sh_name.
2885
2886 2003-05-09  Alan Modra  <amodra@bigpond.net.au>
2887
2888         * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from
2889         elflink.h.  Replace LOG_FILE_ALIGN with bed->s->log_file_align.
2890         (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align.
2891         (bfd_elf_record_link_assignment): Move from elflink.h.
2892         (_bfd_elf_merge_symbol): Likewise.
2893         (_bfd_elf_add_default_symbol): Likewise.
2894         (_bfd_elf_export_symbol): Likewise.
2895         (_bfd_elf_link_find_version_dependencies): Likewise.
2896         (_bfd_elf_link_assign_sym_version): Likewise.
2897         (_bfd_elf_link_read_relocs): Likewise.
2898         (_bfd_elf_link_size_reloc_section): Likewise.
2899         (_bfd_elf_fix_symbol_flags): Likewise.
2900         (_bfd_elf_adjust_dynamic_symbol): Likewise.
2901         (_bfd_elf_link_sec_merge_syms): Likewise.
2902         (elf_link_read_relocs_from_section): Likewise.  Use bed->s->sizeof_rel
2903         and bed->s->sizeof_rela.
2904         (_bfd_elf_link_output_relocs): Likewise.
2905         * elf-bfd.h (struct elf_size_info): Rename file_align to
2906         log_file_align.
2907         (struct elf_info_failed): Move from elflink.h.
2908         (struct elf_assign_sym_version_info): Likewise.
2909         (struct elf_find_verdep_info): Likewise.
2910         (_bfd_elf_create_dynamic_sections): Delete duplicate declaration.
2911         (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol,
2912         _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies,
2913         _bfd_elf_link_assign_sym_version,
2914         _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs,
2915         _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs,
2916         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
2917         _bfd_elf_link_sec_merge_syms): Declare.
2918         (bfd_elf32_link_create_dynamic_sections): Don't declare.
2919         (_bfd_elf32_link_read_relocs): Likewise.
2920         (bfd_elf64_link_create_dynamic_sections): Likewise.
2921         (_bfd_elf64_link_read_relocs): Likewise.
2922         * elflink.h: Move lots o' stuff elsewhere.
2923         * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare.
2924         (bfd_elf64_record_link_assignment): Likewise.
2925         (bfd_elf_record_link_assignment): Declare.
2926         * bfd-in2.h: Regenerate.
2927         * elfcode.h (elf_link_create_dynamic_sections): Don't declare.
2928         (NAME(_bfd_elf,size_info)): Adjust for log_file_align.
2929         * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align.
2930         (assign_file_positions_for_segments): Likewise.
2931         (assign_file_positions_except_relocs): Likewise.
2932         (swap_out_syms, elfcore_write_note): Likewise.
2933         * elf-m10200.c: Adjust for changed function names.
2934         * elf-m10300.c: Likewise.
2935         * elf32-arm.h: Likewise.
2936         * elf32-h8300.c: Likewise.
2937         * elf32-hppa.c: Likewise.
2938         * elf32-ip2k.c: Likewise.
2939         * elf32-m32r.c: Likewise.
2940         * elf32-m68hc11.c: Likewise.
2941         * elf32-m68hc1x.c: Likewise.
2942         * elf32-m68k.c: Likewise.
2943         * elf32-mips.c: Likewise.
2944         * elf32-ppc.c: Likewise.
2945         * elf32-sh.c: Likewise.
2946         * elf32-v850.c: Likewise.
2947         * elf32-xtensa.c: Likewise.
2948         * elf64-alpha.c: Likewise.
2949         * elf64-hppa.c: Likewise.
2950         * elf64-mmix.c: Likewise.
2951         * elf64-ppc.c: Likewise.
2952         * elf64-sh64.c: Likewise.
2953         * elfxx-ia64.c: Likewise.
2954         * elfxx-mips.c: Likewise.
2955         (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align.
2956         * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align.
2957         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
2958         * elf64-mips.c (mips_elf64_size_info): Likewise.
2959         * elf64-s390.c (s390_elf64_size_info): Likewise.
2960         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2961
2962 2003-05-08  H.J. Lu <hongjiu.lu@intel.com>
2963
2964         * elflink.h (elf_add_default_symbol): After skipping the
2965         unversioned symbol, go to non-default one.
2966
2967 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
2968
2969         * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
2970         want_plt field.
2971         (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
2972         for symbols with non-default visibility.
2973
2974 2003-05-07  H.J. Lu <hongjiu.lu@intel.com>
2975
2976         * elflink.h (elf_link_check_versioned_symbol): Also handle the
2977         case that a DSO references a hidden symbol which may be
2978         satisfied by a versioned symbol in another DSO.
2979         (elf_link_output_extsym): Check versioned definition for hidden
2980         symbol referenced by a DSO.
2981
2982 2003-05-07  Nick Clifton  <nickc@redhat.com>
2983
2984         * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset
2985         R_XSTORMY16_16 reloc to ignore overflows.
2986
2987 2003-05-06  Alexandre Oliva  <aoliva@redhat.com>
2988
2989         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve
2990         error message for mixing different-endian files.  Check for ABI
2991         compatibility of input files with the selected emulation.
2992
2993 2003-05-05  Alan Modra  <amodra@bigpond.net.au>
2994
2995         * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
2996         non-default visibility, a) don't make them dynamic, b) discard
2997         space for dynamic relocs.
2998         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
2999
3000         * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
3001         non-default visibility, a) don't allocate plt entries, b) don't
3002         allocate .got relocs, c) discard dyn rel space,
3003         (ppc_elf_relocate_section): d) don't generate .got relocs, e)
3004         don't generate dynamic relocs.
3005         * elf64-ppc.c (allocate_dynrelocs): As above.
3006         (ppc64_elf_relocate_section): As above.
3007
3008 2003-05-05  Andreas Jaeger  <aj@suse.de>
3009
3010         * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
3011         relocation entries for weak undefined symbols with non-default
3012         visibility.
3013         (elf64_x86_64_relocate_section): Initialize the GOT entries and
3014         skip R_386_32/R_386_PC32 for weak undefined symbols with
3015         non-default visibility.
3016
3017 2003-05-04  H.J. Lu <hjl@gnu.org>
3018
3019         * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
3020         relocation entries for weak undefined symbols with non-default
3021         visibility.
3022         (elf_i386_relocate_section): Initialize the GOT entries and
3023         skip R_386_32/R_386_PC32 for weak undefined symbols with
3024         non-default visibility.
3025
3026         * elfxx-ia64.c (allocate_fptr): Don't allocate function
3027         descriptors for weak undefined symbols with non-default
3028         visibility.
3029         (allocate_dynrel_entries): Don't allocate relocation entries
3030         for symbols resolved to 0.
3031         (set_got_entry): Don't install dynamic relocation for weak
3032         undefined symbols with non-default visibility.
3033         (set_pltoff_entry): Likewise.
3034
3035         * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
3036         with non-default visibility.
3037         (elf_link_output_extsym): Don't make weak undefined symbols
3038         with non-default visibility dynamic.
3039
3040 2003-05-04  H.J. Lu <hjl@gnu.org>
3041
3042         * elflink.h (elf_merge_symbol): Correctly handle weak definiton.
3043
3044 2003-05-04  H.J. Lu <hjl@gnu.org>
3045
3046         * elflink.h (elf_merge_symbol): Don't record a hidden/internal
3047         symbol dynamic. Check indirection when removing the old
3048         definition for symbols with non-default visibility.
3049         (elf_add_default_symbol): Skip when told by elf_merge_symbol.
3050
3051 2003-05-02  Nick Clifton  <nickc@redhat.com>
3052
3053         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the
3054         R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about
3055         unsigned overflow.
3056
3057 2003-05-02  Andreas Jaeger  <aj@suse.de>
3058
3059         * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy
3060         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
3061         (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
3062         (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy
3063         ELF_LINK_NON_GOT_REF from weakdef.
3064
3065 2003-05-02  Charles Lepple <clepple@ghz.cc>
3066             Nick Clifton <nickc@redhat.com>
3067
3068         * acinclude.m4: Fix name of --enable-install-libbfd switch.
3069         * aclocal.m4: Regenerate.
3070         * configure: Regenerate.
3071         * Makefile.in: Regenerate.
3072
3073 2003-05-01  Alan Modra  <amodra@bigpond.net.au>
3074
3075         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the
3076         weakdef sym has already been adjusted before treating it specially.
3077         * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy
3078         ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
3079         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
3080         (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF.
3081
3082 2003-04-28  H.J. Lu <hjl@gnu.org>
3083
3084         * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during
3085         the relax finalize pass.
3086
3087         * section.c (struct sec): Add need_finalize_relax and remove
3088         flag11.
3089         (STD_SECTION): Update struct sec initializer.
3090         * bfd-in2.h: Regenerated.
3091
3092 2003-04-28  H.J. Lu <hjl@gnu.org>
3093
3094         * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol
3095         to copy any information related to dynamic linking when we flip
3096         the indirection.
3097
3098 2003-04-27  H.J. Lu <hjl@gnu.org>
3099
3100         * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New.
3101         (ELF_LINK_DYNAMIC_WEAK): New.
3102
3103         * elflink.h (elf_merge_symbol): Add one argument to indicate if
3104         a symbol should be skipped. Ignore definitions in dynamic
3105         objects for symbols with non-default visibility.
3106         (elf_add_default_symbol): Adjusted.
3107         (elf_link_add_object_symbols): Check if a symbol should be
3108         skipped. Don't merge the visibility field with the one from
3109         a dynamic object.
3110         (elf_link_check_versioned_symbol): Use undef_bfd.
3111         (elf_link_output_extsym): Warn if a forced local symbol is
3112         referenced from dynamic objects. Make non-weak undefined symbol
3113         with non-default visibility a fatal error.
3114
3115 2003-04-27  Daniel Jacobowitz  <drow@mvista.com>
3116
3117         * configure.in: Bump version on HEAD to 2.14.90.
3118         * configure: Regenerated.
3119
3120 2003-04-26  Stephane Carrez  <stcarrez@nerim.fr>
3121
3122         PR savannah/3331:
3123         * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
3124         when we couldn't relax something.
3125
3126 2003-04-25  Alan Modra  <amodra@bigpond.net.au>
3127
3128         * elflink.h (elf_merge_symbol): When we find a regular definition
3129         for an indirect symbol, flip the indirection so that the old
3130         direct symbol now points to the new definition.
3131
3132 2003-04-24  Roland McGrath  <roland@redhat.com>
3133
3134         * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr".
3135
3136 2003-04-24  Alan Modra  <amodra@bigpond.net.au>
3137
3138         * elf32-ppc.c: Formatting and comment fixes.
3139         (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
3140         (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
3141
3142 2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
3143
3144         * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
3145         * bfd-in2.h: Rebuilt.
3146         * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG.
3147         * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC
3148         & H8300SNMAGIC.
3149         (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn.
3150         * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn.
3151         (h8300sn_info_struct, h8300hn_info_struct): New.
3152         * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn
3153         (elf32_h8_final_write_processing): Likewise.
3154
3155 2003-04-23  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3156
3157         * elf32-sh.c (tpoff): New.
3158         (struct elf_sh_dyn_relocs): Remove tls_tpoff32.
3159         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3160         (allocate_dynrelocs): Don't make unnecessary dynamic TLS
3161         relocations.  Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
3162         (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
3163         (dtpoff_base): Fix wrong indentation.
3164         (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
3165         relocations.  Don't set tls_tpoff32 flag.  Don't make unnecessary
3166         R_SH_TLS_TPOFF32 relocations.
3167
3168 2003-04-23  J"orn Rennecke <joern.rennecke@superh.com>
3169
3170         * archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
3171         * cpu-sh.c: Likewise.
3172         * elf32-sh.c: Likewise.
3173         * reloc.c (bfd_reloc_code_real): Likewise.
3174         * elf32-sh64-com.c: Change comment to refer to SuperH.
3175         * elf32-sh64.c: Likewise.
3176         * elf64-sh64.c: Likewise.
3177         * bfd-in2.h (enum bfd_architecture): Regenerate.
3178
3179 2003-04-23  Alan Modra  <amodra@bigpond.net.au>
3180
3181         From Julien LEMOINE <speedblue@debian.org>
3182         * elf32-i386.c (elf_i386_info_to_howto): Delete.
3183         (elf_info_to_howto): Define as elf_i386_info_to_howto_rel.
3184
3185 2003-04-22  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
3186
3187         * archures.c: Replace references to Mitsubishi M32R with references
3188         to Renesas M32R.
3189         * relocs.c: Likewise.
3190         * bfd-in2.h: Regenerate.
3191
3192 2003-04-21  Richard Henderson  <rth@redhat.com>
3193
3194         * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an
3195         executable when a symbol is defined both regular and dynamic.
3196
3197 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
3198
3199         * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo.
3200         (elf32-m68hc1x.lo): Update dependencies
3201         * configure.in: Add elf32-m68hc1x.lo.
3202         * configure: Rebuild.
3203         * Makefile.in: Rebuild.
3204
3205 2003-04-21  Stephane Carrez  <stcarrez@nerim.fr>
3206
3207         * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
3208         (m68hc11_elf_hash_table_create): New function.
3209         (elf32_m68hc11_link_hash_table_free): New function.
3210         (stub_hash_newfunc): New function.
3211         (m68hc11_add_stub): New function.
3212         (elf32_m68hc11_add_symbol_hook): New function.
3213         (elf32_m68hc11_setup_section_lists): New function.
3214         (elf32_m68hc11_next_input_section): New function.
3215         (elf32_m68hc11_size_stubs): New function.
3216         (elf32_m68hc11_build_stubs): New function.
3217         (m68hc11_get_relocation_value): New function.
3218         (elf32_m68hc11_relocate_section): Call the above to redirect
3219         some relocations to the trampoline code.
3220         (m68hc11_elf_export_one_stub): New function.
3221         (m68hc11_elf_set_symbol): New function.
3222         (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse.
3223         (m68hc11_elf_get_bank_parameters): Get parameters only when the info
3224         is not yet initialized.
3225
3226         * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
3227         (elf32_m68hc11_stub_hash_entry): New struct.
3228         (m68hc11_page_info): Add trampoline handler address.
3229         (m68hc11_elf_link_hash_table): Add stubs generation members.
3230         (elf32_m68hc11_add_symbol_hook): Declare.
3231         (elf32_m68hc11_setup_section_lists): Declare.
3232         (elf32_m68hc11_size_stubs): Declare.
3233         (elf32_m68hc11_build_stubs): Declare.
3234
3235         * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c.
3236         (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise.
3237         (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto.
3238         (_bfd_m68hc11_elf_set_private_flags): Ditto.
3239         (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto.
3240         (_bfd_m68hc11_elf_print_private_bfd_data): Ditto.
3241         (bfd_elf32_bfd_link_hash_table_create): Define.
3242         (elf_backend_add_symbol_hook): Define.
3243         (m68hc11_elf_bfd_link_hash_table_create): New function.
3244         (m68hc11_elf_build_one_stub): New function.
3245         (m68hc11_elf_size_one_stub): New function.
3246         (m68hc11_elf_bfd_link_hash_table_create): Install the above.
3247         (bfd_elf32_bfd_link_hash_table_create): Define.
3248
3249         * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove.
3250         (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked.
3251         (m68hc12_phys_addr): Ditto.
3252         (m68hc12_phys_page): Ditto.
3253         (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c.
3254         (elf32_m68hc11_gc_mark_hook): Likewise.
3255         (elf32_m68hc11_gc_sweep_hook): Likewise.
3256         (elf32_m68hc11_check_relocs): Likewise.
3257         (elf32_m68hc11_relocate_section): Likewise.
3258         (_bfd_m68hc12_elf_set_private_flags): Likewise.
3259         (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise.
3260         (_bfd_m68hc12_elf_print_private_bfd_data): Likewise.
3261         (m68hc12_elf_build_one_stub): New function.
3262         (m68hc12_elf_size_one_stub): New function.
3263         (m68hc12_elf_bfd_link_hash_table_create): New function, use the above.
3264         (elf_backend_add_symbol_hook): Define.
3265         (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
3266
3267 2003-04-18  Nick Clifton  <nickc@redhat.com>
3268
3269         * format.c (bfd_check_format_matches): Only check associated
3270         vector if the matching_vector has been created.
3271
3272 2003-04-15  Alexandre Oliva  <aoliva@redhat.com>
3273
3274         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in
3275         2003-04-09's change.
3276
3277 2003-04-15  Brian Ford  <ford@vss.fsi.com>
3278
3279         * peicode.h (coff_swap_scnhdr_in): If a section holds
3280         uninitialized data and is from an object file or from an
3281         executable image that has not initialized the s_size field, or if
3282         the physical size is padded, use the virtual size (stored in
3283         s_paddr) instead.
3284
3285 2003-04-15  H.J. Lu <hjl@gnu.org>
3286
3287         * elflink.h (elf_link_add_object_symbols): Properly report
3288         filename for alignment reduction.
3289
3290 2003-04-15  Rohit Kumar Srivastava <rohits@kpitcummins.com>
3291
3292         * archures.c: Replace occurrances of 'Hitachi' with 'Renesas'.
3293         * reloc.c: Likewise.
3294         * coff-h8300.c: Likewise.
3295         * coff-h8500.c: Likewise.
3296         * coff-sh.c: Likewise.
3297         * cpu-h8300.c: Likewise.
3298         * cpu-sh.c: Likewise.
3299         * elf32-h8300.c: Likewise.
3300         * elf32-sh.c: Likewise.
3301         * elf32-sh64-com.c: Likewise.
3302         * elf32-sh64.c: Likewise.
3303         * elf64-sh64.c: Likewise.
3304         * bfd-in2.h: Regenerate.
3305
3306 2003-04-14  H.J. Lu <hjl@gnu.org>
3307
3308         * elflink.h (elf_link_add_object_symbols): Maintain maximum
3309         alignment for common symbols. Warn reducing alignment for
3310         common symbols. Report old filename when symbol size changes.
3311
3312 2003-04-12  Alexandre Oliva  <aoliva@redhat.com>
3313
3314         * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other
3315         occurrences of the same test changed in the previous patch.
3316         Optimize.
3317
3318 2003-04-11  Alexandre Oliva  <aoliva@redhat.com>
3319
3320         * elfxx-mips.c (mips_elf_get_global_gotsym_index): New.
3321         (mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to
3322         GOT_DISP/addend only if the symbol got a global GOT entry.
3323
3324 2003-04-10  Alexandre Oliva  <aoliva@redhat.com>
3325
3326         * elfxx-mips.c (mips_elf_calculate_relocation): Decay
3327         GOT_PAGE/GOT_OFST referencing overridable symbol to
3328         GOT_DISP/addend.
3329         (_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing
3330         global symbol as GOT_DISP.
3331
3332 2003-04-10  Bob Wilson  <bob.wilson@acm.org>
3333
3334         * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
3335         next relocation on an undefined symbol.
3336
3337 2003-04-09  Richard Henderson  <rth@redhat.com>
3338
3339         * elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
3340         Ignore relocations against r_symndx == 0.
3341
3342 2003-04-09  H.J. Lu <hjl@gnu.org>
3343
3344         * elf64-alpha.c (elf64_alpha_relocate_section): Don't return
3345         FALSE for undefined symbols.
3346         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
3347
3348 2003-04-09  Alexandre Oliva  <aoliva@redhat.com>
3349
3350         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
3351         and IRIX-specific shift-to-64-bit 4-byte lengths before following
3352         addr_size.
3353
3354 2003-04-08  Alexandre Oliva  <aoliva@redhat.com>
3355
3356         * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
3357         pointer size from ABI, not arch_bits_per_address.
3358
3359 2003-04-07  Kevin Buettner  <kevinb@redhat.com>
3360
3361         * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
3362         constants for n32 ABI.
3363
3364 2003-04-06  Andrew Cagney  <cagney@redhat.com>
3365
3366         * simple.c (bfd_simple_get_relocated_section_contents): Disable
3367         free that leads to GDB vs BFD memory corruption.
3368
3369 2003-04-04  Stephane Carrez  <stcarrez@nerim.fr>
3370
3371         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust
3372         symbols that mark the end of the section.
3373         (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when
3374         converting to a relative branch so that the offset is computed after
3375         the relaxation; also relocate a jsr into a bsr if possible but don't
3376         relax them if they are to a far symbol as we need to call the
3377         trampoline code.
3378         (elf_m68hc11_howto_table): Set pcrel_offset to true.
3379
3380 2003-04-04  Svein E. Seldal  <Svein.Seldal@solidas.com>
3381
3382         * archures.c: Namespace cleanup. Rename bfd_mach_c3x to
3383         bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x
3384         * bfd-in2.h: Regenerate
3385         * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/
3386         * cpu-tic4x.c: Ditto
3387
3388 2003-04-03  Nick Clifton  <nickc@redhat.com>
3389
3390         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss
3391         differently for object files and executables.
3392         * peicode.h (coff_swap_scnhdr_in): Only set the s_size field
3393         for object files or for executables who have not already
3394         initialised the field.
3395         * libpei.h (bfd_pe_executable_p): New macro.  Return true if
3396         the PE format bfd is an executable.
3397
3398 2003-04-03  Alan Modra  <amodra@bigpond.net.au>
3399
3400         * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL
3401         here as it's too early to reliably determine locality.
3402         (ppc_elf_gc_sweep_hook): Likewise.
3403         (SYMBOL_REFERENCES_LOCAL): Expand comment.
3404
3405 2003-04-02  Bob Wilson  <bob.wilson@acm.org>
3406
3407         * xtensa-modules.c: Remove comment indicating that this is a
3408         generated file.
3409
3410 2003-04-02  Alan Modra  <amodra@bigpond.net.au>
3411
3412         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
3413
3414 2003-04-01  Bob Wilson  <bob.wilson@acm.org>
3415
3416         * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
3417         (ALL_MACHINES_CFILES): Add cpu-xtensa.c.
3418         (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
3419         xtensa-modules.lo.
3420         (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
3421         xtensa-modules.c.
3422         (cpu-xtensa.lo): New target.
3423         (elf32-xtensa.lo): Likewise.
3424         (xtensa-isa.lo): Likewise.
3425         (xtensa-modules.lo): Likewise.
3426         * Makefile.in: Regenerate.
3427         * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
3428         (bfd_archures_list): Add bfd_xtensa_arch.
3429         * config.bfd: Handle xtensa-*-*.
3430         * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
3431         * configure: Regenerate.
3432         * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
3433         PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
3434         * targets.c (bfd_elf32_xtensa_be_vec): Declare.
3435         (bfd_elf32_xtensa_le_vec): Likewise.
3436         (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
3437         * cpu-xtensa.c: New file.
3438         * elf32-xtensa.c: Likewise.
3439         * xtensa-isa.c: Likewise.
3440         * xtensa-modules.c: Likewise.
3441         * libbfd.h: Regenerate.
3442         * bfd-in2.h: Likewise.
3443
3444 2003-04-01  Nick Clifton  <nickc@redhat.com>
3445
3446         * archures.c (bfd_mach_arm_unknown): Define.
3447         * bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes,
3448         bfd_arm_get_mach_from_notes): Prototype.
3449         * bfd-in2.h: Regenerate.
3450         * coff-arm.c (coff_arm_merge_private_bfd_data): Call
3451         bfd_arm_merge_machines.
3452         (coff_arm_final_link_postscript): Call bfd_arm_update_notes.
3453         * coffcode.h (coff_set_arch_mach_hook): Call
3454         bfd_arm_get_mach_from_notes.
3455         * coffgen.c (coff_real_object_p): Revert previous delta.
3456         * cpu_arm.c (arm_check_note): New function.  Examine a note in a
3457         .note section.
3458         (bfd_arm_merge_machines): New function: Handle the merging of ARM
3459         binaries compiled for different architectures..
3460         (bfd_arm_update_notes): New function: Update an ARM note section.
3461         (bfd_arm_get_mach_from_notes): New function: Extract a bfd machine
3462         number from an ARM note section.
3463         * elf32-arm.h (elf32_arm_object_p): Use
3464         bfd_arm_get_mach_from_notes.
3465         (elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines.
3466         (elf32_arm_final_write_processing): Use bfd_arm_update_notes.
3467
3468 2003-04-01  Ben Elliston  <bje@wasabisystems.com>
3469
3470         * dwarf2.c (read_attribute_value): Correct typo in comment.
3471
3472 2003-04-01  Nick Clifton  <nickc@redhat.com>
3473
3474         * dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
3475         instead of concat().
3476         (decode_line_info): Only free filename if it is not NULL.
3477         (add_line_info): Make a copy of the filename when storing it into
3478         the info structure.
3479
3480 2003-03-31  Andreas Schwab  <schwab@suse.de>
3481             Daniel Jacobowitz  <drow@mvista.com>
3482
3483         * simple.c (bfd_simple_get_relocated_section_contents): Add
3484         parameter symbol_table.  Optionally use it instead of the symbol
3485         table from the bfd.  Save and restore output offsets and output
3486         sections  around bfd_get_relocated_section_contents.  Fix a memory
3487         leak.
3488         (simple_save_output_info, simple_restore_output_info): New
3489         functions.
3490         * bfd-in2.h: Regenerate.
3491         * dwarf2.c (read_abbrevs): Use
3492         bfd_simple_get_relocated_section_contents instead of
3493         bfd_get_section_contents.
3494         (decode_line_info): Likewise.
3495         (_bfd_dwarf2_find_nearest_line): Likewise.  Don't call
3496         find_rela_addend.
3497         (find_rela_addend): Remove.
3498         * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for
3499         debugging sections.
3500         (elfNN_ia64_hash_table_create): Create the hash table with malloc,
3501         not bfd_zalloc.
3502
3503 2003-03-31  David Heine  <dlheine@suif.stanford.edu>
3504
3505         * aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of
3506         bfd_alloc.
3507         * dwarf2.c (concat_filename): Always allocate space for the
3508         returned filename.
3509         (decode_line_info): Free the allocated filename returned by
3510         concat_filename.
3511         * elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks.
3512         * elf.c (copy_private_bfd_data): Likewise.
3513         (_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer.
3514         * elflink.h (elf_link_sort_relocs): Fix memory leak.
3515         * format.c (bfd_check_format_matches): Likewise.
3516         * linker.c (bfd_generic_final_link): Likewise.
3517         * opncls.c (find_separate_debug_info): Likewise.
3518         * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
3519
3520 2003-03-28  H.J. Lu <hjl@gnu.org>
3521
3522         * elflink.h (elf_link_add_object_symbols): Correctly combine
3523         visibilities.
3524
3525 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
3526
3527         * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
3528         to -1 before recomputing got offsets.
3529
3530 2003-03-26  Andreas Schwab  <schwab@suse.de>
3531
3532         * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
3533         (elf_m68k_relocate_section): Use it to correctly handle symbols
3534         forced to be local.
3535         (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got
3536         entries for symbols that are forced to be local.
3537
3538 2003-03-25  Alexandre Oliva  <aoliva@redhat.com>
3539
3540         * elfxx-mips.c (_bfd_mips_relax_section): New function.
3541         * elfxx-mips.h (_bfd_mips_relax_section): Declare.
3542         * elfn32-mips.c, elf64-mips.c: Use it.
3543
3544 2003-03-25  Stan Cox   <scox@redhat.com>
3545             Nick Clifton  <nickc@redhat.com>
3546
3547         Contribute support for Intel's iWMMXt chip - an ARM variant:
3548
3549         * archures.c: Add bfd_mach_arm_iWMMXt.
3550         * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2.
3551         * bfd-in2.h: Regenerate.
3552         * libbfd.h: Regenerate.
3553         * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt
3554         object files to be linked with XScale ones.
3555         (coff_arm_final_link_postscript): Update note section.
3556         * coffcode.h (coff_set_arch_mach_hook): Handle note section.
3557         * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook
3558         after identifying a coff binary.
3559         * cpu-arm.c (processors): Add iWMMXt.
3560         (arch_inf): Likewise.
3561         * elf32-arm.h (arm_object_p): Handle note section.
3562         (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to
3563         be linked with XScale ones.
3564         (elf32_arm_section_flags): New function: Set flags on note section.
3565         (elf32_arm_final_write_processing): Handle note section.
3566
3567 2003-03-21  DJ Delorie  <dj@redhat.com>
3568
3569         * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call
3570         _bfd_elf_rela_local_sym.
3571
3572 2003-03-20  H.J. Lu <hjl@gnu.org>
3573
3574         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for
3575         non-ELF outputs.
3576
3577 2003-03-20  Nick Clifton  <nickc@redhat.com>
3578
3579         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and
3580         $idata5 in case bfd_coff_final_link is not called.
3581
3582 2003-03-19  Jakub Jelinek  <jakub@redhat.com>
3583
3584         * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count
3585         field.
3586         (canon_reloc_count): Define.
3587         (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
3588         sparc64_elf_canonicalize_dynamic_reloc): Use it instead of
3589         reloc_count.
3590         (sparc64_elf_canonicalize_reloc): New routine.
3591         (bfd_elf64_canonicalize_reloc): Define.
3592
3593 2003-03-18  Jakub Jelinek  <jakub@redhat.com>
3594
3595         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation
3596         againt mergeable sections.  Take r_addend into account when caching
3597         trampolines.
3598
3599 2003-03-18  Richard Henderson  <rth@redhat.com>
3600
3601         * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
3602         local symbols that have no dyninfo.
3603
3604 2003-03-14  Gene Smith  <gene.smith@siemens.com>
3605
3606         * ieee.c (ieee_write_expression): Handle the case where symbol is
3607         NULL.
3608         General formatting improvements.
3609
3610 2003-03-13  Nick Clifton  <nickc@redhat.com>
3611
3612         * configure.in (LINGUAS): Add zh_CN.
3613         * configure: Regenerate.
3614         * po/zh_CN.po: New file.
3615
3616 2003-03-13  Elias Athanasopoulos  <elathan@phys.uoa.gr>
3617
3618         * aout-cris.c (BYTES_IN_WORD): Don't define.
3619         aout-encap.c: Likewise.
3620         aout-ns32k.c: Likewise.
3621         aout-tic30.c: Likewise.
3622         hp300bsd.c: Likewise.
3623         i386aout.c: Likewise.
3624         i386dynix.c: Likewise.
3625         i386linux.c: Likewise.
3626         i386lynx.c: Likewise.
3627         i386mach3.c: Likewise.
3628         m68k4knetbsd.c: Likewise.
3629         m68klinux.c: Likewise.
3630         m68klynx.c: Likewise.
3631         m68knetbsd.c: Likewise.
3632         m88kmach3.c: Likewise.
3633         mipsbsd.c: Likewise.
3634         newsos3.c: Likewise.
3635         sparclinux.c: Likewise.
3636         sparclynx.c: Likewise.
3637         sparcnetbsd.c: Likewise.
3638         vaxbsd.c: Likewise. Fix comment formatting.
3639
3640 2003-03-12  Alexandre Oliva  <aoliva@redhat.com>
3641
3642         * Reverted 2003-03-02's patch.
3643
3644         * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
3645         overridable.
3646         * elf64-mips.c (mips_elf64_canonicalize_reloc,
3647         mips_elf64_get_dynamic_reloc_upper_bound,
3648         mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
3649         (bfd_elf64_get_canonicalize_reloc,
3650         bfd_elf64_get_dynamic_reloc_upper_bound,
3651         bfd_elf64_canonicalize_dynamic_reloc): Define.
3652         (mips_elf64_slurp_reloc_table): Support dynamic.
3653         (mips_elf64_slurp_one_reloc_table): Adjust.
3654
3655 2003-03-12  Nick Clifton  <nickc@redhat.com>
3656
3657         * xsym.c (bfd_sym_fetch_type_information_table_entry): Change
3658         'index' to 'offset' in test for zero value.
3659
3660 2003-03-11  Alexandre Oliva  <aoliva@redhat.com>
3661
3662         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
3663         dynamic relocations pointing to local or section symbols, use the
3664         NULL symbol instead.  Document the choice to not emit an
3665         additional R_MIPS_64 relocation.
3666
3667 2003-03-11  Alan Modra  <amodra@bigpond.net.au>
3668
3669         * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
3670         zero index dynamic tls relocs generated for the GOT.  Tidy code.
3671         Set "relocation" to 1 on DTPMOD32 relocs.  Optimize HA adjustment.
3672         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3673
3674 2003-03-07  Alan Modra  <amodra@bigpond.net.au>
3675
3676         * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
3677         a tls_get_addr call.
3678
3679         * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
3680         (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
3681         ELF_LINK_NON_GOT_REF from weakdef.
3682         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
3683         (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
3684         ELF_LINK_NON_GOT_REF from weakdef.
3685         * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
3686         (elf_i386_adjust_dynamic_symbol): For weak symbols, copy
3687         ELF_LINK_NON_GOT_REF from weakdef.
3688
3689 2003-03-06  Jakub Jelinek <jakub@redhat.com>
3690         Andrew Haley  <aph@redhat.com>
3691
3692         * elflink.h (elf_bfd_discard_info): Don't process eh frames if
3693         output is relocateable.
3694
3695 2003-03-06  Steven Konopa <skonopa@kgo.csc.com>
3696
3697         * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and
3698         R_COMMENT.
3699
3700 2003-03-06  Alan Modra  <amodra@bigpond.net.au>
3701
3702         * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
3703         error messages.
3704         (ELIMINATE_COPY_RELOCS): Define to zero.
3705         (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
3706         TLSLD relocs.  Report reloc types on a number of errors.  Optimize
3707         LOCAL24PC check for non-local syms.  Don't capitalize error messages.
3708         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
3709         (ppc64_elf_relocate_section): Don't deref htab->tls_sec when
3710         calculating TLSLD relocs.  Report reloc types on a number of errors.
3711         Don't capitalize error messages.
3712
3713 2003-03-03  H.J. Lu <hjl@gnu.org>
3714
3715         * elfxx-ia64.c (USE_BRL): Removed.
3716         (oor_ip): Removed.
3717
3718 2003-03-03  J"orn Rennecke <joern.rennecke@superh.com>
3719
3720         * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
3721         relocation (no special function), and make it non-partial_inplace.
3722         (sh_elf_relax_section): When creating a bsr, use a consistent value
3723         no matter if the symbol is extern or not;  set addend to -4.
3724         Don't swap load / non-load instructions for SH4.
3725         (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
3726         rather than if the symbol is external to determine if adjusting the
3727         offset makes sense.  Adjust the addend too if appropriate.
3728         (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
3729         relocation.
3730
3731 2003-03-03  Nick Clifton  <nickc@redhat.com>
3732
3733         * po/da.po: Installed latest translation.
3734
3735 2003-03-02  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
3736
3737         * elf32-mips.c (elf_mips_howto_table_rel): Change definition of
3738         R_MIPS_PC16 to rightshift 2.
3739         (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
3740         (bfd_elf32_bfd_reloc_type_lookup): Support
3741         BFD_RELOC_MIPSEMB_16_PCREL_S2.
3742         * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
3743         R_MIPS_PC16 to rightshift 2.
3744         (mips_elf64_howto_table_rela): Likewise.
3745         (mips_reloc_map): Map to rightshifted BFD reloc.
3746         * elfn32-mips.c: The same as in elf64-mips.c.
3747         * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
3748         (mips_elf_calculate_relocation): Handle rightshifted addends for
3749         R_MIPS_PC16.
3750         * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
3751         MIPS Embedded PIC. Remove superfluous empty COMMENT.
3752         * libbfd.h: Regenerate.
3753         * bfd-in2.h: Regenerate.
3754
3755 2003-02-28  Richard Henderson  <rth@redhat.com>
3756
3757         * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
3758         for ltoff22x relaxation.
3759
3760 2003-03-01  Alan Modra  <amodra@bigpond.net.au>
3761
3762         * bfd-in.h (_bfd): Don't define.
3763         * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
3764         * syms.c: Likewise.
3765         * bfd-in2.h: Regenerate.
3766
3767 2003-02-27  Richard Henderson  <rth@redhat.com>
3768
3769         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
3770         (elfNN_ia64_check_relocs): Set it.
3771         (allocate_global_data_got): Check it.
3772         (allocate_local_got): Likewise.
3773         (allocate_dynrel_entries): Likewise.
3774         (elfNN_ia64_relax_ldxmov): New.
3775         (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
3776         (elfNN_ia64_choose_gp): Split out from ...
3777         (elfNN_ia64_final_link): ... here.
3778
3779 2003-02-27  Andrew Cagney  <cagney@redhat.com>
3780
3781         * bfd.c (struct bfd): Rename "struct _bfd".
3782         * bfd-in.h: Update copyright.
3783         (struct bfd): Rename "struct _bfd".
3784         (_bfd): Define for backward compatibility.
3785         * bfd-in2.h: Regenerate.
3786
3787 2003-02-25  Alan Modra  <amodra@bigpond.net.au>
3788
3789         * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
3790         and rel_hdr2 when initially counting input relocs rather than after
3791         creating output reloc sections.
3792         (elf_link_read_relocs_from_section): Don't abort with wrong reloc
3793         sizes.
3794
3795         * Makefile.am: Run "make dep-am".
3796         * Makefile.in: Regenerate.
3797
3798 2003-02-24  Kris Warkentin  <kewarken@qnx.com>
3799
3800         * elf.c (elfcore_read_notes): Add check for QNX style core file.
3801         (elfcore_grog_nto_note): New function.
3802         (elfcore_grog_nto_gregs): New function.
3803         (elfcore_grog_nto_status): New function.
3804
3805 2003-02-24  Alan Modra  <amodra@bigpond.net.au>
3806
3807         * elflink.c (_bfd_elf_create_got_section): Check existing .got
3808         section flags before concluding that we've already been called.
3809         Don't use register keyword.
3810         (_bfd_elf_create_dynamic_sections): Don't use register keyword.
3811         (_bfd_elf_create_linker_section): Formatting.
3812
3813 2003-02-20  jmc  <jmc@prioris.mini.pw.edu.pl>
3814
3815         * coff-h8300.c: Fix typo: intial -> initial.
3816         * coff-ppc.c: Likewise.
3817
3818 2003-02-20  Alan Modra  <amodra@bigpond.net.au>
3819
3820         * elf32-ppc.c: Formatting.
3821         (allocate_dynrelocs): LD and GD relocs against the same sym need
3822         separate GOT entries.
3823         (ppc_elf_relocate_section): Correct GOT handling for multiple GOT
3824         entries per symbol.
3825
3826 2003-02-19  Alan Modra  <amodra@bigpond.net.au>
3827
3828         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
3829         removal.  Localize vars.  Remove unnecessary dynobj test.
3830         * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
3831         of INFO.
3832         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3833         and optimize.
3834         (elf_i386_relocate_section): Likewise.
3835         (elf_i386_gc_sweep_hook): Simplify dyn reloc removal.  Localize vars.
3836         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
3837         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
3838         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
3839         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
3840         * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.  Remove
3841         local_dynrel for section too.  Don't touch HIPLT22, LOPLT10, PCPLT32
3842         or PCPLT10 relocs.  Don't subtract twice on PLT32 relocs.
3843         Formatting.
3844
3845         * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
3846         (ppc64_elf_check_relocs): Use it.  Correct comment.  Move SEC_ALLOC
3847         test.
3848         (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
3849         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3850         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3851         and optimize.  Use ELIMINATE_COPY_RELOCS.
3852         (ppc64_elf_relocate_section): Likewise.
3853
3854         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
3855         (ppc_elf_copy_indirect_symbol): Copy pc_count field.
3856         (ELIMINATE_COPY_RELOCS): Define.
3857         (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
3858         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
3859         (MUST_BE_DYN_RELOC): Define.
3860         (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
3861         and optimize.  Trim dyn_relocs.
3862         (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
3863         not be used.  Do generate dyn_relocs for copy reloc avoidance.  Keep
3864         track of pc_rel dyn relocs.
3865         (ppc_elf_relocate_section): Remove "will_become_local".  Adjust
3866         WILL_CALL_FINISH_DYNAMIC_SYMBOL use.  Trim dyn relocs as per
3867         allocate_dynrelocs.  Don't recalculate "sec".
3868
3869 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
3870
3871         * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
3872         * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
3873         on invalid LD relocs.
3874         (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
3875         (ppc64_elf_relocate_section): Unify new handling of LD relocs and
3876         tlsld_got entry.  Use IS_PPC64_TLS_RELOC.
3877
3878         * elf32-ppc.h: New file.
3879         * elf32-ppc.c: Include elf32-ppc.h.
3880         (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
3881         (struct ppc_elf_link_hash_entry): Rename "root" to "elf".  Adjust uses.
3882         Add "tls_mask" field.
3883         (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
3884         (struct ppc_elf_link_hash_table): Rename "root" to "elf".  Adjust uses.
3885         Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
3886         sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
3887         Make use of htab shortcuts throughout file.
3888         (ppc_elf_link_hash_newfunc): Init tls_mask field.
3889         (ppc_elf_link_hash_table_create): Init new fields.
3890         (ppc_elf_copy_indirect_symbol): Copy tls_mask.
3891         (ppc_elf_howto_raw): Add tls relocs.
3892         (ppc_elf_reloc_type_lookup): Handle them.
3893         (ppc_elf_unhandled_reloc): New function.
3894         (ppc_elf_create_got): Stash got section pointer in hash table,
3895         return status.  Make .rela.got too.
3896         (ppc_elf_create_dynamic_sections): Stash section pointers in htab.
3897         (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
3898         NON_GOT_REF set.  Don't allocate space in .plt here..
3899         (allocate_dynrelocs): ..do so here instead, properly ref-counting and
3900         not allocating plt entries unnecessarily.  Allocate got entries here.
3901         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
3902         (ppc_elf_size_dynamic_sections): Allocate local got entries.  Pass
3903         "info" during allocate_dynrelocs hash traversal.  Use htab section
3904         shortcuts rather than searching for named sections.  Get rid of
3905         "plt" and "strip" booleans.
3906         (update_local_sym_info, bad_shared_reloc): New functions.
3907         (ppc_elf_check_relocs): Handle TLS relocs.  Move .rela.got creation to
3908         ppc_elf_create_got.  Don't mark got or plt reloc syms dynamic, do so
3909         in allocate_dynreloc.  Use update_local_sym_info and bad_shared_reloc.
3910         Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16,
3911         R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA
3912         in shared libs.  R_PPC_PLTREL32 is a plt reloc too.  Refcount all
3913         relocs that might use a plt entry.  Set NON_GOT_REF too.
3914         Enumerate all do-nothing relocs.
3915         (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs.  Handle
3916         tls relocs and all plt relocs.
3917         (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions.
3918         (ppc_elf_finish_dynamic_symbol): Don't build got entries here.
3919         (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab
3920         shortcuts.
3921         (ppc_elf_relocate_section): Tidy.  Handle TLS relocs.  Use
3922         bfd_elf_local_sym_name.  Simplify unresolved reloc code.  Build got
3923         entries and got relocs here.  Warn on non-zero got reloc addend.
3924         Split out branch taken/not taken reloc code into a separate switch
3925         and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs.
3926         Split out HA reloc adjustments to separate switch statement.  Don't
3927         warn on reloc overflow if we've already warned about undefined.
3928         Don't rebuild sym name when reporting errors.  Report all possible
3929         errors from _bfd_final_link_relocate.
3930         (bfd_elf32_bfd_final_link): Don't define.
3931
3932 2003-02-18  Alan Modra  <amodra@bigpond.net.au>
3933
3934         * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r".  Don't
3935         rebuild sym name when reporting errors.
3936
3937 2003-02-17  Nick Clifton  <nickc@redhat.com>
3938
3939         * elflink.h (elf_link_output_extsym): Only check
3940         allow_shlib_undefined for shared libraries.
3941         * elf32-i386.c (elf_i386_relocate_section): Remove bogus check
3942         of allow_shlib_undefined.
3943         * elf32-cris.c (cris_elf_relocate_section): Likewise.
3944         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
3945         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
3946         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
3947         * elf32-s390.c (elf_s390_relocate_section): Likewise.
3948         * elf32-sh.c (sh_elf_relocate_section): Likewise.
3949         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
3950         * elf32-vax.c (elf_vax_relocate_section): Likewise.
3951         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
3952         * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
3953         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3954         * elf64-s390.c (elf_s390_relocate_section): Likewise.
3955         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
3956         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
3957         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
3958         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
3959
3960 2003-02-17  Nick Clifton  <nickc@redhat.com>
3961
3962         * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the
3963         address field to use in the comparison.
3964         (SEGMENT_OVERLAPS): Check that LMAs overlap as well.
3965
3966 2003-02-14  Bob Wilson  <bob.wilson@acm.org>
3967
3968         * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF
3969         backends when checking if the generic ELF target should be used.
3970
3971         * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs
3972         outside of functions, treat values as absolute addresses.
3973
3974         * bfd.c: Change embedded documentation to use consistent indentation
3975         and to split up long lines.  Change informal style of description
3976         for functions lacking real documentation.
3977         * coffcode.h: Break up long lines in embedded documentation.
3978         * format.c: Likewise.
3979         * targets.c: Likewise.
3980         * libcoff.h: Regenerate.
3981         * bfd-in2.h: Regenerate.
3982
3983 2003-02-14  Alan Modra  <amodra@bigpond.net.au>
3984
3985         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
3986         (ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
3987         (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
3988         (allocate_dynrelocs): Don't treat undefined and undefweak specially.
3989         (ppc_size_one_stub): Fix warning, and tighten plt entry check.
3990         (group_sections): Don't share a stub section if stubs are for a large
3991         section.  Adjust comment.
3992         (ppc64_elf_size_stubs): Roughly double the size left for stubs if
3993         !stubs_always_before_branch.
3994         (ppc64_elf_relocate_section): Initialize tlsld GOT entry once.  Don't
3995         treat undefined and undefweak specially when processing dyn relocs.
3996
3997 2003-02-13  Jakub Jelinek  <jakub@redhat.com>
3998
3999         * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
4000
4001 2003-02-13  Nick Clifton  <nickc@redhat.com>
4002
4003         * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs
4004         in computation of offset to insert into BL instruction.
4005
4006 2003-02-11  Uwe Stieber  <uwe@wwws.de>
4007
4008         * config.bfd: Add support for kaOS as cross build target system.
4009
4010 2003-02-11  Alan Modra  <amodra@bigpond.net.au>
4011
4012         * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
4013         .__tls_get_addr too.
4014         (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
4015
4016 2003-02-10  Kaz kojima  <kkojima@rr.iij4u.or.jp>
4017
4018         * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
4019         (elf_sh_link_hash_entry): Remove tls_tpoff32 field.
4020         (sh_elf_link_hash_newfunc): Remove the initialization of
4021         tls_tpoff32 field.
4022         (allocate_dynrelocs): Keep dyn_relocs if it includes the entry
4023         for which tls_tpoff32 flag is set.
4024         (sh_elf_relocate_section): Covert to LE only if the dyn_relocs
4025         of the symbol includes the entry matched with the input_section
4026         and having tls_tpoff32 flag on.  When linking statically, set
4027         symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
4028         is defined in this executable.
4029         (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
4030
4031 2003-02-10  Jakub Jelinek  <jakub@redhat.com>
4032
4033         * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
4034         even if there is just non-empty .rela.plt.
4035
4036 2003-02-10  Nick Clifton  <nickc@redhat.com>
4037
4038         * archures.c (bfd_mach_arm_ep9312): Define.
4039         * bfd-in2.h: Regenerate.
4040         * cpu-arm.c (processors[]): Add ep9312.
4041         (bfd_arm_arch): Add ep9312.
4042         * elf32-arm.h (elf32_arm_merge_private_data): Update error
4043         messages and add test for Maverick floating point support.
4044         (elf32_arm_print_private_bfd_data): Handle
4045         EF_ARM_MAVERICK_FLOAT flag.
4046         (elf32_arm_object_p): New function.
4047         (elf_backend_object_p): Define.
4048
4049 2003-02-10  Alan Modra  <amodra@bigpond.net.au>
4050
4051         * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
4052         variables, structure fields or function params to tls_mask or
4053         similar to better reflect usage.
4054         (struct got_entry): Comment.
4055         (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*.
4056         (get_tls_mask): Rename from get_tls_type.
4057
4058 2003-02-09  Alan Modra  <amodra@bigpond.net.au>
4059
4060         * elf64-ppc.c (TLS_GD_LD): Don't define..
4061         (TLS_GD): ..define this instead and update all uses.
4062         (TLS_TPRELGD): Define.
4063         (ppc64_elf_link_hash_table_create): Tweak initialization of
4064         init_refcount and init_offset.
4065         (ppc64_elf_check_relocs): Add one extra element to t_symndx array.
4066         Mark second slot of GD or LD toc entries.
4067         (get_tls_type): Return an int.  Distinguish toc GD and LD entries
4068         from other tls types.
4069         (ppc64_elf_tls_setup): New function, split out from..
4070         (ppc64_elf_tls_optimize): ..here.  Don't optimize when symbols are
4071         defined in a dynamic object.  Fix LD optimization.  Don't set TLS_TPREL
4072         on GD->IE optimization, use TLS_TPRELGD instead.  Use get_tls_type
4073         return value to properly decide whether toc GD and LD entries can
4074         optimize away __tls_get_addr call.  Check next reloc after DTPMOD64
4075         to determine GD or LD rather than looking at TLS_LD flag.  Don't
4076         attempt to adjust got entry tls_type here..
4077         (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
4078         look for possible merges.
4079         (ppc64_elf_size_dynamic_sections): Adjust local got entries for
4080         optimization.
4081         (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
4082         (ppc64_elf_relocate_section): Rename some vars to better reflect usage.
4083         Make use of return value from get_tls_type to properly detect GD and
4084         LD optimizations.  Split tlsld/gd hi/ha from lo/ds case.  Don't
4085         handle tls_get_addr removal when looking at REL24 relocs, do it when
4086         looking at the previous reloc.  Check reloc after DTPMOD64 to determine
4087         GD or LD.
4088         * elf64-ppc.h (ppc64_elf_tls_setup): Declare.
4089
4090 2003-02-08  Alan Modra  <amodra@bigpond.net.au>
4091
4092         * elf32-hppa.c (group_sections): Don't share a stub section if
4093         stubs are for a large section.
4094
4095         * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for
4096         stubs if !stubs_always_before_branch.
4097
4098 2003-02-07  Nick Clifton  <nickc@redhat.com>
4099
4100         * elf.c (swap_out_syms): Generate an error message if an
4101         equivalent output section cannot be found for a symbol.
4102
4103 2003-02-07  Jakub Jelinek  <jakub@redhat.com>
4104
4105         * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
4106         local_got_entries is NULL.
4107
4108 2003-02-06  Andreas Schwab  <schwab@suse.de>
4109
4110         * elf-eh-frame.c (get_DW_EH_PE_signed): Define.
4111         (read_value): Add parameter is_signed, use signed extraction if
4112         the value is signed.
4113         (_bfd_elf_write_section_eh_frame): Pass signed flag of the
4114         encoding to read_value.
4115
4116 2003-02-06  Alan Modra  <amodra@bigpond.net.au>
4117
4118         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and
4119         plt info when called to transfer weak sym info.
4120
4121 2003-02-05  Alan Modra  <amodra@bigpond.net.au>
4122
4123         * reloc.c: Add PPC and PPC64 TLS relocs.
4124         * libbfd.h: Regenerate.
4125         * bfd-in2.h: Regenerate.
4126         * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare.
4127         (ppc64_elf_howto_raw): Add TLS howto's.  Adjust R_PPC64_NONE to be
4128         against a 32 bit field.
4129         (ppc64_elf_reloc_type_lookup): Handle TLS relocs.
4130         (_ppc64_elf_section_data): Add t_symndx and comments.
4131         (ppc64_elf_section_data): Use elf_section_data macro.
4132         (ppc64_elf_new_section_hook): American spelling.
4133         (struct got_entry, struct plt_entry): New.
4134         (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC.
4135         (struct ppc_stub_hash_entry): Add "addend" field.
4136         (struct ppc_link_hash_entry): Add "tls_type".
4137         (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL,
4138         TLS_EXPLICIT): Define.
4139         (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got.
4140         (link_hash_newfunc): Init new fields.
4141         (ppc64_elf_link_hash_table_create): Likewise.  Set init_refcount and
4142         init_offset to NULL.
4143         (ppc64_elf_copy_indirect_symbol): Copy got and plt info.  Don't call
4144         _bfd_elf_link_hash_copy_indirect, rather insert relevant code from
4145         there.
4146         (update_local_sym_info, update_plt_info): New functions.
4147         (ppc64_elf_check_relocs): Use them.  Handle TLS relocs.  Adjust GOT
4148         handling to use got.glist rather than got.refcount.  Likewise for PLT.
4149         (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists.
4150         (func_desc_adjust): Adjust for new PLT list.
4151         (ppc64_elf_adjust_dynamic_symbol): Likewise.
4152         (get_sym_h, get_tls_type): New functions.
4153         (ppc64_elf_edit_opd): Remove unused variable.  Use get_sym_h.
4154         (ppc64_elf_tls_optimize): New function.
4155         (allocate_dynrelocs): Adjust for new PLT and GOT lists.  Allocate
4156         TLS relocs.
4157         (ppc64_elf_size_dynamic_sections): Likewise.
4158         (ppc_type_of_stub): Adjust for new PLT list.
4159         (ppc_build_one_stub): Likewise.
4160         (ppc64_elf_size_stubs): Likewise.  Use get_sym_h.  Treat __tls_get_addr
4161         calls specially.
4162         (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists.  Handle
4163         TLS relocs.  Report local syms using bfd_elf_local_sym_name.  Don't
4164         init GOT entries that have a reloc.  Generate GOT relocs here..
4165         (ppc64_elf_finish_dynamic_symbol): ..not here.  Adjust for PLT list.
4166         * elf64-ppc.h (ppc64_elf_tls_optimize): Declare.
4167
4168 2003-02-04  Andreas Schwab  <schwab@suse.de>
4169
4170         * elf32-m68k.c (elf_m68k_hash_entry): Define.
4171         (elf_m68k_link_hash_traverse): Remove.
4172         (elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and
4173         elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to
4174         reduce casting.
4175         (elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of
4176         casting.
4177         (elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse
4178         instead of elf_m68k_link_hash_traverse.
4179         (elf_m68k_discard_copies): Change first parameter to pointer to
4180         struct elf_link_hash_entry and use elf_m68k_hash_entry when struct
4181         elf_m68k_link_hash_entry is needed.
4182
4183 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
4184
4185         * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare.
4186         (struct elf_link_hash_entry): Add "glist" and "plist" fields to
4187         "got" union, and declare as gotplt_union.  Use gotplt_uinion for
4188         "plt" field.
4189         (struct elf_link_hash_table): Make "init_refcount" a gotplt_union.
4190         Add "init_offset" field.
4191         (struct elf_obj_tdata <local_got>): Add "struct got_entry **" to union.
4192         (elf_local_got_ents): Declare.
4193         * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got"
4194         and "plt".
4195         (_bfd_elf_link_hash_hide_symbol): Use "init_offset".
4196         (_bfd_elf_link_hash_table_init): Set "init_offset".
4197         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount
4198         from init_offset.
4199         (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset.
4200
4201         * elf.c (bfd_elf_local_sym_name): Split out from..
4202         (group_signature): ..here.
4203         * elf-bfd.h (bfd_elf_local_sym_name): Declare.
4204
4205 2003-02-04  Alan Modra  <amodra@bigpond.net.au>
4206
4207         * elf-bfd.h (enum elf_link_info_type): Remove.
4208         (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields
4209         to struct sec.  Remove linkonce_p field.
4210         (elf_linkonce_p): Delete.
4211         (elf_discarded_section): Update for sec_info_type change.
4212         * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc,
4213         flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24.
4214         (ELF_INFO_TYPE_NONE): Define.
4215         (ELF_INFO_TYPE_STABS): Define.
4216         (ELF_INFO_TYPE_MERGE): Define.
4217         (ELF_INFO_TYPE_EH_FRAME): Define.
4218         (ELF_INFO_TYPE_JUST_SYMS): Define.
4219         (STD_SECTION): Update struct sec initializer.
4220         * ecoff.c (bfd_debug_section): Likewise.
4221         * elf.c: Likewise.  Update occurrences of sec_info_type and use_rela_p.
4222         * elflink.h: Likewise.
4223         * elf-eh-frame.c: Likewise.
4224         * elf64-alpha.c: Likewise.
4225         * elfxx-ia64.c: Likewise.
4226         * elfxx-mips.c: Likewise.
4227         * bfd-in2.h: Regenerate.
4228
4229         * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than
4230         referring to used_by_bfd.
4231         * elf64-sparc.c (sec_do_relax): Likewise.
4232         * elf64-mmix.c (mmix_elf_section_data): Likewise.
4233         * elfxx-mips.c (mips_elf_section_data): Likewise.
4234         * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro.
4235         (ieee_get_section_contents): Likewise.
4236         (ieee_new_section_hook): Formatting.
4237         (ieee_canonicalize_reloc): Remove commented out code.
4238         * mmo.c (mmo_section_data): Define.  Use throughout file.
4239         * oasys.c (oasys_get_section_contents): Use oasys_per_section macro.
4240
4241 2003-01-31  Graydon Hoare <graydon@redhat.com>
4242
4243         * Makefile.am (opncls.lo): Add dependency upon libiberty.h.
4244         * Makefile.in: Regenerate.
4245         * opncls.c (calc_crc32, get_debug_link_info,
4246         seperate_debug_file_exists, find_seperate_debug_file): New
4247         internal functions.
4248         (bfd_follow_gnu_debuglink): New function.  Follow the pointer
4249         contained inside a .gnu_debuglink section.
4250         * bfd-in2.h: Regenerate.
4251
4252 2003-01-29  Alexandre Oliva  <aoliva@redhat.com>
4253
4254         * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference
4255         entry->abfd when it's NULL.
4256
4257 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
4258
4259         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle
4260         _bfd_elf_section_offset returning -2 the same way as -1.
4261
4262         * elfxx-mips.c (mips_elf_multi_got): New function.
4263         (struct mips_got_entry): Make symndx and gotidx signed.  Moved
4264         addend into union along with address and link hash entry.
4265         (struct mips_got_info): Added bfd2got and next.
4266         (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx.
4267         (mips_elf_got_section, mips_elf_create_got_section): Use
4268         SEC_EXCLUDE bit to tell whether we really need the got
4269         section.  Take boolean arguments to disregard an excluded
4270         section, or to create it as excluded.  Adjust all callers.
4271         Use mips_elf_got_section all over.
4272         (mips_elf_local_got_index, mips_elf_got_page,
4273         mips_elf_got16_entry): Take input bfd as argument, and pass it
4274         on to mips_elf_create_local_got_entry.
4275         (mips_elf_global_got_index, mips_elf_create_local_got_entry):
4276         Take input bfd as argument, and manage entries in the
4277         appropriate GOT.
4278         (mips_elf_got_offset_from_index): Take input bfd as argument,
4279         and use it to adjust the GP offset of the bfd.
4280         (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move
4281         unreferenced GOT entries of global symbols to the end.
4282         (mips_elf_record_global_got_symbol): Take input bfd as
4283         argument.  Add entries to the master GOT hash table.
4284         (struct mips_elf_bfd2got_hash): New.
4285         (struct mips_elf_got_per_bfd_arg): New.
4286         (struct mips_elf_set_global_got_offset_arg): New.
4287         (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash,
4288         mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash,
4289         mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd,
4290         mips_elf_merge_gots, mips_elf_set_global_got_offset,
4291         mips_elf_resolve_final_got_entry,
4292         mips_elf_resolve_final_got_entries, mips_elf_adjust_gp,
4293         mips_elf_got_for_ibfd): New functions.
4294         (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT.
4295         (MIPS_ELF_GOT_MAX_SIZE): New macro.
4296         (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT.
4297         (mips_elf_got_entry_hash): Take new fields into account.  Use
4298         mips_elf_hash_bfd_vma.
4299         (mips_elf_got_entry_eq): Take new fields into account.
4300         (mips_elf_create_got_section): Initialize new fields.
4301         (mips_elf_calculate_relocation): Pass input_bfd to functions
4302         that now take it.  Adjust gp for the input_bfd.
4303         (mips_elf_allocate_dynamic_relocation,
4304         mips_elf_create_dynamic_relocation,
4305         _bfd_mips_elf_create_dynamic_sections): Use...
4306         (mips_elf_rel_dyn_section): New function.  Borrow code from...
4307         (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that
4308         now take it.  Create the got section if needed, even if
4309         excluded, before recording a global got symbol.  Move some
4310         code to...
4311         (mips_elf_record_local_got_symbol): New fn.
4312         (_bfd_mips_elf_size_dynamic_sections): Disable combreloc.
4313         Compute multi-got global entries offsets.  Move GOT code to...
4314         (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got
4315         if the GOT is too big.
4316         (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of
4317         undefweak symbol to zero.  Generate dynamic relocations for
4318         non-primary GOT entries for global symbols.
4319         (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got
4320         case.  Generate dynamic relocations for local got entries.
4321         Sort dynamic relocations on N64 too, using...
4322         (sort_dynamic_relocs_64): New fns.
4323         (_bfd_mips_elf_hide_symbol): Adjust multi-got counters.
4324         (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT.
4325
4326 2003-01-27  Alexandre Oliva  <aoliva@redhat.com>
4327
4328         * bfd.c (struct _bfd): Added id field.
4329         * opncls.c (_bfd_id_counter): New static variable.
4330         (_bfd_new_bfd): Use it.
4331         * bfd-in2.h: Rebuilt.
4332
4333 2003-01-25  Alan Modra  <amodra@bigpond.net.au>
4334
4335         * elf32-sparc.c (bfd_elf32_new_section_hook): Define.
4336
4337 2003-01-25  Jakub Jelinek  <jakub@redhat.com>
4338
4339         * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs.
4340         (elf32_sparc_rev32_howto): New variable.
4341         (sparc_reloc_map): Add TLS relocs.
4342         (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto):
4343         Handle REV32.
4344         (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject):
4345         New functions.
4346         (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry,
4347         struct elf32_sparc_link_hash_table):
4348         New structures.
4349         (elf32_sparc_tdata, elf32_sparc_local_got_tls_type,
4350         elf32_sparc_hash_table): Define.
4351         (link_hash_newfunc, elf32_sparc_link_hash_table_create,
4352         create_got_section, elf32_sparc_create_dynamic_sections,
4353         elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New
4354         functions.
4355         (elf32_sparc_check_relocs): Handle TLS relocs.  Add dynamic reloc
4356         reference counting.
4357         (elf32_sparc_gc_sweep_hook): Likewise.
4358         (elf32_sparc_adjust_dynamic_symbol): Likewise.
4359         (elf32_sparc_size_dynamic_sections): Likewise.
4360         (elf32_sparc_relocate_section): Likewise.
4361         (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff):
4362         New functions.
4363         (elf32_sparc_object_p): Allocate backend private object data.
4364         (bfd_elf32_bfd_link_hash_table_create,
4365         elf_backend_copy_indirect_symbol, bfd_elf32_mkobject,
4366         elf_backend_can_refcount): Define.
4367         (elf_backend_create_dynamic_sections): Define to
4368         elf32_sparc_create_dynamic_sections.
4369         * reloc.c: Add SPARC TLS relocs.
4370         * bfd-in2.h, libbfd.h: Rebuilt.
4371         * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs.
4372         (sparc_reloc_map): Likewise.
4373
4374 2003-01-24  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4375
4376         * bfd-in2.h: Regenerate.
4377         * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition,
4378         s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions.
4379         (elf_howto_table): Add TLS relocs.
4380         (elf_s390_reloc_type_lookup): Likewise.
4381         (elf_s390_link_hash_entry): Add tls_type.
4382         (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type):
4383         New macros.
4384         (elf_s390_link_hash_table): Add tls_ldm_got.
4385         (link_hash_newfunc): Initialize tls_type.
4386         (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got.
4387         (elf_s390_copy_indirect_symbol): Copy tls_type information.
4388         (elf_s390_check_relocs): Support TLS relocs.
4389         (elf_s390_gc_sweep_hook): Likewise.
4390         (allocate_dynrelocs): Likewise.
4391         (elf_s390_size_dynamic_sections): Likewise.
4392         (elf_s390_relocate_section): Likewise.
4393         (elf_s390_finish_dynamic_symbol): Likewise.
4394         (bfd_elf32_mkobject): Define for TLS.
4395         * elf64-s390.c: Same changes as for elf32-s390.c.
4396         * libbfd.h: Regenerate.
4397         * reloc.c: Add s390 TLS relocations.
4398
4399 2003-01-24  Charles Lepple  <clepple@ghz.cc>
4400
4401         * aclocal.m4: Fix name of --enable-install-libbfd switch.
4402
4403 2003-01-23  Nick Clifton  <nickc@redhat.com>
4404
4405         * Add sh2e support:
4406         2002-04-02  Elena Zannoni  <ezannoni@redhat.com>
4407         * archures.c (bfd_mach_sh2e): Added.
4408         * bfd-in2.h: Rebuilt.
4409         * cpu-sh.c (arch_info_struct): Added SH2e.
4410         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E.
4411
4412 2003-01-23  Alan Modra  <amodra@bigpond.net.au>
4413
4414         * elf-bfd.h (struct bfd_elf_section_data): Remove tdata.  Change
4415         dynindx to an int.  Rearrange for better packing.
4416         * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
4417         * elf32-mips.c (bfd_elf32_new_section_hook): Define.
4418         * elf32-sh64.h: New.  Split out from include/elf/sh.h.
4419         (struct _sh64_elf_section_data): New struct.
4420         (sh64_elf_section_data): Don't dereference sh64_info (was tdata).
4421         * elf32-sh64-com.c: Include elf32-sh64.h.
4422         * elf32-sh64.c: Likewise.
4423         (sh64_elf_new_section_hook): New function.
4424         (bfd_elf32_new_section_hook): Define.
4425         (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
4426         (sh64_bfd_elf_copy_private_section_data): Likewise.
4427         (sh64_elf_final_write_processing): Likewise.
4428         * elf32-sparc.c (struct elf32_sparc_section_data): New.
4429         (elf32_sparc_new_section_hook): New function.
4430         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
4431         (sec_do_relax): Define.
4432         (elf32_sparc_relax_section): Adjust to use sec_do_relax.
4433         (elf32_sparc_relocate_section): Likewise.
4434         * elf64-mips.c (bfd_elf64_new_section_hook): Define.
4435         * elf64-mmix.c (struct _mmix_elf_section_data): New.
4436         (mmix_elf_section_data): Define.  Use throughout file.
4437         (mmix_elf_new_section_hook): New function.
4438         (bfd_elf64_new_section_hook): Define.
4439         * elf64-ppc.c (struct _ppc64_elf_section_data): New.
4440         (ppc64_elf_section_data): Define.  Use throughout.
4441         (ppc64_elf_new_section_hook): New function.
4442         (bfd_elf64_new_section_hook): Define.
4443         * elf64-sparc.c (struct sparc64_elf_section_data): New.
4444         (sparc64_elf_new_section_hook): New function.
4445         (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
4446         (sec_do_relax): Define.
4447         (sparc64_elf_relax_section): Adjust to use sec_do_relax.
4448         (sparc64_elf_relocate_section): Likewise.
4449         (bfd_elf64_new_section_hook): Define.
4450         * elfn32-mips.c (bfd_elf32_new_section_hook): Define.
4451         * elfxx-mips.c (struct _mips_elf_section_data): New.
4452         (mips_elf_section_data): Define.  Use throughout.
4453         (_bfd_mips_elf_new_section_hook): New function.
4454         (mips_elf_create_got_section): Don't alloc used_by_bfd.
4455         * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
4456         * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
4457         * Makefile.am: Run "make dep-am".
4458         * Makefile.in: Regenerate.
4459
4460 2003-01-21  Richard Henderson  <rth@redhat.com>
4461
4462         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New.
4463         (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value.
4464         (elf64_alpha_adjust_dynamic_symbol): Set them.
4465         (elf64_alpha_size_plt_section_1): Reset them when plt entry removed.
4466         (elf64_alpha_relax_tls_get_addr): Handle LDM relocs.  Frob the
4467         symbol index when relaxing LDM to TPREL.
4468         (elf64_alpha_relax_section): Likewise.  Allow relaxation of GD
4469         relocs, even if the target isn't locally defined.
4470         (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero.
4471         (elf64_alpha_relocate_section): Likewise.  Force TP-relative
4472         relocs vs symndx 0 to the tp base.
4473
4474 2003-01-21  Fabio Alemagna  <falemagn@aros.org>
4475
4476         * config.bfd: Handle i[3456]86-*-aros*.
4477
4478 2003-01-21  Andreas Schwab  <schwab@suse.de>
4479
4480         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define.
4481         (struct ppc_elf_link_hash_entry): Define.
4482         (ppc_elf_hash_entry): New function.
4483         (struct ppc_elf_link_hash_table): Define.
4484         (ppc_elf_hash_table): New function.
4485         (ppc_elf_link_hash_newfunc): New function.
4486         (ppc_elf_link_hash_table_create): New function.
4487         (ppc_elf_copy_indirect_symbol): New function.
4488         (allocate_dynrelocs): New function.
4489         (readonly_dynrelocs): New function.
4490         (ppc_elf_size_dynamic_sections): Allocate space for dynamic
4491         relocs and determine DT_TEXTREL.
4492         (ppc_elf_check_relocs): Don't do that here, just count the
4493         dynamic relocs.
4494         (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the
4495         removed section.
4496         (bfd_elf32_bfd_link_hash_table_create): Define.
4497         (elf_backend_copy_indirect_symbol): Define.
4498
4499 2003-01-21  Richard Henderson  <rth@redhat.com>
4500
4501         * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and
4502         TPREL also get a reloc if shared.  Remove SREL support.
4503         (elf64_alpha_emit_dynrel): New.
4504         (elf64_alpha_relocate_section): Use it.  Resolve dynamic TPREL
4505         and GOTTPREL relocs to local symbols against the tp base.
4506         (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel.
4507
4508         * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got
4509         use count before clobbering r_type.
4510         (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn
4511         ordering would mean dataflow inspection is necessary.
4512
4513 2003-01-20  Svein E. Seldal  <Svein.Seldal@solidas.com>
4514
4515         * coffcode.h (coff_set_flags): Added get/set arch hooks.
4516
4517 2003-01-20  Fabio Alemagna  <falemagn@aros.org>
4518
4519         * elf32-sh.c: Treat elfNN_bed like other macros defined in
4520           elfxx-target.h and #undef it before #define'ing it.
4521         * elf32-i386.c: Likewise.
4522         * elf32-sh64.c: Likewise.
4523         * elf64-alpha.c: Likewise.
4524         * elf64-sh64.c: Likewise.
4525
4526 2003-01-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4527
4528         * bfd-in2.h: Regenerate.
4529         * elf32-s390.c (elf_s390_adjust_gotplt): New prototype.
4530         (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add
4531         R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16,
4532         R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16,
4533         R_390_PLTOFF32 and R_390_PLTOFF64.
4534         (elf_s390_reloc_type_lookup): Likewise.
4535         (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track
4536         of GOTPLT references to a function.
4537         (link_hash_newfunc): Initialize gotplt_refcount.
4538         (elf_s390_check_relocs): Move allocation of local_got_refcounts array
4539         and creation of the got section out of the main switch. Add support
4540         for the gotoff, gotplt and pltoff relocations.
4541         (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt
4542         and pltoff.
4543         (elf_s390_adjust_gotplt): New function.
4544         (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed
4545         plt entries.
4546         (allocate_dynrelocs): Add comment.
4547         (elf_s390_relocate_section): Change r_type to unsigned. Add support
4548         for gotoff, gotplt and pltoff relocations.
4549         * elf64-s390.c: Same changes as for elf32-s390.c.
4550         * libbfd.h: Regenerate.
4551         * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12,
4552         BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64,
4553         BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32
4554         and BFD_RELOC_390_PLTOFF64.
4555
4556 2003-01-18  Jakub Jelinek  <jakub@redhat.com>
4557
4558         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
4559         R_IA64_TPREL64[LM]SB against non-global symbol properly.
4560
4561 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
4562
4563         * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add
4564         self_dtpmod_done and self_dtpmod_offset.
4565         (allocate_global_data_got): Only use one got entry for all
4566         dtpmod relocs against local symbols.
4567         (allocate_dynrel_entries): Only need .rela.got entry for
4568         dtpmod against global symbol.
4569         (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset.
4570         Reserve space in .rela.got for the local dtpmod entry.
4571         (set_got_entry): Initialize the common local dtpmod .got entry.
4572         (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB
4573         and R_IA_64_DTPREL64MSB.
4574
4575 2003-01-16  Alan Modra  <amodra@bigpond.net.au>
4576
4577         * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h.
4578         (R_PPC_*): Rename all occurrences to R_PPC64_*.
4579         (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30.
4580         (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type.
4581         (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other
4582         relative relocs, not with absolute ones.
4583         * Makefile.am: Run "make dep-am".
4584         * Makefile.in: Regenerate.
4585         * po/SRC-POTFILES.in: Regenerate.
4586
4587 2003-01-15  Andreas Schwab  <schwab@suse.de>
4588
4589         * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a
4590         relocation against a non-allocated readonly section.
4591
4592 2003-01-10  Alan Modra  <amodra@bigpond.net.au>
4593
4594         * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
4595         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.  PLTGOT16_HA too.
4596
4597 2002-01-08  Klee Dienes  <kdienes@apple.com>
4598
4599         * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
4600         (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
4601         * Makefile.in: Regenerate.
4602
4603 2003-01-08  Alexandre Oliva  <aoliva@redhat.com>
4604
4605         * elfn32-mips.c (prev_reloc_section): New.
4606         (GET_RELOC_ADDEND): Use it.  Parenthesize macro arguments.
4607         (SET_RELOC_ADDEND): Parenthesize macro argument.
4608
4609 2003-01-07  John David Anglin  <dave.anglin@nrc.gc.ca>
4610
4611         * elf32-hppa.c (final_link_relocate): For all DP relative relocations,
4612         adjust addil instructions if the symbol has no section.
4613
4614 2003-01-07  DJ Delorie  <dj@redhat.com>
4615
4616         * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not
4617         partial_inplace.
4618
4619 2003-01-07  Andreas Schwab  <schwab@suse.de>
4620
4621         * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for
4622         PC relative relocations.
4623         (elf_m68k_discard_copies): Set it here instead.
4624
4625 2002-01-02  Ben Elliston  <bje@redhat.com>
4626             Jeff Johnston  <jjohnstn@redhat.com>
4627
4628         * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo.
4629         (ALL_MACHINES_CFILES): Add cpu-iq2000.c.
4630         (BFD32_BACKENDS): Add elf32-iq2000.lo.
4631         (BFD32_BACKENDS_CFILES): Add elf32-iq2000.c.
4632         (cpu-iq2000.lo): New target.
4633         * Makefile.in: Regenerate.
4634         * config.bfd: Handle iq2000-*-elf.
4635         * archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000.
4636         (bfd_archures_list): Add bfd_iq2000_arch.
4637         * configure.in: Handle bfd_elf32_iq2000_vec.
4638         * configure: Regenerate.
4639         * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
4640         and BFD_RELOC_IQ2000_UHI16.
4641         * targets.c (bfd_elf32_iq2000_vec): Declare.
4642         (bfd_target_vector): Add bfd_elf32_iq2000_vec.
4643         * elf.c (prep_headers): Set e_machine to EM_IQ2000.
4644         * cpu-iq2000.c: New file.
4645         * elf32-iq2000.c: Likewise.
4646         * libbfd.h: Regenerate.
4647         * bfd-in2.h: Likewise.
4648
4649 2003-01-02  Richard Sandiford  <rsandifo@redhat.com>
4650
4651         * elfxx-mips.c: Include libiberty.h.
4652         (elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove.
4653         (mips_set_isa_flags): New function, split out from...
4654         (_bfd_mips_elf_final_write_processing): ...here.  Only call
4655         mips_set_isa_flags if the EF_MIPS_MACH bits are clear.
4656         (mips_mach_extensions): New array.
4657         (mips_32bit_flags_p): New function.
4658         (_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks.
4659         Use mips_32bit_flags_p to check if one binary is 32-bit and the
4660         other is 64-bit.  When adopting IBFD's architecture, adopt the
4661         bfd_mach as well as the flags.
4662
4663 2003-01-02  Nick Kelsey  <nickk@ubicom.com>
4664
4665         * elf32-ip2k.c: Re-work of linker relaxation code for the ip2k to
4666         fix internal errors, fix bad code generation, fix incorrect stabs
4667         information, and improve ability to eliminate redundant page
4668         instructions. Added code to ip2k_final_link_relocate to self-verify
4669         the linker relaxation.  Fix formatting problems.
4670
4671 2002-12-30  Chris Demetriou  <cgd@broadcom.com>
4672
4673         * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case.
4674         * archures.c (bfd_mach_mipsisa32r2): New define.
4675         * bfd-in2.h: Regenerate.
4676         * cpu-mips.c (I_mipsisa32r2): New enum value.
4677         (arch_info_struct): Add entry for I_mipsisa32r2.
4678         * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach)
4679         (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2.
4680         (_bfd_mips_elf_final_write_processing): Add
4681         bfd_mach_mipsisa32r2 case.
4682         (_bfd_mips_elf_merge_private_bfd_data): Handle merging of
4683         binaries marked as using MIPS32 Release 2.
4684
4685 2002-12-30    Dmitry Diky <diwil@mail.ru>
4686
4687         * Makefile.am: Add msp430 target.
4688         * configure.in: Likewise.
4689         * Makefile.in: Regenerate.
4690         * configure: Regenerate.
4691         * archures.c: Add msp430 architecture vector.
4692         * config.bfd: Likewise.
4693         * reloc.c: Add msp430 relocs.
4694         * targets.c: Add msp320 target.
4695         * cpu-msp430.c: New file: msp430 cpu detection.
4696         * elf32-msp430.c: New file: msp430 reloc processing.
4697         * bfd-in2.h: Regenerate.
4698         * libbfd.h: Regenerate.
4699
4700 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
4701
4702         * elf.c (elf_sort_sections): Don't reorder .tbss.
4703         (assign_file_positions_for_segments): Only adjust off/voff
4704         for increased alignment in PT_LOAD or PT_NOTE segment,
4705         but adjust p_filesz for .tbss too.  in PT_LOAD consider
4706         .tbss to have zero memory size.
4707         (copy_private_bfd_data) [SECTION_SIZE]: Define.
4708         [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it.
4709         [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections
4710         into PT_TLS segment.  Never put SHF_TLS sections in
4711         segments other than PT_TLS or PT_LOAD.
4712
4713         * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Clear .plt
4714         sh_entsize.
4715
4716 2002-12-23  DJ Delorie  <dj@redhat.com>
4717
4718         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Fix logic reversal.
4719
4720 2002-12-23  Alan Modra  <amodra@bigpond.net.au>
4721
4722         * elflink.h (elf_link_output_extsym): Heed strip_discarded.
4723
4724 2002-12-23  Nick Clifton  <nickc@redhat.com>
4725
4726         * archures.c (bfd_arch_get_compatible): Add third parameter
4727         'accept_unknowns'.  Only accept unknown format BFDs if
4728         accept_unknowns is true, or if the format is "binary".
4729         * bfd-in2.h: Regenerate.
4730
4731 2002-12-21  Nick Clifton  <nickc@redhat.com>
4732
4733         * coff-arm.c (coff_arm_relocate_section): Disable WINCE workaround
4734         that subtracted 8 from pc relative relocations.
4735
4736 2002-12-20  Kazu Hirata  <kazu@cs.umass.edu>
4737
4738         * coff-h8300.c: Fix comment typos.
4739         * coffcode.h: Likewise.
4740         * cpu-cris.c: Likewise.
4741         * elf32-vax.c: Likewise.
4742         * genlink.h: Likewise.
4743         * linker.c: Likewise.
4744         * som.c: Likewise.
4745         * tekhex.c: Likewise.
4746         * vms-misc.c: Likewise.
4747
4748 2002-12-20  DJ Delorie  <dj@redhat.com>
4749
4750         * reloc.c: Add BFD_RELOC_XSTORMY16_12.
4751         * libbfd.h: Regenerate.
4752         * bfd-in2.h: Regenerate.
4753         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12.
4754         (xstormy16_reloc_map): Add R_XSTORMY16_12.
4755
4756 2002-12-19  Kazu Hirata  <kazu@cs.umass.edu>
4757
4758         * doc/bfdint.texi: Fix typos.
4759
4760 2002-12-20  Paul Eggert  <eggert@twinsun.com>
4761
4762         Port to POSIX 1003.1-2001.
4763         * acinclude.m4 (AM_INSTALL_LIBBFD): Do not rely on "test -o".
4764         * configure.in (build-warnings): Likewise.
4765         (Horrible hacks to build DLLs on Windows): Do not rely on "tail -1".
4766         * aclocal.m4: Regenerate.
4767         * config.in: Regenerate.
4768         * configure: Regenerate.
4769
4770 2002-12-19  Alan Modra  <amodra@bigpond.net.au>
4771
4772         * coff-h8300.c: Include libiberty.h.
4773         (h8300_reloc16_extra_cases): Check the hash table creator before
4774         referencing h8300 specific fields.  Stash the hash table pointer
4775         in a local var.  Comment typo fixes.
4776         (h8300_bfd_link_add_symbols): Likewise.
4777
4778         * reloc.c (struct reloc_howto_struct): Revise src_mask and
4779         dst_mask comments.
4780         * bfd-in2.h: Regenerate.
4781
4782 2002-12-18  Alan Modra  <amodra@bigpond.net.au>
4783
4784         * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc
4785         code a little.  Comment on dynamic relocs against section symbols.
4786
4787 2002-12-17  Roger Sayle  <roger@eyesopen.com>
4788
4789         * configure.host (ia64-*-hpux*): Support 64 bit targets using
4790         the HP compiler's "long long".
4791
4792 2002-12-16  Andrew MacLeod  <amacleod@redhat.com>
4793
4794         * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_LO16
4795         and R_XSTORMY16_HI16) howto entries.
4796         (xstormy16_reloc_map): Map R_XSTORMY16_{LO,HI}16 to BFD_RELOC_{LO,HI}16.
4797         (xstormy16_info_to_howto_rela): Use R_XSTORMY16_GNU_VTINHERIT to
4798         determine the start of the second reloc table.
4799
4800 2002-12-16  Nathan Tallent  <eraxxon@alumni.rice.edu>
4801
4802         * ecofflink.c: Fix the reading of the debugging information
4803         of Tru64/Alpha binaries that are produced by recent Compaq
4804         compilers.
4805         (mk_fdrtab): Fix error in creating the FDR (file descriptor)
4806         table.
4807         (lookup_line): Because of the strange information sometimes
4808         generated by Compaq's recent compilers, change how the FDR
4809         table is searched so that PDRs (procedure descriptors) are
4810         correctly found.  Note that this change is really more of a hack;
4811         however, I have included extensive documentation as to why
4812         this is the best solution short of an extensive rewrite or
4813         another hack.
4814         (fdrtab_lookup): Add comments to explain the algorithm.
4815
4816 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4817
4818         * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Reorder
4819         initializers to match struct declaration.
4820
4821 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
4822
4823         * dwarf2.c (comp_unit_contains_address): Comment typo fix.
4824         * elf.c (get_program_header_size): Likewise.
4825         * elf32-m32r.c (m32r_elf_lo16_reloc): Likewise.
4826         (m32r_elf_generic_reloc): Likewise.
4827         * elf32-ppc.c (ppc_elf_howto_init): Likewise.
4828         * elflink.h (elf_bfd_discard_info): Likewise.
4829
4830 2002-12-12  Alan Modra  <amodra@bigpond.net.au>
4831
4832         * elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset
4833         to DT_JMPREL.  Use srelplt input section size for DT_PLTRELSZ and
4834         DT_RELSZ adjustment, not output section.  Avoid writing tags when
4835         unchanged.  Don't assume linker script is sane, adjust DT_REL too.
4836         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw
4837         size of srelplt for DT_PLTRELSZ.  Use srelplt input section size for
4838         DT_RELASZ adjustment, not output section.  Avoid writing tags when
4839         unchanged.  Adjust DT_RELA.
4840         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better
4841         formatting.  Avoid writing tags when unchanged.  Adjust DT_RELA.
4842
4843 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4844
4845         * elfxx-mips.c (mips_elf_calculate_relocation): Don't divide
4846         addend by 4.
4847
4848 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
4849
4850         * elfxx-mips.c (struct mips_got_entry): New.
4851         (struct mips_got_info): Added got_entries field.
4852         (mips_elf_got_entry_hash, mips_elf_got_entry_eq): New functions.
4853         (mips_elf_local_got_index, mips_elf_got_page,
4854         mips_elf_got16_entry): Re-implement in terms of new...
4855         (mips_elf_create_local_got_entry): Rewrite to use got_entries.
4856         Change return type.
4857         (mips_elf_highest): Warning clean-up.
4858         (mips_elf_create_got_section): Initialize got_entries.
4859         (_bfd_mips_elf_check_relocs): Use got_entries to estimate
4860         local got size.
4861         (_bfd_mips_elf_size_dynamic_sections): Do not account for
4862         GOT_PAGE entries, since we now reuse GOT16 entries.
4863
4864 2002-12-10  Jason Thorpe  <thorpej@wasabisystems.com>
4865
4866         * aoutx.h (set_section_contents): Allow an otherwise unrepresentable
4867         read-only section that lies after .text and before .data to be
4868         written into the output file and included in a_text.
4869         (translate_to_native_sym_flags): If an otherwise unrepresentable
4870         section was merged with .text, convert its symbols to N_TEXT
4871         symbols.
4872         * libaout.h (aout_section_merge_with_text_p): New macro.
4873
4874 2002-12-08  Alan Modra  <amodra@bigpond.net.au>
4875
4876         * bfd-in.h: Comment typo fix.  Formatting.
4877         * bfd-in2.h: Regenerate.
4878         * coff64-rs6000.c (xcoff64_openr_next_archived_file): Warning fix.
4879         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): Prototype.
4880         * elf64-mmix.c (mmix_dump_bpo_gregs): Warning fix.
4881
4882 2002-12-05  Richard Henderson  <rth@redhat.com>
4883
4884         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21BI.
4885         Only send PCREL21B though the plt.  Fix installed reloc type.
4886         (elfNN_ia64_relocate_section): Give error for dynamic reloc
4887         against PCREL22 or PCREL64I; clean up error messages for
4888         branch relocs.
4889
4890 2002-12-04  Kevin Buettner  <kevinb@redhat.com>
4891
4892         * elf64-mips.c (elf64_mips_grok_prstatus, elf64_mips_grok_psinfo):
4893         New functions.
4894         (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
4895
4896 2002-12-04  David Mosberger  <davidm@hpl.hp.com>
4897
4898         * cpu-ia64-opc.c: Add operand constant "ar.csd".
4899
4900 2002-12-04  H.J. Lu <hjl@gnu.org>
4901
4902         * elfxx-ia64.c (get_local_sym_hash): Use section ID instead of
4903         BFD address when constructing local name.
4904
4905 2002-12-04  Andreas Schwab  <schwab@suse.de>
4906
4907         * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec
4908         member.
4909         (elf_m68k_link_hash_table_create): Initialize it.
4910         (elf_m68k_check_relocs): Handle symbols that are forced to be
4911         local due to visibility changes.
4912         (elf_m68k_adjust_dynamic_symbol): Likewise.
4913         (elf_m68k_size_dynamic_sections): Likewise.
4914         (elf_m68k_discard_copies): Likewise.
4915         (elf_m68k_relocate_section): Likewise.
4916
4917 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
4918
4919         * elf64-ppc.c (ppc64_elf_edit_opd): Correct typo.
4920
4921 2002-12-04  Alan Modra  <amodra@bigpond.net.au>
4922
4923         * srec.c (srec_write_symbols): Restore '$' prefix to address
4924         accidentally removed in 2002-04-04 change.
4925         (srec_get_symtab): Use 0 instead of `(long) FALSE'.
4926
4927 2002-12-03  Nick Clifton  <nickc@redhat.com>
4928
4929         * elf32-ppc.c (apuinfo_list_init): New function.
4930         (apuinfo_list_add): New function: Add a value to the list.
4931         (apuinfo_list_length): New function: Return the number of
4932         values on the list.
4933         (apuinfo_list_element): New function: Return a value on the
4934         list.
4935         (apuinfo_list_finish): New function: Free the resources used
4936         by the list.
4937         (ppc_elf_begin_write_processing): New function.  Scan the
4938         input bfds for apuinfo sections.
4939         (ppc_elf_write_section): New function: Delay the creation of
4940         the contents of an apuinfo section in an output bfd.
4941         (ppc_elf_final_write_processing): New function.  Create the
4942         contents of an apuinfo section in an output bfd.
4943         (elf_backend_begin_write_processing): Define.
4944         (elf_backend_final_write_processing): Define.
4945         (elf_backend_write_section): Define.
4946
4947 2002-12-03  Richard Henderson  <rth@redhat.com>
4948
4949         * cpu-ia64-opc.c (elf64_ia64_operands): Add ldxmov entry.
4950
4951 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
4952
4953         Fix PR savannah/1417:
4954         * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Don't adjust
4955         branch if it goes to the start of the deleted region.
4956
4957 2002-12-01  Stephane Carrez  <stcarrez@nerim.fr>
4958
4959         * bfd-in2.h (bfd_mach_m6812): Rebuild.
4960         * archures.c (bfd_mach_m6812_default, bfd_mach_m6812,
4961         bfd_mach_m6812s): Declare.
4962
4963         * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): New function.
4964         (_bfd_m68hc12_elf_set_private_flags): Call it.
4965         (_bfd_m68hc12_elf_print_private_bfd_data): Report processor version.
4966         (_bfd_m68hc12_elf_merge_private_bfd_data): Merge the flags and
4967         report microcontroller incompatibilities (HC12 vs HCS12).
4968         (elf_backend_object_p): Update.
4969
4970 2002-11-30  Alan Modra  <amodra@bigpond.net.au>
4971
4972         * bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete.
4973         (enum bfd_boolean, boolean): Delete.
4974         (bfd_boolean): Typedef to an int.
4975         (FALSE, TRUE): Define.
4976         * aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c,
4977         aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h,
4978         aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c,
4979         binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
4980         coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c,
4981         coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c,
4982         coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c,
4983         coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c,
4984         coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c,
4985         coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c,
4986         corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c,
4987         cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c,
4988         cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c,
4989         cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c,
4990         cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c,
4991         cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c,
4992         cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c,
4993         cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c,
4994         cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c,
4995         cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c,
4996         dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c,
4997         elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
4998         elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c,
4999         elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
5000         elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h,
5001         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
5002         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
5003         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
5004         elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c,
5005         elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
5006         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
5007         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
5008         elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c,
5009         elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h,
5010         elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
5011         elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c,
5012         hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c,
5013         i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c,
5014         libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h,
5015         libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c,
5016         m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c,
5017         mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c,
5018         nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
5019         pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c,
5020         pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c,
5021         pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c,
5022         reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c,
5023         som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c,
5024         syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c,
5025         vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h,
5026         xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with
5027         bfd_boolean, true with TRUE, false with FALSE.  Simplify comparisons
5028         of bfd_boolean vars with TRUE/FALSE.  Formatting.
5029         * bfd-in2.h, libbfd.h, libcoff.h: Regenerate
5030
5031 2002-11-28  Alan Modra  <amodra@bigpond.net.au>
5032
5033         * elf-bfd.h: Replace occurrences of Elf32_Internal_* and
5034         Elf64_Internal_* with Elf_Internal_*.  Replace Elf_Internal_Rel
5035         with Elf_Internal_Rela.
5036         * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
5037         elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
5038         elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
5039         elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
5040         elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
5041         elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
5042         elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
5043         elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
5044         elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
5045         elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
5046         elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
5047         * elf-hppa.h (elf_hppa_internal_shdr): Delete.  Use Elf_Internal_Shdr
5048         throughout instead.
5049         * elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
5050         * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
5051         Remove INLINE keyword.
5052         (elf_swap_reloc_in): Likewise.  Also clear r_addend.
5053         (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
5054         as a bfd_byte *.
5055         (elf_write_relocs): Consolidate REL and RELA code.
5056         (elf_slurp_reloc_table_from_section): Simplify REL code.
5057         (NAME(_bfd_elf,size_info)): Populate reloc swap entries.
5058         * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
5059         * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
5060         RELA code.
5061         (elf_link_adjust_relocs): Likewise.  Don't malloc space for temp
5062         reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
5063         (elf_link_output_relocs): Likewise.
5064         (elf_reloc_link_order): Likewise.
5065         (elf_finish_pointer_linker_section): Likewise.
5066         (struct elf_link_sort_rela): Remove union.
5067         (elf_link_sort_cmp1): Update to suit.
5068         (elf_link_sort_cmp2): Here too.
5069         (elf_link_sort_relocs): Consolidate REL and RELA code.  Fix memory
5070         over-allocation for int_rels_per_ext_rel != 1 case.
5071         * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
5072         * elf32-i386.c: Likewise.
5073         * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
5074         * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
5075         elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
5076         * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
5077         * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
5078         elf64-sparc.c, elf64-x86-64.c: Likewise.
5079         * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
5080         * elfxx-mips.c (sort_dynamic_relocs): Likewise for
5081         bfd_elf32_swap_reloc_in.
5082
5083         * elf32-arm.h: Update elf32_arm_info_to_howto calls.
5084         * elf32-mips.c: Likewise for mips_info_to_howto_rel.
5085         (mips_elf64_swap_reloc_in): Zero r_addend.
5086         (mips_elf64_be_swap_reloc_in): Likewise.
5087         (mips_elf64_slurp_one_reloc_table): Simplify.
5088
5089         * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
5090         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
5091         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
5092
5093 2002-11-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5094
5095         * elf32-sh.c (sh_elf_relocate_section): Don't complain about
5096         unresolved debugging relocs in dynamic applications.
5097         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
5098
5099 2002-11-26  Alan Modra  <amodra@bigpond.net.au>
5100
5101         * elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
5102         (_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs
5103         on a relocatable link.  Comment typos.
5104         * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure
5105         in the order they are declared.  Clear elf_hash_value too.
5106         (_bfd_elf_link_hash_table_init): Likewise assign in order.  Clear
5107         eh_info and tls_segment.
5108         * elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets
5109         sorted when discarding relocs by turning them into R_*_NONE.
5110
5111         * libbfd.c (warn_deprecated): Comment spelling.
5112         * po/SRC-POTFILES.in: Regenerate.
5113
5114 2002-11-21  Richard Henderson  <rth@redhat.com>
5115
5116         * elflink.h (elf_link_add_object_symbols): Don't overwrite the
5117         arch's st_other bits when merging visibilities.
5118         (elf_link_output_extsym): Tidy clearing of visibility field.
5119
5120 2002-11-21  Alan Modra  <amodra@bigpond.net.au>
5121
5122         * coff-mcore.c (SWAP_IN_RELOC_OFFSET): Define.
5123         (SWAP_OUT_RELOC_OFFSET): Define.
5124
5125 2002-11-20  Alexandre Oliva  <aoliva@redhat.com>
5126
5127         * elf.c (_bfd_elf_link_hash_table_init): Make sure
5128         can_refcount is properly extended to the type of
5129         init_refcount.
5130
5131 2002-11-19  Alexandre Oliva  <aoliva@redhat.com>
5132
5133         * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro.
5134         (_bfd_mips_elf_relocate_section): Use it.
5135
5136         * elfxx-mips.c (MNAME): New macro.
5137         (_bfd_mips_elf_check_relocs): Use it.
5138         (_bfd_mips_elf_discard_info): Likewise.
5139         (_bfd_mips_elf_final_link): Likewise.
5140
5141 2002-11-19  Alan Modra  <amodra@bigpond.net.au>
5142
5143         * elf64-ppc.c (ppc64_elf_edit_opd): When deleting relocs, adjust
5144         rel_hdr.sh_size too.
5145
5146 2002-11-18  Klee Dienes  <kdienes@apple.com>
5147
5148         * Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo.
5149         (BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c.
5150         (BFD_H_FILES): Add bfdwin.c, bfdio.c.
5151         (LIBBFD_H_FILES): Add bfdwin.c, bfdio.c.
5152         Add dependencies for bfdwin.c, bfdio.c.
5153         * bfd.c: Remove bfd_get_mtime, bfd_get_size.
5154         * libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal,
5155         bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite,
5156         bfd_tell, bfd_flush, bfd_stat, bfd_seek.
5157         * bfdio.c: New file.  Contains real_read, bfd_bread, bfd_write,
5158         bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime,
5159         bfd_get_size (moved from libbfd.c and bfd.c).
5160         * bfdwin.c New file.  Contains _bfd_window_internal,
5161         bfd_init_window, bfd_free_window, bfd_get_file_window (moved from
5162         libbfd.c and bfd.c).
5163         * po/SRC-POTFILES.in: Regenerate.
5164         * po/bfd.pot: Regenerate.
5165         * libbfd.h: Regenerate.
5166         * bfd-in2.h: Regenerate.
5167         * aclocal.m4: Regenerate.
5168         * Makefile.in: Regenerate.
5169         * configure: Regenerate.
5170
5171 2002-11-18  Klee Dienes  <kdienes@apple.com>
5172
5173         * bfd.c (bfd_preserve_save): Don't zero BFD_IN_MEMORY.
5174
5175 2002-11-15  Kazu Hirata  <kazu@cs.umass.edu>
5176
5177         * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away
5178         jsr after a short jump.
5179         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
5180
5181 2002-11-15  Klee Dienes  <kdienes@apple.com>
5182
5183         * pef.c (bfd_pef_convert_architecture): Move declaration of
5184         ARCH_POWERPC and ARCH_M68K to the start of the function.
5185
5186 2002-11-14  Svein E. Seldal  <Svein.Seldal@solidas.com>
5187
5188         * coff-tic4x.c (tic4x_howto_table): Formatting fixup
5189
5190 2002-11-14  Hans-Peter Nilsson  <hp@bitrange.com>
5191
5192         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs):
5193         For bpo_gregs_section->contents, allocate _raw_size, not
5194         _cooked_size.
5195
5196 2002-11-13  Klee Dienes  <kdienes@apple.com>
5197
5198         * config.bfd: Add entries for powerpc-*-darwin and cousins.
5199
5200 2002-11-13  H.J. Lu <hjl@gnu.org>
5201
5202         * elfcode.h (elf_object_p): Don't restore abfd->arch_info.
5203
5204 2002-11-13  Klee Dienes  <kdienes@apple.com>
5205             Alan Modra  <amodra@bigpond.net.au>
5206
5207         * bfd.c (struct bfd_preserve): New.
5208         (bfd_preserve_save): New function.
5209         (bfd_preserve_restore): Ditto.
5210         (bfd_preserve_finish): Ditto.
5211         * bfd-in2.h: Regenerate.
5212         * mach-o.c: Formatting.
5213         (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned.
5214         (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish.
5215         (bfd_mach_o_core_p): Ditto.
5216         (bfd_mach_o_scan): Pass in mdata.
5217         * mach-o.h (bfd_mach_o_scan): Update prototype.
5218         * pef.c: Formatting.
5219         (bfd_pef_object_p): Use bfd_preserve_save/restore/finish.
5220         (bfd_pef_xlib_object_p): Ditto.
5221         (bfd_pef_scan): Pass in mdata.  Move version check to bfd_pef_object_p.
5222         * pef.h (bfd_pef_scan): Update prototype.
5223         * xsym.c: Formatting, K&R fixes.
5224         (bfd_sym_object_p): Use bfd_preserve_save/restore/finish.
5225         (bfd_sym_scan): New function split out from bfd_sym_object_p.
5226         * xsym.h (bfd_sym_scan): Declare.
5227         * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish.
5228         * elfcore.h (elf_core_file_p): Likewise.
5229         * targets.c (_bfd_target_vector): Revert 2002-11-08 change.
5230
5231 2002-11-12  Nick Clifton  <nickc@redhat.com>
5232
5233         * po/da.po: Updated Danish translation.
5234
5235 2002-11-12  Alan Modra  <amodra@bigpond.net.au>
5236
5237         * elflink.h (elf_link_add_object_symbols): Optimize stabs for
5238         relocatable link too.
5239         (elf_link_input_bfd): When emitting relocs, adjust offsets for
5240         eh_frame and stab sections.  Zap deleted relocs.
5241         (elf_reloc_symbol_deleted_p): Return true for zero r_symndx.
5242         (elf_bfd_discard_info): Run for relocatable link too.
5243         * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd.  Make global.
5244         Handle ld -r case.
5245         (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here.
5246         * elf64-ppc.h (ppc64_elf_edit_opd): Declare.
5247
5248         * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c.
5249         (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise.
5250         (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise.
5251         (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR.
5252         (struct eh_frame_hdr_info): Add "hdr_sec", remove "split".
5253         (struct elf_link_hash_table): Add eh_info.
5254         (struct elf_obj_tdata): Change eh_frame_hdr to an asection *.
5255         (_bfd_elf_discard_section_eh_frame): Update prototype.
5256         (_bfd_elf_discard_section_eh_frame_hdr): Likewise.
5257         (_bfd_elf_write_section_eh_frame): Likewise.
5258         (_bfd_elf_write_section_eh_frame_hdr): Likewise.
5259         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec"
5260         param.  Get "hdr_info" from link hash table.
5261         (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param.  Get
5262         header section from link hash table.  Save header section to elf_tdata.
5263         (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec".  Use
5264         header section from link hash table.  Don't alloc hdr_info.  Clear
5265         hdr_sec instead of setting "strip".
5266         (_bfd_elf_eh_frame_section_offset): Formatting.
5267         (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param.
5268         Get header section from link hash table.
5269         (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param.
5270         Get header section from link hash table.
5271         * elf.c (map_sections_to_segments): Use cached eh_frame_hdr.
5272         (get_program_header_size): Likewise.
5273         (_bfd_elf_section_offset): Formatting.
5274         * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header
5275         section pointer in link hash table.
5276         (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr
5277         and _bfd_elf_write_section_eh_frame calls.  Update comment about
5278         eh_frame entries.
5279         (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and
5280         _bfd_elf_discard_section_eh_frame_hdr calls.  Remove "ehdr".
5281
5282         * po/SRC-POTFILES.in: Regenerate.
5283
5284         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero
5285         relocs for discarded FDEs.  Remove dead code.
5286         (_bfd_elf_write_section_eh_frame_hdr): Remove dead code.
5287         * elflink.h (elf_bfd_discard_info): Don't save edited relocs.
5288         Tidy conditions under which stabs are edited.  Formatting.
5289         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
5290         from discarded relocs.
5291         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output
5292         section adjustments after testing magic values.
5293
5294 2002-11-12  Thomas Moestl <tmm@FreeBSD.org>
5295
5296         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct
5297         references to large plt symbols.
5298
5299 2002-11-12  Klee Dienes  <kdienes@apple.com>
5300
5301         * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when
5302         looking for an unused section name.
5303
5304 2002-11-11  Kazu Hirata  <kazu@cs.umass.edu>
5305
5306         * coff-h8300.c: Fix formatting.
5307         * elf32-h8300.c: Likewise.
5308         * reloc16.c: Likewise.
5309
5310 2002-11-09  Jeroen Dobbelaere  <jeroen.dobbelaere@acunia.com>
5311
5312         * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output
5313         section when dynamic section unused;  _bfd_strip_section_from_output
5314         instead.
5315
5316 2002-11-08  Alan Modra  <amodra@bigpond.net.au>
5317
5318         * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec
5319         and sym_vec.
5320
5321         * dwarf2.c: Revert last change.
5322
5323 2002-11-07  Michal Ludvig  <mludvig@suse.cz>
5324
5325         * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
5326         _bfd_dwarf2_find_nearest_line): Use
5327         bfd_simple_get_relocated_section_contents() instead of
5328         bfd_get_section_contents().
5329         * reloc.c (bfd_perform_relocation): Add sanity check.
5330         * simple.c (simple_get_relocated_section_contents): If the section
5331         does not have any relocs associated with it, just return the
5332         unadjusted contents.
5333
5334 2002-11-07  Hans-Peter Nilsson  <hp@axis.com>
5335
5336         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOT,
5337         case R_CRIS_32_GOT>: Correct test for filling in constant .got
5338         contents, enabling for a non-DSO, for symbols defined in the
5339         program with --export-dynamic.
5340
5341 2002-11-07  Alan Modra  <amodra@bigpond.net.au>
5342
5343         * elf64-ppc.c: Comment typo fixes.
5344         (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input.
5345
5346 2002-11-07  Nick Clifton  <nickc@redhat.com>
5347
5348         * po/da.po: Updated Danish translation.
5349
5350 2002-11-06  Alexandre Oliva  <aoliva@redhat.com>
5351
5352         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate
5353         exactly three internal relocs per external reloc.  Set reloc_count
5354         to the external reloc count.
5355
5356 2002-11-06  Klee Dienes  <kdienes@apple.com>
5357
5358          * coff-stgo32.c (stub_bytes): Mark as const.
5359          Fix comment formatting.
5360
5361 2002-11-06  Klee Dienes  <kdienes@apple.com>
5362
5363         * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and
5364         xsym.lo.
5365         (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c.
5366         (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h
5367         * archures.c (enum bfd_architecture): Add bfd_arch_m98k.
5368         * bfd.c (struct bfd): Add private data for mach-o, pef, and sym.
5369         * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and
5370         sym.
5371         (_bfd_target_vector): Add target vectors for mach-o, pef, and sym.
5372         * Makefile.in: Regenerate.
5373         * doc/Makefile.in: Regenerate.
5374         * bfd-in2.h: Regenerate.
5375         * xsym.c: New file.  Contains support for the Apple/Metrowerks
5376         xSYM debugging format.
5377         * xsym.h: New file.
5378         * pef.c: New file.  Contains support for the Apple Code Fragment
5379         Manager Preferred Executable Format
5380         * pef.h: New file.
5381         * pef-traceback.h: New file.  Contains support for parsing PowerPC
5382         traceback tables as used by PEF executables (and perhaps other
5383         systems as well).
5384         * mach-o.c: New file.  Contains support for the Mach-O object file
5385         format.
5386         * mach-o.h: New file.
5387         * mach-o-target.c: New file.  Declares the mach-o targets
5388         themselves.  Included three times by mach-o.c; each time with a
5389         different set of macros set.
5390
5391 2002-11-06  Graeme Peterson  <gp@qnx.com>
5392
5393         * Makefile.am: Remove entries for elf32-qnx.[ch].
5394         * Makefile.in: Regenerate.
5395         * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec,
5396         ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use
5397         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
5398         * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec,
5399         bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec,
5400         and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets.
5401         bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
5402         * configure: Regenerate.
5403         * elf32-qnx.c: Remove.
5404         * elf32-qnx.h: Remove.
5405         * elf.c: Remove calls to QNX specific set_nonloadable_filepos,
5406         is_contained_by_filepos, and copy_private_bfd_data_p.
5407         * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos,
5408         is_contained_by_filepos, and copy_private_bfd_data_p.
5409         * elf32-i386.c: Remove QNX extended bfd support.
5410         * elf32-ppc.c: Remove QNX extended bfd support.
5411         * elf32-sh.c: Remove QNX extended bfd support.
5412         * elfarm-nabi.c: Remove QNX extended bfd support.
5413         * targets.c: Remove qnx vectors.
5414         * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove
5415         (elf_backend_is_contained_by_filepos): Remove.
5416         (elf_backend_copy_private_bfd_data_p): Remove.
5417         * po/SRC-POTFILES.in: Regenerate.
5418
5419 2002-11-06  David O'Brien  <obrien@FreeBSD.org>
5420             Alan Modra  <amodra@bigpond.net.au>
5421
5422         * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of
5423         dynamic relocs against section symbols for the output section vma.
5424
5425 2002-11-05  Alan Modra  <amodra@bigpond.net.au>
5426
5427         * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn,
5428         t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove.
5429
5430 2002-11-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5431             Alan Modra  <amodra@bigpond.net.au>
5432
5433         * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64
5434         vectors in target_selvecs.
5435         (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors
5436         in target_selvecs.
5437         (sh-*-netbsdelf*): Likewise.
5438         * configure.in (assocvecs): New variable.  Handle assocvecs like
5439         selvecs.
5440         * configure: Regenerate.
5441         * format.c (bfd_check_format_matches): Store bfd_target pointers
5442         in matching_vector instead of target names.  Select first target
5443         from bfd_associated_vector that matches a list of ambiguous targets.
5444         * targets.c (_bfd_associated_vector): New array.
5445         (bfd_associated_vector): New variable.
5446         (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec.
5447         * libbfd-in.h (bfd_associated_vector): Declare.
5448         * libbfd.h: Regenerate.
5449
5450 2002-11-05  Elias Athanasopoulos  <eathan@otenet.gr>
5451
5452         * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
5453         non-NULL before dereferencing.
5454
5455 2002-11-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5456
5457         * vms.c (vms_object_p): Restore the start address when returning
5458         NULL.
5459
5460 2002-11-04  Alan Modra  <amodra@bigpond.net.au>
5461             Hans-Peter Nilsson  <hp@axis.com>
5462
5463         * elflink.h (struct elf_final_link_info): Add shndxbuf_size.
5464         (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields.
5465         Set up a larger symshndxbuf, and write it out.  Free it on
5466         exit rather than freeing symbuf twice.  Correct section index
5467         on output section symbol loop.
5468         (elf_link_output_sym): Accumulate symbol extension section
5469         indices, reallocating symshndxbuf rather than writing it out.
5470         (elf_link_flush_output_syms): Don't flush symshndxbuf.
5471         * elf.c (assign_section_numbers): Init i_shdrp to all zero.
5472         Use bfd_zalloc to clear i_shdrp[0] too.
5473
5474 2002-11-03  Stephen Clarke <stephen.clarke@earthling.net>
5475
5476          * elf32-sh64-com.c (sh64_address_in_cranges): Use
5477         _raw_size of cranges section if _cooked_size not yet set.
5478
5479 2002-11-03  Hans-Peter Nilsson  <hp@axis.com>
5480
5481         * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters
5482         for bfd_elf32_swap_symbol_out.
5483
5484 2002-10-31  David O'Brien  <obrien@FreeBSD.org>
5485
5486         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
5487         signed and unsigned in comparison.
5488
5489 2002-10-30  Daniel Jacobowitz  <drow@mvista.com>
5490
5491         * coffcode.h: Remove extraneous '\'.
5492
5493 2002-10-28  H.J. Lu <hjl@gnu.org>
5494
5495         * Makefile.am (targets.lo): Depend on Makefile instead of
5496         config.status.
5497         (archures.lo): Likewise.
5498         * Makefile.in: Regenerated.
5499
5500 2002-10-25  Jason Thorpe  <thorpej@wasabisystems.com>
5501
5502         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add
5503         bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to
5504         targ_selvecs.
5505
5506 2002-10-25  Jim Wilson  <wilson@redhat.com>
5507
5508         * elf64-sh64.c (sh_elf64_relocate_section): Call
5509         _bfd_elf_rela_local_sym.  Handle relocs against STT_SECTION symbol
5510         of SHF_MERGE section.
5511
5512 2002-10-25  Hans-Peter Nilsson  <hp@axis.com>
5513
5514         * simple.c: Correct placement of ATTRIBUTE_UNUSED.
5515
5516 2002-10-24  John David Anglin  <dave@hiauly1.hia.nrc.ca>
5517
5518         * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to
5519         unsigned int.  Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to
5520         unsigned int.
5521         (NAME(aout,final_link)): Cast enum used in assignment.
5522         (aout_link_write_symbols): Cast enums in comparisons, int values to
5523         boolean, enums in assignments to int.
5524         (aout_link_input_section_std): Cast rel->r_index to unsigned int.
5525         (aout_link_input_section_ext): Likewise.  Cast enums used in
5526         comparisons with unsigned ints.
5527         (aout_link_reloc_link_order): Cast enum to int in assignment.
5528         * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr
5529         calls to char *.
5530         * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in
5531         assignment.
5532         * bfd-in2.h (bfd_set_section_vma): Likewise.
5533         * bfd.c (bfd_record_phdr): Cast enums in assignments.
5534         * binary.c (bfd_alloc): Cast enum to long.
5535         * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean.
5536         * dwarf2.c (read_abbrevs): Add casts to enum types.
5537         (read_attribute_value): Likewise.
5538         (arange_add): Cast result of bfd_zalloc call.
5539         (comp_unit_contains_address): Return true and false.
5540         (comp_unit_find_nearest_line): Cast return to boolean.
5541         * format.c (bfd_check_format_matches, bfd_set_format): Likewise.
5542         * gen-aout.c: define macro '_' if not defined.
5543         * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR.
5544         (bfd_bwrite): Cast bfd_realloc to bfd_byte *.
5545         (bfd_write_bigendian_4byte_int): Cast return to boolean.
5546         (bfd_seek): Cast bfd_realloc to bfd_byte *.
5547         (bfd_generic_is_local_label_name): Cast return to boolean.
5548         * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'.
5549         * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to
5550         struct bfd_hash_entry *.
5551         (_bfd_generic_link_hash_newfunc): likewise.
5552         (_bfd_generic_final_link): Cast enum to unsigned int.
5553         * merge.c (sec_merge_emit): Cast return to boolean.
5554         (merge_strings): Add casts to const unsigned char *.
5555         * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int.
5556         (bfd_generic_get_relocated_section_content): Cast enum to unsigned int.
5557         * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result
5558         to struct bfd_hash_entry *.
5559         (bfd_set_section_content): Add cast to PTR in comparison.
5560         * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol,
5561         simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous,
5562         simple_dummy_unattached_reloc,
5563         bfd_simple_get_relocated_section_contents): Add K&R declarations and
5564         function definitions.
5565         * srec.c (S3Forced): Initialize to false.
5566         (srec_get_symtab): Cast return value from bfd_alloc to asymbol *.
5567         * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons.
5568         (_bfd_discard_section_stabs): Likewise.  Also cast return to boolean.
5569         * syms.c (bfd_is_undefined_symclass): Cast return to boolean.
5570         (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in
5571         comparisons.
5572
5573 2002-10-23  Jakub Jelinek  <jakub@redhat.com>
5574
5575         * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic
5576         relocs into shared lib non-allocated reloc sections.
5577
5578 2002-10-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
5579
5580         * dwarf2.c (add_line_info): Ensure that the line_info_table is
5581         sorted even when given an out-of-order line sequence.
5582         (lookup_address_in_line_info_table): When an exact VMA match is
5583         not found, return line information with the closest VMA.
5584
5585 2002-10-23 Ross Alexander <ross.alexander@uk.neceur.com>
5586
5587         * elf64-hppa.c: Force DT_FLAGS to always be set.  Required by
5588         HPUX 11.00 patch PHSS_26559.
5589
5590 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
5591
5592         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move
5593         the options section into a separate section unless IRIX 6
5594         compatibility is enabled.
5595
5596 2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
5597
5598         * elflink.h (struct elf_link_sort_rela): Turn rel and rela
5599         into arrays.
5600         (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust.
5601         (elf_link_sort_relocs): Likewise.  Take int_rels_per_ext_rel
5602         into account.
5603         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose
5604         R_MIPS_REL32 with R_MIPS64 if ABI_64_P.
5605
5606 2002-10-21  Graeme Peterson  <gp@qnx.com>
5607
5608         * targets.c (_bfd_target_vector): Add missing qnx vectors.
5609
5610 2002-10-21  Alan Modra  <amodra@bigpond.net.au>
5611
5612         * targets.c (bfd_target_list): Don't return the default target twice.
5613
5614 2002-10-21  Elias Athanasopoulos  <eathan@otenet.gr>
5615
5616         * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace
5617         perror with bfd_perror.
5618
5619 2002-10-19  H.J. Lu <hjl@gnu.org>
5620
5621         * elflink.h (elf_link_add_object_symbols): Correctly handle
5622         DT_RPATH and DT_RUNPATH.
5623
5624 2002-10-19  Mark Kettenis  <kettenis@gnu.org>
5625
5626         * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes.
5627
5628 2002-10-17  Denis Chertykov  <denisc@overta.ru>
5629
5630         * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code
5631         for ip2k port.
5632
5633 2002-10-17  Alan Modra  <amodra@bigpond.net.au>
5634
5635         * elfxx-target.h (USE_REL): Don't define as 1.
5636         * elf32-arm.h (USE_REL): Provide a default define of 0.
5637         Use #if rather than #ifdef when testing USE_REL.
5638         * elf32-m32r.c: Likewise.
5639
5640         * elf32-arc.c (USE_REL): Define as 1.
5641         * elf32-d10v.c (USE_REL): Likewise.
5642         * elf32-m32r.c (USE_REL): Likewise.
5643         * elf32-m68hc11.c (USE_REL): Likewise.
5644         * elf32-m68hc12.c (USE_REL): Likewise.
5645         * elf32-or32.c (USE_REL): Likewise.
5646         * elfarm-nabi.c (USE_REL): Likewise.
5647
5648 2002-10-16  Jakub Jelinek  <jakub@redhat.com>
5649
5650         * config.bfd (s390-*-linux*): Add targ64_selvecs.
5651         (s390x-*-linux*): Add targ_selvecs.
5652
5653 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
5654
5655         * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,
5656         elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo,
5657         elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo,
5658         elf32-sh64-nbsd.lo, elf32-shqnx.lo.  Add elf32-qnx.lo.
5659         (BFD32_BACKENDS_CFILES): Likewise for corresponding C files.
5660         (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo.
5661         (BFD64_BACKENDS_CFILES): Likewise for corresponding C files.
5662         (SOURCE_HFILES): Add elf32-qnx.h.
5663         (BUILD_HFILES): Add bfdver.h.
5664         Run "make dep-am".
5665         * Makefile.in: Regenerate.
5666         * configure.in Update bfd vector dependencies.
5667         * configure: Regenerate.
5668         * elf32-i386-fbsd.c: Delete.  Move code to elf32-i386.c.
5669         * elf32-i386qnx.c: Likewise.
5670         * elf32-ppcqnx.c: Delete.  Move code to elf32-ppc.c.
5671         * elf32-sh-nbsd.c: Delete.  Move code to elf32-sh.c.
5672         * elf32-sh-lin.c: Likewise.
5673         * elf32-shqnx.c: Likewise.
5674         * elf32-sh64-lin.c: Delete.  Move code to elf32-sh64.c.
5675         * elf32-sh64-nbsd.c: Likewise.
5676         * elf64-sh64-lin.c: Delete.  Move code to elf64-sh64.c.
5677         * elf64-sh64-nbsd.c: Likewise.
5678         * elfarmqnx-nabi.c: Delete.  Move code to elfarm-nabi.c.
5679         * elf32-arm.h (ELF_MAXPAGESIZE): Always define.
5680         * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests.
5681         * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests.
5682         * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define.
5683         (elf_backend_is_contained_by_filepos): Likewise.
5684         (elf_backend_copy_private_bfd_data_p): Likewise.
5685         Globalize and move functions to..
5686         * elf32-qnx.c: ..here.  New file.
5687         * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests.  Don't
5688         emit target vectors when INCLUDE_SHMEDIA.
5689         * elf32-sh64.c: Remove ELF_ARCH test.  Move TARGET_* etc. defines to
5690         end of file.
5691         * elf64-sh64.c: Remove ELF_ARCH test.
5692         * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test.
5693         * po/BLD-POTFILES.in: Regenerate.
5694         * po/SRC-POTFILES.in: Regenerate.
5695
5696 2002-10-16  Alan Modra  <amodra@bigpond.net.au>
5697
5698         * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects
5699         loaded with --just-symbols.
5700
5701         * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define.
5702         * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5703         * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5704         * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
5705
5706 2002-10-15  Richard Henderson  <rth@redhat.com>
5707
5708         * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd.
5709         (BFD64_BACKENDS_CFILES): Likewise.
5710         * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha.
5711         * elf64-alpha-fbsd.c: Remove file, move code ...
5712         * elf64-alpha.c: ... here.
5713         * Makefile.in, configure: Rebuild.
5714
5715 2002-10-14  Richard Henderson  <rth@redhat.com>
5716
5717         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment
5718         VALUE, not ADDEND.
5719
5720 2002-10-14  Stephen Clarke <stephen.clarke@superh.com>
5721
5722         * elf32-sh.c (elf_sh_link_hash_entry): Replace
5723         datalabel_got_offset with union of datalabel_got
5724         offset and refcount.
5725         (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount.
5726         (allocate_dynrelocs): Delete unnecessary code for
5727         STT_DATALABEL type.  Create entry in got for
5728         datalabel version of symbol if datalabel_got.refcount > 0.
5729         (sh_elf_relocate_section): Use datalabel_got union.
5730         (sh_elf_gc_sweep_hook): Pull common code to initialize
5731         h and eh out of switch statement.  Declare seen_stt_datalabel.
5732         Initialize it.  Decrement datalabel_got.refcount for
5733         got relocs when seen_stt_datalabel is true.
5734         Decrement local_got_refcounts entry for datalabel got relocs
5735         of local symbols.
5736         (sh_elf_copy_indirect_symbol): Copy datalabel_got field over.
5737         (sh_elf_check_relocs): Declare seen_stt_datalabel.
5738         Initialize it.  When seen_stt_datalabel is true, increment
5739         datalabel_got refcount rather than got.refcount.
5740         (sh_elf_finish_dynamic_symbol): Create relocs to
5741         initialize got entry for datalabel version of symbol.
5742
5743 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
5744
5745         * Makefile.am: Run "make dep-am".
5746         (BFD_H_FILES): Remove version.h.
5747         * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move..
5748         * version.h: ..to here.
5749         * configure.in (bfd_version_date): Remove.
5750         (AC_OUTPUT): Make bfdver.h from version.h.
5751         * bfd.c: #include "bfdver.h".
5752         * vms-hdr.c: Likewise.
5753         * Makefile.in: Regenerate.
5754         * bfd-in2.h: Regenerate.
5755         * configure: Regenerate.
5756         * po/SRC-POTFILES.in: Regenerate.
5757
5758 2002-10-14  Alan Modra  <amodra@bigpond.net.au>
5759
5760         * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
5761         bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
5762         bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
5763         bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
5764         bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
5765         bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
5766         bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
5767         bfd_mach_ip2022, bfd_mach_ip2022ext,
5768         bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
5769         * bfd-in2.h: Regenerate.
5770
5771 2002-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5772
5773         * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative
5774         endian vector to targ_selvecs.
5775
5776 2002-10-13  Alexandre Oliva  <aoliva@redhat.com>
5777
5778         * elfxx-mips.c (mips_elf_calculate_relocation): Take
5779         save_addend argument.  Don't apply the 32-bit mask to a
5780         GPREL32 value if it's to be used in another relocation.  Don't
5781         use forced-check computation of local_p to decide whether to
5782         add gp0 to GPREL16 value.  Don't use only the lowest 16 bits
5783         of the addend of a non-in-place GPREL16 relocation.
5784         (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to
5785         mips_elf_calculate_relocation().
5786
5787 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
5788
5789         * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs
5790         with symbols in other sections if we relaxed something;  the sections
5791         output offsets must be re-computed before.
5792
5793 2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
5794
5795         * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols
5796         handling to use Elf_Internal_Sym.
5797         (m68hc11_elf_relax_delete_bytes): Likewise.
5798
5799 2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5800
5801         * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,
5802         sh_elf_object_p, dtpoff_base): New functions.
5803         (sh_elf_howto_table): Add TLS relocs.
5804         (sh_reloc_map): Likewise.
5805         (sh_elf_info_to_howto): Support TLS relocs.
5806         (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32.
5807         (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type):
5808         New macros.
5809         (sh_elf_obj_tdata): New.
5810         (elf_sh_link_hash_table): Add tls_ldm_got.
5811         (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got.
5812         (allocate_dynrelocs): Support TLS relocs.
5813         (sh_elf_size_dynamic_sections): Likewise.
5814         (sh_elf_relocate_section): Support TLS relocs.  Don't try to find
5815         .rela.got section when found already.  Return false after printing
5816         error about unresolvable relocation.
5817         (sh_elf_gc_sweep_hook): Support TLS relocs.
5818         (sh_elf_check_relocs): Likewise.
5819         (sh_elf_finish_dynamic_symbol): Likewise.
5820         (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case.
5821         * reloc.c: Add SH TLS relocs.
5822         * bfd-in2.h, libbfd.h: Regenerate.
5823
5824 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
5825
5826         * Makefile.in: Regenerated.
5827
5828 2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
5829
5830         * Makefile.am: Run dep-am.
5831         (BFD_H_DEP): Add simple.c and linker.c.
5832         (BFD32_LIBS): Add simple.lo.
5833         (BFD32_LIBS_CFILES): Add simple.c.
5834         * Makefile.in: Regenerated.
5835         * bfd-in2.h: Regenerated.
5836         * simple.c: New file.
5837
5838 2002-10-11  Alan Modra  <amodra@bigpond.net.au>
5839
5840         * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers.
5841         (record_thumb_to_arm_glue): Likewise.
5842         * ecoff.c (ecoff_link_add_externals): Likewise.
5843         * elf32-arm.h (record_arm_to_thumb_glue): Likewise.
5844         (record_thumb_to_arm_glue): Likewise.
5845         * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
5846         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
5847         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
5848         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
5849         * elf64-ppc.c (func_desc_adjust): Likewise.
5850         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
5851         (sh64_elf64_create_dynamic_sections): Likewise.
5852         * elflink.c (_bfd_elf_create_got_section): Likewise.
5853         (_bfd_elf_create_dynamic_sections): Likewise.
5854         (_bfd_elf_create_linker_section): Likewise.
5855         * elflink.h (elf_add_default_symbol): Likewise.
5856         (elf_link_create_dynamic_sections): Likewise.
5857         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
5858         * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise.
5859         * elfxx-mips.c (mips_elf_create_got_section): Likewise.
5860         (_bfd_mips_elf_add_symbol_hook): Likewise.
5861         (_bfd_mips_elf_create_dynamic_sections): Likewise.
5862         * linker.c (generic_link_add_symbol_list): Likewise.
5863         * xcofflink.c (xcoff_link_add_symbols): Likewise.
5864
5865         * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define.
5866
5867         * elf64-ppc.c (edit_opd): Only zero opd syms when function is
5868         completely removed.  Correct local sym adjustment.
5869
5870 2002-10-10  Stephen Clarke <stephen.clarke@superh.com>
5871
5872         * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
5873         Correct mistake in calculation of address of .got.
5874         * elf64-sh64.c (elf_sh64_pic_plt_entry_be,
5875         elf_sh64_pic_plt_entry_le): Likewise.
5876
5877 2002-10-09  Richard Shann <richard.shann@superh.com>
5878             Stephen Clarke <stephen.clarke@superh.com>
5879
5880         * Makefile.am: Add entries for elf32-sh64-lin.c and
5881         elf64-sh64-lin.c. Regenerate.
5882         * Makefile.in: Regenerate.
5883         * config.bfd: Change sh64eb-*-linux* and sh64-*-linux*
5884         to use sh64 vectors rather than sh vectors.
5885         * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
5886         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
5887         * configure: Regenerate.
5888         * elf32-sh64-lin.c: New file.
5889         * elf64-sh64-lin.c: New file.
5890         * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
5891         bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
5892
5893 2002-10-08  H.J. Lu <hjl@gnu.org>
5894
5895         * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
5896         IE->LE transition for R_386_TLS_IE.
5897
5898 2002-10-08  Alan Modra  <amodra@bigpond.net.au>
5899
5900         * elf64-ppc.c (edit_opd): Correct test for discarded sections.
5901
5902 2002-10-07  Mark Elbrecht  <snowball3@softhome.net>
5903
5904         * cofflink.c (mark_relocs): Don't mark relocations in excluded
5905         sections.
5906
5907 2002-10-07  Alan Modra  <amodra@bigpond.net.au>
5908
5909         * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent
5910         code.
5911
5912         * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx.
5913
5914 2002-10-06  Alan Modra  <amodra@bigpond.net.au>
5915
5916         * opncls.c: Formatting.
5917         (_bfd_new_bfd): Use a smaller section hash table.
5918
5919 2002-10-05  Alexandre Oliva  <aoliva@redhat.com>
5920
5921         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type
5922         of the other two relocations packed with a REL32 to NONE.
5923
5924 2002-10-02  Stephen Clarke <stephen.clarke@superh.com>
5925
5926         * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
5927         (sh_elf_link_hash_newfunc): Initialize it.
5928         (allocate_dynrelocs): Transfer gotplt refs from plt.refcount
5929         to got.refcount for symbols that are forced local or when
5930         we have direct got refs.
5931         (sh_elf_gc_sweep_hook): Adjust gotplt_refcount.  Use it
5932         to correctly adjust got.refcount and plt.refcount.
5933         (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across.
5934         (sh_elf_check_relocs): Increment gotplt_refcount.
5935
5936 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5937
5938         * elf32-i386.c (elf_i386_relocate_section): Fix
5939         movl foo@indntpoff, %eax IE->LE transition.
5940
5941 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5942
5943         * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD
5944         sequence and its transitions.
5945
5946 2002-10-01  Jakub Jelinek  <jakub@redhat.com>
5947
5948         * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
5949         to st_value + addend in non-code sections.
5950         * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
5951         R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
5952
5953 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
5954             Ken Raeburn  <raeburn@cygnus.com>
5955             Aldy Hernandez  <aldyh@redhat.com>
5956             Eric Christopher  <echristo@redhat.com>
5957             Richard Sandiford  <rsandifo@redhat.com>
5958
5959         * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
5960         (bfd_mach_mips5500): New.
5961         * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New.
5962         (arch_info_struct): Add corresponding entries here.
5963         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120,
5964         E_MIPS_MACH_5400 and E_MIPS_MACH_5500.
5965         (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120,
5966         bfd_mach_mips5400 and bfd_mach_mips5500.
5967         (_bfd_mips_elf_mach_extends_p): New function.
5968         (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge
5969         the EF_MIPS_MACH flags.
5970         * bfd-in2.h: Regenerate.
5971
5972 2002-09-28  Jason Thorpe  <thorpej@wasabisystems.com>
5973
5974         * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip
5975         .got sections.
5976
5977 2002-09-28  Alan Modra  <amodra@bigpond.net.au>
5978
5979         * elf.c (map_sections_to_segments): Correct test for start of
5980         writable section in the same page as end of read-only section.
5981
5982 2002-09-27  Matt Thomas  <matt@3am-software.com>
5983
5984         * elf32-vax.c (elf_vax_check_relocs): Remove unused
5985         local_got_refcounts usage.  Remove allocation of got slot.
5986         (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage.
5987         Remove de-allocation of got slot.
5988         (elf_vax_size_dynamic_section): Fix some indentation.  Add hash
5989         traversal for elf_vax_instantiate_got_entries.  Allow empty .got
5990         sections to be GC'ed.
5991         (elf_vax_instantiate_got_entries): New function.
5992         (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling.  Remove
5993         tests that are now handled by elf_vax_instantiate_got_entries.
5994         Assert GOT entry falls within .got section size.  Remove redundant
5995         comparisions.  Fix comments.
5996
5997 2002-09-27  Jakub Jelinek  <jakub@redhat.com>
5998
5999         * reloc.c: Add x86-64 TLS relocs.
6000         * bfd-in2.h, libbfd.h: Rebuilt.
6001         * elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit
6002         relocs.  Add TLS relocs.
6003         (x86_64_reloc_map): Add TLS relocs.
6004         (elf64_x86_64_info_to_howto): Adjust for added TLS relocs.
6005         (struct elf64_x86_64_link_hash_entry): Add tls_type field.
6006         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define.
6007         (elf64_x86_64_hash_entry): Define.
6008         (struct elf64_x86_64_obj_tdata): New.
6009         (elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define.
6010         (struct elf64_x86_64_link_hash_table): Add tls_ld_got.
6011         (link_hash_newfunc): Initialize tls_type.
6012         (elf64_x86_64_link_hash_table_create): Initialize tls_ld_got.
6013         (elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary.
6014         (elf64_x86_64_mkobject): New.
6015         (elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata.
6016         (elf64_x86_64_tls_transition): New.
6017         (elf64_x86_64_check_relocs): Add r_type variable and use it.
6018         Handle TLS relocs.
6019         (elf64_x86_64_gc_sweep_hook): Handle TLS relocs.
6020         (allocate_dynrelocs): Allocate GOT space for TLS relocs.
6021         (elf64_x86_64_size_dynamic_sections): Likewise.
6022         (dtpoff_base, tpoff): New.
6023         (elf64_x86_64_relocate_section): Handle TLS relocs.
6024         (elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT
6025         entries.
6026         (bfd_elf64_mkobject): Define.
6027
6028         * elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set
6029         DF_STATIC_TLS if shared.
6030
6031 2002-09-26  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6032
6033         * elfxx-mips.c (_bfd_mips_elf_fake_sections): Don't emit unneeded
6034         empty relocation sections.
6035
6036 2002-09-26  Alan Modra  <amodra@bigpond.net.au>
6037
6038         * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here.
6039         (ppc64_elf_build_stubs): Build them here instead.
6040
6041 2002-09-24  Jakub Jelinek  <jakub@redhat.com>
6042
6043         * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE
6044         addend into r_addend, not *r_offset.
6045         (elf32_sparc_finish_dynamic_symbol): Likewise.
6046         * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at
6047         R_SPARC_RELATIVE's r_offset.
6048
6049 2002-09-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
6050
6051         * dwarf2.c (decode_line_info): Update to correctly decode
6052         the (non-standard DWARF2) out-of-order address sequences
6053         generated by the Intel C++ 6.0 compiler for ia64-Linux.
6054
6055 2002-09-23  Mark Elbrecht  <snowball3@softhome.net>
6056
6057         * config.bfd: For DJGPP targets, match with any cpu and any machine.
6058
6059 2002-09-23  Alan Modra  <amodra@bigpond.net.au>
6060
6061         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs
6062         for discarded FDEs.  Remove redundant assignment.
6063         * elflink.h (elf_bfd_discard_info): Save edited relocs.
6064
6065 2002-09-22  H.J. Lu <hjl@gnu.org>
6066
6067         * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge
6068         the relocation count between different .reloc sections.
6069
6070 2002-09-21  Alan Modra  <amodra@bigpond.net.au>
6071
6072         * elf32-ppc.c (ppc_elf_relocate_section): Allow ".sbss.*" and
6073         ".sdata.*" for R_PPC_SDAREL16, ".sbss2*" and ".sdata2*" for
6074         R_PPC_EMB_SDA2REL.  Similarly for R_PPC_EMB_SDA21 and
6075         R_PPC_EMB_RELSDA.
6076
6077         * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount"
6078         unsigned.  Move "symcount" assignment out of loop.
6079         * Makefile.am: Run "make dep-am".
6080         * Makefile.in: Regenerate.
6081         * configure: Regenerate.
6082         * po/SRC-POTFILES.in: Regnerate.
6083
6084 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
6085
6086         * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is
6087         zero, set it to 8 for (non-standard) 64-bit DWARF2 formats
6088         (e.g. IRIX64).
6089
6090 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
6091
6092         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word
6093         even if generating R_PPC_RELATIVE reloc.
6094         (ppc_elf_relocate_section): Make sure relocation is performed
6095         if skip == -2.  Clear memory at r_offset when creating dynamic
6096         relocation.
6097
6098 2002-09-19  Jakub Jelinek  <jakub@redhat.com>
6099
6100         * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE,
6101         BFD_RELOC_386_TLS_GOTIE): Add.
6102         * bfd-in2.h, libbfd.h: Rebuilt.
6103         * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE
6104         and R_386_TLS_GOTIE.
6105         (elf_i386_reloc_type_lookup): Handle it.
6106         (struct elf_i386_link_hash_entry): Change tls_type type to unsigned
6107         char instead of enum, change GOT_* into defines.
6108         (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define.
6109         (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
6110         (elf_i386_check_relocs): Likewise.  Avoid crash if local symbol is
6111         accessed both as normal and TLS symbol.  Move R_386_TLS_LDM and
6112         R_386_PLT32 cases so that R_386_TLS_IE can fall through.
6113         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
6114         (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
6115         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
6116         (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if
6117         tls_type is GOT_TLS_IE_BOTH.
6118         (elf_i386_size_dynamic_sections): Likewise.
6119         (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
6120         Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
6121         (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch
6122         all 4 GOT_TLS_* TLS types.
6123
6124 2002-09-19  Nick Clifton  <nickc@redhat.com>
6125
6126         * elflink.h (elf_fix_symbol_flags): When examining weak symbols,
6127         follow indirect links.
6128
6129 2002-09-19  Nathan Tallent  <eraxxon@alumni.rice.edu>
6130
6131         * ecoffswap.h (ecoff_swap_pdr_in) <isym, iline>: Update to
6132         correctly sign-extend 32-bit ECOFF null values (0xffffffff, -1)
6133         on 64 bit machines.
6134         (ecoff_swap_sym_in) <iss>: Likewise.
6135         * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Fix error reading
6136         ECOFF information: 'ioptMax' refers to the actual *size*
6137         of the optimization symtab, not the number of entries.
6138
6139 2002-09-19  Daniel Jacobowitz  <drow@mvista.com>
6140
6141         * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update
6142         ELF_LINK_HASH_NEEDS_PLT logic.
6143
6144 2002-09-18  Daniel Jacobowitz  <drow@mvista.com>
6145
6146         * elfcode.h (elf_slurp_reloc_table_from_section): Check
6147         correct relocation count.
6148
6149 2002-09-17  Daniel Jacobowitz  <drow@mvista.com>
6150
6151         * bfd-in.h (bfd_get_dynamic_symcount): Define.
6152         * bfd.c (struct _bfd): Add dynsymcount.
6153         * bfd-in2.h: Regenerated.
6154         * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set
6155         abfd->dynsymcount.
6156         * elfcode.h (elf_slurp_reloc_table_from_section): Check
6157         for overflow.
6158
6159 2002-09-17  Stan Cox <scox@redhat.com>
6160
6161         * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
6162         (mips_elf64_final_gp): Don't make up gp value.
6163         * elfn32-mips.c (mips_elf_final_gp): Likewise.
6164         * elfxx-mips.c (_bfd_mips_elf_final_link): Always create
6165         .MIPS.options/.options section.
6166
6167 2002-09-17  David O'Brien  <obrien@FreeBSD.org>
6168
6169         * elf32-i386-fbsd.c: Always label using the EI_OSABI method.
6170         It is benign for FreeBSD < 4.1.  Minor reformatting.
6171         * elf64-alpha-fbsd.c: Likewise.
6172
6173 2002-09-17  Jakub Jelinek  <jakub@redhat.com>
6174
6175         * elf32-i386.c (elf_i386_relocate_section) [R_386_TLS_TPOFF32]: Negate
6176         addend.
6177
6178 2002-09-17  Alan Modra  <amodra@bigpond.net.au>
6179
6180         * elf64-alpha.c (alpha_elf_size_info): Make static.
6181
6182 2002-09-17  Svein E. Seldal  <Svein.Seldal@solidas.com>
6183
6184         * coff-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED.
6185         * cpu-tic4x.c: Ditto.
6186
6187 2002-09-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6188
6189         * elf64-mips.c (define elf_backend_ignore_discarded_relocs): Remove
6190         duplicate define.
6191
6192 2002-09-16  Bruno Haible  <bruno@clisp.org>
6193
6194         * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included
6195         by a target variant implementation.
6196         * elf64-alpha.c: Likewise.
6197         * elf32-i386-fbsd.c: New file.
6198         * elf64-alpha-fbsd.c: New file.
6199         * targets.c: Support bfd_elf32_i386_freebsd_vec and
6200         bfd_elf64_alpha_freebsd_vec.
6201         * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec,
6202         bfd_elf64_alpha_freebsd_vec.
6203         * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo.
6204         (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c.
6205         (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo.
6206         (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c.
6207         (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies.
6208         * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD
6209         specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate.
6210
6211 2002-09-12  Jakub Jelinek  <jakub@redhat.com>
6212
6213         * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is
6214         NULL.
6215         (elf_i386_relocate_section): Return false after printing error about
6216         unresolvable relocation.
6217
6218 2002-09-12  Nick Clifton  <nickc@redhat.com>
6219
6220         * elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of
6221         R_ARM_THM_PC11.
6222
6223 2002-09-11  Jeffrey Law  <law@redhat.com>
6224
6225         * elf32-h8300.c (elf32_h8_relax_section): Fix typo.
6226
6227 2002-09-11  Andrew Haley  <aph@cambridge.redhat.com>
6228
6229         * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and
6230         line_ptr before deciding we've found a symbol.
6231
6232 2002-09-11  Nick Clifton  <nickc@redhat.com>
6233
6234         * po/da.po: New Danish translation file.
6235         * configure.in (LINGUAS): Add 'da'.
6236         * configure: Regenerate.
6237
6238 2002-09-10  Michael Snyder  <msnyder@redhat.com>
6239
6240         * irix-core.c (do_sections, do_sections64): New functions.
6241         (irix_core_core_file_p): Call new functions do_sections,
6242         do_sections64, depending on corefile (32-bit or 64-bit).
6243
6244 2002-09-09  Richard Henderson  <rth@redhat.com>
6245
6246         * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21M
6247         and PCREL21F like PCREL21B.
6248
6249 2002-09-04  Kevin Buettner  <kevinb@redhat.com>
6250
6251         * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
6252         vector.
6253
6254 2002-09-02  Nick Clifton  <nickc@redhat.com>
6255
6256         * elf32-v850.c (v850_elf_final_link_relocate): Use helpful
6257         names instead of cryptically overloaded bfd_reloc error
6258         codes.
6259         (v850_elf_relocate_section): Likewise.
6260         (v850_elf_relax_section): Replace caching of external symbols
6261         with caching of internal symbols obtained from calling
6262         bfd_elf_get_elf_syms().
6263         Fixup problems with freeing cached allocated memory blocks.
6264
6265 2002-09-02  Alan Modra  <amodra@bigpond.net.au>
6266
6267         * cpu-pj.c (scan_mach, compatible, arch_info_struct): Remove.
6268         (bfd_pj_arch): Use bfd_default_scan.
6269         * cpu-v850.c (scan): Remove.
6270         (N): Use bfd_default_scan.
6271         * cpu-z8k.c (scan_mach): Remove.
6272         (arch_info_struct, bfd_z8k_arch): Reorganize so that the default is
6273         first.  Use bfd_default_scan.
6274
6275         * ecoff.c (_bfd_ecoff_set_arch_mach_hook): Don't use hard-coded
6276         bfd_mach constants.
6277         (ecoff_get_magic): Likewise.
6278         * elf32-v850.c (v850_elf_object_p): Likewise.
6279         (v850_elf_final_write_processing): Likewise.
6280         * mipsbsd.c (MY(set_arch_mach)): Likewise.
6281         (MY(write_object_contents)): Likewise.
6282         * coff64-rs6000.c (xcoff64_write_object_contents): Likewise.
6283         * coffcode.h (coff_write_object_contents): Likewise.
6284         (coff_set_arch_mach_hook): Add comment describing machine == 0.
6285         Remove unnecessary "machine" assignments.
6286         (coff_write_relocs): Test for the absolute section sym by testing
6287         section and flags.
6288
6289         * aoutx.h (NAME(aout,machine_type)): Recognize bfd_mach_i386_i386
6290         and bfd_mach_i386_i386_intel_syntax.
6291         * pdp11.c (NAME(aout,machine_type)): Likewise.
6292
6293 2002-08-30  John David Anglin  <dave@hiauly1.hia.nrc.ca>
6294
6295         * bfd-in.h (align_power): Cast constants to bfd_vma type.
6296         * bfd-in2.h (align_power): Likewise.
6297
6298 2002-08-30  Alan Modra  <amodra@bigpond.net.au>
6299
6300         * Makefile.am: Run "make dep-am".
6301         * Makefile.in: Regenerate.
6302
6303         * cpu-avr.c (compatible): Don't use hard-coded mach constants.
6304         * cpu-powerpc.c (powerpc_compatible): Likewise.
6305         * cpu-rs6000.c (rs6000_compatible): Likewise.
6306
6307 2002-08-28  Catherine Moore  <clm@redhat.com>
6308
6309         * elf32-v850.c (v850_elf_reloc_map): Add new relocs.
6310         (v850-elf-reloc): Don't resolve pc relative relocs.
6311         (v850_elf_ignore_reloc): New routine.
6312         (v850_elf_final_link_relocate): Handle new relocs.
6313         (v850_elf_relax_delete_bytes ): New routine.
6314         (v850_elf_relax_section): New routine.
6315         (bfd_elf32_bfd_relax_section): Define.
6316         (HOWTO): New entries for new relocs.
6317         * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc.
6318         (BFD_RELOC_V850_LONGJUMP): New reloc.
6319         (BFD_RELOC_V850_ALIGN): New reloc.
6320         * archures.c: Remove redundant v850ea architecture.
6321         * cpu-v850.c: Remove redundant v850ea support.
6322         * libbfd.h: Regenerate.
6323         * bfd-in2.h: Regenerated.
6324
6325 2002-08-28  Svein E. Seldal  <Svein.Seldal@solidas.com>
6326
6327         * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target.
6328         * configure.in: Add tic4x_coff vector files.
6329         * configure: Regenerate.
6330         * Makefile.am: Add tic4x target.
6331         * Makefile.in: Regenerate.
6332
6333 2002-08-27  Michael Hayes <m.hayes@elec.canterbury.ac.nz>
6334
6335         * archures.c: Add the BFD arch type tic4x.
6336         * bfd-in.h: Add BFD_IN_MEMORY flag.
6337         * coff-tic4x.c: New file.
6338         * coffswap.h (coff_swap_sym_out): Add preadjuster.
6339         * cpu-tic4x.c: New file.
6340         * targets.c: Added tic4x- in list of xvecs.
6341         * ticoff.h: New file.
6342         * bfd-in2.h: Regenerate.
6343
6344 2002-08-27  Adam Nemet  <anemet@lnxw.com>
6345
6346         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last
6347         bit of DT_INIT and DT_FINI for Thumb functions.
6348
6349 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
6350
6351         * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC.
6352
6353 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
6354
6355         * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8.
6356
6357 2002-08-24  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6358
6359         * elf32-sh.c (sh_elf_copy_indirect_symbol): New.
6360         (create_got_section, allocate_dynrelocs, readonly_dynrelocs):
6361         Likewise.
6362         (struct elf_sh_pcrel_relocs_copied): Removed.
6363         (struct elf_sh_dyn_relocs): New.
6364         (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied
6365         field with dyn_relocs.
6366         (struct elf_sh_link_hash_table): Add short-cuts to get dynamic
6367         sections and sym_sec.
6368         (sh_elf_link_hash_newfunc): Clear dyn_relocs.
6369         (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec.
6370         (sh_elf_create_dynamic_sections): Use create_got_section instead
6371         of _bfd_elf_create_got_section.
6372         (sh_elf_check_relocs): Likewise.
6373         (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic
6374         sections.
6375         (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections,
6376         sh_elf_relocate_section, sh_elf_check_relocs,
6377         sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections):
6378         Likewise.
6379         (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the
6380         dynamic relocations and avoiding the copy relocation when we
6381         didn't find any dynamic relocations in the section which has
6382         contents or is read-only.
6383         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
6384         (sh_elf_size_dynamic_sections): Don't reset the size of
6385         .rela.got section even if dynamic_sections_created flag is off.
6386         Don't use sh_elf_discard_copies. Scan all input bfd and use
6387         allocate_dynrelocs. Call readonly_dynrelocs to determine
6388         whether we need DT_TEXTREL.
6389         (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine
6390         whether the symbol was never referred to.
6391         (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL.
6392         (sh_elf_gc_sweep_hook): Fill with the real sweep function.
6393         (sh_elf_check_relocs): Call create_got_section if the short-cut
6394         to .got is null. Increment reference counters only instead of
6395         allocating space on dynamic sections here. Don't conditionalize
6396         uninitialized got.offset value when marking the symbol as a
6397         global offset table entry. Keep relocations for symbols satisfied
6398         by a dynamic library to avoid copy relocations for the symbol.
6399         Set dynobj field of an elf hash table if needed.
6400         (sh_elf_finish_dynamic_sections): Handle null section pointer
6401         correctly.
6402         (elf_backend_copy_indirect_symbol): Defined.
6403         (elf_backend_can_refcount): Defined.
6404
6405 2002-08-23  Nick Clifton  <nickc@redhat.com>
6406
6407         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo
6408         previous change.  Add comment explaining why.
6409
6410 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
6411
6412         * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy
6413         contents of .got.plt[2] to tr0, not address of .got.plt.
6414         (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when
6415         patching absolute plt entry. For shmedia plt entry, set bottom bit
6416         of branch to plt0 as this is a branch to an shmedia instruction.
6417         * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le):
6418         Copy contents of .got.plt[2] to tr0, not address of .got.plt.
6419         (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to
6420         branch to plt0.
6421         (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when
6422         patching absolute plt entry. For shmedia plt entry, branch to
6423         plt0 is now ptrel, so use relative offset.  Set bottom bit of
6424         branch target as it is a branch to an shmedia instruction.
6425
6426 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>,
6427             Richard Shann <richard.shann@superh.com>
6428
6429         * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
6430         value if .init is an SHmedia function.  Similarly for DT_FINI.
6431         * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
6432
6433 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
6434
6435         * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
6436         dynamic section.
6437         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
6438
6439 2002-08-22  Kaz Kojima <kkojima@rr.iij4u.or.jp>
6440
6441         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
6442         byte read when reading the return address register column.
6443
6444 2002-08-22  Nick Clifton  <nickc@redhat.com>
6445
6446         * config.bfd: Add powepc64-*-*bsd* target.
6447
6448 2002-08-22  Graeme Peterson  <gp@qnx.com>
6449
6450         * Makefile.am: Add entries for elf32-shqnx.c
6451         * Makefile.in: Regenerate.
6452         * config.bfd: Add support sh-*-nto* target.
6453         * configure.in: Add support for bfd_elf32_sh{l}qnx_vec.
6454         * configure: Regenerate.
6455         * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" .
6456         * elf32-sh.c: Do not include elf32-target.h if
6457         ELF32_SH_C_INCLUDED is defined.
6458         * elf32-shqnx.c: New file: Support for QNX.
6459         * targets.c: Add bfd_elf32_sh{l}qnx_vec.
6460
6461 2002-08-22  Nick Clifton  <nickc@redhat.com>
6462
6463         * po/tr.po: Updated Turkish translation.
6464
6465         * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the
6466         symbols are not read.
6467
6468 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6469
6470         * elf32-m68hc11.c: Formatting fixes.
6471         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
6472         * elf32-m68hc12.c: Formatting fixes.
6473         (elf32_m68hc11_gc_mark_hook): Correct params.  Remove unnecessary test.
6474
6475 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6476
6477         * coff-rs6000.c (rs6000coff_vec <object_flags>): Add SEC_CODE and
6478         SEC_DATA.
6479         (pmac_xcoff_vec): Likewise.
6480         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
6481         (aix5coff64_vec): Likewise.
6482
6483 2002-08-22  Alan Modra  <amodra@bigpond.net.au>
6484
6485         * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data
6486         param to elf_backend_copy_indirect_symbol.
6487         (_bfd_elf_link_hash_copy_indirect): Likewise.
6488         * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust
6489         calls to copy_indirect_symbol.
6490         * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
6491         * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
6492         * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
6493         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
6494         * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
6495         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise.
6496         * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
6497         * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
6498         * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise.
6499         * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise.  Properly
6500         test refcounts for "used" values.
6501
6502 2002-08-21  John David Anglin  <dave@hiauly1.hia.nrc.ca>
6503
6504         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to
6505         argument declaration.
6506
6507 2002-08-19  Elena Zannoni <ezannoni@redhat.com>
6508
6509         * archures.c (bfd_mach_ppc_e500): Added.
6510         * bfd-in2.h: Rebuilt.
6511         * cpu-powerpc.c (bfd_powerpc_archs): Added e500.
6512
6513 2002-08-19  Alan Modra  <amodra@bigpond.net.au>
6514
6515         * elf32-m68hc12.c (elf_backend_can_gc_sections): False.
6516
6517 2002-08-17  Andrew Cagney  <ac131313@redhat.com>
6518
6519         * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
6520         `bfd_byte'.
6521
6522 2002-08-17  Stan Cox  <scox@redhat.com>
6523
6524         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the
6525         IRIX 6 segment layout for NEWABI.
6526
6527 2002-08-16  Stephen Clarke <stephen.clarke@superh.com>
6528
6529         * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
6530         symbols when looking for section referred to by a relocation.
6531         * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
6532
6533 2002-08-15  Alan Modra  <amodra@bigpond.net.au>
6534
6535         * elf32-i370.c: Move reloc enum to include/elf/i370.h.
6536
6537 2002-08-15  Hans-Peter Nilsson  <hp@axis.com>
6538
6539         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add
6540         missing check for whether the symbol is referenced by DSO before
6541         unexporting it as an unneeded dynamic symbol.
6542
6543 2002-08-14  H.J. Lu <hjl@gnu.org>
6544
6545         * libbfd.h: Regenerate.
6546
6547 2002-08-14  H.J. Lu <hjl@gnu.org>
6548
6549         * config.bfd: Always add 64bit vectors to 32bit Linux/mips.
6550
6551 2002-08-14  Stephane Carrez  <stcarrez@nerim.fr>
6552
6553         * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of
6554         instructions.
6555         (m68hc11_direct_relax): New to define table of relaxable instructions.
6556         (find_relaxable_insn): New, find a relaxable insn.
6557         (compare_reloc): New to compare two relocs.
6558         (m68hc11_elf_relax_section): New, relax text sections.
6559         (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs.
6560         (elf32_m68hc11_check_relocs): New function for GC support.
6561         (elf32_m68hc11_relocate_section): New function for GC support.
6562         (bfd_elf32_bfd_relax_section): Define to support linker relaxation.
6563         (elf_backend_check_relocs): Likewise.
6564         (elf_backend_relocate_section): Likewise.
6565
6566 2002-08-13  H.J. Lu <hjl@gnu.org>
6567
6568         * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count
6569         definitions in shared objects when checking symbol with
6570         undefined version.
6571
6572 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6573
6574         * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC.
6575         (elf32_m68hc11_gc_sweep_hook): Likewise.
6576         (elf_backend_gc_mark_hook): Define for GC section support.
6577         (elf_backend_gc_sweep_hook): Likewise.
6578         (elf_backend_can_gc_sections): Likewise.
6579
6580         * elf32-m68hc12.c: Likewise.
6581
6582 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6583
6584         * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New.
6585         (_bfd_m68hc11_elf_merge_private_bfd_data): New function.
6586         (_bfd_m68hc11_elf_set_private_flags): New function.
6587         Use them to set/check/print ELF flags specific to 68HC11.
6588
6589         * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New.
6590         (_bfd_m68hc12_elf_merge_private_bfd_data): New function.
6591         (_bfd_m68hc12_elf_set_private_flags): New function.
6592         Use them to set/check/print ELF flags specific to 68HC12.
6593
6594 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6595
6596         * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs;
6597         fix masks for PC-rel relocs.
6598         (m68hc11_elf_ignore_reloc): New function.
6599
6600         * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific
6601         68HC12 banked addressing relocs.
6602         (m68hc12_phys_addr): New to compute physical address of banked memory.
6603         (m68hc12_phys_page): Likewise for page.
6604         (m68hc12_addr_is_banked): New to see if address is in banked area.
6605         (elf_m68hc12_howto_table): Add new relocs and rename to xx12.
6606
6607 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
6608
6609         * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP,
6610         BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE,
6611         BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12.
6612         * bfd-in2.h: Regenerate.
6613
6614 2002-08-12  H.J. Lu <hjl@gnu.org>
6615
6616         * elflink.h (elf_add_default_symbol): Preserve section across
6617         elf_merge_symbol.
6618
6619 2002-08-09  Graeme Peterson  <gp@qnx.com>
6620
6621         * Makefile.am: Add entries for elf32-ppcqnx.c, and add
6622         elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c.
6623         * Makefile.in: Regenerate.
6624         * config.bfd: Add support for powerpc{le}-*-nto targets.
6625         * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec.
6626         * configure: Regenerate.
6627         * elf32-i386qnx.c: Moved backend functions into a QNX specific
6628         common file "elf32-qnx.h", and now include that file.
6629         * elf32-qnx.h: New file: QNX specific common elf backend.
6630         * elf32-ppc.c: Do not include elf32-target.h if
6631         ELF32_PPC_C_INCLUDED is defined.
6632         * elf32-ppcqnx.c: New file: Support for QNX.
6633         * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend.
6634         * targets.c: Add bfd_elf32_powerpc{le}qnx_vec.
6635
6636 2002-08-09  Nick Clifton  <nickc@redhat.com>
6637
6638         * po/sv.po: Updated Swedish translation.
6639
6640 2002-08-09  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6641
6642         * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if
6643         g->global_gotsym is NULL.
6644
6645 2002-08-08  H.J. Lu <hjl@gnu.org>
6646
6647         * elflink.h (elf_add_default_symbol): Don't warn if a definition
6648         overrides an indirect versioned symbol.
6649
6650 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
6651
6652         * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
6653         for R_386_TLS_TPOFF32 relocs against symndx 0.
6654
6655 2002-08-07  H.J. Lu <hjl@gnu.org>
6656
6657         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol
6658         with undefined version if needed.
6659         (elf_link_assign_sym_version): Match a default symbol with a
6660         version without definition. No need to hide the default
6661         definition separately.
6662
6663 2002-08-08  Alan Modra  <amodra@bigpond.net.au>
6664
6665         * elflink.h (elf_link_output_extsym): Don't output symbols from
6666         SEC_EXCLUDE sections.
6667
6668         * aoutx.h (aout_link_write_symbols): Correct handling of warning syms.
6669
6670 2002-08-07  Alan Modra  <amodra@bigpond.net.au>
6671
6672         * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd
6673         entries.
6674
6675 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6676
6677         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness
6678         mismatch.
6679
6680 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6681
6682         * elfxx-mips.c (ABI_64_P): Remove superfluous check.
6683
6684 2002-08-07  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6685
6686         * elf32-mips.c (mips_reloc_map): Fix typo.
6687
6688 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6689
6690         * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section.
6691
6692 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6693
6694         * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries.
6695
6696 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6697
6698         * libxcoff.h: Use PARAMS on function declarations.
6699         * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc.
6700         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
6701
6702         * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in
6703         addend.
6704         * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise.
6705
6706 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6707
6708         * coff-rs6000.c: Formatting fixes.
6709         (xcoff_calculate_relocation): Use PARAMS in declaration.
6710         (xcoff_complain_overflow): Likewise.
6711         (xcoff_ppc_relocate_section): Use old-style function pointer call.
6712         (bfd_xcoff_backend_data): Remove useless comments.
6713         (rs6000coff_vec): Likewise.
6714         (bfd_pmac_xcoff_backend_data): Likewise.
6715         (pmac_xcoff_vec): Likewise.
6716
6717         * coff64-rs6000.c: Formatting fixes.
6718         (xcoff64_calculate_relocation): Use PARAMS in declaration.
6719         (xcoff64_ppc_relocate_section): Use old-style function pointer call.
6720         (bfd_xcoff_backend_data): Remove useless comments.
6721         (rs6000coff64_vec): Likewise.
6722         (bfd_xcoff_aix5_backend_data): Likewise.
6723         (aix5coff64_vec): Likewise.
6724
6725 2002-08-06  Alan Modra  <amodra@bigpond.net.au>
6726
6727         * coff-rs6000.c (xcoff_howto_table): Revert some of last change to
6728         mask entries.  Use complain_overflow_dont for R_REF.
6729         (xcoff_reloc_type_ba): Revert last change.
6730         (xcoff_reloc_type_br): Likewise.
6731         (xcoff_reloc_type_crel): Likewise.
6732         (xcoff_ppc_relocate_section): Likewise.
6733         * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise.
6734         (xcoff64_ppc_relocate_section): Likewise.
6735         (xcoff64_howto_table): Revert some of last change to mask entries.
6736         Use complain_overflow_dont for R_REF.
6737
6738         * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries.  Make all
6739         relocs with bitsize == 16 have size = 1.
6740         (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment.
6741         (xcoff_reloc_type_br): Likewise.
6742         (xcoff_reloc_type_crel): Likewise.
6743         (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly.
6744         * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and
6745         dst_mask adjustment.
6746         (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly.
6747         (xcoff64_howto_table): Fix src_mask entries.  Make all relocs with
6748         bitsize == 16 have size = 1.
6749
6750 2002-08-01  Denis Chertykov  <denisc@overta.ru>
6751
6752         * elf32-ip2k.c: Processor manufacturer changed to Ubicom.
6753         (struct misc): New field isymbuf. All free_* fields removed.
6754         (symbol_value): Pass in internal syms. No need to swap syms in.
6755         (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free
6756         possibly cached info.
6757         (tidyup_after_error): Removed.
6758         (ip2k_elf_relax_section_pass1): Don't use removed fields of struct
6759         misc. Use new field.
6760         (adjust_all_relocations): Use internal syms. No need to swap syms
6761         in and out.
6762         (add_page_insn): Don't use removed fields of struct misc.
6763
6764 2002-08-01  Nick Clifton  <nickc@redhat.com>
6765
6766         * elf32-arm.h: Revert previous delta.
6767
6768 2002-08-01  Nick Clifton  <nickc@redhat.com>
6769
6770         * configure.in (AM_INIT_AUTOMAKE): Bump version number.
6771         * configure: Regenerate.
6772
6773 2002-07-31  H.J. Lu <hjl@gnu.org>
6774
6775         * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is
6776         selected.
6777
6778 2002-07-31  H.J. Lu <hjl@gnu.org>
6779
6780         * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD
6781         is selected.
6782
6783 2002-07-31  Jakub Jelinek  <jakub@redhat.com>
6784
6785         * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type
6786         if _bfd_elf_link_hash_copy_indirect will swap got.refcount.
6787
6788 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
6789
6790         * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate):
6791         There is no 8 byte relocation type for this architecture.
6792         (do_ns32k_reloc): Use bfd_vma instead of native types.
6793         (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data
6794         returns void.
6795         (_bfd_ns32k_put_displacement): Don't check for overflow. We can
6796         rely on generic code to do that.
6797         * aout-ns32k.c (howto_table): Add appropriate overflow detection
6798         to all table entries.
6799         (_bfd_ns32k_relocate_contents): put_data returns void.
6800         * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate)
6801         (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions
6802         return void.
6803
6804 2002-07-31  Ian Dall  <ian@sibyl.beware.dropbear.id.au>
6805
6806         * aoutx.h (aout_link_check_ar_symbols): Whether to include an
6807         archive object is target dependant.
6808
6809 2002-07-31  Adam Nemet  <anemet@lnxw.com>
6810
6811         * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE.
6812         (THUMB_PLT_ENTRY_SIZE): New macro.
6813         (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE.
6814         (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to
6815         ARM_PLT_ENTRY_SIZE.
6816         (elf32_arm_plt_entry): Likewise.
6817         (elf_backend_plt_header_size): Likewise.
6818         (elf32_thumb_plt0_entry): New global.
6819         (elf32_arm_finish_dynamic_sections): Use it.  Put Thumb entries
6820         into .plt.thumb.
6821         (elf32_thumb_plt_entry): New global.
6822         (elf32_arm_finish_dynamic_symbol): Use it.  Use .thumb.plt for
6823         Thumb entries.  Set the bottom bit of the corresponding GOT entry
6824         for a Thumb PLT entry.
6825         (struct elf32_arm_plt_entry_info): New structure.
6826         (struct elf32_arm_link_hash_entry, plt_info): New member of this
6827         type.
6828         (elf32_arm_link_hash_newfunc): Initialize new member.
6829         (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle
6830         relocations against the PLT.
6831         (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set
6832         first_rel_type if this is the first time we encounter the symbol.
6833         (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case.
6834         Determine if relocation needs a PLT entry.  Set first_rel_type if
6835         this is the first time we encounter the symbol
6836         (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb
6837         functions as well.
6838         (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt.
6839         (elf32_arm_create_dynamic_sections): New function.  Create the
6840         .plt.thumb section.
6841         (elf_backend_create_dynamic_sections): Call it.
6842
6843 2002-07-31  Nick Clifton  <nickc@redhat.com>
6844
6845         * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to
6846         'alternative' in order to avoid shadowing global symbol of the
6847         same name.
6848         * bfd-in2.h: Regenerate.
6849         * libbfd.h: Regenerate.
6850         * libcoff.h: Regenerate.
6851
6852 2002-07-31  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6853
6854         * Makefile.am: Add n32 ABI support.
6855         * Makefile.in: Regenerate.
6856         * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64
6857         bit vectors for mips*-*-linux targets as optional.
6858         * configure.in: Add n32 ABI vectors.
6859         * configure: Regenerate.
6860         * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files.
6861         * elfn32-mips.c: New file, n32 ABI support.
6862         * targets.c: Add n32 ABI vectors.
6863
6864 2002-07-30  Graeme Peterson  <gp@qnx.com>
6865
6866         * elfarmqnx-nabi.c: New file: Support for QNX.
6867         * config.bfd: Add support for arm-*-nto target.
6868         * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec.
6869         * configure: Regenerate.
6870         * Makefile.am: Add entries for elfarmqnx-nabi.c.
6871         * Makefile.in: Regenerate.
6872         * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined.
6873         Do not define global function if ELFARM_NABI_C_INCLUDED is defined.
6874         * elfarm-nabi.c: Do not include elf32-arm.h if
6875         ELFARM_NABI_C_INCLUDED is defined.
6876         * targets.c: Add bfd_elf32_{big|little}armqnx_vec.
6877
6878 2002-07-30  Nick Clifton  <nickc@redhat.com>
6879
6880         * po/sv.po: Updated Swedish translation.
6881
6882 2002-07-30  Jakub Jelinek  <jakub@redhat.com>
6883
6884         * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type.
6885
6886 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
6887
6888         * aoutx.h (some_aout_object_p): Clean up tdata properly on error.
6889         * archive.c (bfd_generic_archive_p): Likewise.
6890         * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise.
6891         (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol.
6892         * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
6893         (xcoff64_archive_p): Likewise.
6894         (xcoff64_openr_next_archived_file): Likewise.
6895         (xcoff64_archive_p): Clean up tdata properly on error.
6896         * coffgen.c (coff_real_object_p): Likewise.
6897         (coff_object_p): Release filehdr and opthdr.
6898         * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error.
6899         * ieee.c (ieee_archive_p): Likewise.
6900         * ihex.c (ihex_object_p): Likewise.
6901         (ihex_mkobject): Always allocate tdata.
6902         * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error.
6903         * srec.c (srec_mkobject): Always allocate tdata.
6904         (srec_object_p): Clean up tdata properly on error.
6905         (symbolsrec_object_p): Likewise.
6906         * versados.c (versados_object_p): Likewise.
6907         * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc,
6908         and bfd_realloc instead of realloc.
6909         (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections.
6910         * vms.c (vms_initialize): Always allocate tdata.  Use bfd_alloc in
6911         place of bfd_malloc, simplifying error freeing.  Free hash table too.
6912         (vms_object_p): Clean up tdata on error.
6913         (vms_mkobject): Don't complain on stderr if vms_initialize fails.
6914         (vms_close_and_cleanup): Adjust for bfd_alloc use.
6915
6916 2002-07-30  Alan Modra  <amodra@bigpond.net.au>
6917
6918         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags.
6919
6920 2002-07-26  Chris Demetriou  <cgd@broadcom.com>
6921
6922         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE
6923         flags into resulting BFD.
6924
6925 2002-07-26  Alan Modra  <amodra@bigpond.net.au>
6926
6927         From John Reiser <jreiser@BitWagon.com>
6928         * elf32-i386.c (elf_i386_link_hash_table_create): Clear
6929         tls_ldm_got.refcount.
6930
6931 2002-07-25  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6932
6933         * elf64-mips.c: Update TODO comment.
6934         (mips_elf64_higher_reloc,mips_elf64_highest_reloc,
6935         mips_elf64_gprel16_reloca): Remove prototypes.
6936         (mips16_jump_reloc,mips16_gprel_reloc): Add functions.
6937         (UNUSED_RELOC): Replace by EMPTY_RELOC.
6938         (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove
6939         wrong comments. Remove disfunctional support of R_MIPS_HIGHER and
6940         R_MIPS_HIGHEST.
6941         (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and
6942         R_MIPS_GOT16. Remove wrong comments.
6943         (elf_mips16_jump_howto,elf_mips16_gprel_howto,
6944         elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code
6945         from elf32-mips.c.
6946         (mips_elf64_hi16_reloc): Fix formatting.
6947         (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove.
6948         (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code.
6949         Better comment. Fall back to R_MIPS_GOT_DISP instead of abort().
6950         (mips_elf64_gprel16_reloc): Make static. Add check for
6951         partial_inplace.
6952         (mips_elf64_gprel16_reloca): Remove.
6953         (mips_elf64_literal_reloc): New function.
6954         (mips_elf64_gprel32_reloc): Fix formatting.
6955         (mips_elf64_shift6_reloc): Fix comment. Make static.
6956         (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from
6957         elf32-mips.c.
6958         (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in
6959         elf32-mips.c
6960         (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU
6961         specific relocations.
6962         (mips_elf64_rtype_to_howto): Enable GNU specific relocations.
6963         (mips_elf64_object_p): Invert logic to check for SGI-ish ABI.
6964         (ELF_MAXPAGESIZE): Add comment.
6965
6966 2002-07-25  Nick Clifton  <nickc@redhat.com>
6967
6968         * po/sv.po: Updated Swedish translation.
6969         * po/es.po: Updated Spanish translation.
6970         * po/fr.po: Updated French translation.
6971
6972 2002-07-25  Alan Modra  <amodra@bigpond.net.au>
6973
6974         * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define
6975         as elf_link_record_local_dynamic_symbol.
6976         (_bfd_elf64_link_record_local_dynamic_symbol): Likewise.
6977         (elf_link_record_local_dynamic_symbol): Declare.  Now returns int.
6978         * elflink.h (elf_link_record_local_dynamic_symbol): Move to..
6979         * elflink.c: .. here.  Use bfd_elf_get_elf_syms.  Check whether an
6980         attempt is made to record a symbol in a discarded section, and
6981         return `2' in that case.
6982
6983 2002-07-24  Nick Clifton  <nickc@redhat.com>
6984
6985         * po/sv.po: Updated Swedish translation.
6986         * po/es.po: Updated Spanish translation.
6987
6988 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
6989
6990         * po/SRC-POTFILES.in: Regenerate.
6991
6992         * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
6993         immediately.  Remove code handling relocatable linking.
6994         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
6995         * elf32-cris.c (cris_elf_relocate_section): Likewise.
6996         * elf32-fr30.c (elf32_frv_relocate_section): Likewise.
6997         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
6998         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
6999         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
7000         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
7001         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
7002         * elf32-v850.c (v850_elf_relocate_section): Likewise.
7003         * elf32-vax.c (elf_vax_relocate_section): Likewise.
7004         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7005         * elf32-avr.c (elf_backend_rela_normal): Define.
7006         * elf32-cris.c: Likewise.
7007         * elf32-fr30.c: Likewise.
7008         * elf32-frv.c: Likewise.
7009         * elf32-h8300.c: Likewise.
7010         * elf32-hppa.c: Likewise.
7011         * elf32-ip2k.c: Likewise.
7012         * elf32-sparc.c: Likewise.
7013         * elf32-v850.c: Likewise.
7014         * elf32-vax.c: Likewise.
7015         * elf64-hppa.c: Likewise.
7016         * elf64-sparc.c: Likewise.
7017         * elf32-fr30.c (elf32_frv_relocate_section): Edit comment.
7018         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
7019         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
7020         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
7021         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
7022         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
7023         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
7024         * elf-m10200.c (USE_RELA): Don't define.
7025         * elf-m10300.c: Likewise.
7026         * elfarm-oabi.c: Likewise.
7027         * elf32-i370.c: Likewise.
7028         * elf32-ip2k.c: Likewise.
7029         * elf32-m68k.c: Likewise.
7030         * elf32-mcore.c: Likewise.
7031         * elf32-ppc.c: Likewise.
7032         * elf32-s390.c: Likewise.
7033         * elf32-vax.c: Likewise.
7034         * elf64-ppc.c: Likewise.
7035         * elf64-s390.c: Likewise.
7036         * elf64-x86-64.c: Likewise.
7037         * elfxx-ia64.c: Likewise.
7038         * elf32-avr.c (USE_REL): Don't undef.
7039         * elf32-ip2k.c: Likewise.
7040
7041 2002-07-23  Nick Clifton  <nickc@redhat.com>
7042
7043         * elf-bfd.h (struct elf_backend_data): Add new bitfield
7044         'want_p_paddr_set_to_zero'.
7045         * elfxx-target.h: Set default value for want_p_paddr_set_to_zero
7046         to false;
7047         * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target.
7048         * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero.
7049
7050 2002-07-23  Gabor Keresztfalvi  <keresztg@mail.com>
7051
7052         * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of
7053         the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to
7054         show the Copyright string.
7055         Minor formatting tidy ups.
7056
7057 2002-07-23  Nick Clifton  <nickc@redhat.com>
7058
7059         * po/fr.po: Updated French translation.
7060         * po/sv.po: Updated Swedish translation.
7061
7062 2002-07-23  Alan Modra  <amodra@bigpond.net.au>
7063
7064         * elflink.h (elf_link_input_bfd): Don't change internal symbols
7065         when outputting relocs.
7066
7067 2002-07-20  Jason Thorpe  <thorpej@wasabisystems.com>
7068
7069         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert
7070         DT_PLTGOT into the dynamic section if there is a PLT.
7071
7072 2002-07-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7073
7074         * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from
7075         elf32-mips.c.
7076         (_bfd_mips_elf_write_section): Likewise.
7077         * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype.
7078         (_bfd_mips_elf_write_section): Likewise.
7079         * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c.
7080         (elf32_mips_write_section): Likewise.
7081         * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it.
7082         (_bfd_mips_elf_write_section): Likewise.
7083
7084 2002-07-19  Alan Modra  <amodra@bigpond.net.au>
7085
7086         * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan
7087         PT_IA_64_UNWIND segments for a given section.
7088
7089 2002-07-17  H.J. Lu <hjl@gnu.org>
7090
7091         * Makefile.am: Fix a typo.
7092         * Makefile.in: Regenerate.
7093
7094 2002-07-15  Denis Chertykov  <denisc@overta.ru>
7095             Frank Ch. Eigler  <fche@redhat.com>
7096             Ben Elliston  <bje@redhat.com>
7097             Alan Lehotsky  <alehotsky@cygnus.com>
7098             John Healy  <jhealy@redhat.com>
7099             Graham Stott  <grahams@redhat.com>
7100             Jeff Johnston  <jjohnstn@redhat.com>
7101
7102         * Makefile.am: Add support for ip2k.
7103         * Makefile.in: Regenerate.
7104         * doc/Makefile.in: Regenerate.
7105         * archures.c: Add support for ip2k.
7106         * config.bfd: Add support for ip2k.
7107         * configure.in: Add support for ip2k.
7108         * configure: Regenerate.
7109         * reloc.c: Add support for ip2k.
7110         * targets.c: Add support for ip2k.
7111         * bfd-in2.h: Regenerate.
7112         * libbfd.h: Regenerate.
7113         * cpu-ip2k.c: New file.
7114         * elf32-ip2k.c: New file.
7115
7116 2002-07-17  Ian Rickards  <irickard@arm.com>
7117
7118         * dwarf2.c (concat_filename): If we can't establish the directory
7119         just return the filename.
7120
7121 2002-07-16  Moritz Jodeit  <moritz@jodeit.org>
7122
7123         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args.
7124
7125 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
7126
7127         * elflink.h: Formatting fixes, tidy prototypes.
7128         (elf_link_assign_sym_version): Move common code out of loop.
7129
7130 2002-07-16  Alan Modra  <amodra@bigpond.net.au>
7131
7132         * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
7133         reloc section size is zero.  Correct reloc output location.
7134
7135 2002-07-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7136
7137         * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
7138         the final type for the e_fsel selector when generating PA2.0W code.
7139         (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1
7140         relocations.
7141
7142 2002-07-14  H.J. Lu <hjl@gnu.org>
7143
7144         * elflink.h (elf_link_assign_sym_version): Hide the default
7145         definition if there is a hidden versioned definition.
7146
7147 2002-07-12  Hans-Peter Nilsson  <hp@axis.com>
7148
7149         * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical
7150         dynamic reference test in assertion when initializing GOT with
7151         static contents.  Just assert that there are either no dynamic
7152         sections, the symbol is defined in the regular objects or that the
7153         symbol is undef weak.  Tweak comment.
7154         (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program
7155         only if the symbol isn't defined in the program and isn't undef
7156         weak.
7157         (elf_cris_adjust_dynamic_symbol): Simplify condition for getting
7158         rid of PLT entry: only do it if the symbol isn't defined in a DSO.
7159         When doing so, clear ELF_LINK_HASH_NEEDS_PLT.  Tweak comments.
7160         (elf_cris_discard_excess_program_dynamics): Don't consider
7161         ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs.
7162
7163 2002-07-11  Alan Modra  <amodra@bigpond.net.au>
7164
7165         * elf32-i386.c (elf_i386_relocate_section): Don't complain about
7166         unresolved debugging relocs in dynamic applications.
7167         * elf32-s390.c (elf_s390_relocate_section): Likewise.
7168         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
7169         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
7170         * elf64-s390.c (elf_s390_relocate_section): Likewise.
7171         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7172         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
7173
7174 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
7175
7176         * elf64-ppc.c (ONES): Define.
7177         (ppc64_elf_howto_table): Use ONES here to avoid warnings.  Fill in
7178         missing src_mask fields.  Tweak R_PPC64_NONE, R_PPC64_COPY.  Fill
7179         in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32.
7180
7181         * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete.
7182         (ppc64_elf_set_private_flags): Delete.
7183         (ppc64_elf_section_from_shdr): Delete.
7184         (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code.
7185         (ppc64_elf_fake_sections): Delete.
7186         (bfd_elf64_bfd_set_private_flags): Don't define.
7187         (bfd_elf64_get_symbol_info): Likewise.
7188         (elf_backend_section_from_shdr): Likewise.
7189         (elf_backend_fake_sections): Likewise.
7190
7191 2002-07-10  Marco Walther  <Marco.Walther@sun.com>
7192
7193         * elf.c: (assign_section_numbers) Set sh_entsize for .stab only
7194         when not already set.
7195         * elf64-sparc.c: (sparc64_elf_fake_sections): New function.
7196         (elf_backend_fake_sections): Define.
7197
7198 2002-07-10  Alan Modra  <amodra@bigpond.net.au>
7199
7200         * merge.c (_bfd_merge_section): Remove redundant output_section check.
7201         Formatting.
7202         (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections.
7203
7204 2002-07-09  Hans-Peter Nilsson  <hp@axis.com>
7205
7206         * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for
7207         NULL sym_hashes to just before use.
7208         <case R_CRIS_32_GOTREL>: In test for local symbol, accept also
7209         symbol with non-default visibility.
7210         <case R_CRIS_32_GOTREL, case R_CRIS_32_PLT_GOTREL>: Ditto.
7211         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
7212         Ditto.
7213         (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for
7214         symbol with non-default visibility.
7215         (cris_elf_check_relocs): At tests for local symbol before
7216         increasing h->plt.refcount, also check for non-default
7217         visibility.  Ditto when checking for local symbol to eliminate
7218         pc-relative runtime relocs.
7219
7220 2002-07-08  Alan Modra  <amodra@bigpond.net.au>
7221
7222         * elf.c: Formatting.
7223         (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks.
7224         (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP.
7225         (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP
7226         segments.
7227
7228 2002-07-07  Mark Mitchell  <mark@codesourcery.com>
7229             Alan Modra  <amodra@bigpond.net.au>
7230
7231         * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into
7232         account the impact of relocation count overflow when computing
7233         section offsets.
7234         * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether
7235         or not to apply the PE COFF reloc overflow handling.  Fix a
7236         fencepost error in deciding whether or not to use that technique.
7237
7238 2002-07-07  Alan Modra  <amodra@bigpond.net.au>
7239
7240         * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx,
7241         change type of locsyms.
7242         (bfd_elf_get_elf_syms): Declare.
7243         * elf.c (bfd_elf_get_elf_syms): New function.
7244         (group_signature): Use bfd_elf_get_elf_syms.
7245         (bfd_section_from_r_symndx): Likewise.
7246         * elfcode.h (elf_slurp_symbol_table): Likewise.
7247         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7248         (elf_link_add_object_symbols): Likewise.  Reorganise to increase
7249         locality of various data structures.  Properly free internal relocs.
7250         (elf_bfd_final_link): Properly free internal relocs.
7251         (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms.
7252         (elf_link_input_bfd): Likewise.
7253         (elf_gc_mark): Likewise.  Properly free internal relocs.
7254         (elf_gc_sweep): Properly free internal relocs.
7255         (elf_reloc_symbol_deleted_p): No need to swap syms in.
7256         (elf_bfd_discard_info): Use bfd_elf_get_elf_syms.  Properly free
7257         internal relocs.
7258         * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms.
7259         Properly free possibly cached info.
7260         (mn10200_elf_relax_delete_bytes): Remove symbol swapping code.
7261         (mn10200_elf_symbol_address_p): Pass in internal syms.  Remove
7262         symbol swapping code.
7263         (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms.
7264         Properly free possibly cached info.
7265         * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c.
7266         (mn10300_elf_relax_delete_bytes): Likewise.
7267         (mn10300_elf_symbol_address_p): Likewise.
7268         (mn10300_elf_get_relocated_section_contents): Likewise.
7269         * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c.
7270         (elf32_h8_relax_delete_bytes): Likewise.
7271         (elf32_h8_symbol_address_p): Likewise.
7272         (elf32_h8_get_relocated_section_contents): Likewise.
7273         * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c.
7274         (m32r_elf_relax_delete_bytes): Likewise.
7275         (m32r_elf_get_relocated_section_contents): Likewise.
7276         * elf32-sh.c (sh_elf_reloc_loop): Free section contents using
7277         elf_section_data to determine whether cached.
7278         (sh_elf_relax_section): As above for elf-m10200.c.
7279         (sh_elf_relax_delete_bytes): Likewise.
7280         (sh_elf_get_relocated_section_contents): Likewise.
7281         * elf32-xstormy16.c (xstormy16_elf_relax_section): As above.
7282         * elf64-alpha.c (elf64_alpha_relax_section): As above.  Also delay
7283         reading of local syms.
7284         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7285         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above.
7286         * elfxx-ia64.c (elfNN_ia64_relax_section): As above.
7287         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal
7288         relocs.
7289         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly
7290         free internal relocs and section contents.  Don't read symbols.
7291         * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms.
7292         (elf32_hppa_size_stubs): Don't free local syms.
7293         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay
7294         reading of local syms.  Use bfd_elf_get_elf_syms.  Properly free
7295         possibly cached info.
7296         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7297         * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms.
7298         * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and
7299         all_local_syms.
7300         (get_local_syms): Delete function.
7301         (edit_opd): Use bfd_elf_get_elf_syms.  Free on error exit.  Cache
7302         on exit.
7303         (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms.  Free/cache on exit.
7304
7305 2002-07-05  Jim Wilson  <wilson@redhat.com>
7306
7307         * syms.c (decode_section_type): New.
7308         (bfd_decode_symclass): Call decode_section_type.
7309
7310 2002-07-04  Jakub Jelinek  <jakub@redhat.com>
7311
7312         * merge.c (_bfd_merged_section_offset): Avoid accessing byte before
7313         section content start.
7314         Reported by Michael Schumacher <mike@hightec-rt.com>.
7315
7316 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
7317
7318         * section.c (_bfd_strip_section_from_output): Remove unnecessary
7319         link order code.  Don't actually remove the output section here;
7320         Just set a flag for the linker to do so.
7321         * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed
7322         sections when setting up output section dynsyms.
7323
7324 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
7325
7326         * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux
7327         fudge.
7328         * elf.c (bfd_section_from_shdr): Work around broken hpux shared
7329         libs here instead.
7330
7331 2002-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
7332
7333         * elf64-s390.c (create_got_section): Set .got section alignment to
7334         8 bytes.
7335         (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes.
7336
7337 2002-07-02  Alan Modra  <amodra@bigpond.net.au>
7338
7339         * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar.
7340
7341 2002-07-01  Matt Thomas  <matt@3am-software.com>
7342
7343         * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_*
7344         to EF_VAX_*.
7345
7346 2002-07-01  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7347
7348         * elfxx-mips.c (ABI_64_P): Fix comment.
7349         (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the
7350         new section names for N64 ABI.
7351         (mips_elf_output_extsym): No special _gp_disp handling for NewABI.
7352         (mips_elf_calculate_relocation): Code formatting.
7353         (mips_elf_create_dynamic_relocation): Likewise.
7354         (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too.
7355         (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI.
7356         (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64
7357         in any NewABI.
7358         (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling
7359         for NewABI.
7360         (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI.
7361         (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled
7362         here, too.
7363
7364 2002-07-01  Andreas Schwab  <schwab@suse.de>
7365
7366         * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert
7367         R_X86_64_64 to R_X86_64_RELATIVE.
7368
7369 2002-07-01  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7370
7371         * vaxbsd.c: New BFD backend for VAX BSD and Ultrix.
7372         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend.
7373         Run "make dep-am".
7374         * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of
7375         host_aout_vec.
7376         * configure.in (vaxbsd_vec): Add.
7377         * targets.c (vaxbsd_vec): Add.
7378         * Makefile.in: Rebuild.
7379         * configure: Rebuild.
7380         * po/SRC-POTFILES.in: Rebuild.
7381
7382 2002-07-01  Alan Modra  <amodra@bigpond.net.au>
7383
7384         * elflink.h (elf_gc_mark): Pass in the section whose relocs we are
7385         examining to gc_mark_hook, rather than the bfd.
7386         (elf_gc_sections): Adjust.
7387         * elf-bfd.h (struct elf_backend_data <gc_mark_hook>): Likewise.
7388         * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise.
7389         * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
7390         * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
7391         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
7392         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
7393         * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
7394         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
7395         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
7396         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
7397         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
7398         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
7399         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
7400         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
7401         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
7402         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
7403         * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
7404         * elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
7405         * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
7406         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
7407         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
7408         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
7409         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
7410         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
7411         * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
7412         * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise.
7413         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
7414         * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise.  Also remove
7415         redundant local sym tests.
7416         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry.
7417         (link_hash_newfunc): Init is_entry.
7418         (ppc64_elf_copy_indirect_symbol): Copy is_entry.
7419         (ppc64_elf_link_hash_table_create): Init all_local_syms.
7420         (create_linkage_sections): Use bfd_make_section_anyway rather than
7421         bfd_make_section.
7422         (ppc64_elf_mark_entry_syms): New function.
7423         (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab.  Set
7424         up opd entry to function section map.
7425         (ppc64_elf_gc_mark_hook): Special case opd section relocs, and
7426         relocs that reference the opd section.
7427         (edit_opd): New function.
7428         (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd.
7429         (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here.
7430         (get_local_syms): Do so here.  Exit if we already have local syms.
7431         Remove bogus comment imported from elf32-hppa.c.  Don't attempt to
7432         read local syms on non-ELF input.
7433         (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather
7434         than duplicating it's function here.  Adjust free of internal
7435         relocs to suit.
7436         (ppc64_elf_relocate_section): Adjust local syms in opd section.
7437         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare.
7438         * elf32-hppa.c (elf32_hppa_size_stubs): Call
7439         _bfd_elf32_link_read_relocs rather than duplicating it's function
7440         here.  Adjust free of internal relocs to suit.
7441
7442 2002-07-01  Andreas Jaeger  <aj@suse.de>
7443
7444         * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations
7445         are not allowed in shared libs code, enforce -fPIC.
7446
7447 2002-06-29  Hans-Peter Nilsson  <hp@bitrange.com>
7448
7449         * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and
7450         trailing zero-sequences when there's previous left-over data.
7451
7452 2002-06-27  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7453
7454         * elf64-hppa.c (elf64_hppa_reloc_type_class): New function.
7455         (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec
7456         and opd_rel_sec in order for starting rela section.  Check _raw_size.
7457         (elf_backend_reloc_type_class): Define.
7458
7459 2002-06-27  Kevin Buettner <kevinb@redhat.com>
7460
7461         * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
7462         DWARF2 formats.
7463
7464 2002-06-27  Alan Modra  <amodra@bigpond.net.au>
7465
7466         * cpu-powerpc.c: Comment on ordering of arch_info.
7467         * elf32-ppc.c (ppc_elf_object_p): New function.
7468         (elf_backend_object_p): Define.
7469         * elf64-ppc.c (ppc64_elf_object_p): New function.
7470         (elf_backend_object_p): Define.
7471
7472 2002-06-26  Jason Thorpe  <thorpej@wasabisystems.com>
7473
7474         * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo.
7475         * configure: Regenerate.
7476
7477 2002-06-25  Jason Eckhardt  <jle@rice.edu>
7478
7479         * dwarf2.c (decode_line_info): Check unit->addr_size
7480         to read in the proper number of prologue bytes.
7481
7482 2002-06-25  Nick Clifton  <nickc@cambridge.redhat.com>
7483
7484         * config.bfd (powerpc-*-aix5*): Only create a selvecs for
7485         aix5coff64_vec if 64-bit bfd support has been enabled.
7486         (powerpc64-*-aix5*): Only define if 64-bit bfd support has
7487         been enabled.
7488
7489         * targets.c (_bfd_target_vector[]): Only include
7490         aix5coff64_vec if 64-bit bfd support has been enabled.
7491
7492 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7493
7494         * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy.
7495         * elf32-hppa.c (hppa_add_stub): Likewise.
7496         * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
7497         * elflink.h (elf_add_default_symbol): Fix comment typo.
7498         (elf_add_default_symbol): Replace strcpy and strncpy with memcpy.
7499         (elf_link_add_object_symbols): Likewise.
7500         (elf_link_assign_sym_version): Likewise.
7501         * hash.c (bfd_hash_lookup): Likewise.
7502         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
7503         * section.c (bfd_get_unique_section_name): Likewise.
7504         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
7505         * elf.c (_bfd_elf_make_section_from_phdr): Likewise.
7506         (assign_section_numbers): Likewise.
7507         (_bfd_elfcore_make_pseudosection): Likewise.
7508         (elfcore_grok_lwpstatus): Likewise.
7509         (elfcore_grok_win32pstatus): Likewise.
7510         (elfcore_write_note): Constify input params.  Use PTR instead of
7511         void *.  Include terminating NUL in namesz.  Correct padding.
7512         Support NULL "name" param.  Use memcpy instead of strcpy.
7513         (elfcore_write_prpsinfo): Constify input params.
7514         (elfcore_write_prstatus): Likewise.  Use PTR instead of void *.
7515         (elfcore_write_lwpstatus): Likewise.
7516         (elfcore_write_pstatus): Likewise.
7517         (elfcore_write_prfpreg): Likewise.
7518         (elfcore_write_prxfpreg): Likewise.
7519         * elf-bfd.h (elfcore_write_note): Update declaration.
7520         (elfcore_write_prpsinfo): Likewise.
7521         (elfcore_write_prstatus): Likewise.
7522         (elfcore_write_pstatus): Likewise.
7523         (elfcore_write_prfpreg): Likewise.
7524         (elfcore_write_prxfpreg): Likewise.
7525         (elfcore_write_lwpstatus): Likewise.
7526
7527 2002-06-25  Jason Eckhardt  <jle@rice.edu>
7528
7529         * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for
7530         symbols of type stProc and stStaticProc.
7531
7532 2002-06-25  Nick Clifton  <nickc@redhat.com>
7533
7534         * ecoff.c: VArious formatting fixes.
7535
7536 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7537
7538         * coff-rs6000.c (xcoff_generate_rtinit): Fix typo.
7539
7540 2002-06-25  Alan Modra  <amodra@bigpond.net.au>
7541
7542         * aout-adobe.c: Don't compare against "true" or "false.
7543         * aout-target.h: Likewise.
7544         * aoutx.h: Likewise.
7545         * archive.c: Likewise.
7546         * bout.c: Likewise.
7547         * cache.c: Likewise.
7548         * coff-a29k.c: Likewise.
7549         * coff-alpha.c: Likewise.
7550         * coff-i386.c: Likewise.
7551         * coff-mips.c: Likewise.
7552         * coff-or32.c: Likewise.
7553         * coff64-rs6000.c: Likewise.
7554         * coffcode.h: Likewise.
7555         * coffgen.c: Likewise.
7556         * cpu-ns32k.c: Likewise.
7557         * ecoff.c: Likewise.
7558         * ecofflink.c: Likewise.
7559         * elf.c: Likewise.
7560         * elf32-arm.h: Likewise.
7561         * elf32-cris.c: Likewise.
7562         * elf32-d30v.c: Likewise.
7563         * elf32-i386.c: Likewise.
7564         * elf32-mcore.c: Likewise.
7565         * elf32-ppc.c: Likewise.
7566         * elf32-sh.c: Likewise.
7567         * elf32-sh64.c: Likewise.
7568         * elf32-v850.c: Likewise.
7569         * elf64-alpha.c: Likewise.
7570         * elf64-sh64.c: Likewise.
7571         * elfcode.h: Likewise.
7572         * elfcore.h: Likewise.
7573         * elflink.h: Likewise.
7574         * elfxx-mips.c: Likewise.
7575         * i386os9k.c: Likewise.
7576         * ieee.c: Likewise.
7577         * libbfd.c: Likewise.
7578         * linker.c: Likewise.
7579         * mmo.c: Likewise.
7580         * nlm32-alpha.c: Likewise.
7581         * nlm32-i386.c: Likewise.
7582         * nlm32-ppc.c: Likewise.
7583         * nlm32-sparc.c: Likewise.
7584         * nlmcode.h: Likewise.
7585         * oasys.c: Likewise.
7586         * pdp11.c: Likewise.
7587         * peicode.h: Likewise.
7588         * reloc.c: Likewise.
7589         * som.c: Likewise.
7590         * srec.c: Likewise.
7591         * tekhex.c: Likewise.
7592         * vms.c: Likewise.
7593         * xcofflink.c: Likewise.
7594         * elf64-sparc.c: Edit comment to not use "== false".
7595
7596         * aoutf1.h: Don't use "? true : false".
7597         * ecoff.c: Likewise.
7598         * format.c: Likewise.
7599         * ieee.c: Likewise.
7600         * linker.c: Likewise.
7601         * mmo.c: Likewise.
7602         * oasys.c: Likewise.
7603
7604 2002-06-23  H.J. Lu  <hjl@gnu.org>
7605
7606         * elflink.h (elf_link_add_archive_symbols): For the default
7607         version, check references with only one `@' first.
7608
7609 2002-06-23  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7610
7611         * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New
7612         function.
7613         (allocate_global_data_dlt): Don't add millicode symbols to dynamic
7614         symbol table.
7615         (allocate_global_data_opd, allocate_dynrel_entries): Likewise.
7616         (elf64_hppa_size_dynamic_sections): Revise to use
7617         elf64_hppa_mark_milli_and_exported_functions.
7618         (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode
7619         symbols out of dynamic symbol table.
7620
7621 2002-06-23  Alan Modra  <amodra@bigpond.net.au>
7622
7623         * Makefile.in: Regenerate.
7624         * libbfd.h: Regenerate.
7625         * bfd-in2.h: Regenerate.
7626         * configure: Regenerate.
7627         * po/SRC-POTFILES.in: Regenerate.
7628
7629         * elflink.h: Comment typo fixes.
7630
7631 2002-06-23  H.J. Lu  <hjl@gnu.org>
7632
7633         * elf-bfd.h (elf_link_loaded_list): New structure.
7634         (elf_link_hash_table): Add "loaded".
7635         * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded".
7636         * elflink.h (elf_link_check_versioned_symbol): New function.
7637         (elf_link_output_extsym): Call elf_link_check_versioned_symbol.
7638
7639 2002-06-19  Nick Clifton  <nickc@cambridge.redhat.com>
7640
7641         * elflink.h (size_dynamic_sections): If the target does not
7642         support an ELF style hash table, return true, indicating that
7643         nothing needed to be done, rather than false, indicating that the
7644         section's size could not be computed.
7645
7646 2002-06-18  Dave Brolley  <brolley@redhat.com>
7647
7648         From Catherine Moore, Michael Meissner, Dave Brolley:
7649         * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c
7650         * targets.c: Support bfd_elf32_frv_vec.
7651         * reloc.c: Add FRV relocs.
7652         * configure.in: Add support for bfd-elf32-frv-vec.
7653         * config.bfd (targ_cpu): Add support for frv-*-elf.
7654         * archures.c: Add frv arch and machines.
7655         * Makefile.am (ALL_MACHINES): Add cpu-frv.lo.
7656         (ALL_MACHINES_CFILES): Add cpu-frv.c.
7657         (BFD32_BACKENDS): Add elf32-frv.lo.
7658         (BFD32_BACKENDS_CFILES): Add elf32-frv.c
7659         (cpu-frv.lo): New target.
7660         (elf32-frv.lo): New target.
7661         * cpu-frv.c: New file.
7662         * elf32-frv.c: New file.
7663
7664 2002-06-18  Jakub Jelinek  <jakub@redhat.com>
7665
7666         * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies
7667         e_shnum == 0.
7668         Only read the first section header if e_shoff is non-zero.
7669         Don't consider e_shstrndx if there are no sections.
7670
7671 2002-06-17  Tom Rix <trix@redhat.com>
7672
7673         * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R,
7674         R_D10V_10_PCREL_L and R_D10V_18_PCREL to use
7675         complain_overflow_bitfield.
7676
7677 2002-06-17  Alan Modra  <amodra@bigpond.net.au>
7678
7679         * opncls.c (bfd_openr): Remove redundant bfd_set_error.
7680         (bfd_fdopenr): Likewise.
7681         (bfd_openstreamr): Likewise.
7682         (bfd_openw): Likewise.
7683
7684         * targets.c: Sort target vecs.
7685         (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec,
7686         bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec,
7687         bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec,
7688         bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec.
7689         * configure.in: Sort target vecs.  Add m88kmach3_vec.
7690         * configure: Regenerate.
7691
7692 2002-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
7693
7694         * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
7695         bpo_reloc_no to break sort order ties, not address of items.
7696
7697 2002-06-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7698
7699         * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
7700         Skip excluded sections in determing __gp value.
7701         (elf_hppa_final_link_relocate): Use the symbol's address in
7702         R_PARISC_FPTR64 relocations that don't need an opd entry.
7703         * elf64-hppa.c (allocate_dynrel_entries): Simplify code.
7704         (elf64_hppa_finalize_dynreloc): Likewise.
7705         (elf64_hppa_size_dynamic_sections): Move comments and fix typo.
7706         (elf64_hppa_finish_dynamic_symbol): Break up assert.
7707
7708 2002-06-14  Sergey Grigoriev  <serge@leopold.Physik.Uni-Augsburg.DE>
7709
7710         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
7711         alignment for .bss, .data and .text sections so that sse and sse2
7712         code will work.
7713         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
7714
7715 2002-06013  J"orn Rennecke  <joern.rennecke@superh.com>
7716
7717         config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*,
7718         sh[1234]*-elf*.
7719
7720 2002-06-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
7721
7722         * elflink.h (elf_bfd_final_link): Improve error handling for missing
7723         dynamic sections.
7724
7725         * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry
7726         for a symbol that has no output section.
7727         (allocate_dynrel_entries): Correct comment.
7728         (elf64_hppa_finalize_dynreloc): Likewise.  Don't create an opd entry
7729         unless we want one.
7730         (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL.
7731         (elf64_hppa_finalize_dlt): Likewise.  Prevent segfault for symbols
7732         with no section.  Remove unnecessary parentheses.
7733
7734 2002-06-11  Tom Rix  <trix@redhat.com>
7735
7736         * coffcode.h (coff_compute_section_file_positions): Add data
7737         section to AIX loader alignment check.
7738
7739         * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section
7740         alignment to 4 bytes.
7741         (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment
7742         power accessor macro.
7743         (do_shared_object_padding): Remove invalid assertion.
7744
7745 2002-06-10  Richard Sandiford  <rsandifo@redhat.com>
7746
7747         * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE
7748         for removed output sections.
7749
7750 2002-06-10  Geoffrey Keating  <geoffk@redhat.com>
7751
7752         * merge.c (merge_strings): Use htab_create_alloc with calloc, not
7753         htab_alloc.
7754         * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise.
7755
7756 2002-06-08  H.J. Lu <hjl@gnu.org>
7757
7758         * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to
7759         work around a long long bug in gcc 2.96 on mips.
7760
7761 2002-06-08  Jason Thorpe  <thorpej@wasabisystems.com>
7762
7763         * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo.
7764         (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c.
7765         Regenerate dependency lists.
7766         * Makefile.in: Regenerate.
7767         * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add
7768         vax1knetbsd_vec to targ_selvecs.
7769         * configure.in: Add vax1knetbsd_vec.
7770         * configure: Regenerate.
7771         * targets.c (_bfd_target_vector): Add vax1knetbsd_vec.
7772         * vax1knetbsd.c: New file.
7773         * vaxnetbsd.c: Update copyright years.
7774         (TARGET_PAGE_SIZE): Set to 0x1000.
7775         (DEFAULT_MID): Set to M_VAX4K_NETBSD.
7776
7777 2002-06-08  Matt Thomas  <matt@3am-software.com>
7778
7779         * libaout.h (enum machine_type): Add M_VAX4K_NETBSD.
7780
7781 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
7782
7783         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static.
7784
7785 2002-06-08  Alan Modra  <amodra@bigpond.net.au>
7786
7787         * Makefile.am: Run "make dep-am".
7788         * Makefile.in: Regenerate.
7789
7790         * armnetbsd.c: Replace CONST with const.
7791         * corefile.c: Likewise.
7792         * elf32-dlx.c: Likewise.
7793         * elf64-mips.c: Likewise.
7794         * mmo.c: Likewise.
7795         * ns32knetbsd.c: Likewise.
7796
7797         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash
7798         table is elf64-sparc.
7799
7800 2002-06-08  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
7801
7802         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code.
7803         Fix RELA addends to get not shifted in the result. Don't do special
7804         handling of R_MIPS_64 for NewABI.
7805
7806 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7807
7808         * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
7809         (NAME(aout,slurp_reloc_table)): Likewise.
7810         * coff-mips.c (mips_relax_section): Use bfd_zalloc.
7811         * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc.
7812         (xcoff_write_archive_contents_big): Likewise.
7813         (xcoff_generate_rtinit): Likewise.
7814         (xcoff_generate_rtinit): Likewise, and check error return.
7815         * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
7816         * coffgen.c (coff_section_symbol): Use bfd_zalloc.
7817         (coff_get_normalized_symtab): Likewise.
7818         (coff_make_empty_symbol): Likewise.
7819         (bfd_coff_set_symbol_class): Likewise.
7820         * cofflink.c (coff_link_add_symbols): Likewise.
7821         * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise.
7822         * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc.
7823         (bfd_ecoff_write_accumulated_debug): Likewise.
7824         * elf64-alpha.c (get_got_entry): Use bfd_zalloc.
7825         * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise.
7826         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc.
7827         * ieee.c (do_with_relocs): Use bfd_zalloc.
7828         * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise.
7829         * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
7830         (NAME(aout,slurp_reloc_table)): Likewise.
7831         (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd.
7832         * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc.
7833         * som.c (som_build_and_write_symbol_table): Likewise.
7834         (som_slurp_string_table): Likewise.
7835         (som_slurp_symbol_table): Likewise.
7836         (som_bfd_ar_write_symbol_stuff): Likewise.
7837         * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc.
7838         * sunos.c (bfd_sunos_size_dynamic_sections): Likewise.
7839         * tekhex.c (find_chunk): Likewise.  Get rid of unused "sname".
7840         * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc.
7841         * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc.
7842
7843 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7844
7845         * elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with
7846         "group" union.
7847         (elf_group_name): Update.
7848         (elf_group_id): Define.
7849         (bfd_elf_set_group_contents): Declare.
7850         * elf.c (elf_fake_sections): Qualify use of elf_group_name.
7851         (set_group_contents): Rename to bfd_elf_set_group_contents.  Remove
7852         ATTRIBUTE_UNUSED from failedptrarg.  If elf_group_id is set, use
7853         that sym for the signature.
7854         (_bfd_elf_compute_section_file_positions): Don't call
7855         set_group_contents for "ld -r" case.
7856         (swap_out_syms): Use bfd_zalloc.
7857         * elflink.h (elf_link_add_archive_symbols): Likewise.
7858         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
7859         (elf_bfd_final_link): Call bfd_elf_set_group_contents.
7860
7861 2002-06-07  Alan Modra  <amodra@bigpond.net.au>
7862
7863         * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
7864         relocs in opd for non-shared too.
7865
7866 2002-06-06  Jeffrey Law  <law@redhat.com>
7867
7868         * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
7869         relocations.
7870
7871 2002-06-06  Nick Clifton  <nickc@cambridge.redhat.com>
7872
7873         * merge.c: Include libiberty.h.
7874         * elf-strtab.c: Include libiberty.h.
7875
7876 2002-06-06  Elias Athanasopoulos  <eathan@otenet.gr>
7877
7878         * peXXigen.c (pe_print_idata): Remove unused variable.
7879
7880 2002-06-06  David Heine <dlheine@tensilica.com>
7881
7882         * elf.c (assign_file_positions_for_segments): Remove unallocated
7883         sections from the section to segment mapping for PT_LOAD segments.
7884         Update comment about empty loadable segments.
7885
7886 2002-06-06  Richard Sandiford  <rsandifo@redhat.com>
7887
7888         * stabs.c (_bfd_link_section_stabs): Check that the symbol offset
7889         is within the .stabstr section.
7890
7891 2002-06-06  Alan Modra  <amodra@bigpond.net.au>
7892
7893         * elf-bfd.h (struct elf_size_info <swap_symbol_in>): Function args
7894         are "const PTR", not "const PTR *".
7895         (bfd_elf32_swap_symbol_in): Likewise.
7896         (bfd_elf64_swap_symbol_in): Likewise.
7897         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR.
7898         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
7899         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7900         (elf_link_add_object_symbols): Likewise.
7901         (elf_link_record_local_dynamic_symbol): Likewise.
7902         (elf_link_input_bfd): Likewise.
7903         (elf_gc_mark): Likewise.
7904         (elf_reloc_symbol_deleted_p): Likewise.
7905         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
7906         (mn10200_elf_relax_delete_bytes): Likewise.
7907         (mn10200_elf_symbol_address_p): Likewise.
7908         (mn10200_elf_get_relocated_section_contents): Likewise.
7909         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
7910         (mn10300_elf_relax_section): Likewise.
7911         (mn10300_elf_relax_delete_bytes): Likewise.
7912         (mn10300_elf_symbol_address_p): Likewise.
7913         (mn10300_elf_get_relocated_section_contents): Likewise.
7914         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
7915         (elf32_h8_relax_delete_bytes): Likewise.
7916         (elf32_h8_symbol_address_p): Likewise.
7917         (elf32_h8_get_relocated_section_contents): Likewise.
7918         * elf32-hppa.c (get_local_syms): Likewise.
7919         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
7920         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7921         * elf32-sh.c (sh_elf_relax_section): Likewise.
7922         (sh_elf_relax_delete_bytes): Likewise.
7923         (sh_elf_get_relocated_section_contents): Likewise.
7924         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
7925         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
7926         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
7927         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7928         * elf64-ppc.c (get_local_syms): Likewise.
7929         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
7930         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
7931
7932 2002-06-05  J"orn Rennecke <joern.rennecke@superh.com>
7933
7934         * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations.
7935
7936 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
7937
7938         * elf.c (group_signature): Swap in the whole symbol, and handle
7939         extracting section symbol names.
7940         (setup_group): Add comment.
7941         (set_group_contents): When called from objcopy or ld, arrange for
7942         section contents to be written.  Write group member output section
7943         indices to allow objcopy to reorganize sections.
7944         (_bfd_elf_copy_private_section_data): Copy group info.
7945
7946         * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field.
7947         (bfd_elf32_swap_symbol_in): Update prototype.
7948         (bfd_elf64_swap_symbol_in): Likewise.
7949         * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *.
7950         (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
7951         * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
7952         (elf_link_add_object_symbols): Likewise.
7953         (elf_link_record_local_dynamic_symbol): Likewise.
7954         (elf_link_input_bfd): Likewise.
7955         (elf_gc_mark): Likewise.
7956         (elf_reloc_symbol_deleted_p): Likewise.
7957         * elf-m10200.c (mn10200_elf_relax_section): Likewise.
7958         (mn10200_elf_relax_delete_bytes): Likewise.
7959         (mn10200_elf_symbol_address_p): Likewise.
7960         (mn10200_elf_get_relocated_section_contents): Likewise.
7961         * elf-m10300.c (mn10300_elf_relax_section): Likewise.
7962         (mn10300_elf_relax_section): Likewise.
7963         (mn10300_elf_relax_delete_bytes): Likewise.
7964         (mn10300_elf_symbol_address_p): Likewise.
7965         (mn10300_elf_get_relocated_section_contents): Likewise.
7966         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
7967         (elf32_h8_relax_delete_bytes): Likewise.
7968         (elf32_h8_symbol_address_p): Likewise.
7969         (elf32_h8_get_relocated_section_contents): Likewise.
7970         * elf32-hppa.c (get_local_syms): Likewise.
7971         * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
7972         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
7973         * elf32-sh.c (sh_elf_relax_section): Likewise.
7974         (sh_elf_relax_delete_bytes): Likewise.
7975         (sh_elf_get_relocated_section_contents): Likewise.
7976         * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
7977         * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
7978         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
7979         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
7980         * elf64-ppc.c (get_local_syms): Likewise.
7981         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
7982         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
7983         * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser.
7984         * elf64-alpha.c (alpha_elf_size_info): Likewise.
7985         * elf64-hppa.c (hppa64_elf_size_info): Likewise.
7986         * elf64-mips.c (mips_elf64_size_info): Likewise.
7987         * elf64-s390.c (s390_elf64_size_info): Likewise.
7988         * elf64-sparc.c (sparc64_elf_size_info): Likewise.
7989
7990 2002-06-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7991
7992         * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to...
7993         elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here.
7994         elf64-mips.c (elf_backend_ignore_discarded_relocs): Use
7995         _bfd_mips_elf_ignore_discarded_relocs.
7996         elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare.
7997
7998 2002-06-05  H.J. Lu <hjl@gnu.org>
7999
8000         * elfxx-mips.c (mips_elf_calculate_relocation): Call
8001         _bfd_elf_rel_local_sym for STT_SECTION relocations against
8002         the SEC_MERGE section.
8003
8004 2002-06-05  Alan Modra  <amodra@bigpond.net.au>
8005
8006         * coff-alpha.c: Update copyright date.
8007         * coff-mips.c: Likewise.
8008         * xcoff-target.h: Likewise.
8009
8010         * bfd-in.h: Remove "taken from the source" comment.
8011         * libbfd-in.h: Likewise.
8012         * libcoff-in.h: Likewise.
8013         * bfd-in2.h: Regenerate.
8014         * libbfd.h: Regenerate.
8015         * libcoff.h: Regenerate.
8016
8017         * elf.c (bfd_elf_discard_group): Return true.
8018         * elf-bfd.h (bfd_elf_discard_group): Declare.
8019         * bfd-in.h (bfd_elf_discard_group): Don't declare here.
8020         * section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
8021         * bfd.c (bfd_discard_group): Define.
8022         * targets.c (struct bfd_target): Add _bfd_discard_group.
8023         (BFD_JUMP_TABLE_LINK): Here too.
8024         * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
8025         * aout-adobe.c (aout_32_bfd_discard_group): Define.
8026         * aout-target.h (MY_bfd_discard_group): Define.
8027         * aout-tic30.c (MY_bfd_discard_group): Define.
8028         * binary.c (binary_bfd_discard_group): Define.
8029         * bout.c (b_out_bfd_discard_group): Define.
8030         * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
8031         * coffcode.h (coff_bfd_discard_group): Define.
8032         * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
8033         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
8034         * i386msdos.c (msdos_bfd_discard_group): Define.
8035         * i386os9k.c (os9k_bfd_discard_group): Define.
8036         * ieee.c (ieee_bfd_discard_group): Define.
8037         * ihex.c (ihex_bfd_discard_group): Define.
8038         * mmo.c (mmo_bfd_discard_group): Define.
8039         * nlm-target.h (nlm_bfd_discard_group): Define.
8040         * oasys.c (oasys_bfd_discard_group): Define.
8041         * ppcboot.c (ppcboot_bfd_discard_group): Define.
8042         * som.c (som_bfd_discard_group): Define.
8043         * srec.c (srec_bfd_discard_group): Define.
8044         * tekhex.c (tekhex_bfd_discard_group): Define.
8045         * versados.c (versados_bfd_discard_group): Define.
8046         * vms.c (vms_bfd_discard_group): Define.
8047         * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
8048         * coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
8049         (aix5coff64_vec): Likewise.
8050         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
8051
8052 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
8053
8054         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo.
8055         (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c.
8056         (elf32-sh64-com.lo): New dependency list.
8057         * Makefile.in: Regenerate.
8058         * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec)
8059         (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add
8060         elf32-sh64-com.lo.
8061         * configure: Regenerate.
8062         * elf32-sh64.c (sh64_address_in_cranges)
8063         (sh64_get_contents_type, sh64_address_is_shmedia): Move to...
8064         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb):
8065         (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to...
8066         * elf32-sh64-com.c: ...here.  New file.
8067
8068 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
8069
8070         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove
8071         ATTRIBUTE_UNUSED on used params.
8072         * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks
8073         before calling bfd_section_from_elf_index on local syms.
8074         * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
8075
8076 2002-06-04  Jason Thorpe  <thorpej@wasabisystems.com>
8077
8078         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo.
8079         (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c.
8080         (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo.
8081         (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c.
8082         (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules.
8083         * Makefile.in: Regenerate.
8084         * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
8085         (sh64-*-netbsd*): New targets.
8086         * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec,
8087         bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec.
8088         * configure: Regenerate.
8089         * elf32-sh64-nbsd.c: New file.
8090         * elf64-sh64-nbsd.c: New file.
8091         * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec,
8092         bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and
8093         bfd_elf64_sh64lnbsd_vec.
8094
8095 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
8096
8097         * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups.
8098         (bfd_section_from_shdr): Likewise.  Set section name of group
8099         sections from signature.
8100         (group_signature): Split out from setup_group.  Ensure symbol table
8101         is available.
8102         (bfd_elf_discard_group): New function.
8103         (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on
8104         .gnu.linkonce* sections if they are members of a group.
8105         (set_group_contents): Set GRP_COMDAT flag.
8106         * section.c (bfd_discard_group): New function.
8107         * bfd-in.h (bfd_elf_discard_group): Declare.
8108         * bfd-in2.h: Regenerate.
8109         * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field.
8110         (elf_linkonce_p): Define.
8111
8112 2002-06-04  Alan Modra  <amodra@bigpond.net.au>
8113
8114         * elf.c (bfd_section_from_shdr): Make "name" const.
8115         * elf-bfd.h (elf_backend_section_from_shdr): Likewise.
8116         * elf32-i370.c (i370_elf_section_from_shdr): Likewise.
8117         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
8118         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
8119         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
8120         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
8121         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
8122         * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise.
8123         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
8124         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
8125         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
8126
8127 2002-06-03  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
8128
8129         * elfxx-mips.c (ABI_64_P): Use backend's data to determine the
8130         ABI.
8131
8132 2002-06-02  Kazu Hirata  <kazu@cs.umass.edu>
8133
8134         * elf32-arc.c: Fix formatting.
8135         * elf32-arm.h: Likewise.
8136         * elf32-cris.c: Likewise.
8137         * elf32-dlx.c: Likewise.
8138         * elf32-hppa.c: Likewise.
8139         * elf32-i386.c: Likewise.
8140         * elf32-i386qnx.c: Likewise.
8141         * elf32-or32.c: Likewise.
8142         * elf32-s390.c: Likewise.
8143         * elf32-sh64.c: Likewise.
8144         * elf32-vax.c: Likewise.
8145         * elf32-xstormy16.c: Likewise.
8146         * elf64-alpha.c: Likewise.
8147         * elf64-mmix.c: Likewise.
8148         * elf64-ppc.c: Likewise.
8149         * elf64-s390.c: Likewise.
8150         * elf64-sh64.c: Likewise.
8151         * elf64-x86-64.c: Likewise.
8152
8153 2002-06-02  Richard Henderson  <rth@redhat.com>
8154
8155         * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
8156         null when there are no got entries for a symbol.
8157         (elf64_alpha_relax_find_tls_segment): Rearrange to avoid
8158         uninitialized variable warning.
8159
8160 2002-06-01  Richard Henderson  <rth@redhat.com>
8161
8162         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for
8163         undefined symbols here.
8164         (elf64_alpha_relax_section): Do it here.  Also test for not
8165         defined in the current module.
8166         (elf64_alpha_relocate_section_r): Split out of ...
8167         (elf64_alpha_relocate_section): ... here.  Don't dereference
8168         NULL when looking up local got entries.
8169
8170 2002-06-01  Richard Henderson  <rth@redhat.com>
8171
8172         * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined
8173         symbols from JSR relaxation.
8174         (elf64_alpha_size_plt_section_1): New.
8175         (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ...
8176         (elf64_alpha_size_rela_got_1): ... here.
8177         (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ...
8178         (elf64_alpha_size_rela_got_section): ... here.
8179         (elf64_alpha_size_plt_section): New.
8180         (elf64_alpha_relax_section): Call them.
8181         (elf64_alpha_size_got_sections): Remove output_bfd arg.
8182         (elf64_alpha_finish_dynamic_symbol): Check gotent use_count.
8183
8184 2002-06-01  Richard Henderson  <rth@redhat.com>
8185
8186         * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New.
8187         (elf64_alpha_relocate_section): Use them.  Reject LE TLS relocs
8188         in shared libraries.  Fix DTPRELHI and TPRELHI value.
8189         (INSN_ADDQ, INSN_RDUNIQ): New.
8190         (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent.
8191         (elf64_alpha_relax_with_lituse): Return boolean.  Remove irelend
8192         argument.  Reject dynamic symbols.  Use LITUSE symbolic constants.
8193         (elf64_alpha_relax_got_load): Rename from relax_without_lituse.
8194         Handle GOTDTPREL and GOTTPREL relocations.
8195         (elf64_alpha_relax_gprelhilo): New.
8196         (elf64_alpha_relax_tls_get_addr): New.
8197         (elf64_alpha_relax_find_tls_segment): New.
8198         (elf64_alpha_relax_section): Handle TLS relocations.
8199         (ALPHA_ELF_LINK_HASH_TLS_IE): New.
8200         (elf64_alpha_check_relocs): Set it.
8201
8202 2002-06-01  Richard Henderson  <rth@redhat.com>
8203
8204         * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp.
8205
8206         * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic
8207         check; don't suppress dynamic relocs for non-allocated sections.
8208
8209         * elf64-alpha.c: Remove dead code.
8210
8211 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
8212
8213         * bfd-in2.h: Regenerate.
8214         * libbfd.h: Regenerate.
8215         * po/SRC-POTFILES.in: Regenerate.
8216
8217         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
8218         space for bss .plt.
8219
8220 2002-05-31  Graeme Peterson  <gp@qnx.com>
8221
8222         * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
8223         (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
8224         Run "make dep-am".
8225         * Makefile.in: Regenerate.
8226         * config.bfd: Add i[3456]86-*-nto-qnx* support.
8227         * configure.in: Add bfd_elf32_i386qnx_vec support.
8228         * configure: Regenerate.
8229         * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
8230         is_contained_by_filepos, and copy_private_bfd_data_p.
8231         * elf.c (assign_file_positions_for_segments): Call backend
8232         set_nonloadable_filepos.  Fix non-K&R call to _bfd_error_handler.
8233         (IS_CONTAINED_BY_FILEPOS): Define.
8234         (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
8235         (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS.  Typo fix.
8236         Fix non-K&R call to _bfd_error_handler.
8237         (_bfd_elf_copy_private_section_data): Use backend
8238         copy_private_bfd_data_p.
8239         * elf32-i386.c: Don't include elfxx-target.h when
8240         ELF32_I386_C_INCLUDED is defined.
8241         * elf32-i386qnx.c: New QNX elf backend file.
8242         * elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
8243         elf_backend_is_contained_by_filepos, and
8244         elf_backend_do_copy_private_bfd_data.
8245         * targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
8246
8247 2002-05-31  Alan Modra  <amodra@bigpond.net.au>
8248
8249         * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define.
8250         Move other similar defines to start of file.
8251
8252 2002-05-30  Tom Rix  <trix@redhat.com>
8253
8254         * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA.
8255         * coff64-rs6000.c (xcoff64_rtype2howto): Same.
8256
8257 2002-05-30  Richard Henderson  <rth@redhat.com>
8258
8259         * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD,
8260         ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New.
8261         (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove.
8262         (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove.
8263         (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated.
8264         (struct alpha_elf_obj_tdata): Rename total_got_entries and
8265         n_local_got_entries to total_got_size and local_got_size.
8266         (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs.
8267         (alpha_got_entry_size): New.
8268         (elf64_alpha_relax_with_lituse): Use it.
8269         (elf64_alpha_relax_without_lituse): Likewise.
8270         (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES.
8271         (get_got_entry): New.
8272         (elf64_alpha_check_relocs): Handle TLS relocs.  Reorganize.
8273         (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask.
8274         (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type.
8275         (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise.
8276         (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size.
8277         (elf64_alpha_calc_got_offsets): Likewise.
8278         (alpha_dynamic_entries_for_reloc): New.
8279         (elf64_alpha_calc_dynrel_sizes): Use it.
8280         (elf64_alpha_size_dynamic_sections): Likewise.
8281         (elf64_alpha_relocate_section): Handle TLS relocations.
8282         * reloc.c: Add Alpha TLS relocations.
8283         * bfd-in2.h, libbfd.h: Rebuild.
8284
8285 2002-05-29 Ralf Habacker <ralf.habacker@freenet.de>
8286
8287         * peXXigen.c (pe_print_idata): Remove double printed
8288         import table lines; add Bound-To comment.
8289
8290 2002-05-29  Matt Thomas  <matt@3am-software.com>
8291
8292         * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo.
8293         (BFD32_BACKENDS_CFILES): Add elf32-vax.c.
8294         (elf32-vax.lo): New rule.
8295         * Makefile.in: Regenerate.
8296         * configure.in (bfd_elf32_vax_vec)
8297         (vaxnetbsd_vec): New vectors.
8298         * configure: Regenerate.
8299         * config.bfd (vax-*-netbsdelf*)
8300         (vax-*-netbsdaout*)
8301         (vax-*-netbsd*): New targets.
8302         * elf32-vax.c: New file.
8303         * reloc.c: Add VAX relocations.
8304         * bfd-in2.h: Regenerate.
8305         * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec.
8306
8307 2002-05-29  Jason Thorpe  <thorpej@wasabisystems.com>
8308
8309         * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec
8310         and bfd_elf32_bigarm_vec to targ_selvecs.
8311
8312 2002-05-29  Ralf Habacker  <ralf.habacker@freenet.de>
8313
8314         * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables
8315         with auto-imported symbols.
8316
8317 2002-05-29  Adam Nemet  <anemet@lnxw.com>
8318
8319         * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue
8320         sections only record bfd.
8321         (bfd_elf32_arm_add_glue_sections_to_bfd): New function.
8322         * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it.
8323         * bfd-in2.h: Regenerate.
8324
8325 2002-05-28  Nick Clifton  <nickc@cambridge.redhat.com>
8326
8327         * syms.c (_bfd_stab_section_find_nearest_line): Move
8328         declaration and initialisation of saw_line and saw_func out of
8329         for loop.
8330
8331 2002-05-29  Alan Modra  <amodra@bigpond.net.au>
8332
8333         * elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
8334         (bfd_elf64_get_symbol_info): Define.
8335         * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
8336
8337 2002-05-29  Andrey Volkov  <avolkov@transas.com>
8338
8339         * cpu-h8300.c: Make default h8300 machine first in machine list.
8340
8341 2002-05-28  Kuang Hwa Lin <kuang@sbcglobal.net>
8342
8343         * config.bfd: Added DLX configuraton.
8344         * Makefile.am: Added DLX configuraton.
8345         * configure.in: Added DLX configuraton.
8346         * archures.c: Add DLX architecure.
8347         * reloc.c: Add DLX relocs.
8348         * targets.c: Added DLX target vector.
8349         * configure: Regenerate.
8350         * Makefile.in: Regenreate.
8351         * bfd-in2.h: Regenreate.
8352         * elf32-dlx.c: New file: Support DLX target.
8353         * cpu-dlx.c: New file: Support DLX target.
8354
8355 2002-05-25  Alan Modra  <amodra@bigpond.net.au>
8356
8357         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting.
8358
8359         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change.
8360         (ppc64_elf_check_relocs): Don't set up function descriptor symbol
8361         strings to point inside function code sym string.
8362         (func_desc_adjust): Likewise.
8363         (ppc64_elf_hide_symbol): Rewrite code to look up function code sym.
8364
8365 2002-05-24  Michal Ludvig  <mludvig@suse.cz>
8366
8367         * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added.
8368         (elf64_x86_64_grok_psinfo): Added.
8369
8370 2002-05-24  TAMURA Kent <kent@netbsd.org>
8371
8372         * config.bfd: Add a target for i386-netbsdpe.
8373
8374 2002-05-24  Alan Modra  <amodra@bigpond.net.au>
8375
8376         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func
8377         and is_func_descriptor.
8378         (func_desc_adjust): Hide function code sym in shared libs unless
8379         there is a matching exported function descriptor sym.
8380
8381 2002-05-23  Jakub Jelinek  <jakub@redhat.com>
8382
8383         * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
8384         for symbols from SHF_TLS section.
8385         (_bfd_elf_print_private_bfd_data): Add PT_TLS.
8386         (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
8387         (map_sections_to_segments): Build PT_TLS segment if necessary.
8388         (assign_file_positions_for_segments): Likewise.
8389         (get_program_header_size): Account for PT_TLS segment.
8390         (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
8391         SEC_THREAD_LOCAL sections to STT_TLS.
8392         * reloc.c: Add 386 and IA-64 TLS relocs.
8393         * section.c (SEC_THREAD_LOCAL): Define.
8394         (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
8395         Remove.
8396         * elflink.h (elf_link_add_object_symbols): Support .tcommon.
8397         (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
8398         unconditionally.
8399         (struct elf_final_link_info): Add first_tls_sec.
8400         (elf_bfd_final_link): Set first_tls_sec.
8401         Compute elf_hash_table (info)->tls_segment.
8402         (elf_link_output_extsym): Handle STT_TLS symbols.
8403         (elf_link_input_bfd): Likewise.
8404         * syms.c (BSF_THREAD_LOCAL): Define.
8405         * bfd-in2.h: Rebuilt.
8406         * libbfd.h: Rebuilt.
8407         * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
8408         elf_i386_mkobject, elf_i386_object_p): New functions.
8409         (elf_howto_table): Add TLS relocs.
8410         (elf_i386_reloc_type_lookup): Support TLS relocs.
8411         (elf_i386_info_to_howto_rel): Likewise.
8412         (struct elf_i386_link_hash_entry): Add tls_type.
8413         (struct elf_i386_obj_tdata): New.
8414         (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
8415         New macros.
8416         (struct elf_i386_link_hash_table): Add tls_ldm_got.
8417         (link_hash_newfunc): Clear tls_type.
8418         (elf_i386_check_relocs): Support TLS relocs.
8419         (elf_i386_gc_sweep_hook): Likewise.
8420         (allocate_dynrelocs): Likewise.
8421         (elf_i386_size_dynamic_sections): Likewise.
8422         (elf_i386_relocate_section): Likewise.
8423         (elf_i386_finish_dynamic_symbol): Likewise.
8424         (bfd_elf32_mkobject, elf_backend_object_p): Define.
8425         * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
8426         dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
8427         want_tprel, want_dtpmod, want_dtprel.
8428         (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
8429         (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
8430         R_IA64_LTOFF_TPREL22.
8431         (elf_code_to_howto_index): Add TLS relocs.
8432         (elfNN_ia64_check_relocs): Support TLS relocs.
8433         (allocate_global_data_got): Account for TLS .got data.
8434         (allocate_dynrel_entries): Account for TLS dynamic relocations.
8435         (elfNN_ia64_install_value): Supprt TLS relocs.
8436         (set_got_entry): Support TLS relocs.
8437         (elfNN_ia64_relocate_section): Likewise.
8438
8439 2002-05-23  Nick Clifton  <nickc@cambridge.redhat.com>
8440
8441         * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb
8442         BLX reloc round the relocation up rather than down.
8443         * coff-arm.c (coff_arm_relocate_section): Likewise.
8444
8445 2002-05-21  H.J. Lu  (hjl@gnu.org)
8446
8447         * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple
8448         definition.
8449
8450 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
8451
8452         * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt.
8453         (ppc64_elf_relocate_section): Handle unresolved relocs in opd.
8454
8455 2002-05-22  Alan Modra  <amodra@bigpond.net.au>
8456
8457         * elf64-ppc.c (ppc64_elf_relocate_section): Return false for
8458         unresolved relocs.
8459         (ppc64_elf_size_dynamic_sections): Check for splt NULL.
8460
8461 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8462
8463         * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
8464         non-ELF targets.
8465
8466 2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8467
8468         * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return
8469         an error value.
8470         * elflink.h (elf_link_output_relocs): Likewise. Improve error message.
8471         return with false on error.
8472         (elf_link_input_bfd): Check reloc_emitter return value.
8473
8474 2002-05-21  Jason Thorpe  <thorpej@wasabisystems.com>
8475
8476         * config.bfd (armeb-*-netbsdelf*): New target.
8477
8478 2002-05-20  Alan Modra  <amodra@bigpond.net.au>
8479
8480         * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
8481         at the plt call stub.
8482
8483 2002-05-19  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8484
8485         * cpu-mips.c (mips_compatible): Don't try to check machine
8486         compatibility.
8487
8488 2002-05-18  Tom Rix  <trix@redhat.com>
8489
8490         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent.
8491
8492 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
8493
8494         * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting.
8495         (ppc64_elf_relocate_section): Don't warn about reloc overflow when
8496         we've already warned about an undefined symbol.  Report more
8497         detail on reloc errors.
8498
8499 2002-05-17  Alan Modra  <amodra@bigpond.net.au>
8500
8501         * acinclude.m4 (AM_INSTALL_LIBBFD): New.
8502         * configure.in: Invoke AM_INSTALL_LIBBFD.
8503         * Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
8504         (install_libbfd): .. New target.
8505         (uninstall_libbfd): Likewise.
8506         (install-bfdlibLTLIBRARIES): Likewise.
8507         (uninstall-bfdlibLTLIBRARIES): Likewise.
8508         (bfdlibdir): New.
8509         (bfdincludedir): New.
8510         (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
8511         * aclocal.m4: Regenerate.
8512         * configure: Regenerate.
8513         * Makefile.in: Regenerate.
8514
8515 2002-05-17  Stuart Balfour <sbalfour@cisco.com>
8516
8517         * hash.c (bfd_hash_lookup): Remove computation of len from inside
8518         hash loop.
8519
8520 2002-05-16  Nick Clifton  <nickc@cambridge.redhat.com>
8521
8522         * config.bfd: Add targets for sh64-linux (little endian and
8523         big endian).
8524
8525 2002-05-15  Laurent Pinchart <laurent.pinchart@skynet.be>
8526
8527         * peXXigen.c (pe_print_idata): Do not assume that the first thunk
8528         is located in the same section as the import table.  Instead
8529         check, and if necessary load the section containing the thunk.
8530
8531 2002-05-15  Nick Clifton  <nickc@cambridge.redhat.com>
8532
8533         * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with
8534         bfd_bread.
8535         (xcoff64_core_file_matches_executable_p): Replace bfd_read
8536         with bfd_bread.
8537
8538 2002-05-15  Alan Modra  <amodra@bigpond.net.au>
8539
8540         * aix5ppc-core.c: Warning fixes.
8541         * aout-adobe.c (aout_32_bfd_link_just_syms): Define.
8542         * aout-target.h (MY_bfd_link_just_syms): Define.
8543         * aout-tic30.c (MY_bfd_link_just_syms): Define.
8544         * bfd.c (bfd_link_just_syms): Define.
8545         * binary.c (binary_bfd_link_just_syms): Define.
8546         * bout.c (b_out_bfd_link_just_syms): Define.
8547         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
8548         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
8549         * coffcode.h (coff_bfd_link_just_syms): Define.
8550         * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
8551         (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
8552         (_bfd_elf_link_just_syms): Declare.
8553         * elf.c (_bfd_elf_link_just_syms): New function.
8554         * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
8555         sections haven't already been discarded by the linker.
8556         * elflink.h (elf_link_add_object_symbols): Likewise for stab
8557         sections and SEC_MERGE sections.
8558         (elf_bfd_discard_info): Similarly here.
8559         * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
8560         * i386msdos.c (msdos_bfd_link_just_syms): Define.
8561         * i386os9k.c (os9k_bfd_link_just_syms): Define.
8562         * ieee.c (ieee_bfd_link_just_syms): Define.
8563         * ihex.c (ihex_bfd_link_just_syms): Define.
8564         * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
8565         (_bfd_generic_link_just_syms): Declare.
8566         * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
8567         * linker.c (_bfd_generic_link_just_syms): New function.
8568         * mmo.c (mmo_bfd_link_just_syms): Define.
8569         * nlm-target.h (nlm_bfd_link_just_syms): Define.
8570         * oasys.c (oasys_bfd_link_just_syms): Define.
8571         * ppcboot.c (ppcboot_bfd_link_just_syms): Define.
8572         * som.c (som_bfd_link_just_syms): Define.
8573         * srec.c (srec_bfd_link_just_syms): Define.
8574         * targets.c (struct bfd_target): Add _bfd_link_just_syms.
8575         (BFD_JUMP_TABLE_LINK): And here.
8576         * tekhex.c (tekhex_bfd_link_just_syms): Define.
8577         * versados.c (versados_bfd_link_just_syms): Define.
8578         * vms.c (vms_bfd_link_just_syms): Define.
8579         * libbfd.h: Regenerate.
8580         * bfd-in2.h: Regenerate.
8581
8582 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8583
8584         * elf32-mips.c: Remove superfluous definitions copied from
8585         elfxx-mips.c.
8586         (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the
8587         SGIish vectors to check the special case.
8588         (mips_elf_hi16_reloc): Fix comment.
8589         (mips_elf_got16_reloc): Likewise.
8590         (_bfd_mips_elf32_gprel16_reloc): Likewise.
8591         (elf_reloc_map): Code cleanup.
8592         (mips_reloc_map): Add comment.
8593         (bfd_elf23_bfd_reloc_type_lookup): Code cleanup.
8594         (mips_elf32_rtype_to_howto): Likewise.
8595         (mips_elf32_discard_info): Likewise.
8596         (elf32_mips_irix_compat): Invert logic: Only SGIish vectors
8597         lead to IRIX compatibility now.
8598
8599 2002-05-15  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
8600
8601         * elfxx-mips.c: Call it IRIX, not Irix in comments.
8602
8603 2002-05-13  Jason Thorpe  <thorpej@wasabisystems.com>
8604
8605         * config.bfd (shle-*-netbsdelf*): Add target which includes
8606         sh64 support.
8607
8608 2002-05-13  David Edelsohn  <edelsohn@gnu.org>
8609
8610         * configure.in: Revert 2002-04-07.  Instead, auto-configure
8611         HAVE_ST_C_IMPL.
8612         * configure: Regenerate.
8613         * config.in: Regenerate.
8614         * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL
8615         or AIX_5_CORE.
8616
8617 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
8618
8619         * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd
8620         corefiles as well.2
8621         * configure: Regenerate.
8622
8623 2002-05-13  Alan Modra  <amodra@bigpond.net.au>
8624
8625         * Makefile.am (install-data-local): Install headers to
8626         $(exec_prefix)/include.
8627         * Makefile.in: Regenerate.
8628
8629 2002-05-11  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
8630             Daniel Jacobowitz  <drow@mvista.com>
8631
8632         * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE.  Don't
8633         map BFD_RELOC_RVA.
8634
8635 2002-05-11  Federico G. Schwindt <fgsch@olimpo.com.br>
8636
8637         * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*,
8638         hppa*-*-openbsd*): New targets.
8639         * configure.in (alpha*-*-openbsd*): Set COREFILE.
8640         * configure: Regenerate.
8641
8642 2002-05-10  Tom Rix  <trix@redhat.com>
8643
8644         * coff64-rs6000.c (xcoff64_reloc_type_br): New function for
8645         xcoff64_ppc_relocate_section.
8646         * coff-rs6000.c : Extern common xcoff_reloc_type functions.
8647         * libxcoff.h: Common xcoff_reloc_type function declaration.
8648
8649 2002-05-10  Alan Modra  <amodra@bigpond.net.au>
8650
8651         * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks
8652         added in 2002-05-09 commit.
8653
8654         * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04,
8655         don't look for stubs on all undefined syms.
8656
8657 2002-05-09  Alan Modra  <amodra@bigpond.net.au>
8658
8659         * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete.
8660         (ppc64_elf_howto_raw <R_PPC64_RELATIVE>): Not pc_relative or
8661         pcrel_offset.
8662
8663         * elf32-i386.c (elf_howto_table): Comments.
8664         (elf_i386_relocate_section): Handle more relocs for relocatable
8665         linking and against SEC_MERGE sections.
8666
8667 2002-05-08  Alan Modra  <amodra@bigpond.net.au>
8668
8669         * elf32-ppc.c (ppc_elf_create_got): New function.
8670         (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before
8671         _bfd_elf_create_dynamic_sections.  Correct .plt flags.
8672         (ppc_elf_check_relocs): Use ppc_elf_create_got in place of
8673         _bfd_elf_create_got_section.
8674
8675 2002-05-07  Alan Modra  <amodra@bigpond.net.au>
8676
8677         * elf-bfd.h (struct elf_backend_data): Add rela_normal.
8678         * elfxx-target.h (elf_backend_rela_normal): Define.
8679         (elfNN_bed): Init rela_normal.
8680         * elflink.h (elf_link_input_bfd <emit_relocs>): Handle adjustment
8681         for section symbols here if rela_normal.  Simplify abs section test.
8682         * elf-m10200.c (mn10200_elf_relocate_section): If relocatable,
8683         return immediately.  Remove code handling relocatable linking.
8684         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
8685         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
8686         * elf32-i370.c (i370_elf_relocate_section): Likewise.
8687         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
8688         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
8689         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
8690         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
8691         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
8692         * elf32-s390.c (elf_s390_relocate_section): Likewise.
8693         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
8694         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
8695         * elf64-s390.c (elf_s390_relocate_section): Likewise.
8696         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
8697         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
8698         * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL.
8699         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
8700         * elf-m10200.c (elf_backend_rela_normal): Define.
8701         * elf-m10300.c (elf_backend_rela_normal): Define.
8702         * elf32-fr30.c (elf_backend_rela_normal): Define.
8703         * elf32-i370.c (elf_backend_rela_normal): Define.
8704         * elf32-i860.c (elf_backend_rela_normal): Define.
8705         * elf32-m68k.c (elf_backend_rela_normal): Define.
8706         * elf32-mcore.c (elf_backend_rela_normal): Define.
8707         * elf32-openrisc.c (elf_backend_rela_normal): Define.
8708         * elf32-ppc.c (elf_backend_rela_normal): Define.
8709         * elf32-s390.c (elf_backend_rela_normal): Define.
8710         * elf32-xstormy16.c (elf_backend_rela_normal): Define.
8711         * elf64-ppc.c (elf_backend_rela_normal): Define.
8712         * elf64-s390.c (elf_backend_rela_normal): Define.
8713         * elf64-x86-64.c (elf_backend_rela_normal): Define.
8714         * elfxx-ia64.c (elf_backend_rela_normal): Define.
8715         * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL.
8716         * elf32-m32r.c (elf_backend_rela_normal): Likewise.
8717
8718 2002-05-06  Nick Clifton  <nickc@cambridge.redhat.com>
8719
8720         * elf32-arm.h (elf32_arm_final_link_relocate): Convert
8721         'reloc_signed_max' and 'reloc_signed_min' into half-word offsets.
8722
8723 2002-05-06  Alan Modra  <amodra@bigpond.net.au>
8724
8725         * elflink.h (elf_link_input_bfd <emit_relocs>): Adjust r_offset
8726         when not relocatable.  Fix reloc_emitter call for K&R.
8727
8728 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
8729
8730         * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code
8731         reloading local sym addend mistakenly removed in 2002-05-01 change.
8732
8733         * dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
8734         (read_abbrevs): Change "offset" param to bfd_vma.
8735         (parse_comp_unit): Change "version" and addr_size to unsigned ints.
8736         Change "abbrev_offset" to bfd_vma.
8737         (read_indirect_string): Use correct conversion chars in error
8738         message format string, cast bfd_vma's to unsigned long.
8739         (read_abbrevs): Likewise.
8740         (read_attribute_value): Likewise.
8741         (decode_line_info): Likewise.
8742         (scan_unit_for_functions): Likewise.
8743         (parse_comp_unit): Likewise.
8744
8745 2002-05-04  Tom Rix  <trix@redhat.com>
8746
8747         * coffswap.h (coff_swap_reloc_in): Remove XCOFF support.
8748         (coff_swap_reloc_out): Same.
8749         * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h.
8750         (xcoff_swap_reloc_out): Same.
8751         (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special
8752         case some 16 bit relocs. Add reloc value to output.
8753         (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit
8754         R_RBR. Improve names.
8755         (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS.
8756         (bfd_xcoff_backend_data): Update with new reloc swap names.
8757         (bfd_pmac_xcoff_backend_data) : Same.
8758         * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h.
8759         (xcoff64_swap_reloc_out): Same.
8760         (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit
8761         R_POS. Add reloc value to output.
8762         (xcoff64_howto_table): Move 64 bit R_POS to first entry.  Add 16
8763         bit R_RBR. Improve names, masks.
8764         (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS.
8765         (bfd_xcoff_backend_data): Update with new reloc swap names.
8766         (bfd_xcoff_aix5_backend_data) : Same.
8767
8768 2002-05-04  Alan Modra  <amodra@bigpond.net.au>
8769
8770         * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add
8771         bfd_count top_index, input_list, all_local_syms.
8772         (elf32_hppa_setup_section_lists): New function, split from
8773         elf32_hppa_size_stubs.
8774         (elf32_hppa_next_input_section): Likewise.
8775         (group_sections): Likewise.
8776         (get_local_syms): Likewise.
8777         (elf32_hppa_size_stubs): Adjust for split out functions.  Look for
8778         stubs on undefined syms too.
8779         (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*.
8780         Only access htab elf fields when we have an elf hash table.
8781         * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare.
8782         (elf32_hppa_next_input_section): Declare.
8783
8784 2002-05-04  Bob Byrnes  <byrnes@curl.com>
8785
8786         * opncls.c (_bfd_new_bfd_contained_in): Check return value of
8787         _bfd_new_bfd.
8788
8789 2002-05-03  H.J. Lu  (hjl@gnu.org)
8790
8791         * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
8792         (mips_elf_link_hash_newfunc): Initialize forced_local to false.
8793         (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
8794         to hide a global symbol.
8795         (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
8796         forced_local to true.
8797
8798 2002-05-02  Richard Henderson  <rth@redhat.com>
8799
8800         * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs
8801         vs SHN_UNDEF to zero.
8802
8803 2002-05-02  Alan Modra  <amodra@bigpond.net.au>
8804
8805         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_SECTOFF>): Change to a
8806         16 bit reloc.
8807         <R_PPC64_SECTOFF_DS>: Likewise.
8808         (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
8809         SECTOFF reloc.
8810         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_SECTOFF>): Correct.
8811         (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
8812         SECTOFF reloc.
8813
8814         * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete.
8815         (ppc64_elf_ha_reloc): New function.
8816         (ppc64_elf_brtaken_reloc): New function.
8817         (ppc64_elf_sectoff_reloc): New function.
8818         (ppc64_elf_sectoff_ha_reloc): New function.
8819         (ppc64_elf_toc_reloc): New function.
8820         (ppc64_elf_toc_ha_reloc): New function.
8821         (ppc64_elf_toc64_reloc): New function.
8822         (ppc64_elf_unhandled_reloc): New function.
8823         (ppc64_elf_howto_raw): Use the above.
8824         <R_PPC64_RELATIVE>: Mark pc_relative, pcrel_offset.
8825         <R_PPC64_SECTOFF>: Not pc_relative or pcrel_offset.  Fix dst_mask.
8826         <R_PPC64_SECTOFF_DS>: Likewise.
8827         (IS_ABSOLUTE_RELOC): Update.
8828         (struct ppc_link_hash_table): Add have_undefweak.
8829         (ppc64_elf_link_hash_table_create): Init.
8830         (func_desc_adjust): Set have_undefweak.
8831         (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier.  Only
8832         add the .sfpr blr when have_undefweak.
8833         (ppc64_elf_setup_section_lists): Check hash table flavour.
8834         (ppc64_elf_next_input_section): Move output_section->owner test to
8835         ppc64elf.em.
8836         (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param
8837         and relocatable test.  Return TOCstart and don't set elf_gp.
8838         (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch
8839         offset calculation.  Add assert on weak sym branch tweaks.
8840         * elf64-ppc.h (ppc64_elf_set_toc): Delete.
8841         (ppc64_elf_toc): Declare.
8842         (ppc64_elf_next_input_section): Update.
8843
8844 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
8845
8846         * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL
8847         file_name.
8848
8849 2002-05-01  Alan Modra  <amodra@bigpond.net.au>
8850
8851         * elf64-ppc.c (CROR_151515, CROR_313131): Define.
8852         (ppc64_elf_relocate_section): Use them.  Don't look for plt calls
8853         on R_PPC64_ADDR24 relocs.  Require a nop or no link reg on plt
8854         call branches.  Correct undefined weak destination.
8855         (ppc64_elf_func_desc_adjust): Always create at least one blr in
8856         .sfpr, and correct case where either only savef* or restf* is
8857         needed.
8858
8859         Long branch stubs, multiple stub sections.
8860         * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare.
8861         (ppc64_elf_next_input_section): Declare.
8862         * elf64-ppc.c: Move linker-only prototypes.
8863         (STUB_SUFFIX): Define.
8864         (enum ppc_stub_type): New.
8865         (struct ppc_stub_hash_entry): New.
8866         (struct ppc_branch_hash_entry): New.
8867         (struct ppc_link_hash_entry): Add stub_cache, oh.
8868         (struct ppc_link_hash_table): Add stub_hash_table etc.  Remove
8869         sstub.  Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration.
8870         Rename plt_overflow to stub_error.
8871         (ppc_stub_hash_lookup): Define.
8872         (ppc_branch_hash_lookup): Define.
8873         (stub_hash_newfunc): New function.
8874         (branch_hash_newfunc): New function.
8875         (link_hash_newfunc): Init new fields.
8876         (ppc64_elf_link_hash_table_create): Likewise.
8877         (ppc64_elf_link_hash_table_free): New function.
8878         (ppc_stub_name): New function.
8879         (ppc_get_stub_entry): New function.
8880         (ppc_add_stub): New function.
8881         (create_linkage_sections): Use bfd_make_section_anyway.  Create
8882         .branch_lt and .rela.branch_lt sections.  Don't create .stub.
8883         (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*,
8884         and set up for plt call stubs.  Link func and func desc syms.
8885         (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24.
8886         (func_desc_adjust): Avoid hash lookup when func desc sym available
8887         via shortcut, and set links when processing.
8888         (ppc64_elf_hide_symbol): Likewise.
8889         (allocate_dynrelocs): Don't allocate stub section here.
8890         (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt.
8891         Remove sstub code.
8892         (ppc_type_of_stub): New function.
8893         (build_one_stub): Delete.
8894         (ppc_build_one_stub): New function.
8895         (ppc_size_one_stub): New function.
8896         (ppc64_elf_setup_section_lists): New function.
8897         (ppc64_elf_next_input_section): New function.
8898         (group_sections): New function.
8899         (get_local_syms): New function.
8900         (ppc64_elf_size_stubs): Rewrite.
8901         (ppc64_elf_build_stubs): Rewrite.
8902         (ppc64_elf_relocate_section): Look up stub entry for REL24
8903         relocs.  Don't propagate REL14* to dynamic objects.  Look for long
8904         branch stubs if REL14* or REL24 relocs won't reach.
8905         (bfd_elf64_bfd_link_hash_table_free): Define.
8906
8907 2002-04-30  Mark Mitchell  <mark@codesourcery.com>
8908
8909         * config.bfd: Add support for powerpc-*-windiss.
8910
8911 2002-04-30  Tom Rix  <trix@redhat.com>
8912
8913         * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT
8914         symbol names into the hash table.
8915
8916 2002-04-28  Tom Rix  <trix@redhat.com>
8917
8918         * coff-rs6000.c (xcoff_calculate_relocation) : Function table for
8919         calulating relocations.
8920         (xcoff_complain_overflow) : Function table for relocation errors.
8921         (xcoff_ppc_relocate_section): Use relocation and complain function
8922         tables.
8923         (xcoff_complain_overflow_unsigned_func): New complain function.
8924         (xcoff_complain_overflow_signed_func): Same.
8925         (xcoff_complain_overflow_bitfield_func): Same.
8926         (xcoff_complain_overflow_dont_func): Same.
8927         (xcoff_reloc_type_crel): New recot function.
8928         (xcoff_reloc_type_br): Same.
8929         (xcoff_reloc_type_ba): Same.
8930         (xcoff_reloc_type_toc): Same.
8931         (xcoff_reloc_type_rel): Same.
8932         (xcoff_reloc_type_neg): Same.
8933         (xcoff_reloc_type_pos): Same.
8934         (xcoff_reloc_type_fail): Same.
8935         (xcoff_reloc_type_noop): Same.
8936         * libxcoff.h : Declare common parts for xcoff64.
8937         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation
8938         and complain function tables.
8939
8940 2002-04-28  Alan Modra  <amodra@bigpond.net.au>
8941
8942         * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo.
8943         * elf32-hppa.c (elf32_hppa_final_link): Formatting.
8944
8945 2002-04-26  Alan Modra  <amodra@bigpond.net.au>
8946
8947         * opncls.c (bfd_make_readable): Call bfd_section_list_clear.
8948         * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
8949
8950         * elflink.h (elf_bfd_final_link): Ensure input bfd class is the
8951         same as the output before calling elf_link_input_bfd.
8952
8953         * coffcode.h (coff_compute_section_file_positions): Set
8954         section_tail after shuffling section list.
8955
8956 2002-04-24  Christian Groessler <chris@groessler.org>
8957
8958         * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The
8959         addresses are 23bit with a special layout, not plain 32bit
8960         values.  Prevent relocation of immediate values.
8961
8962 2002-04-24  Chris G. Demetriou  <cgd@broadcom.com>
8963
8964         * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or
8965         MIPS-16 ASE flags are set, print something to indicate that.
8966
8967 2002-04-23  Alan Modra  <amodra@bigpond.net.au>
8968
8969         * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition
8970         under which a plt call stub is used.
8971         (final_link_relocate): Similarly.
8972         (allocate_plt_static): Clear h-plabel except when plt entry is
8973         exclusively used for a plabel.
8974         (allocate_dynrelocs): Use the above to simplify plt sizing.
8975         (struct elf32_hppa_link_hash_table): Add has_22bit_branch.
8976         (elf32_hppa_link_hash_table_create): Init.
8977         (BL22_RP): Define.
8978         (hppa_build_one_stub): Use BL22_RP if has_22bit_branch.
8979         (elf32_hppa_check_relocs): Set has_22bit_branch.
8980
8981         * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message.
8982         (final_link_relocate): Likewise.
8983
8984 2002-04-22  Jakub Jelinek  <jakub@redhat.com>
8985
8986         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build
8987         search table if some FDE is DW_EH_PE_aligned encoded either.
8988         (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially.
8989
8990 2002-04-22  Richard Smith  <richard@ex-parrot.com>
8991             Jakub Jelinek  <jakub@redhat.com>
8992
8993         * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative.
8994         (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel
8995         encoded personality.
8996         (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality
8997         for CIE/FDE removal.
8998
8999 2002-04-20  Tom Rix  <trix@redhat.com>
9000
9001         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent.
9002
9003 2002-04-20  Alan Modra  <amodra@bigpond.net.au>
9004
9005         * archures.c (bfd_lookup_arch): Move the list order comment..
9006         (struct bfd_arch_info): ..to where it belongs.
9007         * bfd-in2.h: Regenerate.
9008
9009         * archures.c (bfd_lookup_arch): Add comment on list order.
9010         (bfd_default_set_arch_mach): Use bfd_lookup_arch.
9011         * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default
9012         is always at head of list.
9013
9014 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
9015
9016         * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9,
9017         insert_thumb_branch, record_thumb_to_arm_glue): Suppress
9018         definition of these functions for ARM_WINCE builds as they are
9019         not used.
9020         (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define
9021         for ARM_WINCE builds.
9022
9023 2002-04-18  Nick Clifton  <nickc@cambridge.redhat.com>
9024
9025         * coff-arm.c (bfd_arm_process_before_allocation):
9026
9027 2002-04-17  J"orn Rennecke <joern.rennecke@superh.com>
9028
9029         * cpu-sh.c (scan_mach): Delete.
9030         (arch_info_struct): Replace scan_mach with bfd_default_scan.
9031         (bfd_sh_arch): Likewise.
9032
9033 2002-04-16  Nick Clifton  <nickc@cambridge.redhat.com>
9034
9035         * ihex.c (ihex_write_object_contents): Fix check for records
9036         crossing 64K boundaries.
9037
9038 2002-04-16  Alan Modra  <amodra@bigpond.net.au>
9039
9040         * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
9041         type rather than just assuming entries are ELF.
9042         * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
9043         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
9044         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
9045         * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
9046         rather than elf_link_hash_entry.
9047
9048 2002-04-15  Richard Henderson  <rth@redhat.com>
9049
9050         * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow
9051         n32 binaries.
9052
9053 2002-04-15  Michael Snyder  <msnyder@redhat.com>
9054
9055         * opncls.c (bfd_close): Write contents if writeable.
9056         Minor formatting tidy-ups.
9057
9058 2002-04-15  Alan Modra  <amodra@bigpond.net.au>
9059
9060         * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.
9061
9062 2002-04-12  Michael Snyder  <msnyder@redhat.com>
9063
9064         * bfd-in.h (bfd_get_section_lma): New access macro.
9065         Minor white-space fix-up.
9066
9067 2002-04-12  Alan Modra  <amodra@bigpond.net.au>
9068
9069         * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or
9070         header pad.
9071
9072 2002-04-09  DJ Delorie  <dj@redhat.com>
9073
9074         * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks.
9075
9076 2002-04-09  Casper S. Hornstrup <chorns@users.sourceforge.net>
9077
9078         * coffcode.h (coff_read_word): New.
9079         (coff_compute_checksum): New.
9080         (coff_apply_checksum): New.
9081         (coff_write_object_contents): Call coff_apply_checksum () to
9082         apply checksum to PE image.
9083
9084 2002-04-08  Randolph Chung  <tausq@debian.org>
9085
9086         * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h.
9087         (elf32_hppa_final_link): Split out sorting logic to..
9088         * elf-hppa.h (elf_hppa_sort_unwind): ..here.
9089         (elf_hppa_final_link): Call elf_hppa_sort_unwind.
9090
9091 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
9092
9093         * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]*
9094         pattern.
9095         * configure: Re-generate.
9096
9097 2002-04-07  Andrew Cagney  <ac131313@redhat.com>
9098
9099         * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version
9100         is greater or equal to 4.3.3.
9101         * configure: Regenerate.
9102         Fix PR gdb/344.
9103
9104 2002-04-05  Hans-Peter Nilsson  <hp@axis.com>
9105
9106         * elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
9107         R_CRIS_32_PCREL>: Fix typo in name.
9108         (cris_elf_check_relocs): Always create .rela.got here when
9109         R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen.
9110         (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here;
9111         assume it's created.
9112
9113 2002-04-04  Daniel Jacobowitz  <drow@mvista.com>
9114
9115         * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define.
9116         * aout-target.h (MY_bfd_link_hash_table_free): Conditionally
9117         define.
9118         * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise.
9119         * bfd.c (bfd_link_hash_table_free): Define.
9120         * binary.c (binary_bfd_link_hash_table_free): Define.
9121         * bout.c (b_out_bfd_link_hash_table_free): Define.
9122         * coff-rs6000.c (rs6000coff_vec): Include
9123         _bfd_generic_link_hash_table_free.
9124         (pmac_xcoff_vec): Likewise.
9125         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
9126         (aix5coff64_vec): Likewise.
9127         * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define.
9128         * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function.
9129         (bfd_elf32_bfd_link_hash_table_free): Define.
9130         * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function.
9131         (bfd_elf32_bfd_link_hash_table_free): Define.
9132         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally
9133         define.
9134         * i386msdos.c (msdos_bfd_link_hash_table_free): Define.
9135         * i386os9k.c (os9k_bfd_link_hash_table_free): Define.
9136         * ieee.c (ieee_bfd_link_hash_table_free): Define.
9137         * ihex.c (ihex_bfd_link_hash_table_free): Define.
9138         * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define.
9139         (_bfd_generic_link_hash_table_free): Add prototype.
9140         * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype.
9141         * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define.
9142         * linker.c (_bfd_generic_link_hash_table_free): New function.
9143         * mmo.c (mmo_bfd_link_hash_table_free): Define.
9144         * nlm-target.h (nlm_bfd_link_hash_table_free): Define.
9145         * oasys.c (oasys_bfd_link_hash_table_free): Define.
9146         * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define.
9147         * som.c (som_bfd_link_hash_table_free): Define.
9148         * srec.c (srec_bfd_link_hash_table_free): Define.
9149         * tekhex.c (tekhex_bfd_link_hash_table_free): Define.
9150         * versados.c (versados_bfd_link_hash_table_free): Define.
9151         * vms.c (vms_bfd_link_hash_table_free): New function.
9152         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function.
9153
9154         * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc
9155         instead of bfd_alloc.
9156         * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
9157         * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise.
9158         * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise.
9159         * cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
9160         * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
9161         * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
9162         * elf.c (_bfd_elf_link_hash_table_create): Likewise.
9163         * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise.
9164         * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
9165         * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
9166         * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
9167         * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
9168         * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
9169         * elf32-sh.c (sh_elf_link_hash_table_create): Likewise.
9170         * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise.
9171         * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
9172         * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
9173         * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
9174         * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise.
9175         * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise.
9176         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
9177         * linker.c (_bfd_generic_link_hash_table_create): Likewise.
9178         * m68klinux.c (linux_link_hash_table_create): Likewise.
9179         * sparclinux.c (linux_link_hash_table_create): Likewise.
9180         * sunos.c (sunos_link_hash_table_create): Likewise.
9181         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
9182
9183         * targets.c: Add _bfd_link_hash_table_free to xvec.
9184
9185         * bfd-in2.h: Regenerate.
9186         * libbfd.h: Regenerate.
9187         * libcoff.h: Regenerate.
9188
9189 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
9190
9191         * dep-in.sed: Cope with absolute paths.
9192         * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR.
9193         Run "make dep-am".
9194         * Makefile.in: Regenerate.
9195         * coff-arm.c: Fix copyright date.
9196         * cpu-h8300.c: Likewise.
9197         * cpu-i370.c: Likewise.
9198         * cpu-s390.c: Likewise.
9199         * cpu-mips.c: Likewise.
9200         * po/SRC-POTFILES.in: Regenerate.
9201
9202 2002-04-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
9203
9204         * Makefile.am: Add elfxx-mips.c to the known backends.
9205         (elf32-mips.lo): remove dependency to coff/external.h.
9206         * Makefile.in: Regenerate.
9207         * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo
9208         Remove elf32-mips.lo from 64 bit vectors. Update dependencies
9209         accordingly.
9210         * configure: Regenerate.
9211         * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h.
9212         (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c.
9213         (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New
9214         MIPS specific backend functions.
9215         * elf32-mips.c: Moved most code to elfxx-mips.c.
9216         (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make
9217         static.
9218         (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc.
9219         (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc.
9220         (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc.
9221         (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed
9222         interface to allow selection of the right REL or RELA howto table.
9223         (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made
9224         static. Let it refuse n32 objects.
9225         (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus.
9226         (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo.
9227         (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info.
9228         (elf32_mips_ignore_discarded_relocs): Rename from
9229         _bfd_elf32_mips_ignore_discarded_relocs.
9230         (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section.
9231         (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT.
9232         (elf_mips_howto_table_rela): Remove.
9233         * elf64-mips.c: Moved most code to elfxx-mips.c.
9234         (bfd_elf64_bfd_reloc_type_lookup): Make static.
9235         (mips_elf64_rtype_to_howto): New function.
9236         (mips_elf64_object_p): Likewise.
9237         (elf64_mips_irix_compat): Likewise.
9238         * elfxx-mips.c: New file containing common code merged together from
9239         elf32-mips.c and elf64-mips.c.
9240         * elfxx-mips.h: New file containing MIPS specific prototypes from
9241         elf-bfd.h.
9242         * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and
9243         elf_backend_mips_rtype_to_howto.
9244
9245 2002-04-04  Alan Modra  <amodra@bigpond.net.au>
9246
9247         * srec.c (MAXCHUNK, Chunk): Revise comments.
9248         (srec_write_record): Correct buffer size.
9249         (srec_write_header): Do without intermediate buffer.
9250         (srec_write_section): Validate Chunk.
9251         (srec_write_terminator): Pass NULL instead of dummy buffer.
9252         (srec_write_symbols): Pass file and symbol names directly to
9253         bfd_bwrite so sprintf won't overflow buffer.
9254
9255 2002-04-03  Jakub Jelinek  <jakub@redhat.com>
9256
9257         * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic
9258         PC relative relocs against hidden symbols.
9259         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
9260
9261 2002-04-03  Alan Modra  <amodra@bigpond.net.au>
9262
9263         * elf.c (_bfd_elf_make_section_from_shdr): When setting section
9264         LMAs, loop over segments until p_vaddr and p_memsz specify an
9265         extent enclosing the section.
9266
9267 2002-04-02  Nick Clifton  <nickc@cambridge.redhat.com>
9268
9269         * ihex.c (ihex_write_object_contents): Do not allow records to
9270         cross a 64K boundary - wrap if necessary.
9271
9272 2002-04-01  Nathan Williams  <nathanw@wasabisystems.com>
9273
9274         * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
9275         which caused the returned LWP ID to always be 0.
9276
9277 2002-04-01  Richard Henderson  <rth@redhat.com>
9278
9279         * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
9280         (elf32_sparc_relocate_section): Use it to figure out when to
9281         initialize .got entries.
9282         * elf64-sparc.c: Similarly.
9283
9284 2002-03-28  Alan Modra  <amodra@bigpond.net.au>
9285
9286         * linker.c (link_action): Ignore duplicate warning syms.
9287         (_bfd_generic_link_write_global_symbol): Follow warning symbol link.
9288         * elflink.h (elf_adjust_dynstr_offsets): Likewise.
9289         (elf_adjust_dynamic_symbol): Likewise.
9290         (elf_export_symbol): Likewise.
9291         (elf_link_find_version_dependencies): Likewise.
9292         (elf_link_assign_sym_version): Likewise.
9293         (elf_link_sec_merge_syms): Likewise.
9294         (elf_link_output_extsym): Likewise.
9295         (elf_gc_sweep_symbol): Likewise.
9296         (elf_gc_propagate_vtable_entries_used): Likewise.
9297         (elf_gc_smash_unused_vtentry_relocs): Likewise.
9298         (elf_gc_allocate_got_offsets): Likewise.
9299         (elf_collect_hash_codes): Likewise.
9300         * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
9301         * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
9302         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
9303         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
9304         * elf32-arm.h (elf32_arm_discard_copies): Likewise.
9305         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
9306         (elf_cris_discard_excess_dso_dynamics): Likewise.
9307         * elf32-hppa.c (clobber_millicode_symbols): Likewise.
9308         (mark_PIC_calls): Likewise.
9309         (allocate_plt_static): Likewise.
9310         (allocate_dynrelocs): Likewise.
9311         (readonly_dynrelocs): Likewise.
9312         * elf32-i386.c (allocate_dynrelocs): Likewise.
9313         (readonly_dynrelocs): Likewise.
9314         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
9315         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
9316         * elf32-mips.c (mips_elf_output_extsym): Likewise.
9317         (mips_elf_sort_hash_table_f): Likewise.
9318         (mips_elf_check_mips16_stubs): Likewise.
9319         * elf32-s390.c (allocate_dynrelocs): Likewise.
9320         (readonly_dynrelocs): Likewise.
9321         * elf32-sh.c (sh_elf_discard_copies): Likewise.
9322         * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
9323         (xstormy16_relax_plt_realloc): Likewise.
9324         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
9325         (elf64_alpha_output_extsym): Likewise.
9326         * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
9327         * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
9328         (mips_elf64_check_mips16_stubs): Likewise.
9329         (mips_elf64_output_extsym): Likewise.
9330         * elf64-ppc.c (func_desc_adjust): Likewise.
9331         (allocate_dynrelocs): Likewise.
9332         (readonly_dynrelocs): Likewise.
9333         * elf64-s390.c (allocate_dynrelocs): Likewise.
9334         (readonly_dynrelocs): Likewise.
9335         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
9336         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
9337         (readonly_dynrelocs): Likewise.
9338         * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
9339         * aoutx.h (aout_link_write_other_symbol): Likewise.
9340         * cofflink.c (_bfd_coff_write_task_globals): Likewise.
9341         (_bfd_coff_write_global_sym): Likewise.
9342         * i386linux.c (linux_tally_symbols): Likewise.
9343         * m68klinux.c (linux_tally_symbols): Likewise.
9344         * sparclinux.c (linux_tally_symbols): Likewise.
9345         * pdp11.c (aout_link_write_other_symbol): Likewise.
9346         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
9347         * xcofflink.c (xcoff_build_ldsyms): Likewise.
9348         (xcoff_write_global_symbol): Likewise.
9349
9350         * cofflink.c (_bfd_coff_final_link): Formatting.
9351         * cpu-mips.c (mips_compatible): Make static, prototype.
9352         * elf32-i386.c (elf_i386_check_relocs): Formatting.
9353         * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
9354         * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
9355         * elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
9356         (mips_elf64_final_link): Likewise.
9357         * elflink.h (elf_link_find_version_dependencies): Remove duplicate
9358         prototype.
9359
9360 2002-03-27  Nick Clifton  <nickc@cambridge.redhat.com>
9361
9362         * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define.
9363         (SWAP_OUT_RELOC_OFFSET): Define.
9364
9365 2002-03-27  Gregory Steuck <greg@nest.cx>
9366
9367         * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for
9368         terminating NULL if empty symbol table.
9369         (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
9370
9371 2002-03-26  H.J. Lu  (hjl@gnu.org)
9372
9373         * elflink.h (elf_link_input_bfd): Revert the last change since
9374         the gcc exception handling isn't fixed yet.
9375
9376 2002-03-26  H.J. Lu  (hjl@gnu.org)
9377
9378         * elflink.h (elf_link_input_bfd): Complain about relocations
9379         against local symbols in discarded sections.
9380
9381 2002-03-26  Alan Modra  <amodra@bigpond.net.au>
9382
9383         * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections.
9384
9385 2002-03-23  Alan Modra  <amodra@bigpond.net.au>
9386
9387         * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
9388         section file offset for !SEC_LOAD sections.
9389
9390 2002-03-21  Richard Earnshaw  <rearnsha@arm.com>
9391
9392         * elf32-arm.h (elf32_arm_final_link_relocate <case R_ARM_GOTOFF>,
9393         <case R_ARM_GOT>): Handle relocations to Thumb functions.
9394
9395 2002-03-21  Alan Modra  <amodra@bigpond.net.au>
9396
9397         * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
9398         Whitespace changes.
9399         * archive.c: Update copyright date.
9400         * bfd-in2.h: Regenerate.
9401         * libbfd.h: Regenerate.
9402         * Makefile.am: Run "make dep-am"
9403         * Makefile.in: Regenerate.
9404         * po/SRC-POTFILES.in: Regenerate.
9405
9406 2002-03-20  Daniel Jacobowitz  <drow@mvista.com>
9407
9408         * dwarf2.c (struct funcinfo): Move up.
9409         (lookup_address_in_function_table): New argument function_ptr.
9410         Set it.
9411         (lookup_address_in_line_table): New argument function.  If function
9412         is non-NULL, use it to handle ``addr'' before the first line note of
9413         the function.
9414         (comp_unit_find_nearest_line): Update and swap calls to
9415         lookup_address_in_function_table and lookup_address_in_line_table.
9416         * syms.c (_bfd_stab_section_find_nearest_line): Use the first
9417         N_SLINE encountered if we see an N_FUN before any N_SLINE.
9418
9419 2002-03-20  Tom Rix  <trix@redhat.com>
9420
9421         * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from
9422         _bfd_xcoff_generic_stat_arch_elt.  Fix format check.
9423         * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt.
9424
9425 2002-03-19  Tom Rix  <trix@redhat.com>
9426
9427         * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all
9428         dynamic objects in archives.
9429
9430 2002-03-19  Hans-Peter Nilsson  <hp@bitrange.com>
9431
9432         * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
9433         STT_NOTYPE symbols to STT_OBJECT.
9434
9435 2002-03-18  Jan Hubicka  <jh@suse.cz>
9436
9437         * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64"
9438
9439 2002-03-18  Tom Rix  <trix@redhat.com>
9440
9441         * aix5ppc.core.c : New file for AIX 5 64 bit core support.
9442         * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration.
9443         * coff-rs6000 (do_pad) : New function for archive padding.
9444         (do_copy) : New function for object file copying in archives.
9445         (do_shared_object_padding) : New function for padding shared
9446         objects to their text section alignment in archives.
9447         (bfd_xcoff_ar_achive_set_magic) : Stub.
9448         (xcoff_write_armap_big) : Use do_copy and do_pad.
9449         (xcoff_write_archive_contents_big) : Use do_shared_object_padding,
9450         do_copy and do_pad.
9451         * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use
9452         bfd_xcoff_magic_number.
9453         (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook
9454         fop.
9455         (xcoff_backend_data_r) : Use xcoff64_bad_format_hook.
9456         (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data.
9457         (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000.
9458         * rs6000-core.c : Update copyright date.
9459         * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL
9460         csectpp.
9461         * coffcode.h (coff_new_section_hook) : Use new accessor macros.
9462         (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #.
9463         (coff_set_flags) : Use bfd_xcoff_magic_number.
9464         * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC.
9465         * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support.
9466         * Makefile.am : Same.
9467         * config.bfd : Same.
9468         * targets.c : Same.
9469         * configure : Regnerate.
9470         * Makefile.in : Same.
9471         * bfd-in2.h : Same.
9472
9473 2002-03-18  Nick Clifton  <nickc@cambridge.redhat.com>
9474
9475         * po/fr.po: Updated version.
9476
9477 2002-03-18  Alan Modra  <amodra@bigpond.net.au>
9478
9479         * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success.
9480         * libbfd.h: Regenerate.
9481         * archive.c (coff_write_armap): Pass on failures from
9482         bfd_write_bigendian_4byte_int.
9483
9484 2002-03-14  H.J. Lu <hjl@gnu.org>
9485
9486         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD
9487         error to bfd_error_nonrepresentable_section for reinit_array
9488         section in DSO.
9489
9490 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
9491
9492         * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag,
9493         OR it in rather than replacing previously selected flags.
9494
9495         * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15.
9496         (TARGET_LITTLE_SYM): Set ar_max_namelen to 15.
9497
9498 2002-03-14  Alan Modra  <amodra@bigpond.net.au>
9499
9500         * cpu-mips.c (mips_compatible): New.  Don't check bits_per_word.
9501         (N): Use the above.
9502         * elflink.h (elf_bfd_final_link): Revert last change.  Instead,
9503         ensure reloc size matches before calling elf_link_input_bfd.
9504         Add an assert to check reloc size when counting output relocs.
9505
9506 2002-03-14  Nick Clifton  <nickc@cambridge.redhat.com>
9507
9508         * mmo.c (mmo_get_loc): Return NULL rather than false.
9509
9510 2002-03-13  Nick Clifton  <nickc@cambridge.redhat.com>
9511
9512         * po/fr.po: Updated version.
9513
9514 2002-03-13  Alan Modra  <amodra@bigpond.net.au>
9515
9516         * archures.c (bfd_default_compatible): Test bits_per_word.
9517         * cpu-i386.c (i386_compatible): Remove.  Replace occurrences with
9518         bfd_default_compatible.
9519         * cpu-i370.c (i370_compatible): Likewise.
9520         * cpu-sparc.c (sparc_compatible): Likewise.
9521         * cpu-h8300.c (compatible): Test in->arch == out->arch.
9522
9523         * elflink.h: Formatting fixes.
9524         (elf_link_output_extsym): Merge undefined and undef weak cases.
9525
9526         * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd
9527         when word size of input matches output word size.
9528
9529 2002-03-12  Andreas Jaeger  <aj@suse.de>
9530
9531         * cpu-i386.c (i386_compatible): New.  Use it instead of
9532         bfd_default_compatible.
9533
9534 2002-03-07  H.J. Lu  (hjl@gnu.org)
9535
9536         * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type
9537         as the type for bfd_reloc_val.
9538
9539 2002-03-05  John David Anglin  <dave@hiauly1.hia.nrc.ca>
9540
9541         * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
9542         (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols.
9543         (elf_hppa_final_link_relocate): Correct relocations for indirect
9544         references to local data through the DLT.  Fix .opd creation for
9545         local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64
9546         relocations.  Use e_lsel selector for R_PARISC_DLTIND21L,
9547         R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per
9548         "Processor-Specific ELF for PA_RISC, Version 1.43" document.
9549         Similarly, use e_rsel for DLT and LTOFF 'R' relocations.
9550         * elf32-hppa.c (final_link_relocate): Revise relocation selectors
9551         as per "Processor-Specific ELF for PA_RISC, Version 1.43" document.
9552
9553 2002-03-05  Jakub Jelinek  <jakub@redhat.com>
9554
9555         * merge.c (_bfd_merge_sections): Don't segfault if there
9556         is nothing to merge due to GC.
9557
9558 2002-03-05  Alan Modra  <amodra@bigpond.net.au>
9559
9560         * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep
9561         symbols that have been forced local.
9562
9563         * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
9564         to output forced local syms for non-shared link.
9565         (elf_link_output_extsym): Tweak condition for calling backend
9566         adjust_dynamic_symbol so that previous behaviour is kept.
9567         Whitespace changes throughout file.
9568
9569 2002-03-04  H.J. Lu <hjl@gnu.org>
9570
9571         * elf.c (bfd_section_from_shdr): Handle special sections,
9572         .init_array, .fini_array and .preinit_array.
9573         (elf_fake_sections): Likewise.
9574
9575         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the
9576         DT entry only if the section is in output for .init_array,
9577         .fini_array and .preinit_array. Complain about .preinit_array
9578         section in DSO.
9579         (elf_bfd_final_link): Warn zero size for .init_array,
9580         .fini_array and .preinit_array sections.
9581
9582         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
9583         SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
9584         (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
9585         .preinit_array.
9586
9587 2002-03-04  Alan Modra  <amodra@bigpond.net.au>
9588
9589         * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment.
9590         * configure: Regenerate.
9591
9592 2002-03-02  Tom Rix  <trix@redhat.com>
9593
9594         * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with
9595         symbolic equiv.
9596         * coff-rs6000.c (xcoff_howto_table): Same.
9597
9598 2002-03-01  David Mosberger  <davidm@hpl.hp.com>
9599
9600         * elflink.h (size_dynamic_sections): If section named
9601         ".preinit_array" exists, create DT_PREINIT_ARRAY and
9602         DT_PREINIT_ARRAYSZ entries in dynamic table.  Analogously for
9603         ".init_array" and ".fini_array".
9604         (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
9605         DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
9606         DT_FINI_ARRAY.
9607
9608 2002-02-26  Andrew Macleod  <amacleod@cygnus.com>
9609
9610         * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
9611         dynsyms.
9612
9613 2002-02-25  Alan Modra  <amodra@bigpond.net.au>
9614
9615         * elf64-hppa.h: Update copyright date.
9616
9617         * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix.
9618         (ppc64_elf_relocate_section): Don't generate power4 style branch
9619         hints for *_BRTAKEN and *_BRNTAKEN relocs.
9620
9621 2002-02-22  Jakub Jelinek  <jakub@redhat.com>
9622
9623         * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my
9624         last patch.
9625         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
9626
9627 2002-02-21  Andreas Jaeger  <aj@suse.de>
9628
9629         * elf64-x86-64.c: Major rework that introduces all recent changes
9630         to the x86-64 backend.  Get a closer match to elf32-i386.
9631         (struct elf64_x86_64_dyn_relocs): Rename from
9632         elf64_x86_64_pcrel_relocs_copied, add additional fields.  Change
9633         all users.
9634         (struct elf64_x86_64_link_hash_table): Add short cuts to some
9635         sections.
9636         (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc,
9637         remove casts, initialize new hash members.
9638         (create_got_section): New.
9639         (elf64_x86_64_create_dynamic_sections): New.
9640         (elf64_x86_64_copy_indirect_symbol): New.
9641         (elf64_x86_64_check_relocs): Don't allocate space for dynamic
9642         relocs, .got or .relgot here but do it in allocate_dynrelocs.
9643         Reference count possible .plt and .got entries.  Don't test input
9644         section SEC_READONLY here to try to avoid copy relocs, and keep
9645         dyn_relocs regardless of ELF_LINK_NON_GOT_REF.  Don't set
9646         DF_TEXTREL here.  Delay setting of variables until needed.  Cache
9647         pointer to "sreloc" section in elf_section_data. Tweak condition
9648         under which .got created.  Report files with bad relocation
9649         section names.
9650         (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
9651         Reference count possible .plt entries.  Don't deallocate .got and
9652         .relgot space here.
9653         (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc.  Don't
9654         do copy reloc processing for weakdefs.  Remove redundant casts and
9655         aborts.  Delay setting of vars until needed.  Move creation of
9656         dynamic symbols and allocation of .plt and .rela.plt to
9657         allocate_dynrelocs.  Replace BFD_ASSERT with abort.
9658         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
9659         (allocate_dynrelocs): New.
9660         (readonly_dynrelocs): New.
9661         (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs.
9662         Allocate space for dyn relocs.  Replace BFD_ASSERT with abort.
9663         Zero out the dynamic allocated content space.
9664         (elf64_x86_64_discard_copies): Removed.
9665         (elf64_x86_64_relocate_section): Make use of dynamic section
9666         short-cuts.  Localise vars, and delay setting.  Better error
9667         reporting, replace BFD_ASSERT with abort.  Check
9668         ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the
9669         regular object file and tread the weak definition as the normal
9670         one.  Don't discard relocs for undefweak or undefined symbols and
9671         check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy
9672         relocs.
9673         (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for
9674         symbols that have been forced local.  Use same test to decide if
9675         we can use a relative reloc for got as relocate_section.  Expand
9676         SHN_UNDEF comment.  Move expressions out of function calls.
9677         Replace BFD_ASSERT with abort.
9678         (bfd_elf64_bfd_final_link): Removed.
9679         (elf_backend_copy_indirect_symbol): Define.
9680
9681 2002-02-20  Tom Rix  <trix@redhat.com>
9682
9683         * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA.
9684         (_bfd_xcoff_reloc_type_lookup): Use it.
9685         * coff64-rs6000.c (xcoff64_howto_table): Same.
9686         (xcoff64_reloc_type_lookup): Same.
9687
9688 2002-02-20  Peter Schauer  <pes@regent.e-technik.tu-muenchen.de>
9689
9690         * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are
9691         little endian.
9692
9693 2002-02-19  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9694
9695         * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31.
9696         (bfd_mach_s390_esame): Rename to bfd_mach_s390_64.
9697         * bfd-in2.h: Regenerate.
9698         * cpu-s390.c (arch_info_struct): Use renamed architecture defines.
9699         Replace architecture name "s390" with "s390:31-bit" and "s390:esame"
9700         with "s390:64-bit".
9701         * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations.
9702         (elf_s390_reloc_type_lookup): Likewise.
9703         (elf_s390_check_relocs): Likewise.
9704         (elf_s390_gc_sweep_hook): Likewise.
9705         (elf_s390_relocate_section): Likewise.
9706         (elf_s390_object_p): Use renamed architecture define.
9707         * elf64-s390.c (elf_s390_object_p): Use renamed architecture define.
9708
9709 2002-02-19  Frank Ch. Eigler  <fche@redhat.com>
9710
9711         * syms.c (stt[]): Sorted.  Added .init/.fini -> "t" mapping.
9712
9713 2002-02-19  Jakub Jelinek  <jakub@redhat.com>
9714
9715         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable
9716         absptr -> pcrel optimization for shared libs.
9717         Only create minimal .eh_frame_hdr if absptr FDE encoding in shared
9718         library cannot be converted to pcrel.
9719         (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr
9720         relative.
9721         * elf32-i386.c (elf_i386_relocate_section): If
9722         _bfd_elf_section_offset returned -2, skip, but make sure the
9723         relocation is installed.
9724         * elf32-arm.h (elf32_arm_final_link_relocate): Likewise.
9725         * elf32-cris.c (cris_elf_relocate_section): Likewise.
9726         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
9727         * elf32-i370.c (i370_elf_relocate_section): Likewise.
9728         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
9729         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
9730         * elf32-s390.c (elf_s390_relocate_section): Likewise.
9731         * elf32-sh.c (sh_elf_relocate_section): Likewise.
9732         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
9733         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
9734         * elf64-s390.c (elf_s390_relocate_section): Likewise.
9735         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
9736         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
9737         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
9738         * elf64-alpha.c (elf64_alpha_relocate_section): Handle
9739         _bfd_elf_section_offset returning -2 the same way as -1.
9740         * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
9741         * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME
9742         and BFD_ASSERT.
9743         * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise.
9744
9745 2002-02-18  Tom Rix  <trix@redhat.com>
9746
9747         * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support.
9748         (bfd_xcoff_size_dynamic_sections): Same.
9749         * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same.
9750         (bfd_xcoff_size_dynamic_sections): Same.
9751         * coff-rs6000.c (xcoff_generate_rtinit): Same.
9752         * coff-rs646000.c (xcoff64_generate_rtinit): Same.
9753         * libxcoff.h (struct xcoff_backend_data_rec): Same.
9754         * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean.
9755         * bfd-in2.h: Regenerate.
9756
9757 2002-02-18  Alan Modra  <amodra@bigpond.net.au>
9758
9759         * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define.
9760         (struct ppc_link_hash_table): Add sfpr.
9761         (ppc64_elf_link_hash_table_create): Init it.
9762         (ppc64_elf_create_dynamic_sections): Split creation of .stub and
9763         .glink out to..
9764         (create_linkage_sections): ..here.  Make .sfpr too.
9765         (ppc64_elf_check_relocs): Call create_linkage_sections, and set
9766         dynobj early.
9767         (MIN_SAVE_FPR, MAX_SAVE_FPR): Define.
9768         (ppc64_elf_func_desc_adjust): Look for missing ._savef* and
9769         ._restf* functions, and create as needed.
9770         (func_desc_adjust): Only force_local for shared libs.
9771
9772 2002-02-18  David O'Brien  <obrien@FreeBSD.org>
9773
9774         * configure.in: Bump version number post 2.12 branching.
9775         * configure: Regenerate.
9776
9777 2002-02-17  Hans-Peter Nilsson  <hp@bitrange.com>
9778
9779         * mmo.c: Correct and improve comments.
9780         (mmo_write_chunk): Store trailing byte in bfd buffer; don't
9781         zero-pad.  Use input to fill up non-empty bfd buffer.
9782         (mmo_flush_chunk): New function.
9783         (mmo_write_loc_chunk): Add parameter last_vmap, all callers
9784         changed.  Don't emit location specifier if VMA is same as
9785         *LAST_VMAP after omitting leading zero contents.  Call
9786         mmo_flush_chunk before emitting location specifier.
9787         (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished
9788         with mmo_write_loc_chunk calls.
9789         (mmo_internal_write_section): Call mmo_flush_chunk after
9790         mmo_write_chunk.
9791         (mmo_write_symbols_and_terminator): Move :Main to first position
9792         in symbol array.  Add faked one if it does not exist if there are
9793         other symbols.  Don't add it if there are no symbols at all.  Move
9794         out test for value of :Main from symbol loop.  Rename table
9795         fakemain to maintable and variable mainsym to fakemain.
9796
9797 2002-02-15  Richard Henderson  <rth@redhat.com>
9798
9799         * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target
9800         section with no got matches any got.  Simplify error generaion.
9801
9802 2002-02-15  Alan Modra  <amodra@bigpond.net.au>
9803
9804         Support arbitrary length fill patterns.
9805         * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc.
9806         (_bfd_default_link_order): Remove bfd_fill_link_order code.
9807         Call default_data_link_order.
9808         (default_fill_link_order): Delete.
9809         (default_data_link_order): New function.
9810         * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences
9811         of bfd_fill_link_order with bfd_data_link_order.
9812         * elf64-alpha.c (elf64_alpha_final_link): Likewise.
9813         * elf64-mips.c (mips_elf64_final_link): Likewise.
9814
9815         * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value.
9816         Correct value returned in "end" for "0x<non-hex>".
9817
9818 2002-02-14  Nick Clifton  <nickc@cambridge.redhat.com>
9819
9820         * cpu-arm.c (processors): Replace 'arch' field with 'mach'.
9821         (scan): Test against 'mach' field in info structure.
9822
9823 2002-02-14  Alan Modra  <amodra@bigpond.net.au>
9824
9825         * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD.
9826
9827 2002-02-14  Matt Fredette  <fredette@netbsd.org>
9828
9829         * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize
9830         EF_M68000.
9831
9832 2002-02-13  Nick Clifton  <nickc@cambridge.redhat.com>
9833
9834         * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on
9835         non-zero physical addresses when adjusting the LMAs of new
9836         sections.
9837
9838 2002-02-12  John David Anglin  <dave@hiauly1.hia.nrc.ca>
9839
9840         * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped
9841         from _bfd_elf_hppa_gen_reloc_type.
9842         (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype.
9843         * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype.
9844         * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h.
9845         * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype.
9846
9847 2002-02-12  Alexandre Oliva  <aoliva@redhat.com>
9848
9849         * elf-m10300.c (mn10300_elf_relax_section): Skip section before
9850         loading its contents if there's nothing to do in it.
9851
9852 2002-02-12  Alan Modra  <amodra@bigpond.net.au>
9853
9854         * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
9855         64k boundary.
9856
9857         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic
9858         DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
9859         (ppc64_elf_finish_dynamic_sections): Set values for them.
9860
9861 2002-02-11  Michael Snyder  <msnyder@redhat.com>
9862
9863         * elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
9864         * elf.c (elfcore_grok_pstatus): Add prototype.
9865         (elfcore_grok_lwpstatus): Add prototype.
9866         (elfcore_write_lwpstatus): New function.
9867         (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
9868
9869 2002-02-11  Alexandre Oliva  <aoliva@redhat.com>
9870
9871         * elf32-sh.c: Added missing prototypes.
9872         * elf32-sh64.c: Likewise.
9873         (sh_elf_align_loads): Mark unused args as such.
9874         * elf64-sh64.c: Added missing prototypes.
9875         (struct elf_sh64_link_hash_entry): Fix typo.
9876         (sh_elf64_relocate_section): Fix info argument passed to
9877         _bfd_elf_section_offset.
9878
9879 2002-02-11  Alan Modra  <amodra@bigpond.net.au>
9880
9881         * Makefile.am: "make dep-am".
9882         * Makefile.in: Regenerate.
9883         * aclocal.m4: Regenerate.
9884         * config.in: Regenerate.
9885         * configure: Regenerate.
9886
9887 2002-02-10  Daniel Jacobowitz  <drow@mvista.com>
9888
9889         * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized
9890         variable warnings.
9891         * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned
9892         comparison warning.
9893         * trad-core.c (trad_unix_core_file_p): Silence pointer/integer
9894         cast warnings for the common case.
9895
9896 2002-02-10  Hans-Peter Nilsson  <hp@bitrange.com>
9897
9898         * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64
9899         vectors.
9900         (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64
9901         vectors.
9902
9903 2002-02-09  Richard Henderson  <rth@redhat.com>
9904
9905         * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP.
9906         (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise.
9907         (elf64_alpha_relocate_section): Likewise.
9908         * reloc.c (BFD_RELOC_ALPHA_BRSGP): New.
9909         * bfd-in2.h, libbfd.h: Rebuild.
9910
9911 2002-02-09  Hans-Peter Nilsson  <hp@bitrange.com>
9912
9913         * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check
9914         that base-plus-offset reloc accounting is consistent.
9915         (mmix_elf_relax_section): Keep base-plus-offset reloc accounting
9916         up to date for undefined symbols.
9917
9918 2002-02-08  Eric Christopher  <echristo@redhat.com>
9919
9920         From Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
9921
9922         * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
9923         sections for the O32 ABI.
9924
9925 2002-02-08  Chris Demetriou  <cgd@broadcom.com>
9926
9927         * elf32-arm.h: Fix formatting of _("...").
9928         * elf32-d10v.c: Likewise.
9929         * elf32-m68k.c: Likewise.
9930         * elf32-mips.c: Likewise.
9931
9932 2002-02-08  Ivan Guzvinec <ivang@opencores.org>
9933
9934         * coff-or32.c: Fix compile time warning messages.
9935
9936 2002-02-08  Alexandre Oliva  <aoliva@redhat.com>
9937
9938         Contribute sh64-elf.
9939         2002-01-23  Alexandre Oliva  <aoliva@redhat.com>
9940         * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16,
9941         R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16,
9942         R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16,
9943         R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16,
9944         R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16,
9945         R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16,
9946         R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16,
9947         R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8,
9948         R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64):
9949         New relocs.
9950         * libbfd.h, bfd-in2.h: Rebuilt.
9951         * elf32-sh.c (sh_elf_howto_table): Define new relocs.
9952         (sh_reloc_map): Map them.
9953         (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
9954         elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be,
9955         elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry,
9956         elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
9957         elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset,
9958         elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset,
9959         movi_shori_putval) [INCLUDE_SHMEDIA]: New.
9960         (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add
9961         datalabel_got_offset.
9962         (sh_elf_link_hash_newfunc): Initialize it.
9963         (sh_elf_relocate_section): Augment the scope of
9964         seen_stt_datalabel.  Introduce GOTPLT support.  Extend GOTPC, PLT,
9965         GOT and GOTOFF handling to new SHmedia relocation types.  Support
9966         GOT_BIAS.
9967         (sh_elf_check_relocs): Likewise.
9968         (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in
9969         PLT entries using movi_shori_putval.  Support GOT_BIAS.
9970         (sh_elf_finish_dynamic_sections): Likewise.
9971         * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to
9972         relocation, it's now done by the caller.
9973         (GOT_BIAS): New.
9974         * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt,
9975         elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset,
9976         elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset,
9977         elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER,
9978         elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry,
9979         elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse,
9980         sh64_elf64_hash_table): New.
9981         (sh_elf64_howto_table): Introduce new relocs.
9982         (sh_elf64_info_to_howto): Accept new PIC relocs.
9983         (sh_elf64_relocate_section): Augment the scope of
9984         seen_stt_datalabel.  Support new PIC relocs.
9985         (sh_elf64_check_relocs): Support new PIC relocs.
9986         (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le,
9987         elf_sh64_plt_entry_be, elf_sh64_plt_entry_le,
9988         elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le,
9989         elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry,
9990         sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create,
9991         movi_shori_putval, movi_3shori_putval,
9992         sh64_elf64_create_dynamic_sections,
9993         sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies,
9994         sh64_elf64_size_dynamic_sections,
9995         sh64_elf64_finish_dynamic_symbol,
9996         sh64_elf64_finish_dynamic_sections): New.
9997         (elf_backend_create_dynamic-sections,
9998         bfd_elf64_bfd_link_hash_table_create,
9999         elf_backend_adjust_dynamic_symbol,
10000         elf_backend_size_dynamic_sections,
10001         elf_backend_finish_dynamic_symbol,
10002         elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
10003         elf_backend_plt_readonly, elf_backend_want_plt_sym,
10004         elf_backend_got_header_size, elf_backend_plt_header_size):
10005         Define.
10006         2001-05-16  Alexandre Oliva  <aoliva@redhat.com>
10007         * elf32-sh.c: Renumbered and renamed some SH5 relocations to
10008         match official numbers and names; moved unmaching ones to the
10009         range 0xf2-0xff.
10010         * elf32-sh64.c, elf64-sh64.c: Likewise.
10011         2001-03-12  DJ Delorie  <dj@redhat.com>
10012         * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia
10013         sections.
10014         2001-03-12  DJ Delorie  <dj@redhat.com>
10015         * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must
10016         be aligned.
10017         * elf64-sh64.c (sh_elf64_relocate_section): Ditto.
10018         2001-01-14  Hans-Peter Nilsson  <hpn@cygnus.com>
10019         * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define.
10020         (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a
10021         .cranges section with SEC_SORT_ENTRIES set.
10022         (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an
10023         incoming sorted .cranges section.
10024         (sh64_bfd_elf_copy_private_section_data): New.
10025         (sh64_elf_final_write_processing): Only sort .cranges and modify
10026         start address if called by linker.
10027         2001-01-08  Ben Elliston  <bje@redhat.com>
10028         * elf32-sh64.c (sh64_elf_final_write_processing): Activate
10029         Hans-Peter Nilsson's set bit 0 patch from 2001-01-06.
10030         * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto.
10031         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
10032         * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of
10033         line.  Add comments before all entries.
10034         <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct and clarify describing
10035         comment.
10036         (sh_elf64_reloc): Correct head comment.
10037         (sh_elf64_relocate_section): Correct spacing.
10038         <relocating for a local symbol>: Do not honour STO_SH5_ISA32;
10039         instead call reloc_dangerous callback.
10040         <case R_SH_SHMEDIA_CODE>: New case.
10041         (sh_elf64_gc_mark_hook): Correct spacing.
10042         (sh_elf64_check_relocs): Ditto.
10043         * elf32-sh64.c (shmedia_prepare_reloc) <case R_SH_SHMEDIA_CODE>:
10044         New case.
10045         * elf32-sh.c: Correct #endif comments for #ifndef-wrapped
10046         functions.
10047         (sh_elf_howto_table) <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct,
10048         clarify describing comment.  Add comments before all entries.
10049         (sh_elf_relocate_section) <relocating for a local symbol>: Do not
10050         honour STO_SH5_ISA32; instead call reloc_dangerous callback.
10051         2001-01-06  Hans-Peter Nilsson  <hpn@cygnus.com>
10052         Sort .cranges section in final link.  Prepare to set bit 0 on
10053         entry address.
10054         * elf32-sh64.c (struct sh64_find_section_vma_data): New.
10055         (sh64_elf_link_output_symbol_hook): Fix typo in prototype.
10056         (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming
10057         .cranges section.
10058         (sh64_backend_section_from_shdr): New, to recognize
10059         SHT_SH5_CR_SORTED on incoming .cranges section.
10060         (elf_backend_section_from_shdr): Define.
10061         (sh64_elf_final_write_processing): Sort outgoing .cranges
10062         section.  (New, temporarily disabled:) Set bit 0 on entry address
10063         according to ISA type.
10064         (sh64_find_section_for_address): New.
10065         (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb,
10066         crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c.
10067         (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c.  Use
10068         bfd_malloc, not xmalloc.
10069         (sh64_get_contents_type): Move here from opcodes/sh64-dis.c.  Make
10070         global.
10071         * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but
10072         temporarily disabled) setting bit 0 on entry address.
10073         (elf_backend_final_write_processing): Define.
10074         2001-01-05  Hans-Peter Nilsson  <hpn@cygnus.com>
10075         * elf32-sh.c (sh_elf_howto_table) <R_SH_PT_16>: Adjust fields to
10076         be a proper relocation for PTA and PTB rather than a marker.
10077         <R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2,
10078         R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16,
10079         R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16,
10080         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL,
10081         R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL>:
10082         Zero src_mask.
10083         * elf64-sh64.c: Ditto.
10084         (sh_elf64_relocate_section) <case R_SH_PT_16>: New case.
10085         * elf32-sh64.c: Include opcodes/sh64-opc.h
10086         (shmedia_prepare_reloc): Take a bfd_link_info pointer as first
10087         argument.  Drop const qualifiers from "bfd *" and "bfd_byte *"
10088         parameters.  No unused parameters.  Caller changed.
10089         <case R_SH_PT_16>: New case.
10090         * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h.
10091         * Makefile.in: Regenerate.
10092         2000-12-30  Hans-Peter Nilsson  <hpn@cygnus.com>
10093         * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for
10094         all code sections.
10095         (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
10096         (sh64_elf_merge_private_data): Ditto.
10097         * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data
10098         to access stored section flags.
10099         (sh64_elf_final_write_processing): Return immediately unless
10100         called by linker.  Use sh64_elf_section_data (cranges) to get size
10101         of linker-generated cranges entries.
10102         (sh64_elf_copy_private_data): Add missing "return true".
10103         (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
10104         (sh_elf64_merge_private_data): Ditto.
10105         2000-12-19  Hans-Peter Nilsson  <hpn@cygnus.com>
10106         * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of
10107         elf64-sh64.c:sh64_elf_fake_sections.
10108         (elf_backend_fake_sections): Define as sh64_elf64_fake_sections.
10109         2000-12-18  Hans-Peter Nilsson  <hpn@cygnus.com>
10110         * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete.
10111         (sh64_elf_final_write_processing): New.
10112         (elf_backend_final_write_processing): Define.
10113         (sh64_elf_fake_sections): Get header flags from tdata field.
10114         (sh64_elf_copy_private_data): Do not call
10115         sh64_elf_copy_private_data_internal, just copy e_flags field.
10116         (sh64_elf_merge_private_data): Do not call
10117         sh64_elf_copy_private_data_internal.
10118         2000-12-12  Hans-Peter Nilsson  <hpn@cygnus.com>
10119         Remove EF_SH64_ABI64, let ELF size make difference.
10120         Remove SH64-specific BFD section flag.
10121         * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as
10122         containing SHmedia through elf_section_data (asect)->tdata
10123         non-zero, not using a BFD section flag.
10124         (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64.
10125         (sh64_elf_merge_private_data): Similar.
10126         (elf_backend_section_flags): Don't define.
10127         (sh64_elf_backend_section_flags): Delete.
10128         * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64,
10129         not EF_SH64_ABI64.
10130         (sh_elf64_merge_private_data): Similar.
10131         * section.c (Section flags definitions): Don't define
10132         SEC_SH_ISA_SHMEDIA.
10133         (bfd-in2.h): Regenerate.
10134         2000-12-09  Hans-Peter Nilsson  <hpn@cygnus.com>
10135         Make DataLabel references work with partial linking.
10136         * elf32-sh64.c: Fix formatting.
10137         (sh64_elf_link_output_symbol_hook): New.
10138         (elf_backend_link_output_symbol_hook): Define to
10139         sh64_elf_link_output_symbol_hook.
10140         (sh64_elf_add_symbol_hook): Make DataLabel symbol just global
10141         undefined if partial linking.  Adjust sanity check.
10142         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New.
10143         (elf_backend_link_output_symbol_hook): Define to
10144         sh64_elf64_link_output_symbol_hook.
10145         (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global
10146         undefined if partial linking.  Adjust sanity check.
10147         2000-12-07  Hans-Peter Nilsson  <hpn@cygnus.com>
10148         Implement semantics for inter-file DataLabel references.
10149         * elf64-sh64.c (DATALABEL_SUFFIX): Define.
10150         (sh64_elf64_add_symbol_hook): New.
10151         (sh_elf64_relocate_section): If passing an indirect symbol with
10152         st_type STT_DATALABEL on the way to a symbol with st_other
10153         STO_SH5_ISA32, do not bitor 1 to the relocation.
10154         (elf_backend_add_symbol_hook): Define to
10155         sh64_elf64_add_symbol_hook.
10156         * elf64-sh32.c: Tweak comments.
10157         (DATALABEL_SUFFIX): Define.
10158         (sh64_elf_add_symbol_hook): New.
10159         (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook.
10160         * elf32-sh.c (sh_elf_relocate_section): If passing an indirect
10161         symbol with st_type STT_DATALABEL on the way to a symbol with
10162         st_other STO_SH5_ISA32, do not bitor 1 to the relocation.
10163         2000-12-05  Hans-Peter Nilsson  <hpn@cygnus.com>
10164         Pass through STT_DATALABEL.
10165         * elf32-sh64.c (sh64_elf_get_symbol_type): New.
10166         (elf_backend_get_symbol_type): Define.
10167         * elf64-sh64.c (sh64_elf64_get_symbol_type): New.
10168         (elf_backend_get_symbol_type): Define.
10169         2000-11-30  Hans-Peter Nilsson  <hpn@cygnus.com>
10170         * elf32-sh64.c: Tweak comments.
10171         (sh64_elf_copy_private_data_internal): Add prototype.
10172         (bfd_elf32_bfd_set_private_flags): Define.
10173         (sh64_elf_copy_private_data_internal): Compare machine name, not
10174         textual BFD target name, to check whether to copy section flag
10175         SHF_SH5_ISA32.
10176         (sh64_elf_merge_private_data): Validize bfd_get_arch_size.
10177         Tweak section-contents-type-mismatch message.
10178         (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers.
10179         Validize reloc-types.
10180         * elf64-sh64.c: New file.
10181         * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare.
10182         * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo.
10183         (BFD64_BACKENDS_CFILES): Add elf64-sh64.c.
10184         Regenerate dependencies.
10185         * Makefile.in: Regenerate.
10186         * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and
10187         bfd_elf64_sh64l_vec.
10188         * configure.in: Handle bfd_elf64_sh64_vec and
10189         bfd_elf64_sh64l_vec.
10190         * configure: Regenerate.
10191         * po/POTFILES.in: Regenerate.
10192         * po/bfd.pot: Regenerate.
10193         2000-11-29  Hans-Peter Nilsson  <hpn@cygnus.com>
10194         * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize
10195         anything else but EF_SH64 and EF_SH64_ABI64.
10196         (sh64_elf_merge_private_data): Emit error for anything else but
10197         EF_SH64 and EF_SH64_ABI64.
10198         * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec
10199         from targ_selvecs.
10200         * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and
10201         bfd_elf32_sh64l_vec as a temporary measure.
10202         * configure: Regenerate.
10203         2000-11-27  Hans-Peter Nilsson  <hpn@cygnus.com>
10204         * cpu-sh.c (arch_info_struct): Include sh5 item
10205         unconditionalized.
10206         * config.bfd (sh64-*-elf*): Do not set targ_cflags.
10207         Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec,
10208         bfd_elf32_shblin_vec and bfd_elf32_shlin_vec.
10209         * elf32-sh64.c: Tweak comments.
10210         (sh64_elf_set_mach_from_flags): Recognize all machine flags that
10211         are proper subsets of SH64 as bfd_mach_sh5.  Add EF_SH64_ABI64.
10212         (sh64_elf_copy_private_data_internal): Wrap long line.
10213         (sh64_elf_merge_private_data): Rewrite to allow objects from
10214         SH64 subsets to be linked together.
10215         (INCLUDE_SHMEDIA): Define.
10216         * elf32-sh.c (sh_elf_relocate_section) <local symbol>:
10217         Parenthesize plus-expression inside or-expression.
10218         <global symbol>: Ditto.
10219         (sh_elf_set_mach_from_flags): Remove code refusing
10220         deleted EF_SH64_32BIT_ABI flag.
10221         2000-11-26  Hans-Peter Nilsson  <hpn@cygnus.com>
10222         * elf32-sh.c (sh_elf_howto_table) <R_SH_IMM_LOW16_PCREL,
10223         R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16_PCREL,
10224         R_SH_IMM_HI16_PCREL, R_SH_64_PCREL>: Set pcrel_offset to true.
10225         (sh_elf_relocate_section) <local symbol>: Or 1 in
10226         calculation of relocation if sym->st_other & STO_SH5_ISA32.
10227         <global symbol>: Ditto if h->other & STO_SH5_ISA32.
10228         * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to
10229         relocation.
10230         2000-11-24  Hans-Peter Nilsson  <hpn@cygnus.com>
10231         * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo.
10232         (BFD32_BACKENDS_CFILES): Add elf32-sh64.c.
10233         Regenerate dependencies.
10234         * Makefile.in: Regenerate.
10235         * archures.c: Add bfd_mach_sh5.
10236         * config.bfd: Map targ_cpu sh* to bfd_sh_arch.
10237         Handle sh64-*-elf*.  Set targ_cflags to -DINCLUDE_SHMEDIA.
10238         * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec.
10239         * configure: Regenerate.
10240         * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5,
10241         BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6,
10242         BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2,
10243         BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8,
10244         BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16,
10245         BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16,
10246         BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16,
10247         BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16,
10248         BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations.
10249         * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link
10250         in item for SH5.
10251         * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items
10252         for SHmedia relocs.
10253         [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs.
10254         [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call
10255         shmedia_prepare_reloc, goto final_link_relocate if it returns
10256         non-zero, else fail as before.
10257         (sh_elf_set_mach_from_flags): Provide function only if not defined
10258         as macro.  Do not recognize objects with EF_SH64_32BIT_ABI set.
10259         (sh_elf_set_private_flags): Provide function only if not defined
10260         as a macro.
10261         (sh_elf_copy_private_data): Similar.
10262         (sh_elf_merge_private_data): Similar.
10263         * section.c (SEC_SH_ISA_SHMEDIA): New.
10264         * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare.
10265         * elf32-sh64.c: New file.
10266         * libbfd.h: Regenerate.
10267         * bfd-in2.h: Regenerate.
10268         * po/POTFILES.in: Regenerate.
10269         * po/bfd.pot: Regenerate.
10270         * bfd-in2.h: Regenerate.
10271         * libbfd.h: Regenerate.
10272
10273 2002-02-07  Daniel Jacobowitz  <drow@mvista.com>
10274
10275         * bfd-in.h: Update <stdbool.h> check to only see if <stdbool.h> has
10276         been included, not drag it in.
10277         * bfd-in2.h: Regenerate.
10278
10279 2002-02-06  H.J. Lu  (hjl@gnu.org)
10280
10281         * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update
10282         the mach and ISA fields if necessary.
10283
10284 2002-02-06  Nick Clifton  <nickc@cambridge.redhat.com>
10285
10286         * coffcode.h (coff_set_arch_mach_hook): Select the highest known
10287         ARM architecture when an F_ARM_5 flag is detected, since we cannot
10288         be sure exactly which architecture this represents.
10289
10290 2002-02-05  Nick Clifton  <nickc@redhat.com>
10291
10292         * po/tr.po: Updated translation.
10293
10294 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
10295
10296         From Jimi X <jimix@watson.ibm.com>
10297         * archures (bfd_mach_ppc64): Define.
10298         (bfd_powerpc_arch): Rename to bfd_powerpc_archs.
10299         (bfd_powerpc_arch): Define.
10300         * bfd-in2.h: Regenerate.
10301         * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs.
10302         (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs.
10303         (bfd_powerpc_archs): Add default powerpc64 arch.
10304
10305 2002-02-05  Alan Modra  <amodra@bigpond.net.au>
10306
10307         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
10308         against section syms in readonly sections.  Don't do the global
10309         sym check if we find one.
10310         * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
10311         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
10312         * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
10313         * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
10314         (elf_s390_grok_prstatus): Add missing prototype.
10315
10316 2002-02-04  Hans-Peter Nilsson  <hp@bitrange.com>
10317
10318         * elf64-mmix.c (mmix_dump_bpo_gregs): New function.
10319         (mmix_elf_check_common_relocs) <case R_MMIX_BASE_PLUS_OFFSET>:
10320         Call bfd_get_section_by_name only once.  Initialize
10321         bpodata->n_bpo_relocs_this_section.
10322         (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment
10323         referring to DSOs.
10324         (bpo_reloc_request_sort_fn): Don't use difference of values as
10325         return-value.
10326
10327 2002-02-02  David O'Brien  <obrien@FreeBSD>
10328
10329         * configure.in: Tweak the FreeBSD 4.x recognition more.  Only treat
10330         version 4.5 and later the same as 5-CURRENT.
10331         * configure: Re-generate.
10332
10333 2002-02-02  Jason Thorpe  <thorpej@wasabisystems.com>
10334
10335         * config.bfd (hppa*-*-netbsd*): New target.
10336
10337 2002-01-31  Philipp Thomas  <pthomas@suse.de>
10338
10339         * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
10340         to front of message. Unify messages with elf32-arm.h. Use
10341         commas where neccessary.
10342         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
10343         ERROR in messages. Unify messages with coff-arm.c. Correct
10344         VFP/FPA error message.
10345         (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
10346         APCS-32 for translation.
10347
10348 2002-02-01  Hans-Peter Nilsson  <hp@bitrange.com>
10349
10350         Perform on-demand global register allocation from
10351         R_MMIX_BASE_PLUS_OFFSET relocs.
10352         * elf64-mmix.c (struct bpo_reloc_section_info, struct
10353         bpo_reloc_request, struct bpo_greg_section_info): New.
10354         (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook,
10355         bpo_reloc_request_sort_fn, mmix_elf_relax_section,
10356         _bfd_mmix_check_all_relocs,
10357         _bfd_mmix_prepare_linker_allocated_gregs,
10358         _bfd_mmix_finalize_linker_allocated_gregs): New functions.
10359         (elf_mmix_howto_table): Correct src_mask for most relocs.
10360         (mmix_elf_perform_relocation) <case R_MMIX_BASE_PLUS_OFFSET>: New
10361         case.
10362         (mmix_final_link_relocate) <case R_MMIX_BASE_PLUS_OFFSET>: New
10363         case.  Fix typo in comment.  New label do_mmix_reloc.
10364         (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to
10365         store first object file with a base-plus-offset reloc.  Call
10366         mmix_elf_check_common_relocs for the part common with mmo.
10367         (mmix_elf_final_link): Write out linker-allocated register
10368         contents section.
10369         (elf_backend_gc_sweep_hook): Define.
10370         (bfd_elf64_bfd_relax_section): Define.
10371
10372         * mmo.c: Don't include <ctype.h>
10373         (mmo_init): Correct init-once logic.
10374
10375 2002-02-01  Tom Rix  <trix@redhat.com>
10376
10377         * config.bfd: Conditionally support <aiaff> for pre AIX 4.3.
10378
10379 2002-02-01  Alan Modra  <amodra@bigpond.net.au>
10380
10381         * Makefile.am: Run "make dep-am"
10382         * Makefile.in: Regenerate.
10383
10384 2002-01-31  David O'Brien  <obrien@FreeBSD>
10385
10386         * configure.in: Recognize the differences in core files from FreeBSD
10387         4.{0,1} and later versions of 4.x.  This treats 4.2+ the same as
10388         5-CURRENT.
10389         * configure: Regenerate.
10390
10391 2002-01-31  Ivan Guzvinec  <ivang@opencores.org>
10392
10393         * coff-or32.c: New file.
10394         * cpu-or32.c: New file.
10395         * elf32-or32.c: New file.
10396         * archures.c: Add support for or32.
10397         * targets.c: Add support for or32.
10398         * bfd-in2.h: Regenerate.
10399         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
10400         coff_write_object_contents): Add support for or32.
10401         * config.bfd: Add target.
10402         * configure.in: Add support for or32.
10403         * configure: Regenerate.
10404         * Makefile.am: Add support for or32.
10405         * Makefile.in: Regenerate.
10406         * po/SRC-POTFILES.in: Add or32 files.
10407         * po/bfd.pot: Regenerate.
10408
10409 2002-01-31  Nick Clifton  <nickc@cambridge.redhat.com>
10410             Don Lindsay  <lindsayd@cisco.com>
10411
10412         * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return
10413         false' with a return of a bfd_reloc_ error code.
10414
10415 2002-01-31  Hans-Peter Nilsson  <hp@axis.com>
10416
10417         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
10418         unexport unreferenced symbols when --export-dynamic.  Call
10419         _bfd_elf_strtab_delref when unexporting.
10420
10421 2002-01-30  Daniel Jacobowitz  <drow@mvista.com>
10422
10423         * bfd-in.h: Include <stdbool.h> if it is available.
10424         * bfd-in2.h: Regenerated.
10425
10426 2002-01-31  Alan Modra  <amodra@bigpond.net.au>
10427
10428         * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should
10429         not go via the plt.
10430
10431 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
10432
10433         * archures.c: Tidy up formatting of embedded comments.
10434         * bfd.c: Tidy up formatting of embedded comments.
10435         * bfd-in.h: Fix formatting of comments.
10436         * reloc.c: Tidy up formatting of ordinary & embedded comments.
10437         * section.c: Tidy up formatting of embedded comments.
10438         * syms.c: Tidy up formatting of embedded comments.
10439         * targets.c: Tidy up formatting of embedded comments.
10440
10441         * bfd-in2.h: Regenerate.
10442
10443 2002-01-30  Nick Clifton  <nickc@cambridge.redhat.com>
10444
10445         * vms-tir.c (cmd_name): New function.
10446         (tir_cmd_name): New function.
10447         (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name().
10448         (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name().
10449         Fix formatting.
10450
10451         * peXXigen.c (pe_print_idata): Rearrange message to aid in
10452         translation.
10453         (pe_print_pdata): Rearrange message to aid in translation.
10454
10455         * libbfd.c (warn_deprecated): Rearrange error message to aid in
10456         translation.
10457
10458         * ihex.c (ihex_write_object_contents): Fix spelling typo.
10459
10460         * ieee.c (ieee_slurp_external_symbols): Remove spurious space.
10461
10462         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error
10463         message to aid in translation.
10464
10465         * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message
10466         to aid in translation.
10467
10468         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo.
10469
10470 2002-01-30  Philipp Thomas  <pthomas@suse.de>
10471
10472         * coff-arm.c, elf32-elf.h: Unify messages.
10473
10474 2002-01-30  Nick Clifton <nickc@redhat.com>
10475
10476         * po/sv.po: Updated translation.
10477
10478 2002-01-30  Philipp Thomas  <pthomas@suse.de>
10479
10480         * dwarf2.c (read_abbrev): Use full section name in error message.
10481         (decode_line_info): Likewise.
10482
10483         * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging
10484         message.
10485
10486 2002-01-30  Alan Modra  <amodra@bigpond.net.au>
10487
10488         * elf64-ppc.c (func_desc_adjust): Only provide missing function
10489         descriptor symbols for undefined function code syms.  Clear
10490         ELF_LINK_NON_ELF so that they can stay weak.
10491
10492 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
10493             Mitch Lichtenberg  <mpl@broadcom.com>
10494
10495         * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype.
10496         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function
10497         to handle 32-bit ELF embedded reloc (ld --embedded-relocs)
10498         generation.
10499         * bfd-in2.h: Regenerate.
10500
10501 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
10502
10503         * elf32-mips.c: Add additional comments about HI16 relocation
10504         processing.
10505         (_bfd_mips_elf_hi16_reloc): Don't subtract address here for
10506         pc-relative relocations.  (Reverts change made on 2001-10-31.)
10507         (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here
10508         for pc-relative relocations.
10509         (mips_elf_calculate_relocation): Add a comment about a kludge
10510         in the R_MIPS_GNU_REL_HI16 handling.
10511         (_bfd_mips_elf_relocate_section): Implement that kludge;
10512         adjust pc-relative HI16 relocation for difference in HI16 and
10513         LO16 addresses, since it can't easily be done in
10514         mips_elf_calculate_relocation.
10515
10516 2002-01-29  Martin Schwidefsky  <schwidefsky@de.ibm.com>
10517
10518         * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32
10519         relocations with PC32 relocations for undefined or weak symbols.
10520         * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise.
10521         * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise.
10522
10523 2002-01-28  Jason Thorpe  <thorpej@wasabisystems.com>
10524
10525         * elfcore.h (elf_core_file_p): Improve comment for last change.
10526
10527 2002-01-27  Daniel Jacobowitz  <drow@mvista.com>
10528
10529         * configure: Regenerated.
10530
10531 2002-01-27  Jason Thorpe  <thorpej@wasabisystems.com>
10532
10533         * elfcore.h (elf_core_file_p): Set the machine architecture
10534         before processing the program headers.
10535
10536 2002-01-26  Hans-Peter Nilsson  <hp@bitrange.com>
10537
10538         * configure.in <64-bit configuration>: If using gcc, check and
10539         emit error for egcs-1.1.2.
10540         * configure: Regenerate.
10541
10542 2002-01-26  Egor Duda  <deo@logos-m.ru>
10543
10544         * elf.c (elfcore_grok_win32pstatus): Copy only as much information
10545         as possible to avoid stack corruption.
10546
10547 2002-01-26  Richard Henderson  <rth@redhat.com>
10548
10549         * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext
10550         for non-allocated sections.
10551
10552 2002-01-25  Mark Kettenis  <kettenis@gnu.org>
10553
10554         * elf.c (elfcore_write_prstatus): Make sure we pass the address of
10555         prstat.pr_reg even if it is a struct.
10556
10557 2002-01-25  Steve Ellcey <sje@cup.hp.com>
10558
10559         * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX.
10560
10561 2002-01-25  Philipp Thomas  <pthomas@suse.de>
10562
10563         * coffgen.c (coff_print_symbol): Don't mark info message
10564         for translation.
10565
10566 2002-01-25  Nick Clifton <nickc@redhat.com>
10567
10568         * po/fr.po: Updated translation.
10569         * po/es.po: Updated translation.
10570
10571 2002-01-25  Philipp Thomas  <pthomas@suse.de>
10572
10573         * coff-alpha.c (alpha_relocate_section): Unify warning message
10574         for GP relative relocations without GP defined.
10575         * coff-mips.c (mips_relocate_section): Likewise.
10576
10577 2002-01-25  Alan Modra  <amodra@bigpond.net.au>
10578
10579         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid
10580         unsigned overflow when new_offset < old_offset.
10581
10582 2002-01-24  Philipp Thomas  <pthomas@suse.de>
10583
10584         * bfd.c (_bfd_abort): Fix typo.
10585
10586 2002-01-23  Richard Henderson  <rth@redhat.com>
10587
10588         * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress
10589         plt entries for undefweak symbols.
10590
10591 2002-01-23  Steve Ellcey <sje@cup.hp.com>
10592
10593         * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR.
10594         (bfd_elf64_ia64_hpux_big_vec): Ditto.
10595         (bfd_elf32_h8300_vec): Ditto.
10596
10597 2002-01-23  Alan Modra  <amodra@bigpond.net.au>
10598
10599         * elf64-ppc.c: Remove stale part of ABI comment.
10600         (NO_OPD_RELOCS): Define.
10601         (ppc64_elf_check_relocs): Use it.
10602         (ppc64_elf_relocate_section): Here too.
10603         (build_one_stub): Don't point function syms at the stub.  Instead,
10604         hijack plt.offset.
10605         (ppc64_elf_relocate_section): Check whether REL24 relocs should
10606         really go to the stub.  Make all dynamic relocs in opd against
10607         locals.
10608         (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of
10609         plt.offset.
10610
10611 2002-01-22  Richard Henderson  <rth@redhat.com>
10612
10613         * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp.
10614
10615 2002-01-22  Alan Modra  <amodra@bigpond.net.au>
10616
10617         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of
10618         TOC_BASE_OFF adjustment.
10619
10620         * Makefile.am: Run "make dep-am".
10621         * Makefile.in: Regenerate.
10622         * po/SRC-POTFILES.in: Regenerate.
10623
10624 2002-01-22  John David Anglin  <dave@hiauly1.hia.nrc.ca>
10625
10626         * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new
10627         host defines.
10628
10629 2002-01-21  Hans-Peter Nilsson  <hp@axis.com>
10630
10631         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
10632         Check for and emit error if sgot is NULL at this point.
10633
10634 2002-01-21  Jason Thorpe  <thorpej@wasabisystems.com>
10635
10636         * config.bfd (ia64*-*-netbsd*): New target.
10637
10638 2002-01-21  Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
10639
10640         * som.c (som_write_space_strings): Comment typo fix.
10641
10642 2002-01-21  Alan Modra  <amodra@bigpond.net.au>
10643
10644         * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and
10645         is_func_descriptor fields.
10646         (link_hash_newfunc): Init them.
10647         (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a
10648         dot are candidates for plt entries.  When processing .opd relocs,
10649         set function descriptor strings to point inside function code
10650         string, and set new ppc_link_hash_entry fields.
10651         (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs.
10652         (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with
10653         function descriptors.  It's now done in..
10654         (func_desc_adjust): New.
10655         (ppc64_elf_func_desc_adjust): New.
10656         (define elf_backend_always_size_sections): Define.
10657         (ppc64_elf_hide_symbol): New.
10658         (define elf_backend_hide_symbol): Define.
10659         (allocate_dynrelocs): Remove code looking up function descriptors
10660         as that has been done earlier.
10661         (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash
10662         table.
10663         (ppc64_elf_finish_dynamic_symbol): Likewise.  Remove code looking
10664         up function descriptor.
10665         (build_one_stub): Look up the function code sym.  Check for
10666         invalid plt offsets.
10667         (ppc64_elf_relocate_section): Tweak calls to undefined weak syms.
10668         Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs.
10669
10670         * elf-bfd.h (elf_backend_data <elf_backend_hide_symbol>): Add
10671         boolean param.
10672         (_bfd_elf_link_hash_hide_symbol): Likewise.
10673         * elflink.h (elf_link_add_object_symbols): Adjust call to
10674         elf_backend_hide_symbol.
10675         (elf_fix_symbol_flags): Likewise.
10676         (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather
10677         than bfd_alloc.
10678         * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param.
10679         Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref.
10680         * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
10681         (clobber_millicode_symbols): Adjust to suit new hide_symbol.
10682         * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param
10683         and adjust to suit.
10684         * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call
10685         _bfd_elf_link_hash_hide_symbol rather than duplicating code.
10686         * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
10687
10688 2002-01-18  Alan Modra  <amodra@bigpond.net.au>
10689
10690         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a
10691         dynamic function descriptor symbol, not the associated function
10692         symbol.
10693
10694 2002-01-17  Eric Christopher  <echristo@redhat.com>
10695
10696         * elf32-mips.c (mips_elf_calculate_relocation): Fix typo.
10697
10698 2002-01-17  Nick Clifton  <nickc@cambridge.redhat.com>
10699
10700         * po/bfd.pot: Regenerate.
10701         * po/fr.po: Regenerate.
10702
10703 2002-01-17  Alan Modra  <amodra@bigpond.net.au>
10704
10705         * elf-bfd.h (elf_backend_data <elf_backend_section_from_bfd_section>):
10706         Remove "Elf_Internal_Shdr *" param.
10707         (_bfd_mips_elf_section_from_bfd_section): Ditto.
10708         * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto.
10709         * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto.
10710         * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto.
10711         * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto.
10712         * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto.
10713         * elf.c (_bfd_elf_section_from_bfd_section): Allow backend
10714         function to override special sections.  Remove hdr arg from
10715         backend call, and don't loop.
10716
10717 2002-01-16  Eric Christopher  <echristo@redhat.com>
10718
10719         * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp
10720         on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of
10721         relocations requiring gp0 and gp.
10722
10723 2002-01-16  Richard Earnshaw  <rearnsha@arm.com>
10724
10725         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle
10726         EF_ARM_VFP_FLOAT.
10727         (elf32_arm_print_private_bfd_data): Likewise.
10728
10729 2002-01-16  Nick Clifton  <nickc@cambridge.redhat.com>
10730
10731         * po/tr.po: Import new version.
10732
10733 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10734
10735         * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs.
10736         (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc.
10737         (ORI_R0_R0_0): Correct.
10738
10739 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10740
10741         * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE
10742         when plt_not_loaded.
10743         * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to
10744         clear .plt SEC_CODE here.  Create .stub and correct .glink flags.
10745         (PLT_INITIAL_ENTRY_SIZE): Set to 24.
10746         (ppc64_elf_glink_code): Delete.
10747         (PPC64_ELF_GLINK_SIZE): Delete.
10748         (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11,
10749         BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0,
10750         ORI_R0_R0_0): Define.
10751         (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define.
10752         (struct ppc_link_hash_table): Add sstub and plt_overflow.
10753         (ppc64_elf_link_hash_table_create): Init them.
10754         (ppc64_elf_check_relocs <R_PPC64_REL24>): Refcount .plt entry.
10755         Don't copy to shared lib.
10756         (ppc64_elf_check_relocs): Call bfd_set_error on errors.
10757         (ppc64_elf_gc_sweep_hook <R_PPC64_REL24>): Sweep plt refcount.
10758         (allocate_dynrelocs <plt>): Don't change function sym here.  Make
10759         room for .stub and .glink code.
10760         (ppc64_elf_size_dynamic_sections): Handle .stub.  Make entry for
10761         DT_PPC64_GLINK.
10762         (ppc64_elf_final_link): Rename to ppc64_elf_set_toc.  Don't call
10763         bfd_elf64_bfd_final_link.
10764         (bfd_elf64_bfd_final_link): Don't define.
10765         (ppc64_elf_size_stubs): New.
10766         (build_plt_stub): New.
10767         (build_one_stub): New.
10768         (ppc64_elf_build_stubs): New.
10769         (ppc64_elf_relocate_section <toc relocs>): Remove assert.
10770         (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs.
10771         (ppc64_elf_finish_dynamic_symbol): Don't build stubs here.  Set
10772         DT_PPC64_GLINK entry.  Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in
10773         case output sections not separate.  Adjust DT_RELASZ to not
10774         include plt relocs.  Set reserved got entry.  Set got and plt
10775         entry size.
10776         (elf_backend_got_header_size): Set to 8.
10777         * elf64-ppc.h: New file.
10778
10779 2002-01-16  Alan Modra  <amodra@bigpond.net.au>
10780
10781         * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
10782         sections, use bfd_section_list_remove.
10783         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
10784         * elflink.h (elf_link_add_object_symbols): When removing all
10785         sections, use bfd_section_list_clear.
10786
10787 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
10788
10789         * po/sv.po: New file: Swedish translation.
10790         * configure.in (ALL_LINGUAS): Add sv.
10791         * configure: Regenerate.
10792
10793 2002-01-15  Jakub Jelinek  <jakub@redhat.com>
10794
10795         * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change.
10796         * elf.c (merge_sections_remove_hook): New function.
10797         (_bfd_elf_merge_sections): Pass it as 3rd argument to
10798         _bfd_merge_sections.
10799         * libbfd-in.h (_bfd_merge_sections): Add 3rd argument.
10800         * libbfd.h: Rebuilt.
10801         * merge.c (_bfd_merge_sections): Add remove_hook argument.
10802         Call remove_hook if a SEC_EXCLUDE section is encountered.
10803
10804 2002-01-15  Nick Clifton  <nickc@cambridge.redhat.com>
10805
10806         * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'.
10807         (xstormy16_reloc_map): Initialise new field with correct howto
10808         table.
10809         (xstormy16_reloc_type_lookup): Use 'table' field to locate correct
10810         howto entry.
10811
10812 2002-01-10  Michael Snyder  <msnyder@redhat.com>
10813
10814         * elf.c (elfcore_write_prstatus): Use long instead of pid_t;
10815         (elfcore_write_pstatus): Use long instead of pid_t;
10816         * elf-bfd.h: Change prototypes to use long instead of pid_t;
10817
10818 2002-01-09  Jason Thorpe  <thorpej@wasabisystems.com>
10819
10820         * elf.c: Update copyright years.
10821         (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO
10822         and NT_NETBSDCORE_FIRSTMACH.  Improve a comment.
10823
10824 2002-01-08  Michael Snyder  <msnyder@redhat.com>
10825
10826         Add capability to write corefile note sections, for gdb.
10827         * elf.c (elfcore_write_note): New function.
10828         (elfcore_write_prpsinfo): New function.
10829         (elfcore_write_prstatus): New function.
10830         (elfcore_write_pstatus): New function.
10831         (elfcore_write_prfpreg): New function.
10832         (elfcore_write_prxfpreg): New function.
10833         * elf-bfd.h: Add prototypes for above functions.
10834
10835 2002-01-08  Alexandre Oliva  <aoliva@redhat.com>
10836
10837         * elf.c (elf_fake_sections): Propagate errors from
10838         elf_backend_fake_section.
10839
10840 2002-01-07  Jason Thorpe  <thorpej@wasabisystems.com>
10841
10842         * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo.
10843         (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c.
10844         (elf32-sh-nbsd.lo): New rule.
10845         * Makefile.in: Regenerate.
10846         * config.bfd (sh*le-*-netbsdelf*): New target.
10847         (sh*-*-netbsdelf*): New target.
10848         * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*.
10849         (bfd_elf32_shnbsd_vec): New vector.
10850         (bfd_elf32_shlnbsd_vec): New vector.
10851         * configure: Regenerate.
10852         * elf32-sh-nbsd.c: New file.
10853         * targets.c: Update copyright years.
10854         (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and
10855         bfd_elf32_shnbsd_vec.
10856
10857 2002-01-07  Aldy Hernandez  <aldyh@redhat.com>
10858
10859         * coff-rs6000.c (READ20): Use bfd_scan_vma.
10860
10861 2002-01-07  Geoffrey Keating  <geoffk@redhat.com>
10862
10863         * elflink.h (elf_link_input_bfd): Don't ask for the merged offset
10864         of a symbol in a section that will be deleted.
10865
10866 2002-01-07  Nick Clifton  <nickc@cambridge.redhat.com>
10867
10868         * po/es.po: New file: Spanish translation.
10869         * configure.in (ALL_LINGUAS): Add es.
10870         * configure: Regenerate.
10871
10872 2002-01-06  Steve Ellcey  <sje@cup.hp.com>
10873
10874         * elfxx-ia64.c (is_unwind_section_name): Add target vector as
10875         argument so we can handle HP-UX specially.
10876         (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name.
10877         (elfNN_hpux_backend_section_from_bfd_section): New for support
10878         of SHN_IA_64_ANSI_COMMON.
10879         (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON.
10880         (is_unwind_section_name): Add special HP-UX support.
10881         (elfNN_ia64_section_from_shdr): Add support for more sections.
10882         (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and
10883         add support for more sections.
10884         (elfNN_ia64_additional_program_headers): Modify
10885         is_unwind_section_name call.
10886         (elfNN_ia64_modify_segment_map): Remove assumption that there is
10887         only one unwind section in segment.
10888
10889 2002-01-06  Alan Modra  <amodra@bigpond.net.au>
10890
10891         * syms.c (_bfd_generic_make_empty_symbol): New function.
10892         * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
10893         _bfd_generic_make_empty_symbol.
10894         * libbfd.h: Regenerate.
10895         * bfd-in2.h: Regenerate.
10896         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
10897         (hppabsd_core_get_symtab_upper_bound): Don't define.
10898         (hppabsd_core_get_symtab): Likewise.
10899         (hppabsd_core_print_symbol): Likewise.
10900         (hppabsd_core_get_symbol_info): Likewise.
10901         (hppabsd_core_bfd_is_local_label_name): Likewise.
10902         (hppabsd_core_get_lineno): Likewise.
10903         (hppabsd_core_find_nearest_line): Likewise.
10904         (hppabsd_core_bfd_make_debug_symbol): Likewise.
10905         (hppabsd_core_read_minisymbols): Likewise.
10906         (hppabsd_core_minisymbol_to_symbol): Likewise.
10907         (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
10908         Formatting fixes.
10909         * hpux-core.c: Similarly.
10910         * irix-core.c: Similarly.
10911         * osf-core.c: Similarly.
10912         * sco5-core.c: Similarly.
10913         * binary.c (binary_make_empty_symbol): Remove function, define as
10914         _bfd_generic_make_empty_symbol.
10915         * ihex.c (ihex_make_empty_symbol): Likewise.
10916         * mmo.c (mmo_make_empty_symbol): Likewise.
10917         * ppcboot.c (ppcboot_make_empty_symbol): Likewise.
10918         * srec.c (srec_make_empty_symbol): Likewise.
10919         * versados.c (versados_make_empty_symbol): Likewise.
10920         * vms.c (_bfd_vms_make_empty_symbol): Remove.
10921         (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
10922         * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
10923         rather than _bfd_vms_make_empty_symbol.
10924         * vms-misc.c (new_symbol): Likewise.
10925
10926 2002-01-05  Alan Modra  <amodra@bigpond.net.au>
10927
10928         * section.c (bfd_section_init): Remove unnecessary initialisations.
10929         (bfd_section_list_clear): New function.
10930         (bfd_section_list_remove, bfd_section_list_insert): New macros.
10931         (_bfd_strip_section_from_output): Use them.
10932         * coffcode.h (coff_set_alignment_hook): Likewise.
10933         * elf32-mips.c (_bfd_mips_elf_final_link): Likewise.
10934         * elf64-mips.c (mips_elf64_final_link): Likewise.
10935         * elf64-mmix.c (mmix_elf_final_link): Likewise.
10936         * sunos.c (sunos_add_dynamic_symbols): Likewise.
10937         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
10938         * bfd-in2.h: Regenerate.
10939
10940         * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway
10941         rather than doing our own section handling.  Clean up after errors
10942         with bfd_release and bfd_section_list_clear.  Handle unexpected
10943         flags.
10944         * aoutf1.h (sunos4_core_file_p): Likewise.
10945         * aix386-core.c (aix386_core_file_p): Likewise.
10946         * cisco-core.c (cisco_core_file_validate): Likewise.
10947         * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
10948         * trad-core.c (trad_unix_core_file_p): Likewise.
10949
10950         * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors
10951         with bfd_release and bfd_section_list_clear.
10952         * hpux-core.c (hpux_core_core_file_p): Likewise.
10953         * irix-core.c (irix_core_core_file_p): Likewise.
10954         * lynx-core.c (lynx_core_file_p): Likewise.
10955         * osf-core.c (osf_core_core_file_p): Likewise.
10956         * rs6000-core.c (rs6000coff_core_p): Likewise.
10957         * sco5-core.c (sco5_core_file_p): Likewise.
10958
10959         * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform
10960         sign extension adjustments without conditionals.
10961
10962 2002-01-04  Jakub Jelinek  <jakub@redhat.com>
10963
10964         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if
10965         CIE at .eh_frame start is removed due to no FDEs referencing it.
10966
10967 2002-01-04  Jason Thorpe  <thorpej@wasabisystems.com>
10968
10969         * config.bfd (x86_64-*-netbsd*): New target.
10970         * configure.in (x86_64-*-netbsd*): Set COREFILE
10971         to netbsd-core.lo.
10972         * configure: Regenerated.
10973
10974 2002-01-03  Tom Rix  <trix@redhat.com>
10975
10976         * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering
10977         for recent bfd_make_section_anyway change.
10978
10979 2002-01-03  Nick Clifton  <nickc@cambridge.redhat.com>
10980
10981         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
10982         R_ARM_THM_PC11 reloc.
10983
10984 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
10985
10986         * configure.in (LINGUAS): Add ja.
10987         * configure: Regenerate.
10988         * po/ja.po: Import from translation project's web site.
10989
10990 2002-01-02  Nick Clifton  <nickc@cambridge.redhat.com>
10991
10992         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error
10993         messages to ease translation into other languages.
10994
10995 For older changes see ChangeLog-0001
10996 \f
10997 Local Variables:
10998 mode: change-log
10999 left-margin: 8
11000 fill-column: 74
11001 version-control: never
11002 End: