bfd/
[external/binutils.git] / bfd / ChangeLog
1 2009-05-27  Nathan Sidwell  <nathan@codesourcery.com>
2
3         * elf32-ppc.c (ppc_elf_relax_section): Work with a partial
4         link.
5         * bout.c (b_out_bfd_relax_section): Reject relocatable links.
6         * elf32-m10300.c (mn10300_elf_relax_section): Likewise.
7         * elf32-avr.c (elf32_avr_relax_section): Likewise.
8         * elf32-frv.c (elf32_avr_relax_section): Likewise.
9         * elf32-xtensa.c (elf_xtensa_relax_section): Likewise.
10         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
11         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
12         * elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise.
13         * reloc.c (bfd_generic_relax_section): Likewise.
14         * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
15         * vms.c (vms_bfd_relax_section): Likewise.
16
17 2009-05-26  H.J. Lu  <hongjiu.lu@intel.com>
18
19         * elf-bfd.h (_bfd_elf_is_ifunc_symbol): New.
20
21         * elf32-i386.c (is_indirect_symbol): Renamed to ...
22         * elflink.c (_bfd_elf_is_ifunc_symbol): This.
23
24         * elf32-i386.c (allocate_dynrelocs): Updated.
25         (elf_i386_relocate_section): Likewise.
26         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
27         (elf64_x86_64_relocate_section): Likewise.
28
29         * elf64-x86-64.c (is_indirect_symbol): Removed.
30
31 2009-05-26  Nick Clifton  <nickc@redhat.com>
32
33         * po/id.po: Updated Indonesian translation.
34
35 2009-05-26  Rafael Avila de Espindola  <espindola@google.com>
36
37         * Makefile.am: Run "make dep-am".
38         (AM_CPPFLAGS): New.
39         (LIBDL): New.
40         (ALL_MACHINES): Add cpu-plugin.lo.
41         (ALL_MACHINES_CFILES): Add cpu-plugin.c.
42         (BFD32_BACKENDS): Add plugin.lo.
43         (BFD32_BACKENDS_CFILES): Add plugin.c.
44         (libbfd_la_LIBADD): Add LIBDL
45         * archures.c (bfd_architecture): Add bfd_arch_plugin.
46         (bfd_plugin_arch): Declare.
47         * bfd-in.h (BFD_SUPPORTS_PLUGINS): New.
48         * bfd.c (bfd): Add plugin_data.
49         * config.bfd: Handle the plugin target.
50         * configure.in: Check for --enable-plugins.
51         (LT_INIT): Use the dlopen option.
52         * cpu-plugin.c: New.
53         * plugin.c: New.
54         * plugin.h: New.
55         * targets.c (plugin_vec): Declare.
56         (_bfd_target_vector): Add plugin_vec.
57         * Makefile.in: Regenerate.
58         * bfd-in2.h: Regenerate.
59         * configure: Regenerate.
60
61 2009-05-26  Alan Modra  <amodra@bigpond.net.au>
62
63         * dep-in.sed: Don't modify .o to .lo here.  Output one filename
64         per line with all lines having continuation backslash.  Prefix
65         first line with "A", following lines with "B".
66         * Makefile.am (DEP): Don't use dep.sed here.
67         (DEP1): Run $MKDEP on single files, modify .o to .lo here.  Use
68         dep.sed here on dependencies, sort and uniq.
69         * Makefile.in: Regenerate.
70
71 2009-05-25  Tristan Gingold  <gingold@adacore.com>
72
73         * makefile.vms: Add verilog.obj to object list OBJS.
74
75 2009-05-24  Alan Modra  <amodra@bigpond.net.au>
76
77        * bfdio.c (bfd_seek): Formatting.  Ensure newly allocated memory
78        for BFD_IN_MEMORY is cleared.
79        (bfd_bwrite): Zero excess memory allocated.
80
81 2009-05-22  Julian Brown  <julian@codesourcery.com>
82
83         * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New
84         macros.
85         (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
86         (elf32_arm_stub_a8_veneer_blx): New stub sequences.
87         (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
88         arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
89         (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
90         (a8_erratum_fix, a8_erratum_reloc): New structs.
91         (elf32_arm_link_hash_table): Add a8_erratum_fixes,
92         num_a8_erratum_fixes, fix_cortex_a8 fields.
93         (elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
94         (elf32_arm_add_stub): Split into two parts, creating...
95         (elf32_arm_create_or_find_stub_sec): New function.
96         (elf32_arm_final_link_relocate): Add forward declaration.
97         (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
98         relocations, multiple relocations per stub.
99         (find_stub_size_and_template): New (using parts of arm_size_one_stub).
100         (arm_size_one_stub): Use find_stub_size_and_template.
101         (a8_reloc_compare): New.
102         (find_thumb_glue): Add forward declaration.
103         (cortex_a8_erratum_scan): New.
104         (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
105         (bfd_elf32_arm_set_cortex_a8_fix): New.
106         (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
107         (arm_map_one_stub): Add THUMB32_TYPE support.
108         (a8_branch_to_stub_data): New.
109         (make_branch_to_a8_stub): New.
110         (elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
111         * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
112         (bfd_elf32_arm_set_target_relocs): Add argument for controlling
113         Cortex-A8 erratum workaround.
114         * bfd-in2.h: Regenerate.
115
116 2009-05-22  Alan Modra  <amodra@bigpond.net.au>
117
118         * Makefile.am: Run "make dep-am".
119         * Makefile.in: Regenerate.
120         * po/SRC-POTFILES.in: Regenerate.
121
122 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
123
124         * elflink.c (elf_link_input_bfd): Correct *pindex change in last
125         commit.
126
127 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
128
129         * elf-bfd.h (struct elf_backend_data
130         <elf_backend_link_output_symbol_hook>): Return an int.
131         * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop
132         symbols on deleted .opd entries.
133         * elflink.c (elf_link_output_sym): Return without outputting sym
134         if output_symbol_hook returns 2.
135         (elf_link_output_extsym): Don't assign h->indx when symbol discarded.
136         Abort if we must not discard sym.
137         (elf_link_input_bfd): Similarly, don't set finfo->indices for
138         local syms.
139         (bfd_elf_final_link): Adjust elf_link_output_sym calls.
140         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for
141         elf_backend_link_output_symbol_hook return type change.
142         * elf32-arm.c (output_arch_syminfo): Likewise.
143         (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise.
144         (elf32_arm_output_arch_local_syms): Likewise.
145         * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise.
146         * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise.
147         (bfd_score_elf_link_output_symbol_hook): Likewise.
148         * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
149         * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
150         * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise.
151         * elf32-spu.c (spu_elf_output_symbol_hook): Likewise.
152         * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise.
153         * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise.
154         * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise.
155         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise.
156         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
157         * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise.
158         * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
159
160 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
161
162         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
163         out of range .opd symbols.
164
165 2009-05-21  Dave Korn  <dave.korn.cygwin@gmail.com>
166
167         * coffgen.c (coff_print_symbol):  Use bfd_fprintf_vma, not
168         fprintf_vma directly.
169         * peXXigen.c (pe_print_edata):  Likewise.
170         (pe_print_pdata):  Likewise.
171         (_bfd_XX_print_ce_compressed_pdata):  Likewise.
172         (_bfd_XX_print_private_bfd_data_common):  Likewise.
173
174 2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>
175
176         * cofflink.c (process_embedded_commands):  Ignore "-aligncomm".
177
178 2009-05-15  Andrew Stubbs  <ams@codesourcery.com>
179             Paul Brook  <paul@codesourcery.com>
180
181         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
182         fix discarded sections.
183
184 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
185
186         * elf32-spu.c (mark_overlay_section): Move .init and .fini
187         sections into the software icache.
188
189 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
190
191         * elf32-spu.c (build_stub): Always build "compact" sofware
192         i-cache stubs.
193
194 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
195
196         * elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2.
197         (spu_elf_setup): Initialize it.
198         (spu_elf_size_stubs): Move .ovtab into .bss for software i-cache.
199         Update to new-sytle cache manager data structures.
200         (spu_elf_build_stubs): Generate new-style cache manager data
201         structures and symbols.
202         (spu_elf_auto_overlay): Update size computation.
203
204 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
205
206         * elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY
207         segments first amongst the program headers.
208
209 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
210
211         * elf32-spu.c (spu_elf_relocate_section): Only encode overlay index
212         into addresses for relocation types that look at high bits.  Remove
213         special handling of relocation overflow warnings.
214
215 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
216
217         * elf32-spu.c (mark_functions_via_relocs): Handle cycles in the
218         control flow graph between fragments of a function.
219
220 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
221
222         * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode,
223         generate only a 16-byte .toe section.
224         (spu_elf_build_stubs, spu_elf_auto_overlay): Likewise.
225
226 2009-05-14  Alan Modra  <amodra@bigpond.net.au>
227
228         * elf32-spu.c (spu_elf_size_stubs): Split out section placement to..
229         (spu_elf_place_overlay_data): ..here.  New function.
230         * elf32-spu.h (spu_elf_place_overlay_data): Declare.
231
232 2009-05-13  Andrew Jenner  <andrew@codesourcery.com>
233
234         * elf32-arm.c: Move sysdep.h to start of file.
235
236 2009-05-11  Ulrich Weigand  <uweigand@de.ibm.com>
237
238         * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as
239         start of overlays.
240         (spu_elf_build_stubs): Don't define __icache_tagbase.  Define
241         __icache_tag_array and __icache_tag_array_size.
242
243 2009-05-11  Masaki Muranaka  <monaka@monami-software.com>
244
245         * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Remove unnecessary
246         ATTRIBUTE_UNUSED.
247         (bfinfdpic_link_omit_section_dynsym): Likewise.
248         (elf32_bfinfdpic_finish_dynamic_sections): Likewise.
249
250 2009-05-05  Paul Brook  <paul@codesourcery.com>
251
252         * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype.
253         * bfd-in2.h: Regenerate.
254         * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define.
255         (_arm_elf_section_data): Add text and exidx fields.
256         (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size,
257         insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31,
258         copy_exidx_entry): New functions.
259         (elf32_arm_write_section): Fixup .ARM.exidx contents.
260
261 2009-05-05  Christophe lyon  <christophe.lyon@st.com>
262
263         * elf32-arm.c (DEF_STUBS): New helper define.
264         (DEF_STUB): Likewise.
265         (stub_def): New type.
266         (stub_definitions): New array, containing stub template pointers
267         and sizes.
268         (arm_size_one_stub): Make use of stub_definitions.
269
270 2009-05-04  Dave Korn  <dave.korn.cygwin@gmail.com>
271
272         * elflink.c (find_version_for_sym):  Remove from here, ...
273         * linker.c (bfd_find_version_for_sym):  ... rename, replace
274         here, make public and update all callers.
275         * bfd-in2.h:  Regenerate.
276
277 2009-04-30  Nick Clifton  <nickc@redhat.com>
278
279         * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs
280         section pointer.
281         (struct elf_obj_data): Add has_ifunc_symbols boolean.
282         * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags
283         into a STT_GNU_IFUNC symbol type.
284         (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function
285         type.
286         (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if
287         the binary contains ifunc symbols.
288         * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC
289         symbol type into a BSF_GNU_INDIRECT_FUNCTION flag.
290         * elf32-i386.c (is_indirect_function): New function.
291         (elf_i386_check_relocs): Create an ifunc output section.
292         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
293         section if necessary.
294         (elf_i386_relocate_section): Emit a reloc against an ifunc symbol
295         if necessary.
296         (elf_i386_add_symbol_hook): New function. Set the
297         has_ifunc_symbols field of the elf_obj_data structure if an ifunc
298         symbol is encountered.
299         (elf_backend_post_process_headers): Define.
300         (elf_backend_add_symbol_hook): Define.
301         (elf_i386_post_process_headers): Rename to
302         elf_i388_fbsd_post_process_headers.
303         * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro.
304         (is_indirect_function): New function.
305         (elf64_x86_64_check_relocs): Create an ifunc output section.
306         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
307         section if necessary.
308         (elf64_x86_64_relocate_section): Emit a reloc against an ifunc
309         symbol if necessary.
310         (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the
311         elf_obj_data structure if an ifunc symbol is encountered.
312         (elf_backend_post_process_headers): Define.
313         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT
314         if we have ifunc symbols to handle.
315         (get_ifunc_reloc_section_name): New function.  Computes the name
316         for an ifunc section.
317         (_bfd_elf_make_ifunc_reloc_section): New function.  Creates a
318         section to hold ifunc relocs.
319         * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define.
320         (bfd_print_symbol_vandf): Handle ifunc symbols.
321         (bfd_decode_symclass): Likewise.
322         * bfd-in2.h: Regenerate.
323
324 2009-04-30  Joseph Myers  <joseph@codesourcery.com>
325
326         * elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
327         MOVW and MOVT relocations in a shared library link.
328
329 2009-04-27  Anthony Green  <green@moxielogic.com>
330
331         * verilog.c: New file.
332         * Makefile.am (BFD32_LIBS): Add verilog.c.
333         (BFD32_LIBS_CFILES): Add verilog.c.
334         (verilog.lo): New build rule.
335         * Makefile.in: Rebuilt.
336         * targets.c: Add verilog support.
337         * bfd.c (tdata union): Add Verilog private data field.
338         * bfd-in2.h: Regenerate.
339
340 2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>
341
342         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
343         copy pe_opthdr.
344
345 2009-04-23  Matthias Klose  <doko@ubuntu.com>
346
347         * peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
348
349 2009-04-22  Christophe Lyon  <christophe.lyon@st.com>
350
351         PR9743
352         * elf32-arm.c (arm_type_of_stub): Handle R_ARM_THM_JUMP24,
353         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
354         (elf32_arm_size_stubs): Likewise.
355         (record_thumb_to_arm_glue): Deleted unused function.
356         (bfd_elf32_arm_process_before_allocation): No longer handle
357         R_ARM_THM_JUMP24, R_ARM_JUMP24 and R_ARM_PLT32 relocations here.
358         (elf32_arm_final_link_relocate): Handle R_ARM_THM_JUMP24,
359         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
360
361 2009-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
362
363         * elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED.
364         (elf32_arm_write_section): Declare early.
365         (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD.
366         (arm_allocate_glue_section_space): Exclude empty sections.
367         (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED.
368         (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub
369         BFD.
370         (elf32_arm_output_glue_section, elf32_arm_final_link): New.
371         (elf32_arm_merge_eabi_attributes): Skip the stub BFD.
372         (elf32_arm_size_dynamic_sections): Allocate interworking
373         sections here.
374         (bfd_elf32_bfd_final_link): Define.
375
376 2009-04-21  H.J. Lu  <hongjiu.lu@intel.com>
377
378         * coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K.
379         
380         * coffcode.h (coff_compute_section_file_positions): Clear
381         D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE.
382
383         * libcoff-in.h (pe_tdata): Remove force_minimum_alignment and
384         force_minimum_alignment.
385
386         * libcoff.h: Regenerated.
387
388         * pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed.
389         (PEI_FORCE_MINIMUM_ALIGNMENT): Likewise.
390
391         * peicode.h (pe_mkobject): Don't set force_minimum_alignment
392         nor target_subsystem.
393
394         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check
395         force_minimum_alignment nor target_subsystem.
396
397 2009-04-21  Kai Tietz  <kai.tietz@onevision.com>
398
399         * coff-x86_64.c (PEI_HEADERS): Protect includes.
400         (bfd_pe_print_pdata): Remove #ifdef PE variation.
401         * pei-x86_64.c (PEI_HEADERS): Define to prevent double
402         include in coff-x86_64.c of headers.
403         (PDATA_ROW_SIZE): New define.
404         (pex_regs[]): New static array.
405         (pex64_get_runtime_function): New static function.
406         (pex64_get_unwind_info): Likewise.
407         (pex64_get_scope_entry): Likewise.
408         (pex64_xdata_print_uwd_codes): Likewise.
409         (pex64_get_section_by_rva): Likewise.
410         (pex64_dump_xdata): Likewise.
411         (pex64_bfd_print_pdata): Likewise.
412         (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata.
413         * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation.
414         * libpei.h (_bfd_pex64_print_pdata): Removed declaration.
415
416 2009-04-19  Peter O'Gorman  <binutils@mlists.thewrittenword.com>
417             Alan Modra  <amodra@bigpond.net.au>
418             Dave Korn  <dave.korn.cygwin@gmail.com>
419
420         * peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t
421         long names and non-NUL-terminated strings.
422
423 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
424
425         * bfd-in2.h: Regenerated.
426
427 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
428
429         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace
430         IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER.
431
432 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
433
434         PR binutils/10074
435         * coffcode.h (bfd_pei_p): New.
436
437         * config.bfd: Remove bfd_efi_bsdrv_ia32_vec,
438         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
439         bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and
440         bfd_efi_rtdrv_ia64_vec.  Replace bfd_efi_app_ia32_vec,
441         bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with
442         i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively.
443
444         * configure.in: Remove bfd_efi_bsdrv_ia32_vec,
445         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
446         bfd_efi_rtdrv_x86_64_vec,
447         bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec.  Replace
448         bfd_efi_ia64_vec with bfd_pei_ia64_vec.
449         * targets.c: Likewise.
450
451         * configure: Regenerated.
452         * libcoff.h: Likewise.
453         * Makefile.in: Likewise.
454
455         * efi-app-ia32.c: Removed.
456         * efi-app-x86_64.c: Likewise.
457         * efi-bsdrv-ia32.c: Likewise.
458         * efi-bsdrv-ia64.c: Likewise.
459         * efi-bsdrv-x86_64.c: Likewise.
460         * efi-rtdrv-ia32.c: Likewise.
461         * efi-rtdrv-ia64.c: Likewise.
462         * efi-rtdrv-x86_64.c: Likewise.
463         * efi-rtdrv-ia32.c: Likewise.
464
465         * efi-app-ia64.c: Moved to ...
466         * pei-ia64.c: This.
467         (TARGET_SYM): Set to bfd_pei_ia64_vec.
468         (TARGET_NAME): Set to pei-ia64.
469
470         * libpei.h (bfd_target_pei_p): Removed.
471         (bfd_target_pei_arch): Likewise.
472         (bfd_target_efi_app_p): Likewise.
473         (bfd_target_efi_app_arch): Likewise.
474         (bfd_target_efi_bsdrv_p): Likewise.
475         (bfd_target_efi_bsdrv_arch): Likewise.
476         (bfd_target_efi_rtdrv_p): Likewise.
477         (bfd_target_efi_rtdrv_arch): Likewise.
478         (bfd_pe_executable_p): Likewise.
479
480         * Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo,
481         efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo.
482         (BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c
483         and efi-rtdrv-ia32.c.
484         (BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo,
485         efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and
486         efi-rtdrv-x86_64.lo. Add pei-ia64.lo.
487         (BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c,
488         efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and
489         efi-rtdrv-x86_64.c. Add pei-ia64.c.
490         (efi-app-ia64.lo): Removed.
491         (efi-bsdrv-ia32.lo): Likewise.
492         (efi-rtdrv-ia32.lo): Likewise.
493         (efi-app-ia64.lo): Likewise.
494         (efi-bsdrv-ia64.lo): Likewise.
495         (efi-rtdrv-ia64.lo): Likewise.
496         (efi-app-x86_64.lo): Likewise.
497         (efi-bsdrv-x86_64.lo): Likewise.
498         (efi-rtdrv-x86_64.lo): Likewise.
499         (pei-ia64.lo): New.
500
501         * peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p
502         with bfd_pei_p.
503         (arch_type): Removed.
504         (pe_arch): Likewise.
505         (pe_bfd_object_p): Just return coff_object_p.
506
507         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace
508         bfd_pe_executable_p with bfd_pei_p.
509
510 2009-04-17  Christophe Lyon  <christophe.lyon@st.com>
511
512         * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through
513         PLT entries to an undefined symbol when generating a shared
514         library.
515
516 2009-04-17  Nick Clifton  <nickc@redhat.com>
517
518         PR 9909
519         * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols.
520
521 2009-04-16  Richard Sandiford  <r.sandiford@uk.ibm.com>
522
523         * aout-adobe.c (aout_32_bfd_define_common_symbol): Define.
524         * aout-target.h (MY_bfd_define_common_symbol): Likewise.
525         * aout-tic30.c (MY_bfd_define_common_symbol): Likewise.
526         * binary.c (binary_bfd_define_common_symbol): Likewise.
527         * bout.c (b_out_bfd_define_common_symbol): Likewise.
528         * coff-alpha.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
529         * coff-mips.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
530         * coffcode.h (coff_bfd_define_common_symbol): Likewise.
531         * elfxx-target.h (bfd_elfNN_bfd_define_common_symbol): Likewise.
532         * i386msdos.c (msdos_bfd_define_common_symbol): Likewise.
533         * i386os9k.c (os9k_bfd_define_common_symbol): Likewise.
534         * ieee.c (ieee_bfd_define_common_symbol): Likewise.
535         * ihex.c (ihex_bfd_define_common_symbol): Likewise.
536         * libbfd-in.h (_bfd_nolink_bfd_define_common_symbol): Likewise.
537         * mach-o.c (bfd_mach_o_bfd_define_common_symbol): Likewise.
538         * mmo.c (mmo_bfd_define_common_symbol): Likewise.
539         * nlm-target.h (nlm_bfd_define_common_symbol): Likewise.
540         * oasys.c (oasys_bfd_define_common_symbol): Likewise.
541         * pef.c (bfd_pef_bfd_define_common_symbol): Likewise.
542         * ppcboot.c (ppcboot_bfd_define_common_symbol): Likewise.
543         * som.c (som_bfd_define_common_symbol): Likewise.
544         * srec.c (srec_bfd_define_common_symbol): Likewise.
545         * tekhex.c (tekhex_bfd_define_common_symbol): Likewise.
546         * versados.c (versados_bfd_define_common_symbol): Likewise.
547         * vms.c (vms_bfd_define_common_symbol): Likewise.
548         * xcoff-target.h (_bfd_xcoff_bfd_define_common_symbol): Likewise.
549         * xsym.c (bfd_sym_bfd_define_common_symbol): Likewise.
550         * coff-rs6000.c (rs6000coff_vec): Add _bfd_xcoff_define_common_symbol.
551         (pmac_xcoff_vec): Likewise.
552         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
553         (aix5coff64_vec): Likewise.
554         * linker.c (bfd_generic_define_common_symbol): New function.
555         * targets.c (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_define_common_symbol.
556         (_bfd_define_common_symbol): New field.
557         * libcoff-in.h (_bfd_xcoff_define_common_symbol): Declare.
558         * xcofflink.c (_bfd_xcoff_define_common_symbol): New function.
559         (xcoff_build_ldsyms): Don't set XCOFF_DEF_REGULAR for common
560         symbols here.
561         * bfd-in2.h: Regenerate.
562         * libbfd.h: Likewise.
563         * libcoff.h: Likewise.
564
565 2009-04-15  Anthony Green  <green@moxielogic.com>
566
567         * targets.c: Add moxie support.
568         * Makefile.am: Ditto.
569         * Makefile.in: Rebuilt.
570         * cpu-moxie.c, elf32-moxie.c: New files.
571         * archures.c: Add moxie support.
572         * configure.in: Add moxie support.
573         * configure: Rebuilt.
574         * config.bfd, archures.c: Add moxie support.
575         * bfd-in2.h: Rebuilt.
576
577 2009-04-15  Christophe Lyon  <christophe.lyon@st.com>
578
579         * elf32-arm.c (elf32_arm_final_link_relocate): Don't convert ARM
580         branch to an undef weak symbol into a jump to next instruction if
581         a PLT entry will be created.
582
583 2009-04-14  Dave Korn  <dave.korn.cygwin@gmail.com>
584
585         * coffgen.c (make_a_section_from_file):  Set the backend long
586         section names enable if long section names found on input.
587         * coffcode.h:  Extend long section names documentation to match.
588
589 2009-04-08  H.J. Lu  <hongjiu.lu@intel.com>
590
591         * elflink.c (elf_link_add_object_symbols): Warn alternate ELF
592         machine code.
593
594 2009-04-07  DJ Delorie  <dj@redhat.com>
595
596         * archures.c: Add bfd_mach_mep_c5.
597         * bfd-in2.h: Likewise.
598         * cpu-mep.c: Add bfd_c5_arch.
599         * elf32-mep.c: Support it.
600
601 2009-04-07  H.J. Lu  <hongjiu.lu@intel.com>
602
603         * elflink.c (_bfd_elf_section_already_linked): Add `\n' for
604         info->callbacks->einfo.
605         * linker.c (_bfd_generic_section_already_linked): Likewise.
606
607 2009-04-06  DJ Delorie  <dj@redhat.com>
608
609         * elf32-h8300.c (elf32_h8_relax_section): Relax MOVA opcodes.
610
611 2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>
612
613         * coff-x86_64.c (bfd_pe_print_pdata): Defined to
614         _bfd_pex64_print_pdata only if PE is defined.
615
616         * libpei.h (_bfd_pep_print_x64_pdata): Renamed to ...
617         (_bfd_pex64_print_pdata): This.
618
619         * peXXigen.c (_bfd_pep_print_x64_pdata): Renamed to ...
620         (_bfd_pex64_print_pdata): This.  Defined only if COFF_WITH_pex64
621         is defined.
622
623 2009-04-05  Kai Tietz  <kai.tietz@onevision.com>
624
625         * coff-x86_64.c (bfd_pe_print_pdata): Define as
626         _bfd_pep_print_x64_pdata.
627         * libpei.h (_bfd_pep_print_x64_pdata): Add prototype.
628         * peXXigen.c (_bfd_pep_print_x64_pdata): New.
629
630 2009-04-02  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
631
632         * elf32-xtensa.c (relax_property_section): Always set r_offset 
633         to zero.
634
635 2009-04-02  Christophe Lyon  <christophe.lyon@st.com>
636
637         * elf32-arm.c (elf32_arm_stub_long_branch_v4t_thumb_thumb,
638         elf32_arm_stub_long_branch_v4t_thumb_thumb_pic): Two new long
639         branch stubs.
640         (elf32_arm_stub_type): New enum values for the two new stubs.
641         (arm_type_of_stub): Make use of the two new stubs.
642         (arm_size_one_stub): Handle the two new stubs.
643
644 2009-04-01  Matt Thomas  <matt@netbsd.org>
645
646         * elf32-vax.c (elf_vax_check_relocs): Do not put relocations against
647         hidden symbols into the GOT or PLT.GOT.
648         (elf_vax_relocate_section): Do not emit a PCREL reloc 
649         into a shared object if it is against a hidden symbol.
650
651 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
652
653         * xcofflink.c (xcoff_archive_info): Add contains_shared_object_p
654         and know_contains_shared_object_p.
655         (xcoff_archive_contains_shared_object_p): Add an "info" parameter.
656         Cache the result in the archive_info table.
657         (xcoff_auto_export_p): Add an "info" parameter and update the
658         call to xcoff_archive_contains_shared_object_p.
659         (xcoff_mark_auto_exports): Update accordingly.
660         (xcoff_post_gc_symbol): Likewise.
661
662 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
663
664         * xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
665         rather than C_EXT.
666
667 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
668
669         * coff-rs6000.c (member_layout): New structure.
670         (archive_iterator): Likewise.
671         (member_layout_init): New function.
672         (archive_iterator_begin): Likewise.
673         (archive_iterator_next): Likewise.
674         (xcoff_write_armap_old): Use the new iterator functions.
675         (do_shared_object_padding): Delete.
676         (xcoff_write_armap_big): Use the new iterator functions.  Simplify
677         handling of arch_info.
678         (xcoff_write_archive_contents_old): Allocate arelt_data in the
679         first loop rather than the second.  Allocate a member header if
680         there isn't one, then work out the stat information and length
681         in the first loop too.  Use the new iterators for the second loop.
682         (xcoff_write_archive_contents_big): Likewise.
683
684 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
685
686         * bfd-in.h (bfd_xcoff_split_import_path): Declare.
687         (bfd_xcoff_set_archive_import_path): Likewise.
688         * bfd-in2.h: Regenerate.
689         * xcofflink.c: Include libiberty.h.
690         (xcoff_archive_info): New structure.
691         (xcoff_archive_info_hash): New function.
692         (xcoff_archive_info_eq): Likewise.
693         (xcoff_get_archive_info): Likewise.
694         (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info.
695         (bfd_xcoff_split_import_path): New function.
696         (bfd_xcoff_set_archive_import_path): Likewise.
697         (xcoff_set_import_path): Move earlier in file.
698         (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive
699         object to the the directory part of the bfd's filename.  Get the
700         import path and filename of an archive object from the archive's
701         xcoff_tdata, initializing it if necessary.  Update use of
702         import_file_id.
703         (bfd_link_input_bfd): Update use of import_file_id.
704         (xcoff_write_global_symbol): Likewise.
705
706 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
707
708         * xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
709
710 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
711
712         * xcofflink.c (xcoff_link_create_extra_sections): Don't create
713         a .loader section for relocatable links.
714         (xcoff_need_ldrel_p): New function.
715         (xcoff_mark): Use it.
716         (bfd_xcoff_link_count_reloc): Only count loader relocs if there's
717         a loader section.
718         (xcoff_build_ldsym): New function, split out from...
719         (xcoff_build_ldsyms): ...here.  Rename to...
720         (xcoff_post_gc_symbol): ...this.  Only export symbols, and only
721         call xcoff_build_ldsym, if there's a loader section.
722         (xcoff_build_loader_section): New function, extracted verbatim from...
723         (bfd_xcoff_size_dynamic_sections): ...here.  Only call it if
724         there's a loader section.  Only add an __rtinit loader symbol
725         if there's a loader section.  Update after above name change.
726         (xcoff_symbol_section, xcoff_create_ldrel): New functions.
727         (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
728         and xcoff_create_ldrel.
729         (xcoff_write_global_symbol): Use xcoff_create_ldrel.
730         (xcoff_reloc_link_order): Likewise, but only call it if there's
731         a loader section.  Use xcoff_symbol_section.
732         (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
733         if there's a loader section.
734
735 2009-04-01  Richard Sandiford  <rdsandiford@googlemail.com>
736
737         * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
738
739 2009-04-01  Christophe Lyon  <christophe.lyon@st.com>
740
741         * elf32-arm.c (group_sections): Rewrite loops for better
742         readability.
743
744 2009-03-30  DJ Delorie  <dj@redhat.com>
745
746         * elflink.c (elf_link_input_bfd): Don't try to resolve complex
747         relocs when doing a relocatable link.
748
749 2009-03-28  Mark Mitchell  <mark@codesourcery.com>
750
751         * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not
752         "ERROR:", in error messages.
753         * cpu-arm.c (bfd_arm_merge_machines): Likewise.
754         * elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
755         * elf32-arm.c (tag_cpu_arch_combine): Likewise.
756         (elf32_arm_merge_eabi_attributes): Likewise.
757         (elf32_arm_merge_private_bfd_data): Likewise.
758
759 2009-03-27  Nick Clifton  <nickc@redhat.com>
760
761         * section.c (bfd_get_section_contents): Detect and handle the case
762         where a section has the SEC_IN_MEMORY flag set but no actual
763         contents allocated.
764
765 2009-03-26  Alan Modra  <amodra@bigpond.net.au>
766
767         PR 6494
768         * elf.c (copy_elf_program_header): Do not check that PT_GNU_RELRO
769         p_filesz and p_memsz are equal.  Use p_memsz as the segment size.
770         (assign_file_positions_for_non_load_sections): Zap PT_GNU_RELRO
771         if we don't find matching PT_LOAD when copying.
772
773 2009-03-25  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
774
775         * elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of
776         the reloc descriptions.
777
778 2009-03-25  Hans-Peter Nilsson  <hp@axis.com>
779
780         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
781         <R_CRIS_16_GOT_GD, case R_CRIS_32_GOT_GD>: Handle COMMON symbols.
782         <case R_CRIS_16_TPREL, R_CRIS_32_TPREL>: Ditto.
783
784 2009-03-24  H.J. Lu  <hongjiu.lu@intel.com>
785
786         * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Make it static.
787         (bfd_i386_arch_intel_syntax): Likewise.
788         (i8086_arch): Likewise.
789         (bfd_x86_64_arch): Likewise.
790
791 2009-03-24  Hans-Peter Nilsson  <hp@axis.com>
792
793         * elf32-cris.c (cris_elf_relocate_section): <case
794         R_CRIS_16_DTPREL, R_CRIS_32_DTPREL>: Allow use of non-local
795         symbols for non-allocated sections.  Don't check whether to
796         generate R_CRIS_DTPMOD for non-allocated sections.
797         (cris_elf_gc_sweep_hook) <case R_CRIS_32_DTPREL>: Don't
798         handle relocation GC:ing if applied to non-allocated section.
799         (cris_elf_check_relocs): Similar.
800
801         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
802         <R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: Don't include the TLS size
803         when emitting a known TP offset in the GOT.
804
805 2009-03-23  Alan Modra  <amodra@bigpond.net.au>
806
807         * elf64-ppc.c (synthetic_opd): Delete.
808         (compare_symbols): Look for .opd name rather than section match.
809         (ppc64_elf_get_synthetic_symtab): Likewise.
810
811 2009-03-21  Alan Modra  <amodra@bigpond.net.au>
812
813         * elf32-ppc.c (is_pic_glink_stub): Delete.
814         (is_nonpic_glink_stub): New function.
815         (ppc_elf_get_synthetic_symtab): Check for last non-pic stub rather
816         than first pic one.
817         (struct ppc_elf_link_hash_table <glink_pltresolve>): Comment fix.
818
819 2009-03-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
820             Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
821
822         * elf32-s390.c (elf_s390_check_relocs): Use the SYMBOL_*
823         macros for visibilty and locality checks.
824         (elf_s390_adjust_dynamic_symbol): Likewise.
825         (allocate_dynrelocs): Likewise.
826         (elf_s390_relocate_section): Likewise.
827         (elf_s390_finish_dynamic_symbol): Likewise.
828         * elf64-s390.c (elf_s390_check_relocs): Likewise.
829         (elf_s390_adjust_dynamic_symbol): Likewise.
830         (allocate_dynrelocs): Likewise.
831         (elf_s390_relocate_section): Likewise.
832         (elf_s390_finish_dynamic_symbol): Likewise.
833
834 2009-03-19  Kai Tietz  <kai.tietz@onevision.com>
835
836         * bfd-in2.h: Regenerated.
837         * coffcode.h (sec_to_styp_flags): For pe-coff add SEC_READONLY
838         for debugging sections and map memory read/write dependent on
839         SEC_COFF_NOREAD.
840         (styp_to_sec_flags): Set SEC_COFF_NOREAD for sections
841         without memory read flags set.
842         * section.c: Add SEC_COFF_NOREAD to section flags.
843
844 2009-03-19  Andreas Schwab  <schwab@linux-m68k.org>
845
846         * elf32-hppa.c (final_link_relocate): Cast bfd_vma values to long
847         for format string.
848
849 2009-03-19  Alan Modra  <amodra@bigpond.net.au>
850
851         * elf32-spu.c (spu_elf_find_overlays): Separate error return from
852         "no overlays" return.  If there are overlays, create overlay
853         manager entry symbols here, so that..
854         (spu_elf_build_stubs): ..we don't need to set them up here.
855         Simplify entry symbol tests.
856         * elf32-spu.h (spu_elf_find_overlays): Update prototype.
857
858 2009-03-18  Mark Kettenis  <kettenis@gnu.org>
859
860         * elf.c (elfcore_grok_openbsd_procinfo)
861         (elfcore_grok_openbsd_note): New functions.
862         (elf_parse_notes): Handle notes from OpenBSD ELF core files.
863
864 2009-03-18  Alan Modra  <amodra@bigpond.net.au>
865
866         * vms-hdr.c: Don't include alloca.h.
867         * elf32-m68hc1x.c: Include alloca-conf.h.
868         * xsym.c: Likewise.
869         * elf64-hppa.c: Likewise.  Remove existing #if's handling alloca.
870         * som.c: Likewise.
871         * Makefile.am: Run "make dep-am".
872         * Makefile.in: Regenerate.
873
874 2009-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
875
876         * elf32-arm.c (elf32_arm_check_relocs): Correct symbian_p test.
877
878 2009-03-17  Alan Modra  <amodra@bigpond.net.au>
879
880         * elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit.
881         Add compact_stub.
882         (emum _ovly_flavour): Delete ovly_compact, ovly_none.
883         * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and
884         ovly_return fields with ovly_entry[2].  Adjust all users.
885         (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler
886         when soft-icache.
887         (spu_elf_build_stubs): Likewise.
888         (ovl_stub_size): Change arg to spu_elf_params pointer.  Adjust for
889         ovly_flavour changes.  Update all callers.
890         (ovl_stub_size_log2): New function.
891         (build_stub): Handle compact icache stubs.  Use different manager
892         entry point for stubs in non-icache area.
893         (spu_elf_size_stubs): Don't allocate space for indirect branch
894         descriptors.
895         (spu_elf_build_stubs): And don't built them.
896
897 2009-03-16  Andrew Stubbs  <ams@codesourcery.com>
898
899         * dwarf2.c (read_section): Always use rawsize, if available.
900
901 2009-03-16  Alan Modra  <amodra@bigpond.net.au>
902
903         * simple.c (bfd_simple_get_relocated_section_contents): Use larger
904         of rawsize and size for buffer.
905
906 2009-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
907
908         * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay
909         parameter just because fixed sections fit into local store.
910         (spu_elf_auto_overlay): Do not declare as "noreturn".  Skip
911         generating overlays if fixed sections plus reserved stack
912         and heap space fit into local store.
913
914 2009-03-15  Alan Modra  <amodra@bigpond.net.au>
915
916         * elf32-spu.c (build_stub): Correct icache set_id.
917         (spu_elf_relocate_section): Likewise.
918
919 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
920
921         * xcofflink.c (xcoff_link_check_archive_element): Only free the
922         symbol table if it was created by the current call.
923
924 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
925
926         * xcofflink.c (xcoff_build_ldsyms): Give imported descriptors
927         class XMC_DS rather than XMC_UA.
928
929 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
930
931         * bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the
932         bfd_boolean export_defineds parameter with an unsigned int
933         auto_export_flags parameter.
934         * bfd-in2.h: Regenerate.
935         * xcofflink.c (xcoff_archive_contains_shared_object_p): New function,
936         split out from xcoff_build_ldsyms.
937         (xcoff_covered_by_expall_p): New function.
938         (xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms
939         but with extra code to handle -bexpfull and -bexpall.
940         (xcoff_mark_auto_exports): New function.
941         (xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether
942         a function should be automatically exported.
943         (bfd_xcoff_size_dynamic_sections): Replace the export_defineds
944         parameter with an auto_export_flags parameter.  Update ldinfo
945         accordingly.  Use xcoff_mark_auto_exports to mark all automatically-
946         exported symbols.
947
948 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
949
950         * xcofflink.c (xcoff_mark_symbol_by_name): New function.
951         (bfd_xcoff_size_dynamic_sections): Use it to mark the entry,
952         init and fini functions.  Do garbage collection for objects
953         without an entry point too.
954
955 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
956
957         * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to
958         check whether a symbol has csect information.
959         (coff_print_aux): Likewise.
960         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect
961         information for C_AIX_WEAKEXT too.
962         (_bfd_xcoff_swap_aux_out): Likewise.
963         (xcoff_reloc_type_br): Handle defweak symbols too.
964         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect
965         information for C_AIX_WEAKEXT too.
966         (_bfd_xcoff64_swap_aux_out): Likewise.
967         (xcoff64_reloc_type_br): Handle defweak symbols too.
968         * coffgen.c (coff_print_symbol): Handle auxillary function
969         information for C_AIX_WEAKEXT too.
970         * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK
971         instead of BSF_GLOBAL if the L_WEAK flag is set.
972         (xcoff_dynamic_definition_p): New function.
973         (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym
974         defines h.  Don't change h if ldsym isn't the definition.  Otherwise,
975         always take the symbol class from the ldsym.  Use weak bfd symbol
976         types for weak ldsyms.
977         (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P.
978         Fix the check for whether a definition is from a shared object.
979         Allow redefinitions of weak symbols.
980         (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P.
981         (xcoff_keep_symbol_p): Likewise.
982         (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P.
983         (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P.
984         Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols,
985         but mark them as L_WEAK.
986         (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT
987         instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT.
988
989 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
990
991         * xcofflink.c (xcoff_mark): When walking the relocations,
992         only mark the target symbol or the target section, not both.
993         (xcoff_final_definition_p): New function.
994         (xcoff_keep_symbol_p): Use it to check whether an external XCOFF
995         symbol is a valid definition of the associated output symbol.
996         Use XCOFF_ALLOCATED to stop the same hash table entry having
997         two output symbols.
998         (bfd_xcoff_size_dynamic_sections): Set XCOFF_ALLOCATED when
999         keeping a symbol.
1000         (xcoff_link_input_bfd): Use xcoff_final_definition_p.
1001
1002 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1003
1004         * xcofflink.c (bfd_xcoff_import_symbol): Treat imported absolute
1005         symbols as XMC_XO.
1006
1007 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1008
1009         * libcoff-in.h (xcoff_tdata): Add a lineno_counts field.
1010         * libcoff.h: Regenerate.
1011         * xcofflink.c (xcoff_link_add_symbols): Record per-symbol
1012         line-number counts in the bfd's lineno_counts field.
1013         Don't keep per-csect line-number counts.
1014         (xcoff_sweep): Don't update per-csect line-number counts.
1015         (bfd_xcoff_size_dynamic_sections): Count the number of line-number
1016         entries in each output section.
1017         (xcoff_link_input_bfd): Get the number of line numbers from
1018         the bfd's lineno_counts field, rather than recalculating it
1019         from scratch.  Fix the range check when updating C_BINCL and
1020         C_EINCL symbols.
1021         (_bfd_xcoff_bfd_final_link): Don't count the output line numbers
1022         here.  Don't expect csects to have line-number counts.
1023
1024 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1025
1026         * libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long.
1027         * libcoff.h: Regenerate.
1028         * xcofflink.c (xcoff_keep_symbol_p): New function, using the
1029         "skip" logic from xcoff_link_input_bfd.
1030         (bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic
1031         objects in a dynamic link, rather than checking whether csectpp
1032         is null.  Always allocate debug_index for other objects,
1033         and always go through the loop.  Update the type of debug_index
1034         after the change above.  Read the auxillary csect information
1035         and use xcoff_keep_symbol_p to decide whether a symbol should
1036         be kept.  Set its debug_index to -2 if not.
1037         (xcoff_link_input_bfd): Update the type of debug_index after
1038         the change above and always expect it to be nonnull.  Use it to
1039         test whether a symbol should be stripped, rather than making the
1040         decision here.  Postpone all symbol creation to the second pass.
1041
1042 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1043
1044         * xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when
1045         creating a descriptor.
1046         (xcoff_sweep): Don't mark toc_section unless it's needed.
1047         (bfd_xcoff_size_dynamic_sections): Skip the toc_section
1048         when marking every bfd.
1049         (xcoff_link_input_bfd): Skip all TOC anchors.
1050         (xcoff_toc_section_p, xcoff_find_tc0): New functions.
1051         (_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor
1052         to -1; call xcoff_find_tc0 instead.
1053
1054 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1055
1056         * libcoff-in.h (xcoff_section_tdata): Update commentary.
1057         * libcoff.h: Regenerate.
1058         * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
1059         symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
1060         the previous symbol's csect.  Treat last_symndx as an inclusive value
1061         and simplify its handling.
1062         (xcoff_mark): Treat last_symndx as an inclusive value.  Only mark
1063         symbols with the right csect.  Don't mark rsec when processing
1064         relocations against undefined or absolute sections.
1065         (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
1066         of bfd_und_section_ptr.
1067         (xcoff_link_input_bfd): Likewise.
1068
1069 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1070
1071         * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
1072         against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED
1073         flag is set.  Assert that all undefined symbols are either
1074         imported or defined by a dynamic object.
1075         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
1076         * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol
1077         handling to all relocations.  Only set XCOFF_CALLED for function
1078         symbols.
1079         (xcoff_find_function): New function, split out from...
1080         (bfd_xcoff_export_symbol) ...here.
1081         (xcoff_set_import_path): New function, split out from...
1082         (bfd_xcoff_import_symbol): ...here.  Remove assertion for old
1083         meaning of XCOFF_CALLED.
1084         (xcoff_mark_symbol): If we mark an undefined and unimported
1085         symbol, find some way of defining it.  If the symbol is a function
1086         descriptor, fill in its definition automatically.  If the symbol
1087         is a function, mark its descriptor and allocate room for global
1088         linkage code.  Otherwise mark the symbol as implicitly imported.
1089         Move the code for creating function descriptors from...
1090         (xcoff_build_ldsyms): ...here.  Use XCOFF_WAS_UNDEFINED to
1091         check for symbols that were implicitly defined.
1092         (xcoff_mark): Don't count any dynamic relocations against
1093         function symbols.
1094         (bfd_xcoff_size_dynamic_sections): Save the rtld parameter
1095         in the xcoff link info.
1096         (xcoff_link_input_bfd): Remove handling of undefined and
1097         unexported symbols.
1098
1099 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1100
1101         * coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute
1102         if the target is absolute.  Fix comment typo.
1103         (xcoff_ppc_relocate_section): Remove FIXME.
1104         * coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute
1105         if the target is absolute.
1106
1107 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1108
1109         * xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy
1110         R_POS and R_NEG relocations against absolute symbols to the
1111         .loader section.
1112
1113 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1114
1115         * coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype
1116         to 2 for bfd_mach_ppc_620.
1117
1118 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1119
1120         * config.bfd: Treat AIX 6+ in the same way as AIX 5.
1121         * configure.in: Likewise.
1122         * configure: Regenerate.
1123
1124 2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>
1125
1126         PR binutils/9945
1127         * elf.c (assign_section_numbers): Generate symbol table if there
1128         is any relocation in output.
1129         (_bfd_elf_compute_section_file_positions): Likewise.
1130
1131 2009-03-13  Nick Clifton  <nickc@redhat.com>
1132
1133         PR 9934
1134         * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section.
1135         * elflink.c (elf_link_read_relocs_from_section): Use
1136         NUM_SHDR_ENTRIES.  Gracefully handle the case where there are
1137         relocs but no symbol table.
1138         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
1139
1140 2009-03-12  H.J. Lu  <hongjiu.lu@intel.com>
1141
1142         PR ld/9938
1143         * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
1144         to check ___tls_get_addr.
1145
1146         * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
1147         strncmp to check __tls_get_addr.
1148
1149 2009-03-12  Andrew Stubbs  <ams@codesourcery.com>
1150
1151         * dwarf2.c (read_section): Always check the offset, even when the
1152         section has been read before.
1153
1154 2009-03-11  H.J. Lu  <hongjiu.lu@intel.com>
1155
1156         * elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in
1157         comments.
1158
1159 2009-03-11  Chris Demetriou  <cgd@google.com>
1160
1161         * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag.
1162         * bfd-in2.h: Regenerate.
1163         * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT
1164         flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file
1165         mode.
1166         (bsd_write_armap): Likewise.
1167         (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT
1168         flag is set, do nothing.
1169         (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0
1170         for timestamp.
1171
1172 2009-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
1173
1174         * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
1175         used to update stack pointer.
1176
1177 2009-03-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1178
1179         PR binutils/9921
1180         * som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE
1181         for unknown symbols in absolute section.
1182
1183 2009-03-06  Nick Clifton  <nickc@redhat.com>
1184
1185         * po/es.po: Updated Spanish translation.
1186
1187 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
1188
1189         * elf32-arm.c (group_sections): Take next section size into
1190         account before accepting to group it.
1191
1192 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
1193
1194         * elf32-arm.c (arm_type_of_stub): Handle long branches targetting
1195         PLT entries.
1196         (elf32_arm_final_link_relocate): Likewise.
1197
1198 2009-03-05  Moritz Kroll  <Moritz.Kroll@gmx.de>
1199
1200         PR 9923
1201         * peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type.
1202
1203 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
1204
1205         * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New.
1206         * section.c (struct bfd_section): Add has_tls_get_addr_call.
1207         (BFD_FAKE_SECTION): Init new flag.
1208         * ecoff.c (bfd_debug_section): Likewise.
1209         * bfd-in2.h: Regenerate.
1210         * libbfd.h: Regenerate.
1211         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD.
1212         (ppc_elf_reloc_type_lookup): Handle new relocs.
1213         (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such
1214         without marker relocs.
1215         (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
1216         if section has no old-style calls.
1217         (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too.
1218         Don't try to optimize new-style __tls_get_addr call when handling
1219         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
1220         relocs.
1221         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD.
1222         (ppc64_elf_reloc_type_lookup): Handle new relocs.
1223         (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such
1224         without marker relocs.
1225         (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
1226         if section has no old-style calls.  Set toc_ref for new relocs as
1227         appropriate.
1228         (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too.
1229         Don't try to optimize new-style __tls_get_addr call when handling
1230         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
1231         relocs.
1232
1233 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
1234
1235         PR 6768
1236         * configure.in: Test for ld --as-needed support.  Link shared
1237         libbfd against libm.
1238         * configure: Regenerate.
1239
1240 2009-03-03  Alan Modra  <amodra@bigpond.net.au>
1241
1242         * Makefile.am: Run "make dep-am".
1243         * Makefile.in: Regenerate.
1244
1245 2009-03-02  Qinwei  <qinwei@sunnorth.com.cn>
1246
1247         * elf32-score7.c: New file.
1248         * elf32-score.h: New file.
1249         * elf32-score.c: Add code to support score 7.  Set score7 as the
1250         default.
1251         * cpu-score.c: Add score7 architecure.
1252         (compatibile): New function.
1253         * Makefile.am: Add rules for building elf32-score7 object.
1254         * Makefile.in: Regenerate.
1255         * configure.in: Add elf32-score7 object to score vectors.
1256         * configure: Regenerate.
1257         * reloc.c: Add score7 relocs.
1258         * archures.c: Add score3 and score7 machine numbers.
1259         * bfd-in2.h: Regenerate.
1260         * libbfd.h: Regenerate.
1261
1262 2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1263
1264         * configure: Regenerate.
1265
1266 2009-03-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1267
1268         * elf32-hppa.c (hppa32_elf_local_refcounts): New function.
1269         (elf32_hppa_check_relocs): Use it.
1270
1271         * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to
1272         elf64-hppa.c.
1273         (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
1274         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
1275         (elf_hppa_is_dynamic_loader_symbol): Likewise.
1276         (elf_hppa_record_segment_addrs): Likewise.
1277         (elf_hppa_final_link): Likewise.
1278         (elf_hppa_relocate_insn): Likewise.
1279         (elf_hppa_final_link_relocate): Likewise.
1280         (elf64_hppa_relocate_section): Likewise.
1281         * elf64-hppa.c: Insert above.
1282
1283 2009-02-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1284
1285         * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
1286         (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table.
1287         (elf_hppa_relocate_section): Likewise.
1288         * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive
1289         from struct elf_link_hash_entry.  Add count field.
1290         (struct elf64_hppa_dyn_hash_table): Delete.
1291         (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field.
1292         (elf64_hppa_hash_table): Rename to hppa_link_hash_table.
1293         (hppa_elf_hash_entry, eh_name): Define.
1294         (elf64_hppa_new_dyn_hash_entry): Delete.
1295         (elf64_hppa_dyn_hash_lookup): Delete.
1296         (elf64_hppa_dyn_hash_traverse): Delete.
1297         (get_dyn_name): Delete.
1298         (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead
1299         of struct elf64_hppa_dyn_hash_entry *.
1300         (elf64_hppa_finalize_dlt, llocate_global_data_dlt,
1301         allocate_global_data_plt, allocate_global_data_stub,
1302         allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries):
1303         Likewise.
1304         (hppa64_link_hash_newfunc): New.
1305         (elf64_hppa_hash_table_create): Rework.
1306         (count_dyn_reloc): Likewise.
1307         (hppa64_elf_local_refcounts): New.
1308         (elf64_hppa_check_relocs): Rework using standard technique for recording
1309         local DLT, PLT and OPD reference counts.
1310         (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct
1311         elf_link_hash_entry *.
1312         (elf64_hppa_mark_exported_functions, allocate_global_data_dlt,
1313         allocate_global_data_plt, allocate_global_data_stub,
1314         allocate_global_data_opd, allocate_dynrel_entries,
1315         elf64_hppa_adjust_dynamic_symbol,
1316         elf64_hppa_mark_milli_and_exported_functions): Likewise.
1317         (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections):
1318         Use hppa_link_hash_table.  Rework.
1319         (elf64_hppa_link_output_symbol_hook): Rework.
1320         (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd,
1321         elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc,
1322         elf64_hppa_finish_dynamic_sections): Likewise.
1323
1324 2009-02-26  Christophe Lyon  <christophe.lyon@st.com>
1325
1326         * elf32-arm.c (stub_reloc_type): Removed.
1327         (insn_sequence): Renamed reloc_type field to r_type.
1328         (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
1329         (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
1330         (elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
1331         (elf32_arm_stub_type): Add new enum entries for the new stubs.
1332         (arm_stub_is_thumb): Catch new stubs.
1333         (arm_type_of_stub): Handle new stubs.
1334         (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
1335         (bfd_elf32_arm_process_before_allocation): Remove useless
1336         condition.
1337
1338 2009-02-25  H.J. Lu  <hongjiu.lu@intel.com>
1339
1340         * elf.c (elf_find_function): Use is_function_type to check
1341         function symbol.
1342
1343 2009-02-24  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
1344
1345         * xtensa-modules.c: Revert to previous version 1.11 due
1346         to inadvertant commit.
1347
1348 2009-02-24  Sterling Augustine  <sterling@tensilica.com>
1349
1350         * elf32-xtensa.c (text_action_add): Separate test for action
1351         type.  Break if saved action is ta_widen_insn at same offset.
1352
1353 2009-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
1354
1355         * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
1356         to elf32_arm_stub_long_branch_any_arm_pic.
1357         (elf32_arm_stub_long_branch_any_thumb_pic): New.
1358         (enum elf32_arm_stub_type, arm_type_of_stub)
1359         (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
1360         separately.
1361
1362 2009-02-24  Joseph Myers  <joseph@codesourcery.com>
1363
1364         * elf32-arm.c (PREV_SEC): Update comment.
1365         (group_sections): Rename argument to stubs_always_after_branch.
1366         Reverse the list and place stubs at the end of input sections.
1367         Undefine NEXT_SEC.
1368         (elf32_arm_size_stubs): Update to use stubs_always_after_branch.
1369
1370 2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
1371
1372         * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
1373         Fix formatting.
1374         (arm_size_one_stub): Remove unnecessary break.
1375         (arm_map_one_stub): Fix formatting.  Return after BFD_FAIL.
1376
1377 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
1378
1379         * elf32-arm.c (stub_insn_type): New type.
1380         (stub_reloc_type): Likewise.
1381         (insn_sequence): Likewise.
1382         (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
1383         (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
1384         (elf32_arm_stub_long_branch_thumb_only): Likewise.
1385         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
1386         (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
1387         (elf32_arm_stub_long_branch_any_any_pic): Likewise.
1388         (elf32_arm_stub_hash_entry): Add new helper fields.
1389         (stub_hash_newfunc): Initialize these new fields.
1390         (arm_build_one_stub): Encode Arm and Thumb instructions separately
1391         to take endianness into account.
1392         (arm_size_one_stub): Compute size of stubs using insn_sequence.
1393         (arm_map_one_stub): Code is now more generic, thanks to
1394         insn_sequence.
1395
1396 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
1397
1398         * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
1399         code.
1400         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
1401         (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when
1402         BLX is not available. Fix typo in warning message. Add comments
1403         and improve formatting.
1404         (arm_build_one_stub): Adjust to new
1405         elf32_arm_stub_long_branch_v4t_thumb_arm stub.
1406         (arm_map_one_stub): Likewise.
1407
1408 2009-02-23  Tristan Gingold  <gingold@adacore.com>
1409             Eric Botcazou  <ebotcazou@adacore.com>
1410             Douglas B Rupp  <rupp@gnat.com>
1411
1412         * vms.h: Update copyright year, fix comments, reorder declarations.
1413         (_bfd_save_vms_section): Remove the prototype.
1414         (EGPS_S_V_NO_SHIFT): New constant.
1415         (bfd_vms_set_section_flags): New prototype.
1416         (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New
1417         constants.
1418         (EGSY_S_W_FLAGS): Ditto.
1419         (EGSY_S_V_QUAD_VAL): Ditto.
1420         (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto.
1421         (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX,
1422         EGST_S_B_NAMLNG): Ditto.
1423         (ESRF_S_B_NAMLNG): Ditto.
1424         (ETIR_S_C_HEADER_SIZE): Ditto.
1425         (EGPS_S_V_ALLOC_64BIT): Ditto.
1426         (DST_S_C_EPILOG): Ditto.
1427         (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto.
1428         (DST_S_C_SRC_INCRLNUM_B): Ditto.
1429         (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto.
1430         (DST_S_L_PCLINE_UNSLONG): Ditto.
1431         (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto
1432         (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto
1433         (DST_S_C_SOURCE_HEADER_SIZE): Ditto.
1434         (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto.
1435         (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto.
1436         (DST_S_B_SRC_UNSBYTE): Ditto.
1437         (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto.
1438         Add prototypes.
1439         (vms_section, vms_reloc): Remove types.
1440         (hdr_struc): Replaced by ...
1441         (hdr_struct): ... new type.
1442         (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants.
1443         (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto.
1444         (EMH_DATE_LENGTH): Ditto.
1445         (eom_struc): Replaced by ...
1446         (eom_struct): ... new type.
1447         (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants.
1448         (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto.
1449         (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto.
1450         (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto.
1451         (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto.
1452         (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto.
1453         (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto.
1454         (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto.
1455         (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto.
1456         (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto.
1457         (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto.
1458         (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto.
1459         (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto.
1460         (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto.
1461         (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto.
1462         (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto.
1463         (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto.
1464         (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH)
1465         (DBG_S_C_DMT_PSECT_SIZE): Ditto.
1466         (enum file_type_enum): New type.
1467         (struct location_struct): Removed.
1468         (struct fileinfo, struct srecinfo, struct lineinfo): New types.
1469         (struct funcinfo, struct module): Ditto.
1470         (struct vms_private_data_struct): Update fields.
1471         (struct vms_section_data_struct): New type.
1472
1473         * vms.c: Update copyright year, fix comments,
1474         Fix includes for DECC, add prototypes.
1475         (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove
1476         some initializers.
1477         Use flavour to set is_vax, location_stack is removed.
1478         (struct pair): Declare.
1479         (fill_section_ptr): Initialize variables at declaration.
1480         Add guard to set SECTION_SYM flag, handlde und section.
1481         (vms_fixup_sections): Use struct pair for fill_section_ptr argument.
1482         (_bfd_vms_slurp_object_records): New function, replaces previous
1483         vms_object_p.
1484         (vms_slurp_module): New function.
1485         (vms_slurp_image): Ditto.
1486         (vms_object_p): Complete rewrite.
1487         (vms_mkobject): Use is_vax field to slect architecture.
1488         (free_reloc_stream): New function.
1489         (vms_convert_to_var): Ditto.
1490         (vms_convert_to_var_1): Ditto.
1491         (vms_convert_to_var_unix_filename): Ditto.
1492         (vms_close_and_cleanup): Call free_reloc_stream, convert file to
1493         VAR format on VMS.
1494         (vms_new_section_hook): Set alignment to 0, allocate private data.
1495         (vms_get_section_contents): Load content.
1496         (vms_get_symbol_info): Handle undefined section.
1497         (vms_find_nearest_line): Handle.
1498         (alloc_reloc_stream): New function.
1499         (vms_slurp_reloc_table): Ditto.
1500         (vms_get_reloc_upper_bound): Make it real.
1501         (vms_canonicalize_reloc): Do the real work.
1502         (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA,
1503         ALPHA_R_BOH.
1504         (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH.
1505         (vms_set_arch_mach): Check arch.
1506         (vms_set_section_contents): Copy the content after allocation.
1507         (vms_alpha_vec): Update object flags.
1508
1509         * vms-tir.c: Update copyright year, fix comments,
1510         add prototypes for new functions.
1511         (dst_define_location): New function.
1512         (dst_restore_location): New function.
1513         (dst_retrieve_location): New function.
1514         (dst_check_allocation): New function.
1515         (image_dump): Call dst_check_allocation.
1516         (image_write_b): Ditto.
1517         (image_write_w): Ditto.
1518         (image_write_l): Ditto.
1519         (image_write_q): Ditto.
1520         (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW,
1521         STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC,
1522         CTL_STKDL.
1523         Call error handler instead of abort if name is not known.
1524         (etir_sta): Add quarter_relocs argument and set it.
1525         Fix cast.
1526         (etir_sto): Ditto.
1527         (etir_opr): Ditto, return FALSE in case of error.
1528         (etir_ctl): Add quarter_relocs argument and set it, fix cast.
1529         Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL.
1530         (etir_stc): Add quarter_relocs argument and set it, fix cast.
1531         Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA.
1532         Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL.
1533         Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS.
1534         Return FALSE in case of error.
1535         (tir_sta): Change sign of psect.
1536         (tir_ctl): Ditto.
1537         (tir_cmd): Fix cast. Makes tir_table static const.
1538         (etir_cmd): Add quarter_relocs argument, makes etir_table const,
1539         add argument to explain.
1540         (analyze_etir): Initialize maxptr, add quarter_relocs
1541         declaration, move some declarations into inner scopes.
1542         Handle quarter_relocs and STO_IMM.
1543         (_bfd_vms_slurp_tir): Use constant instead of hard-coded values.
1544         (_bfd_vms_slurp_relocs): New function.
1545         (_bfd_vms_decode_relocs): New function.
1546         (sto_imm): Rewritten.
1547         (start_first_etbt_record): New function.
1548         (start_another_etbt_record): Ditto.
1549         (etir_output_check): Ditto.
1550         (defer_reloc_p): Ditto.
1551         (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to
1552         a for-loop.  Correctly deals with contents, deals with .vmsdebug,
1553         rewritte relocations handling.
1554         (_bfd_vms_write_tbt): Removed.
1555         (_bfd_vms_write_dbg): Ditto.
1556
1557         * vms-misc.c: Update copyright year, Fix comments.
1558         (_bfd_vms_get_header_values): Use 'size' instead of 'length'.
1559         (maybe_adjust_record_pointer_for_object): New function.
1560         (_bfd_vms_get_first_record): New function, replaces ...
1561         (_bfd_vms_get_record): ..  removed.
1562         (_bfd_vms_get_object_record): New function.
1563         (_bfd_vms_get_object_record): New function.
1564         (vms_get_remaining_object_record): New function, replaces ...
1565         (_bfd_vms_get_next_record): ... removed.
1566         (add_new_contents): Removed.
1567         (_bfd_save_vms_section): Removed.
1568         (_bfd_get_vms_section): Removed.
1569         (_bfd_vms_output_flush): Write in VAR format.
1570         (new_symbol): Don't make UND section.
1571
1572         * vms-hdr.c: Update copyright year, update list of record handled.
1573         (_bfd_vms_slurp_hdr): rec_length renamed to rec_size.
1574         (_bfd_vms_write_hdr): Strip vms and unix patches,
1575         add comments, truncate module name at 31 characters,
1576         use constants instead of hard-coded value,
1577         write BFD version instead of a fixed string.
1578         (_bfd_vms_slurp_ihd): New function.
1579         (_bfd_vms_slurp_isd): Ditto.
1580         (_bfd_vms_slurp_ihs): Ditto.
1581         (new_module): Ditto.
1582         (parse_module): Ditto
1583         (build_module_list): Ditto.
1584         (module_find_nearest_line): Ditto.
1585         (_bfd_vms_find_nearest_dst_line): Ditto.
1586         (vms_slurp_debug): Ditto.
1587         (_bfd_vms_slurp_dbg): Ditto.
1588         (_bfd_vms_slurp_tbt): Ditto.
1589         (_bfd_vms_write_dbg): Ditto.
1590         (_bfd_vms_write_tbt): Ditto.
1591
1592         * vms-gsd.c: Update copyright year, update list of records handled.
1593         (EVAX_LITERALS_NAME): New macro.
1594         (evax_section_flags): Add an entry for EVAX_LITERALS_NAME.
1595         (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd.
1596         (register_universal_symbol): New function and prototype.
1597         (_bfd_vms_slurp_gsd): Fix indentations and casts,
1598         improve debug messages,
1599         use constants instead of hard-coded value,
1600         fix missing endianness conversion,
1601         handle global symbol (SYMG).
1602         (bfd_vms_set_section_flags): New function.
1603         (_bfd_vms_write_gsd): Don't write .vmsdebug section,
1604         handle section literals,
1605         fix indentation,
1606         handle section bfd and vms flags,
1607         don't output LIB$INITIALIZE symbol,
1608         fix handling of weak symbols,
1609         fix evax vs vax procedure descriptor,
1610         handle absolute symbols.
1611
1612         * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR,
1613         BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations.
1614
1615         * makefile.vms (DEFS): Fix flags for VMS.
1616
1617         * bfdio.c (real_fopen): Handle multiple VMS fopen attributes.
1618
1619         * bfd-in2.h: Regenerated.
1620         * libbfd.h: Regenerated.
1621
1622 2009-02-20  Cary Coutant  <ccoutant@google.com>
1623
1624         * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime
1625         in struct stat.
1626
1627 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
1628
1629         PR gas/7059
1630         * coffcode.h (coff_write_object_contents):  Don't let the string
1631         table offset overflow the s_name field when using long section names.
1632
1633 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
1634
1635         * coff-alpha.c (alpha_ecoff_backend_data):  Initialise fields which
1636         control long section name handling with ECOFF_NO_LONG_SECTION_NAMES.
1637         * coff-mips.c (mips_ecoff_backend_data):  Likewise.
1638         * coff-rs6000.c (bfd_xcoff_backend_data):  Initialise fields which
1639         control long section name handling with XCOFF_NO_LONG_SECTION_NAMES.
1640         (bfd_pmac_xcoff_backend_data):  Likewise.
1641         * coff64-rs6000.c (bfd_xcoff_backend_data):  Likewise.
1642         (bfd_xcoff_aix5_backend_data):  Likewise.
1643         (xcoff64_write_object_contents):  Delete unused long_section_names
1644         local variable.
1645         * coff-sh.c (bfd_coff_small_swap_table):  Initialise long section
1646         name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire
1647         struct non-const.
1648         * coffcode.h (documentation):  Update to describe long section names.
1649         (COFFLONGSECTIONCATHELPER):  New helper macro.
1650         (BLANKOR1TOODD):  Likewise.
1651         (COFF_ENABLE_LONG_SECTION_NAMES):  Likewise.
1652         (COFF_LONG_SECTION_NAMES_SETTER):  Likewise.
1653         (COFF_DEFAULT_LONG_SECTION_NAMES):  Likewise.
1654         (bfd_coff_set_long_section_names_allowed):  New function.
1655         (bfd_coff_set_long_section_names_disallowed):  Likewise.
1656         (struct bfd_coff_backend_data):  Add new backend hook function
1657         pointer _bfd_coff_set_long_section_names.
1658         (bfd_coff_set_long_section_names):  New backend hook.
1659         (coff_write_object_contents):  Only generate long section names if
1660         bfd_coff_long_section_names() indicates they are currently enabled.
1661         (bfd_coff_std_swap_table):  Make non-const, and initialise long
1662         section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
1663         (ticoff0_swap_table):  Likewise to both.
1664         (ticoff1_swap_table):  Again, likewise to both.
1665         * coffgen.c (make_a_section_from_file):  Allow long section names
1666         as inputs even if not currently allowed for outputs.
1667         * ecoff.c (_bfd_ecoff_no_long_sections):  New function.
1668         * efi-app-ia32.c (COFF_LONG_SECTION_NAMES):  Define to 0, not blank.
1669         * efi-app-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
1670         * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
1671         * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
1672         * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
1673         * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
1674         * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
1675         * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
1676         * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
1677         * pei-arm.c (COFF_LONG_SECTION_NAMES):  Likewise.
1678         * pei-i386.c (COFF_LONG_SECTION_NAMES):  Likewise.
1679         * pei-mcore.c (COFF_LONG_SECTION_NAMES):  Likewise.
1680         * pei-mips.c (COFF_LONG_SECTION_NAMES):  Likewise.
1681         * pei-ppc.c (COFF_LONG_SECTION_NAMES):  Likewise.
1682         * pei-sh.c (COFF_LONG_SECTION_NAMES):  Likewise.
1683         * pei-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
1684         * libcoff-in.h:  Update copyright year to cause updated copyright
1685         year in generated libcoff.h, and fix typo.
1686         * libcoff.h:  Regenerated.
1687         * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES):  New macro.
1688         (_bfd_ecoff_no_long_sections):  Add prototype.
1689         * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES):  New macro.
1690         * pe-mips.c (COFF_LONG_SECTION_NAMES):  Define empty if not already
1691         defined by an including .c file.
1692         * ticoff.h (ticoff0_swap_table):  Make non-const, and initialise
1693         long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
1694         (ticoff1_swap_table):  Likewise to both.
1695
1696 2009-02-18  Christophe Lyon  <christophe.lyon@st.com>
1697
1698         * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
1699         stub. Catch default case error.
1700         (arm_map_one_stub): Add missing Thumb mapping symbol.
1701
1702 2009-02-18  Bjoern Haase  <bjoern.m.haase@web.de>
1703
1704         PR 9841
1705         * elf32-avr.c: Handle case where no local symbos exist correctly.
1706
1707 2009-02-16  Christophe Lyon  <christophe.lyon@st.com>
1708
1709         bfd/
1710         * elf32-arm.c (arm_long_branch_stub,
1711         arm_thumb_v4t_long_branch_stub,
1712         arm_thumb_thumb_long_branch_stub,
1713         arm_thumb_arm_v4t_long_branch_stub,
1714         arm_thumb_arm_v4t_short_branch_stub,
1715         arm_pic_long_branch_stub):
1716         Renamed to elf32_arm_stub_long_branch_any_any,
1717         elf32_arm_stub_long_branch_v4t_arm_thumb,
1718         elf32_arm_stub_long_branch_thumb_only,
1719         elf32_arm_stub_long_branch_v4t_thumb_arm,
1720         elf32_arm_stub_short_branch_v4t_thumb_arm,
1721         elf32_arm_stub_long_branch_any_any_pic.
1722         (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch,
1723         arm_thumb_thumb_stub_long_branch,
1724         arm_thumb_arm_v4t_stub_long_branch,
1725         arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch):
1726         Renamed to arm_stub_long_branch_any_any,
1727         arm_stub_long_branch_v4t_arm_thumb,
1728         arm_stub_long_branch_thumb_only,
1729         arm_stub_long_branch_v4t_thumb_arm,
1730         arm_stub_short_branch_v4t_thumb_arm,
1731         arm_stub_long_branch_any_any_pic.
1732
1733 2009-02-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1734
1735         * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used
1736         in branch offset check.
1737
1738 2009-02-15  Alan Modra  <amodra@bigpond.net.au>
1739
1740         * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,
1741         add toc.symndx and toc.add.
1742         (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here.
1743         Set up toc.add.
1744         (get_tls_mask): Add toc_addend param, set from toc.add.  Adjust all
1745         callers.
1746         (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd.
1747         (branch_reloc_hash_match): New function, extracted from..
1748         (ppc64_elf_tls_optimize): ..here.
1749         (ppc64_elf_relocate_section): Properly set addends when optimizing
1750         tls sequences.  Avoid unnecessary reading and writing of insns.
1751         Only redo reloc when symbol changed.  Bypass symbol checks when
1752         using tlsld_got.
1753         * elf32-ppc.c (ppc_elf_tls_setup): Correct comment.
1754         (branch_reloc_hash_match): New function, extracted from..
1755         (ppc_elf_tls_optimize): ..here.
1756         (ppc_elf_relocate_section): Avoid unnecessary reading of insns.
1757         Don't clear addend on zapped __tls_get_addr reloc.
1758
1759 2009-02-12  Nick Clifton  <nickc@redhat.com>
1760
1761         PR 9827
1762         * elflink.c (bfd_elf_final_link): When counting the relocations,
1763         if the header size has not been set yet then assume that it will
1764         match the output section's reloc type.
1765
1766 2009-02-12  Nathan Sidwell  <nathan@codesourcery.com>
1767
1768         * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
1769         relocatable link.
1770
1771 2009-02-09  Alan Modra  <amodra@bigpond.net.au>
1772
1773         * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
1774         (find_function): Likewise.
1775         (pasted_function): Don't error if no prior function found.
1776         (discover_functions): Revert 2008-12-10 change.  Extend first
1777         function range to start of section.
1778
1779 2009-02-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1780
1781         * elf64-hppa.c: Remove PARAMS macro.  Replace PTR with void *.  Convert
1782         functions to C90.
1783         * elf64-hppa.h: Likewise.
1784
1785 2009-02-06  Joseph Myers  <joseph@codesourcery.com>
1786
1787         * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special
1788         .sbss handling.
1789
1790 2009-02-04  Alan Modra  <amodra@bigpond.net.au>
1791
1792         * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize.
1793         Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*.
1794
1795 2009-02-03  Sandip Matte  <sandip@rmicorp.com>
1796
1797         * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr.
1798         * archures.c (bfd_mach_mips_xlr): Define.
1799         * bfd-in2.h: Regenerate.
1800         * cpu-mips.c (I_xlr): Define.
1801         (arch_info_struct): Add XLR entry.
1802         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR.
1803         (mips_set_isa_flags): Handle bfd_mach_mips_xlr
1804         (mips_mach_extensions): Add XLR entry.
1805
1806 2009-02-03  Eric B. Weddington  <eric.weddington@atmel.com>
1807
1808         * elf32-avr.c (avr_final_link_relocate): Allow avr25 to wraparound.
1809
1810 2009-02-03  Carlos O'Donell  <carlos@codesourcery.com>
1811
1812         * configure.in: AC_SUBST pdfdir.
1813         * Makefile.am: Add install-pdf, install-pdf-am
1814         and install-pdf-recursive targets. Define pdfdir.
1815         * doc/Makefile.am: Define pdf__strip_dir. Add
1816         install-pdf and install-pdf-am targets.
1817         * po/Make-in: Add install-pdf target.
1818         * configure: Regenerate.
1819         * Makefile.in: Regenerate
1820         * doc/Makefile.in: Regenerate.
1821
1822 2009-02-03  Maxim Kuvyrkov  <maxim@codesourcery.com>
1823
1824         * bfd-in2.h: Regenerate.
1825         * elf32-m68k.c: Handle 2-slot GOT entries.  Rename variables and
1826         fields from n_entries to n_slots where appropriate, update comments.
1827         (HOWTO): Add TLS relocations.
1828         (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*.
1829         (enum elf_m68k_got_offset_size): New enum.
1830         (struct elf_m68k_got_entry.type): Move field to ...
1831         (struct elf_m68k_got_entry_key): ... here.  Update all uses.
1832         (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static
1833         functions.
1834         (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static
1835         functions.
1836         (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries
1837         fields into n_entries array.  Update comments.
1838         (elf_m68k_init_got): Simplify, update all uses.
1839         (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update.
1840         (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot
1841         GOT entries; update name, update all uses.
1842         (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto.
1843         (elf_m68k_get_got_entry): Update.
1844         (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries,
1845         simplify.
1846         (elf_m68k_remove_got_entry_type): Simplify.
1847         (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update.
1848         (elf_m68k_can_merge_gots): Update.
1849         (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update.
1850         (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot
1851         GOT entries, simplify.
1852         (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same.
1853         (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff
1854         field, remove obsoleted local_n_entries field.
1855         (elf_m68k_partition_multi_got_2): New static function.
1856         (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it;
1857         update.
1858         (elf_m68k_remove_got_entry_type): Update.
1859         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
1860         (elf_m68k_check_relocs): Handle TLS relocations.  Remove unnecessary
1861         update of sgot->size and srelgot->size.
1862         (elf_m68k_gc_sweep_hook): Update.
1863         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
1864         (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle
1865         TLS relocations.
1866         * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations.
1867         * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
1868
1869 2009-02-02  DJ Delorie  <dj@redhat.com>
1870
1871         * elf32-mep.c (config_names): Regenerate configuration.
1872
1873 2009-02-02  Alan Modra  <amodra@bigpond.net.au>
1874
1875         * elf-bfd.h (bfd_elf_get_str_section): Don't declare.
1876         (bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise.
1877         * elf.c (bfd_elf_get_str_section): Make static.
1878         (bfd_elf_find_section): Delete.
1879         * libbfd.h: Regenerate.
1880
1881 2009-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
1882
1883         * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove.
1884         (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs.
1885
1886 2009-01-31  Alan Modra  <amodra@bigpond.net.au>
1887
1888         * elflink.c (on_needed_list): New function.
1889         (elf_link_add_object_symbols): Link in --as-needed libs if they
1890         satisfy undefined symbols in other libs.
1891
1892 2009-01-30  Julian Brown  <julian@codesourcery.com>
1893
1894         * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with
1895         EXEC_P or DYNAMIC flags, and skip sections which are being linked
1896         with --just-symbols (-R).
1897
1898 2009-01-29  Adam Nemet  <anemet@caviumnetworks.com>
1899
1900         * dwarf2.c (read_rangelist): Use read_address to read low_pc and
1901         high_pc in order to properly sign-extend VMAs.
1902
1903 2009-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
1904             Mark Shinwell  <shinwell@codesourcery.com>
1905             Catherine Moore  <clm@codesourcery.com>
1906
1907         * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments.
1908
1909 2009-01-28  Catherine Moore <clm@codesourcery.com>
1910
1911         * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and
1912         SEC_LOAD for dynamic relocation sections.
1913
1914 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
1915
1916         * elf32-cris.c (cris_elf_relocate_section): Use elf_hash_table
1917         (info)->tls_size, not elf_hash_table (info)->tls_sec->size for
1918         the size of local TLS data.
1919
1920 2009-01-27  Andreas Schwab  <schwab@suse.de>
1921
1922         * mach-o.c (bfd_mach_o_archive_p): Restrict the number of
1923         architectures in the archive.
1924
1925 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
1926
1927         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
1928         <R_CRIS_32_DTPREL>: Correct relocation value.
1929
1930         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
1931         <R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined
1932         symbols with non-default visibility.
1933
1934 2009-01-26  Nathan Sidwell  <nathan@codesourcery.com>
1935
1936         * elf32-ppc.c (ppc_elf_relax_section): Add space for relocs
1937         describing the trampolines.
1938         (ppc_elf_relocate_section): Update relocs to describe the
1939         trampolines.
1940
1941 2009-01-25  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1942
1943         * elf-hppa.h (elf_hppa_final_link_relocate): Add check to ensure that
1944         branch targets can be reached for R_PARISC_PCREL22F, R_PARISC_PCREL17F
1945         and R_PARISC_PCREL12F relocations.
1946
1947 2009-01-24  Alan Modra  <amodra@bigpond.net.au>
1948
1949         PR 6022
1950         * elflink.c (find_version_for_sym): New function split out from,
1951         but without export_dynamic test, ..
1952         (_bfd_elf_link_assign_sym_version): ..here.
1953         (_bfd_elf_export_symbol): Use it.
1954
1955 2009-01-23  Alan Modra  <amodra@bigpond.net.au>
1956
1957         * elf-bfd.h (struct elf_assign_sym_version_info): Delete.
1958         (struct elf_info_failed, struct elf_find_verdep_info): Move to..
1959         * elflink.c: ..here, somewhat modified.
1960         * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol,
1961         _bfd_elf_link_find_version_dependencies,
1962         _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section,
1963         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
1964         _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't
1965         declare..
1966         * elflink.c: ..and make static here.
1967         (_bfd_elf_link_find_version_dependencies): Adjust for removal
1968         of output_bfd from struct elf_find_verdep_info.
1969         (_bfd_elf_link_assign_sym_version): Similarly adjust to use
1970         struct elf_info_failed.
1971         (bfd_elf_size_dynamic_sections): Adjust.
1972
1973 2009-01-22  Alan Modra  <amodra@bigpond.net.au>
1974
1975         PR 6832
1976         * dwarf2.c (find_line): Don't update stash->sec_info_ptr until
1977         after comp_unit_find_line call.
1978
1979 2009-01-21  Nick Clifton  <nickc@redhat.com>
1980
1981         PR 9769
1982         * vmsutil.c (vms_file_stats_name): Remove use of unsupported
1983         tm_gmtoff field in struct tm.
1984
1985 2009-01-21  Alan Modra  <amodra@bigpond.net.au>
1986
1987         * elf32-spu.h (struct spu_elf_params): Add non_ia_text.
1988         * elf32-spu.c (mark_overlay_section): Only include .text.ia.*
1989         sections in soft-icache lines unless non_ia_text.  Don't add
1990         rodata if doing so would exceed line size.
1991
1992 2009-01-19  Hans-Peter Nilsson  <hp@axis.com>
1993
1994         * elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol
1995         types than bfd_link_hash_indirect, before early return, call
1996         _bfd_elf_link_hash_copy_indirect.
1997
1998 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
1999
2000         * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
2001         * elf-bfd.h (elf_backend_data): Add obj_attrs_order.
2002         * elf32-arm.c (elf32_arm_obj_attrs_order): New function.
2003         (elf_backend_obj_attrs_order): New define.
2004         * elfxx-target.h (elf_backend_obj_attrs_order): New define.
2005         (elfNN_bed): Add elf_backend_obj_attrs_order.
2006
2007 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
2008
2009         * elf-attrs.c (is_default_attr): Substitute magic numbers with macros.
2010         (obj_attr_size): Likewise.
2011         (write_obj_attribute): Likewise.
2012         (_bfd_elf_copy_obj_attributes): Likewise.
2013         (_bfd_elf_parse_attributes): Likewise.
2014         * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define.
2015         (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines.
2016         (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines.
2017         (ATTR_TYPE_HAS_NO_DEFAULT): New define.
2018         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers
2019         with macros.
2020
2021 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
2022
2023         * elf-attrs.c (is_default_attr): Support defaultless attributes.
2024         (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
2025         (bfd_elf_add_obj_attr_string): Likewise.
2026         (bfd_elf_add_obj_attr_int_string): Likewise.
2027         (_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
2028         * elf-bfd.h (struct obj_attribute): Document new flag bit.
2029         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
2030         Tag_nodefaults has no default value.
2031         (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
2032         comment to reflect the new state.
2033
2034 2009-01-19  Alan Modra  <amodra@bigpond.net.au>
2035
2036         PR 9695
2037         * pdp11.c (N_BADMAG): True for anything but OMAGIC, NMAGIC, ZMAGIC.
2038         (some_aout_object_p): Delete dead code handling QMAGIC and BMAGIC.
2039         (adjust_z_magix): Delete dead code handling QMAGIC.
2040
2041 2009-01-16  Kai Tietz  <kai.tietz@onevision.com>
2042
2043         * coffcode.h (styp_to_sec_flags): Correct interpretation of
2044         IMAGE_SCN_MEM_DISCARDABLE.
2045
2046 2009-01-16  Alan Modra  <amodra@bigpond.net.au>
2047
2048         * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute
2049         SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS.
2050         * configure.in (commonbfdlib): Delete.
2051         (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/
2052         (SHARED_LIBADD): Rename from WIN32LIBADD.  Add pic libiberty if such
2053         is available, not just for linux.
2054         * po/SRC-POTFILES.in: Regenerate.
2055         * Makefile.in: Regenerate.
2056         * configure: Regenerate.
2057
2058 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
2059             Julian Brown   <julian@codesourcery.com>
2060
2061         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known
2062         ARM attributes in ABI 2.07.
2063         * elf32-arm.c (get_secondary_compatible_arch): New function.
2064         (set_secondary_compatible_arch): New function.
2065         (tag_cpu_arch_combine): New function.
2066         (elf32_arm_copy_one_eabi_other_attribute): Delete function.
2067         (elf32_arm_copy_eabi_other_attribute_list): Delete function.
2068         (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to
2069         make it fit with order_01243.
2070         Add support for Tag_also_compatible_with,
2071         Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use,
2072         Tag_MPextension_use, Tag_nodefaults and Tag_conformance.
2073         Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name,
2074         Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension,
2075         Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed,
2076         Tag_VFP_arch and Tag_ABI_FP_16bit_format.
2077         Rework the way unknown attributes are handled.
2078         Defer errors until all attributes have been processed.
2079
2080 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
2081
2082         * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to
2083         bfd_elf_add_obj_attr_int_string.
2084         Read Tag_compatibility from its new location in the attribute array,
2085         rather than the attribute list.
2086         (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat ->
2087         bfd_elf_add_obj_attr_int_string.
2088         (_bfd_elf_parse_attributes): Likewise.
2089         (_bfd_elf_merge_object_attributes): There's now only one
2090         Tag_compatibility, and it's in the array, not the list.
2091         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include
2092         Tag_compatibility.
2093         (bfd_elf_add_obj_attr_compat): Rename to
2094         bfd_elf_add_obj_attr_int_string.
2095         (bfd_elf_add_proc_attr_compat): Rename to
2096         bfd_elf_add_proc_attr_int_string.
2097         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle
2098         Tag_compatibility.
2099
2100 2009-01-15  Douglas B Rupp  <rupp@gnat.com>
2101
2102         * Makefile.am (BFD32_BACKENDS): Add new object vmsutil.lo
2103         (BFD32_BACKENDS_CFILES): Add new file vmsutil.c
2104         (vmsutil.lo): Add dependency rule.
2105         * Makefile.in: Regenerate.
2106         * config.bfd (ia64*-*-*vms*): Add case.
2107         * configure.in (bfd_elf64_ia64_vms_vec): Add case.
2108         * configure: Regenerate.
2109         * vmsutil.c: New file.
2110         * vmsutil.h: New file.
2111         * elf-bfd.h (struct bfd_elf_special_section): Change type of
2112         attr to bfd_vma.
2113         * elfxx-ia64.c (elfNN_vms_post_process_headers,
2114         elfNN_vms_section_processing, elfNN_vms_final_write_processing,
2115         elfNN_vms_close_and_cleanup, elfNN_vms_section_from_shdr,
2116         elfNN_vms_object_p): New functions
2117         * targets.c (bfd_elf64_ia64_vms_vec): New target.
2118
2119 2009-01-14  H.J. Lu  <hongjiu.lu@intel.com>
2120
2121         PR ld/9727
2122         * elflink.c (elf_gc_sweep): Exclude the group section if the
2123         first member of the section group is excluded.
2124
2125 2009-01-14  Alan Modra  <amodra@bigpond.net.au>
2126
2127         PR 9735
2128         * syms.c (_bfd_stab_section_find_nearest_line): Don't free
2129         saved filename, use bfd_alloc rather than bfd_malloc for it.
2130
2131 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
2132
2133         * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute.
2134
2135 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
2136
2137         * elf32-spu.c (remove_cycles): Always set call->max_depth.
2138
2139 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
2140
2141         * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask.
2142
2143 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
2144
2145         * elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2,
2146         num_lines_log2.
2147         (struct got_entry): Add br_addr.
2148         (struct call_info): Add priority.
2149         (struct function_info): Add lr_store and sp_adjust.
2150         (spu_elf_setup): Init line_size_log2 and num_lines_log2.
2151         (spu_elf_find_overlays): For soft-icache, mark any section within cache
2152         area as an overlay, and check that no other overlays exist.  Look up
2153         icache overlay manager entry sym.
2154         (BRA_STUBS, BRA, BRASL): Define.
2155         (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub.
2156         (needs_ovl_stub): Adjust for soft-icache.  Return priority encoded
2157         in branch insn.
2158         (count_stub, build_stub): Support soft-icache.
2159         (build_spuear_stubs, process_stubs): Adjust build_stub call.
2160         (spu_elf_size_stubs): Size soft-icache stubs.
2161         (overlay_index): New function.
2162         (spu_elf_build_stubs): Make static.  Support soft-icache.
2163         (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache.
2164         (find_function_stack_adjust): Save lr store and stack adjust insn
2165         offsets.
2166         (maybe_insert_function): Adjust find_function_stack_adjust call.
2167         (mark_functions_via_relocs): Retrieve priority.
2168         (remove_cycles): Only warn about pruned arcs when stack_analysis.
2169         (sort_calls): Sort by priority first.
2170         (mark_overlay_section): Ignore .ovl.init.
2171         (sum_stack): Only print when stack_analysis.
2172         (print_one_overlay_section): New function, extracted from..
2173         (spu_elf_auto_overlay): ..here.  Support soft-icache overlays.
2174         (spu_elf_stack_analysis): Only print when htab->stack_analysis.
2175         (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive
2176         analysis.  Call spu_elf_build_stubs.
2177         (spu_elf_relocate_section): For soft-icache encode overlay index
2178         into addresses.
2179         (spu_elf_output_symbol_hook): Support soft-icache.
2180         (spu_elf_modify_program_headers: Likewise.
2181
2182         * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis.  Rename
2183         num_regions to num_lines.  Add line_size and max_branch.
2184         (enum _ovly_flavour): Add ovly_soft_icache.
2185         (spu_elf_build_stubs): Delete.
2186
2187 2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
2188
2189         * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
2190         relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.
2191
2192 2009-01-07  Hans-Peter Nilsson  <hp@axis.com>
2193
2194         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
2195         <case R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: For a symbol defined in
2196         the program, the known offset starts at the negative size of the
2197         TLS section.
2198         <case R_CRIS_32_IE, R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>:
2199         Similar.
2200
2201 2009-01-05  Joel Sherrill <joel.sherrill@oarcorp.com>
2202
2203         * config.bfd: Add lm32-*-rtems*.
2204
2205 2009-01-03  H.J. Lu  <hongjiu.lu@intel.com>
2206
2207         * coff-ppc.c: Add 2009 to Copyright.
2208         * elf32-cris.c: Likewise.
2209         * elflink.c: Likewise.
2210
2211 2009-01-03  Hans-Peter Nilsson  <hp@axis.com>
2212
2213         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Rename
2214         gotplt_index to rela_plt_index.  Adjust for R_CRIS_DTPMOD entry.
2215
2216 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
2217
2218         PR ld/9679
2219         * elflink.c (elf_merge_st_other): New.
2220         (_bfd_elf_merge_symbol): Use it on skipped weak definitions and
2221         hide them if needed.
2222         (elf_link_add_object_symbols): Updated.
2223
2224 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
2225
2226         PR ld/9676
2227         * elflink.c (elf_link_add_object_symbols): Update def_dynamic,
2228         ref_dynamic and dynamic_def fields when setting def_regular
2229         to 1.
2230
2231 2009-01-02  Curtis Mackie  <curtmackevo@gmail.com>
2232
2233         PR 9682
2234         * coff-ppc.c (dump_toc): Fix up calls to fprintf without a string
2235         literal.
2236
2237 For older changes see ChangeLog-2008
2238 \f
2239 Local Variables:
2240 mode: change-log
2241 left-margin: 8
2242 fill-column: 74
2243 version-control: never
2244 End: