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