Support garbage collection against STT_GNU_IFUNC symbols.
[external/binutils.git] / bfd / ChangeLog
1 2010-07-13  H.J. Lu  <hongjiu.lu@intel.com>
2
3         PR ld/11791
4         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Support
5         garbage collection against STT_GNU_IFUNC symbols.
6
7         * elf32-i386.c (elf_i386_get_local_sym_hash): Don't set
8         elf.plt.offset/elf.got.offset to -1.
9         (elf_i386_tls_transition): Skip TLS transition for functions.
10         (elf_i386_gc_sweep_hook): Support STT_GNU_IFUNC symbols.
11
12         * elf64-x86-64.c (elf64_x86_64_get_local_sym_hash): Don't set
13         elf.plt.offset/elf.got.offset to -1.
14         (elf64_x86_64_tls_transition): Skip TLS transition for functions.
15         (elf64_x86_64_gc_sweep_hook): Support STT_GNU_IFUNC symbols.
16
17 2010-07-12  H.J. Lu  <hongjiu.lu@intel.com>
18
19         * elf32-i386.c (elf_i386_check_relocs): Re-indent.
20         (elf_i386_relocate_section): Likewise.
21
22 2010-07-06  H.J. Lu  <hongjiu.lu@intel.com>
23
24         * dwarf2.c (add_line_info): Initialize prev_line.
25
26 2010-07-06  Alan Modra  <amodra@gmail.com>
27
28         * elf32-ppc.c (ppc_elf_relax_section): Insert branch around
29         trampolines only for .init and .fini sections.
30
31 2010-07-05  Alan Modra  <amodra@gmail.com>
32
33         * elf32-ppc.c: Formatting.
34         (ppc_elf_finish_dynamic_sections): Don't make plt_entry var static.
35
36 2010-07-03  Cary Coutant  <ccoutant@google.com>
37
38         * compress.c (bfd_uncompress_section_contents): Add ATTRIBUTE_UNUSED.
39         * dwarf2.c (read_and_uncompress_section): New function.
40         (read_section): Call it.
41         (find_line): Likewise.
42
43 2010-07-01  Alan Modra  <amodra@gmail.com>
44
45         * elf64-ppc.c (ppc64_elf_edit_toc): Use SYMBOL_CALLS_LOCAL rather
46         than SYMBOL_REFERENCES_LOCAL.
47         (ppc64_elf_relocate_section): Likewise.
48
49 2010-07-01  Alan Modra  <amodra@gmail.com>
50
51         * elf64-ppc.c (ppc64_elf_edit_toc): Keep toc entries for ifuncs.
52
53 2010-06-29  Alan Modra  <amodra@gmail.com>
54
55         * cpu-maxq.c: Delete file.
56         * coff-maxq.c: Delete file.
57         * Makefile.am: Remove references to maxq.
58         * archures.c: Likewise.
59         * coffcode.h: Likewise.
60         * configure.in: Likewise.
61         * targets.c: Likewise.
62         * config.bfd: Move maxq from obsolete to removed.
63         * Makefile.in: Regenerate.
64         * bfd-in2.h: Regenerate.
65         * configure: Regenerate.
66         * libbfd.h: Regenerate.
67         * po/SRC-POTFILES.in: Regenerate.
68
69 2010-06-28  Alan Modra  <amodra@gmail.com>
70
71         * compress.c (bfd_uncompress_section_contents): Use ATTRIBUTE_UNUSED
72         to silence gcc warning.
73
74 2010-06-27  Alan Modra  <amodra@gmail.com>
75
76         * elf64-ppc.c (get_tls_mask): Don't segfault on NULL elf_section_data.
77         (group_sections): Likewise.
78
79 2010-06-27  Alan Modra  <amodra@gmail.com>
80
81         * bout.c (aligncode): Delete set but unused variables.
82         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
83         * coff-ppc.c (ppc_record_toc_entry): Likewise.
84         (coff_ppc_relocate_section): Likewise.
85         * coff-rs6000.c (xcoff_complain_overflow_bitfield_func): Likewise.
86         * elf-m10200.c (mn10200_elf_relax_delete_bytes): Likewise.
87         * elf-m10300.c (mn10300_elf_final_link_relocate): Likewise.
88         (mn10300_elf_relax_section): Likewise.
89         * elf32-arm.c (arm_build_one_stub, arm_size_one_stub): Likewise.
90         (record_vfp11_erratum_veneer): Likewise.
91         (bfd_elf32_arm_vfp11_erratum_scan): Likewise.
92         (elf32_arm_final_link_relocate): Likewise.
93         (elf32_arm_check_relocs, arm_map_one_stub): Likewise.
94         * elf32-avr.c (elf32_avr_relax_delete_bytes): Likewise.
95         (elf32_avr_relax_section): Likewise.
96         (avr_mark_stub_not_to_be_necessary): Likewise.
97         * elf32-bfin.c (_bfin_create_got_section): Likewise.
98         * elf32-cr16.c (cr16_elf_final_link_relocate): Likewise.
99         (elf32_cr16_relax_delete_bytes): Likewise.
100         * elf32-cr16c.c (cr16c_elf_final_link_relocate): Likewise.
101         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
102         * elf32-crx.c (elf32_crx_relax_delete_bytes): Likewise.
103         * elf32-h8300.c (elf32_h8_relax_section): Likewise.
104         (elf32_h8_relax_delete_bytes): Likewise.
105         * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
106         * elf32-i370.c (i370_elf_check_relocs): Likewise.
107         (elf_relocate_section): Likewise.
108         * elf32-ip2k.c (adjust_all_relocations): Likewise.
109         (ip2k_elf_relax_section): Likewise.
110         * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
111         (lm32_elf_check_relocs): Likewise.
112         (lm32_elf_finish_dynamic_sections): Likewise.
113         (lm32_elf_finish_dynamic_symbol): Likewise.
114         * elf32-m32c.c (m32c_offset_for_reloc): Likewise.
115         (m32c_elf_relax_delete_bytes): Likewise.
116         * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
117         (m32r_elf_finish_dynamic_sections): Likewise.
118         (m32r_elf_check_relocs, m32r_elf_fake_sections): Likewise.
119         * elf32-m68hc11.c (m68hc11_elf_relax_section): Likewise.
120         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
121         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
122         * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
123         (microblaze_elf_check_relocs): Likewise.
124         (microblaze_elf_finish_dynamic_symbol): Likewise.
125         * elf32-msp430.c (msp430_elf_relax_delete_bytes): Likewise.
126         * elf32-ppc.c (ppc_elf_tls_optimize): Likewise.
127         * elf32-rx.c (rx_elf_relocate_section): Likewise.
128         (elf32_rx_relax_delete_bytes, rx_offset_for_reloc): Likewise.
129         (elf32_rx_relax_section): Likewise.
130         * elf32-score.c (score_elf_got_offset_from_index): Likewise.
131         (score_elf_final_link_relocate): Likewise.
132         (s3_bfd_score_elf_relocate_section): Likewise.
133         * elf32-score7.c (score_elf_got_offset_from_index): Likewise.
134         (s7_bfd_score_elf_relocate_section): Likewise.
135         * elf32-sh.c (sh_elf_check_relocs): Likewise.
136         * elf32-spu.c (spu_elf_relocate_section): Likewise.
137         * elf32-v850.c (v850_elf_check_relocs): Likewise.
138         (find_remembered_hi16s_reloc): Likewise.
139         * elf32-vax.c (elf32_vax_merge_private_bfd_data): Likewise.
140         (elf_vax_relocate_section): Likewise.
141         * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
142         * elf32-xtensa.c (xlate_offset_with_removed_text): Likewise.
143         (move_literal): Likewise.
144         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
145         (elf64_hppa_check_relocs): Likewise.
146         (elf64_hppa_finish_dynamic_symbol): Likewise.
147         (elf64_hppa_relocate_section): Likewise.
148         * elf64-mmix.c (mmix_elf_reloc, mmix_elf_relax_section): Likewise.
149         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
150         (ppc64_elf_edit_opd, ppc64_elf_edit_toc): Likewise.
151         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
152         (elfNN_vms_section_from_shdr): Likewise.
153         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
154         (_bfd_sparc_elf_relocate_section): Likewise.
155         * hp300hpux.c (slurp_symbol_table): Likewise.
156         * i386lynx.c (swap_std_reloc_out, swap_std_reloc_in): Likewise.
157         * mach-o.c (bfd_mach_o_write_thread): Likewise.
158         * mmo.c (mmo_scan, mmo_write_symbols_and_terminator): Likewise.
159         * nlm32-sparc.c (nlm_sparc_read_reloc): Likewise.
160         * pdp11.c (pdp11_aout_link_input_section): Likewise.
161         (aout_link_input_section, aout_link_input_bfd): Likewise.
162         * pe-mips.c (mips_swap_reloc_out): Likewise.
163         (coff_pe_mips_relocate_section): Likewise.
164         * som.c (som_bfd_ar_write_symbol_stuff): Likewise.
165         * vms-alpha.c (_bfd_vms_slurp_egsd): Likewise.
166         * xsym.c (bfd_sym_fetch_type_information_table_ent): Likewise.
167
168         * coff-i860.c (i860_reloc_processing): Avoid set but unused warning.
169         * coffcode.h (coff_compute_section_file_positions): Likewise.
170         (coff_slurp_reloc_table): Likewise.
171         * cpu-arm.c (arm_check_note): Likewise.
172         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Likewise.
173         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
174         * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Likewise.
175         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
176         * elf32-moxie.c (moxie_elf_relocate_section): Likewise.
177         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
178         * elf32-sh64.c (_bfd_sh_align_load_span): Likewise.
179         * ieee.c (parse_expression): Likewise.
180         (ieee_slurp_external_symbols, drop_int): Likewise.
181         * peXXigen.c (pe_print_pdata): Likewise.
182         * versados.c (process_esd): Likewise.
183
184 2010-06-25  Tristan Gingold  <gingold@adacore.com>
185
186         * vms-alpha.c (_bfd_vms_write_egsd): Check absolute section with
187         its flags.  Create an absolute section if needed.
188
189 2010-06-25  Tristan Gingold  <gingold@adacore.com>
190
191         * vms-alpha.c (_bfd_vms_write_egsd): Set target_index field of
192         sections.  Mark .vmsdebug section as SEC_DEBUGGING.  Do not create
193         dummy psect anymore.  Adjust.
194         (_bfd_vms_write_eeom): Adjust (use target_index instead of index)
195         (_bfd_vms_write_etir): Ditto.
196         (start_etir_or_etbt_record): Test for SEC_DEBUGGING instead of
197         section name.  Adjust.
198
199 2010-06-25  Tristan Gingold  <gingold@adacore.com>
200
201         * vms-alpha.c (alpha_vms_write_exec): Set linktime field.
202
203 2010-06-25  Alan Modra  <amodra@gmail.com>
204
205         * elf64-ppc.c (toc_skip_enum): Define.
206         (ppc64_elf_edit_toc): Use two low bits of skip array as markers.
207         Optimize largetoc sequences.
208         (adjust_toc_syms): Update for skip array change.
209         (ppc64_elf_relocate_section): Handle R_PPC64_LO_DS_OPT.
210
211 2010-06-25  Alan Modra  <amodra@gmail.com>
212
213         * elf64-ppc.c (is_static_defined): New function.
214         (get_tls_mask, ppc_type_of_stub): Use it here.
215         (ppc64_elf_edit_opd): Ensure we only attempt to edit ppc64 input.
216         (ppc64_elf_tls_setup): Typo fix.
217         (adjust_toc_syms): Correctly handle symbols defined past the end
218         of the toc.  Move syms on removed entries to next entry rather
219         than to start of toc.
220         (ppc64_elf_edit_toc): Likewise.  Ensure we only attempt to
221         edit ppc64 input.  Allocate one extra word in skip array.
222         Honour info->keep_memory when reading relocs if we can.
223         Adjust toc relocs after adjusting symbols.
224
225 2010-06-23  Nathan Sidwell  <nathan@codesourcery.com>
226
227         * archive64.c (bfd_elf64_archive_write_armap): Fix buffer overrun
228         when scaning map.
229
230 2010-06-17  Tristan Gingold  <gingold@adacore.com>
231
232         * Makefile.am (BFD32_BACKENDS_CFILES): Move vms-alpha.c to ...
233         (BFD64_BACKENDS_CFILES): ... here.
234         (BFD32_BACKENDS): Move vms-alpha.lo to ...
235         (BFD64_BACKENDS): ... here.
236         * Makefile.in: Regenerate.
237
238 2010-06-15  Joseph Myers  <joseph@codesourcery.com>
239
240         * elf-bfd.h (LEAST_KNOWN_OBJ_ATTRIBUTE): Decrease to 2.
241         * elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type,
242         elf32_tic6x_merge_arch_attributes, elf32_tic6x_merge_attributes,
243         elf32_tic6x_merge_private_bfd_data): New.
244         (bfd_elf32_bfd_merge_private_bfd_data,
245         elf_backend_obj_attrs_arg_type, elf_backend_obj_attrs_section,
246         elf_backend_obj_attrs_section_type, elf_backend_obj_attrs_vendor):
247         Define.
248         * elf32-tic6x.h (elf32_tic6x_merge_arch_attributes): Declare.
249
250 2010-06-15  Joseph Myers  <joseph@codesourcery.com>
251
252         * elf-bfd.h (LEAST_KNOWN_OBJ_ATTRIBUTE): Define.
253         (struct elf_backend_data): Update comment on obj_attrs_order.
254         * elf-attrs.c (vendor_obj_attr_size, vendor_set_obj_attr_contents,
255         _bfd_elf_copy_obj_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE
256         instead of hardcoded 4.
257         * elf32-arm.c (elf32_arm_obj_attrs_order): Use
258         LEAST_KNOWN_OBJ_ATTRIBUTE and LEAST_KNOWN_OBJ_ATTRIBUTE + 1
259         instead of hardcoded 4 and 5.
260         (elf32_arm_merge_eabi_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE
261         instead of hardcoded 4.
262
263 2010-06-14  Kevin Buettner  <kevinb@redhat.com>
264
265         * elf32-h8300.c (elf_symbol_leading_char): Define.
266
267 2010-06-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
268
269         * vms-alpha.c (_bfd_vms_write_egsd): Make sname const.
270
271 2010-06-11  Tristan Gingold  <gingold@adacore.com>
272
273         * vms-alpha.c (_bfd_vms_slurp_egsd): Always set vma of absolute
274         sections to 0.
275
276 2010-06-11  Tristan Gingold  <gingold@adacore.com>
277
278         * vms-alpha.c (evax_bfd_print_etir): Handle ETIR__C_STO_GBL_LW.
279
280 2010-06-11  Tristan Gingold  <gingold@adacore.com>
281
282         * vms-misc.c (_bfd_vms_output_counted): Make VALUE argument const.
283         Adjust cast.
284         (_bfd_vms_output_dump): Make DATA argument const, adjust cast.
285         * vms.h (_bfd_vms_output_counted, _bfd_vms_output_dump): Adjust.
286         * vms-alpha.c (evax_section_flags): Make it const.
287         (vms_secflag_by_name): Remove unused ABFD argument.
288         Make SECTION_FLAGS and NAME arguments const. Clarify comment.
289         (vms_esecflag_by_name): Make SECTION_FLAGS and NAME arguments const.
290         (_bfd_vms_slurp_egsd): Adjust call to vms_secflag_by_name.
291         (_bfd_vms_write_egsd): Remove useless cast.
292
293 2010-06-10  Tristan Gingold  <gingold@adacore.com>
294
295         * config.bfd: Remove #if/#endif so that som can be compiled on any
296         host.
297         * targets.c (_bfd_target_vector): Remove #if/#endif so that som
298         can be used on any host.
299
300 2010-06-10  Tristan Gingold  <gingold@adacore.com>
301
302         * som.c: Can now be compiled on any host.
303         Include bfd headers instead of system one.
304         (som_compute_checksum): Parameter is now a pointer to a
305         som_external_header structure.  Adjust.
306         (struct section_to_type): Field section is now const.
307         (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Removed conditional
308         definition.
309         (R_LONG_PCREL_MODE, R_N0SEL, R_N1SEL, R_LINETAB): Ditto.
310         (R_LINETAB_ESC, R_LTP_OVERRIDE, R_COMMENT): Ditto.
311         (som_swap_clock_in, som_swap_clock_out): New functions.
312         (som_swap_header_in, som_swap_header_out): Likewise.
313         (som_swap_space_dictionary_in): Likewise.
314         (som_swap_space_dictionary_out): Likewise.
315         (som_swap_subspace_dictionary_in): Likewise.
316         (som_swap_subspace_dictionary_record_out): Likewise.
317         (som_swap_aux_id_in, som_swap_aux_id_out): Likewise.
318         (som_swap_string_auxhdr_out): Likewise.
319         (som_swap_compilation_unit_out): Likewise.
320         (som_swap_exec_auxhdr_in): Likewise.
321         (som_swap_exec_auxhdr_out): Likewise.
322         (som_swap_lst_header_in): Likewise.
323         (som_object_setup): Adjust parameter type using bfd types.
324         (setup_sections): Likewise.  Ditto for object file types.
325         Use intermediate variables for external representation and use the
326         swap functions to convert.
327         (som_object_p): Ditto.  Remove #ifdef/#endif on always defined
328         macros.
329         (som_prep_headers): Likewise.
330         (som_write_symbol_strings): Likewise.
331         (som_begin_writing): Likewise.
332         (som_finish_writing): Likewise.
333         (som_build_and_write_symbol_table): Likewise.
334         (bfd_section_from_som_symbol): Likewise.
335         (som_slurp_symbol_table): Likewise.
336         (som_bfd_print_private_bfd_data): Likewise.
337         (bfd_som_attach_aux_hdr): Likewise.  Clear the padding.
338         (bfd_som_attach_compilation_unit): Likewise.
339         (som_bfd_count_ar_symbols): Likewise.
340         (som_bfd_fill_in_ar_symbols): Likewise.
341         (som_slurp_armap): Likewise.
342         (som_bfd_ar_write_symbol_stuff): Likewise.
343         (som_write_armap): Likewise.  Use _bfd_ar_spacepad instead of
344         sprintf to write header fields.
345         * som.h: Include bfd headers instead of system one.
346         (FILE_HDR_SIZE, AUX_HDR_SIZE): Removed.
347         (struct somdata): Use bfd structures instead of system ones.
348         (struct som_section_data_struct): Likewise.
349         (struct som_subspace_dictionary_record): Removed (now in
350         include/som/internal.h)
351
352 2010-06-10  Tristan Gingold  <gingold@adacore.com>
353
354         * targets.c (bfd_target_list): Remove hp/ux compiler work-around
355         as bfd requires an ANSI-C compiler.
356
357 2010-06-09 Tristan Gingold  <gingold@adacore.com>
358
359         * bfdio.c (bfd_bread): Fix the code to prevent reading past the
360         end of archive members.
361
362 2010-06-08  Tristan Gingold  <gingold@adacore.com>
363
364         * som.c (som_bfd_free_cached_info): Do not free relocations as
365         they were allocated with bfd_zalloc.
366
367 2010-06-08  Tristan Gingold  <gingold@adacore.com>
368
369         * vms-lib.c (_bfd_vms_lib_write_archive_contents): Increment
370         for the first block.
371
372 2010-06-08  Tristan Gingold  <gingold@adacore.com>
373
374         * vms-lib.c (_bfd_vms_lib_ia64_mkarchive): New function.
375         * libbfd-in.h (_bfd_vms_lib_ia64_mkarchive): Declare.
376         * libbfd.h: Regenerate.
377         * elfxx-ia64.c (bfd_elfNN_write_archive_contents): Redefine for VMS.
378         (bfd_elfNN_mkarchive): Ditto.
379
380 2010-06-02  Tristan Gingold  <gingold@adacore.com>
381
382         * vms-alpha.c (alpha_vms_bfd_final_link): Fix 64bit constant.
383
384 2010-06-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
385
386         * configure: Regenerate.
387
388 2010-06-01  Tristan Gingold  <gingold@adacore.com>
389
390         * vms-alpha.c (struct vms_private_data_struct): Add
391         transfer_address field.  Remove unused dst_info field.
392         (alpha_vms_write_exec): Use transfer_address.
393         (_bfd_vms_write_egsd): Add a comment about LIB$INITIALIZE.
394         (alpha_vms_bfd_final_link): Set transfer_address.
395
396 2010-05-31  Tristan Gingold  <gingold@adacore.com>
397
398         * vms-lib.c (credat_lo, credat_hi): New fields.
399         (vms_read_block): Adjust comments.
400         (vms_write_block): New function.
401         (_bfd_vms_lib_archive_p): Decode majorid once.  Replace some
402         hard-coded values with constants.  Set credat_lo and credat_hi.
403         (_bfd_vms_lib_mkarchive): Add argument kind.
404         Set ver, mhd_size and type according to kind.
405         (_bfd_vms_lib_alpha_mkarchive): New function.
406         (struct lib_index): Renamed from struct vms_index
407         (lib_index_cmp): Renamed from vms_index_cmp.  Adjusted.
408         (get_idxlen): Type of idx argument adjusted.  Add is_elfidx
409         argument and handle it.
410         (vms_write_index): Adjust argument idx.  Handle elf indexes.
411         (_bfd_vms_lib_build_map): Adjust type of arguments modules and res.
412         (_bfd_vms_lib_write_archive_contents): Add is_elfidx variable and
413         use it.  Handle elf indexes.  Set credat.
414         * libbfd-in.h (_bfd_vms_lib_mkarchive): Renamed to ...
415         (_bfd_vms_lib_alpha_mkarchive): ... this.
416         * libbfd.h: Regenerated.
417         * vms-alpha.c (vms_alpha_vec): Adjust after previous renaming.
418
419 2010-05-28  Sterling Augustine  <sterling@tensilica.com>
420
421         * elf32-xtensa.c (elf_xtensa_relocate_section): Add a large amount
422         of code to change the bits in the instructions to match the changes
423         in the relocations.  Declare dest_addr and sym_sec to help.
424
425 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
426
427         Workaround GCC PR middle-end/4210.
428         * vms-misc.c (vms_time_t_to_vms_time): Use ternary operator for val[2]
429         and val[3].
430
431 2010-05-27  Tristan Gingold  <gingold@adacore.com>
432
433         * vms-misc.c: Define __NEW_STARLET.  Remove trailing spaces.
434         (VMS_TIME_FACTOR, VMS_TIME_OFFSET): New macros.
435         (vms_time_to_time_t): Use them instead of local const.
436         (vms_time_t_to_vms_time): New function.
437         (vms_get_time): Likewise.
438         (vms_raw_get_time): Likewise.
439         * vms.h (vms_time_t_to_vms_time): New declaration.
440         (vms_get_time): Likewise.
441         (vms_raw_get_time): Likewise.
442
443 2010-05-26  Tristan Gingold  <gingold@adacore.com>
444
445         * vms-alpha.c: Update comments.
446         (alpha_vms_write_exec): Set lnkflags.  Write the GST.
447         (alpha_vms_link_output_symbol): New function.
448         (alpha_vms_bfd_final_link): Generate the VMS symbol table.
449         Set dst_section private field.
450         (alpha_vms_bfd_final_link): Remove code that set dst_section.
451
452 2010-05-26  Tristan Gingold  <gingold@adacore.com>
453
454         * bfdio.c: Declare and define _bfd_memory_iovec.
455         (bfd_bread): Move code for BFD_IN_MEMORY...
456         (bfd_bwrite): ... Ditto ...
457         (bfd_tell): ... Ditto ...
458         (bfd_flush): ... Ditto ...
459         (bfd_stat): ... Ditto ...
460         (bfd_seek): ... Ditto ...
461         (bfd_get_size): ... Ditto ...
462         (bfd_mmap): ... Ditto ...
463         (memory_bread): ... to these new functions.
464         (memory_bwrite): Ditto.
465         (memory_btell): Ditto.
466         (memory_bseek): Ditto.
467         (memory_bflush): Ditto.
468         (memory_bstat): Ditto.
469         (memory_bmmap): Ditto.
470         (memory_bclose): New function.
471         * peicode.h (pe_ILF_build_a_bfd): Use BFD_IN_MEMORY.
472         * xcofflink.c (bfd_xcoff_link_generate_rtinit): Ditto.
473         * opncls.c (bfd_close): Do not handle BFD_IN_MEMORY case.
474         (bfd_make_writable): Use _bfd_memory_iovec.
475         * elfcode.h (bfd_from_remote_memory): Use _bfd_memory_iovec.
476         * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Use
477         _bfd_memory_iovec.
478         (alpha_ecoff_openr_next_archived_file): Use proxy_origin
479         instead of origin.
480         * libbfd.h: Regenerate.
481
482 2010-05-25  Daniel Jacobowitz  <dan@codesourcery.com>
483             Joseph Myers  <joseph@codesourcery.com>
484             Andrew Stubbs  <ams@codesourcery.com>
485
486         * config.bfd (sh-*-uclinux* | sh[12]-*-uclinux*): Add
487         bfd_elf32_shl_vec, and FDPIC vectors to targ_selvecs.
488         * configure.in: Handle FDPIC vectors.
489         * elf32-sh-relocs.h: Add FDPIC and movi20 relocations.
490         * elf32-sh.c (DEFAULT_STACK_SIZE): Define.
491         (SYMBOL_FUNCDESC_LOCAL): Define.  Use it instead of
492         SYMBOL_REFERENCES_LOCAL for function descriptors.
493         (fdpic_object_p): New.
494         (sh_reloc_map): Add FDPIC and movi20 relocations.
495         (sh_elf_info_to_howto, sh_elf_relocate_section): Handle new invalid
496         range.
497         (struct elf_sh_plt_info): Add got20 and short_plt.  Update all
498         definitions.
499         (FDPIC_PLT_ENTRY_SIZE, FDPIC_PLT_LAZY_OFFSET): Define.
500         (fdpic_sh_plt_entry_be, fdpic_sh_plt_entry_le, fdpic_sh_plts): New.
501         (FDPIC_SH2A_PLT_ENTRY_SIZE, FDPIC_SH2A_PLT_LAZY_OFFSET): Define.
502         (fdpic_sh2a_plt_entry_be, fdpic_sh2a_plt_entry_le)
503         (fdpic_sh2a_short_plt_be, fdpic_sh2a_short_plt_le, fdpic_sh2a_plts):
504         New.
505         (get_plt_info): Handle FDPIC.
506         (MAX_SHORT_PLT): Define.
507         (get_plt_index, get_plt_offset): Handle short_plt.
508         (union gotref): New.
509         (struct elf_sh_link_hash_entry): Add funcdesc, rename tls_type to
510         got_type and adjust all uses.  Add GOT_FUNCDESC.
511         (struct sh_elf_obj_tdata): Add local_funcdesc.  Rename
512         local_got_tls_type to local_got_type.
513         (sh_elf_local_got_type): Renamed from sh_elf_local_got_tls_type.  All
514         users changed.
515         (sh_elf_local_funcdesc): Define.
516         (struct elf_sh_link_hash_table): Add sfuncdesc, srelfuncdesc, fdpic_p,
517         and srofixup.
518         (sh_elf_link_hash_newfunc): Initialize new fields.
519         (sh_elf_link_hash_table_create): Set fdpic_p.
520         (sh_elf_omit_section_dynsym): New.
521         (create_got_section): Create .got.funcdesc, .rela.got.funcdesc
522         and .rofixup.
523         (allocate_dynrelocs): Allocate local function descriptors and space
524         for R_SH_FUNCDESC-related relocations, and for rofixups.
525         Handle GOT_FUNCDESC.  Create fixups.  Handle GOT entries which
526         require function descriptors.
527         (sh_elf_always_size_sections): Handle PT_GNU_STACK and __stacksize.
528         (sh_elf_modify_program_headers): New.
529         (sh_elf_size_dynamic_sections): Allocate function descriptors for
530         local symbols.  Allocate .got.funcdesc contents.  Allocate rofixups.
531         Handle local GOT entries of type GOT_FUNCDESC.  Create fixups for
532         local GOT entries.  Ensure that FDPIC libraries always have a PLTGOT
533         entry in the .dynamic section.
534         (sh_elf_add_dyn_reloc, sh_elf_got_offset, sh_elf_initialize_funcdesc)
535         (sh_elf_add_rofixup, sh_elf_osec_to_segment)
536         (sh_elf_osec_readonly_p, install_movi20_field): New functions.
537         (sh_elf_relocate_section): Handle new relocations, R_SH_FUNCDESC,
538         R_SH_GOTFUNCDESC and R_SH_GOTOFFFUNCDESC.  Use sh_elf_got_offset
539         and .got.plt throughout to find _GLOBAL_OFFSET_TABLE_.  Add rofixup
540         read-only section warnings.  Handle undefined weak symbols.  Generate
541         fixups for R_SH_DIR32 and GOT entries.  Check for cross-segment
542         relocations and clear EF_SH_PIC.  Handle 20-bit relocations.
543         Always generate R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
544         (sh_elf_gc_sweep_hook): Handle R_SH_FUNCDESC, R_SH_GOTOFF20,
545         R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20, and R_SH_GOTOFFFUNCDESC.
546         Handle 20-bit relocations.
547         (sh_elf_copy_indirect_symbol): Copy function descriptor reference
548         counts.
549         (sh_elf_check_relocs): Handle new relocations.  Make symbols
550         dynamic for FDPIC relocs.  Account for rofixups.  Error for FDPIC
551         symbol mismatches.  Allocate a GOT for R_SH_DIR32. Allocate fixups
552         for R_SH_DIR32.
553         (sh_elf_copy_private_data): Copy PT_GNU_STACK size.
554         (sh_elf_merge_private_data): Copy initial flags.  Do not clobber
555         non-mach flags.  Set EF_SH_PIC for FDPIC.  Reject FDPIC mismatches.
556         (sh_elf_finish_dynamic_symbol): Do not handle got_funcdesc entries
557         here.  Rename sgot to sgotplt and srel to srelplt.  Handle short_plt,
558         FDPIC descriptors, and got20.  Create R_SH_FUNCDESC_VALUE for FDPIC.
559         Use install_movi20_field.  Rename srel to srelgot.  Always generate
560         R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
561         (sh_elf_finish_dynamic_sections): Fill in the GOT pointer in rofixup.
562         Do not fill in reserved GOT entries for FDPIC.  Correct DT_PLTGOT.
563         Rename sgot to sgotplt.  Assert that the right number of rofixups
564         and dynamic relocations were allocated.
565         (sh_elf_use_relative_eh_frame, sh_elf_encode_eh_address): New.
566         (elf_backend_omit_section_dynsym): Use sh_elf_omit_section_dynsym.
567         (elf_backend_can_make_relative_eh_frame)
568         (elf_backend_can_make_lsda_relative_eh_frame)
569         (elf_backend_encode_eh_address): Define.
570         (TARGET_BIG_SYM, TARGET_BIG_NAME, TARGET_LITTLE_SYM)
571         (TARGET_LITTLE_NAME, elf_backend_modify_program_headers, elf32_bed):
572         Redefine for FDPIC vector.
573         * reloc.c: Add SH FDPIC and movi20 relocations.
574         * targets.c (_bfd_target_vector): Add FDPIC vectors.
575         * configure, bfd-in2.h, libbfd.h: Regenerated.
576
577 2010-05-25  Jay Krell  <jay.krell@cornell.edu>
578
579         PR ld/11624
580         * archive.c (_bfd_calloc_wrapper): New function.
581         (_bfd_add_bfd_to_archive_cache): Use it.
582
583         * configure.in: Add alpha*-*-*vms* to list of natives.
584         * configure: Regenerate.
585
586         * vms-misc.c: Define globalref if necessary.
587         (vms_convert_to_var_unix_filename): Rename to
588         _bfd_vms_convert_to_var_unix_filename and export.
589         * vms.h: Add prototype for _bfd_vms_convert_to_var_unix_filename.
590         * vms-alpha.c (vms_close_and_cleanup): Update invocation of
591         vms_convert_to_var_unix_filename.
592
593 2010-05-24  Tristan Gingold  <gingold@adacore.com>
594
595         * vms-alpha.c (add_symbol_entry): New function extrated from ...
596         (add_symbol): ... adjusted.
597
598 2010-05-24  Tristan Gingold  <gingold@adacore.com>
599
600         * vms-alpha.c (_bfd_vms_slurp_egsd): Fix indentation.
601         (alpha_vms_write_exec): Add a comment.
602         (_bfd_vms_write_egsd): Ditto.
603         (alpha_vms_convert_symbol): Remove a blank line.
604
605 2010-05-21  Tristan Gingold  <gingold@adacore.com>
606
607         * vms-alpha.c (_bfd_vms_slurp_eihs): Do not create a bfd section
608         for the GST.
609
610 2010-05-21  Tristan Gingold  <gingold@adacore.com>
611
612         * vms-alpha.c (_bfd_vms_slurp_eisd): Set SEC_HAS_CONTENTS and
613         SEC_LOAD if isect has data.
614         (vms_get_symbol_info): Refine the condition for 'T' type.
615
616 2010-05-18  Tristan Gingold  <gingold@adacore.com>
617
618         * vms-alpha.c (_bfd_vms_write_emh): New function.
619         (_bfd_vms_write_lmn): New function.
620         (_bfd_vms_write_eeom): Moved.
621         (hash_string): Likewise.
622         (_bfd_vms_length_hash_symbol): Likewise.
623         (_bfd_vms_write_ehdr): Code moved to _bfd_vms_write_emh
624         and _bfd_vms_write_lmn, and call these functions.
625
626 2010-05-18  Tristan Gingold  <gingold@adacore.com>
627
628         * vms-alpha.c (evax_bfd_print_dst): Handle INCR_LINUM_L.
629         Add details in the messages.
630         (evax_bfd_print_image): Change message.
631
632 2010-05-18  H.J. Lu  <hongjiu.lu@intel.com>
633
634         PR gas/11600
635         * elf.c (_bfd_elf_make_section_from_shdr): Handle SHF_EXCLUDE
636         (elf_fake_sections): Likewise.
637
638         * elf32-i370.c (i370_elf_section_from_shdr): Don't handle
639         SHF_EXCLUDE here.
640         * elf32-ppc.c (ppc_elf_fake_sections): Likewise.
641
642 2010-05-17  Tristan Gingold  <gingold@adacore.com>
643
644         * vms-alpha.c: Include esgps.h and eidc.h.
645         (_bfd_vms_slurp_egsd): Ignore SPSC and IDC sub-records.
646         (evax_bfd_print_egsd_flags): New function, extracted from ...
647         (evax_bfd_print_egsd): ..., calls evax_bfd_print_egsd_flags.  Handles
648         EGSD__C_SPSC and EGSD__C_IDC.
649
650 2010-05-14  Tristan Gingold  <gingold@adacore.com>
651
652         * vms-alpha.c (alpha_vms_object_p): Accept header size of 0.
653         (_bfd_vms_get_object_record): Handle align byte only in the
654         foreign case.
655
656 2010-05-14  Tristan Gingold  <gingold@adacore.com>
657
658         * vms-lib.c (_bfd_vms_lib_ia64_archive_p): New function.
659         * libbfd-in.h (_bfd_vms_lib_ia64_archive_p): Add prototype.
660         * libbfd.h: Regenerate.
661         * configure.in (havevecs): Define HAVE_all_vecs when
662         --enable-targets=all is set.  Use AC_SUBST on it.
663         (tdefaults): Do not add havevecs.
664         (bfd_elf64_ia64_vms_vec): Add vms-lib.lo and vms-misc.lo
665         * configure: Regenerate.
666         * Makefile.am (HAVEVECS): New variable.
667         (INCLUDES): Add HAVEVECS.
668         * Makefile.in: Regenerate.
669         * elfxx-ia64.c (INCLUDE_IA64_VMS): New macro, defined if vms
670         target is selected.  Add #ifdef/#endif around vms specific code.
671         (bfd_elfNN_archive_p, bfd_elfNN_archive_slurp_armap,
672         bfd_elfNN_archive_slurp_extended_name_table,
673         bfd_elfNN_archive_construct_extended_name_table,
674         bfd_elfNN_archive_truncate_arname,
675         bfd_elfNN_archive_write_armap,
676         bfd_elfNN_archive_read_ar_hdr,
677         bfd_elfNN_archive_write_ar_hdr,
678         bfd_elfNN_archive_openr_next_archived_file,
679         bfd_elfNN_archive_get_elt_at_index,
680         bfd_elfNN_archive_generic_stat_arch_elt,
681         bfd_elfNN_archive_update_armap_timestamp): Define to use vms archives.
682
683 2010-05-11  Jie Zhang  <jie@codesourcery.com>
684
685         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge
686         Tag_ABI_HardFP_use correctly.
687
688 2010-05-11  Alan Modra  <amodra@gmail.com>
689
690         * coffcode.h (coff_write_object_contents): Enclose all occurrences
691         of hasdebug and is_reloc_section in #ifdef COFF_IMAGE_WITH_PE.
692
693 2010-05-07  Daniel Jacobowitz  <dan@codesourcery.com>
694
695         * elf32-arm.c (struct a8_erratum_reloc): Add hash member.  Move
696         sym_name to improve packing.
697         (cortex_a8_erratum_scan): Check for PLT entries.
698         (elf32_arm_size_stubs): Save the target symbol for a8 relocs.
699
700 2010-05-07  Tristan Gingold  <gingold@adacore.com>
701
702         * Makefile.in: Regenerate with automake 1.11.1.
703         * aclocal.m4: Ditto.
704
705 2010-05-05  Nick Clifton  <nickc@redhat.com>
706
707         * po/es.po: Updated Spanish translation.
708
709 2010-05-03  Tristan Gingold  <gingold@adacore.com>
710
711         * vms-lib.c (vms_lib_bopen): Fix the size threshold to read
712         selective_search flag.
713         Add comments.
714         * vms-alpha.c (alpha_vms_bfd_final_link): Create the DMT section
715         before output_has_begun is set.
716
717 2010-05-03  Tristan Gingold  <gingold@adacore.com>
718
719         * vms-alpha.c: Add comments.
720         (struct vms_private_data_struct): Remove image_autoextend field.
721         (dst_check_allocation): Removed.
722         (image_write): Remove call to dst_check_allocation.
723         (vms_slurp_debug): Do not set image_autoextend.  Adjust section
724         size.
725         (_bfd_vms_slurp_object_records): Remove useless new_type variable.
726         (alpha_vms_write_exec): Use dst_section to get the dst section.
727         Write the dmt section.
728         (evax_bfd_print_image): Also print the dst size in hexa.  Fix typo.
729         (alpha_vms_read_sections_content): Do not set image_autoextend.
730         (alpha_vms_bfd_final_link): Generate the dst.
731
732 2010-05-03  Tristan Gingold  <gingold@adacore.com>
733
734         * vms-lib.c (_bfd_vms_lib_archive_p): Adjust for a possible empty
735         next array.
736         (vms_lib_dcx): Adjust for the above change.
737
738 2010-04-30  H.J. Lu  <hongjiu.lu@intel.com>
739
740         PR ld/11542
741         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): New.
742
743         * elf32-i386.c (elf_i386_relocate_section): Use it.
744         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
745
746 2010-04-30  Tristan Gingold  <gingold@adacore.com>
747
748         * vms-lib.c (vms_read_block): New function.
749         (vms_traverse_index): Use vms_read_block.  Handle long key names.
750
751 2010-04-30  Tristan Gingold  <gingold@adacore.com>
752
753         * vms-lib.c (struct lib_tdata): Field artdata added, fields nbr_syms
754         and syms removed.
755         (struct carsym_mem): New structure.
756         (vms_add_index): New function.
757         (vms_add_indexes_from_list): New function.
758         (vms_traverse_index): Parameter carsym changed to carsym_mem.
759         Code adjusted to handle elfidx.
760         (vms_lib_read_index): Adjusted for vms_traverse_index changes.
761         Parameter NBREL is now a pointer.
762         (_bfd_vms_lib_archive_p): Adjust for above change.  Handle ia64
763         archives.
764         (_bfd_vms_lib_mkarchive): Adjusted for changes in struct lib_tdata.
765         (_bfd_vms_lib_find_symbol): Ditto.
766         (vms_lib_bopen): Fix two typos: return FALSE in case of error,
767         check MHD id.
768         (_bfd_vms_lib_get_module): New function.
769         (_bfd_vms_lib_get_elt_at_index): Rewritten using the above
770         function.
771         (_bfd_vms_lib_openr_next_archived_file): Use _bfd_vms_lib_get_module.
772         (_bfd_vms_lib_generic_stat_arch_elt): Handle ia64 archives.
773         (vms_write_index): Adjust for structure renamed.
774         * vms-alpha.c (alpha_vms_link_add_archive_symbols): Adjust for
775         changes of _bfd_vms_lib_find_symbol.
776
777 2010-04-28  Kai Tietz  <kai.tietz@onevision.com>
778
779         * config.bfd: Correct accidential reverted patch
780         about vax*-*-*vms*.
781
782 2010-04-27  Kai Tietz  <kai.tietz@onevision.com>
783
784         * pe-x86_64.c (TARGET_UNDERSCORE): Set value dependent
785         to USE_MINGW64_LEADING_UNDERSCORES.
786         * pei-x86_64.c (TARGET_UNDERSCORE): Likewise.
787         * config.bfd: Change underscoring default for x64 mingw
788         to false.
789         * coffcode.h (coff_write_relocs): Add check that dereferenced
790         sym_ptr_ptr isn't NULL.
791         * config.in (USE_MINGW64_LEADING_UNDERSCORES): New.
792         * configure: Regenerated.
793         * configure.in: Add option '--enable-leading-mingw64-underscores'
794         and define config.in variable USE_MINGW64_LEADING_UNDERSCORES.
795
796 2010-04-27  Nick Clifton  <nickc@redhat.com>
797
798         PR binutils/11512
799         * coffgen.c (coff_find_nearest_line): Incldue the section address
800         of function name symbols in address comparisons.
801
802 2010-04-27  Nick Clifton  <nickc@redhat.com>
803
804         * po/fr.po: Updated French translation.
805
806 2010-04-23  Alan Modra  <amodra@gmail.com>
807
808         * elf.c: Replace use of ELF_IS_SECTION_IN_SEGMENT and
809         ELF_IS_SECTION_IN_SEGMENT_FILE with ELF_SECTION_IN_SEGMENT
810         throughout file.
811         (assign_file_positions_for_load_sections): Modify section in
812         segment warning to ignore overlay vmas.
813         * elf32-spu.c (spu_elf_object_p): Replace use of
814         ELF_IS_SECTION_IN_SEGMENT_MEMORY with ELF_SECTION_IN_SEGMENT.
815
816 2010-04-22  Nick Clifton  <nickc@redhat.com>
817
818         * po/bfd.pot: Updated by the Translation project.
819         * po/vi.po: Updated Vietnamese translation.
820
821 2010-04-22  Alan Modra  <amodra@gmail.com>
822
823         * elf.c (assign_file_positions_for_load_sections): Revert 2008-05-29
824         change.  Tidy.  Don't error on sections not allocated in segment.
825
826 2010-04-15  Andrew Haley  <aph@redhat.com>
827
828         * bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag:
829         merge_exidx_entries.
830         * bfd-in2.h: Likewise.
831         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise.  Use it to
832         control merging of exidx entries.
833
834 2010-04-20  Joseph Myers  <joseph@codesourcery.com>
835
836         * elf32-tic6x.h: New.
837         * elf-bfd.h (enum elf_target_id): Define TIC6X_ELF_DATA.
838         * elf32-tic6x.c (struct elf32_tic6x_obj_tdata, elf32_tic6x_tdata,
839         elf32_tic6x_howto_table_rel, elf32_tic6x_info_to_howto_rel,
840         elf32_tic6x_set_use_rela_p, elf32_tic6x_mkobject,
841         elf32_tic6x_new_section_hook, elf32_tic6x_rel_relocation_p,
842         bfd_elf32_mkobject, bfd_elf32_new_section_hook): New.
843         (elf32_tic6x_reloc_type_lookup, elf32_tic6x_reloc_name_lookup,
844         elf32_tic6x_relocate_section): Handle REL relocations.
845         (elf_info_to_howto_rel): Define to elf32_tic6x_info_to_howto_rel.
846
847 2010-04-20  Jakub Jelinek  <jakub@redhat.com>
848
849         * dwarf2.c (find_abstract_instance_name, scan_unit_for_symbols): Treat
850         DW_AT_linkage_name the same as DW_AT_MIPS_linkage_name.
851
852 2010-04-19  Nick Clifton  <nickc@redhat.com>
853
854         * archive64.c (bfd_elf64_archive_slurp_armap): Remove unused
855         arhdrpos variable.
856         * elf64-x86-64.c (elf64_x86_64_relocate_section): Add unused
857         attribute to warned variable.  Remove unused val, type and type2
858         variables.
859
860 2010-04-16  Andreas Schwab  <schwab@redhat.com>
861
862         * vms-alpha.c (alpha_vms_link_add_object_symbols): Avoid breaking
863         strict-aliasing rules.
864
865 2010-04-16  Tristan Gingold  <gingold@adacore.com>
866
867         * vms-alpha.c (_bfd_vms_slurp_eihd): Fix typo.
868         (_bfd_vms_get_object_record): Always assume there is a pad byte
869         for alignment.
870
871         * vms-lib.c: Add a few comments.
872
873 2010-04-15  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
874
875         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Support additions to
876         attributes in v2.08 of the ABI.
877
878 2010-04-15  Alan Modra  <amodra@gmail.com>
879
880         * config.bfd (vax*-*-*vms*): Delete.
881
882 2010-04-14  Tristan Gingold  <gingold@adacore.com>
883
884         * Makefile.am (BFD32_BACKENDS): Remove vms-gsd.lo, vms-hdr.lo,
885         vms-tir.lo, vms.lo and add vms-alpha.lo
886         (BFD32_BACKENDS_CFILES): Remove vms-gsd.c, vms-hdr.c,
887         vms-tir.c, vms.c and add vms-alpha.c
888         * Makefile.in: Regenerate.
889         * configure.in (TDEFINES): Adjust file list for vms_alpha_vec.
890         Remove vms_vax_vec.
891         * configure: Regenerate.
892         * targets.c (vms_vax_vec): Remove the declaration.
893         (_bfd_target_vector): Remove vms_vax_vec.
894         * vms-alpha.c: New file.
895         * vms-gsd.c: Removed, rewritten in vms-alpha.c
896         * vms-hdr.c: Ditto.
897         * vms-tir.c: Ditto.
898         * vms.c: Ditto.
899         * vms-misc.c: Fix indentation and comments.  Replace most of
900         #if VMS_DEBUG/vms_debug with vms_debug2.
901         (_bfd_vms_hash_newfunc): Moved to vms-alpha.c
902         (hash_string): Ditto.
903         (_bfd_vms_length_hash_symbol): Ditto.
904         (maybe_adjust_record_pointer_for_object): Ditto.
905         (_bfd_vms_get_object_record): Ditto.
906         (vms_get_remaining_object_record): Ditto.
907         (_bfd_vms_push): Ditto.
908         (_bfd_vms_pop): Ditto.
909         (_bfd_vms_get_header_values): Removed.
910         (_bfd_vms_get_first_record): Removed.
911         (vms_get_remaining_image_record): Removed.
912         (new_symbol): Removed.
913         (_bfd_vms_enter_symbol): Removed.
914         (_bfd_vms_save_sized_string): Use memcpy instead of strncpy.
915         (_bfd_vms_output_begin): Remove rechead parameter.  Replace bfd
916         parameter with struct vms_rec_wr.
917         (_bfd_vms_output_push): Removed and replaced by ...
918         (_bfd_vms_output_begin_subrec): ... new function.
919         (_bfd_vms_output_alignment): Replace bfd parameter with
920         struct vms_rec_wr, and adjust.
921         (_bfd_vms_output_check): Ditto
922         (_bfd_vms_output_byte): Ditto.
923         (_bfd_vms_output_short): Ditto.
924         (_bfd_vms_output_long): Ditto.
925         (_bfd_vms_output_quad): Ditto.
926         (_bfd_vms_output_counted): Ditto.
927         (_bfd_vms_output_dump): Ditto.
928         (_bfd_vms_output_fill): Ditto.
929         (_bfd_vms_output_pop): Removed and replaced by ...
930         (_bfd_vms_output_end_subrec): ... new function.
931         (_bfd_vms_output_flush): Removed.
932         (_bfd_vms_output_align): New function.
933         (_bfd_vms_output_end): Add recwr parameter.  Adjust for this new
934         parameter.
935         (vms_convert_to_var): New function imported from vms.c
936         (vms_convert_to_var_1): Ditto.
937         (vms_convert_to_var_unix_filename): Ditto.
938         (vms_get_module_name): Ditto.
939         (get_vms_time_string): Ditto.
940         (vms_time_to_time_t): Ditto.
941         (vms_rawtime_to_time_t): Ditto.
942         * vms.h: All macros for the VMS file format are now in include/vms.
943         Prototypes for vms.c, vms-gsd.c, vms-misc.c, vms-hdr.c, vms-tir.c
944         have been removed.
945         (struct vms_symbol_struct, struct stack_struct): Moved to vms-alpha.c
946         (struct fileinfo, struct srecinfo, struct lineinfo): Ditto.
947         (struct funcinfo, struct vms_private_data_struct): Ditto.
948         (struct vms_section_data_struct): Ditto.
949         (struct vms_rec_rd, stryct vms_rec_wr): New declarations.
950         (vms_get_module_name, get_vms_time_string): New declarations.
951         (vms_time_to_time_t, vms_rawtime_to_time_t): Ditto.
952         (_bfd_vms_output_begin_subrec, _bfd_vms_output_end_subrec): Ditto.
953         (_bfd_vms_save_sized_string, _bfd_vms_save_counted_string): Adjusted.
954         (_bfd_vms_output_begin, _bfd_vms_output_alignment): Ditto.
955         (_bfd_vms_output_end,_bfd_vms_output_check): Ditto.
956         (_bfd_vms_output_byte, _bfd_vms_output_short): Ditto.
957         (_bfd_vms_output_long, _bfd_vms_output_quad): Ditto.
958         (_bfd_vms_output_counted, _bfd_vms_output_dump): Ditto.
959         (_bfd_vms_output_fill): Ditto.
960         (bfd_vms_set_section_flags): Ditto.
961
962 2010-04-14  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
963
964         * elflink.c (_bfd_elf_merge_symbol): Tighten up the test for early
965         exit due to merging the same weak symbol to test that the symbols are
966         actually weak.
967
968 2010-04-13  Alan Modra  <amodra@gmail.com>
969
970         * elf64-ppc.c (ppc64_elf_relocate_section): Correct NOP location
971         when optimizing high got_tlsgd/ld insns.
972
973 2010-04-10  H.J. Lu  <hongjiu.lu@intel.com>
974
975         * hosts/x86-64linux.h (HAVE_PRPSINFO32_T): Undefine before
976         define.
977         (HAVE_PRSTATUS32_T): Likewise.
978
979 2010-04-10  H.J. Lu  <hongjiu.lu@intel.com>
980
981         PR corefiles/11467
982         * configure.in (CORE_HEADER): New. Set to hosts/x86-64linux.h
983         for x86_64-*-linux*.
984         * config.in: Regenerated.
985         * configure: Likewise.
986
987         * elf.c: Include CORE_HEADER if it is defined.
988
989 2010-04-10  H.J. Lu  <hongjiu.lu@intel.com>
990             Jan Kratochvil  <jan.kratochvil@redhat.com>
991
992         * hosts/x86-64linux.h: New.
993
994 2010-04-09  Nick Clifton  <nickc@redhat.com>
995
996         * aoutx.h (aout_link_input_bfd): Remove unused variable sym_count.
997         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Remove unused
998         variables htab and hdr_info and mark info parameter as unused.
999         * elf.c (prep_headers): Remove unused variable i_phdrp.
1000         (_bfd_elf_write_object_contents): Remove unused variable i_ehdrp.
1001         * elf32-i386.c (elf_i386_relocate_section): Mark variabled warned
1002         as unused.
1003         * peXXigen.c (pe_print_reloc): Remove unused variable datasize.
1004         * verilog.c (verilog_write_section): Remove unused variable
1005         address.
1006
1007 2010-04-07  Alan Modra  <amodra@gmail.com>
1008
1009         * warning.m4 (GCC_WARN_CFLAGS): Only add -Wshadow for gcc-4 and above.
1010         * configure: Regenerate.
1011
1012 2010-04-06  H.J. Lu  <hongjiu.lu@intel.com>
1013
1014         PR ld/11434
1015         * elf-bfd.h (SYMBOLIC_BIND): Don't bind unique symbol locally.
1016
1017 2010-04-06  Tristan Gingold  <gingold@adacore.com>
1018
1019         * vms-lib.c (_bfd_vms_lib_write_archive_contents): Fix idd flags.
1020
1021 2010-04-05  Jakub Jelinek  <jakub@redhat.com>
1022
1023         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Handle CIE version 4
1024         provided that it has the expected address size and zero segment
1025         length.
1026
1027         * dwarf2.c (struct line_head): Add maximum_ops_per_insn field.
1028         (struct line_info): Add op_index field, change end_sequence type to
1029         unsigned char.
1030         (new_line_sorts_after): For the same address compare op_index.
1031         (add_line_info): Add op_index argument, store it into the structure.
1032         (decode_line_info): Complain about unknown versions of .debug_line.
1033         Initialize maximum_ops_per_insn.  Add op_index state register and
1034         track it.
1035
1036 2010-04-01  Nathan Sidwell  <nathan@codesourcery.com>
1037
1038         * elf32-ppc.c (apuinfo_set): New static var.
1039         (ppc_elf_begin_write_processing): Set it here, always create an
1040         APUinfo section if there were any in the inputs.
1041         (ppc_elf_write_section): Check apuinfo_set.
1042         (ppc_elf_final_write_processing): Likewise.
1043
1044 2010-04-01  Tristan Gingold  <gingold@adacore.com>
1045
1046         * vms.h: Include time.h. Add prototypes for vms_get_module_name,
1047         vms_time_to_time_t and vms_rawtime_to_time_t.
1048         * vms.c (vms_alpha_vec): Add archives support.
1049         * vms-misc.c: Include safe-ctype.h
1050         (vms_get_module_name): New function.
1051         (vms_time_to_time_t, vms_rawtime_to_time_t): Ditto.
1052         * vms-hdr.c (_bfd_vms_write_hdr): Put module name creation to the
1053         vms_get_module_name function.  Use this function.
1054         * targets.c: Declare vms_lib_txt_vec.  Add it to _bfd_target_vector.
1055         * libbfd-in.h: Add prototype for _bfd_append_relative_path.
1056         Add prototypes for vms-lib.c
1057         * libbfd.h: Regenerate.
1058         * configure.in (TDEFINES): Add an entry for vms_lib_txt_vec.  Add
1059         vms-lib.lo to vms_alpha_vec.
1060         * config.bfd (targ_cpu): Add targ_selvecs for alpha*-*-*vms*.
1061         * configure: Regenerate.
1062         * bfd.c: Add selective_search field.
1063         * bfd-in2.h: Regenerate.
1064         * archive.c (append_relative_path): Rename to
1065         _bfd_append_relative_path and make it public.
1066         (_bfd_get_elt_at_filepos): Adjust for above renaming.
1067         * Makefile.am (BFD32_BACKENDS): Add vms-lib.lo
1068         (BFD32_BACKENDS_CFILES): Add vms-lib.c
1069         * Makefile.in: Regenerate.
1070
1071 2010-04-01  Jakub Jelinek  <jakub@redhat.com>
1072
1073         * dwarf2.c (read_attribute_value): Handle CU version 4
1074         for DW_FORM_ref_addr, handle DW_FORM_sec_offset, DW_FORM_exprloc
1075         and DW_FORM_flag_present.  For unknown form value return NULL.
1076         (scan_unit_for_symbols): For DW_AT_location handle DW_FORM_exprloc
1077         like DW_FORM_block.
1078         (parse_comp_unit): Allow CU version 4.
1079
1080 2010-04-01  Hans-Peter Nilsson  <hp@axis.com>
1081
1082         * elf32-cris.c (cris_elf_relocate_section): Correct first argument
1083         to _bfd_elf_get_dynamic_reloc_section.
1084         (elf_cris_discard_excess_dso_dynamics): Ditto.
1085
1086 2010-03-31  Kai Tietz  <kai.tietz@onevision.com>
1087
1088         * coff-i386.c (in_reloc_p): Check also for R_SECREL32.
1089         * coff-x86_64.c (in_reloc_p): Check also for R_AMD64_SECREL.
1090
1091 2010-03-31  Alan Modra  <amodra@gmail.com>
1092
1093         * elf64-ppc.c (ppc64_elf_relocate_section): Nop out optimized
1094         TPREL16_HI and TPREL16_HA insns.
1095
1096 2010-03-31  Hans-Peter Nilsson  <hp@axis.com>
1097
1098         PR ld/11458
1099         * elf32-cris.c (elf_cris_copy_indirect_symbol): Remove invalid
1100         assert of empty pcrel_relocs_copied on the direct symbol.  Instead
1101         of moving the list from the indirect symbol to the direct symbol,
1102         merge into any existing list.
1103         (cris_elf_check_relocs): Store the original section in the
1104         pcrel_relocs_copied list, not the relocation section.
1105         (elf_cris_discard_excess_dso_dynamics): Adjust accordingly to find
1106         the relocation section, for reducing its size.  Change the
1107         BFD_ASSERT into a check for the section being read-only, and only
1108         emit warnings and TEXTREL marker when there's an entry for a
1109         read-only section.
1110
1111 2010-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
1112
1113         * elf32-arm.c (using_thumb_only): Handle v6-M.
1114
1115 2010-03-26  Alan Modra  <amodra@gmail.com>
1116
1117         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_EMB_RELSDA>): Not pc-relative.
1118         * bfd-in.h (elf_discarded_section): Clarify comment.
1119         * reloc.c (struct reloc_howto_struct <pc_relative>): Likewise.
1120         * bfd-in2.h: Regenerate.
1121
1122 2010-03-26  Matt Rice  <ratmice@gmail.com>
1123
1124         * archive.c (_bfd_compute_and_write_armap): Allow symbols flagged
1125         as unique in the armap.
1126
1127 2010-03-26  Alan Modra  <amodra@gmail.com>
1128
1129         PR ld/11375
1130         * elf64-ppc.c (ppc64_elf_relocate_section): Always look up a
1131         possible stub on branches.
1132
1133 2010-03-25  Joseph Myers  <joseph@codesourcery.com>
1134
1135         * Makefile.am (ALL_MACHINES): Add cpu-tic6x.lo.
1136         (ALL_MACHINES_CFILES): Add cpu-tic6x.c.
1137         (BFD32_BACKENDS): Add elf32-tic6x.lo.
1138         (BFD32_BACKENDS_CFILES): Add elf32-tic6x.c.
1139         * Makefile.in: Regenerate.
1140         * archures.c (bfd_arch_tic6x, bfd_tic6x_arch): New.
1141         (bfd_archures_list): Update.
1142         * config.bfd (tic6x-*-elf): New.
1143         * configure.in (bfd_elf32_tic6x_be_vec, bfd_elf32_tic6x_le_vec):
1144         New.
1145         * configure: Regenerate.
1146         * cpu-tic6x.c, elf32-tic6x.c: New.
1147         * reloc.c (BFD_RELOC_C6000_PCR_S21, BFD_RELOC_C6000_PCR_S12,
1148         BFD_RELOC_C6000_PCR_S10, BFD_RELOC_C6000_PCR_S7,
1149         BFD_RELOC_C6000_ABS_S16, BFD_RELOC_C6000_ABS_L16,
1150         BFD_RELOC_C6000_ABS_H16, BFD_RELOC_C6000_SBR_U15_B,
1151         BFD_RELOC_C6000_SBR_U15_H, BFD_RELOC_C6000_SBR_U15_W,
1152         BFD_RELOC_C6000_SBR_S16, BFD_RELOC_C6000_SBR_L16_B,
1153         BFD_RELOC_C6000_SBR_L16_H, BFD_RELOC_C6000_SBR_L16_W,
1154         BFD_RELOC_C6000_SBR_H16_B, BFD_RELOC_C6000_SBR_H16_H,
1155         BFD_RELOC_C6000_SBR_H16_W, BFD_RELOC_C6000_SBR_GOT_U15_W,
1156         BFD_RELOC_C6000_SBR_GOT_L16_W, BFD_RELOC_C6000_SBR_GOT_H16_W,
1157         BFD_RELOC_C6000_DSBT_INDEX, BFD_RELOC_C6000_PREL31,
1158         BFD_RELOC_C6000_COPY, BFD_RELOC_C6000_ALIGN,
1159         BFD_RELOC_C6000_FPHEAD, BFD_RELOC_C6000_NOCMP): New.
1160         * targets.c (bfd_elf32_tic6x_be_vec, bfd_elf32_tic6x_le_vec): New.
1161         (_bfd_target_vector): Update.
1162         * bfd-in2.h, libbfd.h: Regenerate.
1163
1164 2010-03-24  H.J. Lu  <hongjiu.lu@intel.com>
1165
1166         * aout-target.h: Update copyright year.
1167         * aout-tic30.c: Likewise.
1168         * coff-alpha.c: Likewise.
1169         * coff-rs6000.c: Likewise.
1170         * coff64-rs6000.c: Likewise.
1171         * elf64-mips.c: Likewise.
1172         * ieee.c: Likewise.
1173         * libecoff.h: Likewise.
1174         * mach-o-target.c: Likewise.
1175         * mach-o.c: Likewise.
1176         * oasys.c: Likewise.
1177         * targets.c: Likewise.
1178
1179 2010-03-24  H.J. Lu  <hongjiu.lu@intel.com>
1180
1181         * libbfd-in.h: Update copyright year.
1182
1183 2010-03-21  H.J. Lu  <hongjiu.lu@intel.com>
1184
1185         PR ld/11413
1186         * elflink.c (_bfd_elf_add_default_symbol): Check !executable
1187         instead of shared.
1188
1189 2010-03-19  Jie Zhang  <jie@codesourcery.com>
1190
1191         * elf32-arm.c (struct section_list): Remove.
1192         (section_list): Remove typedef.
1193         (record_section_with_arm_elf_section_data): Remove.
1194         (find_arm_elf_section_entry): Remove.
1195         (get_arm_elf_section_data): Use is_arm_elf.
1196         (unrecord_section_with_arm_elf_section_data): Remove.
1197         (elf32_arm_new_section_hook): Don't call
1198         record_section_with_arm_elf_section_data.
1199         (elf32_arm_write_section): Set mapcount to -1 when
1200         the map has been used. Don't call
1201         unrecord_section_with_arm_elf_section_data.
1202         (unrecord_section_via_map_over_sections): Remove.
1203         (elf32_arm_close_and_cleanup): Remove.
1204         (elf32_arm_bfd_free_cached_info): Remove.
1205         (bfd_elf32_close_and_cleanup): Don't define.
1206         (bfd_elf32_bfd_free_cached_info): Don't define.
1207
1208 2010-03-18  H.J. Lu  <hongjiu.lu@intel.com>
1209
1210         PR binutils/11396
1211         * libcoff-in.h (pe_tdata): Add dont_strip_reloc.
1212         * libcoff.h: Regenerated.
1213
1214         * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Clear F_RELFLG
1215         if dont_strip_reloc is set.
1216         (_bfd_XX_bfd_copy_private_bfd_data_common): Set
1217         dont_strip_reloc on output if there is no .reloc and
1218         IMAGE_FILE_RELOCS_STRIPPED isn't set in input.
1219
1220 2010-03-18  Wei Guozhi  <carrot@google.com>
1221
1222         PR gas/11323
1223         * elf32-arm.c (elf32_arm_reloc_map): Map BFD_RELOC_ARM_GOT_PREL to
1224         R_ARM_GOT_PREL.
1225         * reloc.c (BFD_RELOC_ARM_GOT_PREL): New ARM relocation.
1226         * bfd-in2.h: Regenerate.
1227         * libbfd.h: Regenerate.
1228
1229 2010-03-17  H.J. Lu  <hongjiu.lu@intel.com>
1230
1231         * reloc.c (BFD_RELOC_SPU_PIC18): Removed.
1232         (BFD_RELOC_SPU_STUB): Likewise.
1233
1234 2010-03-17  Jie Zhang  <jie@codesourcery.com>
1235
1236         * elf.c (assign_file_positions_for_load_sections): Avoid
1237         overflow.
1238
1239 2010-03-17  Alan Modra  <amodra@gmail.com>
1240
1241         PR binutils/11382
1242         * plugin.c (bfd_plugin_object_p): Pass iostream to fileno using
1243         proper type.
1244
1245 2010-03-17  Alan Modra  <amodra@gmail.com>
1246
1247         * elf32-arm.c (cortex_a8_erratum_scan): Warning fix.
1248
1249 2010-03-16  Alan Modra  <amodra@gmail.com>
1250
1251         * elf64-ppc.c (struct ppc_link_hash_table): Add do_toc_opt.
1252         (ppc64_elf_edit_toc): Set it here.
1253         (ha_reloc_match): New function.
1254         (ppc64_elf_relocate_section): Optimize bigtoc insn sequences.
1255
1256 2010-03-15  Alan Modra  <amodra@gmail.com>
1257
1258         * elf64-ppc.c (ppc64_elf_has_small_toc_reloc): New function.
1259         * elf64-ppc.h (ppc64_elf_has_small_toc_reloc): Declare.
1260
1261 2010-03-14  Alan Modra  <amodra@gmail.com>
1262
1263         PR ld/11378
1264         * elf64-ppc.h (ppc64_elf_check_init_fini): Declare.
1265         * elf64-ppc.c (call_check_done): Define.
1266         (ppc64_elf_add_symbol_hook): Substitute bfd_get_section_name macro.
1267         (ppc64_elf_check_relocs, ppc64_elf_size_dynamic_sections): Likewise.
1268         (ppc64_elf_finish_multitoc_partition): Remove unnecessary check.
1269         (toc_adjusting_stub_needed): Use call_check_done rather than toc_off.
1270         Simplify return logic.  Iterate over all .init and .fini fragments
1271         by recursion.  Set makes_toc_func_call here..
1272         (ppc64_elf_next_input_section): ..rather than here.
1273         (check_pasted_section, ppc64_elf_check_init_fini): New functions.
1274
1275 2010-03-13  Alan Modra  <amodra@gmail.com>
1276
1277         PR ld/11375
1278         * elf64-ppc.c (ppc_type_of_stub): Always set *hash to the
1279         function descriptor symbol if there is one, not just for plt stubs.
1280         (ppc64_elf_relocate_section): Use fdh on all ppc_get_stub_entry calls.
1281
1282 2010-03-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1283
1284         * elflink.c (bfd_elf_size_dynamic_sections): Don't emit base
1285         version twice.
1286         Skip it when constructing def.vd_next.
1287
1288         * elf32-i386.c (TARGET_LITTLE_SYM): Redefine to
1289         bfd_elf32_i386_sol2_vec.
1290         (TARGET_LITTLE_NAME): Redefine to elf32-i386-sol2.
1291         (elf32_bed): Redefine to elf32_i386_sol2_bed.
1292         (elf_backend_want_plt_sym): Redefine to 1.
1293
1294         * elf64-x86-64.c (TARGET_LITTLE_SYM): Redefine to
1295         bfd_elf64_x86_64_sol2_vec.
1296         (TARGET_LITTLE_NAME): Redefine to elf64-x86-64-sol2.
1297         (elf64_bed): Redefine to elf64_x86_64_sol2_bed.
1298         (elf_backend_want_plt_sym): Redefine to 1.
1299
1300         * config.bfd (i[3-7]86-*-solaris2*): Set targ_defvec to
1301         bfd_elf32_i386_sol2_vec.
1302         Replace bfd_elf64_x86_64_vec by bfd_elf64_x86_64_sol2_vec in
1303         targ64_selvecs.
1304         (x86_64-*-solaris2*): Set targ_defvec to bfd_elf32_i386_sol2_vec.
1305         Replace bfd_elf64_x86_64_vec by bfd_elf64_x86_64_sol2_vec in
1306         targ_selvecs.
1307
1308         * configure.in: Handle bfd_elf32_i386_sol2_vec,
1309         bfd_elf64_x86_64_sol2_vec.
1310         * configure: Regenerate.
1311
1312         * targets.c (bfd_elf32_i386_sol2_vec): Declare.
1313         (bfd_elf64_x86_64_sol2_vec): Declare.
1314         (_bfd_target_vector): Add bfd_elf32_i386_sol2_vec,
1315         bfd_elf64_x86_64_sol2_vec.
1316
1317 2010-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
1318
1319         * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip non-program
1320         sections.
1321
1322 2010-03-04  Alan Modra  <amodra@gmail.com>
1323
1324         PR 11302
1325         * dwarf2.c (read_abbrevs): Return NULL on alloc failures.
1326         (read_attribute_value, decode_line_info): Likewise.
1327         (add_line_info, read_rangelist): Return FALSE on alloc failures.
1328         (arange_add, sort_line_sequences): Likewise.
1329         (find_abstract_instance_name): Handle failures from called funcs.
1330         (scan_unit_for_symbols, parse_comp_unit, decode_line_info): Likewise.
1331         (find_line): Realloc to a temp, and handle alloc fail.
1332
1333 2010-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
1334
1335         * elf32-arm.c (elf32_arm_output_arch_local_syms): Do not add
1336         a mapping symbol to an empty section.
1337
1338 2010-03-02  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1339
1340         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add a check of the
1341         return value from the call to _bfd_elf_merge_object_attributes.
1342
1343 2010-03-02  Christophe Lyon  <christophe.lyon@st.com>
1344         Alan Modra  <amodra@gmail.com>
1345
1346         * elf32-arm.c (a8_erratum_fix): Add st_type field to record the
1347         destination mode of the a8 stub.
1348         (elf32_arm_link_hash_table): Add top_id field.
1349         (elf32_arm_link_hash_table_create): Initialize top_id.
1350         (arm_type_of_stub): Update prototype, st_type can now be updated
1351         by this function. Actual destination address in case of PLT is
1352         computed here, to help factorizing code.
1353         (elf32_arm_stub_name): Update prototype, use stub_type additional
1354         parameter to build stub name.
1355         (elf32_arm_get_stub_entry): Update prototype, use stub_type
1356         additional parameter to build stub entry.
1357         (arm_build_one_stub): Use bfd_put_16/bfd_put_32 instead of
1358         put_thumb_insn/put_arm_insn as BE8 encoding is now handled later.
1359         Call elf32_arm_final_link_relocate to process all in-stub
1360         relocations.
1361         (elf32_arm_setup_section_lists): Update top_id.
1362         (cortex_a8_erratum_scan): Record stub destination mode.
1363         (elf32_arm_size_stubs): Update call to arm_type_of_stub according
1364         to new prototype.
1365         (elf32_arm_final_link_relocate): Enable processing of in-stub
1366         REL32 relocations. Rely on arm_type_of_stub to detect if a stub is
1367         needed, enabling code factorization.
1368         (elf32_arm_final_link): Process stub sections.
1369         (elf32_arm_output_map_sym): Add entry to code/data map.
1370
1371 2010-03-01  David S. Miller  <davem@davemloft.net>
1372
1373         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): When STT_GNU_IFUNC and
1374         h->def_regular, set h->ref_regular.
1375         (allocate_dynrelocs): Only force output of STT_GNU_IFUNC plt entries
1376         and dynamic relocations if h->ref_regular.
1377
1378         * elfxx-sparc.c (struct elf_reloc_map): Delete.
1379         (sparc_reloc_map): Delete.
1380         (_bfd_sparc_elf_reloc_type_lookup): Explicitly handle each
1381         relocation type in switch statements.
1382
1383 2010-02-25  Alan Modra  <amodra@gmail.com>
1384
1385         PR ld/11304
1386         * elf.c (_bfd_elf_init_private_section_data): Rename need_group
1387         to final_link and invert.  For final link allow some flags to
1388         differ.  Don't specially allow flags to be all zero.
1389
1390 2010-02-24  Alan Modra  <amodra@gmail.com>
1391
1392         PR binutils/10858
1393         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Ise
1394         SYMBOL_REFERENCES_LOCAL to exclude entries from the dynamic symbol
1395         table.
1396
1397 2010-02-23  Andrew Zabolotny  <anpaza@mail.ru>
1398
1399         PR binutils/11297
1400         * elf32-avr.c (elf_avr_howto_table): Add R_AVR_8.
1401         (avr_reloc_map): Map BFD_RELOC_8 to R_AVR_8.
1402
1403 2010-02-22  Alan Modra  <amodra@gmail.com>
1404
1405         * reloc.c (bfd_check_overflow): When forming addrmask, shift
1406         fieldmask left by rightshift.
1407         (_bfd_relocate_contents): Likewise.  Use rightshift addrmask in all
1408         overflow checks.
1409
1410 2010-02-20  H.J. Lu  <hongjiu.lu@intel.com>
1411
1412         * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Don't check
1413         STT_GNU_IFUNC on large common symbol.
1414
1415 2010-02-18  H.J. Lu  <hongjiu.lu@intel.com>
1416
1417         * elf32-i386.c (elf_i386_add_symbol_hook): Don't set
1418         has_ifunc_symbols if the symbol comes from a shared library.
1419         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
1420         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
1421         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
1422         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
1423         * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise.
1424
1425 2010-02-19  Alan Modra  <amodra@gmail.com>
1426
1427         * elf.c (_bfd_elf_fixup_group_sections): New function, split out from..
1428         (_bfd_elf_copy_private_header_data): ..here.
1429         * elflink.c (_bfd_elf_size_group_sections): New function.
1430         (bfd_elf_size_dynamic_sections): Call it.
1431         * elf-bfd.h (_bfd_elf_size_group_sections): Declare.
1432         (_bfd_elf_fixup_group_sections): Declare.
1433
1434 2010-02-18  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1435
1436         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add support for
1437         merging Tag_DIV_use, Tag_MPextension_use, and
1438         Tag_MPextension_use_legacy tags.
1439
1440 2010-02-18  Alan Modra  <amodra@gmail.com>
1441
1442         * elf.c (bfd_elf_set_group_contents): Revert accidental 2009-01-15
1443         commit.  Don't write zeros for removed group members.
1444         (_bfd_elf_copy_private_header_data): Adjust size of group section
1445         when group members are removed by objcopy.
1446
1447 2010-02-15  Dave Korn  <dave.korn.cygwin@gmail.com>
1448
1449         PR binutils/11280
1450         * configure.host (*-*-solaris2.11):  Add host define to select
1451         valid default code page for windres/windmc on solaris.
1452
1453 2010-02-15  Nick Clifton  <nickc@redhat.com>
1454
1455         * po/vi.po: Updated Vietnamese translation.
1456
1457 2010-02-12  Daniel Gutson  <dgutson@codesourcery.com>
1458
1459         * elf32-arm.c (elf32_arm_output_arch_local_syms): add
1460         missing mapping symbol to data only sections.
1461
1462 2010-02-11  David S. Miller  <davem@davemloft.net>
1463
1464         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): For R_SPARC_GOTDATA_OP_HIX22
1465         and R_SPARC_GOTDATA_OP_LOX10, only bump the GOT refcount for global
1466         symbols.
1467         (_bfd_sparc_elf_gc_sweep_hook): Likewise only decrement the GOT count for
1468         these relocs on global symbols.
1469         (gdopoff): New.
1470         (_bfd_sparc_elf_relocate_section): Perform GOTDATA optimizations on
1471         local symbol references which are not STT_GNU_IFUNC.  Handle
1472         relocation of them like R_SPARC_HIX22 and R_SPARC_LOX10 respectively,
1473         and deal with negative vs. non-negative values properly.
1474
1475 2010-02-09  Tristan Gingold  <gingold@adacore.com>
1476
1477         * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Adjust addend for
1478         non-external relocation.
1479
1480 2010-02-09  Alan Modra  <amodra@gmail.com>
1481
1482         * elf64-ppc.c (merge_got_entries): Move earlier in file.
1483         (allocate_dynrelocs): Merge got entries here if not doing multi-toc.
1484         (ppc64_elf_size_dynamic_sections): Similarly merge tlsld_got.
1485         (ppc64_elf_layout_multitoc): Don't resize if we have already
1486         merged got entries.
1487
1488 2010-02-09  Michael Holzheu  <holzheu@de.ibm.com>
1489
1490         * elf-bfd.h (elfcore_write_s390_timer, elfcore_write_s390_todcmp,
1491         elfcore_write_s390_todpreg, elfcore_write_s390_ctrs,
1492         elfcore_write_s390_prefix): New.
1493         * elf.c (elfcore_write_s390_timer, elfcore_write_s390_todcmp,
1494         elfcore_write_s390_todpreg, elfcore_write_s390_ctrs,
1495         elfcore_write_s390_prefix): New.
1496         (elfcore_grok_note): Handle NT_S390_TIMER, NT_S390_TODCMP,
1497         NT_S390_TODPREG, NT_S390_CTRS and NT_S390_PREFIX.
1498         (elfcore_write_register_note): Handle .reg-s390-timer,
1499         .reg-s390-todcmp, .reg-s390-todpreg, .reg-s390-ctrs,
1500         .reg-s390-prefix section.
1501
1502 2010-02-09  Alan Modra  <amodra@gmail.com>
1503
1504         * elf64-ppc.c (struct got_entry): Make tls_type and is_indirect
1505         unsigned char.  Update variables and code using them throughout file.
1506         (struct ppc_link_hash_entry): Likewise for tls_mask.
1507
1508         * elf64-ppc.c (ppc64_elf_layout_multitoc): Don't merge local got ents.
1509
1510         * elf64-ppc.c (has_small_toc_reloc): Don't define.
1511         (makes_toc_func_call, call_check_in_progress): Shuffle flags.
1512         (struct ppc64_elf_obj_tdata): Add has_small_toc_reloc.  Update
1513         code setting the flag.
1514         (ppc64_elf_next_toc_section): Group big-toc sections in
1515         0x80008000 chunks.
1516
1517 2010-02-08  David S. Miller  <davem@davemloft.net>
1518
1519         * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove sgot,
1520         srelgot, splt, srelplt, and sgotplt members in favor of generic copies.
1521
1522         * elfxx-sparc.c (create_got_section): Delete.
1523         (_bfd_sparc_elf_create_dynamic_sections): Don't call, the dynamic
1524         section creator does that work for us.  Use ->elf.foo instead of
1525         ->foo where applicable.
1526         (_bfd_sparc_elf_check_relocs): Use ->elf.foo instead of ->foo
1527         where applicable.
1528         (allocate_dynrelocs): Likewise.
1529         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1530         (_bfd_sparc_elf_relocate_section): Likewise.
1531         (sparc_vxworks_build_plt_entry): Likewise.
1532         (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1533         (sparc_finish_dyn): Likewise.
1534         (sparc_vxworks_finish_exec_plt): Likewise.
1535         (sparc_vxworks_finish_shared_plt): Likewise.
1536         (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1537
1538         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Use the SYMBOL_*
1539         macros for visibilty and locality checks.
1540         (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
1541         (allocate_dynrelocs): Likewise.
1542         (_bfd_sparc_elf_relocate_section): Likewise.
1543         (_bfd_sparc_elf_finish_dynamic_symbol):Likewise.
1544
1545         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove set
1546         but never used local var 'dynobj'.
1547
1548         * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Handle
1549         nocopyreloc.
1550
1551         * reloc.c (BFD_RELOC_SPARC_JMP_IREL): New.
1552         (BFD_RELOC_SPARC_IRELATIVE): Likewise.
1553         * bfd-in2.h: Regenerate.
1554         * libbfd.h: Regenerate.
1555
1556         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add loc_hash_table
1557         and loc_hash_memory.
1558         (_bfd_sparc_elf_link_hash_table_free): Declare.
1559         * elf32-sparc.c (elf32_sparc_add_symbol_hook): New.
1560         (elf_backend_add_symbol_hook, elf_backend_post_process_headers,
1561         bfd_elf32_bfd_link_hash_table_free): Define.
1562         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Set
1563         has_ifunc_symbols if STT_GNU_IFUNC.
1564         (bfd_elf64_bfd_link_hash_table_free): Define.
1565         (elf_backend_post_process_headers): Define always.
1566         * elfxx-sparc.c (sparc_jmp_irel_howto, sparc_irelative_howto): New.
1567         (sparc_reloc_map): Add entries for new IFUNC relocs.
1568         (_bfd_sparc_elf_reloc_type_lookup): Handle new IFUNC relocs.
1569         (_bfd_sparc_elf_info_to_howto_ptr): Likewise.
1570         (elf_sparc_local_htab_hash, elf_sparc_local_htab_eq,
1571         elf_sparc_get_local_sym_hash): New.
1572         (_bfd_sparc_elf_create_dynamic_sections): Move PLT ops initialization
1573         from here...
1574         (_bfd_sparc_elf_link_hash_table_create): ... to here.  Allocate
1575         local hash table.
1576         (_bfd_sparc_elf_link_hash_table_free): New.
1577         (create_ifunc_sections): New.
1578         (_bfd_sparc_elf_check_relocs): Unconditionally assign htab->elf.dynobj
1579         and call create_ifunc_sections().  For local STT_GNU_IFUNC symbols
1580         cons up a fake local hash table entry for it.  Unconditionally add
1581         a PLT refcount for STT_GNU_IFUNC symbols when h->def_regular.  Count
1582         dyn relocs for ifunc.
1583         (_bfd_sparc_elf_adjust_dynamic_symbol): Handle ifunc.
1584         (allocate_dynrelocs):  Unconditionally emit a PLT entry when
1585         STT_GNU_IFUNC and h->def_regular.  Count GOT dyn relocs for ifunc.
1586         (allocate_local_dynrelocs): New function.
1587         (_bfd_sparc_elf_size_dynamic_sections): Invoke it over the local hash
1588         table.  Emit dynamic relocs to irelplt when not shared.  Treat iplt
1589         like splt.
1590         (_bfd_sparc_elf_relocate_section): Handle ifunc relocations by hand.
1591         (_bfd_sparc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc
1592         plt in iplt/irelplt.
1593
1594 2010-02-08  Richard Sandiford  <r.sandiford@uk.ibm.com>
1595
1596         * xcofflink.c (_bfd_xcoff_bfd_final_link): When calculating
1597         max_contents_size, only consider sections whose contents must
1598         be swapped in.
1599
1600 2010-02-09  Alan Modra  <amodra@gmail.com>
1601
1602         * elf64-ppc.c (allocate_dynrelocs): Remove unused got structs here..
1603         (ppc64_elf_size_dynamic_sections): ..and here..
1604         (merge_got_entries): ..rather than here.
1605
1606 2010-02-09  Alan Modra  <amodra@gmail.com>
1607
1608         * elf64-ppc.c (struct ppc_link_hash_table): Add do_multi_toc.
1609         (has_small_toc_reloc): Define.
1610         (ppc64_elf_check_relocs): Set the above flags.
1611         (ppc64_elf_edit_opd): Delete obfd param.
1612         (ppc64_elf_tls_optimize): Likewise.
1613         (ppc64_elf_edit_toc): Likewise.
1614         (ppc64_elf_tls_setup): Likewise.  Add no_multi_toc param.
1615         * elf64-ppc.h: Update prototypes.
1616
1617 2010-02-08  Alan Modra  <amodra@gmail.com>
1618
1619         * section.c (struct bfd_section): Delete has_tls_reloc,
1620         has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, reloc_done.
1621         Add sec_flg0 thru sec_flg5.
1622         (BFD_FAKE_SECTION): Update for changed flags.
1623         * ecoff.c (bfd_debug_section): Likewise.
1624         * elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define.
1625         * elf64-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define.
1626         (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Update.
1627         * elf32-xtensa.c (reloc_done): Define.
1628         * elfxx-ia64.c (skip_relax_pass_0, skip_relax_pass_1): Update.
1629         * bfd-in2.h: Regenerate.
1630
1631 2010-02-08  Tristan Gingold  <gingold@adacore.com>
1632
1633         * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Set reloc.r_extern
1634         for non-scattered relocations.
1635
1636 2010-02-08  Nathan Sidwell  <nathan@codesourcery.com>
1637
1638         * elf32-ppc.c (ppc_elf_begin_write_processing): Allow empty
1639         apuinfo sections, only scan input sections once and reuse the
1640         buffer.
1641
1642 2010-02-08  Philipp Tomsich  <philipp.tomsich@theobroma-systems.com>
1643
1644         * archures.c (bfd_mach_ppc_titan): Define.
1645         * bfd-in2.h: Regenerate.
1646         * cpu-powerpc.c (bfd_powerpc_archs): Add titan entry.
1647
1648 2010-02-08  Alan Modra  <amodra@gmail.com>
1649
1650         * elf32-ppc.c (ppc_elf_check_relocs): Remove dead ifunc code.
1651
1652 2010-02-05  Sterling Augustine  <sterling@tensilica.com>
1653
1654         * elf.c (assign_file_positions_for_load_sections) Update lma of
1655         section if necessary.  Fixes Bugzilla 11219.
1656
1657 2010-02-05  H.J. Lu  <hongjiu.lu@intel.com>
1658
1659         * elf32-i386.c: Remove trailing white spaces.
1660         * elf64-x86-64.c: Likewise.
1661
1662 2010-02-03  Nick Clifton  <nickc@redhat.com>
1663
1664         * elf-bfd.h (emum elf_object_id): Rename to elf_target_id.  Add
1665         entries for other architectures.
1666         (struct elf_link_hash_table): Add hash_table_id field.
1667         (elf_hash_table_id): New accessor macro.
1668         * elflink.c (_bfd_elf_link_hash_table_init): Add target_id
1669         parameter.
1670         * elf-m10300.c (elf32_mn10300_hash_table): Check table id before
1671         returning cast pointer.
1672         (elf32_mn10300_link_hash_table_create): Identify new table as
1673         containing MN10300 extensions.
1674         (mn10300_elf_relax_section): Check pointer returned by
1675         elf32_mn10300_hash_table.
1676         * elf32-arm.c: Likewise, except using ARM extensions.
1677         * elf32-avr.c: Likewise, except using AVR extensions.
1678         * elf32-bfin.c: Likewise, except using BFIN extensions.
1679         * elf32-cris.c: Likewise, except using CRIS extensions.
1680         * elf32-frv.c: Likewise, except using FRV extensions.
1681         * elf32-hppa.c: Likewise, except using HPPA32 extensions.
1682         * elf32-i386.c: Likewise, except using I386 extensions.
1683         * elf32-lm32.c: Likewise, except using LM32 extensions.
1684         * elf32-m32r.c: Likewise, except using M32RM extensions.
1685         * elf32-m68hc11.c: Likewise, except using M68HC11 extensions.
1686         * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions.
1687         * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions.
1688         * elf32-m68k.c: Likewise, except using M68K extensions.
1689         * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions.
1690         * elf32-ppc.c: Likewise, except using PPC32 extensions.
1691         * elf32-s390.c: Likewise, except using S390 extensions.
1692         * elf32-sh.c: Likewise, except using SH extensions.
1693         * elf32-spu.c: Likewise, except using SPU extensions.
1694         * elf32-xtensa.c: Likewise, except using XTENSA extensions.
1695         * elf64-alpha.c: Likewise, except using ALPHA extensions.
1696         * elf64-hppa.c: Likewise, except using HPPA64 extensions.
1697         * elf64-ppc.c: Likewise, except using PPC64 extensions.
1698         * elf64-s390.c: Likewise, except using S390 extensions.
1699         * elf64-x86-64.c: Likewise, except using X86_64 extensions.
1700         * elfxx-ia64.c: Likewise, except using IA64 extensions.
1701         * elfxx-mips.c: Likewise, except using MIPS extensions.
1702         * elfxx-sparc.c: Likewise, except using SPARC extensions.
1703         * elfxx-sparc.h: Likewise, except using SPARC extensions.
1704         * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete
1705         redundant structure.
1706         (elf32_cr16_hash_table): Delete unused macro.
1707         (elf32_cr16_link_hash_traverse): Delete unused macro.
1708         * elf32-score.c: Likewise.
1709         * elf32-score7.c: Likewise.
1710         * elf32-vax.c: Likewise.
1711         * elf64-sh64.c: Likewise.
1712
1713 2010-02-03  Alan Modra  <amodra@gmail.com>
1714
1715         * elf64-ppc.c (struct plt_entry): Move earlier in file.
1716         (struct got_entry): Likewise.  Add is_indirect and got.ent fields.
1717         (struct ppc64_elf_obj_tdata): Change tlsld_got to be a struct got_entry.
1718         Update all uses.
1719         (struct ppc_link_hash_table): Add got_reli_size and second_toc_pass.
1720         Remove no_multi_toc.
1721         (update_local_sym_info, ppc64_elf_check_relocs): Clear is_indirect
1722         when allocating a new struct got_entry.
1723         (allocate_got): New function, extracted from..
1724         (allocate_dynrelocs): ..here.  Abort on got entry in non-ppc64 bfd.
1725         (ppc64_elf_size_dynamic_sections): Track got relocs allocated in
1726         .reliplt by got_reli_size.  Set owner on ppc64_tlsld_got entries.
1727         (ppc64_elf_setup_section_lists): Remove output_bfd param and
1728         no_multi_toc, add add_stub_section and layout_sections_again.  Stash
1729         new params in htab.  Extract some code to..
1730         (ppc64_elf_start_multitoc_partition): ..here.  New function.
1731         (ppc64_elf_next_toc_section): Check for linker script errors.  Handle
1732         second pass toc scan.
1733         (merge_got_entries, merge_global_got, reallocate_got): New functions.
1734         (ppc64_elf_reinit_toc): Rename to..
1735         (ppc64_elf_finish_multitoc_partition): ..this.
1736         (ppc64_elf_layout_multitoc): New function.
1737         (ppc64_elf_size_stubs): Delete output_bfd, add_stub_section and
1738         layout_sections_again params.
1739         (ppc64_elf_relocate_section): Handle indirect got entries.
1740         * elf64-ppc.h: Update prototypes.  Declare new functions.
1741
1742 2010-02-02  H.J. Lu  <hongjiu.lu@intel.com>
1743
1744         * elf-bfd.h (elfcore_write_xstatereg): New.
1745
1746         * elf.c (elfcore_grok_xstatereg): New.
1747         (elfcore_write_xstatereg): Likewise.
1748         (elfcore_grok_note): Handle NT_X86_XSTATE.
1749         (elfcore_write_register_note): Handle .reg-xstate section.
1750
1751 2010-02-01  Tristan Gingold  <gingold@adacore.com>
1752
1753         * som.c (som_write_ar_hdr): Define this macro.
1754
1755 2010-01-30  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1756
1757         * elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
1758         R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations that use the
1759         linkage table pointer to use the global table pointer if not doing
1760         a shared link.
1761
1762 2010-01-29  Joel Brobecker  <brobecker@adacore.com>
1763
1764         * elf.c (elfcore_grok_lwpstatus): Do not overwrite the core signal
1765         if it has already been set.
1766
1767 2010-01-27  Tristan Gingold  <gingold@adacore.com>
1768
1769         * vms.h: Remove trailing spaces.
1770         (struct hdr_struct): Remove unused hdr_c_cpr field.
1771         (enum file_format_enum): Add comments.
1772         * vms.c (vms_bfd_print_private_bfd_data): New function that
1773         replaces the macro.
1774         Remove trailing spaces.
1775         * vms-misc.c: Improve comments.
1776         (_bfd_vms_get_object_record): Also handle files without pads.
1777         * vms-hdr.c (_bfd_vms_write_dbg): Fix format string.
1778         * vms-gsd.c (struct flagdescstruct): Make name field const.
1779         (gsyflagdesc): Fix typo.
1780
1781 2010-01-27  Alan Modra  <amodra@gmail.com>
1782
1783         PR ld/11217
1784         * elf64-ppc.c (struct ppc_link_hash_table): Add toc_bfd, toc_first_sec.
1785         (ppc64_elf_setup_section_lists): Init them.
1786         (ppc64_elf_next_toc_section): Don't partition multi-toc between .got
1787         and .toc on the same input file.
1788         (ppc64_elf_relocate_section): Correct GOT entry offset.
1789
1790 2010-01-26  Tristan Gingold  <gingold@adacore.com>
1791
1792         * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add initializer for write_ar_hdr.
1793         (bfd_target): Add _bfd_write_ar_hdr_fn field.
1794         * archive.c (is_bsd44_extended_name): New macro.
1795         (_bfd_generic_read_ar_hdr_mag): Use it.  Add extra_size.
1796         (bfd_slurp_armap): Also check for "__.SYMDEF" as a BSD4.4 extended
1797         name.
1798         (_bfd_archive_bsd44_construct_extended_name_table): New function.
1799         (_bfd_generic_write_ar_hdr): Ditto.
1800         (_bfd_bsd44_write_ar_hdr): Ditto.
1801         (_bfd_write_archive_contents): Call _bfd_write_ar_hdr.
1802         (bsd_write_armap): Adjust firstreal computation.
1803         * libbfd-in.h (struct areltdata): Add extra_size field.
1804         (_bfd_generic_write_ar_hdr): Add prototype.
1805         (_bfd_bsd44_write_ar_hdr): Ditto.
1806         (_bfd_write_ar_hdr): Define.
1807         (_bfd_noarchive_write_ar_hdr): Ditto.
1808         (_bfd_archive_bsd_write_ar_hdr): Ditto.
1809         (_bfd_archive_coff_write_ar_hdr): Ditto.
1810         (_bfd_archive_bsd44_slurp_armap): Ditto.
1811         (_bfd_archive_bsd44_slurp_extended_name_table): Ditto.
1812         (_bfd_archive_bsd44_construct_extended_name_table): New prototype.
1813         (_bfd_archive_bsd44_truncate_arname): Ditto.
1814         (_bfd_archive_bsd44_write_armap): Ditto.
1815         (_bfd_archive_bsd44_read_ar_hdr): Ditto.
1816         (_bfd_archive_bsd44_write_ar_hdr): Ditto.
1817         (_bfd_archive_bsd44_openr_next_archived_file): Ditto.
1818         (_bfd_archive_bsd44_get_elt_at_index): Ditto.
1819         (_bfd_archive_bsd44_generic_stat_arch_elt): Ditto.
1820         (_bfd_archive_bsd44_update_armap_timestamp): Ditto.
1821         * libbfd.h: Regenerate.
1822         * oasys.c (oasys_write_ar_hdr): Define.
1823         * libecoff.h (_bfd_ecoff_write_ar_hdr): Define.
1824         * ieee.c (ieee_write_ar_hdr): Define.
1825         * elf64-mips.c (bfd_elf64_archive_write_ar_hdr): Define.
1826         * coff-rs6000.c (rs6000coff_vec): Adjust for write_ar_hdr field.
1827         (bfd_pmac_xcoff_backend_data): Ditto.
1828         * coff64-rs6000.c (rs6000coff64_vec): Ditto.
1829         (bfd_xcoff_aix5_backend_data): Ditto.
1830         * coff-alpha.c (alpha_ecoff_write_ar_hdr): Define.
1831         * aout-target.h (MY_write_ar_hdr): Define it if not defined.
1832         * aout-tic30.c (MY_write_ar_hdr): Ditto.
1833         * mach-o-target.c (TARGET_NAME): Use _bfd_archive_bsd44 archive.
1834         (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr)
1835         (bfd_mach_o_slurp_armap, bfd_mach_o_slurp_extended_name_table)
1836         (bfd_mach_o_construct_extended_name_table)
1837         (bfd_mach_o_truncate_arname, bfd_mach_o_write_armap)
1838         (bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt)
1839         (bfd_mach_o_update_armap_timestamp): Moved to mach-o.c
1840         * mach-o.c (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr)
1841         (bfd_mach_o_slurp_armap, bfd_mach_o_slurp_extended_name_table)
1842         (bfd_mach_o_construct_extended_name_table)
1843         (bfd_mach_o_truncate_arname, bfd_mach_o_write_armap)
1844         (bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt)
1845         (bfd_mach_o_update_armap_timestamp): Moved from mach-o-target.c
1846         * bfd-in2.h: Regenerate.
1847
1848 2010-01-26  Alan Modra  <amodra@gmail.com>
1849             H.J. Lu  <hongjiu.lu@intel.com>
1850
1851         PR ld/11218
1852         * elflink.c (elf_link_output_extsym): Do not ignore undefined
1853         symbols with ref_regular set when gc_sections is active.
1854
1855 2010-01-25  Alan Modra  <amodra@gmail.com>
1856
1857         PR ld/11217
1858         * elf64-ppc.c (ppc64_elf_tls_optimize): Optimize tls sequences
1859         with relocations against undefined weak symbols.
1860         (ppc64_elf_relocate_section): Don't optimize calls to undefined
1861         weak functions if the symbol is dynamic.
1862         (ppc64_elf_relocate_section): Edit tprel tls sequences.
1863         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1864         (_bfd_elf_ppc_at_tprel_transform): New function.
1865         * bfd-in.h (_bfd_elf_ppc_at_tprel_transform): Declare.
1866         * bfd-in2.h: Regenerate.
1867
1868 2010-01-23  Richard Sandiford  <r.sandiford@uk.ibm.com>
1869
1870         * coff-rs6000.c (xcoff_howto_table): Change size to 0 and bitsize to 1.
1871         (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_NONE.
1872         * coff64-rs6000.c (xcoff64_howto_table): Change size to 0 and
1873         bitsize to 1.
1874         (xcoff64_reloc_type_lookup): Handle BFD_RELOC_NONE.
1875
1876 2010-01-21  Nick Clifton  <nickc@redhat.com>
1877
1878         * elflink.c (elf_link_add_object_symbols): Look up name of
1879         undefined symbol both before and after versioning has been
1880         applied.  Do not bother with symbols that are weakly undefined.
1881
1882 2010-01-21  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1883
1884         * elf32-s390.c (elf32_s390_merge_private_bfd_data): New function.
1885         (bfd_elf32_bfd_merge_private_bfd_data): New macro definition.
1886
1887 2010-01-19  Cary Coutant  <ccoutant@google.com>
1888
1889         * dwarf2.c (read_attribute_value): Add DW_FORM_ref_sig8.
1890
1891 2010-01-19  Daisuke Hatayama  <d.hatayama@jp.fujitsu.com>
1892             Alan Modra <amodra@gmail.com>
1893
1894         * elfcode.h (elf_swap_ehdr_out): Handle e_phnum > 0xffff.
1895         (elf_object_p): Read e_phnum extension.
1896         (elf_write_shdrs_and_ehdr): Write e_phnum extension.
1897         * elfcore.h (elf_core_file_p): Read e_phnum extension.  Sanity check
1898         that we can read last program header.
1899
1900 2010-01-19  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1901
1902         * elf32-arm.c (elf32_arm_howto_table_1): Correct bitsize of
1903         R_ARM_THM_CALL entry.
1904         (elf32_arm_final_link_relocate): Correct calculation of
1905         reloc_signed_max when doing a R_ARM_THM_CALL, R_ARM_THM_XPC22,
1906         or R_ARM_THM_JUMP24 relocation.
1907
1908 2010-01-18  Alan Modra  <amodra@gmail.com>
1909
1910         PR 11168
1911         * coffcode.h (coff_compute_section_file_positions): Move Rs6000COFF_C
1912         block past vars in COFF_IMAGE_WITH_PE block.  Report error on more
1913         than 32k sections.
1914
1915 2010-01-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1916
1917         Fix compilation warning on gcc-3.4.
1918         * vms-tir.c (start_etir_record, sto_imm): Rename the prototype
1919         parameter index to sec_index according to the function definition.
1920
1921 2010-01-13  Chao-ying Fu  <fu@mips.com>
1922
1923         * elfxx-mips.c (JR_TO_B_P): New define to transform JR to B.
1924         It is true for all CPUs.
1925         (jal_reloc_p): New function.
1926         (mips_elf_calculate_relocation): Rename require_jalxp to
1927         cross_mode_jump_p.
1928         Update comment for CROSS_MODE_JUMP_P.
1929         Set up cross_mode_jump_p based on the mode change.
1930         (mips_elf_perform_relocation): Rename require_jalx to cross_mode_jump_p.
1931         Update comment for CROSS_MODE_JUMP_P.
1932         Test cross_mode_jump_p and jal_reloc_p to turn jal to jalx.
1933         Use !cross_mode_jump_p to guard conversion.
1934         Convert "jr t9" to "b", if possible.
1935         (_bfd_mips_elf_relocate_section): Rename require_jalx to
1936         cross_mode_jump_p.
1937         Pass &cross_mode_jump_p to call mips_elf_calculate_relocation.
1938         Pass cross_mode_jump_p to call mips_elf_perform_relocation.
1939
1940 2010-01-13  Nick Clifton  <nickc@redhat.com>
1941
1942         * cpu-m32c.c (m32c_scan): New function.  Ensures that a scan for
1943         "m32c" returns the m32c arch_info_struct and not the m16c
1944         arch_info_struct.
1945         (arch_info_struct): Use the new scan function.
1946         (bfd_m32c_arch): Likewise.
1947
1948 2010-01-13  Tristan Gingold  <gingold@adacore.com>
1949
1950         * config.bfd: Remove duplicated target vector for i386-*-darwin.
1951         Appends new arch instead of overriding.
1952         Use mach_o_x86_64_vec for x86_64-*-darwin.
1953         * configure.in: Add mach_o_x86_64_vec.
1954         * configure: Regenerate.
1955         * targets.c: Declare mach_o_x86_64_vec, add it to _bfd_target_vector.
1956         * Makefile.am (BFD64_BACKENDS): Add mach-o-x86-64.lo
1957         (BFD64_BACKENDS_CFILES): Add mach-o-x86-64.c
1958         * Makefile.in: Regenerate.
1959         * mach-o-x86-64.c: New file.
1960
1961 2010-01-13  Tristan Gingold  <gingold@adacore.com>
1962
1963         * reloc.c: Add MACH_O_X86_64 relocations.
1964         * bfd-in2.h: Regenerate.
1965         * libbfd.h: Regenerate.
1966
1967 2010-01-13  Tristan Gingold  <gingold@adacore.com>
1968
1969         * archive.c (normalize): Use lbasename.
1970         (bfd_bsd_truncate_arname): Ditto.
1971         (bfd_gnu_truncate_arname): Ditto.
1972
1973 2010-01-12  Tristan Gingold  <gingold@adacore.com>
1974
1975         * makefile.vms (CFLAGS): Turns warnings into informational messages.
1976
1977 2010-01-11  Tristan Gingold  <gingold@adacore.com>
1978
1979         * mach-o.h: Add x86-64 relocation types.
1980
1981 2010-01-11  Tristan Gingold  <gingold@adacore.com>
1982
1983         * mach-o.h (bfd_mach_o_backend_data): Add arch field.
1984         (bfd_mach_o_set_arch_mach): New prototype.
1985         * mach-o.c (bfd_mach_o_mkobject): Define with bfd_mach_o_gen_mkobject.
1986         (bfd_mach_o_set_arch_mach): New function.
1987         (bfd_mach_o_gen_mkobject): New function.
1988         Set TARGET_ARCHITECTURE for the generic back-ends.
1989         * mach-o-target.c (bfd_mach_o_set_arch_mach): Remove define.
1990         Check that TARGET_ARCHITECTURE is defined.
1991         Add TARGET_ARCHITECTURE in TARGET_NAME_BACKEND structure.
1992         * mach-o-i386.c (TARGET_ARCHITECTURE): Define.
1993
1994 2010-01-11  Tristan Gingold  <gingold@adacore.com>
1995
1996         * archive.c (bfd_slurp_armap): Also check for Mach-O sorted armap.
1997
1998 2010-01-11  Nick Clifton  <nickc@redhat.com>
1999
2000         * elf32-v850.c (v850_elf_perform_relocation): Fix overflow
2001         handling of R_V850_HI16_S relocation.
2002
2003 2010-01-11  Alan Modra  <amodra@gmail.com>
2004
2005         PR 11103
2006         * dwarf1.c (parse_die): Correct FORM_STRING data pointer increment.
2007
2008 2010-01-11  Alan Modra  <amodra@gmail.com>
2009
2010         PR 6832
2011         * dwarf2.c (struct comp_unit): Add sec_info_ptr.
2012         (find_abstract_instance_name): Use it.
2013         (parse_comp_unit): Set it.
2014
2015 2010-01-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2016
2017         * Makefile.in: Regenerate.
2018         * configure: Regenerate.
2019
2020 2010-01-08  Tristan Gingold  <gingold@adacore.com>
2021
2022         * archive.c: Remove bfd_special_undocumented_glue.
2023
2024 2010-01-08  Alan Modra  <amodra@gmail.com>
2025
2026         PR ld/11133
2027         * elf32-cr16.c (elf32_cr16_gc_mark_hook): Call _bfd_elf_gc_mark_hook.
2028         * elf32-microblaze.c (microblaze_elf_gc_mark_hook): Likewise.
2029         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
2030
2031 2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>
2032
2033         PR ld/11138
2034         * elflink.c (elf_link_check_versioned_symbol): Don't abort if
2035         a symbol referenced by DSO is is defined in a non-shared object
2036         and forced local.
2037
2038 2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>
2039
2040         PR ld/11133
2041         * elflink.c (_bfd_elf_gc_mark_hook): Check section XXX for
2042         undefined __start_XXX/__stop_XXX in all input files and set
2043         SEC_KEEP.
2044
2045 2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>
2046
2047         PR ld/11143
2048         * elflink.c (elf_gc_sweep): Keep SHT_NOTE section.
2049
2050 2010-01-04  Daniel Gutson  <dgutson@codesourcery.com>
2051
2052         * bfd.m4 (BFD_HAVE_SYS_PROCFS_TYPE): Define _STRUCTURE_PROC
2053         before including procfs.h.
2054         (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
2055         * configure.in: Added autoconf probe for the pr_fpreg member.
2056         * configure: Regenerated.
2057         * config.in: Regenerated.
2058         * elf.c: Define _STRUCTURE_PROC before including procfs.h.
2059
2060 2010-01-04  Joel Brobecker  <brobecker@adacore.com>
2061
2062         Fix -Wshadow warnings in dwarf2.c (seen on alpha-tru64).
2063         * dwarf2.c (concat_filename): Rename dirname with dir_name
2064         to void shadowing the dirname function.
2065         Rename subdirname with subdir_name to stay consistent with
2066         the new dir_name variable name.
2067
2068 2010-01-04  Edmar Wienskoski  <edmar@freescale.com>
2069
2070         * archures.c: Add bfd_mach_ppc_e500mc64.
2071         * bfd-in2.h: Regenerate.
2072         * cpu-powerpc.c (bfd_powerpc_archs): Add entry for
2073         bfd_mach_ppc_e500mc64.
2074
2075 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
2076
2077         Fix -Wshadow warnings (seen on ppc-aix)
2078         * xcofflink.c: Replace finfo by flinfo throughout.
2079
2080 For older changes see ChangeLog-2009
2081 \f
2082 Local Variables:
2083 mode: change-log
2084 left-margin: 8
2085 fill-column: 74
2086 version-control: never
2087 End: