OSDN Git Service

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