feb815ffe9dd78493b0ce01e7f4bdc6b91c923e6
[external/binutils.git] / bfd / ChangeLog
1 2005-05-17  Tavis Ormandy <taviso@gentoo.org>
2
3         * elf.c (bfd_section_from_shdr): Add sanity check when parsing
4         dynamic sections.
5
6 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
7
8         * elf32-ppc.c (LIS_11. LIS_12): Define.
9         (LWZU_0_X_12, LWZ_0_X_12, LWZ_12_4_12, LWZ_12_X_12): Define.
10         (ppc_elf_finish_dynamic_sections): Provide non-pic plt call stub
11         for --data-plt when building non-pie executables.
12
13 2005-05-17  Nick Clifton  <nickc@redhat.com>
14
15         * elf32-arm.c (elf32_arm_final_link_relocate): Gracefully handle
16         the situation where a symbols's section is not known but a section
17         relative R_ARM_RELATIVE reloc has to be generated for the Symbian
18         OS.
19
20         * elf32-v850.c (v850_elf_relocate_section): Move code to test for
21         the presence of a symbol table to just before the symbol table is
22         actually used.
23
24 2005-05-16  H.J. Lu  <hongjiu.lu@intel.com>
25
26         PR 834
27         * elfxx-ia64.c (elfNN_ia64_relax_br): New.
28         (elfNN_ia64_relax_section): Use it.
29
30 2005-05-14  Mark Kettenis  <kettenis@gnu.org>
31
32         * elflink.c (bfd_elf_size_dynamic_sections): Use lbasename instead
33         of basename.
34
35 2005-05-14  Alan Modra  <amodra@bigpond.net.au>
36
37         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set DT_PPC_GOT,
38         not DT_PPC_GLINK.
39         (ppc_elf_finish_dynamic_sections): Likewise.
40
41 2005-05-13  Fred Fish  <fnf@specifixinc.com>
42
43         * libbfd-in.h: Fix a comment typo, 'neaderst' -> 'nearest'
44         * libbfd.h: Rebuilt.
45
46 2005-05-13  Bob Wilson  <bob.wilson@acm.org>
47
48         * elf32-xtensa.c (xtensa_get_property_section_name): Add missing
49         periods in linkonce_kind values.
50
51 2005-05-12  H.J. Lu  <hongjiu.lu@intel.com>
52
53         * elf32-i386.c (elf_i386_relocate_section): Allow R_386_GOTOFF
54         against protected function when building executable.
55
56 2005-05-12  Alan Modra  <amodra@bigpond.net.au>
57
58         * elf32-ppc.c (LWZU_0_X_11): Delete.
59         (B, LWZ_11_X_11, LWZ_11_X_30, MTCTR_11): Define.
60         (ppc_elf_select_plt_layout): Set .got flags too.  Formatting.
61         (ppc_elf_size_dynamic_sections): Allocate space for .glink branch
62         table.
63         (ppc_elf_finish_dynamic_symbol): Point .plt entries into the branch
64         table.
65         (ppc_elf_finish_dynamic_sections): Adjust DT_PPC_GLINK value.
66         Generate .glink branch table and updated stubs.
67
68 2005-05-11  Alan Modra  <amodra@bigpond.net.au>
69
70         * reloc.c (BFD_RELOC_HI16_PCREL): Define.
71         (BFD_RELOC_HI16_S_PCREL, BFD_RELOC_LO16_PCREL): Define.
72         * elf32-ppc.c (GLINK_PLTRESOLVE, GLINK_ENTRY_SIZE): Define.
73         (CROR_151515, CROR_313131): Delete.
74         (ADDIS_11_11, ADDI_11_11, SUB_11_11_30, ADD_0_11_11, ADD_11_0_11,
75         LWZ_0_4_30, MTCTR_0, LWZ_12_8_30, BCTR, ADDIS_11_30,
76         LWZU_0_X_11): Define.
77         (ppc_elf_howto_raw): Add R_PPC_REL16, R_PPC_REL16_LO, R_PPC_REL16_HI
78         and R_PPC_REL16_HA entries.
79         (ppc_elf_reloc_type_lookup): Convert new bfd reloc types.
80         (ppc_elf_addr16_ha_reloc): Also handle R_PPC_REL16_HA.
81         (struct ppc_elf_link_hash_table): Add glink, glink_pltresolve,
82         new_plt, and old_plt.
83         (ppc_elf_create_dynamic_sections): Create .glink section.
84         (ppc_elf_check_relocs): Set new_plt and old_plt.
85         (ppc_elf_select_plt_layout): New function.
86         (ppc_elf_tls_setup): Set plt output section elf type and flags.
87         (allocate_got): Handle differences between old and new got layout.
88         (allocate_dynrelocs): Likewise for plt.
89         (ppc_elf_size_dynamic_sections): Likewise.  Allocate memory for
90         .glink.  Don't allocate memory for old bss .plt.  Emit DT_PPC_GLINK.
91         (ppc_elf_relax_section): Rename ppc_info to htab.  Handle .glink
92         destination of R_PPC_PLTREL24 relocs.
93         (ppc_elf_relocate_section): Handle new relocs and changed destination
94         of R_PPC_PLTREL24.
95         (ppc_elf_finish_dynamic_symbol): Init new style plt and handle
96         differences in layout.
97         (ppc_elf_finish_dynamic_sections): Set DT_PPC_GLINK value.  Don't
98         put a blrl in new got.  Write glink contents.
99         * elf32-ppc.h (ppc_elf_select_plt_layout): Declare.
100         * libbfd.h: Regenerate.
101         * bfd-in2.h: Regenerate.
102
103 2005-05-11  Andreas Schwab  <schwab@suse.de>
104
105         * elf32-i386.c (elf_i386_finish_dynamic_sections): Fix signedness
106         warning.
107
108 2005-05-10  H.J. Lu  <hongjiu.lu@intel.com>
109
110         * elf.c (_bfd_elf_make_section_from_shdr): Only check debug
111         section if SEC_ALLOC isn't set.
112
113 2005-05-09  Kelley Cook  <kcook@gcc.gnu.org>
114
115         * configure.in: Replace AC_COMPILE_CHECK_SIZEOF with AC_CHECK_SIZEOF.
116         * acinclude.m4: Don't sinclude accross.m4.
117         * config.in, configure, Makefile.in, doc/Makefile.in: Regenerate.
118
119 2005-05-09  Alan Modra  <amodra@bigpond.net.au>
120
121         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add has_dotsym.
122         (ppc64_elf_add_symbol_hook): Set has_dotsym.
123         (ppc64_elf_check_directives): Only process syms when has_dotsym.
124         (func_desc_adjust): Hide fake function descriptors when function
125         code entry is defined.
126         (adjust_opd_syms): Adjust for deleted_section becoming union field.
127
128 2005-05-09  Alan Modra  <amodra@bigpond.net.au>
129
130         * elfcode.h (elf_object_p): Add more sanity checks on elf header.
131
132 2005-05-08  Dave Korn   <dave.korn@artimi.com>
133
134         * coff-tic80.c:  Undefine _CONST after system headers to prevent
135         clash with tic80-specific definition in include/coff/tic80.h
136
137 2005-05-08  H.J. Lu  <hongjiu.lu@intel.com>
138
139         PR 939
140         * elflink.c (elf_link_output_extsym): Use output_bfd if
141         h->root.u.def.section is bfd_abs_section_ptr when reporting
142         error.
143
144 2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>
145
146         * elf-bfd.h (elf_backend_data): Update special_sections to
147         array of pointer to bfd_elf_special_section.
148         * elf.c (special_sections): Likewise.
149         * elf32-arm.c (elf32_arm_symbian_special_sections): Likewise.
150         * elf32-m32r.c (m32r_elf_special_sections): Likewise.
151         * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise.
152         * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise.
153         * elf32-mcore.c (mcore_elf_special_sections): Likewise.
154         * elf32-ppc.c (ppc_elf_special_sections): Likewise.
155         * elf32-sh64.c (sh64_elf_special_sections): Likewise.
156         * elf32-v850.c (v850_elf_special_sections): Likewise.
157         * elf32-xtensa.c (elf_xtensa_special_sections): Likewise.
158         * elf64-alpha.c (elf64_alpha_special_sections): Likewise.
159         * elf64-hppa.c (elf64_hppa_special_sections): Likewise.
160         * elf64-ppc.c (ppc64_elf_special_sections): Likewise.
161         * elf64-sh64.c (sh64_elf64_special_sections): Likewise.
162         * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise.
163         * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise.
164         * elfxx-mips.h (_bfd_mips_elf_special_sections): Likewise.
165
166         * elf.c (get_special_section): Updated.
167
168 2005-05-07  Alan Modra  <amodra@bigpond.net.au>
169
170         * elf-bfd.h (struct elf_backend_data): Remove got_symbol_offset.
171         * elfxx-target.h (elf_backend_got_symbol_offset): Delete.
172         * elflink.c (_bfd_elf_create_got_section): Use zero in place of
173         got_symbol_offset.
174         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
175         * elf32-frv.c (_frv_create_got_section): Likewise.
176         * elf32-i370.c (i370_elf_finish_dynamic_sections): Delete ppc code.
177         (elf_backend_got_symbol_offset): Don't define.
178         * elf64-ppc.c (elf_backend_got_symbol_offset): Don't define.
179         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add got_header_size
180         and got_gap.
181         (ppc_elf_create_got): Tidy.
182         (ppc_elf_create_dynamic_sections): Don't set SEC_IN_MEMORY for .plt.
183         (ppc_elf_check_relocs): Reduce string comparisons by using elf.hgot.
184         (ppc_elf_gc_sweep_hook): Likewise.
185         (ppc_elf_relocate_section): Likewise.
186         (ppc_elf_finish_dynamic_symbol): Likewise.
187         (allocate_got): New function.
188         (allocate_dynrelocs): Use allocate_got.
189         (ppc_elf_size_dynamic_sections): Likewise.  Delay tlsld_got allocation
190         so that local got can refcount it.  Set got_header_size.
191         (ppc_elf_relocate_section): Use value of elf.hgot rather than hard-
192         coded 4.
193         (ppc_elf_finish_dynamic_sections): Likewise.
194         (elf_backend_got_symbol_offset): Don't define.
195         (elf_backend_got_header_size): Ditto.
196
197 2005-05-05  Steve Ellcey  <sje@cup.hp.com>
198
199         * configure.in (ACX_HEADER_STRING): New.
200         * configure: Regenerate.
201         * config.in: Regenerate.
202         * sysdep.h (STRING_WITH_STRINGS): Use.
203
204 2005-05-05  H.J. Lu  <hongjiu.lu@intel.com>
205
206         * elf.c (_bfd_elf_close_and_cleanup): Only call
207         _bfd_dwarf2_cleanup_debug_info on bfd_object.
208
209 2005-05-05  H.J. Lu  <hongjiu.lu@intel.com>
210
211         * elflink.c (_bfd_elf_provide_section_bound_symbols): Use
212         "__bss_start" instead of "_edata" as fallback.
213
214 2005-05-05  H.J. Lu  <hongjiu.lu@intel.com>
215
216         * bfd-in2.h: Regenerated.
217
218 2005-05-05  Paul Brook  <paul@codesourcery.com>
219
220         * config.bfd: Use bfd_elf32_i386_vxworks_vec for i?86-*-vxworks.
221         * configure.in: Add bfd_elf32_i386_vxworks_vec. i386 targets need
222         elf-vxworks.lo.
223         * configure: Regenerate.
224         * Makefile.am (BFD32_BACKENDS): Add elf-vxworks.lo.
225         (BFD32_BACKENDS_CFILES): Add elf-vxworks.c.
226         (elf32-i386.lo): Depend on elf-vxworks.h.
227         (elf-vxworks.lo): New rule.
228         * Makefile.in: Regenerate.
229         * elf-bfd.h (elf_backend_data): Update type of
230         elf_backend_emit_relocs.
231         (_bfd_elf_link_output_relocs): Update prototype.
232         * elflink.c (_bfd_elf_link_output_relocs): Always use
233         bed->elf_backend_emit_relocs when outputting relocations.
234         * elfxx-target.h (elf_backend_emit_relocs): Default to
235         _bfd_elf_link_output_relocs.
236         * targets.c (bfd_elf32_i386_vxworks_vec): Declare.
237         (_bfd_target_vector): Add bfd_elf32_i386_vxworks_vec.
238         * elf32-i386.c: Add elf32-i386-vxworks target BFD.
239         (elf_i386_plt0_entry): Remove padding.
240         (elf_i386_pic_plt0_entry): Ditto.
241         (PLTRESOLVE_RELOCS_SHLIB, PLTRESOLVE_RELOCS): Define.
242         (PLT_NON_JUMP_SLOT_RELOCS): Define.
243         (elf_i386_link_hash_table): Add srelplt2, hgot, hplt, is_vxworks and
244         plt0_pad_byte fields.
245         (elf_i386_link_hash_table_create): Zero them.
246         (elf_i386_create_dynamic_sections): Create static relocation section.
247         (allocate_dynrelocs): Allocate space for static PLT relocations.
248         (elf_i386_size_dynamic_sections): Save shortcuts to PLT and GOT
249         symbols.  Give PLT symbols function type.  Don't strip PLT sections
250         if we have exported symbols from them.
251         (elf_i386_finish_dynamic_symbol): Fill in VxWorks PLT static
252         relocation section.  Don't mark _GLOBAL_OFFSET_TABLE_ as absolute on
253         VxWorks.
254         (elf_i386_finish_dynamic_sections): Allow different pad bytes.
255         Add relocation for GOT location.  Fill in PLT static relocations.
256         (elf_i386_vxworks_link_hash_table_create): New function.
257         (elf_i386_vxworks_link_output_symbol_hook): New function.
258         * elf-vxworks.h: New file.
259
260 2005-05-05  H.J. Lu  <hongjiu.lu@intel.com>
261
262         * section.c (bfd_make_section_anyway_with_flags): New.
263         (bfd_make_section_anyway): Call bfd_make_section_anyway_with_flags,
264         (bfd_make_section_with_flags): New.
265         (bfd_make_section): Call bfd_make_section_with_flags.
266
267         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Call
268         bfd_make_section_with_flags/bfd_make_section_anyway_with_flags
269         instead of bfd_make_section/bfd_make_section and don't call
270         bfd_set_section_flags.
271         (mn10300_elf_check_relocs): Likewise.
272         (_bfd_mn10300_elf_create_dynamic_sections): Likewise.
273         * elf32-arm.c (create_got_section): Likewise.
274         (bfd_elf32_arm_add_glue_sections_to_bfd): Likewise.
275         (elf32_arm_check_relocs): Likewise.
276         * elf32-cris.c (cris_elf_check_relocs): Likewise.
277         * elf32-frv.c (elf32_frv_add_symbol_hook): Likewise.
278         (_frv_create_got_section): Likewise.
279         (elf32_frvfdpic_create_dynamic_sections): Likewise.
280         * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise.
281         (elf32_hppa_check_relocs): Likewise.
282         * elf32-i370.c (i370_elf_create_dynamic_sections): Likewise.
283         (i370_elf_check_relocs): Likewise.
284         * elf32-i386.c (create_got_section): Likewise.
285         (elf_i386_check_relocs): Likewise.
286         * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
287         (create_got_section): Likewise.
288         (m32r_elf_create_dynamic_sections): Likewise.
289         (m32r_elf_check_relocs): Likewise.
290         * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
291         * elf32-ppc.c (ppc_elf_create_got): Likewise.
292         (ppc_elf_create_dynamic_sections): Likewise.
293         (ppc_elf_add_symbol_hook): Likewise.
294         (ppc_elf_check_relocs): Likewise.
295         * elf32-s390.c (create_got_section): Likewise.
296         (elf_s390_check_relocs): Likewise.
297         * elf32-sh.c (create_got_section): Likewise.
298         (sh_elf_create_dynamic_sections): Likewise.
299         (sh_elf_check_relocs): Likewise.
300         * elf32-vax.c (elf_vax_check_relocs): Likewise.
301         * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
302         * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise.
303         (add_extra_plt_sections): Likewise.
304         * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
305         (elf64_alpha_create_got_section): Likewise.
306         (elf64_alpha_create_dynamic_sections): Likewise.
307         (elf64_alpha_check_relocs): Likewise.
308         * elf64-hppa.c (get_reloc_section): Likewise.
309         (get_opd): Likewise.
310         (get_plt): Likewise.
311         (get_dlt): Likewise.
312         (get_stub): Likewise.
313         (elf64_hppa_create_dynamic_sectionso): Likewise.
314         * elf64-mmix.c (mmix_elf_check_common_relocs): Likewise.
315         * elf64-ppc.c (create_linkage_sections): Likewise.
316         (ppc64_elf_check_relocs): Likewise.
317         * elf64-s390.c (create_got_section): Likewise.
318         (elf_s390_check_relocs): Likewise.
319         * elf64-sh64.c (sh_elf64_check_relocs): Likewise.
320         (sh64_elf64_create_dynamic_sections): Likewise.
321         * elf64-x86-64.c (create_got_section): Likewise.
322         (elf64_x86_64_check_relocs): Likewise.
323         * elflink.c (_bfd_elf_create_got_section): Likewise.
324         (_bfd_elf_link_create_dynamic_sections): Likewise.
325         (elf_link_add_object_symbols): Likewise.
326         * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
327         (elfNN_ia64_create_dynamic_sections): Likewise.
328         (get_fptr): Likewise.
329         (get_pltoff): Likewise.
330         (get_reloc_section): Likewise.
331         (elfNN_ia64_object_p): Likewise.
332         * elfxx-mips.c (mips_elf_rel_dyn_section): Likewise.
333         (mips_elf_create_compact_rel_section): Likewise.
334         (mips_elf_create_got_section): Likewise.
335         (_bfd_mips_elf_create_dynamic_sections): Likewise.
336         * elfxx-sparc.c (create_got_section): Likewise.
337         (_bfd_sparc_elf_check_relocs): Likewise.
338
339         * elf.c (_bfd_elf_new_section_hook): Call _bfd_elf_get_sec_type_attr
340         on linker created sections.
341
342 2005-05-05  H.J. Lu  <hongjiu.lu@intel.com>
343
344         PR 882
345         * elflink.c (_bfd_elf_link_assign_sym_version): Allow version
346         script on executable.
347
348 2005-05-05  John Levon  <levon@movementarian.org>
349
350         * dwarf2.c (read_abbrevs): If bfd_realloc fails, free currently
351         allocated memory before returning.
352         (decode_line_info): Likewise.
353         (_bfd_dwarf2_cleanup_debug_info): New function:  Frees memory
354         allocated by functions in this file.
355         * elf-bfd.h (_bfd_dwarf2_cleanup_debug_info): Prototype.
356         * elf.c (_bfd_elf_close_and_cleanup): Call
357         _bfd_dwarf2_cleanup_debug_info.
358
359 2005-05-05  Hans-Peter Nilsson  <hp@axis.com>
360
361         * Makefile.am (INCLUDES): Don't -D_GNU_SOURCE here.
362         * configure.in: Call AC_GNU_SOURCE here, after AC_PROG_CC.
363         * configure, config.in, Makefile.in: Regenerate.
364         * sysdep.h (stpcpy): Revert last change.
365
366 2005-05-05  Hans-Peter Nilsson  <hp@axis.com>
367
368         * sysdep.h (stpcpy): Wrap declaration in parentheses.
369
370 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
371
372         * elfxx-ia64.c (ARCH_SIZE): New.
373         (LOG_SECTION_ALIGN): Likewise.
374         (elfNN_ia64_create_dynamic_sections): Use LOG_SECTION_ALIGN to
375         align relocation sections.
376         (get_fptr): Likewise.
377         (get_reloc_section): Likewise.
378         (elfNN_ia64_tprel_base): Likewise.
379         (elfNN_ia64_check_relocs): Support 32bit relocations.
380         (allocate_global_fptr_got): Likewise.
381         (allocate_dynrel_entries): Likewise.
382         (set_got_entry): Likewise.
383         (set_pltoff_entry): Likewise.
384         (elfNN_ia64_relocate_section): Likewise.
385
386 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
387
388         * configure.in: Add AC_CHECK_DECLS(stpcpy).
389         * configure: Regenerate.
390         * config.in: Likewise.
391
392         * sysdep.h (stpcpy): New.
393
394 2005-05-04  Nick Clifton  <nickc@redhat.com>
395
396         * Update the address and phone number of the FSF organization in
397         the GPL notices in the following files:
398         aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c,
399         aout-cris.c, aout-ns32k.c, aout-sparcle.c, aout-target.h,
400         aout-tic30.c, aout0.c, aout32.c, aout64.c, aoutf1.h, aoutx.h,
401         archive.c, archive64.c, archures.c, armnetbsd.c, bfd-in.h,
402         bfd-in2.h, bfd.c, bfdio.c, bfdwin.c, binary.c, bout.c, cache.c,
403         cf-i386lynx.c, cf-m68klynx.c, cf-sparclynx.c, cisco-core.c,
404         coff-a29k.c, coff-alpha.c, coff-apollo.c, coff-arm.c, coff-aux.c,
405         coff-go32.c, coff-h8300.c, coff-h8500.c, coff-i386.c, coff-i860.c,
406         coff-i960.c, coff-ia64.c, coff-m68k.c, coff-m88k.c, coff-maxq.c,
407         coff-mcore.c, coff-mips.c, coff-or32.c, coff-pmac.c, coff-ppc.c,
408         coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c,
409         coff-svm68k.c, coff-tic30.c, coff-tic4x.c, coff-tic54x.c,
410         coff-tic80.c, coff-u68k.c, coff-w65.c, coff-we32k.c, coff-z8k.c,
411         coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c, coffswap.h,
412         corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c,
413         cpu-avr.c, cpu-cr16c.c, cpu-cris.c, cpu-crx.c, cpu-d10v.c,
414         cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c, cpu-h8300.c,
415         cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c, cpu-i860.c,
416         cpu-i960.c, cpu-ia64-opc.c, cpu-ia64.c, cpu-ip2k.c, cpu-iq2000.c,
417         cpu-m10200.c, cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c,
418         cpu-m68hc12.c, cpu-m68k.c, cpu-m88k.c, cpu-maxq.c, cpu-mcore.c,
419         cpu-mips.c, cpu-mmix.c, cpu-msp430.c, cpu-ns32k.c, cpu-openrisc.c,
420         cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c, cpu-rs6000.c,
421         cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c, cpu-tic4x.c,
422         cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c, cpu-w65.c,
423         cpu-we32k.c, cpu-xstormy16.c, cpu-xtensa.c, cpu-z8k.c, demo64.c,
424         dwarf1.c, dwarf2.c, ecoff.c, ecofflink.c, ecoffswap.h,
425         efi-app-ia32.c, efi-app-ia64.c, elf-bfd.h, elf-eh-frame.c,
426         elf-hppa.h, elf-m10200.c, elf-m10300.c, elf-strtab.c, elf.c,
427         elf32-am33lin.c, elf32-arc.c, elf32-arm.c, elf32-avr.c,
428         elf32-cr16c.c, elf32-cris.c, elf32-crx.c, elf32-d10v.c,
429         elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c,
430         elf32-h8300.c, elf32-hppa.c, elf32-hppa.h, elf32-i370.c,
431         elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
432         elf32-iq2000.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c,
433         elf32-m68hc1x.c, elf32-m68hc1x.h, elf32-m68k.c, elf32-m88k.c,
434         elf32-mcore.c, elf32-mips.c, elf32-msp430.c, elf32-openrisc.c,
435         elf32-or32.c, elf32-pj.c, elf32-ppc.c, elf32-ppc.h, elf32-s390.c,
436         elf32-sh-symbian.c, elf32-sh.c, elf32-sh64-com.c, elf32-sh64.c,
437         elf32-sh64.h, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
438         elf32-xstormy16.c, elf32-xtensa.c, elf32.c, elf64-alpha.c,
439         elf64-gen.c, elf64-hppa.c, elf64-hppa.h, elf64-mips.c,
440         elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
441         elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elf64.c, elfcode.h,
442         elfcore.h, elflink.c, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c,
443         elfxx-mips.h, elfxx-sparc.c, elfxx-sparc.h, elfxx-target.h,
444         epoc-pe-arm.c, epoc-pei-arm.c, format.c, freebsd.h, gen-aout.c,
445         genlink.h, hash.c, host-aout.c, hp300bsd.c, hp300hpux.c,
446         hppabsd-core.c, hpux-core.c, i386aout.c, i386bsd.c, i386dynix.c,
447         i386freebsd.c, i386linux.c, i386lynx.c, i386mach3.c, i386msdos.c,
448         i386netbsd.c, i386os9k.c, ieee.c, ihex.c, init.c, irix-core.c,
449         libaout.h, libbfd-in.h, libbfd.c, libbfd.h, libcoff-in.h,
450         libcoff.h, libecoff.h, libhppa.h, libieee.h, libnlm.h, liboasys.h,
451         libpei.h, libxcoff.h, linker.c, lynx-core.c, m68k4knetbsd.c,
452         m68klinux.c, m68klynx.c, m68knetbsd.c, m88kmach3.c, m88kopenbsd.c,
453         mach-o-target.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c, mmo.c,
454         netbsd-core.c, netbsd.h, newsos3.c, nlm-target.h, nlm.c,
455         nlm32-alpha.c, nlm32-i386.c, nlm32-ppc.c, nlm32-sparc.c, nlm32.c,
456         nlm64.c, nlmcode.h, nlmswap.h, ns32k.h, ns32knetbsd.c, oasys.c,
457         opncls.c, osf-core.c, pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c,
458         pe-mcore.c, pe-mips.c, pe-ppc.c, pe-sh.c, peXXigen.c,
459         pef-traceback.h, pef.c, pef.h, pei-arm.c, pei-i386.c, pei-mcore.c,
460         pei-mips.c, pei-ppc.c, pei-sh.c, peicode.h, ppcboot.c,
461         ptrace-core.c, reloc.c, reloc16.c, riscix.c, rs6000-core.c,
462         sco5-core.c, section.c, simple.c, som.c, som.h, sparclinux.c,
463         sparclynx.c, sparcnetbsd.c, srec.c, stab-syms.c, stabs.c, sunos.c,
464         syms.c, sysdep.h, targets.c, tekhex.c, ticoff.h, trad-core.c,
465         vax1knetbsd.c, vaxbsd.c, vaxnetbsd.c, versados.c, vms-gsd.c,
466         vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h, xcoff-target.h,
467         xcofflink.c, xsym.c, xsym.h, xtensa-isa.c, xtensa-modules.c,
468         hosts/alphavms.h
469
470 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
471
472         * bfd-in.h (_bfd_elf_provide_section_bound_symbols): New.
473         * bfd-in2.h: Regenerated.
474
475         * elflink.c (bfd_elf_set_symbol): New.
476         (_bfd_elf_provide_symbol): Call it.
477         (_bfd_elf_provide_section_bound_symbols): New.
478
479 2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>
480
481         * elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
482         at the end, if a strong definition has already been seen.
483
484 2005-05-04  Alan Modra  <amodra@bigpond.net.au>
485
486         * section.c (struct bfd_section): Replace link_order_head and
487         link_order_tail with map_head and map_tail union.
488         (STD_SECTION): Update.
489         (_bfd_strip_section_from_output): Delete.
490         * aoutx.h: Update throughout for above changes.
491         * coff-ppc.c: Likewise.
492         * cofflink.c: Likewise.
493         * ecoff.c: Likewise.
494         * elf-eh-frame.c: Likewise.
495         * elf-m10300.c: Likewise.
496         * elf.c: Likewise.
497         * elf32-arm.c: Likewise.
498         * elf32-cris.c: Likewise.
499         * elf32-hppa.c: Likewise.
500         * elf32-i386.c: Likewise.
501         * elf32-m32r.c: Likewise.
502         * elf32-m68hc1x.c: Likewise.
503         * elf32-m68k.c: Likewise.
504         * elf32-ppc.c: Likewise.
505         * elf32-s390.c: Likewise.
506         * elf32-sh.c: Likewise.
507         * elf32-vax.c: Likewise.
508         * elf32-xtensa.c: Likewise.
509         * elf64-alpha.c: Likewise.
510         * elf64-hppa.c: Likewise.
511         * elf64-ppc.c: Likewise.
512         * elf64-s390.c: Likewise.
513         * elf64-sh64.c: Likewise.
514         * elf64-x86-64.c: Likewise.
515         * elflink.c: Likewise.
516         * elfxx-ia64.c: Likewise.
517         * elfxx-mips.c: Likewise.
518         * elfxx-sparc.c: Likewise.
519         * linker.c: Likewise.
520         * merge.c: Likewise.
521         * pdp11.c: Likewise.
522         * xcofflink.c: Likewise.
523         * elflink.c (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Split
524         out from bfd_elf_size_dynamic_sections.
525         * bfd-in.h (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Declare.
526         * bfd-in2.h: Regenerate.
527
528 2005-05-04  Alan Modra  <amodra@bigpond.net.au>
529
530         * section.c (bfd_section_list_remove): Don't clear s->next.
531         (bfd_section_list_append): Always init s->prev.
532         (bfd_section_list_prepend): Define.
533         (bfd_section_list_insert_after): Minor optimization.
534         (bfd_section_removed_from_list): Rewrite.
535         * elf.c (assign_section_numbers): Simplify list traversal now that
536         bfd_section_list_remove doesn't destroy removed section next ptr.
537         * sunos.c (sunos_add_dynamic_symbols): Likewise.
538         * elfxx-ia64.c (elfNN_ia64_object_p): Use bfd_section_list_prepend.
539         * xcofflink.c (_bfd_xcoff_bfd_final_link): Simplify list traversal.
540         * bfd-in2.h: Regenerate.
541
542 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
543
544         * bfd.c (bfd): Remove section_tail and add section_last.
545         (bfd_preserve): Likewise.
546         (bfd_preserve_save): Likewise.
547         (bfd_preserve_restore): Likewise.
548         * opncls.c (_bfd_new_bfd): Likewise.
549
550         * coffcode.h (coff_compute_section_file_positions): Updated.
551         (coff_compute_section_file_positions): Likewise.
552         * elf.c (assign_section_numbers): Likewise.
553         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
554         * elf64-mmix.c (mmix_elf_final_link): Likewise.
555         * elfxx-ia64.c (elfNN_ia64_object_p): Likewise.
556         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
557         * sunos.c (sunos_add_dynamic_symbols): Likewise.
558         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
559
560         * ecoff.c (bfd_debug_section): Initialize prev.
561
562         * section.c (bfd_section): Add prev.
563         (bfd_section_list_remove): Updated.
564         (bfd_section_list_append): New.
565         (bfd_section_list_insert_after): New.
566         (bfd_section_list_insert_before): New.
567         (bfd_section_list_insert): Removed.
568         (bfd_section_removed_from_list): Updated.
569         (STD_SECTION): Initialize prev.
570         (bfd_section_init): Updated.
571         (bfd_section_list_clear): Updated.
572
573         * bfd-in2.h: Regenerated.
574
575 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
576
577         * elf.c (_bfd_elf_new_section_hook): Don't call
578         _bfd_elf_get_sec_type_attr on sections from input files.
579
580 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
581
582         * merge.c (sec_merge_init): Call bfd_hash_table_init_n with
583         hash table size 16699 instead of bfd_hash_table_init.
584
585 2005-05-01  Paul Brook  <paul@codesourcery.com>
586
587         * elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a strong
588         definition has already been seen.
589
590 2005-05-01  Paul Brook  <paul@codesourcery.com>
591
592         * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Treat
593         R_ARM_PLT32 the same as R_ARM_PC24.
594         (arm_add_to_rel): Ditto.
595
596 2005-04-29  Ralf Corsepius <ralf.corsepius@rtems.org>
597
598         * config.bfd: Add h8300*-*-rtemscoff.
599         Switch h8300*-*-rtems* to elf.
600
601 2005-04-29  Daniel Jacobowitz  <dan@codesourcery.com>
602
603         * aclocal.m4, Makefile.in: Regnerated.
604
605 2005-04-28  Paul Brook  <paul@codesourcery.com>
606
607         Merge changes only applied to Makefile.in.
608         * Makefile.am (BFD32_BACKENDS): Add elfxx-sparc.lo
609         (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
610         (elfxx-sparc.lo): New rule.
611         (elf32-sparc.lo): Add elfxx-sparc.h dependency.
612         (elf64-sparc.lo): Likewise.
613
614 2005-04-28  Julian Brown  <julian@codesourcery.com>
615
616         * elflink.c (_bfd_elf_provide_symbol): Provide symbol for weak
617         import.
618
619 2005-04-27  H.J. Lu  <hongjiu.lu@intel.com>
620
621         * elf-bfd.h (bfd_elf_sym_name): Also take "asection *".
622
623         * elf.c (bfd_elf_sym_name): Updated.
624         (group_signature): Likewise.
625         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
626         * elf64-ppc.c (ppc64_elf_edit_opd): Likewise.
627         (ppc64_elf_edit_toc): Likewise.
628         (ppc64_elf_relocate_section): Likewise.
629         * elfcode.h (elf_slurp_symbol_table): Likewise.
630         * elflink.c (elf_link_input_bfd): Likewise.
631
632         * elfxx-ia64.c (elfNN_ia64_relocate_section): Call
633         bfd_elf_sym_name to get local symbol name when reporting errors.
634
635 2005-04-27  Nick Clifton  <nickc@redhat.com>
636
637         * elflink.c (elf_link_input_bfd): Handle the case where a badly
638         formatted input file results in a reloc which has no associated
639         global symbol.
640
641 2005-04-26  Jerome Guitton  <guitton@gnat.com>
642
643         * bfd.m4 (BFD_NEED_DECLARATION): Restore.
644
645 2005-04-25  David S. Miller  <davem@davemloft.net>
646
647         * elfxx-sparc.c (sparc_elf_append_rela_64): Add BFD64 protection.
648         (sparc_elf_r_info_64, _bfd_sparc_elf_finish_dynamic_symbol,
649         sparc64_finish_dyn, _bfd_sparc_elf_finish_dynamic_sections):
650         Likewise.
651
652 2005-04-25  H.J. Lu  <hongjiu.lu@intel.com>
653
654         PR 858
655         * elflink.c (elf_link_input_bfd): Make non-debugging reference
656         to discarded section an error.
657
658 2005-04-21  Jerome Guitton  <guitton@gnat.com>
659
660         * configure.in: Replace BFD_NEED_DECLARATION checks by the
661         corresponding AC_CHECK_DECLS.
662         * sysdep.h: Replace NEED_DECLARATION_* checks by the corresponding
663         HAVE_DECL_*.
664         * bfd.m4 (BFD_NEED_DECLARATION): Remove, obsolete.
665         * configure: Regenerate.
666         * config.in: Ditto.
667
668 2005-04-21  Andreas Schwab  <schwab@suse.de>
669
670         * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove
671         unsigned from type of dynamic_interpreter.
672         * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create): Remove
673         casts again.
674
675         * elf.c (assign_section_numbers): Fix comment.
676
677 2005-04-21  Jerome Guitton  <guitton@gnat.com>
678
679         * som.c (som_bfd_print_private_bfd_data): Add explicit cast to long
680         for struct som_exec_auxhdr fields.
681
682 2005-04-21  Nick Clifton  <nickc@redhat.com>
683
684         * aout-adobe.c: Convert to ISO C and fix formatting.
685         * aout-arm.c: Convert to ISO C and fix formatting.
686         * aout-cris.c: Convert to ISO C and fix formatting.
687         * aout-ns32k.c: Convert to ISO C and fix formatting.
688         * aout-tic30.c: Convert to ISO C and fix formatting.
689         * coffcode.h: Convert to ISO C and fix formatting.
690         * coffswap.h: Convert to ISO C and fix formatting.
691         * i386aout.c: Convert to ISO C and fix formatting.
692         * libaout.h: Convert to ISO C and fix formatting.
693         * libcoff-in.h: Convert to ISO C and fix formatting.
694         * libcoff.h: Convert to ISO C and fix formatting.
695         * libecoff.h: Convert to ISO C and fix formatting.
696         * libnlm.h: Convert to ISO C and fix formatting.
697         * libpei.h: Convert to ISO C and fix formatting.
698         * libxcoff.h: Convert to ISO C and fix formatting.
699         * nlm-target.h: Convert to ISO C and fix formatting.
700         * nlm.c: Convert to ISO C and fix formatting.
701         * nlm32-alpha.c: Convert to ISO C and fix formatting.
702         * nlm32-i386.c: Convert to ISO C and fix formatting.
703         * nlm32-ppc.c: Convert to ISO C and fix formatting.
704         * nlm32-sparc.c: Convert to ISO C and fix formatting.
705         * nlmcode.h: Convert to ISO C and fix formatting.
706         * nlmswap.h: Convert to ISO C and fix formatting.
707         * pe-mips.c: Convert to ISO C and fix formatting.
708         * peXXigen.c: Convert to ISO C and fix formatting.
709         * peicode.h: Convert to ISO C and fix formatting.
710         * vms-gsd.c: Convert to ISO C and fix formatting.
711         * vms-hdr.c: Convert to ISO C and fix formatting.
712         * vms-misc.c: Convert to ISO C and fix formatting.
713         * vms-tir.c: Convert to ISO C and fix formatting.
714         * vms.c: Convert to ISO C and fix formatting.
715         * vms.h: Convert to ISO C and fix formatting.
716
717         * coffgen.c (coff_print_symbol): Restore correct formatting of
718         output.
719
720 2005-04-20  David S. Miller  <davem@davemloft.net>
721
722         * elfxx-sparc.c (sparc_elf_r_symndx_64): Fix compiler warning.
723         (_bfd_sparc_elf_link_hash_table_create): Likewise.
724         (allocate_dynrelocs): Likewise.
725
726 2005-04-20  Jerome Guitton  <guitton@gnat.com>
727
728         * configure.in: Fix the check for basename declaration. Add check
729         for declarations of ftello, ftello64, fseeko, fseeko64.
730         * configure: Regenerate.
731         * config.in: Ditto.
732         * sysdep.h: If needed, declare ftello, ftello64, fseeko, fseeko64.
733
734 2005-04-19  David S. Miller  <davem@davemloft.net>
735
736         * elfxx-sparc.c: New file.
737         * elfxx-sparc.h: New file.
738         * Makefile.in (BFD32_BACKENDS): Add elfxx-sparc.lo
739         (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
740         (elfxx-sparc.lo): New rule.
741         (elf32-sparc.lo): Add elfxx-sparc.h dependency.
742         (elf64-sparc.lo): Likewise.
743         * configure.in (bfd_elf32_sparc_vec): Add elfxx-sparc.lo
744         (bfd_elf64_sparc_vec): Likewise.
745         * configure: Regenerate.
746         * elf32-sparc.c: Remove common code now in elfxx-sparc.c
747         * elf64-sparc.c: Likewise, also use elf64_sparc_*() naming
748         which is more consistent with elf32-sparc.c
749
750 2005-04-19  Daniel Jacobowitz  <dan@codesourcery.com>
751
752         * elfxx-mips.c (struct mips_elf_link_hash_entry): Update comment.
753         (mips_elf_create_local_got_entry): Check h->root.forced_local.
754
755 2005-04-19  Alan Modra  <amodra@bigpond.net.au>
756
757         * elf32-ppc.c (ppc_elf_check_relocs): Don't bother with
758         dynamic relocs in non-SEC_ALLOC sections.
759         (ppc_elf_gc_sweep_hook): Likewise.
760         (ppc_elf_relax_section): Likewise.
761         (ppc_elf_relocate_section): Likewise.
762
763 2005-04-18  Nick Clifton  <nickc@redhat.com>
764
765         * aix5ppc-core.c (xcoff64_core_p): Fix compile time warning
766         assigning a value to return_value.
767
768 2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>
769
770         PR 855
771         * elf.c (_bfd_elf_copy_private_section_data): Don't copy linker
772         created group data.
773
774 2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>
775
776         PR 855
777         * elf.c (setup_group): Properly handle zero group count.
778
779 2005-04-17  Mark Kettenis  <kettenis@gnu.org>
780
781         * som.c (hppa_som_reloc, som_mkobject, som_is_space)
782         (som_is_subspace, compare_subspaces, som_compute_checksum)
783         (som_build_and_write_symbol_table, som_slurp_symbol_table): New
784         protoypes.
785         (hppa_som_reloc, compare_syms, compare_subspaces)
786         (som_print_symbol, som_get_section_contents)
787         (som_set_section_contents): Remove space after 'void *'.
788         (som_bfd_print_private_bfd_data): Use %lx to print longs.
789         (som_bfd_merge_private_bfd_data)
790         (som_bfd_copy_private_header_data, som_bfd_set_private_flags): New
791         defines.
792
793 2004-04-15  Julian Brown  <julian@codesourcery.com>
794
795         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
796         * bfd-in2.h: Regenerate.
797         * elf32-arm.c (elf32_arm_link_hash_table): New field, 'use_blx'.
798         (elf32_arm_link_hash_table_create): Initialise fix_v4bx, use_blx.
799         (bfd_elf32_arm_set_target_relocs): Handle use_blx.
800         (elf32_arm_final_link_relocate): Use Thumb BLX for R_ARM_THM_PC22
801         relocations if requested to.
802         (allocate_dynrelocs): Don't count size of omitted Thumb stubs based on
803         use_blx rather than symbian_p.
804         (elf32_arm_finish_dynamic_symbol): Don't output Thumb PLT stubs if
805         use_blx is in effect.
806         (elf32_arm_symbian_link_hash_table_create): Enable use_blx by default
807         for SymbianOS.
808
809 2005-04-15  Nick Clifton  <nickc@redhat.com>
810
811         * coffgen.c (coff_print_symbol): Use fprintf_vma to print vma
812         values.
813
814 2005-04-15  Alan Modra  <amodra@bigpond.net.au>
815
816         PR ld/815
817         * elflink.c (elf_smash_syms): Clear undef.next if it's not being
818         used as a list pointer.
819
820 2005-04-14  Alan Modra  <amodra@bigpond.net.au>
821
822         * Makefile.am (NO_WERROR): Define.
823         * warning.m4: New file
824         * acinclude.m4: Include warning.m4.
825         * configure.in: Invoke AM_BINUTILS_WARNINGS.
826         * Makefile.in: Regenerate.
827         * configure: Regenerate.
828
829 2005-04-14  Alan Modra  <amodra@bigpond.net.au>
830
831         * merge.c (sec_merge_emit): Tidy.  Check for bfd_zmalloc errors.
832         Write trailing padding.
833
834         * merge.c (merge_strings): Round up section size for alignment.
835
836 2005-04-14  David S. Miller  <davem@davemloft.net>
837
838         Add TLS support for 64-bit Sparc ELF.
839         *  elf64-sparc.c (sparc64_elf_dyn_relocs,
840         sparc64_elf_link_hash_entry, sparc64_elf_obj_tdata): New structs.
841         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLD_GD, GOT_TLD_IE,
842         sparc64_elf_hash_entry, sparc64_elf_tdata,
843         sparc64_elf_local_got_tls_type): New defines.
844         (sparc64_elf_mkobject): New function.
845         (sparc64_elf_link_hash_table): Add members for dynamic linker
846         sections PLT, RELPLT, DYNBSS, and RELBSS.  Add tls_ldm_got
847         uion to track TLS GOT references.  Add sym_sec to cache
848         mappings from local sym to section.
849         (link_hash_newfunc): New function.
850         (sparc64_elf_bfd_link_hash_table_create): Rename to
851         sparc64_elf_link_hash_table_create for consistency.
852         Pass link_hash_newfunc to _bfd_elf_link_hash_table_init.
853         (sparc64_elf_create_dynamic_sections): Initialize new section
854         members of sparc64_elf_link_hash_table.  Only init srelbss
855         if not-shared.
856         (sparc64_elf_copy_indirect_symbol, sparc64_elf_tls_transition):
857         New functions.
858         (SPARC_NOP): Define.
859         (sparc64_elf_build_plt, sparc64_elf_plt_entry_offset,
860         sparc64_elf_plt_ptr_offset): Delete.
861         (sparc64_plt_entry_build): New function to build PLT entries
862         gradually instread of all at once at the end of linking.
863         (sparc64_elf_check_relocs): Delete dynobj, sgot, and srelgot
864         local vars.  Get them from sparc64_elf_hash_table instead.
865         Check early on if r_symndx is in bounds.  Handle TLS transitions.
866         Account for TLS GOT references and DF_STATIC_TLS, as needed.
867         For TLS relocs, record the tls_type in either
868         sparc64_elf_local_got_tls_type or sparc64_elf_hash_entry as
869         appropriate.  For R_SPARC_TLS_{GD,LDM}_CALL, emit a reference
870         to the __tls_get_addr symbol.  For PLT relocs, track references
871         via h->plt.refcount.  When R_SPARC_{PC10,PC22,PC_HH22,PC_HM10,
872         PC_LM22} and h not-NULL, set h->non_got_ref.  For global data
873         symbol references, count the number of relocations needed for
874         that symbol.  For default switch case, don't error, this lets
875         the TLS relocs not explicitly handled by this function get
876         accepted.
877         (sparc64_elf_gc_mark_hook, sparc64_gc_sweep_hook): New functions.
878         (sparc64_elf_adjust_dynamic_symbol): Remove dynobj local var, get
879         it from sparc64_elf_hash_table.  Store the real PLT offset
880         in h->plt.offset, and build PLT entries one at a time.  Also
881         get .dynbss section pointer from htab.
882         (allocate_dynrelocs, readonly_dynrelocs,
883         sparc64_omit_section_dynsym): New functions.
884         (sparc64_elf_omit_section_dynsym): Use these new functions as
885         helpers.
886         (dtpoff_base, tpoff): New functions.
887         (sparc64_elf_relocate_section): Kill dynobj, sgot, and splt
888         locals, get them from sparc64_elf_hash_table.  Handle TLS
889         relocations and refcounting in main relocation loop.
890         (sparc64_elf_finish_dynamic_symbol): Use
891         sparc64_elf_link_hash_table.  Build PLT entries as we see
892         them.  Handle TLS GOT relocations.
893         (sparc64_elf_finish_dynamic_sections): Get sgot and dynobj
894         from sparc64_elf_hash_table.  Initialize only PLT header
895         not all entries since we not build PLT entries one by one.
896         (elf_backend_copy_indirect_symbol, bfd_elf64_mkobject,
897         elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook,
898         elf_backend_can_gc_sections, elf_backend_can_refcount): Define.
899
900 2005-04-13  Daniel Jacobowitz  <dan@codesourcery.com>
901
902         * elflink.c (elf_link_input_bfd): Update check for removed
903         sections.
904
905 2005-04-12  Alan Modra  <amodra@bigpond.net.au>
906
907         * Makefile.am: Run "make dep-am".
908         * Makefile.in: Regenerate.
909         * aclocal.m4: Regenerate.
910         * libcoff.h: Regenerate.
911
912 2005-04-11  H.J. Lu  <hongjiu.lu@intel.com>
913
914         * linker.c (_bfd_generic_link_output_symbols): Also check if
915         the output section of an input section has been removed from
916         the output file.
917
918         * section.c (bfd_section_list_remove): Clear the next field
919         of the removed section.
920         (bfd_section_removed_from_list): New.
921         * bfd-in2.h: Regenerated.
922
923 2005-04-11  David S. Miller  <davem@davemloft.net>
924
925         * elf32-sparc.c (elf32_sparc_relocate_section,
926         R_SPARC_TLS_LDO_{HIX22,LOX10}): When not shared, transition to
927         R_SPARC_TLS_LE_{HIX22,LOX10}.
928         (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_HIX22): Only
929         xor relocation with 0xffffffff if R_SPARC_TLS_LE_HIX22.
930         (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_LOX10): Only
931         or 0x1c00 into relocation if R_SPARC_TLS_LE_HIX22.
932
933 2005-04-11  H.J. Lu  <hongjiu.lu@intel.com>
934
935         * coffcode.h (STRING_SIZE_SIZE): Updated to match libcoff-in.h.
936
937 2005-04-11  Nick Clifton  <nickc@redhat.com>
938
939         * aout-target.h:  Convert to ISO C.
940         * aoutf1.h:  Convert to ISO C.
941         * aoutx.h:  Convert to ISO C.
942         * bout.c:  Convert to ISO C.
943         * dwarf1.c:  Convert to ISO C.
944         * ecoffswap.h:  Convert to ISO C.
945         * freebsd.h:  Convert to ISO C.
946         * genlink.h:  Convert to ISO C.
947         * ieee.c:  Convert to ISO C.
948         * ihex.c:  Convert to ISO C.
949         * libcoff-in.h:  Convert to ISO C.
950         * mach-o.c:  Convert to ISO C.
951         * mach-o.h:  Convert to ISO C.
952         * netbsd.h:  Convert to ISO C.
953         * ns32k.h:  Convert to ISO C.
954         * ns32knetbsd.c:  Convert to ISO C.
955         * oasys.c:  Convert to ISO C.
956         * pdp11.c:  Convert to ISO C.
957         * pef-traceback.h:  Convert to ISO C.
958         * pef.c:  Convert to ISO C.
959         * pef.h:  Convert to ISO C.
960         * riscix.c:  Convert to ISO C.
961         * som.c:  Convert to ISO C.
962         * som.h:  Convert to ISO C.
963         * srec.c:  Convert to ISO C.
964         * stabs.c:  Convert to ISO C.
965         * sunos.c:  Convert to ISO C.
966         * tekhex.c:  Convert to ISO C.
967         * versados.c:  Convert to ISO C.
968         * version.h:  Convert to ISO C.
969         * xcoff-target.h:  Convert to ISO C.
970         * xcofflink.c:  Convert to ISO C.
971         * xsym.c:  Convert to ISO C.
972         * xsym.h:  Convert to ISO C.
973
974 2005-04-08  Paul Brook  <paul@codesourcery.com>
975
976         * elf32-arm.c (ARM2THUMB_GLUE_SIZE): Rename...
977         (ARM2THUMB_STATIC_GLUE_SIZE): ... to this.
978         (ARM2THUMB_PIC_GLUE_SIZE): Define.
979         (a2t1p_ldr_insn, a2t2p_add_pc_insn, a2t3p_bx_r12_insn): Add.
980         (elf32_arm_to_thumb_stub): Create PIC stubs.
981         (record_arm_to_thumb_glue): Use different stub size for relocatable
982         images.
983
984 2005-04-05  Alan Modra  <amodra@bigpond.net.au>
985
986         * elf64-ppc.c (dec_dynrel_count): New function split out from
987         ppc64_elf_edit_toc, with additional code from ppc64_elf_edit_opd.
988         (ppc64_elf_edit_toc, ppc64_elf_edit_opd): Use it.
989         (ppc64_elf_tls_optimize): Likewise.
990
991 2005-04-05  Mark Kettenis  <kettenis@gnu.org>
992
993         * netbsd-core.c (SPARC_WCOOKIE_OFFSET): Renamed from
994         CORE_WCOOKIE_OFFSET.
995         (SPARC64_WCOOKIE_OFFSET): New.
996         (netbsd_core_file_p): Provide .wcookie section for OpenBSD/sparc64.
997
998 2005-04-05  Nick Clifton  <nickc@redhat.com>
999
1000         * po/rw.po: New translation: Kinyarwanda
1001         * configure.in (ALL_LINGUAS): Add rw
1002         * configure: Regenerate.
1003
1004 2005-04-05  Richard Sandiford  <rsandifo@redhat.com>
1005
1006         * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
1007         (_bfd_mips_elf_section_from_shdr): Use it to check for recognized
1008         SHT_MIPS_OPTIONS names.  Allow all sections with unrecognised
1009         section flags.
1010         (_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P
1011         to check for SHT_MIPS_OPTIONS sections.
1012         (_bfd_mips_elf_set_section_contents): Likewise.
1013
1014 2005-04-04  Eric Christopher  <echristo@redhat.com>
1015
1016         * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
1017         Clean up gp handling code.
1018
1019 2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>
1020
1021         * elf.c (bfd_elf_set_group_contents): Ignore linker created
1022         group section.
1023         (assign_section_numbers): Accept link_info. Check SHT_GROUP
1024         sections for relocatable files only. Remove the linker created
1025         group sections.
1026         (_bfd_elf_compute_section_file_positions): Pass link_info to
1027         assign_section_numbers.
1028
1029         * elfxx-ia64.c (elfNN_ia64_object_p): New.
1030         (elf_backend_object_p): Defined.
1031
1032 2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>
1033
1034         * elf-bfd.h (elf_section_data): Use (sec) instead of sec.
1035
1036 2005-04-03  Fred Fish  <fnf@specifixinc.com>
1037
1038         * dwarf2.c (struct dwarf2_debug): Add dwarf_ranges_buffer and
1039         dwarf_ranges_size members.
1040         (struct comp_unit): Add base_address member.
1041         (struct funcinfo): Replace low/high members with an arange.
1042         (arange_add): Replace incoming "unit" parameter with "abfd" and
1043         "first_arange" pointers.  Reorganize/rewrite function body.
1044         (decode_line_info): Change arange_add call to pass bfd and arange
1045         pointers.
1046         (lookup_address_in_line_info_table): Use arange list instead of
1047         individual low/high members.  Walk function's arange list to find
1048         lowest PC in list, to test for overlapping functions.
1049         (read_debug_ranges): New function, reads the debug_ranges section.
1050         (lookup_address_in_function_table): Use arange list instead of
1051         individual low/high members.  Rewrite to find smallest range that
1052         matches.
1053         (read_rangelist): Read a given rangelist from debug_ranges.
1054         (scan_unit_for_functions): Use arange list instead of individual
1055         low/high members.  Handle a DW_AT_ranges attribute.
1056         (parse_comp_unit): Use arange list instead of individual low/high
1057         members.  Save comp unit base address.  Handle a DW_AT_ranges
1058         attribute.
1059
1060 2005-04-01  H.J. Lu  <hongjiu.lu@intel.com>
1061
1062         * elf.c (assign_section_numbers): Really use the kept section.
1063
1064 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
1065
1066         * elf-bfd.h (_bfd_elf_check_kept_section): New.
1067
1068         * elf.c (assign_section_numbers): When sh_link points to a
1069         discarded section, call _bfd_elf_check_kept_section to see if
1070         the kept section can be used. Otherwise reject sh_link
1071         pointing to discarded section.
1072
1073         * elflink.c (_bfd_elf_check_kept_section): New.
1074         (elf_link_input_bfd): Use it.
1075
1076 2005-04-01  Alan Modra  <amodra@bigpond.net.au>
1077
1078         * elf64-ppc.c (ppc64_elf_edit_toc): Account for dynamic relocs
1079         that we no longer need.
1080
1081 2005-04-01  Alan Modra  <amodra@bigpond.net.au>
1082
1083         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return -1 on errors
1084         rather than 0.
1085         (ppc64_elf_check_relocs): Remove unnecessary SEC_ALLOC check.
1086
1087 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
1088
1089         * elf.c (assign_section_numbers): Fix a typo.
1090
1091 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
1092
1093         * elflink.c (elf_link_input_bfd): Remove the extra `\n' in
1094         error message.
1095         (_bfd_elf_section_already_linked): Likewise.
1096
1097 2005-03-31  Jerome Guitton  <guitton@gnat.com>
1098
1099         * config.in: Regenerate.
1100
1101 2005-03-31  Jerome Guitton  <guitton@gnat.com>
1102
1103         * config.in (HAVE_DECL_BASENAME): New configure macro.
1104         * configure.in: Check for basename.
1105         * configure: Regenerate.
1106
1107 2005-03-30  Julian Brown  <julian@codesourcery.com>
1108
1109         * bfd-in.h (bfd_is_arm_mapping_symbol_name): Rename from
1110         bfd_elf32_is_arm_mapping_symbol_name.
1111         * bfd-in2.h: Regenerate.
1112         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename from
1113         bfd_elf32_is_arm_mapping_symbol_name.
1114         * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename
1115         bfd_elf32_is_arm_mapping_symbol_name to bfd_is_arm_mapping_symbol_name.
1116         (arm_elf_find_function): Likewise.
1117         (elf32_arm_output_symbol_hook): Likewise.
1118
1119 2005-03-30  Julian Brown  <julian@codesourcery.com>
1120
1121         * bfd-in.h (bfd_elf32_is_arm_mapping_symbol_name): Add prototype.
1122         * bfd-in2.h: Regenerate.
1123         * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to
1124         bfd_elf32_is_arm_mapping_symbol_name.
1125         (elf32_arm_output_symbol_hook): Likewise.
1126         (arm_elf_find_function): Likewise, and include STT_NOTYPE in test for
1127         mapping symbols.
1128         (is_arm_mapping_symbol_name): Function moved from here...
1129         * cpu-arm.c (bfd_elf32_is_arm_mapping_symbol_name): ...to here, renamed
1130         and made global.
1131
1132 2005-03-29  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>
1133
1134         * configure.in: Check for ffs decl and alphabetize.
1135         * config.in: Regenerate.
1136         * configure: Regenerate.
1137         * sysdep.h [NEED_DECLARATION_FFS] (ffs): Prototype and alphabetize.
1138
1139 2005-03-29  Fred Fish  <fnf@specifixinc.com>
1140
1141         * dwarf2.c (struct comp_unit): Fix typo.
1142         (scan_unit_for_functions): Remove unused local variable "name"
1143         and dead code that set it.
1144
1145 2005-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
1146             Phil Blundell  <philb@gnu.org>
1147
1148         * bfd-in2.h, libbfd.h: Regenerated.
1149         * reloc.c: Add ARM TLS relocations.
1150         * elf32-arm.c (elf32_arm_howto_table): Add dynamic TLS
1151         relocations.
1152         (elf32_arm_tls_gd32_howto, elf32_arm_tls_ldo32_howto)
1153         (elf32_arm_tls_ldm32_howto, elf32_arm_tls_le32_howto)
1154         (elf32_arm_tls_ie32_howto): New.
1155         (elf32_arm_howto_from_type): Support TLS relocations.
1156         (elf32_arm_reloc_map): Likewise.
1157         (elf32_arm_reloc_type_lookup): Likewise.
1158         (TCB_SIZE): Define.
1159         (struct elf32_arm_obj_tdata): New.
1160         (elf32_arm_tdata, elf32_arm_local_got_tls_type): Define.
1161         (elf32_arm_mkobject): New function.
1162         (struct elf32_arm_relocs_copied): Add pc_count.
1163         (elf32_arm_hash_entry, GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD)
1164         (GOT_TLS_IE): Define.
1165         (struct elf32_arm_link_hash_table): Add tls_ldm_got.
1166         (elf32_arm_link_hash_newfunc): Initialize tls_type.
1167         (elf32_arm_copy_indirect_symbol): Copy pc_count and tls_type.
1168         (elf32_arm_link_hash_table_create): Initialize tls_ldm_got.
1169         (dtpoff_base, tpoff): New functions.
1170         (elf32_arm_final_link_relocate): Handle TLS relocations.
1171         (IS_ARM_TLS_RELOC): Define.
1172         (elf32_arm_relocate_section): Warn about TLS mismatches.
1173         (elf32_arm_gc_sweep_hook): Handle TLS relocations and pc_count.
1174         (elf32_arm_check_relocs): Detect invalid symbol indexes.  Handle
1175         TLS relocations and pc_count.
1176         (elf32_arm_adjust_dynamic_symbol): Check non_got_ref.
1177         (allocate_dynrelocs): Handle TLS.  Bind REL32 relocs to local
1178         calls.
1179         (elf32_arm_size_dynamic_sections): Handle TLS.
1180         (elf32_arm_finish_dynamic_symbol): Likewise.
1181         (bfd_elf32_mkobject): Define.
1182
1183 2005-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
1184
1185         * elf32-arm.c (elf32_arm_check_relocs): Increment count for all
1186         relocation types.  Don't count relocations which will use a PLT.
1187
1188 2005-03-29  Joel Brobecker  <brobecker@gnat.com>
1189
1190         * elf.c (elfcore_grok_nto_status): Print tid as long.
1191         (elfcore_grok_nto_regs): Likewise.
1192
1193 2005-03-29  Joel Brobecker  <brobecker@gnat.com>
1194
1195         * irix-core.c: Remove some unnecessary prototypes.
1196
1197 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
1198
1199         * irix-core.c: Convert to ISO C.
1200
1201 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
1202
1203         * irix-core.c (do_sections): Replace + by | in expression.
1204         (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
1205         to unused parameters to avoid a compiler warning.
1206
1207 2005-03-28  Mark Kettenis  <kettenis@gnu.org>
1208
1209         * netbsd-core.c: Convert to ISO C.  Fix formatting.
1210
1211 2005-03-24  Eric Christopher  <echristo@redhat.com>
1212
1213         * elfxx-mips.c: Revert previous patch.
1214
1215 2005-03-24  Nick Clifton  <nickc@redhat.com>
1216
1217         * targets.c (_bfd_target_vector): Only include the
1218         bfd_elf32_ia64_hpux_big_vec vector when building a 64-bit BFD with
1219         all targets enabled.
1220
1221 2005-03-24  James E Wilson  <wilson@specifixinc.com>
1222
1223         * Makefile.am (BFD32_BACKENDS): Delete elf32-ia64.lo.
1224         (BFD64_BACKENDS): Add elf32-ia64.lo.
1225         * Makefile.in: Regenerate.
1226
1227 2005-03-23  Eric Christopher  <echristo@redhat.com>
1228
1229         * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): New.
1230         (mips_elf_calculate_relocation): Use. Define DF_TEXTREL
1231         after emitting relocation.
1232         (_bfd_mips_elf_adjust_dynamic_symbol): Ditto.
1233         (_bfd_mips_elf_check_relocs): Remove code to set DF_TEXTREL
1234         and readonly_reloc.
1235
1236 2005-03-23  Mike Frysinger  <vapier@gentoo.org>
1237             Nick Clifton  <nickc@redhat.com>
1238
1239         * config.bfd: Accept any C library to accompany a GNU Linux
1240         implementation, not just the GNU C library.
1241         * configure.in: Likewise.
1242         * configure: Regenerate.
1243
1244 2005-03-22  H.J. Lu  <hongjiu.lu@intel.com>
1245
1246         * bfd-in.h (_bfd_elf_provide_symbol): New.
1247         * bfd-in2.h: Regenerated.
1248
1249         * elf32-ppc.c (set_linker_sym): Moved to elflink.c.
1250         (ppc_elf_set_sdata_syms): Call _bfd_elf_provide_symbol instead
1251         of set_linker_sym.
1252
1253         * elflink.c (_bfd_elf_provide_symbol): New. Moved and renamed
1254         from elf32-ppc.c.
1255
1256 2005-03-22  Hans-Peter Nilsson  <hp@axis.com>
1257
1258         * hash.c (strtab_hash_newfunc): Fix typo in allocated size.
1259
1260 2005-03-22  Bob Wilson  <bob.wilson@acm.org>
1261
1262         * xtensa-isa.c (xtensa_opcode_lookup, xtensa_state_lookup,
1263         xtensa_sysreg_lookup_name, xtensa_interface_lookup,
1264         xtensa_funcUnit_lookup): Skip bsearch call if count is zero.
1265         (xtensa_opcode_decode): Rearrange code.
1266
1267 2005-03-22  Nick Clifton  <nickc@redhat.com>
1268
1269         * binary.c: Convert to ISO C90 formatting.
1270         * coff-arm.c: Convert to ISO C90 formatting.
1271         * coffgen.c: Convert to ISO C90 formatting.
1272         * elf32-gen.c: Convert to ISO C90 formatting.
1273         * elf64-gen.c: Convert to ISO C90 formatting.
1274         * hash.c: Convert to ISO C90 formatting.
1275         * ieee.c: Convert to ISO C90 formatting.
1276
1277 2005-03-22  Daniel Jacobowitz  <dan@codesourcery.com>
1278
1279         * elf32-arm.c (elf32_arm_final_link_relocate): Don't fail for
1280         unresolved symbols in R_ARM_NONE relocations.
1281
1282 2005-03-22  Daniel Jacobowitz  <dan@codesourcery.com>
1283
1284         * elf32-arm.c (elf32_arm_final_link_relocate): Add
1285         UNRESOLVED_RELOC_P argument.  Set it appropriately.
1286         (elf32_arm_relocate_section): Update call to
1287         elf32_arm_final_link_relocate.  Don't clobber RELOCATION; use
1288         unresolved_reloc instead.
1289
1290 2005-03-23  Alan Modra  <amodra@bigpond.net.au>
1291
1292         * elflink.c (elf_link_add_object_symbols): Set SEC_EXCLUDE on
1293         .gnu.warning.* sections.
1294
1295 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
1296
1297         * elf32-ppc.c (elf_linker_section_pointers_t): Remove
1298         written_address_p.
1299         (ppc_elf_create_linker_section): Don't try to reuse existing section.
1300         (elf_create_pointer_linker_section): Delete info parm.  Don't make
1301         h dynamic.  Don't set written_address_p.
1302         (ppc_elf_check_relocs): Adjust ppc_elf_create_linker_section calls.
1303         (bfd_put_ptr): Delete.
1304         (elf_finish_pointer_linker_section): Remove output_bfd and info parms.
1305         Always write section contents.  Assert global sym is def_regular.
1306         Use offset bottom bit as a written flag.
1307         (ppc_elf_relocate_section): Adjust elf_finish_pointer_linker_section
1308         calls.
1309
1310 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
1311
1312         * elf32-ppc.c (ppc_elf_set_sdata_syms): New function, extracted from..
1313         (ppc_elf_set_sdata_syms): ..here.  Expand comment.  Set .sbss start
1314         and end syms.
1315
1316 2005-03-21  Nick Clifton  <nickc@redhat.com>
1317
1318         * coff-arm.c (coff_link_hash_entry): Only define for non WINCE
1319         targets.
1320         (t2a1_bx_pc_insn): Likewise.
1321         (t2a2_noop_insn): Likewise.
1322         (t2a3_b_insn): Likewise.
1323         (t2a1_push_insn): Likewise.
1324         (t2a2_ldr_insn): Likewise.
1325         (t2a3_mov_insn): Likewise.
1326         (t2a4_bx_insn): Likewise.
1327         (t2a5_pop_insn): Likewise.
1328         (t2a6_bx_insn): Likewise.
1329         (coff_arm_relocate_section): Only declare the high_address
1330         variable for non WINCE targets.
1331
1332 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
1333
1334         * elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
1335         SEC_LINKER_CREATED.  Attach to dynobj.
1336         (ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
1337
1338 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1339
1340         * elf32-ppc.c (struct elf_linker_section): Remove sym_hash and
1341         sym_offset.  Add name, bss_name, sym_name, sym_val.
1342         (struct ppc_elf_link_hash_table): Remove sdata and sdata2 pointers.
1343         Add sdata array of elf_linker_section_t.
1344         (ppc_elf_link_hash_table_create): Set name, sym_name, and bss_name.
1345         (enum elf_linker_section_enum): Delete.
1346         (ppc_elf_create_linker_section): Rewrite.  Don't create syms here.
1347         (ppc_elf_check_relocs): Delay ppc_elf_create_linker_section until
1348         the special sections are needed.  Adjust htab->sdata refs.
1349         Ensure dynobj is set in sreloc code.
1350         (ppc_elf_size_dynamic_sections): Strip sdata sections.
1351         (ppc_elf_set_sdata_syms): New function.
1352         (elf_finish_pointer_linker_section): Use 0x8000 for sym_offset.
1353         (ppc_elf_relocate_section): Adjust references to htab->sdata.  Use
1354         sym_val instead of sym_hash.
1355         * elf32-ppc.h (ppc_elf_set_sdata_syms): Declare.
1356
1357 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1358
1359         * elf32-ppc.c (is_ppc_elf_target): Move to linker part of file.
1360         (ppc_elf_merge_private_bfd_data): Likewise.
1361
1362 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1363
1364         * elf32-ppc.c (struct elf_linker_section): Remove rel_section.
1365         (ppc_elf_create_linker_section): Don't create rel_section.
1366         (elf_create_pointer_linker_section): Don't size relocs.
1367         (elf_finish_pointer_linker_section): Remove relative_reloc parm.
1368         Don't generate relocs.
1369         (ppc_elf_relocate_section): Adjust calls to
1370         elf_finish_pointer_linker_section.
1371
1372 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
1373
1374         * elf32-ppc.c (is_ppc_elf_target): New function.
1375         (ppc_elf_merge_private_bfd_data): Use it rather than just testing
1376         for bfd_target_elf_flavour.  Do this test before endian check.
1377         (ppc_elf_add_symbol_hook): Use is_pcc_elf_target.
1378         (ppc_elf_size_dynamic_sections): Likewise.
1379
1380 2005-03-20  H.J. Lu  <hongjiu.lu@intel.com>
1381
1382         * elf-bfd.h (elf_backend_data): Add int to
1383         elf_backend_section_from_shdr.
1384         (bfd_elf_section_data): Update comment for this_idx.
1385         (_bfd_elf_make_section_from_shdr): Add int.
1386         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
1387
1388         * elf.c (_bfd_elf_make_section_from_shdr): Take section index
1389         and use it to set this_idx in bfd_elf_section_data.
1390         (bfd_section_from_shdr): Pass shindex to
1391         _bfd_elf_make_section_from_shdr.
1392         (_bfd_elf_section_from_bfd_section): Use this_idx in
1393         bfd_elf_section_data to find section index.
1394
1395         * elf32-arm.c (elf32_arm_section_from_shdr): Take section
1396         index and pass it to _bfd_elf_make_section_from_shdr.
1397         * elf32-i370.c(i370_elf_section_from_shdr): Likewise.
1398         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
1399         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
1400         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
1401         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
1402         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
1403         * elf64-x86-64.c (elf64_x86_64_section_from_shdr): Likewise.
1404         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
1405         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
1406
1407 2005-03-19  Danny Smith <dannysmith@users.sourceforge.net>
1408             Ross Ridge  <rridge@csclub.uwaterloo.ca>
1409
1410         * peicode.h (pe_ILF_build_a_bfd): Strip only one prefix
1411         character in IMPORT_NAME_UNDECORATE and IMPORT_NAME_NOPREFIX
1412         cases.  Add comment.
1413
1414 2005-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1415
1416         * elflink.c (elf_mark_used_section): Remove check for special
1417         sections.
1418
1419 2005-03-18  Andreas Schwab  <schwab@suse.de>
1420
1421         * elfxx-ia64.c (elfNN_ia64_install_value): Change type of insn
1422         from bfd_vma to ia64_insn, remove broken cast.
1423
1424 2005-03-18  C Jaiprakash  <cjaiprakash@noida.hcltech.com>
1425
1426         * elf32-m68k.c (elf_cfv4e_plt0_entry): plt entry for coldfire v4e.
1427         (elf_m68k_adjust_dynamic_symbol,elf_m68k_finish_dynamic_symbol,
1428          elf_m68k_finish_dynamic_sections): Use it.
1429
1430 2005-03-17  Paul Brook <paul@codesourcery.com>
1431             Dan Jacobowitz <dan@codesourcery.com>
1432             Mark Mitchell  <mark@codesourcery.com>
1433
1434         * elf32-arm.c (elf32_arm_modify_segment_map): New function.
1435         (elf32_arm_additional_program_headers): Likewise.
1436         (elf_backend_modify_segment_map): Define.
1437         (elf_backend_additional_program_headers): Likewise.
1438         (elf32_arm_symbian_modify_segment_map): Use
1439         elf32_arm_modify_segment_map.
1440
1441 2005-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1442
1443         * elflink.c (elf_mark_used_section): Check bfd_is_const_section
1444         for special sections.
1445
1446 2005-03-18  Alan Modra  <amodra@bigpond.net.au>
1447
1448         * elf-bfd.h (_bfd_elf_link_renumber_dynsyms): Delete.
1449         * elflink.c (_bfd_elf_link_renumber_dynsyms): Make static, add
1450         section_sym_count param, and return number of section symbols.
1451         (bfd_elf_size_dynamic_sections): Clear section symbol area of
1452         .dynsym contents.  Don't bother calling swap_symbol_out on the
1453         first all-zero dynsym.
1454         (elf_mark_used_section): Formatting.  Avoid twiddling flags in
1455         special sections like bfd_abs_section.
1456         (bfd_elf_gc_sections): Spelling fix.
1457
1458 2005-03-16  Fred Fish  <fnf@specifixinc.com>
1459
1460         PR binutils/790
1461         * dwarf2.c (read_indirect_string): Fix apparent typo, check
1462         dwarf_str_buffer allocation, not dwarf_abbrev_buffer.
1463
1464 2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>
1465
1466         * elflink.c (elf_mark_used_section): New.
1467         (bfd_elf_gc_sections): Call elf_gc_mark_section for
1468         non-relocatable link if we don't do GC.
1469
1470 2005-03-16  Nick Clifton  <nickc@redhat.com>
1471             Ben Elliston  <bje@au.ibm.com>
1472
1473         * configure.in (werror): New switch: Add -Werror to the
1474         compiler command line.  Enabled by default.  Disable via
1475         --disable-werror.
1476         * configure: Regenerate.
1477
1478 2005-03-16  Nick Clifton  <nickc@redhat.com>
1479
1480         * ecoff.c: Convert to ISO C90 formatting.
1481
1482 2005-03-16  Alan Modra  <amodra@bigpond.net.au>
1483
1484         * elf32-ppc.c: Divide file into general and linker specific
1485         functions.  Sort linker functions into roughly the order in which
1486         they are called by the ELF linker code.
1487
1488 2005-03-16  Alan Modra  <amodra@bigpond.net.au>
1489
1490         * elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED
1491         on section.  Correct comment, and add FIXME.
1492         (ppc_elf_additional_program_headers): Don't bump header count for
1493         interp.  Test SEC_ALLOC, not SEC_LOAD, and don't test size.
1494         (ppc_elf_size_dynamic_sections): Don't strip sdata and sdata2, but
1495         do allocate memory if they need it.
1496
1497 2005-03-15  Mikkel Krautz  <krautz@gmail.com>
1498
1499         * config.bfd (x86_64-elf): Add target.
1500
1501 2005-03-15  Alan Modra  <amodra@bigpond.net.au>
1502
1503         * po/es.po: Commit new Spanish translation.
1504
1505 2005-03-14  H.J. Lu  <hongjiu.lu@intel.com>
1506
1507         * elfxx-ia64.c (elfNN_ia64_relocate_section): Set symbo name
1508         for global symbol when reporting overflow.
1509
1510 2005-03-11  Jakub Jelinek  <jakub@redhat.com>
1511
1512         * libbfd-in.h (_bfd_ar_spacepad): New prototype.
1513         * libbfd.h: Rebuilt.
1514         * archive.c (_bfd_ar_spacepad): New function.
1515         (_bfd_construct_extended_name_table, _bfd_write_archive_contents,
1516         bsd_write_armap, _bfd_archive_bsd_update_armap_timestamp,
1517         coff_write_armap): Use it.
1518         (bfd_ar_hdr_from_filesystem): Likewise.  Fix HP-UX large
1519         uid/gid support.
1520         * archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad.
1521
1522 2005-03-10  Mark Kettenis  <kettenis@gnu.org>
1523
1524         * archive.c (_bfd_look_for_bfd_in_cache): Move declaration of
1525         has_table to the start of the function.
1526
1527 2005-03-10  Ben Elliston  <bje@au.ibm.com>
1528
1529         * archive.c: Include hashtab.h.
1530         (struct ar_cache): Rename `arelt' to `arbfd' and remove `next'.
1531         (_bfd_look_for_bfd_in_cache): Reimplement using htab_find.
1532         (hash_file_ptr): New function.
1533         (eq_file_ptr): Likewise.
1534         (_bfd_add_bfd_to_archive_cache): Reimplement using a hash table.
1535         * libbfd-in.h: Include hashtab.h.
1536         (struct artdata): Change `cache' member type to htab_t.
1537         * libbfd.h: Rebuild.
1538
1539 2005-03-08  Daniel Jacobowitz  <dan@codesourcery.com>
1540
1541         * configure.in: Bump version to 2.16.90.
1542         * configure: Regenerated.
1543
1544 2005-03-07  Jakub Jelinek  <jakub@redhat.com>
1545
1546         * opncls.c (opncls_bread, opncls_bclose): Fix if pread resp.
1547         close is a function like macro in system headers.
1548
1549 2005-03-07  Alan Modra  <amodra@bigpond.net.au>
1550
1551         PR ld/778
1552         * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate
1553         _GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol.
1554
1555 2005-03-06  Alan Modra  <amodra@bigpond.net.au>
1556
1557         * elf.c (elfcore_grok_win32pstatus): Warning fixes.
1558
1559 2005-03-05  Alan Modra  <amodra@bigpond.net.au>
1560
1561         * po/bfd.pot: Regenerate.
1562
1563 2005-03-05  Alan Modra  <amodra@bigpond.net.au>
1564
1565         * elf64-ppc.c (update_plt_info): Don't mark new ABI call syms
1566         with is_func.
1567         (func_desc_adjust): Force dot-syms local in executables as well
1568         as shared libs.
1569
1570 2005-03-04  David Daney  <ddaney@avtrex.com>
1571
1572         * elfxx-mips.c (mips_elf_calculate_relocation): Handle special
1573         '__gnu_local_gp' symbol used by gas -mno-shared.
1574
1575 2005-03-03  H.J. Lu  <hongjiu.lu@intel.com>
1576
1577         * elf-bfd.h (elf_backend_data): Add "const char *" to
1578         elf_backend_section_from_phdr.
1579
1580         * elf.c (bfd_section_from_phdr): Pass "proc" to the
1581         elf_backend_section_from_phdr hook.
1582
1583 2005-03-02  Daniel Jacobowitz  <dan@codesourcery.com>
1584             Joseph Myers  <joseph@codesourcery.com>
1585
1586         * elfxx-mips.c (struct mips_got_entry): Add tls_type.
1587         (struct mips_got_info): Add tls_gotno, tls_assigned_gotno,
1588         and tls_ldm_offset.
1589         (struct mips_elf_got_per_bfd_arg): Add global_count.
1590         (struct mips_elf_count_tls_arg): New.
1591         (struct mips_elf_hash_sort_data): Update comment for min_got_dynindx.
1592         (struct mips_elf_link_hash_entry): Add tls_type and tls_got_offset.
1593         (GOT_NORMAL, GOT_TLS_GD, GOT_TLS_LDM, GOT_TLS_IE)
1594         (GOT_TLS_OFFSET_DONE, GOT_TLS_DONE): Define.
1595         (TLS_RELOC_P): Define.
1596         (TP_OFFSET, DTP_OFFSET): Define.
1597         (dtprel_base, tprel_base): New functions.
1598         (mips_elf_link_hash_newfunc): Initialize tls_type.
1599         (mips_elf_got_entry_hash, mips_elf_got_entry_eq)
1600         (mips_elf_multi_got_entry_hash, mips_elf_multi_got_entry_eq): Handle
1601         TLS entries.
1602         (mips_tls_got_relocs, mips_elf_count_local_tls_relocs)
1603         (mips_elf_count_global_tls_entries, mips_elf_count_global_tls_relocs)
1604         (mips_elf_output_dynamic_relocation, mips_elf_initialize_tls_slots)
1605         (mips_tls_got_index): New functions.
1606         (mips_elf_local_got_index): Add new R_SYMNDX, H, and R_TYPE
1607         arguments.  Pass them to mips_elf_create_local_got_entry.  Use
1608         mips_tls_got_index.
1609         (mips_elf_global_got_index): Add new R_TYPE and INFO arguments.
1610         Handle TLS entries.
1611         (mips_elf_got_page, mips_elf_got16_entry): Update calls to
1612         mips_elf_create_local_got_entry.
1613         (mips_elf_create_local_got_entry): Add new R_SYMNDX, H, and R_TYPE
1614         arguments.  Handle TLS entries.
1615         (mips_elf_sort_hash_table_f): Add non-TLS assertions.
1616         (mips_elf_record_local_got_symbol): Add new TLS_FLAG argument.  Handle
1617         TLS entries.
1618         (mips_elf_record_global_got_symbol): Likewise.
1619         (mips_elf_make_got_per_bfd): Initialize new mips_got_info members.
1620         Count TLS entries.
1621         (mips_elf_merge_gots): Handle TLS entries when merging.
1622         (mips_elf_initialize_tls_index): New function.
1623         (mips_elf_set_global_got_offset): Handle TLS entries.
1624         (mips_elf_adjust_gp): Handle TLS.
1625         (mips_elf_multi_got): Remove redundant call to
1626         mips_elf_resolve_final_got_entries.  Initialize global_count.
1627         Correct a comment.  Initialize new TLS members of mips_got_info.
1628         Assign TLS GOT indexes for new GOTs.
1629         (mips_elf_create_got_section): Initialize new TLS members of
1630         mips_got_info.
1631         (mips_elf_calculate_relocation): Handle TLS relocs.
1632         (_bfd_mips_elf_check_relocs): Likewise.  Update calls to changed
1633         functions.
1634         (_bfd_mips_elf_always_size_sections): Handle TLS.
1635         (_bfd_mips_elf_size_dynamic_sections): Likewise.
1636         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.  Update calls to
1637         changed functions.
1638         (_bfd_mips_elf_copy_indirect_symbol): Copy tls_type.
1639         (_bfd_mips_elf_hide_symbol): Handle TLS.
1640         * elfn32-mips.c (elf_mips_howto_table_rel, elf_mips_howto_table_rela)
1641         (mips_reloc_map): Add TLS relocs.
1642         * elf32-mips.c (elf_mips_howto_table_rel, mips_reloc_map): Likewise.
1643         * elf64-mips.c (mips_elf64_howto_table_rel)
1644         (mips_elf64_howto_table_rela, mips_reloc_map): Likewise.
1645         * reloc.c: Define new MIPS TLS relocations.
1646         * libbfd.h, bfd-in2.h: Regenerated.
1647
1648 2005-03-02  Jan Beulich  <jbeulich@novell.com>
1649
1650         * Makefile.am: Add dependency of cache.o on libiberty.h.
1651         * cache.c: Include libiberty.h.
1652         (bfd_open_file): Use unlink_if_ordinary instead of unlink.
1653
1654 2005-03-01  Zack Weinberg  <zack@codesourcery.com>
1655
1656         * elf.c (bfd_section_from_shdr <default case>): Call
1657         elf_backend_section_from_shdr hook unconditionally, and return
1658         what it returns.
1659         (bfd_section_from_phdr): Similarly, for elf_backend_section_from_phdr.
1660         * elfxx-target.h (elf_backend_section_from_shdr)
1661         (elf_backend_section_from_phdr): Default to
1662         _bfd_elf_make_section_from_shdr and _bfd_elf_make_section_from_phdr
1663         respectively.
1664
1665 2005-03-01  Alan Modra  <amodra@bigpond.net.au>
1666
1667         * targets.h: Typo fix.
1668         * bfd-in2.h: Regenerate.
1669
1670         * bout.c (b_out_write_object_contents): Don't use sizeof on host
1671         structs to size on-disk structures.
1672         (b_out_set_section_contents): Size the external struct, not the
1673         internal one for on-disk size.
1674         (b_out_sizeof_headers): Likewise.
1675
1676 2005-03-01  Alan Modra  <amodra@bigpond.net.au>
1677
1678         * elf64-ppc.c (ppc64_elf_size_stubs): Override defined dot-sym
1679         entry points with the func descriptor as well as undefweak.
1680
1681 2005-02-28  Ross Ridge  <rridge@csclub.uwaterloo.ca>
1682
1683         * peicode.h (pe_ILF_build_a_bfd): Do not assume that an @ will be
1684         present when IMPORT_NAME_UNDOECRATE is used.
1685
1686 2005-02-28  H.J. Lu  <hongjiu.lu@intel.com>
1687
1688         PR 757
1689         * elf-bfd.h (_bfd_elf_merge_symbol): Add a pointer to unsigned
1690         int.
1691
1692         * elf32-sh-symbian.c (sh_symbian_relocate_section): Pass NULL
1693         to _bfd_elf_merge_symbol.
1694
1695         * elflink.c (_bfd_elf_merge_symbol): Use the pointer to
1696         unsigned int to return the alignment of the old common symbol
1697         in the dynamic object.
1698         (_bfd_elf_add_default_symbol): Pass NULL to
1699         _bfd_elf_merge_symbol.
1700         (elf_link_add_object_symbols): Pass &old_alignment to
1701         _bfd_elf_merge_symbol. Get the alignment of the new common
1702         symbol in the dynamic object.
1703
1704 2005-02-24  Ben Elliston  <bje@au.ibm.com>
1705
1706         * coffcode.h (coff_sym_filepos): Remove GNU960 conditional code.
1707         * format.c (bfd_check_format_matches): Likewise.
1708         * archive.c (BFD_GNU960_ARMAG): Likewise.
1709         (bfd_generic_archive_p): Likewise.
1710         (_bfd_write_archive_contents): Likewise.
1711
1712 2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>
1713
1714         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.95.
1715         * configure: Regenerate.
1716
1717 2005-02-24  Julian Brown  <julian@sirius.codesourcery.com>
1718
1719         * elflink.c (elf_link_add_object_symbols): Force symbols in discarded
1720         COMDAT group sections to have default visibility.
1721
1722 2005-02-24  Alan Modra  <amodra@bigpond.net.au>
1723
1724         * coffcode.h (coff_print_aux): Warning fix.
1725         * elf-m10300.c (mn10300_elf_relax_section): Use section->id
1726         instead of section pointer to identify.
1727         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.  Allocate
1728         the correct size buffer for local sym mangling too.
1729         (h8300_bfd_link_add_symbols): Likewise.
1730         * elf32-sh-symbian.c (sh_symbian_process_embedded_commands): Fix
1731         warning.
1732         * elf32-sh64.c (shmedia_prepare_reloc): Use %B and %p in error message
1733         * elf32-xtensa.c (literal_value_hash): Warning fix.
1734         * versados.c (process_otr): Warning fix.
1735         (versados_canonicalize_reloc): Likewise.
1736         * vms-gsd.c (_bfd_vms_slurp_gsd): Warning fix.
1737         * vms.c (fill_section_ptr): Warning fix.
1738
1739 2005-02-23  H.J. Lu  <hongjiu.lu@intel.com>
1740
1741         * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Defined.
1742         * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Likewise.
1743
1744 2005-02-23  Nick Clifton  <nickc@redhat.com>
1745
1746         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Initialise
1747         the relvaddr field of the Elf32_crinfo structure.
1748
1749         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Initialise
1750         variables that are passed by reference to
1751         m68hc11_get_relocation_value in case that function does not
1752         initialise them.
1753
1754         * elf32-cr16c.c (cr16c_elf_final_link_relocate): Remove duplicated
1755         return statements and replace with a single return at the end of
1756         the function.  This helps pacify the flow analysis code in gcc 4.0.
1757
1758         * elf.c (_bfd_elf_compute_section_file_positions): Initialise
1759         strtab to avoid compile time warning.
1760
1761 2005-02-23  Ben Elliston  <bje@au.ibm.com>
1762
1763         * opncls.c (bfd_zalloc): Document this function.
1764
1765 2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>
1766
1767         * coffcode.h (sec_to_styp_flags): Replaced SEC_CLINK with
1768         SEC_TIC54X_CLINK. Replace SEC_BLOCK with SEC_TIC54X_BLOCK.
1769         Replace SEC_SHARED with SEC_COFF_SHARED.
1770         (styp_to_sec_flags): Likewise.
1771
1772         * elfxx-target.h (TARGET_BIG_SYM): Remove SEC_ARCH_BIT_0.
1773         (TARGET_LITTLE_SYM): Likewise.
1774
1775         * section.c (SEC_ARCH_BIT_0): Removed.
1776         (SEC_LINK_DUPLICATES_SAME_CONTENTS): Defined with
1777         SEC_LINK_DUPLICATES_ONE_ONLY and SEC_LINK_DUPLICATES_SAME_SIZE.
1778         (SEC_SHARED): Renamed to ...
1779         (SEC_COFF_SHARED): This.
1780         (SEC_BLOCK): Renamed to ...
1781         (SEC_TIC54X_BLOCK): This.
1782         (SEC_CLINK): Renamed to ...
1783         (SEC_TIC54X_CLINK): This.
1784         (SEC_XXX): Rearranged. Move SEC_COFF_SHARED_LIBRARY,
1785         SEC_COFF_SHARED, SEC_TIC54X_BLOCK and SEC_TIC54X_CLINK to the
1786         end.
1787         * bfd-in2.h: Regenerated.
1788
1789 2005-02-21  Fred Fish  <fnf@specifixinc.com>
1790
1791         * dwarf2.c (find_abstract_instance_name): Call recursively
1792         to handle a DW_AT_specification.
1793
1794 2005-02-21  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
1795
1796         * elfxx-mips.c (ecoff_swap_rpdr_out, mips_elf_output_extsym,
1797         mips_elf_create_dynamic_relocation,
1798         _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_final_link):
1799         Remove #if 0'd code.
1800
1801 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1802
1803         * Makefile.am: Run "make dep-am"
1804         * Makefile.in: Regenerate.
1805
1806 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1807
1808         * coffgen.c (bfd_coff_get_comdat_section): Check that
1809         coff_section_data isn't NULL.
1810
1811 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1812
1813         * bfd-in.h (bfd_elf_bfd_from_remote_memory): Warning fix.
1814         * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Likewise.
1815         * coff-rs6000.c (xcoff_write_armap_big): Warning fixes.  Remove
1816         useless assignments.
1817         (xcoff_write_archive_contents_big): Likewise.
1818         (_bfd_xcoff_put_ldsymbol_name): Likewise.
1819         * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise.
1820         * coffgen.c (coff_write_symbols): Make "written" a bfd_vma.
1821         * cofflink.c (process_embedded_commands): Warning fixes.
1822         * cpu-arm.c: Delete unnecessary prototypes.  Convert to C90.
1823         Warning fixes.
1824         * dwarf2.c: Warning fixes.
1825         * elf-bfd.h: Likewise.
1826         * elf-eh-frame.c: Likewise.
1827         * elf-strtab.c: Likewise.
1828         * elf.c: Likewise.
1829         * elf32-m68k.c: Likewise.
1830         * elf32-ppc.c: Likewise.
1831         * elf32-sh-symbian.c: Likewise.
1832         * elf32-sh.c: Delete unnecessary prototypes.  Warning fixes.
1833         * elf64-sh64.c: Likewise.
1834         * peicode.h: Likewise.
1835         * elf64-mmix.c: Warning fixes.
1836         * elfcode.h: Likewise.
1837         * elfxx-mips.c: Likewise.
1838         * libbfd-in.h: Likewise.
1839         * libbfd.c: Likewise.
1840         * mach-o.c: Likewise.
1841         * merge.c: Likewise.
1842         * mmo.c: Likewise.
1843         * opncls.c: Likewise.
1844         * pef.c: Likewise.
1845         * srec.c: Likewise.
1846         * vms-hdr.c: Likewise.
1847         * vms-tir.c: Likewise.
1848         * xtensa-isa.c: Likewise.
1849         * xtensa-modules.c: Likewise.
1850         * xsym.c: Likewise.
1851         (pstrcmp): Use correct choice of string lengths.  Fix return value.
1852         (bfd_sym_module_name): Correct string length.
1853         * bfd-in2.h: Regenerate.
1854         * libbfd.h: Regenerate.
1855
1856 2005-02-17  Alexandre Oliva  <aoliva@redhat.com>
1857
1858         * elf32-frv.c (elf32_frv_relocate_section): Remove warning from
1859         uninitialized check_segment[1] in TLSMOFF case.
1860         Reported by Alan Modra.
1861         (elf32_frv_relocate_section): Improve errors and warnings.
1862
1863 2005-02-17  Alan Modra  <amodra@bigpond.net.au>
1864
1865         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Fix warning.
1866
1867 2005-02-16  Alan Modra  <amodra@bigpond.net.au>
1868
1869         * coff-arm.c (coff_arm_is_local_label_name): Warning fix.
1870         * elf32-frv.c (frvfdpic_relocs_info_hash): Likewise.
1871         * pef.c (bfd_pef_scan): Don't ignore return value of
1872         bfd_pef_scan_start_address.
1873         * mach-o.c (bfd_mach_o_scan): Don't ignore return value of
1874         bfd_mach_o_scan_start_address.
1875         * elfxx-ia64.c (elfNN_ia64_relax_brl): Rewrite for 32-bit bfd_vma.
1876         * elfxx-mips.c: Remove unnecessary prototypes.
1877         (sort_dynamic_relocs_64): Abort if not BFD64.
1878
1879 2005-02-16  Alan Modra  <amodra@bigpond.net.au>
1880
1881         * elf64-ppc.c (ppc64_elf_edit_toc): Skip toc if size is zero.
1882         Skip toc reloc adjust if reloc_count is zero.
1883
1884 2005-02-15  Nigel Stephens  <nigel@mips.com>
1885             Maciej W. Rozycki  <macro@mips.com>
1886
1887         * elf32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
1888         reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
1889         R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1890         (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
1891         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1892         dst_mask.
1893         (mips16_gprel_reloc): Remove bit shuffling; call
1894         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1895         and _bfd_mips16_elf_reloc_shuffle() instead.
1896         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1897         (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1898         relocs.
1899         (mips_elf32_rtype_to_howto): Fetch MIPS16 howtos from
1900         elf_mips16_howto_table_rel.
1901         * elf64-mips.c (mips16_elf64_howto_table_rel): New array for
1902         MIPS16 REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16
1903         relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1904         (elf_mips16_jump_howto): Move into mips16_elf64_howto_table_rel.
1905         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1906         dst_mask.
1907         (mips16_elf64_howto_table_rela): New array for MIPS16 RELA
1908         reloc howtos.  Add R_MIPS16_26, R_MIPS16_GPREL, R_MIPS16_HI16 and
1909         R_MIPS16_LO16 relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16
1910         placeholders.
1911         (mips16_gprel_reloc): Remove bit shuffling; call
1912         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1913         and _bfd_mips16_elf_reloc_shuffle() instead.
1914         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1915         (bfd_elf64_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1916         relocs.
1917         (mips_elf64_rtype_to_howto): Fetch MIPS16 howtos from
1918         mips16_elf64_howto_table_rela or mips16_elf64_howto_table_rel.
1919         * elfn32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
1920         REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
1921         R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1922         (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
1923         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1924         dst_mask.
1925         (mips16_gprel_reloc): Remove bit shuffling; call
1926         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1927         and _bfd_mips16_elf_reloc_shuffle() instead.
1928         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1929         (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1930         relocs.
1931         (mips_elf_n32_rtype_to_howto): Fetch MIPS16 howtos from
1932         elf_mips16_howto_table_rela or elf_mips16_howto_table_rel.
1933         * elfxx-mips.c (_bfd_mips16_elf_reloc_unshuffle): New function to
1934         handle bit shuffling for MIPS16 relocs.
1935         (_bfd_mips16_elf_reloc_shuffle): Likewise.
1936         (_bfd_mips_elf_lo16_reloc): Use _bfd_mips16_elf_reloc_unshuffle()
1937         and _bfd_mips16_elf_reloc_shuffle().
1938         (_bfd_mips_elf_generic_reloc): Likewise.
1939         (mips_elf_calculate_relocation): Likewise.  Handle R_MIPS16_HI16
1940         and R_MIPS16_LO16.
1941         (mips_elf_obtain_contents): Remove bit shuffling.
1942         (mips_elf_perform_relocation): Likewise; call
1943         _bfd_mips16_elf_reloc_unshuffle() and _bfd_mips16_elf_reloc_shuffle()
1944         instead.
1945         (_bfd_mips_elf_relocate_section): Likewise.  Handle R_MIPS16_HI16
1946         and R_MIPS16_LO16.
1947         * elfxx-mips.h (_bfd_mips16_elf_reloc_unshuffle): Declare.
1948         (_bfd_mips16_elf_reloc_shuffle): Likewise.
1949         * reloc.c (BFD_RELOC_MIPS16_HI16): New reloc.
1950         (BFD_RELOC_MIPS16_HI16_S): Likewise.
1951         (BFD_RELOC_MIPS16_LO16): Likewise.
1952         * bfd-in2.h: Regenerate.
1953         * libbfd.h: Regenerate.
1954
1955 2005-02-15  Jan Beulich  <jbeulich@novell.com>
1956
1957         * elfxx-ia64.c (ia64_howto_table): Correct strings for
1958         R_IA64_DTPMOD64[LM]SB.
1959
1960 2005-02-14  H.J. Lu  <hongjiu.lu@intel.com>
1961
1962         * elfxx-ia64.c (elfNN_ia64_relax_section): Allow relax
1963         backward branch in the same section.
1964         (elfNN_ia64_relocate_section): Inform users that the input
1965         section is too big to relax br instruction when overflow
1966         happens to R_IA64_PCREL21B, R_IA64_PCREL21BI, R_IA64_PCREL21M
1967         and R_IA64_PCREL21F.
1968
1969 2005-02-14 Orjan Friberg <orjanf@axis.com>
1970
1971         * elfcore.h (elf_core_file_p): Move the call to
1972         elf_backend_object_p to allow the correct machine to be set before
1973         processing the program headers.
1974
1975 2005-02-14  Nick Clifton  <nickc@redhat.com>
1976
1977         PR binutils/716
1978         * peicode.h (pe_bfd_copy_private_bfd_data): Copy the large address
1979         aware flag from the input bfd to the output bfd.
1980
1981 2005-02-11  Maciej W. Rozycki  <macro@mips.com>
1982
1983         * elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Reject
1984         R_MIPS_LITERAL relocations for external symbols.
1985         * elf64-mips.c (mips_elf64_literal_reloc): Likewise.
1986         * elfn32-mips.c (mips_elf_literal_reloc): Likewise.
1987
1988 2005-02-11  H.J. Lu  <hongjiu.lu@intel.com>
1989
1990         * bfd-in2.h: Rebuilt.
1991
1992 2005-02-11  Paul Brook  <paul@codesourcery.com>
1993
1994         * elf-bfd.h (struct elf_link_hash_table): Add
1995         is_relocatable_executable.
1996         * elf.c (_bfd_elf_link_hash_table_init): Initialize it.
1997         * elflink.c (bfd_elf_link_record_dynamic_symbol): Create local dynamic
1998         symbols in relocatable executables.
1999         (bfd_elf_record_link_assignment): Create dynamic section symbols in
2000         relocatable executables.
2001         (_bfd_elf_link_renumber_dynsyms): Ditto.
2002         (bfd_elf_final_link): Ditto.
2003         * elf32-arm.c (elf32_arm_final_link_relocate): Copy absolute
2004         relocations into relocatable executables.
2005         (elf32_arm_check_relocs): Crate dynamic sections for relocatable
2006         executables.  Also copy absolute relocations.
2007         (elf32_arm_adjust_dynamic_symbol): Don't create copy relocations
2008         in relocatable executables.
2009         (allocate_dynrelocs): Copy relocations for relocatable executables.
2010         Output dynamic symbols for symbols defined in linker scripts.
2011
2012 2005-02-11  Nick Clifton  <nickc@redhat.com>
2013
2014         * libbfd.c (read_signed_leb128): Use an unsigned type for 'shift'
2015         to avoid a compile time warning.
2016
2017         * coff-alpha.c (alpha_adjust_reloc_in): Remove redundant test from
2018         BFD_ASSERT.
2019
2020         * coff-tic4x.c (coff_rtype_to_howto): Move definition before
2021         inclusion of coffcode.h so that it is actually picked up.
2022
2023         * coffcode.h (coff_std_swap_table): Add an unused attribute in
2024         case it is not used.
2025
2026         * elf32-ip2k.c (ip2k_call_opcode, IS_CALL_OPCODE): Remove unused
2027         structure and macro.
2028
2029         * elf32-iq2000.c (iq2000_reloc_map): Remove unused structure and
2030         array.
2031
2032         * elf32-m32r.c (m32r_reloc_map_old): Use #ifdef USE_M32R_OLD_RELOC
2033         to protect the declaration of this array.
2034
2035         * xsym.c (bfd_sym_parse_contained_variables_table_entry_v32):
2036         Avoid call to memcpy with a size of 0.
2037
2038 2005-02-12  Alan Modra  <amodra@bigpond.net.au>
2039
2040         * elf64-ppc.c (toc_adjusting_stub_needed): Return true for
2041         old-style branches to undefined dot-symbols which will be
2042         satisfied by a plt call.
2043
2044 2005-02-11  Alan Modra  <amodra@bigpond.net.au>
2045
2046         * elf64-ppc.c (move_plt_plist): New function, extracted from..
2047         (ppc64_elf_copy_indirect_symbol): ..here.
2048         (func_desc_adjust): Use move_plt_plist.
2049
2050 2005-02-10  Paul Brook  <paul@codesourcery.com>
2051
2052         * elf32-arm.c (elf32_arm_final_link_relocate): Handle R_ARM_THM_PC9.
2053
2054 2005-02-10  Paul Brook  <paul@codesourcery.com>
2055
2056         * elflink.c (bfd_elf_record_link_assignment): Make hidden and internal
2057         symbols local.
2058         (elf_link_renumber_hash_table_dynsyms): Ignore local symbols.
2059         (elf_link_renumber_local_hash_table_dynsyms): New function.
2060         (_bfd_elf_link_renumber_dynsyms): Number local dynamic symbols.
2061
2062 2005-02-10  Jakub Jelinek  <jakub@redhat.com>
2063
2064         * bfd-in.h (BFD_LINKER_CREATED): Define.
2065         * bfd-in2.h: Rebuilt.
2066         * elflink.c (bfd_elf_size_dynamic_sections): Disregard
2067         BFD_LINKER_CREATED bfds when determining input bfds without
2068         .note.GNU-stack section.
2069
2070 2005-02-10  Maciej W. Rozycki  <macro@mips.com>
2071
2072         * elf64-mips.c (mips16_gprel_reloc): Update a comment.
2073         * elfn32-mips.c (mips16_gprel_reloc): Keep R_MIPS16_GPREL
2074         relocations against external symbols unchanged.
2075
2076 2005-02-08  Paul Brook  <paul@codesourcery.com>
2077
2078         * elflink.c (elf_link_input_bfd): Ignore symbols from null input
2079         sections.
2080
2081 2005-02-08  Hans-Peter Nilsson  <hp@axis.com>
2082
2083         * elflink.c (elf_link_add_object_symbols): Don't add "warning: "
2084         prefix here.
2085
2086 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
2087
2088         * elf64-mips.c: Fix formatting throughout.
2089
2090 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
2091
2092         * elfn32-mips.c (elf_mips_howto_table_rela): Fix a comment typo.
2093
2094 2005-02-07  Alexandre Oliva  <aoliva@redhat.com>
2095
2096         * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove special handling for
2097         *ABS*/*UND* sections.
2098         (elf32_frv_relocate_section): Move zero-addend-required error...
2099         (_frv_emit_got_relocs_plt_entries): ... here.  Report error for
2100         missing needed TLS section.
2101
2102 2005-02-07  Hans-Peter Nilsson  <hp@axis.com>
2103
2104         * aoutx.h (NAME(aout,find_nearest_line)): Correct case for N_SO
2105         being the last symbol.
2106         (aout_link_add_symbols): Just return TRUE if a warning
2107         symbol was last.
2108
2109 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
2110
2111         * elf32-mips.c (mips_elf_gprel32_reloc): Reject
2112         R_MIPS_GPREL32 relocations against external symbols.
2113         * elf64-mips.c (mips_elf64_gprel32_reloc): Replace an incorrect
2114         comment.
2115
2116 2005-02-07  Alan Modra  <amodra@bigpond.net.au>
2117
2118         * elf-bfd.h (elf_string_from_elf_strtab): Delete macro.
2119         * elf.c (bfd_elf_string_from_elf_section): Expand occurrence of
2120         elf_string_from_elf_strtab.
2121         (_bfd_elf_setup_group_pointers, bfd_section_from_shdr): Likewise.
2122         (bfd_section_from_shdr): For SHT_SYMTAB, load SHT_SYMTAB_SHNDX too
2123         if it exists.  Don't do the reverse for SHT_SYMTAB_SHNDX.  For
2124         SHT_STRTAB, check whether the strtab is for symtab or dynsymtab by
2125         looking at cached symtab info first, before iterating over headers.
2126         For SHT_REL and SHT_RELA, load dynsymtab if needed.
2127         * elfcode.h (elf_object_p): Don't load section header stringtab
2128         specially.
2129
2130 2005-02-06  H.J. Lu  <hongjiu.lu@intel.com>
2131
2132         * elf32-i386.c (elf_i386_relocate_section): Disallow R_386_GOTOFF
2133         against protected function when building shared library.
2134
2135         PR 584
2136         * elf64-x86-64.c (is_32bit_relative_branch): New.
2137         (elf64_x86_64_relocate_section): Alllow R_X86_64_PC32 on a
2138         protected function symbol when building shared library for
2139         32bit relative branch instruction.
2140
2141 2005-02-06  Alan Modra  <amodra@bigpond.net.au>
2142
2143         * elf64-ppc.c (add_symbol_adjust): Don't create fake descriptor
2144         syms when doing a relocatable link.
2145         (ppc64_elf_gc_mark_hook): Check that syms are defined before looking
2146         at u.def.section.
2147         (ppc64_elf_tls_setup): Likewise.
2148         (ppc64_elf_edit_opd): Don't use an undefined func desc sym.
2149
2150 2005-02-04  Alan Modra  <amodra@bigpond.net.au>
2151
2152         * elf64-ppc.c (struct ppc_link_hash_entry): Add "fake".
2153         (link_hash_newfunc): Clear all locals using memset.
2154         (make_fdh): Remove flags param.  Always create fake func desc
2155         weak.  Link the descriptor with the code entry sym.
2156         (ppc64_elf_archive_symbol_lookup): Don't return fake syms.
2157         (add_symbol_adjust): Adjust make_fdh call.
2158         (func_desc_adjust): Likewise.  Twiddle any pre-existing fake
2159         descriptor to strong undefined if code entry is strong.
2160
2161 2005-02-04  Alan Modra  <amodra@bigpond.net.au>
2162
2163         * elflink.c (bfd_elf_record_link_assignment): Do "provide" symbol
2164         lookup here.  Set to new before calling bfd_link_repair_undef_list.
2165         (elf_smash_syms): Check that u.undef.weak isn't the not_needed bfd.
2166
2167 2005-02-03  Alan Modra  <amodra@bigpond.net.au>
2168
2169         * linker.c (_bfd_link_hash_newfunc): Set all local fields.
2170
2171 2005-02-03  Alan Modra  <amodra@bigpond.net.au>
2172
2173         * linker.c (_bfd_generic_link_add_one_symbol): Set u.undef.weak.
2174         * elflink.c (elf_smash_syms): Restore symbols that were undefweak
2175         before the as-needed lib was loaded.  Abort on unexpected refs.
2176
2177 2005-02-02  Alan Modra  <amodra@bigpond.net.au>
2178
2179         * elflink.c (elf_smash_syms): Expand comments.
2180         (elf_link_add_object_symbols): Only call elf_smash_syms for
2181         as-needed dynamic objects.
2182
2183         * elfxx-ia64.c (elfNN_ia64_new_elf_hash_entry): Don't clear
2184         everything, just the field specific to ia64.
2185         * elf64-hppa.c (elf64_hppa_new_dyn_hash_entry): Likewise.
2186
2187 2005-02-01  Alan Modra  <amodra@bigpond.net.au>
2188
2189         * elf64-ppc.c (func_desc_adjust): Move code creating func desc sym to..
2190         (make_fdh): ..here.  New function.  Don't set BSF_OBJECT for
2191         undefined syms.
2192         (struct add_symbol_adjust_data): New.
2193         (add_symbol_adjust): Make an undefweak func desc for old ABI
2194         objects to link with --as-needed shared libs.  Return fail status.
2195         Don't adjust old ABI func entry sym to weak if func desc syms
2196         isn't defined.
2197         (ppc64_elf_check_directives): Adjust call to add_symbol_adjust,
2198         and return status.
2199
2200 2005-02-01  Hans-Peter Nilsson  <hp@axis.com>
2201
2202         * cpu-cris.c (get_compatible): Rearrange disabled code and comment
2203         for clarity.
2204
2205 2005-02-01  Alan Modra  <amodra@bigpond.net.au>
2206
2207         * elf64-ppc.c (ppc64_elf_check_directives): Move undefs list fixup..
2208         * linker.c (bfd_link_repair_undef_list): ..to new function, but don't
2209         remove anything but new and undefweak.
2210         * elflink.c (_bfd_elf_link_create_dynamic_sections): Override any
2211         existing _DYNAMIC.
2212         (_bfd_elf_create_dynamic_sections): Formatting.
2213         (bfd_elf_record_link_assignment): Call bfd_link_repair_undef_list.
2214         (_bfd_elf_merge_symbol): Don't handle as-needed syms here.
2215         (struct elf_smash_data): New.
2216         (elf_smash_syms): New function.
2217         (elf_link_add_object_symbols): Call elf_smash_syms.  Don't add
2218         unneeded dynamic objects to loaded list.
2219         (elf_link_output_extsym): Don't handle as-needed here.  Strip
2220         bfd_link_hash_new symbols.
2221         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
2222         delref when dynindx is already -1.
2223         * elf64-alpha.c (elf64_alpha_output_extsym): Strip bfd_link_hash_new
2224         symbols.
2225         * elfxx-mips.c (mips_elf_output_extsym): Likewise.
2226
2227 2005-02-01  Ben Elliston  <bje@au.ibm.com>
2228
2229         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Redefine.
2230
2231 2005-02-01  Ben Elliston  <bje@au.ibm.com>
2232
2233         * aout-arm.c, aout-target.h, aoutx.h, archive.c, armnetbsd.c,
2234         bfd-in.h, bfdio.c, coff-alpha.c, coff-arm.c, coff-h8300.c,
2235         coff-i860.c, coff-mcore.c, coff-or32.c, coff-ppc.c, coff-sh.c,
2236         coff-sparc.c, coffcode.h, coffgen.c, cofflink.c, cpu-cris.c,
2237         cpu-h8500.c, cpu-ns32k.c, ecoff.c, ecofflink.c, elf.c,
2238         elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-hppa.c,
2239         elf32-i860.c, elf32-ip2k.c, elf32-m32r.c, elf32-sh.c,
2240         elf32-v850.c, elf64-mips.c, elf64-sparc.c, elflink.c,
2241         i386aout.c, i386msdos.c, i386os9k.c, ieee.c, mach-o.c,
2242         nlm32-sparc.c, oasys.c, opncls.c, pdp11.c, pe-mips.c, peXXigen.c,
2243         pef.c, peicode.h, reloc.c, riscix.c, section.c, simple.c, som.c,
2244         sparclynx.c, targets.c, vms-misc.c, vms-tir.c, xsym.c,
2245         hosts/delta68.h, hosts/vaxbsd.h: Remove #if 0'd code
2246         throughout. Similarly, collapse #if 1'd code.
2247
2248 2005-02-01  Ben Elliston  <bje@au.ibm.com>
2249
2250         * elf-bfd.h (bfd_elf_discard_group): Remove.
2251         * elf.c (bfd_elf_discard_group): Likewise.
2252         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Remove macro.
2253
2254 2005-01-31  Richard Sandiford  <rsandifo@redhat.com>
2255
2256         * elf-bfd.h (elf_backend_data): Add elf_backend_eh_frame_address_size.
2257         (_bfd_elf_eh_frame_address_size): Declare.
2258         * elfxx-target.h (elf_backend_eh_frame_address_size): Define a default.
2259         (elfNN_bed): Initialize elf_backend_eh_frame_address_size.
2260         * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Declare.
2261         (elf_backend_eh_frame_address_size): Define.
2262         * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): New function.
2263         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Get the address
2264         size from the new backend hook.
2265         (_bfd_elf_write_section_eh_frame): Likewise.
2266         (_bfd_elf_eh_frame_address_size): New function.
2267
2268 2005-01-31  Andrew Cagney  <cagney@gnu.org>
2269
2270         * configure: Regenerate to track ../gettext.m4.
2271
2272 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
2273
2274         * elf32-arm.c (elf32_arm_symbian_special_sections): Do not set
2275         SHF_WRITE for .init_array, .fini_array, and .preinit_array.
2276
2277 2005-01-31  Nick Clifton  <nickc@redhat.com>
2278
2279         * confg.bfd: Make targets scheduled for obsoletion (m68k-lynxos,
2280         sparc-lynxos, vax-vms) be obsolete.
2281
2282 2005-01-28  Daniel Jacobowitz  <dan@codesourcery.com>
2283
2284         * elf-bfd.h (struct elf_backend_data): Add minpagesize.
2285         * elf32-arm.c (ELF_MINPAGESIZE): Define.
2286         * elf32-ppc.c (ELF_MINPAGESIZE): Define.
2287         * elfcode.h (elf_object_p): Use minpagesize instead of
2288         maxpagesize.
2289         * elfxx-target.h (ELF_MINPAGESIZE): Default to ELF_MAXPAGESIZE.
2290         (elfNN_bed): Include ELF_MINPAGESIZE.
2291
2292 2005-01-28  Julian Brown  <julian@codesourcery.com>
2293
2294         * bin-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
2295         * bin-in2.h (bfd_elf32_arm_set_target_relocs): Update prototype.
2296         * elf32-arm.c (elf32_arm_link_hash_table): Add fix_v4bx flag.
2297         (bfd_elf32_arm_set_target_relocs): Add formal parameter fix_v4bx for
2298         passing flag value from ld. Set flag value in global hash table entry.
2299         (elf32_arm_final_link_relocate): Add code to implement R_ARM_V4BX
2300         relocation.
2301
2302 2005-01-27  Andrew Cagney  <cagney@gnu.org>
2303
2304         * configure: Regenerate to track ../gettext.m4 change.
2305
2306 2005-01-25  Mark Mitchell  <mark@codesourcery.com>
2307
2308         * elf32-arm.c (elf_backend_default_use_rela_p): Define to zero for
2309         SymbianOS.
2310
2311 2005-01-25  Alexandre Oliva  <aoliva@redhat.com>
2312
2313         2004-12-10  Alexandre Oliva  <aoliva@redhat.com>
2314         * elf32-frv.c (elf32_frv_relocate_section): Force local binding
2315         for TLSMOFF.
2316         * reloc.c: Add R_FRV_TLSMOFF.
2317         * elf32-frv.c (elf32_frv_howto_table): Likewise.
2318         (frv_reloc_map, frv_reloc_type_lookup): Map it.
2319         (elf32_frv_relocate_section): Handle it.
2320         (elf32_frv_check_relocs): Likewise.
2321         * libbfd.h, bfd-in2.h: Rebuilt.
2322         2004-11-26  Alexandre Oliva  <aoliva@redhat.com>
2323         * elf32-frv.c (_frvfdpic_emit_got_relocs_plt_entries): Don't crash
2324         when given an undefweak TLS symbol.  Fix constant TLS PLT entries
2325         such that they return the constant in gr9.
2326         (_frvfdpic_relax_tls_entries): Don't crash for undefweak TLS
2327         symbols.
2328         (_frvfdpic_size_got_plt): Set _cooked_size of dynamic sections.
2329         too, such that they shrink on relaxation.
2330         (elf32_frvfdpic_finish_dynamic_sections): Check __ROFIXUP_END__ as
2331         marking the position right past the _GLOBAL_OFFSET_TABLE_ value.
2332         (_frvfdpic_assign_plt_entries): Shrink constant TLS PLT entries
2333         if we can guarantee the use of 16-bit constants.
2334         2004-11-10  Alexandre Oliva  <aoliva@redhat.com>
2335         Introduce TLS support for FR-V FDPIC.
2336         * reloc.c: Add TLS relocations.
2337         * elf32-frv.c (elf32_frv_howto_table): Add TLS relocations.
2338         (elf32_frv_rel_tlsdesc_value_howto): New.
2339         (elf32_frv_rel_tlsoff_howto): New.
2340         (frv_reloc_map): Add new mappings.
2341         (struct frvfdpic_elf_link_hash_table): Add pointer to summary
2342         reloc information.
2343         (frvfdpic_dynamic_got_plt_info): New.
2344         (frvfdpic_plt_tls_ret_offset): New.
2345         (ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE): Move earlier.
2346         (struct _frvfdpic_dynamic_got_info): Likewise.  Add TLS members.
2347         (struct _frvfdpic_dynamic_got_plt_info): Likewise.
2348         (FRVFDPIC_SYM_LOCAL): Regard symbols defined in the absolute
2349         section as local.
2350         (struct frvfdpic_relocs_info): Add TLS fields.
2351         (frvfdpic_relocs_info_hash): Warning clean up.
2352         (frvfdpic_relocs_info_find): Initialize tlsplt_entry.
2353         (frvfdpic_pic_merge_early_relocs_info): Merge TLS fields.
2354         (FRVFDPIC_TLS_BIAS): Define.
2355         (tls_biased_base): New.
2356         (_frvfdpic_emit_got_relocs_plt_entries): Deal with TLS
2357         relocations.
2358         (frv_reloc_type_lookup): Likewise.
2359         (frvfdpic_info_to_howto_rel): Likewise.
2360         (elf32_frv_relocate_section): Likewise.
2361         (_frv_create_got_section): Create the PLT section here.
2362         (elf32_frvfdpic_create_dynamic_sections): Not here.
2363         (_frvfdpic_count_nontls_entries): Move out of...
2364         (_frvfdpic_count_got_plt_entries): ... here.
2365         (_frvfdpic_count_tls_entries): Likewise.  Add TLS support.
2366         (_frvfdpic_count_relocs_fixups): Likewise.  Add relaxation
2367         support.
2368         (_frvfdpic_relax_tls_entries): New.
2369         (_frvfdpic_compute_got_alloc_data): Add TLS support.
2370         (_frvfdpic_get_tlsdesc_entry): New.
2371         (_frvfdpic_assign_got_entries): Add TLS support.
2372         (_frvfdpic_assign_plt_entries): Likewise.
2373         (_frvfdpic_reset_got_plt_entries): New.
2374         (_frvfdpic_size_got_plt): Move out of...
2375         (elf32_frvfdpic_size_dynamic_sections): ... here.
2376         (_frvfdpic_relax_got_plt_entries): New.
2377         (elf32_frvfdpic_relax_section): New.
2378         (elf32_frvfdpic_finish_dynamic_sections): Add TLS sanity check.
2379         (elf32_frv_check_relocs): Add TLS support.
2380         (bfd_elf32_bfd_relax_section): Define for FDPIC.
2381         * libbfd.h, bfd-in2.h: Rebuilt.
2382
2383 2005-01-25  Alan Modra  <amodra@bigpond.net.au>
2384
2385         * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound): Only include
2386         loadable reloc sections.
2387         (_bfd_elf_canonicalize_dynamic_reloc): Likewise.
2388         (_bfd_elf_get_synthetic_symtab): Return 0 if no dynamic syms.
2389
2390 2005-01-25  Alan Modra  <amodra@bigpond.net.au>
2391
2392         * elflink.c (elf_link_add_object_symbols): Don't create link dynamic
2393         sections immediately when linking shared libs.  Instead, wait until
2394         we know a lib is needed.
2395         (_bfd_elf_link_create_dynstrtab): Extract from..
2396         (_bfd_elf_link_create_dynamic_sections_): ..here.
2397         (elf_add_dt_needed_tag): Call _bfd_elf_link_create_dynstrtab and
2398         _bfd_elf_link_create_dynamic_sections.  Add abfd param.  Allow
2399         for non-existent .dynamic.
2400         (elf_link_output_extsym): Don't complain about undefined symbols
2401         in as-needed dynamic libs that aren't actually linked.
2402
2403 2005-01-24  Andrew Cagney  <cagney@gnu.org>
2404
2405         * configure: Regenerate, ../gettext.m4 was updated.
2406
2407 2005-01-21  Ben Elliston  <bje@au.ibm.com>
2408
2409         * aout-encap.c: Remove unused file.
2410
2411 2005-01-19  H.J. Lu  <hongjiu.lu@intel.com>
2412
2413         PR 679
2414         * elflink.c (_bfd_elf_dynamic_symbol_p): Only protected
2415         non-function symbols are local.
2416         (_bfd_elf_symbol_refs_local_p): Likewise.
2417
2418 2005-01-18  Alan Modra  <amodra@bigpond.net.au>
2419
2420         * bfd.c (bfd_link_just_syms): Add abfd param.
2421         * bfd-in2.h: Regenerate.
2422
2423 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
2424
2425         * elf-eh-frame.c (skip_cfa_op, skip_non_nops): New functions.
2426         (_bfd_elf_discard_section_eh_frame): Use them to interpret the CFA
2427         instructions.  If the amount of padding is known, reduce the size
2428         of the CIE or FDE by that amount.
2429
2430 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
2431
2432         * elf-bfd.h (struct cie): Use bfd_vmas for code_align, ra_column and
2433         augmentation_size.  Use bfd_signed_vmas for data_align.
2434         * elf-eh-frame.c (read_uleb128, read_sleb128): Delete in favor of...
2435         (read_byte, skip_leb128, read_uleb128, read_sleb128): ...these new
2436         functions.  Don't read past the end of the enclosing CIE or FDE.
2437         (skip_bytes): New utility function.
2438         (_bfd_elf_discard_section_eh_frame): Use new functions, adding more
2439         sanity checking.
2440         (_bfd_elf_write_section_eh_frame): Use new functions.
2441
2442 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
2443
2444         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use an
2445         assert-style REQUIRE() macro to handle sanity checks.
2446
2447 2005-01-17  H.J. Lu  <hongjiu.lu@intel.com>
2448
2449         * dwarf2.c (dwarf2_debug): Move info_ptr_unit to ...
2450         (comp_unit): Here.
2451         (read_unsigned_leb128): Removed.
2452         (read_signed_leb128): Removed.
2453         (find_abstract_instance_name): Updated.
2454         (parse_comp_unit): Accept info_ptr_unit.
2455         (_bfd_dwarf2_find_nearest_line): Set info_ptr_unit for each
2456         comp unit and pass it to parse_comp_unit.
2457
2458         * elf-eh-frame.c (read_unsigned_leb128): Moved to ...
2459         (read_signed_leb128): Moved to ...
2460         * libbfd.c: Here.
2461
2462         * libbfd-in.h (read_unsigned_leb128): New prototype.
2463         (read_signed_leb128): Likewise.
2464         * libbfd.h: Regenerated.
2465
2466 2005-01-17  Andrew Stubbs  <andrew.stubbs@st.com>
2467             Nick Clifton   <nickc@redhat.com>
2468
2469         * cpu-sh.c (bfd_to_arch_table): Change arch_sh1_up to arch_sh_up,
2470         arch__sh4_nofp_up to arch_sh4_nofpu_up and arch_sh4a_nofp_up to
2471         arch_sh4a_nofpu_up in order to match the external names and make the
2472         testsuite's job easier.
2473         * archuires.c: Rename bfd_mach_sh2a_fake? to more meaningful
2474         names.
2475         * bfd-in2.h: Regenerate.
2476
2477 2005-01-15  Andrew Cagney  <cagney@gnu.org>
2478
2479         * bfd.m4: New file.
2480         * acinclude.m4: Move BFD_NEED_DECLARATION,
2481         BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to
2482         the new file bfd.m4.  Include ../bfd/bfd.m4.
2483         * configure: Re-generate.
2484
2485 2005-01-12  Alan Modra  <amodra@bigpond.net.au>
2486
2487         * elf32-ppc.c (ppc_elf_howto_raw): Delete RELAX32* entries.
2488         (ppc_elf_relax_section): Use PLT variants of RELAX32 relocs for
2489         reaching PLT.
2490         (ppc_elf_relocate_section): Handle R_PPC_RELAX32_PLT and
2491         R_PPC_RELAX32PC_PLT.
2492
2493 2005-01-11  Alan Modra  <amodra@bigpond.net.au>
2494
2495         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Follow indirect and warning
2496         symbols.
2497         * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
2498         * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
2499         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
2500         * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
2501         * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
2502         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
2503         * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
2504         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
2505         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
2506         * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.
2507         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
2508         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
2509         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
2510         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
2511
2512 2005-01-11  Alan Modra  <amodra@bigpond.net.au>
2513
2514         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Correct
2515         .dynsbss flags.
2516
2517 2005-01-10  Inderpreet Singh <inderpreetb@noida.hcltech.com>
2518
2519         * archures.c: Define bfd_mach_maxq10 and bfd_mach_maxq20.
2520         * bfd-in2.h:  Regenerate.
2521         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Add code
2522         to support these new machine values.
2523         * cpu-maxq.c (bfd_maxq10_arch): New architecture definition for
2524         the maxq10.
2525         (bfd_maxq_arch): Update values for the maxq20.
2526
2527 2005-01-10  Eric Botcazou  <ebotcazou@libertysurf.fr>
2528
2529         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): When linking a
2530         non-shared object, do not reserve space in .plt and .rela.plt for
2531         regular symbols neither defined nor referenced in shared objects.
2532
2533 2005-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
2534
2535         * elf32-sparc.c (elf32_sparc_link_hash_table_create): Use bfd_zmalloc
2536         to zero the structure.
2537         (create_got_section): Use BFD_ASSERT instead of abort.
2538         * elf64-sparc.c (struct sparc64_elf_link_hash_table): New 'sgot' and
2539         'srelgot' fields.
2540         (create_got_section): New function.
2541         (sparc64_elf_create_dynamic_sections): Likewise.
2542         (sparc64_elf_check_relocs): Invoke create_got_section instead of
2543         _bfd_elf_create_got_section.  Use the sgot and srelgot shortcuts.
2544         (sparc64_elf_size_dynamic_sections): Use the srelgot shortcut.
2545         (sparc64_elf_relocate_section): Use the sgot and srelgot shortcuts.
2546         (sparc64_elf_finish_dynamic_symbol): Likewise.
2547         (sparc64_elf_finish_dynamic_sections): Use the sgot shortcut.
2548         (elf_backend_create_dynamic_sections): Define to
2549         sparc64_elf_create_dynamic_sections.
2550
2551 2005-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
2552
2553         * elf32-sparc.c (elf32_sparc_omit_section_dynsym): New function.
2554         (elf_backend_omit_section_dynsym): Define to it.
2555         * elf64-sparc.c (sparc64_elf_omit_section_dynsym): New function.
2556         (elf_backend_omit_section_dynsym): Define to it.
2557
2558 2005-01-07  Jakub Jelinek  <jakub@redhat.com>
2559
2560         * bfd/elf.c (INCLUDE_SECTION_IN_SEGMENT): Don't put empty sections into
2561         PT_DYNAMIC segment, unless .dynamic.
2562
2563 2005-01-06  Paul Brook  <paul@codesourcery.com>
2564
2565         * config.bfd: Add entry for arm-*-vxworks and arm-*-windiss.
2566         * configure.in: Add bfd_elf32_{big,little}arm_vxworks_vec.
2567         * configure: Regenerate.
2568         * elf32-arm.c: Add VxWorks target bfd.
2569         (USE_REL): Remove.
2570         (elf32_arm_link_hash_table): Add use_rel.
2571         (elf32_arm_link_hash_table_create, elf32_arm_final_link_relocate,
2572         elf32_arm_relocate_section): Replace USE_REL with runtime check.
2573         Correct offset calculation for RELA case.
2574         (elf_backend_may_use_rel_p, elf_backend_may_use_rela_p,
2575         elf_backend_default_use_rela_p, elf_backend_rela_normal): Define.
2576         (elf32_arm_vxworks_link_hash_table_create): New function.
2577         * targets.c (bfd_elf32_bigarm_vxworks_vec): Add declaration.
2578         (bfd_elf32_littlearm_vxworks_vec): Ditto.
2579         (_bfd_target_vector): Add bfd_elf32_{big,little}arm_vxworks_vec.
2580
2581 2005-01-06  Alan Modra  <amodra@bigpond.net.au>
2582
2583         * elf64-ppc.c (struct ppc_link_hash_table): Add no_multi_toc and
2584         multi_toc_needed.
2585         (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Define.
2586         (ppc64_elf_check_relocs): Update references to has_gp_reloc.
2587         (ppc64_elf_setup_section_lists): Add no_multi_toc parm, set htab bit.
2588         (ppc64_elf_next_toc_section): Heed no_multi_toc.
2589         (ppc64_elf_reinit_toc): Set multi_toc_needed.
2590         (toc_adjusting_stub_needed): Rewrite.
2591         (ppc64_elf_next_input_section): Use multi_toc_needed to shortcut
2592         toc tests.  Adjust for toc_adjusting_stub_needed changes.
2593         (ppc64_elf_size_stubs): Update references to has_gp_reloc.
2594         * elf64-ppc.h (ppc64_elf_setup_section_lists): Update prototype.
2595         * section.c: Expand comment on backend bits.
2596         * bfd-in2.h: Regenerate.
2597         * libbfd.h: Regenerate.
2598
2599 2005-01-06  Alan Modra  <amodra@bigpond.net.au>
2600
2601         * elf64-ppc.c (ppc64_elf_size_stubs): When determining need for
2602         toc adjusting stub, do not test source section flags.
2603
2604 2005-01-05  Eric Botcazou  <ebotcazou@libertysurf.fr>
2605
2606         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
2607         from STABS debugging sections again.
2608
2609 2005-01-05  Fred Fish  <fnf@specifixinc.com>
2610
2611         * dwarf2.c (struct dwarf2_debug): Add info_ptr_unit member.
2612         (find_abstract_instance_name): New function.
2613         (scan_unit_for_functions): Handle DW_TAG_inlined_subroutine.
2614         (scan_unit_for_functions): Handle DW_AT_abstract_origin.
2615         (_bfd_dwarf2_find_nearest_line): Initialize info_ptr_unit.
2616
2617 2004-12-31  Paul Brook  <paul@copdesourcery.com>
2618
2619         * elf32-arm.c (elf32_arm_symbian_plt_entry): Fix comment typo.
2620
2621 2004-12-31  Alan Modra  <amodra@bigpond.net.au>
2622
2623         * reloc.c (BFD_RELOC_AVR_LDI, BFD_RELOC_AVR_6, BFD_RELOC_AVR_6_ADIW):
2624         Commit missing changes from 2004-12-22.
2625         * bfd-in2.h: Regenerate.
2626
2627 2004-12-23  Tomer Levi  <Tomer.Levi@nsc.com>
2628
2629         * elf32-crx.c (elf32_crx_relax_section): Support 'bcop' relaxation.
2630
2631 2004-12-21  Kris Warkentin  <kewarken@qnx.com>
2632
2633         * elf.c (elfcore_grok_nto_gregs): Change name to elfcore_grok_nto_regs.
2634         Add 'base' argument for constructing register sections.  Reformat.
2635         (elfcore_grok_nto_note): Call elfcore_grok_nto_regs for both
2636         gp and fp regs.  Reformat.
2637
2638 2004-12-22  Klaus Rudolph  <lts-rudolph@gmx.de>
2639
2640         * reloc.c: Add new relocs R_AVR_LDI, R_AVR_6, R_AVR_6_ADIW.
2641         * bfd-in2.h: Regenerate.
2642         * elf32-avr.c (elf_avr_nowto_table): Add the new relocs.
2643         (avr_reloc_map): Likewise.
2644         (avr_final_link_relocate): Likewise.
2645
2646 2004-12-22  Alan Modra  <amodra@bigpond.net.au>
2647
2648         * elflink.c (_bfd_elf_merge_symbol): Treat old definitions from
2649         as-needed dynamic libs as undefined.
2650         (elf_link_add_object_symbols): Remove DYN_AS_NEEDED from as-needed
2651         libs when finding they are needed.
2652
2653 2004-12-20  Alan Modra  <amodra@bigpond.net.au>
2654
2655         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add opd_relocs.
2656         (opd_entry_value): Use opd_relocs if available.
2657         (ppc64_elf_relocate_section): Don't set reloc_done.  Instead
2658         copy .opd relocations to opd_relocs.
2659         (ppc64_elf_edit_toc): Set rel_hdr.sh_size after editing relocs.
2660
2661 2004-12-16  Richard Sandiford  <rsandifo@redhat.com>
2662
2663         * reloc.c (BFD_RELOC_V850_LO16_SPLIT_OFFSET): New bfd_reloc_code_type.
2664         * elf32-v850.c (v850_elf_howto_table): Add entry for
2665         R_V850_LO16_SPLIT_OFFSET.
2666         (v850_elf_reloc_map): Map it to BFD_RELOC_V850_LO16_SPLIT_OFFSET.
2667         (v850_elf_perform_lo16_relocation): New function, extracted from...
2668         (v850_elf_perform_relocation): ...here.  Use it to handle
2669         R_V850_LO16_SPLIT_OFFSET.
2670         (v850_elf_check_relocs, v850_elf_final_link_relocate): Handle
2671         R_V850_LO16_SPLIT_OFFSET.
2672         * libbfd.h, bfd-in2.h: Regenerate.
2673
2674 2004-12-14  P.J. Darcy  <darcypj@us.ibm.com>
2675
2676         * config.bfd: Add s390x-ibm-tpf support.
2677
2678 2004-12-14  Tomer Levi  <Tomer.Levi@nsc.com>
2679
2680         * elf32-crx.c (elf32_crx_relax_delete_bytes): Add 'struct bfd_link_info *'
2681         to prototype, to make hash info available.
2682         Prevent wrapped symbols from being adjusted twice.
2683
2684 2004-12-14  Richard Sandiford  <rsandifo@redhat.com>
2685
2686         * elfxx-mips.c (mips_elf_calculate_relocation): Don't report an
2687         overflow for calls to undefined weak symbols.
2688
2689 2004-12-11  Alan Modra  <amodra@bigpond.net.au>
2690
2691         * elfcode.h (elf_slurp_symbol_table): Use bfd_elf_sym_name so that
2692         canonical sections syms have a name.
2693
2694 2004-12-11  Alan Modra  <amodra@bigpond.net.au>
2695
2696         * elf64-ppc.c (opd_entry_value): Don't use cached relocs if they
2697         have been adjusted for output.
2698         (ppc64_elf_relocate_section): Mark sections with reloc_done.
2699
2700 2004-12-10  Alan Modra  <amodra@bigpond.net.au>
2701
2702         * elf.c (bfd_elf_sym_name): Rename from bfd_elf_local_sym_name and
2703         add symtab_hdr param.
2704         (group_signature): Update calls.
2705         * elf-bfd.h (bfd_elf_sym_name): Update.
2706         * elf32-ppc.c (ppc_elf_relocate_section): Update.
2707         * elf64-ppc.c (ppc64_elf_edit_opd, ppc64_elf_edit_toc): Update.
2708         (ppc64_elf_relocate_section): Update.
2709         * elflink.c (elf_link_input_bfd): Update.
2710
2711 2004-12-10  Jakub Jelinek  <jakub@redhat.com>
2712
2713         * elf.c (bfd_elf_local_sym_name): Avoid crashes with invalid
2714         st_shndx on STT_SECTION sections.
2715
2716 2004-12-09  Daniel Jacobowitz  <dan@codesourcery.com>
2717
2718         * elfcode.h (elf_slurp_reloc_table_from_section): Don't canonicalize
2719         ELF section symbols.
2720
2721 2004-12-09  Ian Lance Taylor  <ian@wasabisystems.com>
2722
2723         * elfxx-mips.c (mips_elf_calculate_relocation): For R_MIPS_JALR,
2724         return a real value, unless it is a PLT symbol.
2725         (mips_elf_perform_relocation): On the RM9000, turn a jal into a
2726         bal if possible.
2727
2728         * elfn32-mips.c (elf_mips_howto_table_rela): Change dst_mask of
2729         R_MIPS_JALR entry to 0.
2730
2731         * archures.c: Define bfd_mach_mips9000.
2732         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_9000.
2733         (mips_set_isa_flags): Handle bfd_mach_mips9000.
2734         * cpu-mips.c (I_mips9000): Define.
2735         (arch_info_struct): Add case for bfd_mach_mips9000.
2736         * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mips9000.
2737         * bfd-in2.h: Regenerate.
2738
2739 2004-12-08  Ian Lance Taylor  <ian@wasabisystems.com>
2740
2741         * elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26
2742         overflow.
2743
2744 2004-12-07  Ben Elliston  <bje@gnu.org>
2745
2746         * netbsd-core.c (netbsd_core_file_p): Make `i' unsigned.
2747
2748 2004-12-06  Daniel Jacobowitz  <dan@debian.org>
2749
2750         Suggested by Fergal Daly <fergal@esatclear.ie>:
2751         * simple.c (simple_dummy_multiple_definition): New function.
2752         (bfd_simple_get_relocated_section_contents): Use it.
2753
2754 2004-12-03  Jan Beulich  <jbeulich@novell.com>
2755
2756         * elf.c (elf_find_function): Don't use the last file symbol ever,
2757         seen, but the last one seen prior to the symbol being reported.
2758         Don't report a filename at all for global symbols when that might
2759         be ambiguous/wrong.
2760
2761 2004-12-01  Paul Brook  <paul@codesourcery.com>
2762
2763         * elf32-arm.c (elf32_arm_copy_private_bfd_data): Set EI_OSABI.
2764         (elf32_arm_post_process_headers): Set EI_OSABI depending on ABI
2765         version.
2766
2767 2004-12-01  Paul Brook  <paul@codesourcery.com>
2768
2769         * elflink.c (elf_link_add_object_symbols): Make symbols from discarded
2770         sections undefined.
2771
2772 2004-11-30  Paul Brook  <paul@codesourcery.com>
2773
2774         * elf32-arm.c (struct elf32_arm_link_hash_table): Remove
2775         no_pipeline_knowledge
2776         (elf32_arm_link_hash_table_create): Ditto.
2777         (bfd_elf32_arm_process_before_allocation): Ditto.
2778         (elf32_arm_final_link_relocate): Ditto.  Remove oabi relocation
2779         handling.
2780         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
2781         prototype.
2782         * bfd-in2.h: Regenerate.
2783
2784 2004-11-30  Randolph Chung  <tausq@debian.org>
2785
2786         * elf32-hppa.c (elf32_hppa_grok_prstatus): New function.
2787         (elf32_hppa_grok_psinfo): New function.
2788         (elf_backend_grok_prstatus): Define.
2789         (elf_backend_grok_psinfo): Define.
2790
2791 2004-11-24  H.J. Lu  <hongjiu.lu@intel.com>
2792
2793         PR 574:
2794         * elfcode.h (elf_slurp_symbol_table): Handle STT_TLS.
2795
2796 2004-11-24  Paul Brook  <paul@codesourcery.com>
2797
2798         * elf.c (assign_section_numbers): Number SHT_GROUP sections first.
2799
2800 2004-11-24  Paul Brook  <paul@codesourcery.com>
2801
2802         * elf32-arm.c (elf32_arm_swap_symbol_in): New function.
2803         (elf32_arm_swap_symbol_out): New function.
2804         (elf32_arm_size_info): Add.
2805         (elf_backend_size_info): Define.
2806
2807 2004-11-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2808
2809         * hpux-core.c (hpux_core_core_file_p): Use offsetof macro in calls to
2810         make_bfd_asection.
2811
2812 2004-11-19  Alan Modra  <amodra@bigpond.net.au>
2813
2814         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Warning fix.
2815         * elf32-iq2000.c (iq2000_reloc_type_lookup): C90 function decl.
2816         * nlmcode.h (nlm_write_object_contents): Warning fix.
2817
2818 2004-11-18  Bob Wilson  <bob.wilson@acm.org>
2819
2820         * elf32-xtensa.c (ebb_propose_action): Fix argument order.
2821
2822 2004-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
2823
2824         * elf32-arm.c (PLT_THUMB_STUB_SIZE): Define.
2825         (elf32_arm_plt_thumb_stub): New.
2826         (struct elf32_arm_link_hash_entry): Add plt_thumb_refcount
2827         and plt_got_offset.
2828         (elf32_arm_link_hash_traverse): Fix typo.
2829         (elf32_arm_link_hash_table): Add obfd.
2830         (elf32_arm_link_hash_newfunc): Initialize new fields.
2831         (elf32_arm_copy_indirect_symbol): Copy plt_thumb_refcount.
2832         (elf32_arm_link_hash_table_create): Initialize obfd.
2833         (record_arm_to_thumb_glue): Mark the glue as a local ARM function.
2834         (record_thumb_to_arm_glue): Mark the glue as a local Thumb function.
2835         (bfd_elf32_arm_get_bfd_for_interworking): Verify that the
2836         interworking BFD is not dynamic.
2837         (bfd_elf32_arm_process_before_allocation): Handle R_ARM_PLT32.  Do
2838         not emit glue for PLT references.
2839         (elf32_arm_final_link_relocate): Handle Thumb functions.  Do not
2840         emit glue for PLT references.  Support the Thumb PLT prefix.
2841         (elf32_arm_gc_sweep_hook): Handle R_ARM_THM_PC22 and
2842         plt_thumb_refcount.
2843         (elf32_arm_check_relocs): Likewise.
2844         (elf32_arm_adjust_dynamic_symbol): Handle Thumb functions and
2845         plt_thumb_refcount.
2846         (allocate_dynrelocs): Handle Thumb PLT references.
2847         (elf32_arm_finish_dynamic_symbol): Likewise.
2848         (elf32_arm_symbol_processing): New function.
2849         (elf_backend_symbol_processing): Define.
2850
2851 2004-11-16  Richard Sandiford  <rsandifo@redhat.com>
2852
2853         * elf-bfd.h (eh_cie_fde): Add new fields: add_augmentation_size and
2854         add_fde_encoding.  Remove need_relative.
2855         * elf-eh-frame.c (extra_augmentation_string_bytes)
2856         (extra_augmentation_data_bytes, size_of_output_cie_fde): New functions.
2857         (_bfd_elf_discard_section_eh_frame): Consider changing the FDE encoding
2858         in cases where the CIE has no existing 'R' augmentation.  Use
2859         size_of_output_cie_fde when assigning offsets.  Use the final offset
2860         as the new section size.
2861         (_bfd_elf_eh_frame_section_offset): Remove need_relative handling.
2862         Account for any extra augmentation bytes in the returned offset.
2863         (_bfd_elf_write_section_eh_frame): Rework so that the entries are
2864         moved before being modified.  Pad growing entries with DW_CFA_nops.
2865         Add 'z' and 'R' augmentations as directed by add_augmentation_size
2866         and add_fde_encoding.
2867
2868 2004-11-15  Mark Mitchell  <mark@codesourcery.com>
2869
2870         * elf32-arm.c (elf32_arm_relocate_section): Use
2871         arm_real_reloc_type.
2872
2873 2004-11-16  Richard Sandiford  <rsandifo@redhat.com>
2874
2875         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Return early
2876         for discard relocations; don't add an R_MIPS_NONE to the main body
2877         of .rel.dyn.
2878
2879 2004-11-04  Paul Brook  <paul@codesourcery.com>
2880
2881         * elf-bfd.h (_bfd_elf_slurp_version_tables): Update prototype.
2882         * elf.c (_bfd_elf_print_private_bfd_data): Pass extra argument.
2883         (_bfd_elf_slurp_version_tables): Add extra argument.  Create extra
2884         default version definition for unversioned symbols.
2885         * elfcode.h (elf_slurp_symbol_table): Pass extra argument.
2886         * elflink.c (elf_link_add_object_symbols): Pass extra argument to
2887         _bfd_elf_slurp_version_tables.  Set default version for unversioned
2888         imported symbols.
2889
2890 2004-11-15  Paul Brook  <paul@codesourcery.com>
2891
2892         * elflink.c (elf_link_add_object_symbols): Don't assume version
2893         indices are consecutive.
2894
2895 2004-11-14  Richard Sandiford  <rsandifo@redhat.com>
2896
2897         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Deal with
2898         composite relocations against the personality data.
2899
2900 2004-11-13  Paul Brook  <paul@codesourcery.com>
2901
2902         * bfd/elf32-arm.c (elf32_arm_final_link_relocate): Resolve
2903         R_ARM_PREL31 relocations to PLT entries.
2904         (elf32_arm_relocate_section, elf32_arm_gc_sweep_hook): Ditto.
2905         (elf32_arm_check_relocs): Ditto.
2906
2907 2004-11-12  Bob Wilson  <bob.wilson@acm.org>
2908
2909         * xtensa-isa.c (xtensa_interface_class_id): New.
2910
2911 2004-11-11  Bob Wilson  <bob.wilson@acm.org>
2912
2913         * elf32-xtensa.c (property_table_compare): Remove assertion about
2914         entries with the same address and non-zero size.
2915         (xtensa_read_table_entries): Report such entries as errors.
2916
2917 2004-11-11  Mark Mitchell  <mark@codesourcery.com>
2918
2919         * elf32-arm.c (elf32_arm_final_link_relocate): Correct logic for
2920         R_ARM_RELATIVE on Symbian OS.
2921
2922 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
2923
2924         * som.c (som_bfd_print_private_bfd_data): New function.
2925         (som_object_setup): Save the auxiliary header.  Don't assume that
2926         zero is an invalid entry point for a shared library.
2927         (som_object_p): Allocate the auxiliary header on the heap.
2928
2929         * elf32-arm.c (elf32_arm_begin_write_processing): Do not use a K&R
2930         declaration.
2931         (elf32_arm_symbian_modify_segment_map): Likewise.
2932
2933 2004-11-09  Daniel Jacobowitz  <dan@debian.org>
2934
2935         From David Poole <daveml@mbuf.com>:
2936         * elf32-arm.c (elf32_arm_readonly_dynrelocs): New function.
2937         (elf32_arm_size_dynamic_sections): Call it.
2938
2939 2004-11-09  Alan Modra  <amodra@bigpond.net.au>
2940
2941         * Makefile.am (SOURCE_HFILES): Remove elf32-arm.h.
2942         (ALL_MACHINES_CFILES): Fix typo.
2943         * Makefile.in: Regenerate.
2944         * po/SRC-POTFILES.in: Regenerate.
2945
2946 2004-11-08  Mark Mitchell  <mark@codesourcery.com>
2947
2948         * elf32-arm.c (elf32_arm_final_link_relocate): When generating an
2949         R_ARM_RELATIVE relocation for Symbian OS, mention the section
2950         symbol in the relocation.
2951
2952 2004-11-08  Inderpreet Singh  <inderpreetb@nioda.hcltech.com>
2953             Vineet Sharma  <vineets@noida.hcltech.com>
2954
2955         * coff-maxq.c: New File.
2956         * cpu-maxq.c: New File.
2957         * coffcode.h: Likewise.
2958         * config.bfd: Likewise.
2959         * configure.in (maxqcoff_vec): New target vector.
2960         * Makefile.am: Add support for maxq target.
2961         * configure.in: Likewise.
2962         * archures.c:. Likewise.
2963         * targets.c: Likewise.
2964         * bfd_in2.h : Regenerated.
2965         * Makefile.in: Regenerated.
2966         * configure: Regenerated.
2967         * doc/Makefile.in: Regenerated.
2968
2969 2004-11-08  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
2970
2971         * coff-i386.c (coff_i386_reloc): Fix weak symbols.
2972         * cofflink.c (_bfd_coff_link_input_bfd): Don't process
2973         C_NT_WEAK aux entries.
2974         (_bfd_coff_generic_relocate_section): Handle undefined
2975         aliases.
2976
2977 2004-11-07  Andreas Schwab  <schwab@suse.de>
2978
2979         * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Use
2980         SYMBOL_CALLS_LOCAL and check for undefweak symbols with
2981         non-default visibility.
2982
2983 2004-11-01  Mark Mitchell  <mark@codesourcery.com>
2984
2985         * elf32-arm.c (elf32_arm_symbian_begin_write_processing): Clear
2986         D_PAGED.
2987         (elf32_arm_symbian_modify_segment_map): Don't
2988         reset includes_filehdr and includes_phdrs here.
2989
2990 2004-11-04  Daniel Jacobowitz  <dan@debian.org>
2991
2992         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Replace
2993         elfarm-nabi with elf32-arm.  Remove elfarm-oabi.
2994         (elf32-arm.lo): Replace elfarm-nabi.lo rule.  Remove elf32-arm.h
2995         dependency.
2996         * config.bfd: Move arm-*-oabi* and thumb-*-oabi* from obsolete list
2997         to a new removed list.  Remove normal configuration stanzas.
2998         * configure.in: (bfd_elf32_bigarm_vec, bfd_elf32_bigarm_symbian_vec)
2999         (bfd_elf32_littlearm_symbian_vec, bfd_elf32_littlearm_vec): Replace
3000         elfarm-nabi.lo with elf32-arm.lo.
3001         (bfd_elf32_bigarm_oabi_vec, bfd_elf32_littlearm_oabi_vec): Remove.
3002         * elf32-arm.c: Renamed from elfarm-nabi.c.  Inline elf32-arm.h.
3003         * elf32-arm.h: Remove.
3004         * elfarm-oabi.c: Remove.
3005         * targets.c (_bfd_target_vector): Remove bfd_elf32_bigarm_oabi_vec
3006         and bfd_elf32_littlearm_oabi_vec.
3007         * aclocal.m4, Makefile.in, configure, doc/Makefile.in: Regenerated.
3008
3009 2004-11-04  Hans-Peter Nilsson  <hp@axis.com>
3010
3011         * config.bfd: Support crisv32-*-* like cris-*-*.
3012         * archures.c (bfd_mach_cris_v0_v10, bfd_mach_cris_v32)
3013         (bfd_mach_cris_v10_v32): New macros.
3014         * cpu-cris.c: Tweak formatting.
3015         (get_compatible): New function.
3016         (N): New macro.
3017         (bfd_cris_arch_compat_v10_v32, bfd_cris_arch_v32): New
3018         bfd_arch_info_type:s.
3019         (bfd_cris_arch): Use bfd_mach_cris_v0_v10 for member mach,
3020         get_compatible for member compatible and link bfd_cris_arch_v32 as
3021         next.
3022         * elf32-cris.c (cris_elf_pcrel_reloc)
3023         (cris_elf_set_mach_from_flags): New functions.
3024         (cris_elf_howto_table) <R_CRIS_8_PCREL, R_CRIS_16_PCREL>
3025         <R_CRIS_32_PCREL>: Use cris_elf_pcrel_reloc.
3026         (cris_elf_grok_prstatus, cris_elf_grok_psinfo): Give correct
3027         numbers for bfd_mach_cris_v32.
3028         (PLT_ENTRY_SIZE_V32): New macro.
3029         (elf_cris_plt0_entry): Drop last comma in initializer.
3030         (elf_cris_plt0_entry_v32, elf_cris_plt_entry_v32)
3031         (elf_cris_pic_plt0_entry_v32, elf_cris_pic_plt_entry_v32): New
3032         PLT initializers.
3033         (cris_elf_relocate_section): Change all "%B(%A)" messages to
3034         "%B, section %A".
3035         (elf_cris_finish_dynamic_symbol): Do V32-specific PLT entries.
3036         (elf_cris_finish_dynamic_sections): Similar.
3037         (elf_cris_adjust_dynamic_symbol): Similar.
3038         (cris_elf_check_relocs): Change all "%B(%A)" messages to "%B,
3039         section %A".
3040         <switch with PIC relocs>: Emit error and return FALSE for
3041         bfd_mach_cris_v10_v32.
3042         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
3043         Emit warning when generating textrel reloc.
3044         (cris_elf_object_p): Call cris_elf_set_mach_from_flags.
3045         (cris_elf_final_write_processing): Set flags according to mach.
3046         (cris_elf_print_private_bfd_data): Display
3047         EF_CRIS_VARIANT_COMMON_V10_V32 and EF_CRIS_VARIANT_V32.
3048         (cris_elf_merge_private_bfd_data): Drop variables old_flags,
3049         new_flags.  Don't call cris_elf_final_write_processing.  Don't
3050         look at the actual elf header flags at all; use
3051         bfd_get_symbol_leading_char to check ibfd, obfd.  Trap difference
3052         in bfd_get_mach for ibfd and obfd and handle merging of compatible
3053         objects.
3054         (bfd_elf32_bfd_copy_private_bfd_data): Define.
3055         * reloc.c (BFD_RELOC_CRIS_SIGNED_8, BFD_RELOC_CRIS_UNSIGNED_8)
3056         (BFD_RELOC_CRIS_SIGNED_16, BFD_RELOC_CRIS_UNSIGNED_16)
3057         (BFD_RELOC_CRIS_LAPCQ_OFFSET): New relocs.
3058         * bfd-in2.h, libbfd.h: Regenerate.
3059
3060 2004-11-04  Alan Modra  <amodra@bigpond.net.au>
3061
3062         * elf64-ppc.h (ppc64_elf_edit_toc): Declare.
3063         * elf64-ppc.c (struct ppc_link_hash_entry <adjust_done>): Update
3064         comment.
3065         (struct adjust_toc_info): New.
3066         (adjust_toc_syms, ppc64_elf_edit_toc): New functions.
3067
3068 2004-11-03  Bob Wilson  <bob.wilson@acm.org>
3069
3070         * elf.c (assign_file_positions_for_segments): Set next_file_pos even
3071         if there are no segments.
3072
3073 2004-11-02  Daniel Jacobowitz  <dan@debian.org>
3074
3075         * config.bfd: Mark arm-*-oabi and thumb-*-oabi as obsolete.
3076
3077 2004-11-02  Nick Clifton  <nickc@redhat.com>
3078
3079         * elf32-iq2000.c: Convert to ISO C90 formatting.
3080
3081 2004-11-02  Hans-Peter Nilsson  <hp@axis.com>
3082
3083         * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_.
3084
3085 2004-10-28  H.J. Lu  <hongjiu.lu@intel.com>
3086
3087         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle weak
3088         undefined symbols for R_IA64_SECREL32MSB, R_IA64_SECREL32LSB,
3089         R_IA64_SECREL64MSB and R_IA64_SECREL64LSB.
3090
3091 2004-10-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3092
3093         * elf32-sh.c (tpoff): Take alignment into account.
3094
3095 2004-10-28  Nick Clifton  <nickc@redhat.com>
3096
3097         * elf32-iq2000.c (iq2000_elf_relocate_section): Do nothing when
3098         performing a relocatable link.
3099         (iq2000_elf_object_p): Do not set elf_bad_symtab.  This is only
3100         for MIPS ports under Irix.
3101
3102 2004-10-27  Richard Earnshaw  <rearnsha@arm.com>
3103
3104         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Handle
3105         R_ARM_CALL and R_ARM_JUMP24 as aliases of R_ARM_PC24.
3106         (elf32_arm_final_link_relocate): Ditto.
3107         (arm_add_to_rel, elf32_arm_relocate_section): Ditto.
3108         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto
3109         (elf32_arm_adjust_dynamic_symbol): Ditto.
3110         * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_CALL and
3111         R_ARM_JUMP32.  Move R_ARM_R{REL32,ABS32,PC24,BASE}...
3112         (elf32_arm_r_howto): ... To here.
3113         (elf32_arm_howto_from_type): Use elf32_arm_r_howto.
3114
3115 2004-10-26  H.J. Lu  <hongjiu.lu@intel.com>
3116
3117         PR 475
3118         * elfxx-ia64.c (elfNN_ia64_relocate_section): Correct
3119         R_IA64_SECREL32MSB, R_IA64_SECREL32LSB, R_IA64_SECREL64MSB
3120         and R_IA64_SECREL64LSB.
3121
3122 2004-10-26  Paul Brook  <paul@codesourcery.com>
3123
3124         * elflink.c (elf_finalize_dynstr): Skip shared aux structure.
3125         (bfd_elf_size_dynamic_sections): Create default version definition.
3126         (elf_link_output_extsym): Adjust for default symbol version.
3127
3128 2004-10-24  Hans-Peter Nilsson  <hp@bitrange.com>
3129
3130         * mmo.c: Adjust to ISO C.
3131
3132         * mmo.c (mmo_write_section_description): New function broken out
3133         of mmo_internal_write_section.
3134         (mmo_internal_write_section): For each of .text and .data, call
3135         mmo_write_section_description before outputting contents if it has
3136         nontrivially deducible vma or contents.
3137         (mmo_has_leading_or_trailing_zero_tetra_p): New function.
3138         (mmo_canonicalize_symtab): Adjust absolute symbols to .data
3139         symbols if found within the .data address range.
3140
3141 2004-10-24  Daniel Jacobowitz  <dan@debian.org>
3142
3143         * opncls.c (bfd_close): Return TRUE for BFD_IN_MEMORY.
3144
3145 2004-10-24  Hans-Peter Nilsson  <hp@bitrange.com>
3146
3147         * mmo.c (File Layout): Correct place of misplaced blurb about
3148         special data.
3149
3150 2004-10-22  Mark Kettenis  <kettenis@gnu.org>
3151
3152         * config.bfd: Add mips64*-*-openbsd.
3153
3154 2004-10-21  Bob Wilson  <bob.wilson@acm.org>
3155
3156         * elf32-xtensa.c (ebb_propose_action): Put declarations before
3157         statements.
3158
3159 2004-10-21  H.J. Lu  <hongjiu.lu@intel.com>
3160
3161         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.94.
3162         * configure: Regenerate.
3163
3164 2004-10-21  H.J. Lu  <hongjiu.lu@intel.com>
3165
3166         PR 463
3167         * aoutx.h (aout_link_input_section_std): Pass proper hash entry
3168         to linker reloc_overflow callback.
3169         (aout_link_input_section_ext): Likewise.
3170         (aout_link_reloc_link_order): Likewise.
3171         * coff-a29k.c (coff_a29k_relocate_section): Likewise.
3172         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
3173         Likewise.
3174         (alpha_relocate_section): Likewise.
3175         * coff-arm.c (coff_arm_relocate_section): Likewise.
3176         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
3177         * coff-h8500.c (extra_case): Likewise.
3178         * coff-i960.c (coff_i960_relocate_section): Likewise.
3179         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
3180         * coff-mips.c (mips_relocate_section): Likewise.
3181         * coff-or32.c (coff_or32_relocate_section): Likewise.
3182         * coff-ppc.c (coff_ppc_relocate_section): Likewise.
3183         * coff-rs6000.c (xcoff_ppc_relocate_section): Likewise.
3184         * coff-sh.c (sh_relocate_section): Likewise.
3185         * coff-tic80.c (coff_tic80_relocate_section): Likewise.
3186         * coff-w65.c (w65_reloc16_extra_cases): Likewise.
3187         * coff-z8k.c (extra_case): Likewise.
3188         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
3189         * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
3190         (_bfd_coff_generic_relocate_section): Likewise.
3191         * ecoff.c (ecoff_reloc_link_order): Likewise.
3192         * elf-hppa.h (elf_hppa_relocate_section): Likewise.
3193         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
3194         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
3195         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
3196         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
3197         * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
3198         * elf32-cris.c (cris_elf_relocate_section): Likewise.
3199         * elf32-crx.c (elf32_crx_relocate_section): Likewise.
3200         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
3201         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
3202         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
3203         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
3204         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
3205         * elf32-i370.c (i370_elf_relocate_section): Likewise.
3206         * elf32-i386.c (elf_i386_relocate_section): Likewise.
3207         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
3208         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
3209         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
3210         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
3211         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
3212         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
3213         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
3214         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
3215         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
3216         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
3217         * elf32-s390.c (elf_s390_relocate_section): Likewise.
3218         * elf32-sh.c (sh_elf_relocate_section): Likewise.
3219         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
3220         * elf32-v850.c (v850_elf_relocate_section): Likewise.
3221         * elf32-vax.c (elf_vax_relocate_section): Likewise.
3222         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
3223         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
3224         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
3225         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3226         * elf64-s390.c (elf_s390_relocate_section): Likewise.
3227         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
3228         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
3229         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
3230         * elflink.c (elf_reloc_link_order): Likewise.
3231         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
3232         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
3233         (_bfd_elf_mips_get_relocated_section_contents): Likewise.
3234         * linker.c (_bfd_generic_reloc_link_order): Likewise.
3235         * pdp11.c (pdp11_aout_link_input_section): Likewise.
3236         (aout_link_reloc_link_order): Likewise.
3237         * reloc.c (bfd_generic_get_relocated_section_contents):
3238         Likewise.
3239         * xcofflink.c (xcoff_reloc_link_order): Likewise.
3240         * simple.c (simple_dummy_reloc_overflow): Updated.
3241
3242 2004-10-20  Andreas Schwab  <schwab@suse.de>
3243
3244         * elf32-m68k.c (elf_m68k_plt_sym_val): New function.
3245         (elf_backend_plt_sym_val): Define.
3246
3247 2004-10-19  Danny Smith  <dannysmith@users.sourceforege.net>
3248
3249         * config.bfd: Set targ_underscore=yes for PE COFF targets
3250
3251 2004-10-19  Alan Modra  <amodra@bigpond.net.au>
3252
3253         * elf64-ppc.c (opd_entry_value): Handle --just-symbols objects.
3254         (ppc64_elf_edit_opd): Likewise.
3255
3256 2004-10-18  Mark Mitchell  <mark@codesourcery.com>
3257
3258         * elfarm-nabi.c (ELF_DYNAMIC_SEC_FLAGS): Add comment.
3259         * elflink.c (_bfd_elf_create_dynamic_sections): For a loaded PLT,
3260         set SEC_ALLOC and SEC_LOAD.
3261
3262 2004-10-18  Nick Clifton  <nickc@redhat.com>
3263
3264         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Compute
3265         'name' for relocs against both local and global symbols.
3266
3267 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
3268
3269         * bfd-in2.h: Regenerate.
3270         * bfd.c (struct bfd): Add no_export.
3271         * elflink.c (elf_link_add_object_symbols): Handle no_export.
3272
3273 2004-10-15  Alan Modra  <amodra@bigpond.net.au>
3274
3275         * config.bfd: Whitespace cleanup.
3276         * Makefile.am: Run "make dep-am"
3277         * Makefile.in: Regenerate.
3278
3279 2004-10-15  Jakub Jelinek  <jakub@redhat.com>
3280
3281         * elflink.c (struct already_linked_section): Removed.
3282         (try_match_symbols_in_sections, already_linked): Removed.
3283         (_bfd_elf_section_already_linked): Skip ^\.gnu\.linkonce\.[^.]*\.
3284         prefix of section names when finding already_linked_table
3285         chain.  Compare section names.  Instead of calling already_linked,
3286         do it inline and only for sections in the same already_linked_list.
3287
3288 2004-10-15  Alan Modra  <amodra@bigpond.net.au>
3289
3290         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Add "info"
3291         parameter.  If called after _bfd_elf_write_section_eh_frame,
3292         don't allow a -2 return unless need_* bit is already set, and
3293         handle offsets adjusted for output_offset.
3294         * elf-bfd.h (_bfd_elf_eh_frame_section_offset): Update prototype.
3295         * elf.c (_bfd_elf_section_offset): Update call.
3296
3297 2004-10-13  H.J. Lu  <hongjiu.lu@intel.com>
3298
3299         PR 440
3300         * coffcode.h (coff_compute_section_file_positions): Cast to
3301         bfd_vma when computing page alignment.
3302
3303 2004-10-13  Mark Mitchell  <mark@codesourcery.com>
3304
3305         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
3306         offsets, not VMAs, for DT_VERSYM, DT_VERDEF, DT_VERNEED.
3307
3308 2004-10-12  Mark Mitchell  <mark@codesourcery.com>
3309
3310         * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Make .rel.plt
3311         relocations use a virtual address, not a section offset.
3312
3313 2004-10-12  Bob Wilson  <bob.wilson@acm.org>
3314
3315         * elf32-xtensa.c (elf_xtensa_get_private_bfd_flags): Delete.
3316         (narrow_instruction, widen_instruction): Remove unnecessary calls to
3317         xtensa_format_encode.
3318         (ebb_propose_action): Inline call to ebb_add_proposed_action.
3319         (ebb_add_proposed_action): Delete.
3320
3321 2004-10-12  Bob Wilson  <bob.wilson@acm.org>
3322
3323         * elf32-xtensa.c: Use ISO C90 formatting.
3324
3325 2004-10-12  Paul Brook  <paul@codesourcery.com>
3326
3327         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Rephrase error
3328         message.
3329
3330 2004-10-12  Paul Brook  <paul@codesourcery.com>
3331
3332         * elf32-arm.h: Support EABI version 4 objects.
3333
3334 2004-10-12  Alan Modra  <amodra@bigpond.net.au>
3335
3336         PR 325
3337         * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Place last in chain.
3338         Don't mark as default.
3339         (bfd_x86_64_arch): Don't mark as default.
3340
3341 2004-10-12  Alan Modra  <amodra@bigpond.net.au>
3342
3343         * elflink.c (enum action_discarded): New.
3344         (elf_section_complain_discarded): Delete.
3345         (elf_action_discarded): New function subsuming the above and also
3346         controlling reloc behaviour.
3347         (elf_link_input_bfd): Use it.
3348
3349 2004-10-11  Jakub Jelinek  <jakub@redhat.com>
3350
3351         * elf.c (bfd_section_from_shdr): Handle SHT_GNU_LIBLIST.
3352         (special_sections): Add .gnu.liblist and .gnu.conflict.
3353         (assign_section_numbers): Handle SHT_GNU_LIBLIST.
3354
3355 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
3356
3357         PR 233
3358         * elflink.c (elf_link_input_bfd): Try harder to support
3359         relocations against symbols in removed linkonce sections.
3360
3361 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
3362
3363         * elflink.c (elf_link_input_bfd): Revert PR 354 change.
3364
3365         PR 354
3366         * elflink.c (elf_link_input_bfd): Check that relocs in SEC_ALLOC
3367         sections do not reference symbols in non-SEC_ALLOC sections.
3368
3369 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
3370
3371         PR 437
3372         * elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections.
3373         (_bfd_elf_link_omit_section_dynsym): Formatting.
3374
3375 2004-10-10  Alan Modra  <amodra@bigpond.net.au>
3376
3377         * libbfd-in.h (BFD_ASSERT, BFD_FAIL): Wrap macro body in do while.
3378         * libbfd.h: Regnerate.
3379         * elf32-cris.c: Add missing semicolon to BFD_ASSERTs.
3380         * elf32-frv.c: Likewise.
3381         * elf32-m32r.c: Likewise.
3382         * elf32-ppc.c: Likewise.
3383         * elf64-hppa.c: Likewise.
3384         * elfxx-ia64.c: Likewise.
3385         * opncls.c: Likewise.
3386
3387 2004-10-10  Alan Modra  <amodra@bigpond.net.au>
3388
3389         * elf-bfd.h (struct eh_frame_hdr_info): Add offsets_adjusted.
3390         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust
3391         offsets stored in struct eh_cie_fde entries before doing other
3392         work.
3393
3394         * elf-bfd.h (struct eh_cie_fde): Add cie_inf, remove sec.
3395         (struct eh_frame_hdr_info): Add last_cie_inf, remove last_cie_offset.
3396         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete code
3397         setting offsets for removed CIEs.  Don't set "sec", instead set
3398         cie_inf for FDEs.  Keep a pointer to last struct eh_cie_fde for a
3399         CIE in hdr_info.  Only set make_relative and make_lsda_relative
3400         for CIEs.  Use pointers rather than array indices.
3401         (_bfd_elf_eh_frame_section_offset): Test/set make_relative,
3402         make_lsda_relative, need_* on cie_inf for FDEs.
3403         (_bfd_elf_write_section_eh_frame): Adjust offset and new_offset for
3404         section output_offset.  Delete cie_offset, instead use cie_inf
3405         pointer to CIE entry.  Use need_relative and need_lsda_relative on
3406         CIE entry for FDEs.  Use pointers rather than array indices.
3407
3408 2004-10-09  Alan Modra  <amodra@bigpond.net.au>
3409
3410         * coff-rs6000.c (rs6000coff_vec): Add initializer for
3411         bfd_is_target_special_symbol.
3412         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
3413         * som.c (som_bfd_is_target_special_symbol): Define.
3414
3415 2004-10-08  Nick Clifton  <nickc@redhat.com>
3416
3417         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.93.
3418         * configure: Regenerate.
3419         * bfd-in2.h: Regenerate.
3420         * syms.c (bfd_is_target_special_symbol): New interface function.
3421         Returns true when a symbol should be considered to be special.
3422         * targets.c (bfd_target): Include bfd_is_target_special_symbol in
3423         the symbol jump table.
3424         * elf32-arm.h (elf32_arm_is_target_special_symbol): New function.
3425         Return true iff the symbol is a mapping symbol.
3426         (bfd_elf32_bfd_is_target_special_symbol): Define.
3427         * elfxx-target.h: Provide a default definition for
3428         bfd_is_target_special_symbol.
3429         * aout-target.h: Likewise.
3430         * aout-tic30.c: Likewise.
3431         * binary.c: Likewise.
3432         * coffcode.h: Likewise.
3433         * i386msdos.c: Likewise.
3434         * ieee.c: Likewise.
3435         * ihex.c: Likewise.
3436         * libaout.h: Likewise.
3437         * libbfd-in.h: Likewise
3438         * libecoff.h: Likewise.
3439         * mach-o.c: Likewise.
3440         * mmo.c: Likewise.
3441         * nlm-target.h: Likewise.
3442         * oasys.c: Likewise.
3443         * pef.c: Likewise.
3444         * ppcboot.c: Likewise.
3445         * srec.c: Likewise.
3446         * tekhex.c: Likewise.
3447         * versados.c: Likewise.
3448         * vms.c: Likewise.
3449         * xcoff-target.h: Likewise.
3450         * xsym.c: Likewise.
3451         * libbfd.h: Regenerate.
3452
3453 2004-10-08  Daniel Jacobowitz  <dan@debian.org>
3454
3455         * config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*.
3456         * elf64-x86-64.c (elf64_x86_64_section_from_shdr): New function.
3457         (elf_backend_section_from_shdr): Define.
3458
3459 2004-10-08  Alan Modra  <amodra@bigpond.net.au>
3460
3461         * syms.c (bfd_is_local_label): Return false for file symbols.
3462
3463 2004-10-07  Bob Wilson  <bob.wilson@acm.org>
3464             David Heine  <dlheine@tensilica.com>
3465
3466         * elf32-xtensa.c (elf32xtensa_size_opt): New global variable.
3467         (xtensa_default_isa): Global variable moved here from xtensa-isa.c.
3468         (elf32xtensa_no_literal_movement): New global variable.
3469         (elf_howto_table): Add entries for new relocations.
3470         (elf_xtensa_reloc_type_lookup): Handle new relocations.
3471         (property_table_compare): When addresses are equal, compare sizes and
3472         various property flags.
3473         (property_table_matches): New.
3474         (xtensa_read_table_entries): Extend to read new property tables.  Add
3475         output_addr parameter to indicate that output addresses should be used.
3476         Use bfd_get_section_limit.
3477         (elf_xtensa_find_property_entry): New.
3478         (elf_xtensa_in_literal_pool): Use elf_xtensa_find_property_entry.
3479         (elf_xtensa_check_relocs): Handle new relocations.
3480         (elf_xtensa_do_reloc): Use bfd_get_section_limit.  Handle new
3481         relocations.  Use new xtensa-isa.h functions.
3482         (build_encoding_error_message): Remove encode_result parameter.  Add
3483         new target_address parameter used to detect alignment errors.
3484         (elf_xtensa_relocate_section): Use bfd_get_section_limit.  Clean up
3485         error handling.  Use new is_operand_relocation function.
3486         (elf_xtensa_combine_prop_entries, elf_xtensa_merge_private_bfd_data):
3487         Use underbar macro for error messages.  Formatting.
3488         (get_const16_opcode): New.
3489         (get_l32r_opcode): Add a separate flag for initialization.
3490         (get_relocation_opnd): Operand number is no longer explicit in the
3491         relocation.  Change to decode the opcode and analyze its operands.
3492         (get_relocation_slot): New.
3493         (get_relocation_opcode): Add bfd parameter.  Use bfd_get_section_limit.
3494         Use new xtensa-isa.h functions to handle multislot instructions.
3495         (is_l32r_relocation): Add bfd parameter.  Use is_operand_relocation.
3496         (get_asm_simplify_size, is_alt_relocation, is_operand_relocation,
3497         insn_decode_len, insn_decode_opcode, check_branch_target_aligned,
3498         check_loop_aligned, check_branch_target_aligned_address, narrowable,
3499         widenable, narrow_instruction, widen_instruction, op_single_fmt_table,
3500         get_single_format, init_op_single_format_table): New.
3501         (elf_xtensa_do_asm_simplify): Add error_message parameter and use it
3502         instead of calling _bfd_error_handler.  Use new xtensa-isa.h functions.
3503         (contract_asm_expansion): Add error_message parameter and pass it to
3504         elf_xtensa_do_asm_simplify.  Replace use of R_XTENSA_OP0 relocation
3505         with R_XTENSA_SLOT0_OP.
3506         (get_expanded_call_opcode): Extend to handle either L32R or CONST16
3507         instructions.  Use new xtensa-isa.h functions.
3508         (r_reloc struct): Add new virtual_offset field.
3509         (r_reloc_init): Add contents and content_length parameters.  Set
3510         virtual_offset field to zero.  Add contents to target_offset field for
3511         partial_inplace relocations.
3512         (r_reloc_is_defined): Check for null.
3513         (print_r_reloc): New debug function.
3514         (source_reloc struct): Replace xtensa_operand field with pair of the
3515         opcode and the operand position.  Add is_abs_literal field.
3516         (init_source_reloc): Specify operand by opcode/position pair.  Set
3517         is_abs_literal field.
3518         (source_reloc_compare): When target_offsets are equal, compare other
3519         fields to make sorting predictable.
3520         (literal_value struct): Add is_abs_literal field.
3521         (value_map_hash_table struct): Add has_last_loc and last_loc fields.
3522         (init_literal_value): New.
3523         (is_same_value): Replace with ...
3524         (literal_value_equal): ... this function.  Add comparisons of
3525         virtual_offset and is_abs_literal fields.
3526         (value_map_hash_table_init): Use bfd_zmalloc.  Check for allocation
3527         failure.  Initialize has_last_loc field.
3528         (value_map_hash_table_delete): New.
3529         (hash_literal_value): Rename to ...
3530         (literal_value_hash): ... this.  Include is_abs_literal flag and
3531         virtual_offset field in the hash value.
3532         (get_cached_value): Rename to ...
3533         (value_map_get_cached_value): ... this.  Update calls to
3534         literal_value_hash and literal_value_equal.
3535         (add_value_map): Check for allocation failure.  Update calls to
3536         value_map_get_cached_value and literal_value_hash.
3537         (text_action, text_action_list, text_action_t): New types.
3538         (find_fill_action, compute_removed_action_diff, adjust_fill_action,
3539         text_action_add, text_action_add_literal, offset_with_removed_text,
3540         offset_with_removed_text_before_fill, find_insn_action,
3541         print_action_list, print_removed_literals): New.
3542         (offset_with_removed_literals): Delete.
3543         (xtensa_relax_info struct): Add is_relaxable_asm_section, action_list,
3544         fix_array, fix_array_count, allocated_relocs, relocs_count, and
3545         allocated_relocs_count fields.
3546         (init_xtensa_relax_info): Initialize new fields.
3547         (reloc_bfd_fix struct): Add new translated field.
3548         (reloc_bfd_fix_init): Add translated parameter and use it to set the
3549         translated field.
3550         (fix_compare, cache_fix_array): New.
3551         (get_bfd_fix): Remove fix_list parameter and get all relax_info for the
3552         section via get_xtensa_relax_info.  Use cache_fix_array to set up
3553         sorted fix_array and use bsearch instead of linear search.
3554         (section_cache_t): New struct.
3555         (init_section_cache, section_cache_section, clear_section_cache): New.
3556         (ebb_t, ebb_target_enum, proposed_action, ebb_constraint): New types.
3557         (init_ebb_constraint, free_ebb_constraint, init_ebb, extend_ebb_bounds,
3558         extend_ebb_bounds_forward, extend_ebb_bounds_backward,
3559         insn_block_decodable_len, ebb_propose_action, ebb_add_proposed_action):
3560         New.
3561         (retrieve_contents): Use bfd_get_section_limit.
3562         (elf_xtensa_relax_section): Add relocations_analyzed flag.  Update call
3563         to compute_removed_literals.  Free value_map_hash_table when no longer
3564         needed.
3565         (analyze_relocations): Check is_relaxable_asm_section flag.  Call
3566         compute_text_actions for all sections.
3567         (find_relaxable_sections): Mark sections as relaxable if they contain
3568         ASM_EXPAND relocations that can be optimized.  Adjust r_reloc_init
3569         call.  Increment relax_info src_count field only for appropriate
3570         relocation types.  Remove is_literal_section check.
3571         (collect_source_relocs): Use bfd_get_section_limit.  Adjust calls to
3572         r_reloc_init and find_associated_l32r_irel.  Check
3573         is_relaxable_asm_section flag.  Handle L32R instructions with absolute
3574         literals.  Pass is_abs_literal flag to init_source_reloc.
3575         (is_resolvable_asm_expansion): Use bfd_get_section_limit.  Check for
3576         CONST16 instructions.  Adjust calls to r_reloc_init and
3577         pcrel_reloc_fits.  Handle weak symbols conservatively.
3578         (find_associated_l32r_irel): Add bfd parameter and pass it to
3579         is_l32r_relocation.
3580         (compute_text_actions, compute_ebb_proposed_actions,
3581         compute_ebb_actions, check_section_ebb_pcrels_fit,
3582         check_section_ebb_reduces, text_action_add_proposed,
3583         compute_fill_extra_space): New.
3584         (remove_literals): Replace with ...
3585         (compute_removed_literals): ... this function.  Call
3586         init_section_cache.  Use bfd_get_section_limit.  Sort internal_relocs.
3587         Call xtensa_read_table_entries to get the property table.  Skip
3588         relocations other than R_XTENSA_32 and R_XTENSA_PLT.  Use new
3589         is_removable_literal, remove_dead_literal, and
3590         identify_literal_placement functions.
3591         (get_irel_at_offset): Rewrite to use bsearch on sorted relocations
3592         instead of linear search.
3593         (is_removable_literal, remove_dead_literal,
3594         identify_literal_placement): New.
3595         (relocations_reach): Update check for literal not referenced by any
3596         PC-relative relocations.  Adjust call to pcrel_reloc_fits.
3597         (coalesce_shared_literal, move_shared_literal): New.
3598         (relax_section): Use bfd_get_section_limit.  Call
3599         translate_section_fixes.  Update calls to r_reloc_init and
3600         offset_with_removed_text.  Check new is_relaxable_asm_section flag.
3601         Add call to pin_internal_relocs.  Add special handling for
3602         R_XTENSA_ASM_SIMPLIFY and R_XTENSA_DIFF* relocs.  Use virtual_offset
3603         info to calculate new addend_displacement variable.  Replace code for
3604         deleting literals with more general code to perform the actions
3605         determined by the action_list for the section.
3606         (translate_section_fixes, translate_reloc_bfd_fix): New.
3607         (translate_reloc): Check new is_relaxable_asm_section flag.  Call
3608         find_removed_literal only if is_operand_relocation.  Update call to
3609         offset_with_removed_text.  Use new target_offset and removed_bytes
3610         variables.
3611         (move_literal): New.
3612         (relax_property_section):  Use bfd_get_section_limit.  Set new
3613         is_full_prop_section flag and handle new property tables.  Update calls
3614         to r_reloc_init and offset_with_removed_text.  Check
3615         is_relaxable_asm_section flag.  Handle expansion of zero-sized
3616         unreachable entries, with use of offset_with_removed_text_before_fill.
3617         For relocatable links, combine entries only for literal tables.
3618         (relax_section_symbols): Check is_relaxable_asm_section flag.  Update
3619         calls to offset_with_removed_text.  Translate st_size field for
3620         function symbols.
3621         (do_fix_for_relocatable_link): Change to return bfd_boolean to indicate
3622         failure.  Add contents parameter.  Update call to get_bfd_fix.  Update
3623         call to r_reloc_init.  Call _bfd_error_handler and return FALSE for
3624         R_XTENSA_ASM_EXPAND relocs.
3625         (do_fix_for_final_link): Add input_bfd and contents parameters.  Update
3626         call to get_bfd_fix.  Include offset from contents for partial_inplace
3627         relocations.
3628         (is_reloc_sym_weak): New.
3629         (pcrel_reloc_fits): Use new xtensa-isa.h functions.
3630         (prop_sec_len): New.
3631         (xtensa_is_property_section): Handle new property sections.
3632         (is_literal_section): Delete.
3633         (internal_reloc_compare): When r_offset matches, compare r_info and
3634         r_addend to make sorting predictable.
3635         (internal_reloc_matches): New.
3636         (xtensa_get_property_section_name): Handle new property sections.
3637         (xtensa_get_property_predef_flags): New.
3638         (xtensa_callback_required_dependence): Use bfd_get_section_limit.
3639         Update calls to xtensa_isa_init, is_l32r_relocation, and r_reloc_init.
3640         * xtensa-isa.c (xtensa_default_isa): Moved to elf32-xtensa.c.
3641         (xtisa_errno, xtisa_error_msg): New variables.
3642         (xtensa_isa_errno, xtensa_isa_error_msg): New.
3643         (xtensa_insnbuf_alloc): Add error handling.
3644         (xtensa_insnbuf_to_chars): Add num_chars parameter.  Update to
3645         use xtensa_format_decode.  Add error handling.
3646         (xtensa_insnbuf_from_chars): Add num_chars parameter.  Decode the
3647         instruction length to find the number of bytes to copy.
3648         (xtensa_isa_init): Add error handling.  Replace calls to
3649         xtensa_load_isa and xtensa_extend_isa with code to initialize lookup
3650         tables in the xtensa_modules structure.
3651         (xtensa_check_isa_config, xtensa_add_isa, xtensa_load_isa,
3652         xtensa_extend_isa): Delete.
3653         (xtensa_isa_free): Change to only free lookup tables.
3654         (opname_lookup_compare): Replace with ...
3655         (xtensa_isa_name_compare): ... this function.  Use strcasecmp.
3656         (xtensa_insn_maxlength): Rename to ...
3657         (xtensa_isa_maxlength): ... this.
3658         (xtensa_insn_length): Delete.
3659         (xtensa_insn_length_from_first_byte): Replace with ...
3660         (xtensa_isa_length_from_chars): ... this function.
3661         (xtensa_num_opcodes): Rename to ...
3662         (xtensa_isa_num_opcodes): ... this.
3663         (xtensa_isa_num_pipe_stages, xtensa_isa_num_formats,
3664         xtensa_isa_num_regfiles, xtensa_isa_num_stages,
3665         xtensa_isa_num_sysregs, xtensa_isa_num_interfaces,
3666         xtensa_isa_num_funcUnits, xtensa_format_name, xtensa_format_lookup,
3667         xtensa_format_decode, xtensa_format_encode, xtensa_format_length,
3668         xtensa_format_num_slots, xtensa_format_slot_nop_opcode,
3669         xtensa_format_get_slot, xtensa_format_set_slot): New functions.
3670         (xtensa_opcode_lookup): Add error handling.
3671         (xtensa_decode_insn): Replace with ...
3672         (xtensa_opcode_decode): ... this function, with new format and
3673         slot parameters.  Add error handling.
3674         (xtensa_encode_insn): Replace with ...
3675         (xtensa_opcode_encode): ... this function, which does the encoding via
3676         one of the entries in the "encode_fns" array.  Add error handling.
3677         (xtensa_opcode_name): Add error handling.
3678         (xtensa_opcode_is_branch, xtensa_opcode_is_jump, xtensa_opcode_is_loop,
3679         xtensa_opcode_is_call): New.
3680         (xtensa_num_operands): Replace with ...
3681         (xtensa_opcode_num_operands): ... this function.  Add error handling.
3682         (xtensa_opcode_num_stateOperands,
3683         xtensa_opcode_num_interfaceOperands, xtensa_opcode_num_funcUnit_uses,
3684         xtensa_opcode_funcUnit_use, xtensa_operand_name,
3685         xtensa_operand_is_visible): New.
3686         (xtensa_get_operand, xtensa_operand_kind): Delete.
3687         (xtensa_operand_inout): Add error handling and special-case for
3688         "sout" operands.
3689         (xtensa_operand_get_field, xtensa_operand_set_field): Rewritten to
3690         operate on one slot of an instruction.  Added error handling.
3691         (xtensa_operand_encode): Handle default operands with no encoding
3692         functions.  Check for success by comparing against decoded value.
3693         Add error handling.
3694         (xtensa_operand_decode): Handle default operands.  Return decoded value
3695         through argument pointer.  Add error handling.
3696         (xtensa_operand_is_register, xtensa_operand_regfile,
3697         xtensa_operand_num_regs, xtensa_operand_is_known_reg): New.
3698         (xtensa_operand_isPCRelative): Rename to ...
3699         (xtensa_operand_is_PCrelative): ... this.  Add error handling.
3700         (xtensa_operand_do_reloc, xtensa_operand_undo_reloc): Return value
3701         through argument pointer.  Add error handling.
3702         (xtensa_stateOperand_state, xtensa_stateOperand_inout,
3703         xtensa_interfaceOperand_interface, xtensa_regfile_lookup,
3704         xtensa_regfile_lookup_shortname, xtensa_regfile_name,
3705         xtensa_regfile_shortname, xtensa_regfile_view_parent,
3706         xtensa_regfile_num_bits, xtensa_regfile_num_entries,
3707         xtensa_state_lookup, xtensa_state_name, xtensa_state_num_bits,
3708         xtensa_state_is_exported, xtensa_sysreg_lookup,
3709         xtensa_sysreg_lookup_name, xtensa_sysreg_name, xtensa_sysreg_number,
3710         xtensa_sysreg_is_user, xtensa_interface_lookup, xtensa_interface_name,
3711         xtensa_interface_num_bits, xtensa_interface_inout,
3712         xtensa_interface_has_side_effect, xtensa_funcUnit_lookup,
3713         xtensa_funcUnit_name, xtensa_funcUnit_num_copies): New.
3714         * xtensa-modules.c: Rewrite to use new data structures.
3715         * reloc.c (BFD_RELOC_XTENSA_DIFF8, BFD_RELOC_XTENSA_DIFF16,
3716         BFD_RELOC_XTENSA_DIFF32, BFD_RELOC_XTENSA_SLOT0_OP,
3717         BFD_RELOC_XTENSA_SLOT1_OP, BFD_RELOC_XTENSA_SLOT2_OP,
3718         BFD_RELOC_XTENSA_SLOT3_OP, BFD_RELOC_XTENSA_SLOT4_OP,
3719         BFD_RELOC_XTENSA_SLOT5_OP, BFD_RELOC_XTENSA_SLOT6_OP,
3720         BFD_RELOC_XTENSA_SLOT7_OP, BFD_RELOC_XTENSA_SLOT8_OP,
3721         BFD_RELOC_XTENSA_SLOT9_OP, BFD_RELOC_XTENSA_SLOT10_OP,
3722         BFD_RELOC_XTENSA_SLOT11_OP, BFD_RELOC_XTENSA_SLOT12_OP,
3723         BFD_RELOC_XTENSA_SLOT13_OP, BFD_RELOC_XTENSA_SLOT14_OP,
3724         BFD_RELOC_XTENSA_SLOT0_ALT, BFD_RELOC_XTENSA_SLOT1_ALT,
3725         BFD_RELOC_XTENSA_SLOT2_ALT, BFD_RELOC_XTENSA_SLOT3_ALT,
3726         BFD_RELOC_XTENSA_SLOT4_ALT, BFD_RELOC_XTENSA_SLOT5_ALT,
3727         BFD_RELOC_XTENSA_SLOT6_ALT, BFD_RELOC_XTENSA_SLOT7_ALT,
3728         BFD_RELOC_XTENSA_SLOT8_ALT, BFD_RELOC_XTENSA_SLOT9_ALT,
3729         BFD_RELOC_XTENSA_SLOT10_ALT, BFD_RELOC_XTENSA_SLOT11_ALT,
3730         BFD_RELOC_XTENSA_SLOT12_ALT, BFD_RELOC_XTENSA_SLOT13_ALT,
3731         BFD_RELOC_XTENSA_SLOT14_ALT): Add new relocations.
3732         * Makefile.am (xtensa-isa.lo, xtensa-modules.lo): Update dependencies.
3733         * Makefile.in: Regenerate.
3734         * bfd-in2.h: Likewise.
3735         * libbfd.h: Likewise.
3736
3737 2004-10-07  Richard Sandiford  <rsandifo@redhat.com>
3738
3739         * elf64-mips.c (mips_elf64_write_rel): Use STN_UNDEF for relocs
3740         against the absolute section.
3741         (mips_elf64_write_rela): Likewise.
3742
3743 2004-10-07  Jan Beulich <jbeulich@novell.com>
3744
3745         * elf.c (elf_find_function): Don't generally check for matching
3746         section, just for non-file symbols.  Remove redunant comparison
3747         for the latter.
3748         * elf32-arm.h (arm_elf_find_function): Likewise.
3749
3750 2004-10-07  Jeff Baker  <jbaker@qnx.com>
3751
3752         * elflink.c (_bfd_elf_add_dynamic_entry): Add code to warn if
3753         adding a DT_TEXTREL to a shared object and --warn-shared-textrel
3754         was specified.
3755
3756 2004-10-04  Roland McGrath  <roland@redhat.com>
3757
3758         * hash.c (bfd_hash_set_default_size): Use const for table.
3759         Use size_t instead of int for variable compared to sizeof results.
3760
3761 2004-10-05  Alan Modra  <amodra@bigpond.net.au>
3762
3763         PR 425
3764         * syms.c (_bfd_stab_section_find_nearest_line): Ignore R_*_NONE relocs.
3765
3766 2004-10-01  Paul Brook  <paul@codesourcery.com>
3767
3768         * elf32-arm.h (elf32_arm_fake_sections,
3769         is_arm_elf_unwind_section_name, elf32_arm_section_from_shdr): New
3770         functions.
3771         (elf_backend_fake_sections, elf_backend_section_from_shdr): Define.
3772
3773 2004-10-01  Alan Modra  <amodra@bigpond.net.au>
3774
3775         * elf-bfd.h (struct eh_cie_fde): Add need_relative and
3776         need_lsda_relative.
3777         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Set
3778         need_relative or need_lsda_relative if we are processing an
3779         offset for a reloc on a FDE initial loc or LSDA field
3780         respectively.
3781         (_bfd_elf_write_section_eh_frame): Test need_relative and
3782         need_lsda_relative in place of corresponding make_* field
3783         when deciding to use pc-relative encodings.
3784
3785 2004-09-30  Paul Brook  <paul@codesourcery.com>
3786
3787         * elf32-arm.h (bfd_elf32_arm_set_target_relocs): Handle "abs"
3788         target2 relocation type.
3789
3790 2004-09-30  H.J. Lu  <hongjiu.lu@intel.com>
3791
3792         PR 414
3793         * elflink.c (_bfd_elf_merge_symbol): Check TLS symbol.
3794
3795 2004-09-30  Paul Brook  <paul@codesourcery.com>
3796
3797         * reloc.c: Add BFD_RELOC_ARM_SMI.
3798         * bfd-in2.h: Regenerate.
3799         * libbfd.h: Ditto.
3800
3801 2004-09-24  Alan Modra  <amodra@bigpond.net.au>
3802
3803         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add output section
3804         vma and output offset to address.
3805         * simple.c (simple_save_output_info): Only set output section
3806         and offset for debug sections, or those not already set up by
3807         the linker.
3808         (bfd_simple_get_relocated_section_contents): Update comment.
3809
3810 2004-09-24  Alan Modra  <amodra@bigpond.net.au>
3811
3812         * elf.c (IS_LOADED): Delete.
3813         (assign_file_positions_for_segments): Just test SEC_LOAD instead.
3814         Restore SEC_HAS_CONTENTS test to the one place it was used prior
3815         to 2004-09-22.
3816
3817 2004-09-23  Alan Modra  <amodra@bigpond.net.au>
3818
3819         PR gas/396
3820         * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3821         bfd_mach_sparc_sparclet and bfd_mach_sparc_sparclite.  Remove
3822         redundant assignment of EM_SPARC.
3823
3824 2004-09-22  Brian Ford  <ford@vss.fsi.com>
3825
3826         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
3827         alignment for .rdata sections so sse[2] code works with gcc >= 3.3.3
3828         constants.
3829         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
3830
3831 2004-09-22  Alan Modra  <amodra@bigpond.net.au>
3832
3833         * elf32-ppc.c (ppc_elf_modify_segment_map): Delete.
3834         (elf_backend_modify_segment_map): Don't define.
3835
3836 2004-09-22  Alan Modra  <amodra@bigpond.net.au>
3837
3838         * elf.c (IS_LOADED): Define.
3839         (assign_file_positions_for_segments): Don't round up file offset of
3840         PT_LOAD segments containing no SEC_LOAD sections, instead round down.
3841         Delete code handling link script adjustment of lma.  Do the adjust
3842         in later code handling similar ajustments.  Remove dead code error
3843         check.  Warn if section lma would require a negative offset
3844         adjustment.  Tweak lma adjustment to use p_filesz rather than p_memsz.
3845         Use p_vaddr + p_memsz inside section loop in place of voff.  Don't
3846         update voff in section loop.  Change voff in segment loop to be an
3847         adjustment on top of "off".  Set sec->filepos and update "off" later.
3848         Test for loadable sections consistently using IS_LOADED.  Similarly,
3849         test for alloc-only sections other than .tbss consistently.
3850         Don't bother checking SEC_ALLOC in PT_LOAD segments.  Remove FIXME.
3851         Tidy PT_NOTE handling.  Use %B and %A in error messages.
3852         (assign_file_positions_except_relocs): Use %B in error message.
3853
3854 2004-09-17  H.J. Lu  <hongjiu.lu@intel.com>
3855
3856         * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9.
3857         (CONFIG_STATUS_DEPENDENCIES): New.
3858         (Makefile): Removed.
3859         (config.status): Likewise.
3860         * Makefile.in: Regenerated.
3861
3862 2004-09-17  Paul Brook  <paul@codesourcery.com>
3863
3864         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add prototype.
3865         (bfd_elf32_arm_process_before_allocation): Update prototype.
3866         * bfd-in2.h: Regenerate.
3867         * bfd/elf32-arm.h (elf32_arm_link_hash_table): Add target2_reloc.
3868         (elf32_arm_link_hash_table_create): Set it.
3869         (bfd_elf32_arm_process_before_allocation): Remove target1_is_rel.
3870         (bfd_elf32_arm_set_target_relocs): New function.
3871         (arm_real_reloc_type): New function.
3872         (elf32_arm_final_link_relocate): Use it.  Handle R_ARM_PREL31 and
3873         R_ARM_GOT_PREL.  Remove R_ARM_TARGET1.
3874         (elf32_arm_gc_sweep_hook): Ditto.
3875         (elf32_arm_check_relocs): Ditto.
3876         (elf32_arm_relocate_section): Handle R_ARM_GOT_PREL.
3877         * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_PREL31 and
3878         R_ARM_GOT_TARGET2.
3879         (elf32_arm_got_prel): New variable.
3880         (elf32_arm_howto_from_type): New function.
3881         (elf32_arm_info_to_howto): Use it.
3882         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_PREL31 and
3883         BFD_RELOC_ARM_TARGET2.
3884         * libbfd.h: Regenerate.
3885         * reloc.c: Add BFD_RELOC_ARM_TARGET2 and BFD_RELOC_ARM_PREL31.
3886
3887 2004-09-17  Alan Modra  <amodra@bigpond.net.au>
3888
3889         * ecoff.c: Update u.undef.next refs.
3890         * elf64-ppc.c: Likewise.
3891         * elflink.c: Likewise.
3892         * linker.c: Likewise.
3893         * xcofflink.c: Likewise.
3894
3895         * elf-bfd.h (struct elf_link_hash_entry): Rearrange.  Add FIXME to
3896         dynamic_def.  Combine weakdef and elf_hash_value.  Move vtable
3897         fields to indirect struct.
3898         * elf-m10300.c: Update u.weakdef refs.
3899         * elf32-arm.h: Likewise.
3900         * elf32-cris.c: Likewise.
3901         * elf32-frv.c: Likewise.
3902         * elf32-hppa.c: Likewise.
3903         * elf32-i370.c: Likewise.
3904         * elf32-i386.c: Likewise.
3905         * elf32-m32r.c: Likewise.
3906         * elf32-m68k.c: Likewise.
3907         * elf32-ppc.c: Likewise.
3908         * elf32-s390.c: Likewise.
3909         * elf32-sh.c: Likewise.
3910         * elf32-sparc.c: Likewise.
3911         * elf32-vax.c: Likewise.
3912         * elf32-xtensa.c: Likewise.
3913         * elf64-alpha.c: Likewise.
3914         * elf64-hppa.c: Likewise.
3915         * elf64-ppc.c: Likewise.
3916         * elf64-s390.c: Likewise.
3917         * elf64-sh64.c: Likewise.
3918         * elf64-sparc.c: Likewise.
3919         * elf64-x86-64.c: Likewise.
3920         * elfxx-ia64.c: Likewise.
3921         * elfxx-mips.c: Likewise.
3922         * elflink.c: Likewise.  Also u.elf_hash_value.
3923         (elf_gc_propagate_vtable_entries_used): Update for h->vtable
3924         indirection.
3925         (elf_gc_smash_unused_vtentry_relocs): Likewise.
3926         (bfd_elf_gc_record_vtinherit): Alloc vtable.
3927         (bfd_elf_gc_record_vtentry): Likewise.
3928         * elf.c (_bfd_elf_link_hash_newfunc): Use memset.
3929
3930 2004-09-17  Alan Modra  <amodra@bigpond.net.au>
3931
3932         * Makefile.am: Run "make dep-am".
3933         * Makefile.in: Regenerate.
3934         * bfd-in2.h: Regenerate.
3935         * po/SRC-POTFILES.in: Regenerate.
3936         * po/bfd.pot: Regenerate.
3937
3938 2004-09-16  Alan Modra  <amodra@bigpond.net.au>
3939
3940         * elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags
3941         with bitfields.  Make "type" and "other" bitfields too.
3942         (ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR,
3943         ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC,
3944         ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED,
3945         ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF,
3946         ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK,
3947         ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK,
3948         ELF_LINK_POINTER_EQUALITY_NEEDED): Delete.
3949         (ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update.
3950         * elf-hppa.h: Update all uses of elf_link_hash_flags.
3951         * elf-m10300.c: Likewise.
3952         * elf.c: Likewise.
3953         * elf32-arm.h: Likewise.
3954         * elf32-cris.c: Likewise.
3955         * elf32-frv.c: Likewise.
3956         * elf32-hppa.c: Likewise.
3957         * elf32-i370.c: Likewise.
3958         * elf32-i386.c: Likewise.
3959         * elf32-m32r.c: Likewise.
3960         * elf32-m68k.c: Likewise.
3961         * elf32-ppc.c: Likewise.
3962         * elf32-s390.c: Likewise.
3963         * elf32-sh-symbian.c: Likewise.
3964         * elf32-sh.c: Likewise.
3965         * elf32-sh64.c: Likewise.
3966         * elf32-sparc.c: Likewise.
3967         * elf32-vax.c: Likewise.
3968         * elf32-xtensa.c: Likewise.
3969         * elf64-alpha.c: Likewise.
3970         * elf64-hppa.c: Likewise.
3971         * elf64-ppc.c: Likewise.
3972         * elf64-s390.c: Likewise.
3973         * elf64-sh64.c: Likewise.
3974         * elf64-sparc.c: Likewise.
3975         * elf64-x86-64.c: Likewise.
3976         * elflink.c: Likewise.
3977         * elfxx-ia64.c: Likewise.
3978         * elfxx-mips.c: Likewise.
3979         * configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92.
3980         * configure: Regenerate.
3981         * aclocal.m4: Regenerate.
3982
3983 2004-09-16  Alan Modra  <amodra@bigpond.net.au>
3984
3985         * elf32-arm.h (elf32_arm_gc_sweep_hook): Add #ifndef OLD_ARM_ABI
3986         around uses of R_ARM_TARGET1.
3987         (elf32_arm_check_relocs): Likewise.
3988
3989 2004-09-13  Paul Brook  <paul@codesourcery.com>
3990
3991         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
3992         prototype.
3993         * bfd-in2.h: Regenerate.
3994         * libbfd.h: Regenerate.
3995         * elf32-arm.h (elf32_arm_link_hash_table): Add target1_is_rel.
3996         (elf32_arm_link_hash_table_create): Set target1_is_rel.
3997         (bfd_elf32_arm_process_before_allocation): Ditto.
3998         (elf32_arm_final_link_relocate): Handle R_ARM_TARGET1.
3999         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
4000         * elfarm-nabi.c (elf32_arm_howto_table): Rename RELABS to TARGET1.
4001         * reloc.c: Ditto.
4002
4003 2004-09-10  Joel Brobecker  <brobecker@gnat.com>
4004
4005         * hpux-core.c (thread_section_p): New function.
4006         (hpux_core_core_file_p): Fix computation of offset in call
4007         to bfd_seek. Create a ".reg" section from an arbitrary
4008         ".reg/<id>" section if none was created after having read
4009         all sections.
4010
4011 2004-09-11  Andreas Schwab  <schwab@suse.de>
4012
4013         * acinclude.m4: Fix spelling of ACX_NONCANONICAL_*.
4014         * aclocal.m4: Rebuild.
4015         * configure: Rebuild.
4016
4017 2004-09-10  Joel Brobecker  <brobecker@gnat.com>
4018
4019         * section.c (bfd_sections_find_if): Fix parameter name in
4020         comment to match code.
4021
4022 2004-09-10  Alan Modra  <amodra@bigpond.net.au>
4023
4024         * elf.c  (assign_file_positions_except_relocs): Assign relocs
4025         stored in a bfd section.
4026
4027 2004-09-08  Hans-Peter Nilsson  <hp@axis.com>
4028
4029         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Reset
4030         h->gotplt_refcount to 0, not -1.
4031
4032 2004-09-07  Hans-Peter Nilsson  <hp@axis.com>
4033
4034         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOTPLT,
4035         case R_CRIS_32_GOTPLT>: For internal error message, handle NULL
4036         symname.
4037         (cris_elf_check_relocs) <case R_CRIS_32_PLT_PCREL>: Don't try to
4038         handle symbol visibility here.
4039
4040 2004-09-07  Alan Modra  <amodra@bigpond.net.au>
4041
4042         * elf64-ppc.c (struct ppc_link_hash_table): Add stub_globals.
4043         (is_ppc64_elf_target): Rename from is_ppc64_target.  Update all
4044         callers.
4045         (ppc_stub_name): Remove trailing "+0" on stub name.
4046         (create_linkage_sections): Create relocations for
4047         branch lookup table when --emit-relocs as well as when --shared.
4048         (ppc_build_one_stub): Emit relocs for long branch stubs.  Adjust
4049         relbrlt test.  For --emit-stub-syms, always output a sym even when
4050         one already exists on a plt call stub.  Put stub type in the stub
4051         symbol name.
4052         (ppc_size_one_stub): Size long branch stub relocs.  Adjust relbrlt
4053         test.
4054         (ppc64_elf_size_stubs): Count global sym stubs added.  Zero
4055         reloc_count in stub sections.  Adjust relbrlt test.
4056         (ppc64_elf_build_stubs): Adjust relbrlt test.  Tweak stats output.
4057         * elflink.c (bfd_elf_size_dynamic_sections): Fix comment typo.
4058         (elf_link_input_bfd): Ignore symbol index zero relocs when checking
4059         for relocs against discarded symbols.  Fix comments.
4060
4061 2004-09-06  Mark Mitchell  <mark@codesourcery.com>
4062
4063         * elf-bfd.h (_bfd_elf_make_dynamic_segment): Declare it.
4064         * elf.c (_bfd_elf_make_dynamic_segment): New function, split out
4065         from ...
4066         (map_sections_to_segments): ... here.  Use it.  Assign a file
4067         position to the .dynamic section if it is not loadable, but part
4068         of the PT_DYNAMIC segment.
4069         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
4070         offsets, not VMAs, for the BPABI.  Do not fill in the header in
4071         the .got.plt section for the BPABI.
4072         * elfarm-nabi.c (elf32_arm_symbian_modify_segment_map): Add a
4073         PT_DYNAMIC segment.
4074         (elf_backend_want_got_plt): Define to zero for Symbian OS.
4075
4076 2004-09-06  Nick Clifton  <nickc@redhat.com>
4077
4078         * elflink.c (elf_link_add_object_symbols): Set the error code to
4079         bfd_error_wrong_format when the input format does not match the
4080         output format.
4081
4082 2004-09-06  Alan Modra  <amodra@bigpond.net.au>
4083
4084         * elf64-ppc.c (is_ppc64_target): New function, extracted from..
4085         (ppc64_elf_check_directives): ..here.
4086         (ppc64_elf_size_dynamic_sections): Use it here to check bfd type
4087         before accessing ppc64_elf_tdata.
4088         (ppc64_elf_finish_dynamic_sections): And here too.
4089
4090 2004-09-04  Alan Modra  <amodra@bigpond.net.au>
4091
4092         * bfd.c (_bfd_default_error_handler): Correct loop exit.
4093
4094 2004-09-03  Mark Mitchell  <mark@codesourcery.com>
4095
4096         * config.bfd (arm*-*-symbianelf*): Use OS-specific target vectors.
4097         * configure.in (bfd_elf32_bigarm_symbian_vec): Add it.
4098         (bfd_elf32_littlearm_symbian_vec): Likewise.
4099         * configure: Regenerated.
4100         * elf-bfd.h (elf_backend_data): Add dynamic_sec_flags.
4101         * elf32-arm.h (PLT_HEADER_SIZE): Do not define.
4102         (PLT_ENTRY_SIZE): Likewise.
4103         (bfd_vma_elf32_arm_symbian_plt_entry): New
4104         variable.
4105         (elf32_arm_link_hash_table): Add plt_header_size, plt_entry_size,
4106         and symbian_p.
4107         (create_got_section): Don't create sections when generating BPABI
4108         objects.
4109         (elf32_arm_create_dynamic_sections): Tidy.
4110         (elf32_arm_link_hash_table_create): Set plt_header_size,
4111         plt_entry_size, and symbian_p.
4112         (elf32_arm_check_relocs): Do not mark .rel.dyn as loadable when
4113         generating BPABI objects.
4114         (allocate_dynrelocs): Use htab->plt_header_size, not
4115         PLT_HEADER_SIZE.  Do not add to .got.plt when
4116         generating BPABI objects.
4117         (elf32_arm_finish_dynamic_symbol): Generate Symbian OS PLTs.
4118         * elfarm-nabi.c: Add SymbianOS target vectors.
4119         * elflink.c (_bfd_elf_create_got_section): Use dynamic_sec_flags.
4120         (_bfd_elf_link_create_dynamic_sections): Likewise.
4121         * elfxx-target.h (ELF_DYNAMIC_SEC_FLAGS): New macro.
4122         (elfNN_bed): Use it.
4123         * targets.c (bfd_elf32_bigarm_symbian_vec): New variable.
4124         (bfd_elf32_littlearm_symbian_vec): Likewise.
4125         (_bfd_target_vector): Add them.
4126
4127 2004-09-03  Nick Clifton  <nickc@redhat.com>
4128
4129         PR 360
4130         * coffcode.h (handle_COMDAT): Replace abort with an warning
4131         message and allow the scan to continue.
4132
4133 2004-09-02  Alan Modra  <amodra@bigpond.net.au>
4134
4135         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Use static_syms passed
4136         in when reading relocs, not our sorted syms.  Remove unnecessary
4137         var.
4138
4139 2004-08-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
4140
4141         * elf.c (special_sections): Add .gnu.linkonce.b modelled on .bss.
4142
4143 2004-08-30  Nathanael Nerode  <neroden@gcc.gnu.org>
4144
4145         * acinclude.m4: Require AC_CANONICAL_TARGET, not AC_CANONICAL_SYSTEM.
4146         Include ../config/acx.m4 and use ACX_NONCANONICAL_* where appropriate;
4147         replace uses of *_alias with *_noncanonical.
4148         * aclocal.m4: Rebuild with aclocal 1.4p6.
4149         * Makefile.in: Rebuild with automake 1.4p6.
4150         * doc/Makefile.in: Rebuild with automake 1.4p6.
4151         * configure.in: Autoupdate with autoupdate 2.59.
4152         * config.in: Regenerate with autoheader 2.59.
4153         * configure: Regnerate with autoconf 2.59.
4154
4155 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
4156
4157         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Copy input
4158         symbol pointer arrays before modifying.
4159
4160 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
4161
4162         * bfd.c (bfd_get_synthetic_symtab): Pass counts and both symbol tables.
4163         * elf-bfd.h (_bfd_elf_get_synthetic_symtab): Adjust.
4164         * elf.c (_bfd_elf_get_synthetic_symtab): Adjust.
4165         * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Adjust.
4166         * targets.c (struct bfd_target <_bfd_get_synthetic_symtab>): Adjust.
4167         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't read symbols.
4168         Use both symbol tables on non-relocatable objects.  Use a common
4169         error exit.  Fix "mid" warning.
4170         * libbfd.h: Regenerate.
4171         * bfd-in2.h: Regenerate.
4172
4173 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
4174
4175         * elf64-ppc.c (ppc64_elf_branch_reloc): Check .opd is in a regular
4176         object file.
4177         (struct sfpr_def_parms): Save some space.
4178         (sfpr_define): Here too.
4179
4180         * elf64-ppc.c (compare_symbols): Put section syms first.
4181         (sym_exists_at): New function.
4182         (ppc64_elf_get_synthetic_symtab): Use relocs to find code entry
4183         points only for relocatable files.  Use .opd section contents
4184         otherwise.  Generally clean up the code.
4185
4186 2004-08-27  Alan Modra  <amodra@bigpond.net.au>
4187
4188         * elf64-ppc.c (STD_R0_0R1, STD_R0_0R12, LD_R0_0R1, LD_R0_0R12,
4189         LI_R12_0, STVX_VR0_R12_R0, LVX_VR0_R12_R0, MTLR_R0, SFPR_MAX): Define.
4190         (struct sfpr_def_parms): New.
4191         (sfpr_define): New function.
4192         (savegpr0, savegpr0_tail, restgpr0, restgpr0_tail): New functions.
4193         (savegpr1, savegpr1_tail, restgpr1, restgpr1_tail): New functions.
4194         (savefpr, savefpr0_tail, restfpr, restfpr0_tail): New functions.
4195         (savefpr1_tail, restfpr1_tail): New functions.
4196         (savevr, savevr_tail, restvr, restvr_tail): New functions.
4197         (MIN_SAVE_FPR, MAX_SAVE_FPR): Don't define.
4198         (ppc64_elf_func_desc_adjust): Use sfpr_define in place of existing
4199         code.  Define all ABI mandated _save and _rest functions.
4200
4201 2004-08-26  Paul Brook  <paul@codesourcery.com>
4202
4203         * elf32-arm.h (INTERWORK_FLAG): Return true for EABIv3 objects.
4204
4205 2004-08-26  Alan Modra  <amodra@bigpond.net.au>
4206
4207         * elf32-m32r.c (m32r_elf_relocate_section): Don't compare with
4208         TRUE or FALSE.
4209
4210 2004-08-26  Alan Modra  <amodra@bigpond.net.au>
4211
4212         * elf32-i386.c (elf_i386_relocate_section): Tweak last change so
4213         that pcrel correction is applied for R_386_PC32.
4214
4215 2004-08-25  Alan Modra  <amodra@bigpond.net.au>
4216
4217         * elf32-i386.c (elf_i386_relocate_section): Zero section contents
4218         for R_386_32 and R_386_PC32 relocs against symbols defined in
4219         discarded sections.
4220
4221 2004-08-25  Dmitry Diky  <diwil@spec.ru>
4222
4223         * reloc.c (BFD_RELOC_MSP430_2X_PCREL,BFD_RELOC_MSP430_RL_PCREL):
4224         Add new relocations.
4225         * bfd-in2.h: Regenerate.
4226         * libbfd.h: Regenerate.
4227         * elf32-msp430.c: Clean-up code.
4228         (elf_msp430_howto_table): Add new relocation entries.
4229         (bfd_elf32_bfd_reloc_type_lookup): New relocation handlers.
4230         (msp430_elf_relax_section): New function.
4231         (msp430_elf_relax_delete_bytes): New function.
4232         (msp430_elf_symbol_address_p): New function.
4233
4234 2004-08-24  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
4235
4236         * elf32-m32r.c (m32r_elf_relocate_section): Handle
4237         R_M32R_SDA16_RELA in the same way as R_M32R_SDA16.
4238
4239 2004-08-20  Daniel Jacobowitz  <dan@debian.org>
4240
4241         * elflink.c (_bfd_elf_section_already_linked): Handle
4242         SEC_LINK_DUPLICATES_SAME_CONTENTS.
4243
4244 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
4245
4246         * config.bfd (arm*-*-symbianelf*): New target.
4247         (arm*-*-eabi*): Likewise.
4248
4249 2004-08-19  Alan Modra  <amodra@bigpond.net.au>
4250
4251         * elf64-ppc.c (ppc_get_stub_entry): Change third param to a
4252         "struct ppc_link_hash_entry *".
4253         (ppc64_elf_relocate_section): Ditto for type of h.  Introduce h_elf
4254         to satisfy RELOC_FOR_GLOBAL_SYMBOL.
4255
4256 2004-08-19  Jakub Jelinek  <jakub@redhat.com>
4257
4258         * elf64-ppc.c (ppc64_elf_edit_opd): Support 16 byte long .opd
4259         entries (where fd_aux overlaps next entry's fd_func).
4260         Add non_overlapping argument, use it.
4261         (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, adjust_opd_syms,
4262         ppc64_elf_size_stubs, ppc64_elf_relocate_section,
4263         ppc64_elf_output_symbol_hook): Use address / 8 instead of address / 24
4264         as indexes into opd_sym_map/opd_adjust array.
4265         * elf64-ppc.h (ppc64_elf_edit_opd): Adjust prototype.
4266
4267 2004-08-18  Alan Modra  <amodra@bigpond.net.au>
4268
4269         * elf64-ppc.c (func_desc_adjust): Give undefined dot-symbols a value
4270         if we can look up their function descriptor in a regular file.
4271
4272 2004-08-18  Nick Clifton  <nickc@redhat.com>
4273
4274         PR 324
4275         * cofflink.c (coff_link_add_symbols): Check that the comdat
4276         pointer in the coff_section_data structure has been initialised
4277         before using it.
4278
4279 2004-08-18  Alan Modra  <amodra@bigpond.net.au>
4280
4281         PR 338
4282         * elflink.c (bfd_elf_record_link_assignment): Add comment about
4283         changing bfd_link_hash_undefined to bfd_link_hash_new.
4284
4285 2004-08-17  Jakub Jelinek  <jakub@redhat.com>
4286
4287         * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Only define
4288         if not yet defined.
4289         * elf64-ppc.c (bfd_elf64_get_synthetic_symtab): Define.
4290         (synthetic_opd, synthetic_relocatable): New variables.
4291         (compare_symbols, compare_relocs): New helper routines.
4292         (ppc64_elf_get_synthetic_symtab): New function.
4293         * bfd.c (bfd_get_synthetic_symtab): Rename dynsyms argument
4294         to relsyms.
4295         * bfd-in2.h: Regenerated.
4296         * elf.c (_bfd_elf_get_synthetic_symtab): Rename dynsyms argument
4297         to relsyms.  Return 0 if abfd is relocatable.
4298
4299 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4300
4301         * elflink.h (elf_gc_sweep): Keep non-alloc, non-load sections.
4302
4303 2004-08-17  Nick Clifton  <nickc@redhat.com>
4304
4305         * (is_arm_mapping_symbol_name): New function - return true
4306         when a symbol name matches the requirements for an ARM mapping
4307         symbol name.
4308         (arm_elf_find_function): New function based on
4309         elf_find_function in elf.c but skipping ARM mapping symbols
4310         and including thumb function symbols.
4311         (elf32_arm_find_nearest_line): Use arm_elf_find_function.
4312         (elf32_arm_output_symbol_hook): Use is_arm_mapping_symbol_name.
4313
4314 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4315
4316         * elf64-ppc.c (ppc64_elf_branch_reloc): New function.
4317         (ppc64_elf_howto_raw): Use ppc64_elf_branch_reloc.
4318         (ppc64_elf_brtaken_reloc): Here too.
4319
4320 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4321
4322         * elf64-ppc.c (add_symbol_adjust): Correct mismatched function
4323         symbol visibility.
4324         (ppc64_elf_check_directives): Check that we have the right hash
4325         table before proceeding.
4326
4327 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
4328
4329         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add "deleted_section".
4330         (adjust_opd_syms): Attach opd syms for deleted entries to one of
4331         the sections that will be discarded.
4332
4333 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
4334
4335         * elflink.c (elf_section_complain_discarded): Ignore .fixup.
4336
4337 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
4338
4339         * bfd.c (_bfd_default_error_handler): Account for doubled '%' in
4340         free space available.
4341
4342 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
4343
4344         * pdp11.c (struct pdp11_aout_reloc_external): Delete.  Replace
4345         occurrences with bfd_byte * thoughout file.
4346
4347         * coff-rs6000.c (do_shared_object_padding): Warning fix.
4348         (xcoff_write_armap_big): Likewise.
4349         (xcoff_write_archive_contents_old): Likewise.
4350         (xcoff_write_archive_contents_big): Likewise.
4351
4352         * elf64-mmix.c (mmix_elf_get_section_contents): Delete declaration.
4353
4354 2004-08-13  Nick Clifton  <nickc@redhat.com>
4355
4356         * elf32-arm.h: Convert to ISO C90.
4357
4358 2004-08-13  Alan Modra  <amodra@bigpond.net.au>
4359
4360         PR 293
4361         * elf32-hppa.c (elf32_hppa_hide_symbol): Use init_refcount to
4362         zero the plt field.
4363
4364 2004-08-13  Alan Modra  <amodra@bigpond.net.au>
4365
4366         * bfd.c (_bfd_default_error_handler): Handle %A and %B.
4367         (bfd_archive_filename, bfd_get_section_ident): Delete.
4368         * ecofflink.c (bfd_ecoff_debug_accumulate_other): Don't call
4369         bfd_archive_filename.
4370         * elflink.c (elf_link_input_bfd): Don't use callbacks->error_handler
4371         to warn about symbols in discarded sections.  Use _bfd_error_handler.
4372         * aout-adobe.c (aout_adobe_callback): See below.
4373         * aout-cris.c (swap_ext_reloc_in): ..
4374         * coff-arm.c (find_thumb_glue, find_arm_glue,
4375         coff_arm_relocate_section, bfd_arm_process_before_allocation,
4376         coff_arm_merge_private_bfd_data, _bfd_coff_arm_set_private_flags,
4377         coff_arm_copy_private_bfd_data): ..
4378         * coff-i860.c (i860_reloc_processing): ..
4379         * coff-mcore.c (mcore_coff_unsupported_reloc,
4380         coff_mcore_relocate_section): ..
4381         * coff-ppc.c (coff_ppc_relocate_section): ..
4382         * coff-rs6000.c (xcoff_create_csect_from_smclas
4383         * coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
4384         sh_swap_insns, sh_relocate_section): ..
4385         * coff-tic54x.c (tic54x_reloc_processing): ..
4386         * coff-tic80.c (coff_tic80_relocate_section): ..
4387         * coff64-rs6000.c (xcoff64_create_csect_from_smclas): ..
4388         * coffcode.h (styp_to_sec_flags, coff_slurp_line_table,
4389         coff_slurp_symbol_table, coff_classify_symbol,
4390         coff_slurp_reloc_table): ..
4391         * coffgen.c (_bfd_coff_read_string_table): ..
4392         * cofflink.c (coff_link_add_symbols, _bfd_coff_link_input_bfd,
4393         _bfd_coff_generic_relocate_section): ..
4394         * cpu-arm.c (bfd_arm_merge_machines): ..
4395         * cpu-sh.c (sh_merge_bfd_arch): ..
4396         * elf-hppa.h (elf_hppa_relocate_section): ..
4397         * elf.c (bfd_elf_string_from_elf_section, setup_group,
4398         _bfd_elf_setup_group_pointers, bfd_section_from_shdr,
4399         assign_section_numbers, _bfd_elf_symbol_from_bfd_symbol,
4400         copy_private_bfd_data, _bfd_elf_validate_reloc): ..
4401         * elf32-arm.h (find_thumb_glue, find_arm_glue,
4402         bfd_elf32_arm_process_before_allocation, elf32_thumb_to_arm_stub,
4403         elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate,
4404         elf32_arm_relocate_section, elf32_arm_set_private_flags,
4405         elf32_arm_copy_private_bfd_data, elf32_arm_merge_private_bfd_data): ..
4406         * elf32-cris.c (cris_elf_relocate_section, cris_elf_check_relocs,
4407         cris_elf_merge_private_bfd_data
4408         * elf32-frv.c (elf32_frv_relocate_section, elf32_frv_check_relocs): ..
4409         * elf32-gen.c (elf32_generic_link_add_symbols): ..
4410         * elf32-hppa.c (hppa_add_stub, hppa_build_one_stub,
4411         elf32_hppa_check_relocs, get_local_syms, final_link_relocate,
4412         elf32_hppa_relocate_section): ..
4413         * elf32-i370.c (i370_elf_merge_private_bfd_data,
4414         i370_elf_check_relocs, i370_elf_relocate_section): ..
4415         * elf32-i386.c (elf_i386_info_to_howto_rel, elf_i386_check_relocs,
4416         elf_i386_relocate_section): ..
4417         * elf32-m32r.c (m32r_elf_relocate_section,
4418         m32r_elf_merge_private_bfd_data): ..
4419         * elf32-m68hc1x.c (m68hc12_add_stub,
4420         _bfd_m68hc11_elf_merge_private_bfd_data): ..
4421         * elf32-m68k.c (elf_m68k_relocate_section): ..
4422         * elf32-mcore.c (mcore_elf_unsupported_reloc,
4423         mcore_elf_relocate_section): ..
4424         * elf32-ppc.c (ppc_elf_merge_private_bfd_data, bad_shared_reloc,
4425         ppc_elf_check_relocs, ppc_elf_relocate_section,
4426         ppc_elf_begin_write_processing): ..
4427         * elf32-s390.c (elf_s390_check_relocs, invalid_tls_insn,
4428         elf_s390_relocate_section): ..
4429         * elf32-sh-symbian.c (sh_symbian_import_as,
4430         sh_symbian_process_embedded_commands,
4431         sh_symbian_relocate_section): ..
4432         * elf32-sh.c (sh_elf_relax_section, sh_elf_relax_delete_bytes,
4433         sh_elf_swap_insns, sh_elf_relocate_section, sh_elf_check_relocs,
4434         sh_elf_merge_private_data): ..
4435         * elf32-sparc.c (elf32_sparc_check_relocs,
4436         elf32_sparc_relocate_section,
4437         elf32_sparc_merge_private_bfd_data): ..
4438         * elf32-v850.c (v850_elf_check_relocs,
4439         v850_elf_merge_private_bfd_data): ..
4440         * elf32-xtensa.c (elf_xtensa_check_relocs,
4441         elf_xtensa_relocate_section, elf_xtensa_merge_private_bfd_data): ..
4442         * elf64-alpha.c (elf64_alpha_relax_with_lituse,
4443         elf64_alpha_relax_got_load, elf64_alpha_size_got_sections,
4444         elf64_alpha_relocate_section_r, elf64_alpha_relocate_section): ..
4445         * elf64-gen.c (elf64_generic_link_add_symbols): ..
4446         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data, ppc_add_stub,
4447         ppc64_elf_check_relocs, ppc64_elf_edit_opd,
4448         ppc64_elf_relocate_section): ..
4449         * elf64-s390.c (elf_s390_check_relocs, invalid_tls_insn,
4450         elf_s390_relocate_section): ..
4451         * elf64-sh64.c (sh_elf64_relocate_section): ..
4452         * elf64-sparc.c (sparc64_elf_check_relocs,
4453         sparc64_elf_add_symbol_hook, sparc64_elf_relocate_section,
4454         sparc64_elf_merge_private_bfd_data): ..
4455         * elf64-x86-64.c (elf64_x86_64_check_relocs,
4456         elf64_x86_64_relocate_section): ..
4457         * elflink.c (_bfd_elf_add_default_symbol,
4458         _bfd_elf_link_assign_sym_version, elf_link_read_relocs_from_section,
4459         _bfd_elf_link_output_relocs, elf_link_add_object_symbols,
4460         bfd_elf_size_dynamic_sections, elf_link_output_extsym,
4461         elf_get_linked_section_vma, elf_fixup_link_order,
4462         bfd_elf_final_link, bfd_elf_gc_record_vtinherit,
4463         bfd_elf_gc_record_vtinherit, _bfd_elf_section_already_linked): ..
4464         * elfxx-ia64.c (elfNN_ia64_relax_section,
4465         elfNN_ia64_relocate_section, elfNN_ia64_merge_private_bfd_data): ..
4466         * elfxx-mips.c (mips_elf_perform_relocation,
4467         _bfd_mips_elf_check_relocs,
4468         _bfd_mips_elf_merge_private_bfd_data): ..
4469         * ieee.c (ieee_slurp_external_symbols): ..
4470         * ihex.c (ihex_bad_byte, ihex_scan, ihex_read_section): ..
4471         * libbfd.c (_bfd_generic_verify_endian_match): ..
4472         * linker.c (_bfd_generic_link_add_one_symbol,
4473         _bfd_generic_section_already_linked): ..
4474         * pdp11.c (translate_to_native_sym_flags): ..
4475         * pe-mips.c (coff_pe_mips_relocate_section): ..
4476         * peicode.h (pe_ILF_build_a_bfd): ..
4477         * srec.c (srec_bad_byte): ..
4478         * stabs.c (_bfd_link_section_stabs): ..
4479         * xcofflink.c (xcoff_link_add_symbols, xcoff_link_input_bfd): ..
4480         Replace all uses of bfd_archive_filename and bfd_get_section_ident
4481         with corresponding %B and %A in _bfd_error_handler format string.
4482         Replace occurrences of "fprintf (stderr," with _bfd_error_handler
4483         calls to use %A and %B.  Fix "against symbol .. from section" and
4484         similar error messages.  Combine multiple _bfd_error_handler calls
4485         where they were separated due to bfd_archive_filename deficiencies.
4486         * bfd-in2.h: Regenerate.
4487
4488 2004-08-12  H.J. Lu  <hongjiu.lu@intel.com>
4489
4490         * elf32-i386.c (elf_i386_relocate_section): Report unrecognized
4491         relocation.
4492
4493 2004-08-10  Alan Modra  <amodra@bigpond.net.au>
4494
4495         * elf64-ppc.c (struct ppc_link_hash_entry): Add was_undefined.
4496         (struct ppc_link_hash_table): Remove no_multi_toc, multi_toc_needed.
4497         Make emit_stub_syms, stub_error and has_14bit_branch bit-fields.
4498         Add twiddled_syms.
4499         (link_hash_newfunc): Init was_undefined.
4500         (add_symbol_adjust): Don't set undefined dot symbols to defweak;
4501         Use undefweak instead.
4502         (ppc64_elf_check_directives): Fix undefs chain.
4503         (ppc64_elf_next_toc_section): Remove no_multi_toc and multi_toc_needed
4504         references.
4505         (ppc64_elf_size_stubs): Adjust for add_symbol_adjust change.
4506         (undo_symbol_twiddle, ppc64_elf_restore_symbols): New functions.
4507         * elf64-ppc.h (ppc64_elf_restore_symbols): Declare.
4508
4509 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4510
4511         * elf64-x86-64.c (elf64_x86_64_relocate_section): For -fno-pic
4512         error, test input_section flags rather than sec.
4513
4514 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4515
4516         * elf-bfd.h (struct elf_backend_data): Add
4517         elf_backend_archive_symbol_lookup.
4518         (_bfd_elf_archive_symbol_lookup): Declare.
4519         * elflink.c (_bfd_elf_archive_symbol_lookup): New function..
4520         (elf_link_add_archive_symbols): ..extracted from here.  Call the
4521         backend version.
4522         * elfxx-target.h (elf_backend_archive_symbol_lookup): Provide default.
4523         (elfNN_bed): Init new field.
4524         * elf64-ppc.c (elf_backend_check_directives): Define.
4525         (elf_backend_archive_symbol_lookup): Define.
4526         (struct ppc_link_hash_table): Add tls_get_add_fd.  Make tls_get_add
4527         a ppc_link_hash_entry pointer.
4528         (get_fdh): Move.
4529         (ppc64_elf_archive_symbol_lookup, opd_entry_value): New functions.
4530         (add_symbol_adjust, ppc64_elf_check_directives): New functions.
4531         (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, func_desc_adjust,
4532         ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup,
4533         ppc64_elf_tls_optimize, allocate_dynrelocs, ppc_type_of_stub,
4534         ppc_build_one_stub, ppc64_elf_size_stubs, ppc64_elf_relocate_section,
4535         ppc64_elf_finish_dynamic_symbol): Handle branch relocs to function
4536         descriptor symbols.
4537
4538 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4539
4540         * elf64-ppc.c (struct ppc_link_hash_entry): Expand adjust_done comment.
4541         (ppc64_elf_add_symbol_hook): Test for NULL section.
4542         (get_sym_h): Formatting.
4543         (ppc64_elf_size_stubs): Include reloc addend in value stored as
4544         stub target_value.
4545
4546         * elf64-ppc.c (ppc64_elf_relocate_section): Combine handling of
4547         long branch stubs with code handling plt and r2off branch stubs.
4548
4549 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4550
4551         * elf-bfd.h (_bfd_elf_gc_mark): Declare.
4552         * elflink.c (elf_link_input_bfd): Formatting.
4553         (_bfd_elf_gc_mark): Rename from elf_gc_mark and make global.  Adjust
4554         all callers.
4555         * elf64-ppc.c (struct ppc_link_hash_entry): Remove is_entry.
4556         (link_hash_newfunc): Don't set it.
4557         (ppc64_elf_copy_indirect_symbol): Nor copy it.
4558         (ppc64_elf_mark_entry_syms): Delete.
4559         (ppc64_elf_gc_mark_hook): Mark entry syms here.  Also mark opd
4560         sections.  Use get_opd_info.
4561         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Delete.
4562
4563 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4564
4565         * elf64-ppc.c (adjust_opd_syms): Fix merge error.
4566
4567         * elf64-ppc.c (struct ppc_link_hash_table): Remove have_undefweak.
4568         (func_desc_adjust): Don't set have_undefweak.
4569         (ppc64_elf_func_desc_adjust): Don't add an extr nop to sfpr.
4570         (ppc64_elf_relocate_section): NOP out calls to undefweak functions.
4571
4572         * elf64-ppc.c (struct ppc_link_hash_entry): Make "oh" a
4573         "struct ppc_link_hash_entry *".  Adjust all references.
4574         (ppc64_elf_hide_symbol): Correct a comment.
4575
4576         * elf64-ppc.c (get_opd_info): New function.
4577         (adjust_opd_syms): Use get_opd_info.  Define removed symbols as zero.
4578         (ppc64_elf_edit_opd): Use get_opd_info.  Check that sym has a dot
4579         before calling get_fdh.  Test fdh rather than h before dereferencing
4580         fdh.  Mark removed symbols in opd_adjust.
4581         (ppc64_elf_tls_optimize): Don't bother with opd adjustment here.
4582         (ppc64_elf_relocate_section): Use get_opd_info, and handle removed
4583         opd symbols.
4584         (ppc64_elf_output_symbol_hook): Likewise.
4585
4586 2004-08-06  Paul Brook  <paul@codesourcery.com>
4587
4588         * elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations.
4589         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32,
4590         BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32.
4591         * reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32
4592         and BFD_RELOC_ARM_SBREL32.
4593         * bfd-in2.h, bbfd.h: Regenerate.
4594
4595 2004-08-01  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4596
4597         * elfxx-mips.c (mips_elf_calculate_relocation): Test only for
4598         the dynamic link symbol actually in use.
4599
4600 2004-08-01  Stephane Carrez  <stcarrez@nerim.fr>
4601
4602         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Handle bfd_link_hash_new
4603
4604 2004-07-31  Joel Brobecker  <brobecker@gnat.com>
4605             Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4606
4607         * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Handle
4608         SHN_MIPS_TEXT and SHN_MIPS_DATA.
4609
4610 2004-07-30  H.J. Lu  <hongjiu.lu@intel.com>
4611             Nick Clifton  <nickc@redhat.com>
4612
4613         PR 290
4614         * bfd.c (_bfd_default_error_handler): Make it global.
4615
4616         * elf-bfd.h (elf_backend_data): Add link_order_error_handler.
4617
4618         * elf.c (assign_section_numbers): Cope gracefully with sections
4619         which have SHF_LINK_ORDER set but no sh_link set up.
4620         * elflink.c (elf_get_linked_section_vma): Likewise.
4621
4622         * elfxx-ia64.c (elf_backend_link_order_error_handler): New. Set
4623         it to NULL.
4624
4625         * elfxx-target.h (elf_backend_link_order_error_handler): New.
4626         Set it to _bfd_default_error_handler.
4627         (elfNN_bed): Add elf_backend_link_order_error_handler.
4628
4629         * libbfd-in.h (_bfd_default_error_handler): New.
4630
4631         * libbfd.h: Regenerated.
4632
4633 2004-07-30  Jakub Jelinek  <jakub@redhat.com>
4634
4635         * archures.c (bfd_mach_sparc_64bit_p): Define.
4636         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Use it.
4637         * bfd-in2.h: Rebuilt.
4638
4639 2004-07-29  Alexandre Oliva  <aoliva@redhat.com>
4640
4641         Introduce SH2a support.
4642         2004-02-18  Corinna Vinschen  <vinschen@redhat.com>
4643         * archures.c (bfd_mach_sh2a_nofpu): New.
4644         * bfd-in2.h: Rebuilt.
4645         * cpu-sh.c (SH2A_NOFPU_NEXT): New.
4646         (arch_info_struct): Add sh2a_nofpu.
4647         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a_nofpu.
4648         2003-12-29  DJ Delorie  <dj@redhat.com>
4649         * reloc.c: Add relocs for sh2a.
4650         * bfd-in2.h: Regenerate.
4651         * libbfd.hh: Regenerate.
4652         2003-12-01  Michael Snyder  <msnyder@redhat.com>
4653         * archures.c (bfd_mach_sh2a): New.
4654         * bfd-in2.h: Rebuilt.
4655         * cpu-sh.c (SH_NEXT, SH2_NEXT, etc.): Change defines to enums.
4656         (SH2A_NEXT): New.
4657         (arch_info_struct): Add sh2a.
4658         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a.
4659
4660 2004-07-28  Nick Clifton  <nickc@redhat.com>
4661             John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4662
4663         PR 273
4664         * som.c (setup_sections): Improve estimation of space sizes in
4665         relocatable objects.
4666
4667 2004-07-27  Jason Thorpe  <thorpej@wasabisystems.com>
4668         * config.bfd (hppa*-*-netbsd*): Set targ_defvec to
4669         bfd_elf32_hppa_nbsd_vec.  Add bfd_elf32_hppa_linux_vec
4670         to targ_selvecs.
4671         * configure.in (bfd_elf32_hppa_nbsd_vec): Add case.
4672         * configure: Regenerate.
4673         * elf32-hppa.c (elf32_hppa_object_p): Add "elf32-hppa-netbsd"
4674         case that accepts OSABI=NetBSD and OSABI=SysV.
4675         (elf32_hppa_set_gp): For "elf32-hppa-netbsd", set the GP to
4676         the base of .got or .data (if .got does not exist).
4677         (elf32_hppa_post_process_headers): For elf32-hppa-netbsd,
4678         set OSABI=NetBSD.
4679         (TARGET_BIG_SYM): Add bfd_elf32_hppa_nbsd_vec case.
4680         (TARGET_BIG_NAME): Add "elf32-hppa-netbsd" case.
4681         * targets.c (bfd_elf32_hppa_nbsd_vec): Add extern declaration.
4682         (_bfd_target_vector): Add bfd_elf32_hppa_nbsd_vec.
4683
4684 2004-07-27  H.J. Lu  <hongjiu.lu@intel.com>
4685
4686         PR 161/251
4687         * elf-bfd.h (bfd_elf_section_data): Add sec_group.
4688         (elf_sec_group): Defined.
4689         (bfd_elf_match_symbols_in_sections): New prototype.
4690         (_bfd_elf_setup_group_pointers): Likewise.
4691
4692         * elf.c (bfd_elf_discard_group): Abort.
4693         (bfd_elf_set_group_contents): Also include relocation sections.
4694         Remove zero-fill for ld -r.
4695         (_bfd_elf_setup_group_pointers): New function.
4696         (elf_sort_elf_symbol): Likewise.
4697         (elf_sym_name_compare): Likewise.
4698         (bfd_elf_match_symbols_in_sections): Likewise.
4699
4700         * elfcode.h (elf_object_p): Call _bfd_elf_setup_group_pointers.
4701
4702         * elflink.c (match_group_member): New.
4703         (elf_link_input_bfd): Check group member for discarded section.
4704         (try_match_symbols_in_sections): New function.
4705         (already_linked): Likewise.
4706         (_bfd_elf_section_already_linked): Support mixing comdat group
4707         and linkonce section.
4708
4709         * libbfd-in.h (bfd_section_already_linked_table_traverse): New.
4710         * linker.c (bfd_section_already_linked_table_traverse): New.
4711
4712         * libbfd.h: Regenerated.
4713
4714 2004-07-27  Tomer Levi  <Tomer.Levi@nsc.com>
4715
4716         * reloc.c: Add BFD_RELOC_CRX_SWITCH8, BFD_RELOC_CRX_SWITCH16,
4717         BFD_RELOC_CRX_SWITCH32.
4718         * bfd-in2.h: Regenerate.
4719         * libbfd.h: Regenerate.
4720         * elf32-crx.c: Support relocation/relaxation of
4721         BFD_RELOC_CRX_SWITCH* types.
4722
4723 2004-07-27  Alan Modra  <amodra@bigpond.net.au>
4724
4725         * elf64-ppc.c: Correct "Linker stubs" comment.
4726
4727 2004-07-26  H.J. Lu  <hongjiu.lu@intel.com>
4728
4729         * elf-bfd.h (bfd_elf_section_data): Add a pointer for the
4730         linked-to section.
4731         (elf_linked_to_section): New.
4732
4733         * elf.c (assign_section_numbers): Set up sh_link for
4734         SHF_LINK_ORDER.
4735
4736         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set sh_info
4737         to sh_link for SHT_IA_64_UNWIND sections.
4738
4739 2004-07-22  H.J. Lu  <hongjiu.lu@intel.com>
4740
4741         * elflink.c (elf_fixup_link_order): Add _() to error message.
4742
4743 2004-07-22  H.J. Lu  <hongjiu.lu@intel.com>
4744
4745         * elflink.c (elf_fixup_link_order): Issue a warning and flag
4746         an error if failed.
4747
4748 2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>
4749
4750         * aout-adobe.c (aout_32_section_already_linked): Defined.
4751         * aout-target.h (MY_section_already_linked): Likewise.
4752         * aout-tic30.c (MY_section_already_linked): Likewise.
4753         * binary.c (binary_section_already_linked): Likewise.
4754         * bout.c (b_out_section_already_linked): Likewise.
4755         * coff-alpha.c (_bfd_ecoff_section_already_linked): Likewise.
4756         * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise.
4757         * coffcode.h (coff_section_already_linked): Likewise.
4758         * i386msdos.c (msdos_section_already_linked): Likewise.
4759         * i386os9k.c (os9k_section_already_linked): Likewise.
4760         * ieee.c (ieee_section_already_linked): Likewise.
4761         * ihex.c (ihex_section_already_linked): Likewise.
4762         * mach-o.c (bfd_mach_o_section_already_linked): Likewise.
4763         * mmo.c (mmo_section_already_linked): Likewise.
4764         * nlm-target.h (nlm_section_already_linked): Likewise.
4765         * oasys.c (oasys_section_already_linked): Likewise.
4766         * pef.c (bfd_pef_section_already_linked): Likewise.
4767         * ppcboot.c (ppcboot_section_already_linked): Likewise.
4768         * som.c (som_bfd_discard_group): Likewise.
4769         * srec.c (srec_section_already_linked): Likewise.
4770         * tekhex.c (tekhex_section_already_linked): Likewise.
4771         * versados.c (versados_section_already_linked): Likewise.
4772         * vms.c (vms_section_already_linked): Likewise.
4773         * coff-target.h (_bfd_xcoff_section_already_linked): Likewise.
4774         * xsym.c (bfd_sym_section_already_linked): Likewise.
4775
4776         * bfd-in.h (bfd_section_already_linked_table_init): New.
4777         (bfd_section_already_linked_table_free): Likewise.
4778
4779         * coff-rs6000.c (rs6000coff_vec): Add
4780         _bfd_generic_section_already_linked.
4781         (pmac_xcoff_vec): Likewise.
4782         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
4783         (aix5coff64_vec): Likewise.
4784
4785         * elf-bfd.h (_bfd_elf_section_already_linked): New prototype.
4786         * elflink.c (_bfd_elf_section_already_linked): New function.
4787
4788         * elfxx-target.h (bfd_elfNN_section_already_linked): Defined.
4789
4790         * libbfd-in.h (_bfd_nolink_section_already_linked): Defined.
4791         (_bfd_generic_section_already_linked): New.
4792         (bfd_section_already_linked_hash_entry): Likewise.
4793         (bfd_section_already_linked): Likewise.
4794         (bfd_section_already_linked_table_lookup): Likewise.
4795         (bfd_section_already_linked_table_insert): Likewise.
4796
4797         * linker.c (bfd_section_already_linked): New.
4798         (_bfd_section_already_linked_table): Likewise.
4799         (bfd_section_already_linked_table_lookup): Likewise.
4800         (bfd_section_already_linked_table_insert): Likewise.
4801         (already_linked_newfunc): Likewise.
4802         (bfd_section_already_linked_table_init): Likewise.
4803         (bfd_section_already_linked_table_free): Likewise.
4804         (_bfd_generic_section_already_linked): Likewise.
4805
4806         * section.c (bfd_section): Remove comdat.
4807         (bfd_comdat_info): Moved to ...
4808         * bfd-in.h (coff_comdat_info): Here.
4809         (bfd_coff_get_comdat_section): New.
4810         * coffgen.c (bfd_coff_get_comdat_section): Likewise.
4811         * libcoff-in.h (coff_section_tdata): Add comdat.
4812         * coffcode.h (handle_COMDAT): Updated.
4813         * cofflink.c (coff_link_add_symbols): Likewise.
4814         * ecoff.c (bfd_debug_section): Likewise.
4815
4816         * targets.c (bfd_target): Add _section_already_linked.
4817         (BFD_JUMP_TABLE_LINK): Updated.
4818
4819         * bfd-in2.h: Regenerated.
4820         * libbfd.h: Likewise.
4821         * libcoff.h: Likewise.
4822
4823 2003-07-21  Paul Brook  <paul@codesourcery.com>
4824
4825         * elflink.c (elf_get_linked_section_vma, compare_link_order,
4826         elf_fixup_link_order): New functions.
4827         (bfd_elf_final_link): Call elf_fixup_link_order.
4828
4829 2004-07-21  Alexandre Oliva  <aoliva@redhat.com>
4830
4831         * elf-bfd.h (ELF_COMMON_DEF_P): New.
4832         * elflink.c (_bfd_elf_symbol_refs_local_p): Use it to handle
4833         common definitions.
4834         * elf-m10300.c: Use SYMBOL_REFERENCES_LOCAL instead of
4835         _bfd_elf_symbol_refs_local_p.
4836         * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove hack for common
4837         symbols.
4838
4839 2004-07-19  H.J. Lu  <hongjiu.lu@intel.com>
4840
4841         * bfd-in.h (dynamic_lib_link_class): Add DYN_NO_ADD_NEEDED and
4842         DYN_NO_NEEDED.
4843         (bfd_elf_get_dyn_lib_class): New prototype.
4844         * elf.c (bfd_elf_get_dyn_lib_class): New function.
4845
4846         * elflink.c (elf_link_add_object_symbols): Check DYN_AS_NEEDED,
4847         DYN_DT_NEEDED and DYN_NO_NEEDED bits to see if a DT_NEEDED
4848         entry is needed. Issue an error if a DT_NEEDED entry is needed
4849         for a file marked DYN_NO_NEEDED.
4850         (elf_link_check_versioned_symbol): Check the DYN_DT_NEEDED bit
4851         for DT_NEEDED tags.
4852
4853         * bfd-in2.h: Regenerated.
4854
4855 2004-07-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4856
4857         * elflink.c (elf_section_complain_discarded): Don't complain in
4858         .PARISC.unwind.
4859
4860 2004-07-10  James E Wilson  <wilson@specifixinc.com>
4861
4862         * elfxx-ia64.c (elfNN_ia64_relax_ldxmov): Remove abfd parameter.
4863         (elfNN_ia64_install_value, elfNN_ia64_relax_brl): Likewise.
4864         (elfNN_ia64_relax_section, elfNN_ia64_relocate_section,
4865         elfNN_ia64_finish_dynamic_symbol, elfNN_ia64_finish_dynamic_sections):
4866         Fix callers.
4867         (elfNN_ia64_relax_brl): Change bfd_get_64 to bfd_getl64.  Change
4868         bfd_put_64 to bfd_putl64.
4869         (elfNN_ia64_relax_ldxmov, elfNN_ia64_install_value): Likewise.
4870
4871 2004-07-09  H.J. Lu  <hongjiu.lu@intel.com>
4872
4873         PR 240
4874         * elfxx-ia64.c (elfNN_ia64_relax_section): Only warn br in
4875         .init/.fini sections when trying to relax it.
4876
4877 2004-07-09  Jie Zhang  <zhangjie@magima.com.cn>
4878
4879         * elf.c (assign_file_positions_for_segments): Make sure the
4880         .dynamic section is the first section in the PT_DYNAMIC segment.
4881
4882 2004-07-09  Nick Clifton  <nickc@redhat.com>
4883
4884         * config.bfd: Change sh-sybmian-elf to sh-*-symbianelf.
4885         * elf32-sh-symbian.c: Rename the sh_find_elf_flags and
4886         sh_elf_get_flags_from_mach functions so that they do not conflict
4887         when this target is built with other sh-elf targets.
4888         * elf32-sh.c (sh_elf_get_flags_from_mach): Remove bogus
4889         suppression of this function.
4890         (sh_elf_find_flags): Likewise.
4891
4892 2004-07-07  Tomer Levi  <Tomer.Levi@nsc.com>
4893
4894         * Makefile.am (ALL_MACHINES): Add cpu-crx.lo.
4895         (ALL_MACHINES_CFILES): Add cpu-crx.c.
4896         (BFD32_BACKENDS): Add elf32-crx.lo.
4897         (BFD32_BACKENDS_CFILES): Add elf32-crx.c.
4898         (cpu-crx.lo): New target.
4899         (elf32-crx.lo): New target.
4900         * Makefile.in: Regenerate.
4901         * archures.c (bfd_architecture): Add bfd_{arch,mach}_crx.
4902         (bfd_archures_list): Add bfd_crx_arch.
4903         * bfd-in2.h: Regenerate.
4904         * config.bfd: Handle crx-*-elf*, crx*.
4905         * configure.in: Handle bfd_elf32_crx_vec.
4906         * configure: Regenerate.
4907         * cpu-crx.c: New file.
4908         * elf32-crx.c: Likewise.
4909         * libbfd.h: Regenerate.
4910         * reloc.c: Add BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8,
4911         BFD_RELOC_CRX_REL8_CMP, BFD_RELOC_CRX_REL16, BFD_RELOC_CRX_REL24,
4912         BFD_RELOC_CRX_REL32, BFD_RELOC_CRX_REGREL12, BFD_RELOC_CRX_REGREL22,
4913         BFD_RELOC_CRX_REGREL28, BFD_RELOC_CRX_REGREL32, BFD_RELOC_CRX_ABS16,
4914         BFD_RELOC_CRX_ABS32, BFD_RELOC_CRX_NUM8, BFD_RELOC_CRX_NUM16,
4915         BFD_RELOC_CRX_NUM32, BFD_RELOC_CRX_IMM16 and BFD_RELOC_CRX_IMM32
4916         * targets.c (bfd_elf32_crx_vec): Declare.
4917         (bfd_target_vector): Add bfd_elf32_crx_vec.
4918
4919 2004-07-06  Nick Clifton  <nickc@redhat.com>
4920
4921         * config.bfd: Add sh-symbian-elf target.
4922         * configure.in: Add bfd_elf32_shl_symbian_vec.
4923         * configure: Regenerate.
4924         * elf-bfd.h (struct elf_backend_data): Add new field
4925         'check_directives'.
4926         * elflink.c (elf_link_add_object_symbols): Invoke the
4927         check_directives function, if defined.
4928         * elfxx-target.h: Provide a default, NULL definition for
4929         check_directives.
4930         * targets.c: Add bfd_elf32_shl_symbian_vec.
4931         * elf32-sh.c (sh_elf_swap_insns): Protect against unnecessary
4932         definition.
4933         (elf32_shlin_grok_prstatus, elf32_shlib_grok_psinfo,
4934         * sh_elf_get_flags_from_mach, sh_elf_find_flags): Likewise.
4935         (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Only define if they have
4936         not already been defined.
4937         * elf32-sh64.c: Use SH_TARGET_ALREADY_DEFINED.
4938         * sh-symbian.c: New file.  Provide functions to support the
4939         * sh-symbian-elf target.
4940         * Makefile.am: Add elf32-sh-symbian.c
4941         * Makefile.in: Regenerate.
4942
4943 2004-07-05  Andrew Stubbs <andrew.stubbs@superh.com>
4944
4945         * elf32-sh.c: Include ../opcodes/sh-opc.h.
4946         * Makefile.am: Ran make dep-am.
4947         * Makefile.in: Ran make dep-in.
4948
4949 2004-07-03  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>
4950
4951         * cofflink.c (_bfd_coff_generic_relocate_section): Resolve PE weak
4952         externals properly.
4953
4954 2004-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4955
4956         * config.bfd: Add want64 to configuration target s390-*-linux*.
4957
4958 2004-07-01  H.J. Lu  <hongjiu.lu@intel.com>
4959
4960         * bfd.c (bfd_get_section_ident): New.
4961
4962         * elflink.c (elf_link_read_relocs_from_section): Call
4963         bfd_get_section_ident to identify the section when reporting
4964         error.
4965         (_bfd_elf_link_output_relocs): Likewise.
4966         (elf_link_output_extsym): Likewise.
4967         (elf_link_input_bfd): Likewise.
4968         (bfd_elf_gc_record_vtinherit): Likewise.
4969
4970         * bfd-in2.h: Regenerated.
4971
4972 2004-07-01  Jie Zhang  <zhangjie@magima.com.cn>
4973             Nick Clifton  <nickc@redhat.com>
4974
4975         PR 204
4976         * elfxx-mips.c (_bfd_mips_elf_final_link): Pass the correct number
4977         of section symbols to mips_elf_sort_hash_table ().
4978
4979 2004-07-01  Alan Modra  <amodra@bigpond.net.au>
4980
4981         * elflink.c (elf_section_ignore_discarded_relocs): Revert last
4982         change.  Comment.
4983         (elf_section_complain_discarded): New function.  Handle
4984         .gcc_except_table too.
4985         (elf_link_input_bfd): Rewrite handling of relocs against symbols
4986         in discarded sections.
4987         * elf-bfd.h (elf_discarded_section): Protect macro arg.
4988
4989 2004-06-30  James E Wilson  <wilson@specifixinc.com>
4990
4991         * elfxx-ia64.c (elfNN_ia64_check_relocs): New local pltoff.  Initialize
4992         to NULL.  Call get_pltoff if NULL and NEED_PLTOFF is true.
4993
4994 2004-06-30  H.J. Lu  <hongjiu.lu@intel.com>
4995
4996         PR 233
4997         * elflink.c (elf_link_input_bfd): Issue an error for non-debug
4998         local references to discarded sections and report their
4999         locations.
5000
5001 2004-06-30  Alan Modra  <amodra@bigpond.net.au>
5002
5003         * elflink.c (elf_section_ignore_discarded_relocs): Don't test
5004         sec_info_type, test section name instead.
5005
5006 2004-06-29  H.J. Lu  <hongjiu.lu@intel.com>
5007
5008         PR 240
5009         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't relax branch
5010         in .init/.fini sections.
5011
5012 2004-06-29  Bob Wilson  <bob.wilson@acm.org>
5013
5014         * elf32-xtensa.c (elf_xtensa_relocate_section): Use
5015         bfd_get_section_limit.
5016
5017 2004-06-29  Bob Wilson  <bob.wilson@acm.org>
5018
5019         * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Don't change the
5020         output section size.
5021
5022 2004-06-29  Alan Modra  <amodra@bigpond.net.au>
5023
5024         * elf64-mmix.c (mmix_set_relaxable_size): Save original size in
5025         rawsize.
5026         (mmix_elf_perform_relocation): Adjust for above change.
5027         (mmix_elf_relocate_section): Likewise.
5028         (mmix_elf_relax_section): Likewise.  Use output_section->rawsize.
5029         (mmix_elf_get_section_contents): Delete.
5030         (bfd_elf64_get_section_contents): Delete.
5031         (mmix_elf_relocate_section): Zero stub area.
5032         * linker.c (default_indirect_link_order): Alloc max of section size
5033         and rawsize.
5034         * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
5035         * section.c (bfd_malloc_and_get_section): Likewise.
5036         (struct bfd_section): Update rawsize comment.
5037         * bfd-in2.h: Regenerate.
5038
5039         * reloc16.c (bfd_coff_reloc16_relax_section): Set rawsize.
5040
5041 2004-06-29  Alan Modra  <amodra@bigpond.net.au>
5042
5043         * bfd-in.h (bfd_get_section_limit): Define.
5044         * reloc.c (bfd_perform_relocation, bfd_install_relocation)
5045         (_bfd_final_link_relocate): Use bfd_get_section_limit.
5046         * aout-tic30.c (tic30_aout_final_link_relocate): Likewise.
5047         * coff-arm.c (coff_arm_relocate_section): Likewise.
5048         * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): Likewise.
5049         * cpu-ns32k.c (do_ns32k_reloc): Likewise.
5050         (bfd_ns32k_final_link_relocate): Likewise.
5051         * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): Likwise.
5052         * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): Likewise.
5053         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc)
5054         (i860_howto_highadj_reloc, i860_howto_splitn_reloc): Likewise.
5055         * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc)
5056         (m32r_elf_generic_reloc, m32r_elf_relocate_section): Likewise.
5057         * elf32-m68hc1x.c (m68hc11_elf_special_reloc): Likewise.
5058         * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
5059         * elf32-or32.c (or32_elf_consth_reloc): Likewise.
5060         * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Likewise.
5061         * elf32-s390.c (s390_elf_ldisp_reloc): Likewise.
5062         * elf32-sh.c (sh_elf_reloc_loop): Likewise.
5063         * elf32-sparc.c (sparc_elf_wdisp16_reloc): Likewise.
5064         (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc): Likwise.
5065         * elf32-v850.c (v850_elf_reloc): Likewise.
5066         * elf32-xstormy16.c (xstormy16_elf_24_reloc): Likewise.
5067         * elf32-xtensa.c (bfd_elf_xtensa_reloc): Likewise.
5068         * elf64-alpha.c (elf64_alpha_reloc_gpdisp): Likewise.
5069         * elf64-mips.c (mips_elf64_gprel32_reloc)
5070         (mips16_gprel_reloc): Likewise.
5071         * elf64-mmix.c (mmix_elf_reloc): Likewise.
5072         * elf64-s390.c (s390_elf_ldisp_reloc): Likewise.
5073         * elf64-sparc.c (init_insn_reloc): Likewise.
5074         * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
5075         * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp)
5076         (_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_lo16_reloc)
5077         (_bfd_mips_elf_generic_reloc): Likewise.
5078         * bfd-in2.h: Regenerate.
5079
5080 2004-06-28  Alan Modra  <amodra@bigpond.net.au>
5081
5082         * bfd-in.h (struct stab_info): Move from stabs.c.
5083         * stabs.c (struct stab_link_includes_table): Delete.
5084         (stab_link_includes_lookup): Delete.
5085         (_bfd_write_section_stabs, _bfd_write_stab_strings): Remove one
5086         level of indirection from sinfo parm.
5087         (_bfd_link_section_stabs): Likewise.  Set SEC_LINKER_CREATED on
5088         stabstr section.  Adjust hash table accesses.
5089         * coff-ppc.c (ppc_bfd_coff_final_link): Do include rawsize in contents
5090         alloc.  Adjust stab_info test.
5091         * cofflink.c (_bfd_coff_link_hash_table_init): Clear stab_info.
5092         (_bfd_coff_final_link): Adjust stab_info test.
5093         (_bfd_coff_link_input_bfd): Ignore SEC_LINKER_CREATED sections.
5094         * elf-bfd.h (struct elf_link_hash_table): Include struct stab_info
5095         in place.
5096         * libcoff-in.h (struct coff_link_hash_table): Likewise.
5097         * elf.c (_bfd_elf_link_hash_table_init): Clear stab_info.
5098         * elflink.c (bfd_elf_final_link): Don't attempt to link linker created
5099         stabstr section.  Adjust stab_info test.
5100         * libbfd-in.h (_bfd_link_section_stabs, _bfd_write_section_stabs)
5101         (_bfd_write_stab_strings): Adjust prototypes.
5102         * libbfd.h: Regenerate.
5103         * libcoff.h: Regenerate.
5104         * bfd-in2.h: Regenerate.
5105
5106 2004-06-27  Mark Kettenis  <kettenis@gnu.org>
5107
5108         From Miod Vallat <miod@online.fr>:
5109         * aoutx.h (NAME(aout,machine_type)): Handle bfd_arch_m88k.
5110
5111 2004-06-26  Alexandre Oliva  <aoliva@redhat.com>
5112
5113         * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): Delete.
5114         (struct elf32_mn10300_link_hash_entry): Remove
5115         pcrel_relocs_copied.
5116         (mn10300_elf_check_relocs): Only reserve dynamic relocations for
5117         R_MN10300_32.  Don't adjust pcrel_relocs_copied.
5118         (mn10300_elf_final_link_relocate): Fail for direct, pc-relative
5119         and gotoff relocations if the symbol doesn't bind locally.  Use
5120         _bfd_elf_symbol_refs_local_p to test.  Don't create dynamic
5121         relocation for PCREL32.
5122         (mn10300_elf_relocate_section): Use _bfd_elf_symbol_refs_local_p
5123         to test whether a symbol binds locally.
5124         (elf32_mn10300_link_hash_newfunc): Don't initialize
5125         pcrel_relocs_copied.
5126         (_bfd_mn10300_elf_discard_copies): Delete.
5127         (_bfd_mn10300_elf_size_dynamic_sections): Don't call it.
5128
5129 2004-06-26  Mark Kettenis  <kettenis@gnu.org>
5130
5131         * config.bfd: Replace m88k-*-openbsd* with m88*-*-openbsd*.
5132
5133 2004-06-25  Joel Brobecker  <brobecker@gnat.com>
5134
5135         * som.c (som_set_reloc_info): Correct small typo.
5136
5137 2004-06-25  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
5138
5139         * elf32-m32r.c (m32r_elf_howto_table): Support R_M32R_GOTOFF.
5140         (m32r_elf_relocate_section): Changed for R_M32R_GOTOFF.
5141         (m32r_elf_gcsweep_hook): Likewise.
5142         (m32r_elf_check_relocs): Likewise.
5143         (m32r_elf_howto_table): Added R_M32R_GOTOFF_HI_ULO,
5144         R_M32R_GOTOFF_HI_SLO and R_M32R_GOTOFF_LO.
5145         * reloc.c: Added BFD_RELOC_M32R_GOTOFF_HI_ULO,
5146         BFD_RELOC_M32R_GOTOFF_HI_SLO and BFD_RELOC_M32R_GOTOFF_LO.
5147         * bfd-in2.h: Regenerated.
5148         * libbfd.h: Regenerated.
5149
5150 2004-06-24  H.J. Lu  <hongjiu.lu@intel.com>
5151
5152         * elf64-x86-64.c (elf64_x86_64_check_relocs): Warn overflow
5153         relocation symbol.
5154         (elf64_x86_64_relocate_section): Issue an error for
5155         R_X86_64_PC8, R_X86_64_PC16 and R_X86_64_PC32 relocations
5156         against global symbols when building shared library.
5157
5158 2004-06-24  Alan Modra  <amodra@bigpond.net.au>
5159
5160         * section.c (struct sec): Rename "_cooked_size" to "size".
5161         Rename "_raw_size" to "rawsize".
5162         (STD_SECTION): Adjust comments.
5163         (bfd_set_section_size, bfd_get_section_contents): Use size.
5164         (bfd_malloc_and_get_section): New function.
5165         * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size.
5166         * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early.
5167         Correctly free reloc and contents memory.
5168         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME
5169         and fake CIE now that we can shink section size to zero.
5170         (_bfd_elf_write_section_eh_frame): Likewise..
5171         * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents.
5172         * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use
5173         _bfd_stab_section_offset.  Use _bfd_elf_section_offset.
5174         * stabs.c (_bfd_stab_section_offset_): Remove unused args and
5175         unneeded indirection.
5176         * elf.c (_bfd_elf_section_offset): .. and update call.
5177         * libbfd-in.h (_bfd_stab_section_offset): Update prototype.
5178         * libbfd.h: Regenerate.
5179         * bfd-in2.h: Regenerate.
5180
5181         Replace occurrences of "_raw_size" and "_cooked_size" in most places
5182         with "size".  Set new "rawsize" for stabs, eh_frame, and SEC_MERGE
5183         sections.  Use "rawsize", if non-zero, for bfd_get_section_contents
5184         calls if the section might be a stabs, eh_frame, or SEC_MERGE section.
5185         Similarly use "rawsize", if non-zero, in reloc functions to validate
5186         reloc addresses.  Use new bfd_malloc_and_get_section in most places
5187         where bfd_get_section_contents was called.  Expand all occurrences of
5188         bfd_section_size and bfd_get_section_size.  Rename "raw_size" var in
5189         grok_prstatus and similar functions to "size".
5190         * aix386-core.c (aix386_core_file_p): ..
5191         * aix5ppc-core.c (xcoff64_core_p): ..
5192         * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents,
5193         aout_adobe_set_section_contents): ..
5194         * aout-target.h (callback): ..
5195         * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate,
5196         MY_bfd_final_link): ..
5197         * aoutf1.h (sunos4_core_file_p): ..
5198         * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic,
5199         adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags,
5200         final_link, aout_link_input_section): ..
5201         * binary.c (binary_object_p, binary_canonicalize_symtab,
5202         binary_set_section_contents): ..
5203         * bout.c (b_out_callback, b_out_write_object_contents,
5204         b_out_set_section_contents, b_out_bfd_relax_section,
5205         b_out_bfd_get_relocated_section_contents): ..
5206         * cisco-core.c (cisco_core_file_validate): ..
5207         * coff-alpha.c (alpha_ecoff_object_p,
5208         alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): ..
5209         * coff-arm.c (coff_arm_relocate_section,
5210         bfd_arm_allocate_interworking_sections): ..
5211         * coff-h8300.c (h8300_reloc16_extra_cases,
5212         h8300_bfd_link_add_symbols): ..
5213         * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): ..
5214         * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section,
5215         ppc_bfd_coff_final_link): ..
5216         * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): ..
5217         * coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
5218         sh_align_loads, sh_coff_get_relocated_section_contents): ..
5219         * coff64-rs6000.c (xcoff64_write_object_contents,
5220         xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): ..
5221         * coffcode.h (coff_compute_section_file_positions,
5222         coff_write_object_contents): ..
5223         * coffgen.c (make_a_section_from_file, coff_write_symbols,
5224         coff_section_symbol, build_debug_section): ..
5225         * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link,
5226         process_embedded_commands, _bfd_coff_link_input_bfd,
5227         _bfd_coff_write_global_sym): ..
5228         * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): ..
5229         * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): ..
5230         * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): ..
5231         * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
5232         _bfd_dwarf2_find_nearest_line): ..
5233         * ecoff.c (bfd_debug_section, ecoff_set_symbol_info,
5234         ecoff_compute_section_file_positions,
5235         _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): ..
5236         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame,
5237         _bfd_elf_discard_section_eh_frame_hdr,
5238         _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset,
5239         _bfd_elf_write_section_eh_frame,
5240         _bfd_elf_write_section_eh_frame_hdr): ..
5241         * elf-hppa.h (elf_hppa_sort_unwind): ..
5242         * elf-m10200.c (mn10200_elf_relax_section,
5243         mn10200_elf_relax_delete_bytes,
5244         mn10200_elf_get_relocated_section_contents): ..
5245         * elf-m10300.c (_bfd_mn10300_elf_create_got_section,
5246         mn10300_elf_check_relocs, mn10300_elf_relax_section,
5247         mn10300_elf_relax_delete_bytes,
5248         mn10300_elf_get_relocated_section_contents,
5249         _bfd_mn10300_elf_adjust_dynamic_symbol,
5250         _bfd_mn10300_elf_discard_copies,
5251         _bfd_mn10300_elf_size_dynamic_sections,
5252         _bfd_mn10300_elf_finish_dynamic_sections): ..
5253         * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list,
5254         _bfd_elf_make_section_from_phdr, elf_fake_sections,
5255         bfd_elf_set_group_contents, map_sections_to_segments,
5256         elf_sort_sections, assign_file_positions_for_segments,
5257         SECTION_SIZE, copy_private_bfd_data,
5258         _bfd_elf_get_dynamic_reloc_upper_bound,
5259         _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect,
5260         _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus,
5261         elfcore_grok_lwpstatus, elfcore_grok_win32pstatus,
5262         elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs,
5263         _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): ..
5264         * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect,
5265         bfd_elf32_arm_process_before_allocation,
5266         elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs,
5267         elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections,
5268         elf32_arm_write_section): ..
5269         * elf32-cris.c (cris_elf_grok_prstatus,
5270         elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook,
5271         elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol,
5272         cris_elf_check_relocs, elf_cris_size_dynamic_sections,
5273         elf_cris_discard_excess_dso_dynamics,
5274         elf_cris_discard_excess_program_dynamics): ..
5275         * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): ..
5276         * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): ..
5277         * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup,
5278         _frv_create_got_section, _frvfdpic_assign_plt_entries,
5279         elf32_frvfdpic_size_dynamic_sections,
5280         elf32_frvfdpic_modify_segment_map,
5281         elf32_frvfdpic_finish_dynamic_sections): ..
5282         * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes,
5283         elf32_h8_get_relocated_section_contents): ..
5284         * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub,
5285         elf32_hppa_adjust_dynamic_symbol, allocate_plt_static,
5286         allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections,
5287         elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs,
5288         elf32_hppa_finish_dynamic_sections): ..
5289         * elf32-i370.c (i370_elf_adjust_dynamic_symbol,
5290         i370_elf_size_dynamic_sections, i370_elf_check_relocs,
5291         i370_elf_finish_dynamic_sections): ..
5292         * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol,
5293         allocate_dynrelocs, elf_i386_size_dynamic_sections,
5294         elf_i386_relocate_section, elf_i386_finish_dynamic_sections): ..
5295         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
5296         i860_howto_highadj_reloc, i860_howto_splitn_reloc): ..
5297         * elf32-ip2k.c (ip2k_is_switch_table_128,
5298         ip2k_relax_switch_table_128, ip2k_is_switch_table_256,
5299         ip2k_relax_switch_table_256, ip2k_elf_relax_section,
5300         adjust_all_relocations, ip2k_elf_relax_delete_bytes): ..
5301         * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc,
5302         m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol,
5303         allocate_dynrelocs, m32r_elf_size_dynamic_sections,
5304         m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections,
5305         m32r_elf_relax_section, m32r_elf_relax_delete_bytes,
5306         m32r_elf_get_relocated_section_contents): ..
5307         * elf32-m68hc11.c (m68hc11_elf_build_one_stub,
5308         m68hc11_elf_size_one_stub, m68hc11_elf_relax_section,
5309         m68hc11_elf_relax_delete_bytes): ..
5310         * elf32-m68hc12.c (m68hc12_elf_build_one_stub,
5311         m68hc12_elf_size_one_stub): ..
5312         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs,
5313         elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): ..
5314         * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook,
5315         elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections,
5316         elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): ..
5317         * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
5318         elf32_mips_grok_prstatus): ..
5319         * elf32-or32.c (or32_elf_consth_reloc): ..
5320         * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc,
5321         elf_create_pointer_linker_section, ppc_elf_create_linker_section,
5322         ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol,
5323         allocate_dynrelocs, ppc_elf_size_dynamic_sections,
5324         ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus,
5325         ppc_elf_final_write_processing): ..
5326         * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
5327         allocate_dynrelocs, elf_s390_size_dynamic_sections,
5328         elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): ..
5329         * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section,
5330         sh_elf_relax_delete_bytes, sh_elf_align_loads,
5331         sh_elf_adjust_dynamic_symbol, allocate_dynrelocs,
5332         sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents,
5333         sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): ..
5334         * elf32-sh64-com.c (sh64_address_in_cranges,
5335         sh64_get_contents_type): ..
5336         * elf32-sh64.c (sh64_find_section_for_address,
5337         sh64_elf_final_write_processing): ..
5338         * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc,
5339         sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol,
5340         allocate_dynrelocs, elf32_sparc_size_dynamic_sections,
5341         elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): ..
5342         * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): ..
5343         * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol,
5344         elf_vax_size_dynamic_sections, elf_vax_discard_copies,
5345         elf_vax_instantiate_got_entries, elf_vax_relocate_section,
5346         elf_vax_finish_dynamic_sections): ..
5347         * elf32-xstormy16.c (xstormy16_elf_24_reloc,
5348         xstormy16_elf_check_relocs, xstormy16_relax_plt_check,
5349         xstormy16_elf_relax_section, xstormy16_elf_always_size_sections,
5350         xstormy16_elf_finish_dynamic_sections): ..
5351         * elf32-xtensa.c (xtensa_read_table_entries,
5352         elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size,
5353         elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc,
5354         bfd_elf_xtensa_reloc, elf_xtensa_relocate_section,
5355         elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections,
5356         elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus,
5357         get_relocation_opcode, retrieve_contents, find_relaxable_sections,
5358         collect_source_relocs, is_resolvable_asm_expansion, remove_literals,
5359         relax_section, shrink_dynamic_reloc_sections, relax_property_section,
5360         xtensa_callback_required_dependence): ..
5361         * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section,
5362         elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol,
5363         elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets,
5364         elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1,
5365         elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes,
5366         elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1,
5367         elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel,
5368         elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): ..
5369         * elf64-hppa.c (allocate_dynrel_entries,
5370         elf64_hppa_size_dynamic_sections,
5371         elf64_hppa_finish_dynamic_sections): ..
5372         * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc,
5373         mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table,
5374         elf64_mips_grok_prstatus): ..
5375         * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc,
5376         mmix_elf_relocate_section, mmix_elf_final_link,
5377         mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation,
5378         mmix_elf_relax_section, mmix_elf_get_section_contents): ..
5379         * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus,
5380         ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust,
5381         ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd,
5382         allocate_dynrelocs, ppc64_elf_size_dynamic_sections,
5383         ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section,
5384         toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs,
5385         ppc64_elf_build_stubs, ppc64_elf_relocate_section,
5386         ppc64_elf_finish_dynamic_sections): ..
5387         * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
5388         allocate_dynrelocs, elf_s390_size_dynamic_sections,
5389         elf_s390_finish_dynamic_sections): ..
5390         * elf64-sh64.c (sh_elf64_get_relocated_section_contents,
5391         sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol,
5392         sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections,
5393         sh64_elf64_finish_dynamic_sections): ..
5394         * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc,
5395         sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol,
5396         sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section,
5397         sparc64_elf_finish_dynamic_symbol,
5398         sparc64_elf_finish_dynamic_sections): ..
5399         * elf64-x86-64.c (elf64_x86_64_grok_prstatus,
5400         elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs,
5401         elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section,
5402         elf64_x86_64_finish_dynamic_sections): ..
5403         * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): ..
5404         * elfcode.h (elf_slurp_reloc_table): ..
5405         * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag,
5406         elf_finalize_dynstr, elf_link_add_object_symbols,
5407         bfd_elf_size_dynamic_sections, elf_link_sort_relocs,
5408         elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): ..
5409         * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
5410         elf32_mips_grok_prstatus): ..
5411         * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries,
5412         elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc,
5413         elfNN_ia64_choose_gp, elfNN_ia64_final_link,
5414         elfNN_ia64_finish_dynamic_sections): ..
5415         * elfxx-mips.c (mips_elf_create_procedure_table,
5416         mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp,
5417         _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc,
5418         mips_elf_global_got_index, mips_elf_multi_got,
5419         mips_elf_create_compact_rel_section, mips_elf_calculate_relocation,
5420         mips_elf_allocate_dynamic_relocations,
5421         mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections,
5422         _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol,
5423         _bfd_mips_elf_always_size_sections,
5424         _bfd_mips_elf_size_dynamic_sections,
5425         _bfd_mips_elf_finish_dynamic_symbol,
5426         _bfd_mips_elf_finish_dynamic_sections,
5427         _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info,
5428         _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents,
5429         _bfd_elf_mips_get_relocated_section_contents,
5430         _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): ..
5431         * hp300hpux.c (callback): ..
5432         * hppabsd-core.c (make_bfd_asection): ..
5433         * hpux-core.c (make_bfd_asection): ..
5434         * i386linux.c (linux_link_create_dynamic_sections,
5435         bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): ..
5436         * i386msdos.c (msdos_write_object_contents): ..
5437         * i386os9k.c (os9k_callback, os9k_write_object_contents,
5438         os9k_set_section_contents): ..
5439         * ieee.c (parse_expression, ieee_slurp_external_symbols,
5440         ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data,
5441         ieee_write_section_part, do_with_relocs, do_as_repeat,
5442         do_without_relocs, ieee_write_debug_part, init_for_output,
5443         ieee_set_section_contents): ..
5444         * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): ..
5445         * irix-core.c (do_sections, make_bfd_asection): ..
5446         * libaout.h (aout_section_merge_with_text_p): ..
5447         * libbfd.c (_bfd_generic_get_section_contents,
5448         _bfd_generic_get_section_contents_in_window): ..
5449         * linker.c (default_indirect_link_order): ..
5450         * lynx-core.c (make_bfd_asection): ..
5451         * m68klinux.c (linux_link_create_dynamic_sections,
5452         bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): ..
5453         * mach-o.c (bfd_mach_o_make_bfd_section,
5454         bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib,
5455         bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab,
5456         bfd_mach_o_scan_read_segment): ..
5457         * merge.c (_bfd_add_merge_section, record_section, merge_strings,
5458         _bfd_merge_sections): ..
5459         * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc,
5460         mmo_map_set_sizes, mmo_canonicalize_symtab,
5461         mmo_internal_write_section, mmo_write_object_contents): ..
5462         * netbsd-core.c (netbsd_core_file_p): ..
5463         * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import,
5464         nlm_alpha_set_public_section): ..
5465         * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): ..
5466         * nlm32-sparc.c (nlm_sparc_write_import): ..
5467         * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in,
5468         nlm_compute_section_file_positions): ..
5469         * oasys.c (oasys_object_p, oasys_slurp_section_data,
5470         oasys_write_sections, oasys_write_data, oasys_set_section_contents): ..
5471         * opncls.c (get_debug_link_info): ..
5472         * osf-core.c (make_bfd_asection): ..
5473         * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic,
5474         adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs,
5475         final_link, aout_link_input_section): ..
5476         * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out,
5477         pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): ..
5478         * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section,
5479         bfd_pef_scan_start_address, bfd_pef_parse_symbols): ..
5480         * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): ..
5481         * ptrace-core.c (ptrace_unix_core_file_p): ..
5482         * reloc.c (bfd_perform_relocation, bfd_install_relocation,
5483         _bfd_final_link_relocate, bfd_generic_relax_section,
5484         bfd_generic_get_relocated_section_contents): ..
5485         * reloc16.c (bfd_coff_reloc16_relax_section,
5486         bfd_coff_reloc16_get_relocated_section_c): ..
5487         * riscix.c (riscix_some_aout_object_p): ..
5488         * rs6000-core.c (read_hdr, make_bfd_asection): ..
5489         * sco5-core.c (make_bfd_asection): ..
5490         * simple.c (bfd_simple_get_relocated_section_contents): ..
5491         * som.c (som_object_setup, setup_sections, som_prep_headers,
5492         som_write_fixups, som_begin_writing, bfd_section_from_som_symbol,
5493         som_set_reloc_info, som_get_section_contents,
5494         som_bfd_link_split_section): ..
5495         * sparclinux.c (linux_link_create_dynamic_sections,
5496         bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): ..
5497         * srec.c (srec_scan, srec_read_section, srec_get_section_contents): ..
5498         * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs,
5499         _bfd_write_stab_strings, _bfd_stab_section_offset): ..
5500         * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections,
5501         bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs,
5502         sunos_scan_ext_relocs, sunos_scan_dynamic_symbol,
5503         sunos_write_dynamic_symbol, sunos_check_dynamic_reloc,
5504         sunos_finish_dynamic_link): ..
5505         * syms.c (_bfd_stab_section_find_nearest_line): ..
5506         * tekhex.c (first_phase, tekhex_set_section_contents,
5507         tekhex_write_object_contents): ..
5508         * trad-core.c (trad_unix_core_file_p): ..
5509         * versados.c (process_esd, process_otr, process_otr): ..
5510         * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): ..
5511         * vms-misc.c (add_new_contents): ..
5512         * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): ..
5513         * vms.c (vms_set_section_contents): ..
5514         * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols,
5515         xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms,
5516         _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): ..
5517         * xsym.c (bfd_sym_scan): .. See above.
5518
5519 2004-06-21  H.J. Lu  <hongjiu.lu@intel.com>
5520
5521         * elfxx-ia64.c (elfNN_ia64_relax_section): Add addend when
5522         calling _bfd_merged_section_offset only for section symbols.
5523
5524 2004-06-22  Alan Modra  <amodra@bigpond.net.au>
5525
5526         * elf32-ppc.c (ppc_elf_relax_section): Implement reference code
5527         for handling SEC_MERGE symbols in relax_section.
5528
5529 2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
5530
5531         2003-05-15  Richard Sandiford  <rsandifo@redhat.com>
5532         * cpu-h8300.c (compatible): Allow h8300s and h8300sx code to be
5533         linked together. Mark the result as h8300sx code.
5534
5535 2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
5536
5537         * elf-bfd.h (struct elf_backend_data): Added
5538         elf_backend_omit_section_dynsym.
5539         (_bfd_elf_link_omit_section_dynsym): Declare.
5540         * elf32-frv.c (_frvfdpic_link_omit_section_dynsym): New.
5541         (elf_backend_omit_section_dynsym): Use it for frvfdpic.
5542         * elflink.c (_bfd_elf_link_omit_section_dynsym): Split out of...
5543         (_bfd_elf_link_renumber_dynsyms): ... this function.
5544         * elfxx-target.h (elf_backend_omit_section_dynsym): Default to
5545         _bfd_elf_link_omit_section_dynsym).
5546         (elfNN_bed): Added elf_backend_omit_section_dynsym.
5547
5548 2004-06-21  Nick Clifton  <nickc@redhat.com>
5549
5550         * coffcode.h (styp_to_sec_flags): Ignore IMAGE_SCN_MEM_NOT_PAGED
5551         flags.
5552
5553 2004-06-17  Jerome Guitton  <guitton@gnat.com>
5554
5555         * bfd-in.h (bfd_cache_close_all): New function declaration.
5556         * bfd-in2.h: Regenerate.
5557         * cache.c (bfd_cache_close_all): New function definition.
5558
5559 2004-06-16  Mark Kettenis  <kettenis@gnu.org>
5560
5561         * configure.in: Don't set COREFILE to trad-core.lo for FreeBSD
5562         4.10 and beyond.
5563         * configure: Regenerate.
5564
5565 2004-06-16  Daniel Jacobowitz  <dan@debian.org>
5566
5567         * elf32-ppc.c (ppc_elf_create_linker_section): Create symbols in
5568         the pre-existing section.
5569
5570 2004-06-15  Alan Modra  <amodra@bigpond.net.au>
5571
5572         * section.c (struct sec): Remove usused flags.  Reorganize a little.
5573         (bfd_get_section_size_before_reloc): Delete.
5574         (bfd_get_section_size_after_reloc): Delete.
5575         (STD_SECTION): Update.
5576         (bfd_get_section_size_now): Delete.
5577         (bfd_set_section_contents): Don't referece reloc_done.
5578         (bfd_get_section_contents): Remove reloc_done comment.
5579         * bout.c (b_out_bfd_get_relocated_section_contents): Don't set
5580         reloc_done.
5581         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise.
5582         * ecoff.c (bfd_debug_section): Update initializer.
5583         * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Ditto.
5584         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
5585         * bfd-in.h (bfd_section_size): Expand.
5586         (bfd_get_section_size): New macro.
5587         * bfd-in2.h: Regenerate.
5588         * coff64-rs6000.c (xcoff64_write_object_contents): Replace
5589         bfd_get_section_size_before_reloc with bfd_get_section_size.
5590         * coffcode.h (coff_write_object_contents): Likewise.
5591         * coffgen.c (build_debug_section): Likewise.
5592         * dwarf1.c (parse_line_table): Likewise.
5593         (_bfd_dwarf1_find_nearest_line): Likewise.
5594         * ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
5595         * i386msdos.c (msdos_write_object_contents): Likewise.
5596         * pdp11.c (squirt_out_relocs): Likewise.
5597         * elf32-sh64.c (sh64_find_section_for_address): Remove comment.
5598         * elf64-mmix.c (mmix_elf_final_link): Update comment.
5599
5600 2004-06-14  Chris Demetriou  <cgd@broadcom.com>
5601
5602         * elf32-mips.c (elf_mips_gnu_pcrel32): Add (undoing 2004-04-24
5603         removal) with updated comment.
5604         (bfd_elf32_bfd_reloc_type_lookup): Add back case for
5605         BFD_RELOC_32_PCREL.
5606         (mips_elf32_rtype_to_howto): Add back case for R_MIPS_PC32.
5607         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
5608
5609 2004-06-12  Alan Modra  <amodra@bigpond.net.au>
5610
5611         * elf64-x86-64.c (elf64_x86_64_relocate_section): Ignore reloc
5612         overflow on branches to undefweaks.
5613
5614 2004-06-11  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
5615
5616         * coff-alpha.c (alpha_relocate_section): Set used_by_bfd directly
5617         as ecoff_section_data() does not return a valid lvalue.
5618
5619 2004-06-09  Alexandre Oliva  <aoliva@redhat.com>
5620
5621         * elflink.c (elf_sort_symbol): Compare section id, not pointers.
5622         (elf_link_add_object_symbols): Likewise.
5623
5624         * elf-m10300.c (_bfd_mn10300_elf_reloc_type_class): New.
5625         (elf_backend_reloc_type_class): New.
5626
5627 2004-06-08  Mark Kettenis  <kettenis@gnu.org>
5628
5629         * configure.in (hppa*-*-netbsd*, hppa*-*-openbsd): Set COREFILE to
5630         netbsd-core.lo.
5631         * configure: Regenerate.
5632
5633 2004-06-07  Daniel Jacobowitz  <dan@debian.org>
5634
5635         From:  Albert Chin-A-Young  <china@thewrittenword.com>
5636         * bfd/elf-bfd.h (struct eh_cie_fde): Convert unsigned char bitfields
5637         to unsigned int.
5638
5639 2004-05-29  H.J. Lu  <hongjiu.lu@intel.com>
5640
5641         * elfxx-ia64.c (elfNN_ia64_relax_section): Undo the last
5642         change.
5643
5644 2004-05-28  DJ Delorie  <dj@redhat.com>
5645
5646         * elf-m10300.c (mn10300_elf_relax_section): Preserve reloc addend
5647         for linking, but otherwise adjust reloc for merged sections.
5648
5649 2004-05-28  H.J. Lu  <hongjiu.lu@intel.com>
5650
5651         * elfxx-ia64.c (elfNN_ia64_relax_section): Properly call
5652         _bfd_merged_section_offset for local symbols.
5653
5654 2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
5655
5656         * Makefile.am: Regenerate dependencies.
5657         * Makefile.in: Regenerate.
5658         * archures.c: Add bfd_mach_sh3_nommu .
5659         * bfd-in2.h: Regenerate.
5660         * cpu-sh.c: Add sh3-nommu architecture.
5661         (bfd_to_arch_table): Create new table.
5662         (sh_get_arch_from_bfd_mach): Create new function.
5663         (sh_get_arch_up_from_bfd_mach): Create new function.
5664         (sh_merge_bfd_arch): Create new function.
5665         * elf32-sh.c (sh_ef_bfd_table): Add table.
5666         (sh_elf_check_relocs): Replace switch statement with
5667         use of sh_ef_bfd_table .
5668         (sh_elf_get_flags_from_mach): Add new function.
5669         (sh_find_elf_flags): Likewise.
5670         (sh_elf_copy_private_data): Replace most of non-elf contents
5671         with a call to sh_merge_bfd_arch() .
5672
5673 2004-05-27  Michael Chastain  <mec.gnu@mindspring.com>
5674
5675         * Makefile.am (bfdver.h): Use explicit filename, not $< .
5676         * Makefile.in: Regenerate.
5677
5678 2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
5679
5680         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Avoid
5681         custom calling conventions for dynamic symbols.
5682         (mn10300_elf_relax_section): Avoid relaxing a function as a local
5683         symbol if it's an alias to a global one.
5684
5685 2004-05-26  H.J. Lu  <hongjiu.lu@intel.com>
5686
5687         * elf.c (_bfd_elf_make_section_from_shdr): Undo the last
5688         change.
5689
5690 2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
5691
5692         * elf-m10300.c (mn10300_elf_relax_section): Don't test isym within
5693         loop over hashes.
5694
5695 2004-05-26  Alan Modra  <amodra@bigpond.net.au>
5696
5697         * elf.c (_bfd_elf_make_section_from_shdr): Don't set SEC_EXCLUDE
5698         for SHT_GROUP sections.
5699
5700 2004-05-25  Alan Modra  <amodra@bigpond.net.au>
5701
5702         * elflink.c (elf_link_add_object_symbols): Don't set up merge
5703         section data here..
5704         * elf.c (_bfd_elf_merge_sections): .. Do it here instead.
5705         * merge.c: Formatting.  Remove unnecessary casts.  Expand
5706         bfd_get_section_alignment macro.
5707         (struct sec_merge_sec_info): Rename "first" to "first_str".  Update
5708         use throughout file.
5709         (_bfd_add_merge_section): Rename from _bfd_merge_section.  Update
5710         comment.  Abort on dynamic or non-SEC_MERGE input.  Don't test
5711         section name to determine sinfo group, instead test output section
5712         and alignment.
5713         (_bfd_merge_sections): Add struct bfd_link_info param.  Call
5714         _bfd_strip_section_from_output rather than just twiddling flags.
5715         * libbfd-in.h (_bfd_add_merge_section): Rename, update comment.
5716         (_bfd_merge_sections): Update prototype.
5717         * libbfd.h: Regenerate.
5718
5719 2004-05-24  Mark Kettenis  <kettenis@gnu.org>
5720
5721         * netbsd-core.c: Correctly indent section that sets architecture
5722         from machine ID.
5723
5724         From Miod Vallat <miod@online.fr>:
5725         * m88kopenbsd.c: New file.
5726         * targets.c (m88k_openbsd_vec): New.
5727         * config.bfd: Add m88k-*-openbsd*.
5728         * configure.in (m88k-*-openbsd*): Set COREFILE to netbsd-core.lo.
5729         (m88kopenbsd_vec): New.
5730         * configure: Regenerate.
5731         * Makefile.am (BFD32_BACKENDS): Add m88kopenbsd.lo.
5732         (BFD32_BACKENDS_CFILES): Add m88kopenbsd.c.
5733         Run "make dep-am".
5734         * Makefile.in: Regenerate.
5735         * po/SRC-POTFILES.in: Regenerate.
5736
5737 2004-05-24  Nick Clifton  <nickc@redhat.com>
5738
5739         * hash.c: Remove bogus node "Changing the default Hash Table Size"
5740         introduced by hash table size patch.
5741
5742 2004-05-22  Ben Elliston  <bje@au.ibm.com>
5743
5744         * configure.in (is_release): Remove.
5745         (bfd_version_date, bfd_version, bfd_version_string): Likewise.
5746         (AC_OUTPUT): Don't output bfdver.h from version.h.
5747         * configure: Regenerate.
5748         * Makefile.am (RELEASE): New variable.
5749         (bfdver.h): New target.
5750         * Makefile.in: Regenerate.
5751         * doc/Makefile.in: Likewise.
5752
5753 2004-05-22  Ben Elliston  <bje@au.ibm.com>
5754
5755         * Makefile.am (config.status): Don't depend on version.h.
5756         * Makefile.in: Regenerate.
5757
5758 2004-05-22  Alan Modra  <amodra@bigpond.net.au>
5759
5760         * merge.c (_bfd_merged_section_offset): Remove "addend" param.
5761         * libbfd-in.h (_bfd_merged_section_offset): Adjust prototype.
5762         * libbfd.h: Regenerate.
5763         * elf.c (_bfd_elf_rela_local_sym): Adjust call.
5764         (_bfd_elf_rel_local_sym): Likewise.
5765         * elflink.c (_bfd_elf_link_sec_merge_syms): Likewise.
5766         (elf_link_input_bfd): Likewise.
5767         * elf32-ppc.c (ppc_elf_relax_section): Likewise.
5768         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
5769         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
5770         (elfNN_ia64_relocate_section): Likewise.
5771
5772 2004-05-21  Andy Chittenden  <achittenden@bluearc.com>
5773
5774         * hash.c (bfd_default_hash_table_size): New variable.
5775         (bfd_hash_table_init): Use new variable instead of DEFAULT_SIZE.
5776         (bfd_hash_set_default_size): New function.  Set the default size
5777         to a selected prime number close to the argument.  Document new
5778         function.
5779         * bfd-in.h: Add prototype for  bfd_hash_set_default_size.
5780         * bfd-in2.h: Regenerate.
5781         * Makefile.am (hash.lo): Add dependency upon libiberty.h.
5782         * Makefile.in: Regenerate.
5783
5784 2004-05-21  Mark Kettenis  <kettenis@gnu.org>
5785
5786         * libaout.h (machine_type): Add M_88K_OPENBSD and M_HPPA_OPENBSD.
5787         * netbsd-core.c (netbsd_core_file_p): Set architecture for alpha,
5788         arm, m68k, m88k and hppa core files.
5789
5790 2004-05-21  Nick Clifton  <nickc@redhat.com>
5791
5792         * bfdio.c (bfd_bread): Do not use iovec if it is NULL.
5793         (bfd_bwrite): Likewise.
5794         (bfd_tell): Likewise.
5795         (bfd_flush): Likewise.
5796         (bfd_stat): Likewise.
5797         (bfd_seek): Likewise.
5798         (bfd_get_mtime): Likewise.
5799         (bfd_get_size): Likewise.
5800
5801 2004-05-19  Ben Elliston  <bje@au.ibm.com>
5802
5803         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Comment correction.
5804
5805 2004-05-19  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
5806
5807         * archive.c (_bfd_get_elt_at_filepos): Cope with a nested archives.
5808         (bfd_generic_openr_next_archived_file): Likewise.
5809
5810 2004-05-17  Bob Wilson  <bob.wilson@acm.org>
5811
5812         * elf32-xtensa.c (xtensa_get_property_section_name): Determine linkonce
5813         section names by inserting a new substring after .gnu.linkonce, except
5814         for .gnu.linkonce.t.* where the "t." is replaced.
5815
5816 2004-05-17  Adam Nemet  <anemet@lnxw.com>
5817
5818         * config.bfd (sparc-*-lynxos* case): Add to obsolete list.
5819         (m68-*-lynxos* case): Likewise.
5820         (powerpc-*-lyxnos* case): New case.
5821         (i[3-7]86-*-lynxos* case): Update to LynxOS 4.0 ELF.
5822
5823 2004-05-17  David Heine  <dlheine@tensilica.com>
5824
5825         * aout-target.h (MY_bfd_copy_private_header_data): Define.
5826         * aout-tic30.c (MY_bfd_copy_private_header_data): Define.
5827         * bfd.c (bfd_copy_private_header_data): Define.
5828         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add entries for new
5829         interface.
5830         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
5831         * coffcode.h (coff_bfd_copy_private_header_data): Define.
5832         * elf-bfd.h (_bfd_elf_copy_private_header_data): Declare.
5833         * elf.c (_bfd_elf_copy_private_section_data): Remove code to set up
5834         segments by calling copy_private_bfd_data.
5835         (_bfd_elf_copy_private_header_data): Define.
5836         * elfxx-target.h (bfd_elfNN_bfd_copy_private_header_data): Define.
5837         * libbfd-in.h (_bfd_generic_bfd_copy_private_header_data): Define.
5838         * libecoff.h (_bfd_ecoff_bfd_copy_private_header_data): Define.
5839         * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Define.
5840         * mmo.c (mmo_bfd_copy_private_header_data): Define.
5841         * ppcboot.c (ppcboot_bfd_copy_private_header_data): Define.
5842         * som.c (som_bfd_copy_private_header_data): Define.
5843         * targets.c (BFD_JUMP_TABLE_COPY): Add _bfd_copy_private_header_data.
5844         * vms.c (vms_bfd_copy_private_header_data): Define.
5845         * bfd-in2.h: Regenerate.
5846         * libbfd.h: Regenerate.
5847
5848 2004-05-15  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
5849
5850         * elfxx-mips.c (MINUS_TWO): Define.
5851         (mips_elf_higher, mips_elf_highest,
5852         mips_elf_create_dynamic_relocation): Use MINUS_ONE and MINUS_TWO for
5853         some bfd_vma values.
5854         (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Code cleanup.
5855
5856 2004-05-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5857
5858         * som.c (log2): Rename to exact_log2.  Adjust all callers.
5859
5860 2004-05-13  Paul Brook  <paul@codesourcery.com>
5861
5862         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle
5863         dwarf3 format CIE entries.  Remove comment about the size of the
5864         ra_column field.  It is now correctly deduced.
5865
5866 2004-05-13  Joel Sherrill <joel@oarcorp.com>
5867
5868         * config.bfd (or32-*-rtems*): Switch to elf.
5869
5870 2004-05-13  Nick Clifton  <nickc@redhat.com>
5871
5872         * po/fr.po: Updated French translation.
5873
5874 2004-05-11  Jakub Jelinek  <jakub@redhat.com>
5875
5876         * elflink.c (bfd_elf_final_link): Don't output STT_SECTION symbol
5877         into .dynsym if elf_section_data (sec)->dynindx <= 0.
5878         Adjust counting of last_local.
5879         (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections
5880         other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt
5881         created by the linker nor !SHF_ALLOC.
5882
5883         * elf32-i386.c (elf_i386_finish_dynamic_sections): Point
5884         DT_PLTGOT to the start of the .got.plt section instead of the
5885         .got output section.  Set sh_entsize for .got section in addition
5886         to .got.plt.
5887         (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
5888         is at sgot->output_section->vma.
5889         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point
5890         DT_PLTGOT to the start of the .got.plt section instead of the
5891         .got output section.
5892         (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
5893         is at sgot->output_section->vma.  Set sh_entsize for .got section
5894         in addition to .got.plt.
5895         * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO.
5896         (bfd_section_from_phdr): Likewise.
5897         (map_sections_to_segments): Likewise.
5898         (assign_file_positions_for_segments): Likewise.
5899         (get_program_header_size): Likewise.
5900         * elflink.c (bfd_elf_size_dynamic_sections): Set
5901         elf_tdata (output_bfd)->relro from info->relro.
5902         * elf-bfd.h (struct elf_obj_tdata): Add relro field.
5903
5904 2004-05-08  Alexandre Oliva  <aoliva@redhat.com>
5905
5906         * elf32-frv.c (_frvfdpic_add_dyn_reloc): Don't warn when we get
5907         a zero symndx for which we hadn't accounted a dynamic relocation.
5908         (_frvfdpic_add_rofixup): Likewise.
5909
5910 2004-05-07  Brian Ford  <ford@vss.fsi.com>
5911             DJ Delorie  <dj@redhat.com>
5912
5913         * coffcode.h (coff_write_object_contents) [COFF_IMAGE_WITH_PE]:
5914         Propagate IMAGE_FILE_LARGE_ADDRESS_AWARE.
5915         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Recognize
5916         IMAGE_FILE_LARGE_ADDRESS_AWARE.  Use PE defines.
5917
5918 2004-05-07  Alexandre Oliva  <aoliva@redhat.com>
5919
5920         * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Return
5921         immediately if there's no link info.
5922         (elf32_frvfdpic_copy_private_bfd_data): New.
5923         (bfd_elf32_bfd_copy_private_bfd_data): Use it for frvfdpic.
5924
5925 2004-05-06  Zack Weinberg  <zack@codesourcery.com>
5926
5927         * dwarf2.c (add_line_info): Also set info->filename to NULL if
5928         filename argument is null; do not call strlen on a null pointer.
5929
5930 2004-05-06  Daniel Jacobowitz  <drow@mvista.com>
5931
5932         * elf32-arm.h (elf32_arm_relocate_section): Remove R_ARM_PLT32
5933         special case.
5934
5935 2004-05-05  Alexandre Oliva  <aoliva@redhat.com>
5936
5937         * configure.in (bfd_elf32_frvfdpic_vec): New.
5938         * configure: Rebuilt.
5939         * targets.c (bfd_elf32_frvfdpic_vec): New.
5940         * config.bfd: Enable it on frv-*-elf and frv-*-*linux*, as default
5941         on the latter.
5942         * elf32-frv.c: Prefix all identifiers added for FDPIC support with
5943         frvfdpic instead of frv.  Rearrange elf-target macros such that
5944         the FDPIC-specific ones are only defined for this new target
5945         vector.
5946         (bfd_elf32_frvfdpic_vec): Declare.
5947         (IS_FDPIC): New.
5948         (elf32_frv_relocate_section): Use it to enable segment checking
5949         and to control rofixup emission.  Add output section vma to
5950         applied relocation in non-LOAD non-ALLOC sections.  Use
5951         _bfd_error_handler for errors.
5952         (_frv_create_got_section): Create .rel.got and .rofixup only in
5953         FDPIC.  Create non-dynamic _gp at .got+2048 in non-FDPIC, like the
5954         linker script.
5955         (elf32_frvfdpic_size_dynamic_sections): Assume FDPIC.
5956         (elf32_frvfdpic_modify_segment_map): Likewise.
5957         (elf32_frv_finish_dynamic_sections): New, do-nothing.
5958         (elf32_frvfdpic_finish_dynamic_sections): Assume FDPIC.  Improve
5959         error message if we miscompute the rofixup size.
5960         (frvfdpic_elf_use_relative_eh_frame): Assume FDPIC.
5961         (frvfdpic_elf_encode_eh_address): Likewise.
5962         (elf32_frv_check_relocs): Reject FDPIC-only relocs in non-FDPIC.
5963         Record relocs only in FDPIC.  Make sure _gp is defined for GPREL
5964         relocs.  Reject unknown relocation types.
5965         (elf32_frv_object_p): Make sure target vector matches FDPIC bits.
5966         (frv_elf_merge_private_bfd_data): Likewise.
5967         (ELF_MAXPAGESIZE): Revert to 0x1000 for elf32-frv; keep it as
5968         0x4000 for newly-added elf32-frvfdpic.
5969
5970 2004-05-05  Nick Clifton  <nickc@redhat.com>
5971
5972         PR/136
5973         * cache.c (bfd_cache_lookup_worker): Call abort() rather than
5974         returning NULL as most users of this function do not check its
5975         return value.
5976         * hppabsd-core.c (hppabsd_core_core_file_p): Do not check result
5977         of bfd_cache_lookup().
5978         * sco5-core.c (sco5_core_file_p): Likewise.
5979         * trad-core.c (trad_unix_core_file_p): Likewise.
5980
5981 2004-05-05  Nick Clifton  <nickc@redhat.com>
5982
5983         * cache.c (bfd_cache_lookup): Improve formatting.
5984         * archive.c: Fix formatting.
5985
5986 2004-05-05  Peter Barada  <peter@the-baradas.com>
5987
5988         * bfd_archures.c(bfd_architecture): Add 521x,5249,547x,548x.
5989         * cpu-m68k.c(bfd_m68k_arch): Likewise.
5990         * bfd-in2.h(bfd_architecture): Regenerate.
5991
5992 2004-05-03  Alan Modra  <amodra@bigpond.net.au>
5993
5994         * elf.c (_bfd_elf_rela_local_sym): Set kept_section for excluded
5995         SEC_MERGE sections.
5996         * elflink.c (elf_link_input_bfd): Adjust output reloc index for
5997         those against discarded link-once and SEC_MERGE section symbols.
5998
5999 2004-05-02  H.J. Lu  <hongjiu.lu@intel.com>
6000
6001         * section.c (bfd_get_section_by_name_if): New.
6002         * bfd-in2.h: Regenerated.
6003
6004 2004-05-02  Alan Modra  <amodra@bigpond.net.au>
6005
6006         * som.c (som_bfd_is_group_section): Define.
6007
6008 2004-05-01  Alan Modra  <amodra@bigpond.net.au>
6009
6010         * section.c (bfd_make_section_anyway): Copy the whole
6011         bfd_hash_entry, not just "next" from existing entry.
6012
6013 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
6014
6015         * elf.c (bfd_section_from_shdr): Maintain the section order in
6016         a section group.
6017         (special_sections): Add ".note.GNU-stack".
6018         (elf_fake_sections): Handle section group for relocatable
6019         link..
6020
6021 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
6022
6023         * section.c (bfd_sections_find_if): New.
6024         * bfd-in2.h: Regenerated.
6025
6026 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
6027
6028         * section.c (bfd_make_section_anyway): Add all sections to hash tab.
6029
6030         * elf-bfd.h (bfd_elf_is_group_section): Declare.
6031         * elf.c (bfd_elf_is_group_section): New function.
6032         * elfxx-target.h (bfd_elfNN_bfd_is_group_section
6033         * section.c (bfd_generic_is_group_section): New function.
6034         * targets.c (struct bfd_target): Add _bfd_is_group_section field.
6035         (BFD_JUMP_TABLE_LINK): Adjust.
6036         * aout-adobe.c (aout_32_bfd_is_group_section): Define.
6037         * aout-target.h (MY_bfd_is_group_section): Define.
6038         * aout-tic30.c (MY_bfd_is_group_section): Define.
6039         * bfd.c (bfd_is_group_section): Define.
6040         * binary.c (binary_bfd_is_group_section): Define.
6041         * bout.c (b_out_bfd_is_group_section): Define.
6042         * coff-alpha.c (_bfd_ecoff_bfd_is_group_section): Define.
6043         * coff-mips.c (_bfd_ecoff_bfd_is_group_section): Define.
6044         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Adjust.
6045         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Adjust.
6046         * coffcode.h (coff_bfd_is_group_section): Define.
6047         * i386msdos.c (msdos_bfd_is_group_section): Define.
6048         * i386os9k.c (os9k_bfd_is_group_section): Define.
6049         * ieee.c (ieee_bfd_is_group_section): Define.
6050         * ihex.c (ihex_bfd_is_group_section): Define.
6051         * libbfd-in.h (_bfd_nolink_bfd_is_group_section): Define.
6052         * mach-o.c (bfd_mach_o_bfd_is_group_section): Define.
6053         * mmo.c (mmo_bfd_is_group_section): Define.
6054         * nlm-target.h (nlm_bfd_is_group_section): Define.
6055         * oasys.c (oasys_bfd_is_group_section): Define.
6056         * pef.c (bfd_pef_bfd_is_group_section): Define.
6057         * ppcboot.c (ppcboot_bfd_is_group_section): Define.
6058         * srec.c (srec_bfd_is_group_section): Define.
6059         * tekhex.c (tekhex_bfd_is_group_section): Define.
6060         * versados.c (versados_bfd_is_group_section): Define.
6061         * vms.c (vms_bfd_is_group_section): Define.
6062         * xsym.c (bfd_sym_bfd_is_group_section): Define.
6063         * bfd-in2.h: Regenerate.
6064         * libbfd.h: Regenerate.
6065
6066 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
6067
6068         * elflink.c (elf_gc_mark): Follow indirect and warning syms.
6069
6070 2004-04-30  Hans-Peter Nilsson  <hp@axis.com>
6071
6072         * configure.in: Update version to 2.15.91.
6073         * configure: Regenerate.
6074
6075 2004-04-29  Brian Ford  <ford@vss.fsi.com>
6076
6077         * bfd.c (bfd_get_sign_extend_vma): Add pe[i]-i386 case to DJGPP hack.
6078         * coffcode.h (DOT_DEBUG, GNU_LINKONCE_WI): Define.
6079         [!COFF_WITH_PE] (sec_to_styp_flags, styp_to_sec_flags): Use them.
6080         (coff_compute_section_file_positions) [RS6000COFF_C]: Likewise.
6081         [COFF_WITH_PE] (sec_to_styp_flags): Handle DWARF 2/3 .debug* and
6082         .gnu.linkonce.wi. sections.
6083         * pe-i386.c (COFF_SUPPORT_GNU_LINKONCE): Define.
6084         (COFF_SECTION_ALIGNMENT_ENTRIES): Add entries for .debug and
6085         .gnu.linkonce.wi..
6086         * pei-i386.c (COFF_SUPPORT_GNU_LINKONCE): Likewise.
6087         (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
6088
6089 2004-04-28  Chris Demetriou  <cgd@broadcom.com>
6090
6091         * reloc.c: Remove BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16.
6092         * bfd-in2.h: Regenerate.
6093         * libbfd.h: Likewise.
6094
6095 2004-04-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6096
6097         * som.c (struct som_misc_symbol_info): Add is_comdat, is_common and
6098         dup_common fields.
6099         (setup_sections): Use som_subspace_dictionary_record struct instead
6100         subspace_dictionary_record.  Set SEC_LINK_ONCE if subspace is
6101         is_comdat, is_common or dup_common.
6102         (som_prep_headers): Use som_subspace_dictionary_record struct.  Set
6103         is_comdat, is_common and dup_common in section subspace_dict from
6104         copy_data.
6105         (som_begin_writing): Use som_subspace_dictionary_record struct.
6106         (som_finish_writing): Likewise.
6107         (som_bfd_derive_misc_symbol_info): Add support to set is_comdat,
6108         is_common and dup_common flags in info for symbol.  Add comment
6109         regarding linker support for these fields.  Slightly reorganize
6110         function.
6111         (som_build_and_write_symbol_table): Set is_comdat, is_common and
6112         dup_common fields in symbol table from symbol info.
6113         (bfd_som_set_subsection_attributes): Add comdat, common and dup_common
6114         arguments.  Set corresponding fields in copy_data.  Change all callers.
6115         (som_bfd_ar_write_symbol_stuff): Set dup_common flag in library
6116         symbol table.
6117         (som_vec): Add SEC_LINK_ONCE to applicable section flags.
6118         * som.h (som_subspace_dictionary_record): Define.
6119         (som_copyable_section_data_struct): Add is_comdat, is_common and
6120         dup_common fields.
6121         (som_section_data_struct): Use som_subspace_dictionary_record struct
6122         instead of subspace_dictionary_record.
6123         (bfd_boolean bfd_som_set_subsection_attributes): Adjust prototype.
6124
6125 2004-04-27  Bob Wilson  <bob.wilson@acm.org>
6126
6127         * elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size
6128         if set.  Check reloc_done flag before applying relocations.  Use
6129         output addresses, both when applying relocations and when comparing
6130         against the specified section.
6131         (elf_xtensa_relocate_section): Use output address to check if dynamic
6132         reloc is in a literal pool.  Set section's reloc_done flag.
6133
6134 2004-04-27  H.J. Lu  <hongjiu.lu@intel.com>
6135
6136         * elf32-sh64.c (elf_backend_section_flags): New. Defined.
6137         (sh64_elf_set_mach_from_flags): Remove the kludge for .cranges
6138         section.
6139         (sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges
6140         section.
6141
6142 2004-04-27  Alan Modra  <amodra@bigpond.net.au>
6143
6144         * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign
6145         structure field removed in 2004-04-24 patch.
6146         * elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix.
6147
6148         * elf-bfd.h (struct elf_backend_data <elf_backend_section_flags>):
6149         Constify hdr arg.
6150         * elf32-arm.h (elf32_arm_section_flags): Likewise.
6151         * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
6152         * elfxx-ia64.c (elfNN_ia64_section_flags): Likewise.
6153         * elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section
6154         field before calling elf_backend_section_flags.
6155
6156 2004-04-24  Chris Demetriou  <cgd@broadcom.com>
6157
6158         * elf32-mips.c (elf_mips_gnu_rel_hi16, elf_mips_gnu_rel_lo16)
6159         (elf_mips_gnu_pcrel64, elf_mips_gnu_pcrel32): Remove.
6160         (bfd_elf32_bfd_reloc_type_lookup): Remove cases for
6161         BFD_RELOC_PCREL_HI16_S, BFD_RELOC_PCREL_LO16, BFD_RELOC_64_PCREL,
6162         and BFD_RELOC_32_PCREL.
6163         (mips_elf32_rtype_to_howto): Remove cases for R_MIPS_GNU_REL_HI16,
6164         R_MIPS_GNU_REL_LO16, R_MIPS_PC64, R_MIPS_PC32.
6165         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
6166         (_bfd_mips_elf_lo16_reloc): Remove handling for R_MIPS_GNU_REL_HI16.
6167         (mips_elf_next_relocation): Move comment about matching HI/LO
6168         relocations to...
6169         (_bfd_mips_elf_relocate_section): Here.  Remove handling for
6170         R_MIPS_GNU_REL_HI16.
6171
6172 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
6173
6174         * coff-mips.c (mips_relhi_reloc, mips_rello_reloc)
6175         (mips_switch_reloc, mips_read_relocs, mips_relax_section)
6176         (mips_relax_pcrel16, PCREL16_EXPANSION_ADJUSTMENT): Remove.
6177         (mips_relocate_hi): Remove now-unused 'adjust' and 'pcrel' arguments,
6178         and update comments to reflect current usage.
6179         (mips_howto_table): Remove entries for MIPS_R_RELHI, MIPS_R_RELLO,
6180         and MIPS_R_SWITCH, as well as several empty entries.  Update comment
6181         for MIPS_R_PCREL16.
6182         (mips_ecoff_swap_reloc_in, mips_ecoff_swap_reloc_out)
6183         (mips_adjust_reloc_out, mips_bfd_reloc_type_lookup): Remove support
6184         for MIPS_R_SWITCH, MIPS_R_RELLO, and MIPS_R_RELHI relocations.
6185         (mips_adjust_reloc_in): Likewise, adjust maximum accepted relocation
6186         type number to be MIPS_R_PCREL16.
6187         (mips_relocate_section): Remove support for link-time relaxation
6188         of branches used by embedded-PIC.  Remove support for MIPS_R_SWITCH,
6189         MIPS_R_RELLO, and MIPS_R_RELHI relocations.
6190         (_bfd_ecoff_bfd_relax_section): Redefine to bfd_generic_relax_section.
6191         * ecoff.c (ecoff_indirect_link_order): Remove support for link-time
6192         relaxation of branches used by embedded-PIC.
6193         * ecofflink.c (bfd_ecoff_debug_accumulate): Likewise.
6194         * libecoff.h (struct ecoff_section_tdata): Remove embedded-PIC
6195         related members, update comment.
6196         * pe-mips.c: Remove disabled (commented-out and #if 0'd)
6197         code related to embedded-PIC.
6198         * elfxx-mips.c (_bfd_mips_elf_read_ecoff_info): Remove
6199         initialization of now-removed 'adjust' member of
6200         'struct ecoff_debug_info'.
6201
6202 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
6203
6204         * elfxx-mips.c (mips_elf_get_global_gotsym_index): Remove.
6205
6206 2004-04-21  Philip Blundell  <pb@nexus.co.uk>
6207
6208         * elf32-arm.h (elf32_arm_check_relocs): Don't output REL32
6209         relocs for locally defined symbols during -shared final link.
6210         (elf32_arm_final_link_relocate): Likewise.
6211
6212 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
6213
6214         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Copy also
6215         ELF_LINK_POINTER_EQUALITY_NEEDED.
6216         (elf64_x86_64_check_relocs): Set ELF_LINK_POINTER_EQUALITY_NEEDED
6217         if r_type is not R_X86_64_PC32.
6218         (elf64_x86_64_finish_dynamic_symbol): If
6219         ELF_LINK_POINTER_EQUALITY_NEEDED is not set, clear st_value of
6220         SHN_UNDEF symbols.
6221
6222 2004-04-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6223
6224         * elf32-sh.c (sh_elf_plt_sym_val): New function.
6225         (elf_backend_plt_sym_val): Define.
6226
6227 2004-04-22  Andrew Cagney  <cagney@redhat.com>
6228
6229         * opncls.c (bfd_alloc): Fix type of "wanted" in doco.
6230
6231 2004-04-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6232
6233         * hpux-core.c (hpux_core_core_file_p): Add cast in call to
6234         make_bfd_asection.
6235         * som.c (som_set_section_contents): Constantify second argument.
6236         (hppa_som_gen_reloc_type): Abort for unsupported selectors.
6237         (som_object_setup): Rework to avoid warning.
6238         (setup_sections, som_write_fixups, bfd_section_from_som_symbol):
6239         Likewise.
6240
6241 2004-04-22  Andrew Cagney  <cagney@redhat.com>
6242
6243         * cache.c (bfd_cache_close): Check for a previously closed file.
6244
6245 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
6246
6247         * bfd.c (bfd_get_synthetic_symtab): Define.
6248         * targets.c (BFD_JUMP_TABLE_DYNAMIC): Add
6249         NAME##_get_synthetic_symtab.
6250         (struct bfd_target): Add _bfd_get_synthetic_symtab.
6251         * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Define.
6252         * elf-bfd.h (struct elf_backend_data): Add plt_sym_val and
6253         relplt_name fields.
6254         (_bfd_elf_get_synthetic_symtab): New prototype.
6255         * elfcode.h (elf_get_synthetic_symtab): Define.
6256         * elf.c (_bfd_elf_get_synthetic_symtab): New function.
6257         * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Define.
6258         (elf_backend_plt_sym_val, elf_backend_relplt_name): Define.
6259         (elfNN_bed): Add elf_backend_plt_sym_val and elf_backend_relplt_name.
6260         * bfd-in2.h: Rebuilt.
6261         * libbfd.h: Rebuilt.
6262         * elf32-i386.c (elf_i386_plt_sym_val): New function.
6263         (elf_backend_plt_sym_val): Define.
6264         * elf64-x86-64.c (elf64_x86_64_plt_sym_val): New function.
6265         (elf_backend_plt_sym_val): Define.
6266         * elf32-s390.c (elf_s390_plt_sym_val): New function.
6267         (elf_backend_plt_sym_val): Define.
6268         * elf64-s390.c (elf_s390_plt_sym_val): New function.
6269         (elf_backend_plt_sym_val): Define.
6270         * elf32-sparc (elf32_sparc_plt_sym_val): New function.
6271         (elf_backend_plt_sym_val): Define.
6272         * elf64-sparc.c (sparc64_elf_plt_sym_val): New function.
6273         (elf_backend_plt_sym_val): Define.
6274         * elf32-ppc.c (ppc_elf_plt_sym_val): New function.
6275         (elf_backend_plt_sym_val): Define.
6276         * aout-target.h (MY_get_synthetic_symtab): Define.
6277         * aout-tic30.c (MY_get_synthetic_symtab): Define.
6278         * coff-rs6000.c (rs6000coff_vec): Add
6279         _bfd_nodynamic_get_synthetic_symtab.
6280         (pmac_xcoff_vec): Likewise.
6281         * coff64-rs6000.c (rs6000coff64_vec): Add
6282         _bfd_nodynamic_get_synthetic_symtab.
6283         (aix5coff64_vec): Likewise.
6284         * sunos.c (MY_get_synthetic_symtab): Define.
6285         * vms.c (vms_get_synthetic_symtab): Define.
6286
6287 2004-04-22  Nick Clifton  <nickc@redhat.com>
6288
6289         * bfd.c (bfd_archive_filename): Return NULL on NULL input.
6290
6291 2004-04-22  Peter Barada <peter@the-baradas.com>
6292
6293         * archures.c: Add bfd_mach_mcfv4e to bfd_architecture.
6294         * bfd2-in.h: Regenerate.
6295         * cpu-m68k.c: Add 'm68k:mcfv4e' to arch_info_struct[].
6296
6297 2004-04-21  Chris Demetriou  <cgd@broadcom.com>
6298
6299         * coff-mips.c (bfd_mips_ecoff_create_embedded_relocs): Remove.
6300         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Remove.
6301         * bfd-in.h (bfd_mips_ecoff_create_embedded_relocs)
6302         (bfd_mips_elf32_create_embedded_relocs): Remove prototypes
6303         * bfd-in2.h: Regenerate.
6304
6305 2004-04-21  Bob Wilson  <bob.wilson@acm.org>
6306
6307         * elf32-xtensa.c (is_same_value): Add final_static_link argument and
6308         require relocations against a weak symbol to reference the same
6309         symbol hash entry if not a final, static link.
6310         (get_cached_value, add_value_map): Add final_static_link argument.
6311         (remove_literals): Pass final_static_link argument as needed.
6312
6313 2004-04-21  Andrew Cagney  <cagney@redhat.com>
6314
6315         * opncls.c (_bfd_new_bfd_contained_in): Copy "iovec".
6316         (struct opncls, opncls_btell, opncls_bseek, opncls_bread)
6317         (opncls_bwrite, opncls_bclose, opncls_bflush)
6318         (opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a
6319         bfd iovec that uses function callbacks.
6320         (bfd_close): Use the iovec's bclose.
6321         * cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite)
6322         (cache_bclose, cache_bflush, cache_bstat)
6323         (cache_iovec): New functions and global variable, implement a
6324         cache "iovec", where applicable set bfd_error.
6325         (bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec.
6326         * bfdio.c (struct bfd_iovec): Define.
6327         (real_read): Delete function.
6328         (bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat)
6329         (bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec",
6330         assume that bread and bwrite set bfd_error.
6331         * bfd.c (struct bfd): Add "iovec", update comments.
6332         * bfd-in2.h, libbfd.h: Re-generate.
6333
6334 2004-04-21  Andrew Cagney  <cagney@redhat.com>
6335
6336         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
6337
6338 2004-04-21  Eric Botcazou  <ebotcazou@act-europe.fr>
6339
6340         * elflink.c (elf_gc_mark_dynamic_ref_symbol): New function.
6341         (bfd_elf_gc_sections): Fail if a shared object is being created.
6342         Do not fail if dynamic sections have been created.  Instead call
6343         elf_gc_mark_dynamic_ref_symbol to mark sections that contain
6344         dynamically referenced symbols.  Do not mark the whole graph
6345         rooted at .eh_frame, only the section proper.
6346
6347 2004-04-20  DJ Delorie  <dj@redhat.com>
6348
6349         * reloc.c: Add BFD_RELOC_32_SECREL.
6350         * bfd-in2.h: Regenerate.
6351         * libbfd.h: Likewise.
6352         * coff-i386.c (howto_table) [COFF_WITH_PE]: Add R_SECREL32.
6353         (coff_i386_rtype_to_howto) [COFF_WITH_PE]: Handle it.
6354         (coff_i386_reloc_type_lookup) [COFF_WITH_PE]: Likewise.
6355
6356 2004-04-19  Jakub Jelinek  <jakub@redhat.com>
6357
6358         * elf32-sparc.c (elf32_sparc_relocate_section): Handle
6359         relocs against hidden/protected undefweak symbols properly.
6360         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
6361
6362 2004-04-18  Mark Kettenis  <kettenis@gnu.org>
6363
6364         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
6365         * netbsd-core.c (netbsd_core_file_p): Set architecture for PowerPC
6366         core files.
6367
6368 2004-04-17  Brian Ford  <ford@vss.fsi.com>
6369
6370         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the first non-zero
6371         filepos for the SizeOfHeaders field.
6372         (_bfd_XXi_swap_scnhdr_out): Correct section flags lossage on reloc
6373         overflow.
6374         (_bfd_XXi_swap_sym_in): Remove redundant section flags assignment.
6375
6376 2004-04-16  Alan Modra  <amodra@bigpond.net.au>
6377
6378         * simple.c (bfd_simple_get_relocated_section_contents): Don't
6379         change reloc_done.  Set and restore _cooked_size.
6380         (RETURN): Delete.
6381
6382 2004-04-15  Mark Kettenis  <kettenis@gnu.org>
6383
6384         * netbsd-core.c (netbsd_core_file_p): Set architecture for VAX
6385         core files.
6386
6387 2004-04-15  Nick Clifton  <nickc@redhat.com>
6388
6389         * bfd.c (bfd_archive_filename): Catch NULL bfd pointers.
6390
6391 2004-04-15  Alan Modra  <amodra@bigpond.net.au>
6392
6393         * elf64-sparc.c (sparc64_elf_check_relocs): Fix thinko last change.
6394
6395 2004-04-15  H.J. Lu  <hongjiu.lu@intel.com>
6396
6397         * elflink.c (_bfd_elf_merge_symbol): Treat weak as strong only
6398         when it is a definition.
6399
6400 2004-04-14  Alan Modra  <amodra@bigpond.net.au>
6401
6402         * elf32-sparc.c (elf32_sparc_relocate_section): Don't abort
6403         when statically linking PIC code.
6404         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
6405
6406 2004-04-11  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
6407
6408         * config.bfd: Remove mips*-*-mach3* and mips*-dec-mach3* targets.
6409         * configure.in: Remove mips-dec-bsd*, mips-dec-mach3*, mips-*-mach3*
6410         targets amd aout_mips_big_vec, aout_mips_little_vec target vectors.
6411         * configure: Regenerate.
6412
6413 2004-04-08  Richard Sandiford  <rsandifo@redhat.com>
6414
6415         * elflink.c: Include libiberty.h.
6416         * Makefile.am (elflink.lo): Depend on libiberty.h.
6417         * Makefile.in: Regenerate.
6418
6419 2004-04-06  Daniel Jacobowitz  <drow@mvista.com>
6420
6421         * elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use
6422         ".MIPS.stubs".
6423
6424 2004-04-05  H.J. Lu  <hongjiu.lu@intel.com>
6425
6426         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always
6427         reserve the memory for dynamic linker
6428
6429 2004-04-05  Mark Kettenis  <kettenis@gnu.org>
6430
6431         * netbsd-core.c (CORE_WCOOKIE_OFFSET): New define.
6432         (netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc.
6433
6434 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
6435
6436         * elf32-cr16c.c (elf32_cr16c_relocate_section): Use
6437         RELOC_FOR_GLOBAL_SYMBOL.
6438         (elf32_cr16c_add_symbol_hook): Remove const from Elf_Internal_Sym.
6439
6440 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
6441
6442         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
6443         R_ARM_ALU* only if OLD_ARM_ABI is not defined.
6444
6445 2004-04-01  Paul Brook  <paul@codesourcery.com>
6446
6447         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update.
6448         * elf32-arm.h (struct elf32_elf_section_map): New.
6449         (struct _arm_elf_section_data): New.
6450         (elf32_arm_section_data): Define.
6451         (struct elf32_arm_link_hash_table): Add byteswap_code.
6452         (elf32_arm_link_hash_table_create): Initialize byteswap_code.
6453         (bfd_elf32_arm_process_before_allocation): Add byteswap_code.
6454         (elf32_arm_post_process_headers): Set EF_ARM_BE8.
6455         (elf32_arm_output_symbol_hook, elf32_arm_new_section_hook,
6456         elf32_arm_compare_mapping, elf32_arm_write_section): New functions.
6457         (bfd_elf32_new_section_hook, elf_backend_write_section,
6458         elf_backend_link_output_symbol_hook): Define.
6459
6460 2004-04-01  Andy Chittenden  <achittenden@bluearc.com>
6461
6462         * stabs.c (struct stab_link_includes_totals): Add field 'symb'
6463         that keeps the characters in a B_INCL..B_EINCL range.
6464         (_bfd_link_section_stabs): When computing the sum of the
6465         characters in a B_INCL..B_EINCL range also keep a copy of those
6466         characters.  Use this information to distinguish between
6467         include sections that have the same sum and the same length
6468         but which are nevertheless unique.
6469
6470 2004-03-31  Paul Brook  <paul@codesourcery.com>
6471
6472         * elf32-arm.h (elf32_arm_final_link_relocate): Add R_ARM_ALU*.
6473         * elfarm-nabi.c (elf32_arm_howto_table): Ditto.
6474
6475 2004-03-31  Andy Chittenden <achittenden@bluearc.com>
6476
6477         * stabs.c (struct stab_link_includes_totals): Rename field 'total'
6478         to 'sum_chars' and add field 'num_chars'.
6479         (_bfd_link_section_stabs): When computing the sum of the
6480         characters in a B_INCL..B_EINCL range also keep a count of the
6481         number of characters.  Use this information to help distinguish
6482         between include sections when have the same sum but which
6483         nevertheless are still unique.
6484
6485 2004-03-31  Mattias EngdegÃ¥rd  <mattias@virtutech.se>
6486
6487         * stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs.
6488
6489 2004-03-30  Galit Heller  <Galit.Heller@nsc.com>
6490             Tomer Levi    <Tomer.Levi@nsc.com>
6491
6492         * Makefile.am (ALL_MACHINES): Add cpu-cr16c.lo.
6493         (ALL_MACHINES_CFILES): Add cpu-cr16c.c.
6494         (BFD32_BACKENDS): Add elf32-cr16c.lo.
6495         (BFD32_BACKENDS_CFILES): Add elf32-cr16c.c.
6496         (cpu-cr16c.lo): New target.
6497         (elf32-cr16c.lo): Likewise.
6498         * Makefile.in: Regenerate.
6499         * archures.c (bfd_architecture): Add bfd_{arch,mach}_cr16c.
6500         (bfd_archures_list): Add bfd_cr16c_arch.
6501         * config.bfd: Handle cr16c-*-elf*.
6502         * configure.in: Handle bfd_elf32_cr16c_vec.
6503         * configure: Regenerate.
6504         * reloc.c: Add BFD_RELOC_16C_NUM08, BFD_RELOC_16C_NUM08_C,
6505         BFD_RELOC_16C_NUM16, BFD_RELOC_16C_NUM16_C,
6506         BFD_RELOC_16C_NUM32, BFD_RELOC_16C_NUM32_C,
6507         BFD_RELOC_16C_DISP04, BFD_RELOC_16C_DISP04_C,
6508         BFD_RELOC_16C_DISP08, BFD_RELOC_16C_DISP08_C,
6509         BFD_RELOC_16C_DISP16, BFD_RELOC_16C_DISP16_C,
6510         BFD_RELOC_16C_DISP24, BFD_RELOC_16C_DISP24_C,
6511         BFD_RELOC_16C_DISP24a, BFD_RELOC_16C_DISP24a_C,
6512         BFD_RELOC_16C_REG04, BFD_RELOC_16C_REG04_C,
6513         BFD_RELOC_16C_REG04a, BFD_RELOC_16C_REG04a_C,
6514         BFD_RELOC_16C_REG14, BFD_RELOC_16C_REG14_C,
6515         BFD_RELOC_16C_REG16, BFD_RELOC_16C_REG16_C,
6516         BFD_RELOC_16C_REG20, BFD_RELOC_16C_REG20_C,
6517         BFD_RELOC_16C_ABS20, BFD_RELOC_16C_ABS20_C,
6518         BFD_RELOC_16C_ABS24, BFD_RELOC_16C_ABS24_C,
6519         BFD_RELOC_16C_IMM04, BFD_RELOC_16C_IMM04_C,
6520         BFD_RELOC_16C_IMM16, BFD_RELOC_16C_IMM16_C,
6521         BFD_RELOC_16C_IMM20, BFD_RELOC_16C_IMM20_C,
6522         BFD_RELOC_16C_IMM24, BFD_RELOC_16C_IMM24_C,
6523         BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C.
6524         * targets.c (bfd_elf32_cr16c_vec): Declare.
6525         (bfd_target_vector): Add bfd_elf32_cr16c_vec.
6526         * cpu-cr16c.c: New file.
6527         * elf32-cr16c.c: Likewise.
6528         * libbfd.h: Regenerate.
6529         * bfd-in2.h: Likewise.
6530
6531 2004-03-30  Jakub Jelinek  <jakub@redhat.com>
6532
6533         * elf.c (map_sections_to_segments): Fix handling of .tbss.
6534
6535 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6536
6537         * Makefile.am: Remove all mention of elflink.h.
6538         * Makefile.in: Regenerate.
6539         * bfd-in.h (bfd_elf_discard_info): Declare.
6540         (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete.
6541         * bfd-in2.h: Regenerate.
6542         * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol,
6543         bfd_elf32_link_record_dynamic_symbol,
6544         bfd_elf64_link_record_dynamic_symbol,
6545         _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link,
6546         bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol,
6547         _bfd_elf32_link_record_local_dynamic_symbol,
6548         _bfd_elf64_link_record_local_dynamic_symbol,
6549         _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets,
6550         _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link,
6551         _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry,
6552         _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets,
6553         _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry,
6554         _bfd_elf32_reloc_symbol_deleted_p,
6555         _bfd_elf64_reloc_symbol_deleted_p): Delete.
6556         (bfd_elf_link_record_dynamic_symbol,
6557         bfd_elf_link_record_local_dynamic_symbol,
6558         bfd_elf_final_link, bfd_elf_gc_sections,
6559         bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry,
6560         bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link,
6561         bfd_elf_reloc_symbol_deleted_p): Declare.
6562         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
6563         * elf32-arm.h: Update for changed function names.  Remove local
6564         WILL_CALL_FINISH_DYNAMIC_SECTION define.
6565         * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c,
6566         * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c,
6567         * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c,
6568         * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
6569         * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
6570         * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c,
6571         * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c,
6572         * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise.
6573         * elfxx-target.h (bfd_elfNN_bfd_final_link): Define.
6574         (bfd_elfNN_print_symbol): Define.
6575         * elfcode.h: Don't include elflink.h.
6576         (elf_bfd_discard_info, elf_reloc_symbol_deleted_p,
6577         elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections,
6578         elf_gc_common_finalize_got_offsets, elf_gc_common_final_link,
6579         elf_gc_record_vtinherit, elf_gc_record_vtentry,
6580         elf_link_record_local_dynamic_symbol): Don't define.
6581         * elflink.c: Update for changed function names.  Move elflink.h
6582         code here.
6583         * elflink.h: Delete file.
6584         * po/SRC-POTFILES.in: Regenerate.
6585         * po/bfd.pot: Regenerate.
6586
6587 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6588
6589         * elf64-mmix.c (mmix_elf_relocate_section): Restore code setting
6590         "name" for global syms accidentally removed in 2004-03-20 change.
6591
6592 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6593
6594         * elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field.
6595         * elflink.h: Replace all occurrences of sizeof (Elf_External_*)
6596         where Elf_External_* is different for 64 and 32 bit, with
6597         corresponding elf_size_info field.
6598         (struct elf_final_link_info): Use "bfd_byte *" instead
6599         of "Elf_External_Sym *" for external_syms and symbuf.
6600         (elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local
6601         vars and use instead of ELF_R_INFO and ELF_R_TYPE macros.
6602         (struct elf_link_sort_rela): Add "sym_mask" alias for "offset".
6603         (elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM.
6604         (elf_link_sort_cmp2): Adjust.
6605         (elf_link_sort_relocs): Set up r_sym_mask local var instead of
6606         using ELF_R_SYM macro.  Set u.sym_mask.
6607         (elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro
6608         version, elf_stringtab_init.  Ditto for bfd_section_from_elf_index
6609         vs. section_from_elf_index.  Adjust Elf_External_Sym pointer
6610         arithmetic.  Pass bed to elf_link_flush_output_syms.  Adjust
6611         Elf_External_Dyn pointer arithmentic.  Use bed swap_dyn_in and
6612         swap_syn_out functions.  Rearrange dyn swap in/out switch.
6613         (elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic.
6614         Pass bed to elf_link_flush_output_syms.  Use bed swap_symbol_out.
6615         (elf_link_flush_output_syms): Add elf_backend_data arg.
6616         (elf_link_check_versioned_symbol): Likewise.
6617         (elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol.
6618         Adjust Elf_External_Sym pointer arithmetic.  Use bed swap_symbol_out.
6619         (elf_link_input_bfd): Use bfd_section_from_elf_index.  Set up
6620         r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM,
6621         ELF_R_TYPE and ELF_R_INFO macros.
6622         (elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation
6623         based on size rather than using ELF_R_INFO.
6624         (elf_gc_mark): Set up r_sym_shift local var and use instead of
6625         ELF_R_SYM macro.
6626         (struct alloc_got_off_arg): New.
6627         (elf_gc_common_finalize_got_offsets): Use elf_size_info instead of
6628         ARCH_SIZE.  Pass get entry size down to elf_gc_allocate_got_offsets.
6629         (elf_gc_allocate_got_offsets): Adjust.
6630         (elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of
6631         ELF_R_SYM.  Use bfd_section_from_elf_index.
6632         (elf_bfd_discard_info): Set cookie.r_sym_shift.
6633         * elfcode.h (elf_stringtab_init, section_from_elf_index): Delete.
6634         (elf_slurp_symbol_table): Use bfd_section_from_elf_index.
6635
6636 2004-03-26  Stan Shebs  <shebs@apple.com>
6637
6638         Remove MPW support, no longer used.
6639         * config.bfd (powerpc-*-mpw*): Remove configuration.
6640         * mpw-config.in, mpw-make.sed: Remove files.
6641         * ecoffswap.h [MPW_C]: Remove MPW-C-friendly version of code.
6642
6643 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
6644
6645         * elf64-ppc.c (elf_backend_add_symbol_hook): Define.
6646         (ppc64_elf_add_symbol_hook): New function.
6647         * elf-bfd.h (struct elf_backend_data <elf_add_symbol_hook>): Remove
6648         const from Elf_Internal_Sym param.
6649         * elflink.c (elf_link_add_object_symbols): Adjust.
6650         * elf-hppa.h (elf_hppa_add_symbol_hook): Adjust.
6651         * elf32-frv.c (elf32_frv_add_symbol_hook): Adjust.
6652         * elf32-i370.c (elf_backend_add_symbol_hook): Adjust.
6653         * elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust.
6654         * elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust.
6655         * elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust.
6656         * elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust.
6657         * elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust.
6658         * elf32-v850.c (v850_elf_add_symbol_hook): Adjust.
6659         * elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust.
6660         * elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust.
6661         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust.
6662         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust.
6663         * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust.
6664         * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust.
6665         * elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust.
6666
6667 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
6668
6669         * elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define.
6670         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete.
6671         (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete.
6672         (_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete.
6673         (bfd_elf64_bfd_link_add_symbols): Delete.
6674         (bfd_elf_link_add_symbols): Declare.
6675         * elfcode.h (elf_bfd_link_add_symbols): Delete.
6676         * elflink.c: Include safe-ctype.h.
6677         (elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag,
6678         make static.
6679         (elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static.
6680         (elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make
6681         static.
6682         (elf_link_add_archive_symbols): Rename from
6683         _bfd_elf_link_add_archive_symbols, make static.
6684         (elf_link_add_object_symbols): New function.  Corresponding
6685         elflink.h function converted to use elf_size_info.
6686         (bfd_elf_link_add_symbols): Likewise.
6687         (bfd_elf_size_dynamic_sections): Adjust.
6688         * elflink.h (elf_bfd_link_add_symbols): Delete.
6689         (elf_link_add_object_symbols): Delete.
6690         * elf32-gen.c (elf32_generic_link_add_symbols): Call
6691         bfd_elf_link_add_symbols.
6692         * elf64-gen.c (elf64_generic_link_add_symbols): Likewise.
6693
6694 2004-03-25  Alan Modra  <amodra@bigpond.net.au>
6695
6696         * elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed
6697         and chained shared libs only if dynsym.  Clear dynsym on forced-local.
6698
6699         * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare.
6700         (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete.
6701         (_bfd_elf_add_dt_needed_tag): Declare.
6702         (_bfd_elf_sort_symbol): Declare.
6703         (_bfd_elf_finalize_dynstr): Declare.
6704         (RELOC_FOR_GLOBAL_SYM): Formatting.
6705         * elfcode.h (elf_add_dynamic_entry): Delete.
6706         * elflink.c (_bfd_elf_add_dynamic_entry): New function.  Corresponding
6707         elflink.h function converted to use elf_size_info.
6708         (_bfd_elf_add_dt_needed_tag): Likewise.
6709         (_bfd_elf_sort_symbol): Likewise.
6710         (_bfd_elf_finalize_dynstr): Likewise.
6711         (compute_bucket_count): Likewise.
6712         (bfd_elf_size_dynamic_sections): Likewise.  Check result of
6713         _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref.
6714         (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from..
6715         * elflink.h: ..here.
6716         (sort_symbol, add_dt_needed_tag): Delete.
6717         (elf_add_dynamic_entry, elf_finalize_dynstr): Delete.
6718         (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete.
6719         Update all users.
6720         * elf32-arm.h (add_dynamic_entry): Update.  Remove casts.
6721         * elf32-cris.c (add_dynamic_entry): Likewise.
6722         * elf32-hppa.c (add_dynamic_entry): Likewise.
6723         * elf32-i370.c (add_dynamic_entry): Likewise.
6724         * elf32-i386.c (add_dynamic_entry): Likewise.
6725         * elf32-m32r.c (add_dynamic_entry): Likewise.
6726         * elf32-m68k.c (add_dynamic_entry): Likewise.
6727         * elf32-ppc.c (add_dynamic_entry): Likewise.
6728         * elf32-s390.c (add_dynamic_entry): Likewise.
6729         * elf32-sh.c (add_dynamic_entry): Likewise.
6730         * elf32-sparc.c (add_dynamic_entry): Likewise.
6731         * elf32-vax.c (add_dynamic_entry): Likewise.
6732         * elf32-xtensa.c (add_dynamic_entry): Likewise.
6733         * elf64-alpha.c (add_dynamic_entry): Likewise.
6734         * elf64-hppa.c (add_dynamic_entry): Likewise.
6735         * elf64-ppc.c (add_dynamic_entry): Likewise.
6736         * elf64-s390.c (add_dynamic_entry): Likewise.
6737         * elf64-sparc.c (add_dynamic_entry): Likewise.
6738         * elf64-x86-64.c (add_dynamic_entry): Likewise.
6739         * elfxx-ia64.c (add_dynamic_entry): Likewise.
6740         * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
6741         * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
6742         * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise.
6743         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
6744
6745 2004-03-23  Paul Brook  <paul@codesourcery.com>
6746
6747         * elf32-arm.h (arm_print_private_bfd_data): Add EABI v3.
6748
6749 2004-03-22  Bob Wilson  <bob.wilson@acm.org>
6750
6751         * elf32-xtensa.c (elf_xtensa_check_relocs): Remove code to read
6752         literal tables and check for relocs outside of literal pools.
6753         (elf_xtensa_make_sym_local): Don't clear ELF_LINK_NON_GOT_REF flag.
6754         (elf_xtensa_fix_refcounts): Don't check ELF_LINK_NON_GOT_REF or
6755         set DF_TEXTREL.
6756         (elf_xtensa_size_dynamic_sections): Don't add DT_TEXTREL entry.
6757         (elf_xtensa_relocate_section): Read literal tables and check for
6758         dynamic relocations in read-only sections and not in literal pools.
6759
6760 2004-03-23  Alan Modra  <amodra@bigpond.net.au>
6761
6762         PR 51.
6763         * linker.c (bfd_wrapped_link_hash_lookup): Handle info->wrap_char.
6764
6765 2004-03-22  Hans-Peter Nilsson  <hp@axis.com>
6766
6767         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOTPLT,
6768         R_CRIS_16_GOTPLT>: Also error if there's no PLT for a symbol
6769         not defined by the executable, or defined in a DSO.
6770         <eliding run-time relocation of .got>: Initialize GOT entry for a
6771         function symbol or ELF_LINK_HASH_NEEDS_PLT statically in an
6772         executable.
6773         (cris_elf_gc_sweep_hook): Improve fallthrough marking.
6774         (elf_cris_try_fold_plt_to_got): Improve head comment.  Do not fold
6775         a PLT reloc to GOT for an executable.
6776         (elf_cris_adjust_dynamic_symbol): Only fold a .got.plt entry with
6777         .got for a DSO and explain why.
6778         (elf_cris_discard_excess_program_dynamics): Also lose GOT-relocs
6779         and unreferenced symbols for which a PLT is defined.  Adjust
6780         dynamic-symbol pruning correspondingly, to make sure we don't lose
6781         a dynamic symbol also defined by a DSO.
6782
6783 2004-03-22  Alan Modra  <amodra@bigpond.net.au>
6784
6785         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add input_bfd, input_section
6786         and rel args.  Group input and output args.  Wrap to 80 columns.
6787         * elf-m10200.c, elf-m10300.c, elf32-arm.h, elf32-avr.c,
6788         elf32-cris.c, elf32-d10v.c, elf32-fr30.c, elf32-h8300.c,
6789         elf32-hppa.c, elf32-i386.c, elf32-i860.c, elf32-ip2k.c,
6790         elf32-iq2000.c, elf32-m68hc1x.c, elf32-m68k.c, elf32-mcore.c,
6791         elf32-msp430.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
6792         elf32-sparc.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c,
6793         elf32-xtensa.c, elf64-alpha.c, elf64-mmix.c, elf64-ppc.c,
6794         elf64-s390.c, elf64-sparc.c, elf64-x86-64.c, elfxx-ia64.c: Update
6795         RELOC_FOR_GLOBAL_SYMBOL invocation.
6796
6797 2004-03-20  H.J. Lu  <hongjiu.lu@intel.com>
6798
6799         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if
6800         unresolved symbols in objects aren't allowed.
6801
6802         * elf-hppa.h (elf_hppa_relocate_section): Properly handle
6803         unresolved symbols.
6804         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
6805         (elf_hppa_unmark_useless_dynamic_symbols):
6806         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
6807         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
6808         (elf32_hppa_relocate_section): Likewise.
6809         * elf32-i370.c (i370_elf_relocate_section): Likewise.
6810         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
6811         * elf32-sh.c (sh_elf_relocate_section): Likewise.
6812         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
6813         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
6814
6815         * elf-m10200.c (mn10200_elf_relocate_section): Use
6816         RELOC_FOR_GLOBAL_SYMBOL.
6817         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
6818         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
6819         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
6820         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
6821         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
6822         * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise.
6823         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
6824         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
6825         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
6826         * elf32-v850.c (v850_elf_relocate_section): Likewise.
6827         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
6828         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
6829
6830 2004-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6831
6832         * elf32-hppa.c (elf32_hppa_check_relocs): Handle R_PARISC_PCREL32.
6833         (final_link_relocate): Likewise.
6834         * elf-hppa.h (elf_hppa_reloc_final_type): Handle selectors for
6835         R_PARISC_PCREL32 and R_PARISC_PCREL64 relocations.
6836
6837 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
6838
6839         * Makefile.am: Run "make dep-am".
6840         * Makefile.in: Regenerate.
6841         * aclocal.m4: Regenerate.
6842         * config.in: Regenerate.
6843         * po/bfd.pot: Regenerate.
6844
6845 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
6846             H.J. Lu  <hongjiu.lu@intel.com>
6847
6848         * elflink.c (_bfd_elf_merge_symbol): Revert last change.  Move
6849         type and size change code to where it was previously.  Remove
6850         dt_needed param.  Treat old weak syms as strong if new sym is
6851         from a shared lib, even when old sym is from another shared
6852         lib.  Remove unnecessary tests of oldweak and newweak.  Correct
6853         comments.
6854         (_bfd_elf_add_default_symbol): Remove dt_needed param.  Update
6855         _bfd_elf_merge_symbol calls.
6856         * elflink.h (elf_link_add_object_symbols): Update calls.  Remove
6857         dt_needed local var.  Update comments.
6858         * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype.
6859         (_bfd_elf_add_default_symbol): Likewise.
6860
6861         * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle
6862         strong syms in one shared object overriding weak syms in another.
6863
6864 2004-03-18  Alan Modra  <amodra@bigpond.net.au>
6865
6866         * elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field.  Add
6867         dyn_lib_class field.  Rearrange for better packing.
6868         (elf_dt_soname): Delete.
6869         (elf_dyn_lib_class): Define.
6870         * elf.c (bfd_elf_set_dt_needed_name): Update comment.
6871         (bfd_elf_set_dt_needed_soname): Delete.
6872         (bfd_elf_set_dyn_lib_class): New function.
6873         * elflink.h (add_dt_needed_tag): New function.  Split out from..
6874         (elf_link_add_object_symbols): ..here.  Rename "name" to "soname".
6875         Use elf_dyn_lib_class to set dt_needed and add_needed.  Move fallback
6876         initialization of soname.
6877         (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of
6878         elf_dt_soname.
6879         * bfd-in.h (enum dynamic_lib_link_class): New.
6880         (bfd_elf_set_dt_needed_soname): Delete.
6881         (bfd_elf_set_dyn_lib_class): Declare.
6882         * bfd-in2.h: Regenerate.
6883
6884         * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling.
6885         (_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs.
6886         * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in
6887         symbol loop.  Instead use add_needed to flag tag as written.
6888
6889 2004-03-17  Nathan Sidwell  <nathan@codesourcery.com>
6890
6891         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
6892         logic for null_input_bfd detection.
6893
6894 2004-03-17  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
6895
6896         * config.bfd: Switch sh-*-rtems* to ELF.  Add sh-*-rtemscoff*.
6897
6898 2004-03-16  Mark Kettenis  <kettenis@gnu.org>
6899
6900         * netbsd-core.c (netbsd_core_file_p) [CORE_FPU_OFFSET]: Remove
6901         code.
6902
6903 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6904
6905         * elflink.c (elf_link_read_relocs_from_section): Don't use
6906         NUM_SHDR_ENTRIES in end of reloc calc.  Move NULL shdr check..
6907         (_bfd_elf_link_read_relocs): ..to here.
6908         * elf32-ppc.c (ppc_elf_relax_section): Formatting.
6909
6910 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6911
6912         * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override
6913         values selected in configure.host.  Require both to be defined
6914         before setting BFD_HOST_64_BIT_DEFINED.  Protect assignment to
6915         corresponding BFD_HOST vars with quotes.
6916         <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc;
6917         Always require BFD_HOST_64_BIT_DEFINED.
6918         <file_ptr type>: Find off_t size before emitting message.  Combine
6919         off_t and ftello64 conditional.
6920         * configure: Regenerate.
6921
6922 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6923
6924         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer
6925         aliasing warning.  Remove trailing whitespace throughout file.
6926
6927 2004-03-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6928
6929         * elf-hppa.h (elf_hppa_relocate_section): Pass input_bfd instead of
6930         input_section in calls to get_dyn_name.
6931         * elf64-hppa.c (get_dyn_name): Change type of first argument to "bfd *".        Use section id of first section in input BFD to build dynamic name for
6932         local symbols.
6933         (elf64_hppa_check_relocs): Pass abfd in call to get_dyn_name.
6934
6935 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
6936
6937         * bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
6938         (BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
6939         (bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
6940         (bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
6941         (bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
6942         * configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
6943         (BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
6944         when using long.
6945         * libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
6946         (bfd_getb64): Return bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
6947         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
6948         (bfd_putb64): Accept bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
6949         (bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
6950         * dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
6951         (read_8_bytes, read_indirect_string, read_address): Likewise.
6952         (read_abbrevs, parse_comp_unit): Likewise.
6953         * targets.c (struct bfd_target): Likewise.
6954         * aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
6955         * hppabsd-core.c: Likewise.  Formatting.
6956         * hpux-core.c: Likewise.
6957         * irix-core.c: Likewise.
6958         * netbsd-core.c: Likewise.
6959         * osf-core.c: Likewise.
6960         * ptrace-core.c: Likewise.
6961         * sco5-core.c: Likewise.
6962         * trad-core.c: Likewise.
6963         * configure: Regenerate.
6964         * bfd-in2.h: Regenerate.
6965
6966 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
6967
6968         * bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
6969         (bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
6970         (bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
6971         (bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
6972         (bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
6973         (bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
6974         (bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
6975         * libbfd.c: Likewise in function definitions.
6976         (bfd_put_8): Mask with 0xff rather than casting to char.
6977         (bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
6978         (bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
6979         (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
6980         (H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
6981         (H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
6982         (H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
6983         * libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
6984         (H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
6985         (H_GET_64, H_GET_32, H_GET_16): Likewise.
6986         (H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
6987         * archive.c (do_slurp_coff_armap): Update swap prototype.
6988         * coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
6989         (tic54x_getl_signed_32): Likewise.
6990         (tic54x_putl32): Likewise.  Mask with 0xff rather than casting to char.
6991         * mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
6992         * pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
6993         (bfd_getp_signed_32, bfd_putp32): Likewise.
6994         * targets.c (struct bfd_target): Use void* in place of bfd_byte* for
6995         bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
6996         bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
6997         bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
6998         bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
6999         bfd_h_getx_signed_16, bfd_h_putx16.
7000         * aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
7001         * hppabsd-core.c: Similarly.  Rename NO_SIGNED_GET to NO_GETS.
7002         * hpux-core.c: Likewise.
7003         * irix-core.c: Likewise.
7004         * netbsd-core.c: Likewise.
7005         * osf-core.c: Likewise.
7006         * ptrace-core.c: Likewise.
7007         * sco5-core.c: Likewise.
7008         * trad-core.c: Likewise.
7009         * bfd-in2.h: Regenerate.
7010
7011 2004-03-15  Matt Thomas  <matt@3am-software.com>
7012
7013         * config.bfd: Add x86-64 vector to NetBSD/i386 if 64bit BFD is
7014         selected.
7015
7016 2004-03-13  Mark Kettenis  <kettenis@gnu.org>
7017
7018         * config.bfd: Add x86_64-*-openbsd*.
7019         * configure.in (x86_64-*-openbsd*): Set COREFILE to
7020         netbsd-core.lo.
7021         * configure: Regenerate.
7022
7023 2004-03-12  Nick Clifton  <nickc@redhat.com>
7024             Dave Murphy  <wintermute2k4@ntlworld.com>
7025
7026         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Skip most checks
7027         if the input bfd does not contain any code.
7028
7029 2004-03-09  Steve Ellcey  <sje@cup.hp.com>
7030
7031         * elfxx-ia64.c (plt_full_entry): Change ld8 to ld8.acq.
7032
7033 2004-03-05  Fred Fish  <fnf@redhat.com>
7034
7035         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Just force
7036         mips16 symbols to be even rather than testing first for even/odd.
7037         (_bfd_mips_elf_link_output_symbol_hook): Ditto.
7038
7039 2004-03-05  Nathan Sidwell  <nathan@codesourcery.com>
7040
7041         * elf.c (map_sections_to_segments): Ignore .tbss sections for
7042         layout purposes.
7043
7044 2004-03-03  Alexandre Oliva  <aoliva@redhat.com>
7045
7046         * elflink.c (bfd_elf_record_link_assignment): Mark undefweak and
7047         undefined symbols as hash_new.
7048
7049 2003-03-03  Andrew Stubbs  <andrew.stubbs@superh.com>
7050
7051         * archures.c: Add bfd_mach_sh4_nommu_nofpu.
7052         * cpu-sh.c: Ditto.
7053         * elf32-sh.c: Ditto.
7054         * bfd-in2.h: Regenerate.
7055
7056 2004-03-02  Alexandre Oliva  <aoliva@redhat.com>
7057
7058         * elf32-frv.c (struct frv_pic_relocs_info): Added fixups and
7059         dynrelocs.
7060         (_frv_count_got_plt_entries): Initialize them.
7061         (frv_pic_relocs_info_find): Add insert argument.  Adjust all
7062         callers.
7063         (frv_pic_relocs_info_for_global): Likewise.
7064         (frv_pic_relocs_info_for_local): Likewise.
7065         (frv_pic_merge_early_relocs_info): New.
7066         (_frv_resolve_final_relocs_info): Use it in case one entry maps to
7067         another.
7068         (_frv_add_dyn_reloc): Add entry argument.  Adjust all callers.
7069         Check that we don't exceed the allocated count for entry.
7070         (_frv_add_rofixup): Likewise.
7071         (_frv_emit_got_relocs_plt_entries): Adjust for coding standards.
7072         (elf32_frv_finish_dynamic_sections): Improve error message in case
7073         we emit too few rofixup entries.
7074
7075 2004-03-01  Richard Sandiford  <rsandifo@redhat.com>
7076
7077         * archures.c (bfd_mach_fr450): New.
7078         * bfd-in2.h: Regenerate.
7079         * cpu-frv.c (arch_info_450): New bfd_arch_info_type.
7080         (arch_info_500): Link to it.
7081         * elf32-frv.c (elf32_frv_machine, frv_elf_merge_private_bfd_data)
7082         (frv_elf_print_private_bfd_data): Handle fr405 and fr450 header flags.
7083         (frv_elf_arch_extension_p): New function.
7084         (frv_elf_merge_private_bfd_data): Use it.
7085
7086 2004-02-28  H.J. Lu  <hongjiu.lu@intel.com>
7087
7088         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype.
7089
7090         * elflink.h (is_global_data_symbol_definition): Moved to
7091         elflink.c.
7092         (elf_link_is_defined_archive_symbol): Likewise.
7093         (elf_link_add_archive_symbols): Likewise. Renamed to
7094         _bfd_elf_link_add_archive_symbols.
7095
7096         * elflink.c (elf_link_is_defined_archive_symbol): Get the size
7097         of ELF symbol table entry from backend.
7098         (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols
7099         instead of elf_link_add_object_symbols.
7100
7101 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
7102
7103         * elf-bfd.h (struct elf_backend_data): Added
7104         elf_backend_can_make_relative_eh_frame,
7105         elf_backend_can_make_lsda_relative_eh_frame and
7106         elf_backend_encode_eh_address.
7107         (_bfd_elf_encode_eh_address): Declare.
7108         (_bfd_elf_can_make_relative): Declare.
7109         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new
7110         hooks to decide whether to attempt to make_relative and
7111         make_lsda_relative.
7112         (_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address.
7113         (_bfd_elf_can_make_relative): New.
7114         (_bfd_elf_encode_eh_address): New.
7115         * elf32-frv.c (frv_elf_use_relative_eh_frame): New.
7116         (frv_elf_encode_eh_address): New.
7117         (elf_backend_can_make_relative_eh_frame): Define.
7118         (elf_backend_can_make_lsda_relative_eh_frame): Define.
7119         (elf_backend_encode_eh_address): Define.
7120         * elfxx-target.h
7121         (elf_backend_can_make_relative_eh_frame): Define.
7122         (elf_backend_can_make_lsda_relative_eh_frame): Define.
7123         (elf_backend_encode_eh_address): Define.
7124         (elfNN_bed): Add them.
7125
7126 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
7127
7128         * elf32-frv.c (elf32_frv_howto_table) <R_FRV_LABEL16>: Set
7129         complain_on_overflow to signed.
7130
7131 2004-02-27  H.J. Lu  <hongjiu.lu@intel.com>
7132
7133         * elflink.h (sort_symbol): New.
7134         (elf_link_add_object_symbols): Use a sorted symbol array for
7135         weakdef.
7136
7137 2004-02-27  Jakub Jelinek  <jakub@redhat.com>
7138
7139         * elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
7140         for pc relative relocs.
7141         (elf_s390_relocate_section): Likewise.
7142         * elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
7143         for pc relative relocs.
7144         (elf_s390_relocate_section): Likewise.
7145
7146 2004-02-26  H.J. Lu  <hongjiu.lu@intel.com>
7147
7148         * elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to
7149         count_dyn_reloc.
7150
7151 2004-02-25  H.J. Lu  <hongjiu.lu@intel.com>
7152
7153         * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
7154         field to track if a relocation is against readonly section.
7155         (count_dyn_reloc): Take a new argument for rent->reltext.
7156         (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
7157         (get_reloc_section): Don't set ia64_info->reltext here.
7158         (allocate_dynrel_entries): Set ia64_info->reltext here.
7159
7160 2004-02-24  Alexandre Oliva  <aoliva@redhat.com>
7161
7162         * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
7163         (_frv_emit_got_relocs_plt_entries): Decay relocation to protected
7164         function's descriptor to symbol+offset, and map local undefweak
7165         symbol to NULL function descriptor.
7166         (elf32_frv_relocate_section): Likewise.
7167
7168 2004-02-23  Mark Kettenis  <kettenis@gnu.org>
7169
7170         * libaout.h (enum machine_type): Add M_SPARC64_NETBSD and
7171         M_X86_64_NETBSD.
7172         * netbsd-core.c (M_SPARC64_OPENBSD): Define.
7173         (netbsd_core_file_p): Set architecture from machine ID for
7174         selected machines.
7175
7176 2004-02-23  Jakub Jelinek  <jakub@redhat.com>
7177
7178         * elflink.h (size_dynamic_sections): If not adding DT_FLAGS and
7179         DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.
7180
7181 2004-02-21  H.J. Lu  <hongjiu.lu@intel.com>
7182
7183         * elflink.c (_bfd_elf_merge_symbol): Properly handle undefined
7184         symbols with non-default visibility.
7185
7186 2004-02-21  Danny Smith  <daanysmith@users.sourceforge.net>
7187
7188         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
7189         IMAGE_SCN_MEM_WRITE on known sections only.
7190
7191 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
7192
7193         * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
7194         symbols used in PIE relocs.
7195
7196 2004-02-19  Jakub Jelinek  <jakub@redhat.com>
7197
7198         * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear
7199         .plt sh_entsize.
7200
7201 2004-02-18  Daniel Jacobowitz  <drow@mvista.com>
7202
7203         * configure.in: Update version to 2.15.90.
7204         * configure: Regenerate.
7205
7206 2004-02-17  Daniel Jacobowitz  <drow@mvista.com>
7207             Richard Sandiford  <rsandifo@redhat.com>
7208
7209         * elfxx-mips.c (mips_elf_calculate_relocation): Use
7210         _bfd_elf_symbol_refs_local_p to decide whether to decay
7211         a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend.
7212         (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE
7213         relocs if the symbol wasn't defined by a regular object file.
7214         Don't check the symbol's dynindx.
7215
7216 2004-02-16  Andrew Cagney  <cagney@redhat.com>
7217
7218         * bfd-in.h (file_ptr, ufile_ptr): Configure type using
7219         @bfd_file_ptr@.
7220         * bfd-in2.h: Re-generate.
7221
7222 2004-02-14  Andrew Cagney  <cagney@redhat.com>
7223
7224         * configure.host (HDEFINES): When hppa*-*-hpux*, define
7225         _LARGEFILE64_SOURCE.
7226
7227 2004-02-13  Andrew Cagney  <cagney@redhat.com>
7228
7229         * elf.c (vma_page_aligned_bias): New function.
7230         (assign_file_positions_except_relocs)
7231         (assign_file_positions_for_segments): Replace broken modulo
7232         arithmetic with call to vma_page_aligned_bias.
7233
7234 2004-02-11  Andrew Cagney  <cagney@redhat.com>
7235
7236         * bfd-in.h: Update copyright.
7237         (bfd_tell): Change return type to file_ptr.
7238         * bfd-in2.h: Re-generate.
7239         * cache.c: Update copyright.
7240         (bfd_cache_lookup_worker): Use real_fseek, do not cast offset
7241         parameter.
7242         (close_one): Use real_ftell.
7243         * bfdio.c: Update copyright.
7244         (real_ftell, real_fseek): New functions.
7245         (bfd_tell): Use real_fseek and real_ftell, change return type to
7246         file_ptr.
7247         (bfd_seek): Use real_ftell and real_fseek, change type of
7248         file_position to a file_ptr.
7249         * libbfd-in.h: Update copyright.
7250         (real_ftell, real_fseek): Declare.
7251         * libbfd.h: Re-generate.
7252
7253         * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64,
7254         fseeko and fseeko64.  Determine bfd_file_ptr.
7255         * configure: Re-generate.
7256         * config.in: Re-generate.
7257
7258 2004-02-09  Anil Paranjpe  <anilp1@KPITCummins.com>
7259
7260         * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w.
7261         * elf32-h8300.c: Likewise.
7262
7263 2004-02-09  Christian Vogel <vogelchr@vogel.cx>
7264             Nick Clifton  <nickc@redhat.com>
7265
7266         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch
7267         GOT entries with no associated GOT subsection.
7268
7269 2004-02-09  Richard Sandiford  <rsandifo@redhat.com>
7270
7271         * bfd-elf.h (elf_backend_name_local_section_symbols): New hook.
7272         * elf.c (swap_out_syms): Use it to decide whether local section
7273         symbols should be named.
7274         * elfxx-target.h (elf_backend_name_local_section_symbols): New macro.
7275         * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare.
7276         (elf_backend_name_local_section_symbols): Define.
7277         * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New.
7278
7279 2004-01-30  H.J. Lu  <hongjiu.lu@intel.com>
7280
7281         * elfxx-ia64.c (elfNN_ia64_relax_brl): New function.
7282         (elfNN_ia64_relax_section): Optimize brl to br during the relax
7283         finalize pass.
7284
7285 2004-01-30  Alexandre Oliva  <aoliva@redhat.com>
7286
7287         * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer
7288         to bfd_link_hash_entry passed by reference to
7289         _bfd_generic_link_add_one_symbol.
7290
7291 2004-01-25  H.J. Lu  <hongjiu.lu@intel.com>
7292
7293         * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm
7294         relocations against dynamic symbols.
7295
7296 2004-01-23  Daniel Jacobowitz  <drow@mvista.com>
7297
7298         * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13
7299         change.
7300
7301 2004-01-21  Tom Rix  <tcrix@worldnet.att.net>
7302
7303         * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw.
7304         * bfd-in2.h, libbfd.h: Rebuilt.
7305
7306 2004-01-20  Danny Smith  <dannysmith@users.sourceforge.net>
7307
7308         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove
7309         IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT
7310         flag has been cleared.
7311
7312 2004-01-19  Kazu Hirata  <kazu@cs.umass.edu>
7313
7314         * coff-h8300.c: Add and adjust comments about relaxation.
7315         * elf32-h8300.c: Likewise.
7316
7317 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
7318
7319         * coff-h8300.c: Fix comment typos.
7320         * elf32-h8300.c: Likewise.
7321
7322 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
7323
7324         * coff-h8300.c: Add comments about relaxation.
7325         * elf32-h8300.c: Likewise.
7326
7327 2004-01-14  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7328
7329         * acinclude.m4: Quote names of macros to be defined by AC_DEFUN
7330         throughout.
7331         * aclocal.m4: Regenerate.
7332         * configure: Regenerate.
7333
7334 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
7335
7336         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call
7337         mips_elf64_rtype_to_howto instead of using howto_table.
7338
7339 2004-01-13  Daniel Jacobowitz  <drow@mvista.com>
7340
7341         * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
7342         the .plt section.
7343         (elf32_arm_check_relocs): Don't increment the PLT refcount for
7344         relocs which would not use the PLT.
7345
7346 2004-01-13  Alan Modra  <amodra@bigpond.net.au>
7347
7348         * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
7349         (ppc64_elf_gc_sweep_hook): Likewise.
7350         (ppc64_elf_size_dynamic_sections): Test for .plt directly.
7351
7352 2004-01-12  Anil Paranjpe  <anilp1@KPITCummins.com>
7353
7354         Adds linker relaxation support for bit manipulation insns like
7355         band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
7356         bst, btst, bxor.
7357         * elf32-h8300.c: Opcode for bit manipulation insn is checked in
7358         elf32_h8_relax_section function while relxation for aa:16 and aa:32.
7359         * coff-h8300.c: Opcode for bit manipulation insn is checked in
7360         h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32.
7361
7362 2004-01-12  Alan Modra  <amodra@bigpond.net.au>
7363
7364         * dwarf2.c: Convert to C90, remove unneeded casts and prototypes.
7365
7366 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
7367
7368         * elf32-h8300.c: Fix formatting.
7369
7370 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
7371
7372         * elf32-cris.c (cris_elf_gc_sweep_hook): Return early if no
7373         dynamic object is present.  Declare r_symndx and h in an inner
7374         scope.
7375         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
7376
7377 2004-01-09  Daniel Jacobowitz  <drow@mvista.com>
7378
7379         * elf32-arm.h (struct elf32_arm_relocs_copied): Remove pc_count.
7380         (elf32_arm_copy_indirect_symbol): Don't copy pc_count.
7381         (elf32_arm_final_link_relocate): Handle PLT32 and PC24 relocs
7382         identically.  Do not emit PC24 relocations for shared libraries.
7383         (elf32_arm_gc_sweep_hook): Handle PLT32 and PC24 relocs
7384         identically.  Don't adjust pc_count.
7385         (elf32_arm_check_relocs): Handle PLT32 and PC24 relocs identically.
7386         Set ELF_LINK_HASH_NEEDS_PLT for both.  Don't adjust pc_count; don't
7387         adjust count for branch relocations.
7388         (allocate_dynrelocs): Correct typo in call to
7389         WILL_CALL_FINISH_DYNAMIC_SYMBOL.  Never allocate space for
7390         PC24 or PLT32 relocs when linking.
7391
7392 2004-01-09  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
7393
7394         * coff-arm.c (aoutarm_std_reloc_howto): [ARM_WINCE] Synchronize ARM_26D
7395         relocation howto with ARM_26 one for consistency.
7396         (coff_arm_relocate_section): Set partial_inplace for ARM_26 relocations
7397         that will be converted to ARM_26D ones, since we always want 'done'
7398         relocations to be reflected in section's data.
7399         (coff_arm_relocate_section): [ARM_WINCE] Quick fix for BL instruction
7400         offset.
7401         (_bfd_final_link_relocate): Do not modify "inplace" data, if not
7402         requested.
7403
7404 2004-01-08  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
7405
7406         * coff-arm.c (coff_arm_relocate_section): Do not alter relocs that
7407         are not partial_inplace during a relocatable link.
7408
7409 2004-01-08  Kazu Hirata  <kazu@cs.umass.edu>
7410
7411         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return early
7412         if no dynamic object is present.  Declare r_symndx and h in an
7413         inner scope.
7414
7415 2004-01-07  H.J. Lu  <hongjiu.lu@intel.com>
7416
7417         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't install
7418         trampoline if it is known out of range.
7419
7420 2004-01-06  Alexandre Oliva  <aoliva@redhat.com>
7421
7422         2003-12-17  Alexandre Oliva  <aoliva@redhat.com>
7423         * elf32-frv.c (_frv_osec_readonly_p): New.
7424         (_frv_emit_got_relocs_plt_entries): Don't emit rofixup for
7425         undefweak symbol.
7426         (_frv_count_got_plt_entries): Adjust expected count accordingly.
7427         (elf32_frv_relocate_section): Likewise.  Error out if attempting
7428         to emit rofixups or dynamic relocs in read-only segments.  Use
7429         _bfd_elf_section_offset to adjust r_offsets in rofixups and
7430         dynamic relocations.
7431         2003-12-12  Alexandre Oliva  <aoliva@redhat.com>
7432         * elf32-frv.c (elf32_frv_relocate_section): Compute dynamic
7433         relocations or fixups involving merged sections correctly.  Avoid
7434         crash when undefined symbol is referenced by R_FRV_32 or
7435         R_FRV_FUNCDESC_VALUE.
7436         2003-12-02  Alexandre Oliva  <aoliva@redhat.com>
7437         * elf32-frv.c (elf32_frv_relocate_section): Add output_offset of
7438         input section holding local symbol to addend of R_FRV_32 or
7439         R_FRV_FUNCDESC_VALUE dynamic relocation.
7440         2003-11-27  Alexandre Oliva  <aoliva@redhat.com>
7441         * elf32-frv.c (elf32_frv_modify_segment_map): Add link info arg.
7442         (elf32_frv_always_size_sections): Don't store pointer to
7443         __stacksize symbol in sec_info.
7444         (elf32_frv_modify_segment_map): Look it up here.
7445         2003-11-26  Alexandre Oliva  <aoliva@redhat.com>
7446         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Emit the address
7447         of the lazy PLT entry, not only its offset, as the low word of a
7448         function descriptor.
7449         2003-11-10  Alexandre Oliva  <aoliva@redhat.com>
7450         * elf32-frv.c (elf32_frv_always_size_sections): Define __stacksize
7451         if a hash table entry already exists but is not a definition.
7452         2003-11-05  Alexandre Oliva  <aoliva@redhat.com>
7453         * elf32-frv.c (frv_elf_link_hash_table_create): Use bfd_zalloc.
7454         (_frv_add_rofixup): Don't inline.
7455         (_frv_emit_got_relocs_plt_entries): Use NULL as funcdesc address
7456         for undefweak symbols.
7457         (elf32_frv_relocate_section): Avoid crash while computing
7458         relocation when linking with shared library.  Only emit rofixups
7459         and dynamic relocations for alloc&load sections.  Mark binaries
7460         with inter-segment relocations for relocation as a unit.
7461         (_frv_create_got_section): Rename .rofixup.got to .rofixup.
7462         (DEFAULT_STACK_SIZE): New.
7463         (_frv_count_got_plt_entries): Fix thinko in deciding whether to
7464         emit rofixups or dynamic relocs when linking dynamic non-PIE
7465         executables.
7466         (elf32_frv_size_dynamic_sections): Generate rofixup on PIEs and
7467         shared libs too.  Reserve the last entry for the GOT pointer.
7468         (elf32_frv_finish_dynamic_sections): Emit it.
7469         (elf32_frv_always_size_sections): New.
7470         (elf32_frv_modify_segment_map): New.
7471         (elf32_frv_check_relocs): Reserve relocs32 space only in ALLOC
7472         sections.
7473         (frv_elf_merge_private_bfd_data): Clear PIC bit if FDPIC is set.
7474         (frv_elf_print_private_bfd_data): Handle FDPIC and LIBPIC.
7475         (elf_backend_always_size_sections): New.
7476         (elf_backend_modify_segment_map): New.
7477         2003-10-31  Alexandre Oliva  <aoliva@redhat.com>
7478         * config.bfd: Added frv-*-*linux*.
7479         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Use idx 0 for
7480         ABS section, instead of crashing.
7481         (elf32_frv_relocate_section): Don't crash before warning about
7482         different segments in non-PIC relocation.
7483         2003-10-17  Alexandre Oliva  <aoliva@redhat.com>
7484         * elf32-frv.c (elf32_frv_relocate_section): Don't warn on LABEL24
7485         relocs to undefweak symbols.
7486         (elf32_frv_relocate_section): Ditto for undefined symbols.
7487         2003-10-06  Alexandre Oliva  <aoliva@redhat.com>
7488         * elf32-frv.c (elf32_frv_create_dynamic_sections): Make sure
7489         gotfixup section was created.
7490         2003-09-30  Alexandre Oliva  <aoliva@redhat.com>
7491         * elf32-frv.c (elf32_frv_howto_table): Change GOT12,
7492         FUNCDESC_GOT12, GOTOFF12 and FUNCDESC_GOTOFF12 to
7493         complain_overflow_signed.
7494         * elf32-frv.c (_frv_add_rofixup): Do not error out if contents
7495         have not been allocated.
7496         (_frv_emit_got_relocs_plt_entries): Return non-void.  Assert
7497         privfd only if dynamic sections were created.
7498         (elf32_frv_relocate_section): Compute gprel_segment, and use it
7499         for GPREL relocs.  When linking relocatable FDPIC executables,
7500         emit warnings for relocations that would be illegal on PIE or
7501         shared libraries.  Emit rofixup for R_FRV_32 only if input object
7502         is not FDPIC.
7503         (_frv_create_got_section): Define _gp symbol in the rofixup
7504         section.
7505         (elf32_frv_finish_dynamic_sections): If rofixups needed but
7506         dynamic sections missing, error out requesting -melf32frvfd.
7507         2003-09-19  Alexandre Oliva  <aoliva@redhat.com>
7508         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Rearrange
7509         computation of addends from section and global or local symbol
7510         value.  Change return type to bfd_boolean, and return a failure if
7511         a dynamic FUNCDESC or FUNCDESC_VALUE relocation that requires a
7512         nonzero addend is required.
7513         (elf32_frv_relocate_section): Likewise.  Print error for
7514         unsupported nonzero addends.
7515         2003-09-18  Alexandre Oliva  <aoliva@redhat.com>
7516         * elf32-frv.c (FRV_SYM_LOCAL): In the absence of dynamic sections,
7517         force everything local.
7518         (_frv_emit_got_relocs_plt_entries): Cope with NULL sec.
7519         * elf32-frv.c (struct frv_elf_link_hash_table): Added sgotfixup.
7520         (frv_gotfixup_section): New.
7521         (FRV_SYM_LOCAL): Accept undefweak and local common symbols.
7522         (struct frv_pic_relocs_info): Split relocs into relocs32, relocsfd
7523         and relocsfdv.
7524         (_frv_add_rofixup): New.
7525         (_frv_emit_got_relocs_plt_entries): Generate fixups for non-PIE
7526         fdpic executables.  Use FRV_SYM_LOCAL more widely to simplify and
7527         improve some ugly conditions.
7528         (elf32_frv_relocate_section): Likewise.  Reject inter-segment
7529         relocations in fdpic.
7530         (_frv_create_got_section): Create .rofixup.got section.
7531         (struct _frv_dynamic_got_info): Added fixups.
7532         (_frv_count_got_plt_entries): Account in-GOT relocations into
7533         relocs32, relocsfd and relocsfdv.  Account them into relocs or
7534         fixups, as appropriate.
7535         (elf32_frv_size_dynamic_sections): Size rofixup section.  Simplify
7536         sizing of gotrel.
7537         (elf32_frv_finish_dynamic_sections): Verify that the right number
7538         of relocations and fixups was generated.
7539         (elf32_frv_check_relocs): Compute relocs32, relocsfd and
7540         relocsfdv.
7541         * elf32-frv.c (FRV_SYM_LOCAL): New macro, used instead of
7542         SYMBOL_CALLS_LOCAL and SYMBOL_REFERENCES_LOCAL.
7543         (FRV_FUNCDESC_LOCAL): New macro, used to decide whether a function
7544         descriptor of a (formerly-)global symbol is local.
7545         (struct frv_pic_relocs_info): Adjust comments.
7546         (_frv_emit_got_relocs_plt_entries): Adjust.
7547         (elf32_frv_relocate_section): Likewise.
7548         (_frv_count_got_plt_entries): Likewise.
7549         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Don't add global
7550         symbol's value to addend in the common preamble.  Decay dynamic
7551         symbols to section+offset if they bind or call locally, for GOT
7552         and FUNCDESC_VALUE, respectively.
7553         (elf32_frv_relocate_section): Likewise.
7554         (elf32_frv_check_relocs): Don't register as dynamic symbols of
7555         internal or hidden visibility.
7556         2003-09-17  Alexandre Oliva  <aoliva@redhat.com>
7557         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Get addend as
7558         argument, so as to not call _bfd_elf_rel_local_sym to compute it.
7559         (elf32_frv_relocate_section): Pass relocation addend in.  Use
7560         original relocation addend to look up the got relocs/plt entries
7561         table.  Do not call _bfd_elf_rel_local_sym.  Don't error out when
7562         processing relocations that reference .scommon symbols.
7563         2003-09-15  Alexandre Oliva  <aoliva@redhat.com>
7564         Introduce support for dynamic linking.
7565         * elf32-frv.c (R_FRV_FUNCDESC_VALUE): Mark it as 64 bits.
7566         (elf32_frv_rel_32_howto, elf32_frv_rel_funcdesc_howto,
7567         elf32_frv_rel_funcdesc_value_howto): New REL descriptors.
7568         (frv_reloc_type_lookup): Return REL howtos for executables and
7569         dynamic libraries.
7570         (frv_info_to_howto_rel): New.
7571         (struct frv_elf_link_hash_table): New.
7572         (frv_hash_table, frv_got_section, frv_gotrel_section,
7573         frv_plt_section, frv_pltrel_section, frv_relocs_info,
7574         frv_got_initial_offset, frv_plt_initial_offset): New macros.
7575         (frv_elf_link_hash_table_create): New.
7576         (struct frv_pic_relocs_info): New.
7577         (frv_pic_relocs_info_hash, frv_pic_relocs_info_eq): New.
7578         (frv_pic_relocs_info_find): New.
7579         (frv_pic_relocs_info_for_global, frv_pic_relocs_info_for_local):
7580         New.
7581         (FRV_LZPLT_BLOCK_SIZE, FRV_LZPLT_RESOLVE_LOC): New.
7582         (_frv_add_dyn_reloc, _frv_osec_to_segment): New.
7583         (_frv_emit_got_relocs_plt_entries): New.
7584         (elf32_frv_relocate_section): Add support for dynamic linking.
7585         Handle new relocations.
7586         (_frv_create_got_section): New.
7587         (elf32_frv_create_dynamic_sections): New.
7588         (ELF_DYNAMIC_INTERPRETER): New.
7589         (struct _frv_dynamic_got_info): New.
7590         (_frv_count_got_plt_entries): New.
7591         (struct _frv_dynamic_got_plt_info): New.
7592         (_frv_compute_got_alloc_data): New.
7593         (_frv_get_got_entry, _frv_get_fd_entry): New.
7594         (_frv_assign_got_entries, _frv_assign_plt_entries): New.
7595         (_frv_resolve_final_relocs_info): New.
7596         (elf32_frv_size_dynamic_sections): New.
7597         (elf32_frv_finish_dynamic_sections): New.
7598         (elf32_frv_adjust_dynamic_symbol): New.
7599         (elf32_frv_finish_dynamic_symbol): New.
7600         (elf32_frv_check_relocs): Handle new relocs.  Explain how the
7601         whole thing works.
7602         (elf_info_to_howto_rel): Define.
7603         (bfd_elf32_bfd_link_hash_table_create): Define.
7604         (elf_backend_create_dynamic_sections): Define.
7605         (elf_backend_adjust_dynamic_symbol): Define.
7606         (elf_backend_size_dynamic_sections): Define.
7607         (elf_backend_finish_dynamic_symbol): Define.
7608         (elf_backend_finish_dynamic_sections): Define.
7609         (elf_backend_want_got_sym): Define.
7610         (elf_backend_got_header_size): Define.
7611         (elf_backend_want_got_plt): Define.
7612         (elf_backend_plt_readonly): Define.
7613         (elf_backend_want_plt_sym): Define.
7614         (elf_backend_plt_header_size): Define.
7615         (elf_backend_may_use_rel_p): Define.
7616         (elf_backend_may_use_rela_p): Define.
7617         (elf_backend_default_use_rela_p): Define.
7618         2003-08-08  Alexandre Oliva  <aoliva@redhat.com>
7619         * elf32-frv.c (R_FRV_FUNCDESC_VALUE, R_FRV_FUNCDESC_GOTOFF12,
7620         R_FRV_FUNCDESC_GOTOFFHI, R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12,
7621         R_FRV_GOTOFFHI, R_FRV_GOTOFFLO): New.
7622         (frv_reloc_map): Map the corresponding BFD relocs to them.
7623         (frv_reloc_type_lookup): ... and back to BFD relocs.
7624         * reloc.c: New relocs.
7625         * bfd-in2.h, libbfd.h: Rebuilt.
7626         2003-08-04  Alexandre Oliva  <aoliva@redhat.com>
7627         * elf32-frv.c (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
7628         R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
7629         R_FRV_FUNCDESC_GOTLO): New.
7630         (frv_reloc_map): Map the corresponding BFD relocs to them.
7631         (frv_reloc_type_lookup): ... and back to BFD relocs.
7632         * reloc.c: New relocs.
7633         * bfd-in2.h, libbfd.h: Rebuilt.
7634
7635 2004-01-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7636
7637         * elf32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7638         targets to support pages of up to 64kB.
7639         (elf32_bed): Redefine to get a separate backend data structure for
7640         traditional targets.
7641         * elf64-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7642         targets to support pages of up to 64kB.
7643         (elf64_bed): Redefine to get a separate backend data structure for
7644         traditional targets.
7645         * elfn32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7646         targets to support pages of up to 64kB.
7647         (elf32_bed): Redefine to get a separate backend data structure for
7648         traditional targets.
7649
7650 2004-01-04  Mark Kettenis  <kettenis@gnu.org>
7651
7652         * elf32-sparc.c (elf32_sparc_grok_psinfo): New function.
7653
7654 2004-01-02  Mark Kettenis  <kettenis@gnu.org>
7655
7656         * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD.
7657         (elf_i386_grok_psinfo): Likewise.
7658
7659 2004-01-02  Bernardo Innocenti  <bernie@develer.com>
7660
7661         * config.bfd: Add m68k-uClinux target.
7662
7663 2004-01-01  Grant Edwards <grante@visi.com>
7664
7665         * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored.
7666         * elf32-h8300.c (elf32_h8_gc_mark_hook): New function.
7667         (elf32_h8_gc_sweep_hook): New function.
7668         (elf_backend_gc_mark_hook): Define.
7669         (elf_backend_gc_sweep_hook): Define.
7670         (elf_backend_can_gc_sections): Define.
7671
7672 For older changes see ChangeLog-0203
7673 \f
7674 Local Variables:
7675 mode: change-log
7676 left-margin: 8
7677 fill-column: 74
7678 version-control: never
7679 End: