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