PR ld/12161
[binutils.git] / bfd / ChangeLog
blobe5444993ed6b78511f2284b16fe79f63188ce049
1 2012-01-05  Nick Clifton  <nickc@redhat.com>
3         PR ld/12161
4         * elf32-avr.c (elf32_avr_relax_delete_bytes): Read in relocs if
5         necessary.
7 2012-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
9         Fix zero registers core files when built by gcc-4.7.
10         * elf64-x86-64.c (elf_x86_64_write_core_note): Remove variables p and
11         size.  Call elfcore_write_note for the local variables.  Remove the
12         final elfcore_write_note call.  Add NOTREACHED comments.
14 2012-01-04  Tristan Gingold  <gingold@adacore.com>
16         * mach-o.c (bfd_mach_o_fat_stat_arch_elt): New function.
17         (bfd_mach_o_generic_stat_arch_elt): Adjust.
19 2012-01-04  Tristan Gingold  <gingold@adacore.com>
21         * mach-o.c (bfd_mach_o_fat_member_init): New function.
22         (bfd_mach_o_openr_next_archived_file): Reindent.
23         Adjust to call bfd_mach_o_fat_member_init.
24         (bfd_mach_o_fat_extract): Adjust to call bfd_mach_o_fat_member_init.
26 2012-01-04  Tristan Gingold  <gingold@adacore.com>
28         * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Handle
29         BFD_RELOC_32, BFD_RELOC_MACH_O_X86_64_PCREL32_1,
30         BFD_RELOC_MACH_O_X86_64_PCREL32_2,
31         BFD_RELOC_MACH_O_X86_64_PCREL32_4,
32         BFD_RELOC_MACH_O_X86_64_BRANCH32,
33         BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
34         BFD_RELOC_MACH_O_X86_64_GOT.
36 2012-01-04  Tristan Gingold  <gingold@adacore.com>
38         * mach-o.h (bfd_mach_o_fvmlib_command): New structure.
39         (bfd_mach_o_load_command): Add fvmlib field.
41         * mach-o.c (bfd_mach_o_read_fvmlib): New function.
42         (bfd_mach_o_read_command): Handle fvmlib.
44 2012-01-04  Tristan Gingold  <gingold@adacore.com>
46         * mach-o.c (bfd_mach_o_convert_architecture): Reindent.
47         Decode msubtype for ARM.
49 2012-01-04  Tristan Gingold  <gingold@adacore.com>
51         * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add comments.
53 2012-01-04  Tristan Gingold  <gingold@adacore.com>
55         * mach-o.h: Reindent header.
56         (bfd_mach_o_encryption_info_command): New structure.
57         (bfd_mach_o_load_command): Add encryption_info field.
59         * mach-o.c (bfd_mach_o_read_encryption_info): New function.
60         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO.
61         (bfd_mach_o_read_command): Adjust error message.
63 2012-01-04  Shinichiro Hamaji  <shinichiro.hamaji@gmail.com>
65         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Factor out the part
66         which reads DWARF2 and stores in stash from find_line.
67         (find_line) Call _bfd_dwarf2_slurp_debug_info.
68         * libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Add declaration.
69         * libbfd.h (_bfd_dwarf2_slurp_debug_info): Regenerate.
70         * mach-o.c (dsym_subdir): The name of subdir where debug
71         information may be stored.
72         (bfd_mach_o_lookup_uuid_command): New. Lookup a load command whose
73         type is UUID.
74         (bfd_mach_o_dsym_for_uuid_p): New. Check if the specified BFD is
75         corresponding to the executable.
76         (bfd_mach_o_find_dsym): New. Find a debug information BFD in the
77         specified binary file.
78         (bfd_mach_o_follow_dsym): New. Find a debug information BFD for
79         the original BFD.
80         (bfd_mach_o_find_nearest_line): Check dSYM files for Mach-O
81         executables, dylibs, and bundles.
82         (bfd_mach_o_close_and_cleanup): Clean up BFDs for the dSYM file.
83         * mach-o.h (dsym_bfd): The BFD of the dSYM file.
85 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
87         * mach-o.c (bfd_mach_o_mangle_symbols): Put in the section index
88         for stabd symbols.
89         (bfd_mach_o_primary_symbol_sort_key): Adjust for stabs.
90         (bfd_mach_o_cf_symbols): Likewise.
92 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
94         * mach-o.c (bfd_mach_o_mangle_symbols): Correct typo.
96 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
98         * mach-o.c (bfd_mach_o_write_symtab): Fill in the string table index
99         as the value of an indirect symbol.  Keep the string table index in
100         non-indirect syms for reference.
101         (bfd_mach_o_write_dysymtab): New.
102         (bfd_mach_o_primary_symbol_sort_key): New.
103         (bfd_mach_o_cf_symbols): New.
104         (bfd_mach_o_sort_symbol_table): New.
105         (bfd_mach_o_mangle_symbols): Return early if no symbols.  Sort symbols.
106         If we are emitting a dysymtab, process indirect symbols and count the
107         number of each other kind.
108         (bfd_mach_o_mangle_sections): New.
109         (bfd_mach_o_write_contents): Split out some pre-requisite code into
110         the command builder. Write dysymtab if the command is present.
111         (bfd_mach_o_count_sections_for_seg): New.
112         (bfd_mach_o_build_seg_command): New.
113         (bfd_mach_o_build_dysymtab_command): New.
114         (bfd_mach_o_build_commands): Reorganize to support the fact that some
115         commands are optional and should not be emitted if there are no
116         sections or symbols.
117         (bfd_mach_o_set_section_contents): Amend comment.
118         * mach-o.h: Amend and add to comments. 
119         (mach_o_data_struct): Add fields for dysymtab symbols counts and a
120         pointer to the indirects, when present.
121         (bfd_mach_o_should_emit_dysymtab): New macro.
122         (IS_MACHO_INDIRECT): Likewise.
124 2011-12-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
126         * elf32-rl78.c (rl78_elf_relocate_section, rl78_dump_symtab)
127         (rl78_elf_relax_section): Remove debug prints.
129 2011-12-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
131         * elf32-rl78.c (rl78_elf_relocate_section, rl78_elf_relax_section): Use
132         BFD_VMA_FMT.
134 2011-12-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
136         * elf32-rl78.c (prev_alignment, sec_start): Remove unused variables.
138 2011-12-23  Tristan Gingold  <gingold@adacore.com>
140         * vms-lib.c (vms_traverse_index): Move pointer update code.
142 2011-12-22  DJ Delorie  <dj@redhat.com>
144         * elf32-rl78.c (rl78_elf_howto_table): Add R_RL78_RH_RELAX.
145         (rl78_reloc_map): Add BFD_RELOC_RL78_RELAX.
146         (rl78_elf_relocate_section): Add R_RL78_RH_RELAX, R_RL78_RH_SFR,
147         and R_RL78_RH_SADDR.
148         (rl78_elf_finish_dynamic_sections): Only validate PLT section if
149         we didn't relax anything, as relaxing might remove a PLT reference
150         after we've set up the table.
151         (elf32_rl78_relax_delete_bytes): New.
152         (reloc_bubblesort): New.
153         (rl78_offset_for_reloc): New.
154         (relax_addr16): New.
155         (rl78_elf_relax_section): Add support for relaxing long
156         instructions into short ones.
158 2011-12-22  Martin Schwidefsky  <schwidefsky@de.ibm.com>
160         * elf32-s390.c (elf_s390_relocate_section): Add check for debugging
161         section in LD to LE linker relaxation for R_390_TLS_LDO32.
162         * elf64-s390.c (elf_s390_relocate_section): Likewise for
163         R_390_TLS_LDO64.
165 2011-12-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
167         * elf32-arm.c (elf32_arm_nabi_grok_psinfo): Fill in core_pid.
169 2011-12-19  Iain Sandoe  <idsandoe@googlemail.com>
171         * mach-o-i386.c (bfd_mach_o_section_type_valid_for_tgt): Define NULL.
172         * mach-o-target.c (bfd_mach_o_backend_data): Initialize
173         bfd_mach_o_section_type_valid_for_tgt
174         * mach-o-x86-64.c (bfd_mach_o_section_type_valid_for_x86_64): New.
175         (bfd_mach_o_section_type_valid_for_tgt): Set to
176         bfd_mach_o_section_type_valid_for_x86_64.
177         * mach-o.c (bfd_mach_o_section_type_name): Reorder and eliminate dup.
178         (bfd_mach_o_section_attribute_name): Reorder.
179         (bfd_mach_o_get_section_type_from_name): If the target has defined a
180         validator for section types, then use it.
181         * mach-o.h (bfd_mach_o_get_section_type_from_name): Alter declaration
182         to include the bfd.
184 2011-12-19  Chung-Lin Tang  <cltang@codesourcery.com>
186         * reloc.c (BFD_RELOC_MIPS16_TLS_GD,BFD_RELOC_MIPS16_TLS_LDM,
187         BFD_RELOC_MIPS16_TLS_DTPREL_HI16,BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
188         BFD_RELOC_MIPS16_TLS_GOTTPREL,BFD_RELOC_MIPS16_TLS_TPREL_HI16,
189         BFD_RELOC_MIPS16_TLS_TPREL_LO16): New relocations for MIPS16 TLS.
190         * bfd-in2.h (bfd_reloc_code_real): Regenerate.
191         * libbfd.h (bfd_reloc_code_real_names): Regenerate.
192         * elf32-mips.c (elf_mips16_howto_table_rel): Add R_MIPS16_TLS_*
193         entries.
194         (mips16_reloc_map): Add BFD_RELOC_MIPS16_TLS_* to R_MIPS16_TLS_*
195         mappings.
196         * elfn32-mips.c (elf_mips16_howto_table_rel,
197         elf_mips16_howto_table_rela): Add R_MIPS16_TLS_* entries.
198         (mips16_reloc_map): Add BFD_RELOC_MIPS16_TLS_* to R_MIPS16_TLS_*
199         mappings.
200         * elf64-mips.c (mips16_elf64_howto_table_rel,
201         mips16_elf64_howto_table_rela): Add R_MIPS16_TLS_* entries.
202         (mips16_reloc_map): Add BFD_RELOC_MIPS16_TLS_* to R_MIPS16_TLS_*
203         mappings.
204         * elfxx-mips.c (TLS_RELOC_P,mips16_reloc_p,
205         _bfd_mips_elf_check_relocs): Add cases for R_MIPS16_TLS_* relocations.
206         (tls_gd_reloc_p): Add R_MIPS16_TLS_GD case.
207         (tls_ldm_reloc_p): Add R_MIPS16_TLS_LDM case.
208         (tls_gottprel_reloc_p): Add R_MIPS16_TLS_GOTTPREL case.
209         (mips_elf_calculate_relocation): Add cases for R_MIPS16_TLS_*,
210         R_MIPS_TLS_DTPREL32/64, and R_MIPS_TLS_TPREL32/64 relocations.
212 2011-12-19  Chung-Lin Tang  <cltang@codesourcery.com>
213             Catherine Moore  <clm@codesourcery.com>
214             Sandra Loosemore  <sandra@codesourcery.com>
215             Richard Sandiford  <rdsandiford@googlemail.com>
217         * elfxx-mips.c (mips_elf_local_pic_function_p): Return true when
218         H is a MIPS16 function with a kept 32-bit stub. Update comments.
219         (mips_elf_get_la25_target): New function.
220         (mips_elf_add_la25_intro): Change to use mips_elf_get_la25_target().
221         (mips_elf_add_la25_stub): Move compute of use_trampoline_p down,
222         change to use mips_elf_get_la25_target().
223         (mips_elf_relocation_needs_la25_stub): Add target_is_16_bit_code_p
224         parameter, add switch case for R_MIPS16_26.
225         (mips_elf_calculate_relocation): Redirect relocation to point to the
226         LA25 stub if it exists, instead of the MIPS16 stub. Update arguments
227         of call to mips_elf_relocation_needs_la25_stub(), don't use la25 stub
228         for mips16->mips16 calls.
229         (_bfd_mips_elf_check_relocs): Update arguments of call to
230         mips_elf_relocation_needs_la25_stub().
231         (mips_elf_create_la25_stub): Change to use mips_elf_get_la25_target().
233 2011-12-16  Shinichiro Hamaji  <shinichiro.hamaji@gmail.com>
235         * mach-o-i386.c (TARGET_PRIORITY): Define as 0 (top priority)
236         * mach-o-target.c (TARGET_NAME): Use TARGET_PRIORITY
237         * mach-o-x86-64.c (TARGET_PRIORITY): Define as 0 (top priority)
238         * mach-o.c (bfd_mach_o_header_p): Remove special handling for
239         mach-o-i386.
240         (TARGET_PRIORITY) Set 1 for mach-o-be and mach-o-le, and set 0 for
241         mach-o-fat.
243 2011-12-15  Kevin Buettner  <kevinb@redhat.com>
245         * elf32-am33lin.c (elf32_am33lin_grok_prstatus): Add case
246         to correspond to a smaller ELF_NGREG defined by the kernel.
248 2011-12-15  H.J. Lu  <hongjiu.lu@intel.com>
250         * elf64-x86-64.c (ELF32_DYNAMIC_INTERPRETER): Set to
251          "/lib/ldx32.so.1".
253 2011-12-15  Iain Sandoe  <iains@gcc.gnu.org>
255         * mach-o.c (bfd_mach_o_mkobject_init): Initialize dyn_reloc_cache.
256         (bfd_mach_o_close_and_cleanup): Only cleanup Mach-O private data
257         for object files.
259 2011-12-15  Shinichiro Hamaji  <shinichiro.hamaji@gmail.com>
261         * mach-o.c (bfd_mach_o_canonicalize_reloc): Update relocation
262         table only when there isn't the cahce.
263         (bfd_mach_o_get_dynamic_reloc_upper_bound): Need one more space
264         for a pointer for the watchdog.
265         (bfd_mach_o_canonicalize_dynamic_reloc): Utilize cache like
266         bfd_mach_o_canonicalize_reloc.
267         (bfd_mach_o_close_and_cleanup): Call bfd_mach_o_free_cached_info.
268         (bfd_mach_o_free_cached_info): Free up cache data.
269         * mach-o.h (reloc_cache): A place to store cache of dynamic relocs.
270         (bfd_mach_o_free_cached_info): Add declaration.
272 2011-12-15  Iain Sandoe  <iains@gcc.gnu.org>
274         * mach-o-target.c (bfd_mach_o_bfd_set_private_flags): Use
275         bfd_mach_o_bfd_set_private_flags.
276         * mach-o.c (bfd_mach_o_bfd_set_private_flags): New.
277         * mach-o.h (bfd_mach_o_bfd_set_private_flags): Declare.
279 2011-12-14  Nick Clifton  <nickc@redhat.com>
281         PR ld/12451
282         * elfcode.h (elf_checksum_contents): Read in the section's
283         contents if they are not already available, and the section
284         actually has some contents.
286         * compress.c (bfd_get_full_section_contents): Use zmalloc to
287         allocate the buffers so that excess bytes are guaranteed to be
288         zero.
290 2011-12-14  Iain Sandoe  <iains@gcc.gnu.org>
292         * mach-o-i386.c (text_section_names_xlat): New table.
293         (data_section_names_xlat): Likewise.
294         (import_section_names_xlat): Likewise.
295         (mach_o_i386_segsec_names_xlat): Likewise.
296         (bfd_mach_o_tgt_seg_table): Use new tables.
297         * mach-o-x86-64.c (bfd_mach_o_tgt_seg_table): Set NULL.
298         * mach-o.c (mach_o_section_name_xlat, mach_o_segment_name_xlat):
299         Move to mach-o.h as   typedefs.
300         (text_section_names_xlat): Update for current GCC usage.
301         (data_section_names_xlat): Likewise.
302         (dwarf_section_names_xlat): Likewise.
303         (objc_section_names_xlat): New table.
304         (segsec_names_xlat): Add objc table.
305         (bfd_mach_o_normalize_section_name):  Replace with...
306         (bfd_mach_o_section_data_for_mach_sect): New.
307         (bfd_mach_o_section_data_for_bfd_name): New.
308         (bfd_mach_o_section_data_for_bfd_name): Update to use additional data.
309         (bfd_mach_o_convert_section_name_to_mach_o): Likewise.
310         (bfd_mach_o_bfd_copy_private_section_data): Implement.
311         (bfd_mach_o_write_symtab): Write a zero-length string as the first entry
312         for compatibility with system tools.
313         (bfd_mach_o_build_commands): Update section alignment info.
314         (bfd_mach_o_new_section_hook): Use translation table data to define
315         default section flags, type, attributes and alignment, when available.
316         (bfd_mach_o_init_section_from_mach_o): Add TODO comment.
317         (bfd_mach_o_section_type_name): Add 'symbol_stubs'.
318         (bfd_mach_o_section_attribute_name): Add 'self_modifying_code'.
319         (bfd_mach_o_get_section_type_from_name): Change "not-found" return
320         value.
321         (bfd_mach_o_tgt_seg_table): Set default NULL.
322         * mach-o.h (bfd_mach_o_segment_command):  Use define for name length.
323         (bfd_mach_o_backend_data): Move until after contents are defined.
324         (bfd_mach_o_normalize_section_name): Remove.
325         (bfd_mach_o_convert_section_name_to_bfd): Declare.
326         (mach_o_section_name_xlat): Declare.
327         (mach_o_segment_name_xlat): Declare.
328         (bfd_mach_o_section_data_for_mach_sect): Declare.
329         (bfd_mach_o_section_data_for_bfd_name): Declare.
331 2011-12-13  Shinichiro Hamaji  <shinichiro.hamaji@gmail.com>
333         * dwarf2.c (bfd_dwarf2_cleanup_debug_info): Accept stash as an
334         argument like other functions to support formats other than ELF.
335         * elf-bfd.h (bfd_dwarf2_cleanup_debug_info): Move to bfd-in.h.
336         * elf.c (_bfd_elf_close_and_cleanup): Pass dwarf2_find_line_info
337         in tdata as a parameter.
338         * libbfd-in.h (bfd_dwarf2_cleanup_debug_info): Move from
339         elf-bfd.h.
340         * libbfd.h (bfd_dwarf2_cleanup_debug_info): Regenerate.
341         * mach-o-target.c (bfd_mach_o_close_and_cleanup): Remove the
342         fallback macro.
343         (bfd_mach_o_find_nearest_line): Likewise.
344         * mach-o.c (bfd_mach_o_find_nearest_line): Add the definition
345         which calls _bfd_dwarf2_find_nearest_line.
346         (bfd_mach_o_close_and_cleanup): Likewise.
347         * mach-o.h (mach_o_data_struct): Add dwarf2_find_line_info.
348         (bfd_mach_o_find_nearest_line): Add declaration.
349         (bfd_mach_o_close_and_cleanup): Add declaration.
351 2011-12-13  Tristan Gingold  <gingold@adacore.com>
353         * mach-o.c (bfd_mach_o_read_symtab_symbols): Make global.  Remove
354         prototype.
355         (bfd_mach_o_section_get_entry_size): Make global.
356         (bfd_mach_o_section_get_nbr_indirect): Likewise.
357         (bfd_mach_o_read_symtab_strtab): Likewise.
358         (struct bfd_mach_o_xlat_name): Move to mach-o.h
359         (bfd_mach_o_print_flags): Move to binutils/od-macho.c
360         (bfd_mach_o_get_name_of_null, bfd_mach_o_get_name): Likewise.
361         (bfd_mach_o_cpu_name, bfd_mach_o_filetype_name): Likewise.
362         (bfd_mach_o_header_flags_name): Likewise.
363         (bfd_mach_o_load_command_name): Likewise.
364         (bfd_mach_o_print_private_header): Likewise.
365         (bfd_mach_o_print_section_map, bfd_mach_o_print_section): Likwise.
366         (bfd_mach_o_print_segment, bfd_mach_o_print_dysymtab): Likewise.
367         (bfd_mach_o_print_dyld_info): Likewise.
368         (bfd_mach_o_print_private_bfd_data): Remove.
369         (bfd_mach_o_type_name): Make global.
370         (bfd_mach_o_section_attribute_name): Likewise.
371         * mach-o.h (bfd_mach_o_xlat_name): Added.
372         (bfd_mach_o_section_get_nbr_indirect)
373         (bfd_mach_o_section_get_entry_size)
374         (bfd_mach_o_read_symtab_symbols)
375         (bfd_mach_o_read_symtab_strtab)
376         (bfd_mach_o_section_attribute_name)
377         (bfd_mach_o_section_type_name): Likewise.
378         * mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data): Define.
380 2011-12-13  Chung-Lin Tang  <cltang@codesourcery.com>
382         * elfxx-mips.c (mips_elf_calculate_relocation): Correct
383         R_MIPS16_HI16/R_MIPS16_LO16 handling of two cleared lower bits,
384         update comments.
386 2011-12-12  Iain Sandoe  <iains@gcc.gnu.org>
388         * mach-o.c (bfd_mach_o_read_section_32): Null-terminate sectname.
389         (bfd_mach_o_read_section_64): Likewise.
391 2011-12-11  John Davis Anglin  <dave.anglin@nrc-cnrc.gc.ca>
393         PR binutils/13476
394         * elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
395         R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations to
396         R_PARISC_DPREL21L when not doing a shared link.  Likewise convert
397         R_PARISC_TLS_GD14R, R_PARISC_TLS_LDM14R and R_PARISC_TLS_IE14R to
398         R_PARISC_DPREL14R.  Handle R_PARISC_TLS_GD21L, R_PARISC_TLS_LDM21L
399         and R_PARISC_TLS_IE21L with R_PARISC_DLTIND21L.
401 2011-12-10  David Daney  <david.daney@cavium.com>
403         * elfxx-mips.c (mips_elf_link_hash_table.rld_value): Remove.
404         (mips_elf_link_hash_table.rld_symbol): New field;
405         (MIPS_ELF_RLD_MAP_SIZE): New macro.
406         (_bfd_mips_elf_add_symbol_hook): Remember __rld_obj_head symbol
407         in rld_symbol.
408         (_bfd_mips_elf_create_dynamic_sections): Remember __rld_map symbol
409         in rld_symbol.
410         (_bfd_mips_elf_size_dynamic_sections): Set correct size for .rld_map.
411         (_bfd_mips_elf_finish_dynamic_symbol): Remove .rld_map handling.
412         (_bfd_mips_elf_finish_dynamic_sections): Use rld_symbol to
413         calculate DT_MIPS_RLD_MAP value.
414         (_bfd_mips_elf_link_hash_table_create): Initialize rld_symbol,
415         quit initializing rld_value.
417 2011-12-08  Andrew Pinski  <apinski@cavium.com>
418             Adam Nemet  <anemet@caviumnetworks.com>
420         * archures.c (bfd_mach_mips_octeon2): New macro
421         * bfd-in2.h: Regenerate.
422         * cpu-mips.c (I_mipsocteon2): New enum value.
423         (arch_info_struct): Add bfd_mach_mips_octeon2.
424         * elfxx-mips.c (_bfd_elf_mips_mach): Support E_MIPS_MACH_OCTEON2.
425         (mips_set_isa_flags): Add bfd_mach_mips_octeon2.
426         (mips_mach_extensions): Add bfd_mach_mips_octeon2.
428 2011-12-07  Alan Modra  <amodra@gmail.com>
430         PR ld/12772
431         * elflink.c (elf_gc_sweep_symbol): Discard unmarked symbols
432         defined in shared libraries.
434 2011-12-07  Tristan Gingold  <gingold@adacore.com>
436         * mach-o.c (bfd_mach_o_canonicalize_symtab): Fix indentation.
437         Adjust the condition.
438         (bfd_mach_o_read_symtab_symbol): Now returns a bfd_boolean.
439         Adjust return statements.
440         (bfd_mach_o_read_symtab_strtab): Likewise.
441         (bfd_mach_o_read_symtab_symbols): Likewise.
442         (bfd_mach_o_scan_start_address): Likewise.  Make it static.
443         (bfd_mach_o_scan): Likewise.
444         (bfd_mach_o_read_dysymtab_symbol): Remove unused function.
445         (bfd_mach_o_header_p): Adjust call.
446         (bfd_mach_o_cpu_name): Make it const.
447         (bfd_mach_o_filetype_name): Likewise.
448         (bfd_mach_o_header_flags_name): Likewise.
449         (bfd_mach_o_section_type_name): Likewise.
450         (bfd_mach_o_section_attribute_name): Likewise.
451         (bfd_mach_o_load_command_name): Likewise.
452         (bfd_mach_o_get_section_type_from_name): Add a const qualifier
453         after above change.
454         (bfd_mach_o_get_section_attribute_from_name): Likewise.
455         * mach-o.h (bfd_mach_o_read_dysymtab_symbol)
456         (bfd_mach_o_scan_start_address, bfd_mach_o_scan): Remove.
458 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
460         * elf-bfd.h (elfcore_write_s390_last_break): Add prototype.
461         (elfcore_write_s390_system_call): Likewise.
462         * elf.c (elfcore_write_s390_last_break): New function.
463         (elfcore_write_s390_system_call): Likewise.
464         (elfcore_write_register_note): Call them.
465         (elfcore_grok_s390_last_break): New function.
466         (elfcore_grok_s390_system_call): Likewise.
467         (elfcore_grok_note): Call them.
469 2011-12-05  Tristan Gingold  <gingold@adacore.com>
471         * mach-o.c (bfd_mach_o_read_symtab_symbol): Accept indirect symbols.
473 2011-12-05  Tristan Gingold  <gingold@adacore.com>
475         * mach-o.c (bfd_mach_o_write_contents): Handle LC_LOAD_UPWARD_DYLIB.
476         (bfd_mach_o_read_dylib): Likewise.
477         (bfd_mach_o_read_command): Likewise.
478         (bfd_mach_o_bfd_print_private_bfd_data): Likewise.
480 2011-12-05  Tristan Gingold  <gingold@adacore.com>
482         * mach-o.c (bfd_mach_o_read_command): Add the bfd in the error
483         message.
484         (bfd_mach_o_openr_next_archived_file): Use arch name as member name.
485         (bfd_mach_o_fat_extract): Ditto.
487 2011-12-03  Alan Modra  <amodra@gmail.com>
489         PR ld/13468
490         * elflink.c (bfd_elf_final_link): Don't segfault when checking
491         for DT_TEXTREL and .dynamic does not exist.
493 2011-12-03  Alan Modra  <amodra@gmail.com>
495         PR ld/13470
496         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
497         change in 2011-07-01 commit.  Comment.
498         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
500 2011-12-01  Mikael Pettersson  <mikpe@it.uu.se>
502         * elf32-m68k.c (elf_m68k_check_relocs) <R_68K_8, R68K_16, R_68K_32>: For
503         non-SEC_ALLOC sections break before GOT and PLT accounting.
505 2011-12-01  Hans-Peter Nilsson  <hp@axis.com>
507         * elf32-cris.c (cris_elf_check_relocs) <plt accounting for
508         R_CRIS_8, R_CRIS_16, and R_CRIS_32>: Move early break for
509         non-SEC_ALLOC sections before GOT and PLT accounting.
511 2011-11-29  Andrew Pinski  <apinski@cavium.com>
513         * archures.c (bfd_mach_mips_octeonp): New macro.
514         * bfd-in2.h: Regenerate.
515         * bfd/cpu-mips.c (I_mipsocteonp): New enum value.
516         (arch_info_struct): Add bfd_mach_mips_octeonp.
517         * elfxx-mips.c (mips_set_isa_flags): Add bfd_mach_mips_octeonp.
518         (mips_mach_extensions): Add bfd_mach_mips_octeonp.
520 2011-11-23  Tristan Gingold  <gingold@adacore.com>
522         * vms-lib.c (get_idxlen): Add comments.  Fix type in sizeof.
523         (vms_write_index): Add comments.
525 2011-11-22  DJ Delorie  <dj@redhat.com>
527         * elf32-rx.c (rx_elf_object_p): Add more checks for "scanning" to
528         avoid using the special non-swapping target when not explicitly
529         requested.
531 2011-11-22  Daniel Calcoen  <Daniel.Calcoen@cern.ch>
533         * elf32-rx.c (rx_elf_object_p): Correct typo: lma->vma.
535 2011-11-22  Tristan Gingold  <gingold@adacore.com>
537         * mach-o.c (bfd_mach_o_print_symbol): Display COM for common
538         symbols.  Print section name in brackets.
540 2011-11-21  Andreas Tobler  <andreast@fgznet.ch>
542         * config.bfd: Add vectors for powerpc and powerpc64-freebsd.
543         * configure.in (TDEFINES): Add rules for powerpc*-freebsd.
544         * configure: Regenerate.
545         * elf32-ppc.c: Add powerpc-freebsd definitions.
546         * elf64-ppc.c: Add powerpc64-freebsd definitions.
547         * targets.c: Add bits for powerpc and powerpc64-freebsd.
549 2011-11-17  Philipp Thomas  <philipp@thogro.org>
551         * elf32-arm.c (elf32_thumb_to_arm_stub): Sync message so that it
552         needs to be translated only once.
554 2011-11-16  Maciej W. Rozycki  <macro@codesourcery.com>
556         * elf64-mips.c (mips_elf64_howto_table_rela): Set src_mask to
557         zero throughout.
558         (mips16_elf64_howto_table_rela): Likewise.
559         (micromips_elf64_howto_table_rela): Likewise.
560         * elfn32-mips.c (elf_mips_howto_table_rela): Likewise.
561         (elf_mips16_howto_table_rela): Likewise.
562         (elf_micromips_howto_table_rela): Likewise.
564 2011-11-15  Alan Modra  <amodra@gmail.com>
565             Andreas Tobler  <andreast@fgznet.ch>
567         * elflink.c (_bfd_elf_create_got_section): Replace
568         bfd_make_section_with_flags with bfd_make_section_anyway_with_flags.
569         (_bfd_elf_link_create_dynamic_sections): Likewise.
570         * elf32-ppc.c (ppc_elf_create_glink): Likewise.
571         (ppc_elf_create_dynamic_sections): Likewise.
573 2011-11-14  Maxim Kuvyrkov  <maxim@codesourcery.com>
575         * elfxx-mips.c (mips_n64_exec_plt0_entry): Use 64-bit move.
577 2011-11-08  Nick Clifton  <nickc@redhat.com>
579         * elf-m10300.c (mn10300_elf_relax_section): Fix check for an
580         immediate move into an address register.
582 2011-11-09  Alan Modra  <amodra@gmail.com>
584         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark syms in
585         executables when export_dynamic.
587 2011-11-08  Alan Modra  <amodra@gmail.com>
589         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename
590         ha_relocs_not_using_r2 to unexpected_toc_insn.
591         (ok_lo_toc_insn): New function.
592         (ppc64_elf_edit_toc): Check insn on lo toc reloc.  Emit warning.
593         (ppc64_elf_relocate_section): Don't check insn on lo toc reloc here.
594         Handle addic on lo toc reloc.
596 2011-11-06  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
598         PR ld/13387
599         * elf32-hppa.c (elf32_hppa_hide_symbol): Make STT_GNU_IFUNC symbol
600         go through PLT.  Reset plt field with init_plt_offset.
601         (elf32_hppa_adjust_dynamic_symbol): Ensure that a PLT slot is
602         allocated for symbols referenced by a plabel.
604 2011-11-02  DJ Delorie  <dj@redhat.com>
606         * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Delete unused
607         variable.
609 2011-11-02  Jan Beulich  <jbeulich@suse.com>
611         * coffgen.c (coff_write_alien_symbol): Make public. Add 'struct
612         internal_syment *' parameter. Extend 'dummy' to an array with two
613         elements. Set n_numaux early. Handle BSF_FILE.
614         (coff_write_symbols): Pass NULL as new third argument to
615         coff_write_alien_symbol().
616         * cofflink.c (_bfd_coff_final_link): Don't use COFF-specific
617         obj_raw_syment_count() on non-COFF input BFD. Insert local symbols
618         from non-COFF input BFDs.
619         * libcoff-in.h (coff_write_alien_symbol): Declare.
620         * libcoff.h (coff_write_alien_symbol): Re-generate.
622 2011-11-01  DJ Delorie  <dj@redhat.com>
624         * Makefile.am (ALL_MACHINES): Add cpu-rl78.lo.
625         (ALL_MACHINES_CFILES): Add cpu-rl78.c.
626         (BFD32_BACKENDS): Add elf32-rl78.lo.
627         (BFD32_BACKENDS_CFILES): Add elf32-rl78.c.
628         (Makefile.in): Regenerate.
629         * archures.c (bfd_architecture): Define bfd_arch_rl78.
630         (bfd_archures_list): Add bfd_rl78_arch.
631         * config.bfd: Add rl78-*-elf.
632         * configure.in: Add bfd_elf32_rl78_vec.
633         * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_RL78_* relocations.
634         * targets.c (bfd_target_vector): Add bfd_elf32_rl78_vec.
635         * Makefile.in: Regenerate.
636         * bfd-in2.h: Regenerate.
637         * configure: Regenerate.
638         * libbfd.h: Regenerate.
639         * cpu-rl78.c: New file.
640         * elf32-rl78.c: New file.
642 2011-10-26  Nick Clifton  <nickc@redhat.com>
644         PR ld/13049
645         * elf64-ppc.c (STUB_SUFFIX): Revert previous delta.
646         * elf32-hppa.c (STUB_SUFFIX): Likewise.
648 2011-10-25  Joern Rennecke  <joern.rennecke@embecosm.com>
650         * Makefile.am (ALL_MACHINES): Add cpu-epiphany.lo.
651         (ALL_MACHINES_CFILES): Add cpu-epiphany.c.
652         (BFD32_BACKENDS): Add elf32-epiphany.lo.
653         (BFD32_BACKENDS_CFILES): Add elf32-epiphany.c.
654         * archures.c (bfd_arch_epiphany): Add.
655         (bfd_mach_epiphany16, bfd_mach_epiphany32): Define.
656         (bfd_epiphany_arch): Declare.
657         (bfd_archures_list): Add &bfd_epiphany_arch.
658         * config.bfd (epiphany-*-elf): New target case.
659         * configure.in (bfd_elf32_epiphany_vec): New target vector case.
660         * reloc.c (BFD_RELOC_EPIPHANY_SIMM8): New relocation.
661         (BFD_RELOC_EPIPHANY_SIMM24, BFD_RELOC_EPIPHANY_HIGH): Likewise.
662         (BFD_RELOC_EPIPHANY_LOW, BFD_RELOC_EPIPHANY_SIMM11): Likewise.
663         (BFD_RELOC_EPIPHANY_IMM11, BFD_RELOC_EPIPHANY_IMM8): Likewise.
664         * targets.c (bfd_elf32_epiphany_vec): Declare.
665         (_bfd_target_vector): Add bfd_elf32_epiphany_vec.
666         * Makefile.in: Regenerate.
667         * bfd-in2.h: Regenerate.
668         * configure: Regenerate.
669         * libbfd.h: Regenerate.
670         * po/SRC-POTFILES.in: Regenerate.
671         * po/bfd.pot: Regenerate.
672         * cpu-epiphany.c: New file.
673         * elf32-epiphany.c: New file.
675 2011-10-24  Maciej W. Rozycki  <macro@codesourcery.com>
677         * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Remove
678         assertions.
680 2011-10-24  Eugeniy Meshcheryakov  <eugen@debian.org>
682         PR ld/13273
683         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Do not warn about
684         identical TAG_PCS_config attributes.
686 2011-10-24  Nick Clifton  <nickc@redhat.com>
688         * po/ja.po: Updated Japanese translation.
690 2011-10-24  Pau Garcia i Quiles  <pgquiles@elpauer.org>
692         PR binutils/13292
693         * bfd-in.h: Include <sys/stat.h> rather than forward defining
694         struct stat.
695         * bfd-in2.h: Regenerate.
697 2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>
699         PR ld/13302
700         * elf32-i386.c (elf_i386_relocate_section): Replace
701         R_386_IRELATIVE with R_386_RELATIVE.
703         * elf64-x86-64.c (elf_x86_64_relocate_section): Replace
704         R_X86_64_IRELATIVE with R_X86_64_RELATIVE.
706 2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>.
708         * elf32-i386.c (elf_i386_relocate_section): Fix a typo in
709         comments.
710         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
712 2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>
714         PR ld/13302
715         * elf32-i386.c (elf_i386_link_hash_table): Add next_jump_slot_index
716         and next_irelative_index.
717         (elf_i386_link_hash_table_create): Initialize next_jump_slot_index
718         and next_irelative_index.
719         (elf_i386_allocate_dynrelocs): Increment reloc_count instead of
720         next_tls_desc_index.
721         (elf_i386_size_dynamic_sections): Set next_tls_desc_index and
722         next_irelative_index from reloc_count.
723         (elf_i386_finish_dynamic_symbol): Put R_386_IRELATIVE after
724         R_386_JUMP_SLOT.
726         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
727         next_jump_slot_index and next_irelative_index.
728         (elf_x86_64_link_hash_table_create): Initialize
729         next_jump_slot_index and next_irelative_index.
730         (elf_x86_64_size_dynamic_sections): Set next_irelative_index
731         from reloc_count.
732         (elf_x86_64_finish_dynamic_symbol): Put R_X86_64_IRELATIVE after
733         R_X86_64_JUMP_SLOT.
735 2011-10-20  Nick Clifton  <nickc@redhat.com>
737         PR ld/13049
738         * elf32-arm.c (STUB_SUFFIX): Avoid collision with user namespace
739         symbol names.
740         * elf64-ppc.c (STUB_SUFFIX): Likewise.
741         * elf32-hppa.c (STUB_SUFFIX): Likewise.
743 2011-10-20  Alan Modra  <amodra@gmail.com>
745         * elf32-i386.c (i386_opcode16): Delete.
746         (elf_i386_check_tls_transition): Use memcmp to compare contents.
747         * elf64-x86-64.c (x86_64_opcode16, x86_64_opcode32): Delete.
748         (elf_x86_64_check_tls_transition): Use memcmp to compare contents.
750 2011-10-19  Alan Modra  <amodra@gmail.com>
752         PR ld/13177
753         * elflink.c (_bfd_elf_gc_mark_rsec): Set symbol "mark".
754         (elf_gc_sweep_symbol): Don't test plt/got refcounts, instead test
755         "mark".  Hide undefweak too.  Clear def_regular and ref_regular.
756         * elf-m10300.c (mn10300_elf_relocate_section): Ignore unresolved
757         reloc errors from garbage-collected code.
758         * elf32-arm.c (elf32_arm_relocate_section): Likewise.
759         * elf32-bfin.c (bfin_relocate_section): Likewise.
760         (bfinfdpic_relocate_section): Likewise.
761         * elf32-cris.c (cris_elf_relocate_section): Likewise.
762         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
763         * elf32-i386.c (elf_i386_relocate_section): Likewise.
764         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
765         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
766         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
767         * elf32-s390.c (elf_s390_relocate_section): Likewise.
768         * elf32-sh.c (sh_elf_relocate_section): Likewise.
769         * elf32-spu.c (spu_elf_relocate_section): Likewise.
770         * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
771         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
772         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
773         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
774         * elf64-s390.c (elf_s390_relocate_section): Likewise.
775         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
776         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
777         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
778         * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
780 2011-10-19  Alan Modra  <amodra@gmail.com>
782         PR ld/13311
783         * elflink.c (elf_link_output_extsym): Correct test for warning when
784         forced local executable syms are referenced from shared libraries.
786 2011-10-19  Alan Modra  <amodra@gmail.com>
788         PR ld/13254
789         * elflink.c (bfd_elf_final_link): Emit error_textrel error.
791 2011-10-18  David S. Miller  <davem@davemloft.net>
793         PR binutils/13301
794         * elfxx-sparc.c (sparc_elf_find_reloc_at_ofs): New function.
795         (_bfd_sparc_elf_relocate_section): Always move the __tls_get_addr
796         call delay slot instruction forward 4 bytes when performing
797         relaxation.
799 2011-10-17  Alan Modra  <amodra@gmail.com>
801         PR ld/12975
802         PR ld/13195
803         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Apply 2011-09-15
804         and 2011-09-29 bfd_elf_gc_mark_dynamic_ref_symbol changes here too.
806 2011-10-14  Hans-Peter Nilsson  <hp@axis.com>
808         * elf32-cris.c (cris_elf_gc_sweep_hook) <R_CRIS_16_GOTPLT>
809         <R_CRIS_32_GOTPLT>: Fix missing update of gotplt refcount for
810         global symbols.
811         <R_CRIS_8, R_CRIS_16, R_CRIS_32>: New cases for similar missing
812         updates of the plt refcount.
813         (elf_cris_adjust_gotplt_to_got): Assert integrity of the gotplt
814         refcount in relation to the plt refcount.
816 2011-10-13  Richard Sandiford  <richard.sandiford@linaro.org>
818         * elf32-arm.c (elf32_arm_final_link_relocate): Mark PLT calls via
819         stubs as resolved.
821 2011-10-11  Alan Modra  <amodra@gmail.com>
823         PR binutils/13278
824         * archive.c (bfd_generic_archive_p): Only check first element
825         when target_defaulted.
826         (_bfd_construct_extended_name_table): Use ar_maxnamelen.
827         (_bfd_archive_bsd44_construct_extended_name_table): Likewise.
829 2011-10-11  Alan Modra  <amodra@gmail.com>
831         PR binutils/13257
832         * archive.c (_bfd_find_nested_archive, _bfd_get_elt_at_filepos): Open
833         thin archive element using container target if not defaulted.
835 2011-10-10  Nick Clifton  <nickc@redhat.com>
837         * po/es.po: Updated Spanish translation.
838         * po/fi.po: Updated Finnish translation.
839         * po/fr.po: Updated French translation.
840         * po/ru.po: Updated Russian translation.
842 2011-10-10  Alan Modra  <amodra@gmail.com>
844         * elf64-ppc.c (ppc64_elf_howto_table): Add R_PPC64_TOCSAVE entry.
845         (struct ppc_link_hash_table): Add tocsave_htab.
846         (struct tocsave_entry): New.
847         (tocsave_htab_hash, tocsave_htab_eq, tocsave_find): New functions.
848         (ppc64_elf_link_hash_table_create): Create tocsave_htab..
849         (ppc64_elf_link_hash_table_free): ..and delete it.
850         (build_plt_stub): Always put STD_R2_40R1 first.
851         (ppc64_elf_size_stubs): Check for R_PPC64_TOCSAVE following reloc
852         on plt call.  If present add prologue nop location to tocsave_htab.
853         (ppc64_elf_relocate_section): Convert prologue nop to std.  Skip
854         first insn of plt call stub when R_PPC64_TOCSAVE present.
856 2011-10-08  H.J. Lu  <hongjiu.lu@intel.com>
858         PR ld/13250
859         * elflink.c (elf_link_add_object_symbols): Preserve the maximum
860         alignment and size for common symbols.
862 2011-10-08  Alan Modra  <amodra@gmail.com>
864         PR ld/13229
865         PR ld/13244
866         * elflink.c (elf_link_add_object_symbols): Don't make IR symbols
867         dynamic.
869 2011-10-08  Alan Modra  <amodra@gmail.com>
871         PR ld/13229
872         * elflink.c (elf_link_output_extsym): Strip defined plugin symbols
873         even when strip_discarded is false.
875 2011-10-05  Kai Tietz  <ktietz@redhat.com>
877         * coffgen.c (coff_write_alien_symbol): Don't write
878         symbol for discarded sections, if strip_discarded isn't
879         explicit set to false.
880         (coff_write_native_symbol): Likewise.
882 2011-10-05  DJ Delorie  <dj@redhat.com>
883             Nick Clifton  <nickc@redhat.com>
885         * elf32-rx.c: Add support for PID mode.
886         (rx_elf_relocate_section): Add checks for unsafe PID relocations.
887         Include addend in R_RX_SYM relocations.
889 2011-09-30  Tristan Gingold  <gingold@adacore.com>
891         * dwarf2.c (struct dwarf2_debug): Add field debug_sections.
892         (read_section): Add sec argument. Adjust the code to get section
893         names from it.
894         (read_indirect_string): Adjust call to read_section.
895         (read_abbrevs): Ditto.
896         (decode_line_info): Ditto.
897         (read_debug_ranges): Ditto.
898         (DWARF2_DEBUG_INFO, DWARF2_COMPRESSED_DEBUG_INFO): Remove.
899         (find_debug_info): Add debug_sections parameter.  Use it instead
900         the above macros.
901         (place_sections): Get section names from stash.
902         (find_line): Add debug_sections argument.  Initialize
903         debug_sections field of stash from it.
904         Adjust calls to find_debug_info.
905         (_bfd_dwarf2_find_nearest_line): Add debug_sections argument.
906         Adjust call to find_line.
907         (_bfd_dwarf2_find_line): Adjust call to find_line.
908         * libcoff-in.h (struct dwarf_debug_section): New declaration.
909         (coff_find_nearest_line_with_names): Likewise.
910         * libcoff.h: Regenerate.
911         * libbfd-in.h (struct dwarf_debug_section): Move declaration.
912         (dwarf_debug_sections): Likewise.
913         (_bfd_dwarf2_find_nearest_line): Add debug_sections argument.
914         * libbfd.h: Regenerate.
915         * elf.c (_bfd_elf_find_nearest_line): Adjust call to
916         _bfd_dwarf2_find_nearest_line.
917         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Ditto.
918         * elf64-alpha.c (elf64_alpha_find_nearest_line): Ditto.
919         * elf32-arm.c (elf32_arm_find_nearest_line): Ditto.
920         * coffgen.c (coff_find_nearest_line_with_names): New function.
921         (coff_find_nearest_line): Calls coff_find_nearest_line_with_names.
922         * coff-rs6000.c (xcoff_debug_sections): New constant.
923         (xcoff_find_nearest_line): New function.
924         (rs6000coff_vec): Use xcoff_find_nearest_line.
925         (pmac_xcoff_vec): Ditto.
927 2011-09-30  Alan Modra  <amodra@gmail.com>
929         PR ld/13235
930         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add ha_relocs_not_using_r2.
931         (ppc64_elf_edit_toc): Check HA relocs.
932         (ha_reloc_match): Delete function.
933         (ppc64_elf_relocate_section): Remove delayed HA nop optimization.
934         Instead do it and low part optimization based on
935         ha_relocs_not_using_r2.
937 2011-09-29  Alan Modra  <amodra@gmail.com>
939         PR ld/13233
940         * elflink.c (_bfd_elf_gc_mark_extra_sections): Mark single member
941         debug and special section groups.
943 2011-09-29  H.J. Lu  <hongjiu.lu@intel.com>
945         PR ld/13195
946         * elflink.c (_bfd_elf_merge_symbol): Don't set dynamic_def when
947         clearing def_dynamic.
948         (elf_link_add_object_symbols): Likewise.  Set dynamic_def when
949         setting def_dynamic.
950         (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is
951         versioned.
953 2011-09-27  Kai Tietz  <ktietz@redhat.com>
955         * coffcode.h (sec_to_styp_flags): Handle
956         SEC_LINK_DUPLICATES_SAME_CONTENTS, and
957         SEC_LINK_DUPLICATES_SAME_SIZE.
959 2011-09-22  Tristan Gingold  <gingold@adacore.com>
961         * configure.in: Bump version to 2.22.51
962         * configure: Regenerate.
964 2011-09-21  David S. Miller  <davem@davemloft.net>
966         * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): New.
967         * elfxx-sparc.h: Declare it.
968         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Call it.
969         * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
971 2011-09-21  Tristan Gingold  <gingold@adacore.com>
973         * mach-o.c (bfd_mach_o_convert_section_name_to_bfd): Add comment.
974         Deals with size limited strings.
975         (bfd_mach_o_build_commands): Initialize more fields.
977 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>
979         PR ld/13177
980         * elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT
981         nor GOT references.
983 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>
985         PR ld/12975
986         * bfd-in.h (bfd_elf_size_dynamic_sections): Remove pointer
987         to struct bfd_elf_version_tree.
989         * elflink.c (elf_info_failed): Remove verdefs.
990         (_bfd_elf_export_symbol): Updated.
991         _bfd_elf_link_assign_sym_version): Likewise.
992         (bfd_elf_size_dynamic_sections): Remove pointer to struct
993         bfd_elf_version_tree.  Updated.
994         (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is hidden
995         by linker script.
997         * linker.c (bfd_hide_sym_by_version): New.
999         * bfd-in2.h: Regenerated.
1001 2011-09-12  H.J. Lu  <hongjiu.lu@intel.com>
1003         PR ld/13178
1004         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Use .got.plt
1005         if there are no GOT relocations.
1007 2011-09-09  Kai Tietz  <ktietz@redhat.com>
1009         * peicode.h (pe_ILF_build_a_bfd): Don't remove leading underscore
1010         for targets without symbol_leading_char.
1012 2011-09-08  Bernd Jendrissek  <bernd.jendrissek@gmail.com>
1014         * bfdwin.c (bfd_get_file_window): Fix memory leak.
1016 2011-09-07  Alan Modra  <amodra@gmail.com>
1018         PR ld/13131
1019         * bfd/elf64-ppc.c (adjust_toc_syms): Ensure ppc64_elf_howto_table
1020         is initialized.
1022 2011-09-06  Alan Modra  <amodra@gmail.com>
1024         PR ld/13131
1025         * elf64-ppc.c (adjust_toc_syms): Delete redundant code.
1026         (ppc64_elf_edit_toc): Fix style nit.  Report some details
1027         on linker failure due to reference in debug or non-alloc
1028         sections to optimized away toc entry, and don't abort.
1030 2011-09-01  Christophe Lyon  <christophe.lyon@st.com>
1032         * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip excluded
1033         sections.
1035 2011-08-26  Nick Clifton  <nickc@redhat.com>
1037         * po/es.po: Updated Spanish translation.
1039 2011-08-19  Alan Modra  <amodra@gmail.com>
1041         * elf64-ppc.c (ppc64_elf_edit_toc): Ignore can_optimize bit if
1042         we haven't seen expected -mcmodel=medium/large code relocs.
1044 2011-08-18  Tristan Gingold  <gingold@adacore.com>
1046         * mach-o.c (bfd_mach_o_read_segment): Initialize list.
1048 2011-08-17  Tristan Gingold  <gingold@adacore.com>
1050         * mach-o.c (bfd_mach_o_write_section_32): Fix typo.
1052 2011-08-17  Alan Modra  <amodra@gmail.com>
1054         PR ld/12762
1055         * bfd-in.h (struct bfd_section_already_linked): Forward declare.
1056         (_bfd_handle_already_linked): Declare.
1057         * coff-alpha.c (_bfd_ecoff_section_already_linked): Define as
1058         _bfd_coff_section_already_linked.
1059         * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise.
1060         * coffcode.h (coff_section_already_linked): Likewise.
1061         * cofflink.c (coff_link_add_symbols): Revert 2011-07-09 changes.
1062         * elf-bfd.h: Likewise.
1063         * libbfd-in.h: Likewise.
1064         * targets.c: Likewise.
1065         * linker.c (bfd_section_already_linked): Likewise.
1066         (bfd_section_already_linked_table_lookup): Likewise.
1067         (bfd_section_already_linked_table_insert): Likewise.
1068         (_bfd_generic_section_already_linked): Likewise.  Call
1069         _bfd_handle_already_linked.
1070         (_bfd_handle_already_linked): New function, split out from..
1071         * elflink.c (_bfd_elf_section_already_linked): ..here.  Revert
1072         2011-07-09 changes.  Avoid unnecessary strcmp when matching
1073         already_linked_list entries.  Match plugin linkonce section.
1074         (section_signature): Delete.
1075         * coffgen.c (_bfd_coff_section_already_linked): New function.
1076         * libcoff-in.h (_bfd_coff_section_already_linked): Declare.
1077         * libbfd.h: Regenerate.
1078         * libcoff.h: Regenerate.
1079         * bfd-in2.h: Regenerate.
1081 2011-08-14  Alan Modra  <amodra@gmail.com>
1083         * elf32-ppc.c (ppc_elf_select_plt_layout): Force bss-plt when
1084         shared and call to _mcount will go via plt.
1086 2011-08-14  Alan Modra  <amodra@gmail.com>
1088         * elf64-ppc.c: Prefix all einfo error strings with "%P: ".
1089         * elf32-ppc.c: Likewise.
1090         (ppc_elf_select_plt_layout): Use einfo rather than info to report
1091         forced bss-plt.
1093 2011-08-12  H.J. Lu  <hongjiu.lu@intel.com>
1095         PR ld/13082
1096         * elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_RELATIVE64.
1097         (elf_x86_64_relocate_section): Treat R_X86_64_64 like R_X86_64_32
1098         and zero-extend it to 64bit if addend is zero for x32.  Generate
1099         R_X86_64_RELATIVE64 for x32.
1101 2011-08-09  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1103         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
1104         * bfd-in2.h (bfd_elf32_arm_set_target_relocs): Likewise.
1105         * elf32-arm.c (elf32_arm_link_hash_table): New field.
1106         (elf232_arm_link_hash_table_create): Initialise new field.
1107         (check_use_blx): Change test depending on fix_arm1176.
1108         (bfd_elf32_arm_set_target_relocs): Set fix_arm1176 from
1109         command line options.
1111 2011-08-08  Tristan Gingold  <gingold@adacore.com>
1113         * mach-o.c (struct mach_o_segment_name_xlat): Add comments.
1114         (segsec_names_xlat): Reorder elements.
1115         (bfd_mach_o_read_section_32): Fix typo.
1116         (bfd_mach_o_read_section_64): Fix typo.
1118 2011-08-08  Tristan Gingold  <gingold@adacore.com>
1120         * mach-o.h (BFD_MACH_O_SEGNAME_SIZE): New macro.
1121         (BFD_MACH_O_SECTNAME_SIZE): Ditto.
1122         (bfd_mach_o_section): Use them.  Add next field.
1123         (bfd_mach_o_segment_command): Replace sections array by
1124         sect_head and sect_tail.
1125         (bfd_mach_o_get_mach_o_section): New macro.
1126         (bfd_mach_o_lookup_section): Remove.
1127         (bfd_mach_o_new_section_hook): New function.
1128         * mach-o.c (bfd_mach_o_normalize_section_name): Use strncmp
1129         instead of strcmp.
1130         (bfd_mach_o_convert_section_name_to_bfd): Replaces section
1131         parameter with segname and sectname parameters.  Adjust.
1132         (bfd_mach_o_append_section_to_segment): New function.  Use a
1133         linked list for Mach-O sections.
1134         (bfd_mach_o_write_segment_32): Adjust.
1135         (bfd_mach_o_write_segment_64): Ditto.
1136         (bfd_mach_o_build_commands): Fix comment.  Adjust.
1137         (bfd_mach_o_flatten_sections): Adjust.
1138         (bfd_mach_o_print_section_map): Adjust.
1139         (bfd_mach_o_set_section_flags_from_bfd): Ditto.
1140         (bfd_mach_o_new_section_hook): New function.
1141         (bfd_mach_o_init_section_from_mach_o): Ditto.
1142         (bfd_mach_o_read_section_32): Remove section parameter.
1143         Return a section instead.
1144         (bfd_mach_o_read_section_64): Ditto.
1145         (bfd_mach_o_read_section): Ditto.
1146         (bfd_mach_o_make_bfd_section): Adjust.
1147         (bfd_mach_o_read_segment): Adjust for new profile of
1148         bfd_mach_o_read_section.
1149         (bfd_mach_o_lookup_section): Remove.
1150         * mach-o-target.c (bfd_mach_o_new_section_hook): Remove.
1152 2011-08-08  Tristan Gingold  <gingold@adacore.com>
1154         * mach-o.h (bfd_mach_o_version_min_command): New structure.
1155         (bfd_mach_o_load_command): Add version_min.
1156         (mach_o_data_struct): Fix comment.
1157         * mach-o.c (bfd_mach_o_read_version_min): New function.
1158         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_FUNCTION_STARTS,
1159         BFD_MACH_O_LC_VERSION_MIN_MACOSX and
1160         BFD_MACH_O_LC_VERSION_MIN_IPHONEOS.
1161         (bfd_mach_o_get_name_or_null): New function.
1162         (bfd_mach_o_get_name): Use the above new one.
1163         (bfd_mach_o_load_command_name): Add the above new commands.
1164         (bfd_mach_o_bfd_print_private_bfd_data): Display numerically
1165         unknown commands.  Handle BFD_MACH_O_LC_FUNCTION_STARTS,
1166         BFD_MACH_O_LC_VERSION_MIN_MACOSX and
1167         BFD_MACH_O_LC_VERSION_MIN_IPHONEOS.
1169 2011-08-08  Tristan Gingold  <gingold@adacore.com>
1171         * mach-o.h: Move size macros to external.h
1172         Move reloc macros to reloc.h and x86-64.h.
1173         * mach-o-i386.c: Includes mach-o/reloc.h
1174         * mach-o-x86-64.c: Ditto and includes mach-o/x86-64.h
1175         * mach-o.c: Add includes.
1176         (bfd_mach_o_write_header): Use structure from external.h to convert.
1177         (bfd_mach_o_write_thread): Ditto.
1178         (bfd_mach_o_write_relocs): Ditto.
1179         (bfd_mach_o_write_section_32): Ditto.
1180         (bfd_mach_o_write_section_64): Ditto.
1181         (bfd_mach_o_write_segment_32): Ditto.
1182         (bfd_mach_o_write_segment_64): Ditto.
1183         (bfd_mach_o_write_symtab): Ditto.
1184         (bfd_mach_o_write_contents): Ditto.
1185         (bfd_mach_o_read_header): Ditto.
1186         (bfd_mach_o_read_section_32): Ditto.
1187         (bfd_mach_o_read_section_64): Ditto.
1188         (bfd_mach_o_read_symtab_symbol): Ditto.
1189         (bfd_mach_o_read_dylinker): Ditto.
1190         (bfd_mach_o_read_dylib): Ditto.
1191         (bfd_mach_o_read_dysymtab): Ditto.
1192         (bfd_mach_o_read_symtab): Ditto.
1193         (bfd_mach_o_read_linkedit): Ditto.
1194         (bfd_mach_o_read_str): Ditto.
1195         (bfd_mach_o_read_dyld_info): Ditto.
1196         (bfd_mach_o_read_segment): Ditto.
1197         (bfd_mach_o_read_command): Ditto.
1198         (bfd_mach_o_archive_p): Ditto.
1199         (bfd_mach_o_canonicalize_one_reloc): Ditto. Change the BUF parameter.
1200         (bfd_mach_o_canonicalize_relocs): Adjust to call the above function.
1201         (bfd_mach_o_read_dysymtab_symbol): Rename BUF variable.
1202         (bfd_mach_o_read_uuid): Remove useless cast.  Use a macro instead
1203         of an hard-coded value.
1205 2011-08-08  Tristan Gingold  <gingold@adacore.com>
1207         * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Fix cut-and-past typos.
1208         (bfd_mach_o_x86_64_swap_reloc_out): Handle BFD_RELOC_32_PCREL,
1209         BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64 and
1210         BFD_RELOC_MACH_O_X86_64_GOT_LOAD.  Share common code.
1212 2011-08-08  Tristan Gingold  <gingold@adacore.com>
1214         * mach-o.c (bfd_mach_o_normalize_section_name): New function.
1215         (bfd_mach_o_convert_section_name_to_bfd): Use it.
1216         (bfd_mach_o_get_section_type_from_name): New function.
1217         (bfd_mach_o_get_section_attribute_from_name): Ditto.
1218         * mach-o.h (bfd_mach_o_section): Move bfdsection field at the end.
1219         Add comments.  Add prototypes for the above new functions.
1221 2011-08-05  Mark Kettenis  <kettenis@gnu.org>
1223         * netbsd-core.c (netbsd_core_vec): Init match_priority field.
1225 2011-08-05  Alan Modra  <amodra@gmail.com>
1227         * elf64-ppc.c (maybe_strip_output): New function.
1228         (ppc64_elf_size_stubs): Use it to strip .branch_lt and .eh_frame.
1230 2011-08-05  Alan Modra  <amodra@gmail.com>
1232         PR ld/12762
1233         * elflink.c (_bfd_elf_section_already_linked): Return matched
1234         status.  Remove COFF comdat section handling.
1235         * linker.c (_bfd_generic_section_already_linked): Return matched
1236         status.  Don't set SEC_GROUP in l_flags for plugin entries.
1237         (bfd_section_already_linked): Update prototype.
1238         * targets.c (_section_already_linked): Likewise.
1239         * elf-bfd.h (_bfd_elf_section_already_linked): Likewise.
1240         * libbfd-in.h (_bfd_generic_section_already_linked): Likewise.
1241         (_bfd_nolink_section_already_linked): Update.
1242         * libbfd.h: Regenerate.
1243         * bfd-in2.h: Regenerate.
1245 2011-08-05  Alan Modra  <amodra@gmail.com>
1247         * elf32-ppc.c: Include dwarf2.h.
1248         (struct ppc_elf_link_hash_table): Add glink_eh_frame.
1249         (ppc_elf_create_glink): Create .eh_frame section.
1250         (glink_eh_frame_cie): New array.
1251         (ppc_elf_size_dynamic_sections): Size glink_eh_frame.
1252         (ppc_elf_finish_dynamic_sections): Write glink_eh_frame.
1254 2011-08-04  Tristan Gingold  <gingold@adacore.com>
1256         * vms-alpha.c (_bfd_vms_write_eeom): Round vms_linkage_index.
1257         (_bfd_vms_write_etir): Initialize vms_linkage_index to 0.
1259 2011-08-03  Tristan Gingold  <gingold@adacore.com>
1261         * mach-o.c (bfd_mach_o_canonicalize_symtab): Handle no symbols case.
1262         (bfd_mach_o_read_symtab_symbols): Return if no symbols.
1264 2011-08-02  Maciej W. Rozycki  <macro@codesourcery.com>
1266         * elfxx-mips.c (check_4byte_branch): Remove function.
1267         (check_relocated_bzc): New function.
1268         (_bfd_mips_elf_relax_section): Permit the relaxation of LUI
1269         instructions that immediately follow a compact branch
1270         instruction.
1272 2011-08-02  Alan Modra  <amodra@gmail.com>
1274         * elf64-ppc.c (build_plt_stub): Correct emitted relocs when no
1275         plt_static_chain.
1276         (ppc_build_one_stub): Adjust get_relocs call to suit..
1277         (ppc_size_one_stub): ..and reloc sizing.  Correct plt size corner case.
1279 2011-08-01  H.J. Lu  <hongjiu.lu@intel.com>
1281         PR ld/13048
1282         * archures.c (bfd_mach_i386_intel_syntax): New.
1283         (bfd_mach_i386_i8086): Updated.
1284         (bfd_mach_i386_i386): Likewise.
1285         (bfd_mach_x86_64): Likewise.
1286         (bfd_mach_x64_32): Likewise.
1287         (bfd_mach_i386_i386_intel_syntax): Likewise.
1288         (bfd_mach_x86_64_intel_syntax): Likewise.
1289         (bfd_mach_x64_32_intel_syntax): Likewise.
1290         (bfd_mach_l1om): Likewise.
1291         (bfd_mach_l1om_intel_syntax): Likewise.
1292         (bfd_mach_k1om): Likewise.
1293         (bfd_mach_k1om_intel_syntax): Likewise.
1295         * bfd-in2.h: Regenerated.
1297         * cpu-i386.c (bfd_i386_compatible): Check mach instead of
1298         bits_per_address.
1299         (bfd_x64_32_arch_intel_syntax): Set bits_per_address to 64.
1300         (bfd_x64_32_arch): Likewise.
1302         * elf64-x86-64.c: Include "libiberty.h".
1303         (x86_64_elf_howto_table): Append x32 R_X86_64_32.
1304         (elf_x86_64_rtype_to_howto): Support x32 R_X86_64_32.
1305         (elf_x86_64_reloc_type_lookup): Likewise.
1306         (elf_x86_64_reloc_name_lookup): Likewise.
1307         (elf_x86_64_relocate_section): Likewise.
1308         (elf_x86_64_check_relocs): Allow R_X86_64_64 relocations for x32.
1310 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
1312         * elfxx-mips.c (check_br32): Fix return type.
1314 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
1316         * elfxx-mips.c (bz_insn_16): Correct opcode mask.
1318 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
1320         * elfxx-mips.c: Adjust comments throughout.
1321         (mips_elf_relax_delete_bytes): Reshape code.
1322         (_bfd_mips_elf_relax_section): Remove check for
1323         R_MICROMIPS_GPREL16 relocations.  Reshape code.
1325 2011-07-28  Roland McGrath  <mcgrathr@google.com>
1327         * elf32-i386.c (NACL_PLT_ENTRY_SIZE, NACLMASK): New macros.
1328         (elf_i386_nacl_plt0_entry): New variable.
1329         (elf_i386_plt_entry): New variable.
1330         (elf_i386_nacl_pic_plt0_entry): New variable.
1331         (elf_i386_nacl_pic_plt_entry): New variable.
1332         (elf_i386_nacl_plt, elf_i386_nacl_arch_bed): New variables.
1333         (elf_backend_arch_data): New macro setting for elf_i386_nacl_vec stanza.
1334         (elf_backend_plt_alignment): Likewise.
1336         * config.bfd: Handle i[3-7]86-*-nacl*.
1337         * elf32-i386.c (bfd_elf32_i386_nacl_vec): New backend vector stanza.
1338         * targets.c: Support bfd_elf32_i386_nacl_vec.
1339         * configure.in: Likewise.
1340         * configure: Regenerated.
1342         * elf32-i386.c (struct elf_i386_plt_layout): New type.
1343         (GET_PLT_ENTRY_SIZE): New macro.
1344         (elf_i386_plt): New variable.
1345         (struct elf_i386_backend_data): New member `plt'.
1346         (elf_i386_arch_bed): Add initializer for it.
1347         (elf_i386_vxworks_arch_bed): Likewise.
1348         (elf_i386_allocate_dynrelocs): Use GET_PLT_ENTRY_SIZE.
1349         (elf_i386_plt_sym_val): Likewise.
1350         (elf_i386_relocate_section): Likewise.
1351         (elf_i386_finish_dynamic_symbol): Likewise.
1352         Also use other elf_i386_plt_layout members for PLT details.
1353         (elf_i386_finish_dynamic_sections): Likewise.
1355         * elf32-i386.c (struct elf_i386_backend_data): New type.
1356         (get_elf_i386_backend_data): New macro.
1357         (elf_i386_arch_bed): New variable.
1358         (elf_backend_arch_data): New macro.
1359         (struct elf_i386_link_hash_table): Remove plt0_pad_byte and is_vxworks.
1360         (elf_i386_link_hash_table_create): Don't initialize them.
1361         (elf_i386_create_dynamic_sections): Find is_vxworks flags in
1362         elf_i386_backend_data, not elf_i386_link_hash_table.
1363         (elf_i386_adjust_dynamic_symbol): Likewise.
1364         (elf_i386_allocate_dynrelocs): Likewise.
1365         (elf_i386_readonly_dynrelocs): Likewise.
1366         (elf_i386_size_dynamic_sections): Likewise.
1367         (elf_i386_relocate_section): Likewise.
1368         (elf_i386_finish_dynamic_symbol): Likewise.
1369         (elf_i386_finish_dynamic_sections): Likewise.  Same for plt0_pad_byte.
1370         (elf_i386_vxworks_link_hash_table_create): Function removed.
1371         (elf_i386_vxworks_arch_bed): New variable.
1372         (elf_backend_arch_data): New macro in elf32-i386-vxworks stanza.
1374         * elf-bfd.h (elf_backend_data): New member arch_backend_data.
1375         * elfxx-target.h (elf_backend_arch_data): New macro.
1376         (elfNN_bed): Use it as initializer for the new member.
1378 2011-07-28  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
1380         * elf64-hppa.c (elf_hppa_final_link_relocate): Fix handling of out
1381         of range branches.
1383 2011-07-26  Jakub Jelinek  <jakub@redhat.com>
1385         * dwarf2.c (dwarf_debug_sections): Add .debug_macro
1386         and .zdebug_macro entry.
1387         (dwarf_debug_section_enum): Add debug_macro.
1389 2011-07-26  Alan Modra  <amodra@gmail.com>
1391         * elf64-ppc.c: Include dwarf2.h.
1392         (struct ppc_link_hash_table): Add glink_eh_frame.
1393         (create_linkage_sections): Create .eh_frame section.
1394         (ppc64_elf_size_dynamic_sections): Arrange to drop unneeded
1395         glink_eh_frame.
1396         (glink_eh_frame_cie): New array.
1397         (ppc64_elf_size_stubs): Size glink_eh_frame.
1398         (ppc64_elf_build_stubs): Init glink_eh_frame contents.
1399         (ppc64_elf_finish_dynamic_sections): Write glink_eh_frame.
1401 2011-07-25  Hans-Peter Nilsson  <hp@bitrange.com>
1403         PR ld/12815
1404         * elf64-mmix.c (struct _mmix_elf_section_data): New members
1405         has_warned_bpo and has_warned_pushj.
1406         (mmix_final_link_relocate): Remove PARAMS and PTR macros,
1407         converting to ISO C.  Add new parameter error_message.  All
1408         callers changed.
1409         (mmix_elf_perform_relocation): Ditto.
1410         <case R_MMIX_PUSHJ_STUBBABLE, case R_MMIX_BASE_PLUS_OFFSET>:
1411         Handle the case where mmix_elf_check_common_relocs has not been
1412         called, missing preparations for relocs of the respective type.
1414 2011-07-24  Chao-ying Fu  <fu@mips.com>
1415             Ilie Garbacea  <ilie@mips.com>
1416             Maciej W. Rozycki  <macro@codesourcery.com>
1417             Joseph Myers  <joseph@codesourcery.com>
1418             Catherine Moore  <clm@codesourcery.com>
1419             Richard Sandiford  <rdsandiford@googlemail.com>
1421         * archures.c (bfd_mach_mips_micromips): New macro.
1422         * cpu-mips.c (I_micromips): New enum value.
1423         (arch_info_struct): Add bfd_mach_mips_micromips.
1424         * elfxx-mips.h (_bfd_mips_elf_is_target_special_symbol): New
1425         prototype.
1426         (_bfd_mips_elf_relax_section): Likewise.
1427         (_bfd_mips16_elf_reloc_unshuffle): Rename to...
1428         (_bfd_mips_elf_reloc_unshuffle): ... this.  Handle microMIPS
1429         ASE.
1430         (_bfd_mips16_elf_reloc_shuffle): Rename to...
1431         (_bfd_mips_elf_reloc_shuffle): ... this.  Handle microMIPS ASE.
1432         (gprel16_reloc_p): Handle microMIPS ASE.
1433         (literal_reloc_p): New function.
1434         * elf32-mips.c (elf_micromips_howto_table_rel): New variable.
1435         (_bfd_mips_elf32_gprel16_reloc): Handle microMIPS ASE.
1436         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
1437         and _bfd_mips_elf_reloc_shuffle changes.
1438         (mips_elf_gprel32_reloc): Update comment.
1439         (micromips_reloc_map): New variable.
1440         (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE.
1441         (mips_elf32_rtype_to_howto): Likewise.
1442         (mips_info_to_howto_rel): Likewise.
1443         (bfd_elf32_bfd_is_target_special_symbol): Define.
1444         (bfd_elf32_bfd_relax_section): Likewise.
1445         * elf64-mips.c (micromips_elf64_howto_table_rel): New variable.
1446         (micromips_elf64_howto_table_rela): Likewise.
1447         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
1448         and _bfd_mips_elf_reloc_shuffle changes.
1449         (micromips_reloc_map): Likewise.
1450         (bfd_elf64_bfd_reloc_type_lookup): Handle microMIPS ASE.
1451         (bfd_elf64_bfd_reloc_name_lookup): Likewise.
1452         (mips_elf64_rtype_to_howto): Likewise.
1453         (bfd_elf64_bfd_is_target_special_symbol): Define.
1454         * elfn32-mips.c (elf_micromips_howto_table_rel): New variable.
1455         (elf_micromips_howto_table_rela): Likewise.
1456         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
1457         and _bfd_mips_elf_reloc_shuffle changes.
1458         (micromips_reloc_map): Likewise.
1459         (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE.
1460         (bfd_elf32_bfd_reloc_name_lookup): Likewise.
1461         (mips_elf_n32_rtype_to_howto): Likewise.
1462         (bfd_elf32_bfd_is_target_special_symbol): Define.
1463         * elfxx-mips.c (LA25_LUI_MICROMIPS_1): New macro.
1464         (LA25_LUI_MICROMIPS_2): Likewise.
1465         (LA25_J_MICROMIPS_1, LA25_J_MICROMIPS_2): Likewise.
1466         (LA25_ADDIU_MICROMIPS_1, LA25_ADDIU_MICROMIPS_2): Likewise.
1467         (TLS_RELOC_P): Handle microMIPS ASE.
1468         (mips_elf_create_stub_symbol): Adjust value of stub symbol if
1469         target is a microMIPS function.
1470         (micromips_reloc_p): New function.
1471         (micromips_reloc_shuffle_p): Likewise.
1472         (got16_reloc_p, call16_reloc_p): Handle microMIPS ASE.
1473         (got_disp_reloc_p, got_page_reloc_p): New functions.
1474         (got_ofst_reloc_p): Likewise.
1475         (got_hi16_reloc_p, got_lo16_reloc_p): Likewise.
1476         (call_hi16_reloc_p, call_lo16_reloc_p): Likewise.
1477         (hi16_reloc_p, lo16_reloc_p, jal_reloc_p): Handle microMIPS ASE.
1478         (micromips_branch_reloc_p): New function.
1479         (tls_gd_reloc_p, tls_ldm_reloc_p): Likewise.
1480         (tls_gottprel_reloc_p): Likewise.
1481         (_bfd_mips16_elf_reloc_unshuffle): Rename to...
1482         (_bfd_mips_elf_reloc_unshuffle): ... this.  Handle microMIPS
1483         ASE.
1484         (_bfd_mips16_elf_reloc_shuffle): Rename to...
1485         (_bfd_mips_elf_reloc_shuffle): ... this.  Handle microMIPS ASE.
1486         (_bfd_mips_elf_lo16_reloc): Handle microMIPS ASE.
1487         (mips_tls_got_index, mips_elf_got_page): Likewise.
1488         (mips_elf_create_local_got_entry): Likewise.
1489         (mips_elf_relocation_needs_la25_stub): Likewise.
1490         (mips_elf_calculate_relocation): Likewise.
1491         (mips_elf_perform_relocation): Likewise.
1492         (_bfd_mips_elf_symbol_processing): Likewise.
1493         (_bfd_mips_elf_add_symbol_hook): Likewise.
1494         (_bfd_mips_elf_link_output_symbol_hook): Likewise.
1495         (mips_elf_add_lo16_rel_addend): Likewise.
1496         (_bfd_mips_elf_check_relocs): Likewise.
1497         (mips_elf_adjust_addend): Likewise.
1498         (_bfd_mips_elf_relocate_section): Likewise.
1499         (mips_elf_create_la25_stub): Likewise.
1500         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1501         (_bfd_mips_elf_gc_sweep_hook): Likewise.
1502         (_bfd_mips_elf_is_target_special_symbol): New function.
1503         (mips_elf_relax_delete_bytes): Likewise.
1504         (opcode_descriptor): New structure.
1505         (RA): New macro.
1506         (OP32_SREG, OP32_TREG, OP16_VALID_REG): Likewise.
1507         (b_insns_32, bc_insn_32, bz_insn_32, bzal_insn_32): New variables.
1508         (beq_insn_32): Likewise.
1509         (b_insn_16, bz_insn_16): New variables.
1510         (BZC32_REG_FIELD): New macro.
1511         (bz_rs_insns_32, bz_rt_insns_32): New variables.
1512         (bzc_insns_32, bz_insns_16):Likewise.
1513         (BZ16_REG, BZ16_REG_FIELD): New macros.
1514         (jal_insn_32_bd16, jal_insn_32_bd32): New variables.
1515         (jal_x_insn_32_bd32): Likewise.
1516         (j_insn_32, jalr_insn_32): Likewise.
1517         (ds_insns_32_bd16, ds_insns_32_bd32): Likewise.
1518         (jalr_insn_16_bd16, jalr_insn_16_bd32, jr_insn_16): Likewise.
1519         (JR16_REG): New macro.
1520         (ds_insns_16_bd16): New variable.
1521         (lui_insn): Likewise.
1522         (addiu_insn, addiupc_insn): Likewise.
1523         (ADDIUPC_REG_FIELD): New macro.
1524         (MOVE32_RD, MOVE32_RS): Likewise.
1525         (MOVE16_RD_FIELD, MOVE16_RS_FIELD): Likewise.
1526         (move_insns_32, move_insns_16): New variables.
1527         (nop_insn_32, nop_insn_16): Likewise.
1528         (MATCH): New macro.
1529         (find_match): New function.
1530         (check_br16_dslot, check_br32_dslot): Likewise.
1531         (check_br16, check_br32): Likewise.
1532         (IS_BITSIZE): New macro.
1533         (check_4byte_branch): New function.
1534         (_bfd_mips_elf_relax_section): Likewise.
1535         (_bfd_mips_elf_merge_private_bfd_data): Disallow linking MIPS16
1536         and microMIPS modules together.
1537         (_bfd_mips_elf_print_private_bfd_data): Handle microMIPS ASE.
1538         * reloc.c (BFD_RELOC_MICROMIPS_7_PCREL_S1): New relocation.
1539         (BFD_RELOC_MICROMIPS_10_PCREL_S1): Likewise.
1540         (BFD_RELOC_MICROMIPS_16_PCREL_S1): Likewise.
1541         (BFD_RELOC_MICROMIPS_GPREL16): Likewise.
1542         (BFD_RELOC_MICROMIPS_JMP, BFD_RELOC_MICROMIPS_HI16): Likewise.
1543         (BFD_RELOC_MICROMIPS_HI16_S): Likewise.
1544         (BFD_RELOC_MICROMIPS_LO16): Likewise.
1545         (BFD_RELOC_MICROMIPS_LITERAL): Likewise.
1546         (BFD_RELOC_MICROMIPS_GOT16): Likewise.
1547         (BFD_RELOC_MICROMIPS_CALL16): Likewise.
1548         (BFD_RELOC_MICROMIPS_GOT_HI16): Likewise.
1549         (BFD_RELOC_MICROMIPS_GOT_LO16): Likewise.
1550         (BFD_RELOC_MICROMIPS_CALL_HI16): Likewise.
1551         (BFD_RELOC_MICROMIPS_CALL_LO16): Likewise.
1552         (BFD_RELOC_MICROMIPS_SUB): Likewise.
1553         (BFD_RELOC_MICROMIPS_GOT_PAGE): Likewise.
1554         (BFD_RELOC_MICROMIPS_GOT_OFST): Likewise.
1555         (BFD_RELOC_MICROMIPS_GOT_DISP): Likewise.
1556         (BFD_RELOC_MICROMIPS_HIGHEST): Likewise.
1557         (BFD_RELOC_MICROMIPS_HIGHER): Likewise.
1558         (BFD_RELOC_MICROMIPS_SCN_DISP): Likewise.
1559         (BFD_RELOC_MICROMIPS_JALR): Likewise.
1560         (BFD_RELOC_MICROMIPS_TLS_GD): Likewise.
1561         (BFD_RELOC_MICROMIPS_TLS_LDM): Likewise.
1562         (BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16): Likewise.
1563         (BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16): Likewise.
1564         (BFD_RELOC_MICROMIPS_TLS_GOTTPREL): Likewise.
1565         (BFD_RELOC_MICROMIPS_TLS_TPREL_HI16): Likewise.
1566         (BFD_RELOC_MICROMIPS_TLS_TPREL_LO16): Likewise.
1567         * bfd-in2.h: Regenerate.
1568         * libbfd.h: Regenerate.
1570 2011-07-22  H.J. Lu  <hongjiu.lu@intel.com>
1572         * Makefile.am (ALL_MACHINES): Add cpu-k1om.lo.
1573         (ALL_MACHINES_CFILES): Add cpu-k1om.c.
1574         * Makefile.in: Regenerated.
1576         * archures.c (bfd_architecture): Add bfd_arch_k1om.
1577         (bfd_k1om_arch): New.
1578         (bfd_archures_list): Add &bfd_k1om_arch.
1579         * bfd-in2.h: Regenerated.
1581         * config.bfd (targ64_selvecs): Add bfd_elf64_k1om_vec if
1582         bfd_elf64_x86_64_vec is supported.  Add bfd_elf64_k1om_freebsd_vec
1583         if bfd_elf64_x86_64_freebsd_vec is supported.
1584         (targ_selvecs): Likewise.
1586         * configure.in: Support bfd_elf64_k1om_vec and
1587         bfd_elf64_k1om_freebsd_vec.
1588         * configure: Regenerated.
1590         * cpu-k1om.c: New.
1592         * elf64-x86-64.c (elf64_k1om_elf_object_p): New.
1593         (bfd_elf64_k1om_vec): Likewise.
1594         (bfd_elf64_k1om_freebsd_vec): Likewise.
1596         * targets.c (bfd_elf64_k1om_vec): New.
1597         (bfd_elf64_k1om_freebsd_vec): Likewise.
1598         (_bfd_target_vector): Add bfd_elf64_k1om_vec and
1599         bfd_elf64_k1om_freebsd_vec.
1601 2011-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1603         Fix false coff-go32-exe matches.
1604         * coff-i386.c (TARGET_SYM) <_bfd_check_format>: Conditionally use
1605         COFF_CHECK_FORMAT.
1606         * coff-stgo32.c (go32_check_format): New forward declaration.
1607         (COFF_CHECK_FORMAT): New defintion.
1608         (go32_check_format): New function.
1610 2011-07-15  Alan Modra  <amodra@gmail.com>
1612         * configure.in: Bump version.
1613         * configure: Regenerate.
1615 2011-07-14  Alan Modra  <amodra@gmail.com>
1617         * linker.c (_bfd_generic_section_already_linked): Set l_flags.
1618         * elf-bfd.h (struct already_linked): Forward declare.
1620 2011-07-14  Alan Modra  <amodra@gmail.com>
1622         * elflink.c (_bfd_elf_fix_symbol_flags): Loop on indirect syms.
1623         (_bfd_elf_adjust_dynamic_symbol): Remove FIXME.
1625 2011-07-14  Alan Modra  <amodra@gmail.com>
1627         * elf64-ppc.c (struct ppc_link_hash_table): Add plt_static_chain.
1628         (build_plt_stub): Add plt_static_chain param, don't load r11 if false.
1629         (build_tls_get_addr_stub): Likewise.
1630         (ppc_build_one_stub): Update calls to above.
1631         (ppc_size_one_stub): Adjust stub size.
1632         (ppc64_elf_size_stubs): Add plt_static_chain param, save to htab.
1633         * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype.
1635 2011-07-12  Nick Clifton  <nickc@redhat.com>
1637         * elf32-arm.c (elf32_arm_section_flags): Delete.
1638         (elf_backend_section_flags): Remove.
1640 2011-07-11  H.J. Lu  <hongjiu.lu@intel.com>
1642         PR ld/12982
1643         * elflink.c (bfd_elf_size_dynamic_sections): Also skip BFD_PLUGIN
1644         when setting stack_flags.
1646 2011-07-11  Catherine Moore  <clm@codesourcery.com>
1648         * aout-adobe.c (aout_32_bfd_lookup_section_flags): New definition.
1649         * aout-target.h (MY_bfd_lookup_section_flags): New definition.
1650         * aout-tic30.c (MY_bfd_lookup_section_flags): New definition.
1651         * bfd-in2.h: Regenerated.
1652         * bfd.c (bfd_lookup_section_flags): New definition.
1653         * binary.c (binary_bfd_lookup_section_flags): New definition.
1654         * bout.c (b_out_bfd_lookup_section_flags): New definition.
1655         * coff-alpha.c (_bfd_ecoff_bfd_lookup_section_flags): New definition.
1656         * coff-mips.c (_bfd_ecoff_bfd_lookup_section_flags): New definition.
1657         * coff-rs6000.c (rs6000coff_vec): Include
1658         bfd_generic_lookup_section_flags.
1659         (pmac_xcoff_vec): Likewise.
1660         * coffcode.h (coff_bfd_lookup_section_flags): New definition.
1661         * coff64-rs6000.c (rs6000coff64_vec): Include
1662         bfd_generic_lookup_section_flags.
1663         (aix5coff64_vec): Likewise.
1664         * ecoff.c (bfd_debug_section): Initialize flag_info field.
1665         * elf-bfd.h (elf_backend_lookup_section_flags_hook): Declare.
1666         (bfd_elf_lookup_section_flags): Declare.
1667         * elflink.c (bfd_elf_lookup_section_flags): New function.
1668         * elfxx-target.h (bfd_elfNN_bfd_lookup_section_flags): Define.
1669         (elf_backend_lookup_section_flags_hook): Define.
1670         (elf_backend_data): Add elf_backend_lookup_section_flags_hook.
1671         * i386msdos.c (msdos_bfd_lookup_section_flags): New define.
1672         * i386os9k.c (os9k_bfd_lookup_section_flags): New define.
1673         * ieee.c (ieee_bfd_lookup_section_flags): New define.
1674         * ihex.c (ihex_bfd_lookup_section_flags): New define.
1675         * libbfd-in.h (_bfd_nolink_bfd_lookup_section_flags): Declare.
1676         (bfd_generic_lookup_section_flags): Declare.
1677         * libbfd.h: Regenerated.
1678         * mach-o-target.c (bfd_mach_o_bfd_lookup_section_flags): New.
1679         * mmo.c (mmo_bfd_lookup_section_flags): New definition.
1680         * nlm-target.h (nlm_bfd_lookup_section_flags): New definition.
1681         * oasys.c (oasys_bfd_lookup_section_flags): New definition.
1682         * pef.c (bfd_pef_bfd_lookup_section_flags): New definition.
1683         * plugin.c (bfd_plugin_bfd_lookup_section_flags): New definition.
1684         * ppcboot.c (ppcboot_bfd_lookup_section_flags): New definition.
1685         * reloc.c (bfd_generic_lookup_section_flags): New function.
1686         * som.c (som_bfd_lookup_section_flags): New definition.
1687         * srec.c (srec_bfd_lookup_section_flags): New definition.
1688         * targets.c (flag_info): Declare.
1689         (NAME##_bfd_lookup_section_flags): Add to LINK jump table.
1690         (_bfd_lookup_section_flags): New.
1691         * tekhex.c (tekhex_bfd_lookup_section_flags): New definition.
1692         * versados.c (versados_bfd_lookup_section_flags): New definition.
1693         * vms-alpha.c (alpha_vms_bfd_lookup_section_flag): New definition.
1694         * xsym.c (bfd_sym_bfd_lookup_section_flags): New definition.
1696 2011-07-11  H.J. Lu  <hongjiu.lu@intel.com>
1698         PR ld/12978
1699         * elfnn-ia64.c (count_dyn_reloc): Fix a typo.
1701 2011-07-09  Alan Modra  <amodra@gmail.com>
1703         PR ld/12942
1704         * elflink.c (elf_link_add_object_symbols): Use elf_discarded_section
1705         rather than kept_section to determine whether a symbol is from
1706         a discarded section.
1707         * cofflink.c (coff_link_add_symbols): Make symbols from discarded
1708         sections appear undefined.
1710 2011-07-09  H.J. Lu  <hongjiu.lu@intel.com>
1712         PR ld/12942
1713         * elf-bfd.h (_bfd_elf_section_already_linked): Replace
1714         "asection *" with "struct already_linked *".
1715         * libbfd-in.h (_bfd_nolink_section_already_linked): Likewise.
1716         (_bfd_generic_section_already_linked): Likewise.
1717         (bfd_section_already_linked_table_insert): Likewise.
1718         (struct already_linked): New.
1719         (struct bfd_section_already_linked): Use it.
1720         * elflink.c (_bfd_elf_section_already_linked): Replace.
1721         "asection *" with "struct already_linked *".  Replace the plugin
1722         dummy with the LTO output.
1723         * linker.c (_bfd_generic_section_already_linked): Likewise.
1724         * targets.c (struct already_linked): Add forward declaration.
1725         (bfd_target): Replace "struct bfd_section *" with
1726         "struct already_linked *" in _section_already_linked.
1727         * bfd-in2.h: Regenerate.
1728         * libbfd.h: Regenerate.
1730 2011-07-06  Tristan Gingold  <gingold@adacore.com>
1732         * mach-o.h: Move loader related definitions to
1733         include/mach-o/loader.h.  Include it.
1735 2011-07-05  H.J. Lu  <hongjiu.lu@intel.com>
1737         * elf64-x86-64.c (elf_backend_post_process_headers): Always
1738         define to _bfd_elf_set_osabi.
1740 2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
1741             Thomas Schwinge  <thomas@schwinge.name>
1743         PR binutils/12913
1744         * elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of
1745         ELFOSABI_LINUX alias.
1746         * elf32-hppa.c: Likewise.
1747         * elf32-i370.c: Likewise.
1748         * elf64-hppa.c: Likewise.
1750 2011-07-01  Ian Lance Taylor  <iant@google.com>
1752         * elf32-i386.c (elf_i386_eh_frame_plt): Correct expression: change
1753         DW_OP_lit3 to DW_OP_lit2.
1755 2011-07-01  Alan Modra  <amodra@gmail.com>
1757         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't look at
1758         dyn relocs when called to copy flags for a weak sym.
1759         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
1760         (ppc64_elf_merge_private_bfd_data): Delete.
1761         (bfd_elf64_bfd_merge_private_bfd_data): Define as
1762         _bfd_generic_verify_endian_match.
1764 2011-06-30  Bernd Schmidt  <bernds@codesourcery.com>
1766         * bfd/elf32-tic6x.c (elf32_tic6x_set_osabi): Also set it if
1767         link_info is NULL.
1769 2011-06-28  Tristan Gingold  <gingold@adacore.com>
1771         * vms-alpha.c (vms_private_data_struct): Make vms_linkage_index
1772         unsigned int.
1773         (_bfd_vms_write_etir): Write linkage index from reloc.
1775 2011-06-28  Fawzi Mohamed <fawzi.mohamed@nokia.com>
1777         * mach-o.c (bfd_mach_o_read_command): Also ignore
1778         BFD_MACH_O_LC_ROUTINES_64.
1780 2011-06-27  Tristan Gingold  <gingold@adacore.com>
1782         * vms-alpha.c (_bfd_vms_write_etir): Use 'section' to get current
1783         section target index.
1785 2011-06-27  Nick Clifton  <nickc@redhat.com>
1787         * cisco-core.c (cisco_core_little_vec): Add initialization of
1788         match_priority field.
1790 2011-06-27  Tristan Gingold  <gingold@adacore.com>
1792         * cache.c: Include bfd_stdint.h.
1793         (cache_bmmap): Change profile.  Return region start and size.
1794         * bfdio.c (struct bfd_iovec): Change bmmap profile.
1795         (bfd_mmap): Change profile and adjust.   Update comment.
1796         (memory_bmmap): Change profile.
1797         * opncls.c (opncls_bmmap): Change profile.
1798         * vms-lib.c (vms_lib_bmmap): Likewise.
1799         * libbfd.h: Regenerate.
1800         * bfd-in2.h: Regenerate.
1802 2011-06-27  Tristan Gingold  <gingold@adacore.com>
1804         * vms-misc.c (vms_time_to_time_t): Adjust overflow detection.
1805         Add comment.
1807 2011-06-25  H.J. Lu  <hongjiu.lu@intel.com>
1809         * elf64-x86-64.c (elf_backend_post_process_headers): Don't
1810         define for FreeBSD/x86-64 nor FreeBSD/L1OM.  Define for L1OM.
1812 2011-06-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
1814         * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Initialize
1815         PLT_EH_FRAME.
1816         * elf32-i386.c (elf_i386_link_hash_table): Likewise.
1818 2011-06-24  Richard Henderson  <rth@redhat.com>
1820         PR ld/12928
1821         * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Recover the
1822         tlsgd insn before swapping adjacent insns.
1824 2011-06-24  Tristan Gingold  <gingold@adacore.com>
1826         * vms-alpha.c (alpha_vms_slurp_relocs): Add a guard for relocs in the
1827         absolute section.
1829 2011-06-24  Alan Modra  <amodra@gmail.com>
1831         PR ld/12921
1832         * elf.c (assign_file_positions_for_load_sections): Don't align
1833         sh_offset for all SHT_NOBITS sections here, just .tbss sections
1834         that don't get a PT_LOAD.
1836 2011-06-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1838         * elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE.
1839         (sh_elf_check_relocs): Likewise.
1841 2011-06-22  Richard Henderson  <rth@redhat.com>
1843         * elf64-alpha.c (elf64_alpha_check_relocs): No dynamic reloc for
1844         TPREL in a PIE image.
1845         (alpha_dynamic_entries_for_reloc): Likewise.
1846         (elf64_alpha_relocate_section): Allow TPREL in PIE images.
1847         (elf64_alpha_relax_got_load): Likewise.
1849 2011-06-22  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
1851         * elf32-arm.c (elf32_arm_final_link_relocate): Allow R_ARM_TLS_LE32
1852         for PIE.
1854 2011-06-22  Alan Modra  <amodra@gmail.com>
1856         * elflink.c (_bfd_elf_merge_symbol): Allow type changes for
1857         plugin symbols.  Fix segfault on linker scrip defined syms.
1859 2011-06-20  Jakub Jelinek  <jakub@redhat.com>
1861         PR ld/12570
1862         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Allow no relocations
1863         at all for linker created .eh_frame sections.
1864         (_bfd_elf_discard_section_eh_frame): Handle linker created
1865         .eh_frame sections with no relocations.
1866         * elf64-x86-64.c: Include dwarf2.h.
1867         (elf_x86_64_eh_frame_plt): New variable.
1868         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
1869         PLT_FDE_LEN_OFFSET): Define.
1870         (struct elf_x86_64_link_hash_table): Add plt_eh_frame field.
1871         (elf_x86_64_create_dynamic_sections): Create and fill in
1872         .eh_frame section for .plt section.
1873         (elf_x86_64_size_dynamic_sections): Write .plt section size
1874         into .eh_frame FDE covering .plt section.
1875         (elf_x86_64_finish_dynamic_sections): Write .plt section
1876         start into .eh_frame FDE covering .plt section.  Call
1877         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
1878         (elf_backend_plt_alignment): Define to 4.
1879         * elf32-i386.c: Include dwarf2.h.
1880         (elf_i386_eh_frame_plt): New variable.
1881         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
1882         PLT_FDE_LEN_OFFSET): Define.
1883         (struct elf_i386_link_hash_table): Add plt_eh_frame field.
1884         (elf_i386_create_dynamic_sections): Create and fill in
1885         .eh_frame section for .plt section.
1886         (elf_i386_size_dynamic_sections): Write .plt section size
1887         into .eh_frame FDE covering .plt section.
1888         (elf_i386_finish_dynamic_sections): Write .plt section
1889         start into .eh_frame FDE covering .plt section.  Call
1890         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
1891         (elf_backend_plt_alignment): Define to 4.
1893 2011-06-19  H.J. Lu  <hongjiu.lu@intel.com>
1895         * elf64-x86-64.c (elf_backend_post_process_headers): Defined
1896         for x32.
1898 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
1900         * elf64-x86-64.c: Include <stdarg.h> and CORE_HEADER if
1901         CORE_HEADER is defined.
1902         (elf_x86_64_write_core_note): New.
1903         (elf_backend_write_core_note): Likewise.
1905         * hosts/x86-64linux.h (uint64_t): New.
1906         (user_regsx32_struct): Likewise.
1907         (elf_gregx32_t): Likewise.
1908         (ELF_NGREGX32): Likewise.
1909         (elf_gregsetx32_t): Likewise.
1910         (elf_prstatusx32): Likewise.
1911         (prstatusx32_t): Likewise.
1912         (user_fpregs32_struct): Removed.
1913         (user_fpxregs32_struct): Likewise.
1914         (user32): Likewise.
1915         (elf_fpregset32_t): Likewise.
1916         (elf_fpxregset32_t): Likewise.
1917         (prgregset32_t): Likewise.
1918         (prfpregset32_t): Likewise.
1920 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
1922         * elf64-x86-64.c (elf_x86_64_grok_prstatus): Support x32.
1923         (elf_x86_64_grok_psinfo): Likewise.
1925 2011-06-16  Nick Clifton  <nickc@redhat.com>
1927         * elf.c (elf_find_function): Fail if not provided with a symbol
1928         table.
1930 2011-06-15  Ulrich Weigand  <ulrich.weigand@linaro.org>
1932         * elf-bfd.h (elfcore_write_arm_vfp): Add prototype.
1933         * elf.c (elfcore_grok_arm_vfp): New function.
1934         (elfcore_grok_note): Call it to handle NT_ARM_VFP notes.
1935         (elfcore_write_arm_vfp): New function.
1936         (elfcore_write_register_note): Call it to handle .reg-arm-vfp.
1938 2011-06-14  Richard Henderson  <rth@redhat.com>
1940         * elf64-alpha.c (elf64_alpha_copy_indirect_symbol): Rename from
1941         elf64_alpha_merge_ind_symbols; adjust for the generic interface.
1942         (elf64_alpha_always_size_sections): Don't call
1943         elf64_alpha_merge_ind_symbols.
1944         (elf_backend_copy_indirect_symbol): New.
1946 2011-06-14  Alan Modra  <amodra@gmail.com>
1948         PR ld/12887
1949         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Check sec_info_type
1950         before doing anything.
1951         (_bfd_elf_discard_section_eh_frame): Likewise.
1953 2011-06-14  Alan Modra  <amodra@gmail.com>
1955         * Makefile.am: Formatting.
1956         * Makefile.in: Regenerate.
1957         * configure.in (bfd_elf64_tilegx_vec): Add elfxx-tilegx.lo.
1958         * po/SRC-POTFILES.in: Regnerate.
1960 2011-06-14  Alan Modra  <amodra@gmail.com>
1962         * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Don't use PTR.
1963         (allocate_dynrelocs, readonly_dynrelocs): Replace PTR with void *.
1964         Don't handle warning symbols here.
1965         * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): As above.
1966         (allocate_dynrelocs, readonly_dynrelocs): As above.
1968 2011-06-14  Alan Modra  <amodra@gmail.com>
1970         PR ld/12851
1971         * elflink.c (_bfd_elf_gc_mark_extra_sections): New function.
1972         (elf_gc_sweep): Don't treat debug and sections like .comment
1973         specially here.
1974         (bfd_elf_gc_sections): Treat note sections as gc roots only when
1975         not part of a group.  Always call gc_mark_extra_sections.
1976         * elf-bfd.h (_bfd_elf_gc_mark_extra_sections): Declare.
1977         * elfxx-target.h (elf_backend_gc_mark_extra_sections): Default to
1978         _bfd_elf_gc_mark_extra_sections.
1979         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Call
1980         _bfd_elf_gc_mark_extra_sections.
1981         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): Likewise.
1983 2011-06-13  Nick Clifton  <nickc@redhat.com>
1985         * elf32-tilepro.c (tilepro_elf_check_relocs): Delete unused local
1986         variable 'local_got_offsets'.
1987         * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1988         (tilegx_finish_dyn): Delete unused local variable 'abi_64_p'.
1990 2011-06-13  Walter Lee  <walt@tilera.com>
1992         * Makefile.am (ALL_MACHINES): Add cpu-tilegx.lo and cpu-tilepro.lo.
1993         (ALL_MACHINE_CFILES): Add cpu-tilegx.c and cpu-tilepro.c.
1994         (BFD32_BACKENDS): Add elf32-tilegx.lo, elf32-tilepro.lo,
1995         and elfxx-tilegx.lo.
1996         (BFD32_BACKENDS_CFILES): Add elf32-tilegx.c elf32-tilepro.c, and
1997         elfxx-tilegx.c.
1998         (BFD64_BACKENDS): Add elf64-tilegx.lo.
1999         (BFD64_BACKENDS_CFILES): Add elf64-tilegx.c.
2000         * Makefile.in: Regenerate.
2001         * arctures.c (bfd_architecture): Define bfd_arch_tilepro,
2002         bfd_arch_tilegx, bfd_mach_tilepro, bfd_mach_tilegx.
2003         (bfd_arch_info): Add bfd_tilegx_arch, bfd_tilepro_arch.
2004         (bfd_archures_list): Add bfd_tilegx_arch, bfd_tilepro_arch.
2005         bfd-in2.h: Regenerate.
2006         * config.bfd: Handle tilegx-*-* and tilepro-*-*.
2007         * configure.in: Handle bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
2008         and bfd_elf64_tilegx_vec.
2009         * configure: Regenerate.
2010         * elf-bfd.h (enum elf_target_id): Define TILEGX_ELF_DATA and
2011         TILEPRO_ELF_DATA.
2012         * libbfd.h: Regenerate.
2013         * reloc.c: Add BFD_RELOC_TILEPRO_{COPY, GLOB_DAT, JMP_SLOT,
2014         RELATIVE, BROFF_X1, JOFFLONG_X1, JOFFLONG_X1_PLT, IMM8_X0,
2015         IMM8_Y0, IMM8_X1, IMM8_Y1, DEST_IMM8_X1, MT_IMM15_X1, MF_IMM15_X1,
2016         IMM16_X0, IMM16_X1, IMM16_X0_LO, IMM16_X1_LO, IMM16_X0_HI,
2017         IMM16_X1_HI, IMM16_X0_HA, IMM16_X1_HA, IMM16_X0_PCREL,
2018         IMM16_X1_PCREL, IMM16_X0_LO_PCREL, IMM16_X1_LO_PCREL,
2019         IMM16_X0_HI_PCREL, IMM16_X1_HI_PCREL, IMM16_X0_HA_PCREL,
2020         IMM16_X1_HA_PCREL, IMM16_X0_GOT, IMM16_X1_GOT, IMM16_X0_GOT_LO,
2021         IMM16_X1_GOT_LO, IMM16_X0_GOT_HI, IMM16_X1_GOT_HI,
2022         IMM16_X0_GOT_HA, IMM16_X1_GOT_HA, MMSTART_X0, MMEND_X0,
2023         MMSTART_X1, MMEND_X1, SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1,
2024         IMM16_X0_TLS_GD, IMM16_X1_TLS_GD, IMM16_X0_TLS_GD_LO,
2025         IMM16_X1_TLS_GD_LO, IMM16_X0_TLS_GD_HI, IMM16_X1_TLS_GD_HI,
2026         IMM16_X0_TLS_GD_HA, IMM16_X1_TLS_GD_HA, IMM16_X0_TLS_IE,
2027         IMM16_X1_TLS_IE, IMM16_X0_TLS_IE_LO, IMM16_X1_TLS_IE_LO,
2028         IMM16_X0_TLS_IE_HI, IMM16_X1_TLS_IE_HI, IMM16_X0_TLS_IE_HA,
2029         IMM16_X1_TLS_IE_HA, TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
2030         Add BFD_RELOC_TILEGX_{HW0, HW1, HW2, HW3, HW0_LAST, HW1_LAST,
2031         HW2_LAST, COPY, GLOB_DAT, JMP_SLOT, RELATIVE, BROFF_X1,
2032         JUMPOFF_X1, JUMPOFF_X1_PLT, IMM8_X0, IMM8_Y0, IMM8_X1, IMM8_Y1,
2033         DEST_IMM8_X1, MT_IMM14_X1, MF_IMM14_X1, MMSTART_X0, MMEND_X0,
2034         SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1, IMM16_X0_HW0,
2035         IMM16_X1_HW0, IMM16_X0_HW1, IMM16_X1_HW1, IMM16_X0_HW2,
2036         IMM16_X1_HW2, IMM16_X0_HW3, IMM16_X1_HW3, IMM16_X0_HW0_LAST,
2037         IMM16_X1_HW0_LAST, IMM16_X0_HW1_LAST, IMM16_X1_HW1_LAST,
2038         IMM16_X0_HW2_LAST, IMM16_X1_HW2_LAST, IMM16_X0_HW0_PCREL,
2039         IMM16_X1_HW0_PCREL, IMM16_X0_HW1_PCREL, IMM16_X1_HW1_PCREL,
2040         IMM16_X0_HW2_PCREL, IMM16_X1_HW2_PCREL, IMM16_X0_HW3_PCREL,
2041         IMM16_X1_HW3_PCREL, IMM16_X0_HW0_LAST_PCREL,
2042         IMM16_X1_HW0_LAST_PCREL, IMM16_X0_HW1_LAST_PCREL,
2043         IMM16_X1_HW1_LAST_PCREL, IMM16_X0_HW2_LAST_PCREL,
2044         IMM16_X1_HW2_LAST_PCREL, IMM16_X0_HW0_GOT, IMM16_X1_HW0_GOT,
2045         IMM16_X0_HW1_GOT, IMM16_X1_HW1_GOT, IMM16_X0_HW2_GOT,
2046         IMM16_X1_HW2_GOT, IMM16_X0_HW3_GOT, IMM16_X1_HW3_GOT,
2047         IMM16_X0_HW0_LAST_GOT, IMM16_X1_HW0_LAST_GOT,
2048         IMM16_X0_HW1_LAST_GOT, IMM16_X1_HW1_LAST_GOT,
2049         IMM16_X0_HW2_LAST_GOT, IMM16_X1_HW2_LAST_GOT, IMM16_X0_HW0_TLS_GD,
2050         IMM16_X1_HW0_TLS_GD, IMM16_X0_HW1_TLS_GD, IMM16_X1_HW1_TLS_GD,
2051         IMM16_X0_HW2_TLS_GD, IMM16_X1_HW2_TLS_GD, IMM16_X0_HW3_TLS_GD,
2052         IMM16_X1_HW3_TLS_GD, IMM16_X0_HW0_LAST_TLS_GD,
2053         IMM16_X1_HW0_LAST_TLS_GD, IMM16_X0_HW1_LAST_TLS_GD,
2054         IMM16_X1_HW1_LAST_TLS_GD, IMM16_X0_HW2_LAST_TLS_GD,
2055         IMM16_X1_HW2_LAST_TLS_GD, IMM16_X0_HW0_TLS_IE,
2056         IMM16_X1_HW0_TLS_IE, IMM16_X0_HW1_TLS_IE, IMM16_X1_HW1_TLS_IE,
2057         IMM16_X0_HW2_TLS_IE, IMM16_X1_HW2_TLS_IE, IMM16_X0_HW3_TLS_IE,
2058         IMM16_X1_HW3_TLS_IE, IMM16_X0_HW0_LAST_TLS_IE,
2059         IMM16_X1_HW0_LAST_TLS_IE, IMM16_X0_HW1_LAST_TLS_IE,
2060         IMM16_X1_HW1_LAST_TLS_IE, IMM16_X0_HW2_LAST_TLS_IE,
2061         IMM16_X1_HW2_LAST_TLS_IE, TLS_DTPMOD64, TLS_DTPOFF64, TLS_TPOFF64,
2062         TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
2063         * targets.c (bfd_elf32_tilegx_vec): Declare.
2064         (bfd_elf32_tilepro_vec): Declare.
2065         (bfd_elf64_tilegx_vec): Declare.
2066         (bfd_target_vector): Add bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
2067         and bfd_elf64_tilegx_vec.
2068         * cpu-tilegx.c: New file.
2069         * cpu-tilepro.c: New file.
2070         * elf32-tilepro.h: New file.
2071         * elf32-tilepro.c: New file.
2072         * elf32-tilegx.c: New file.
2073         * elf32-tilegx.h: New file.
2074         * elf64-tilegx.c: New file.
2075         * elf64-tilegx.h: New file.
2076         * elfxx-tilegx.c: New file.
2077         * elfxx-tilegx.h: New file.
2079 2011-06-13  Alan Modra  <amodra@gmail.com>
2081         * linker.c (bfd_link_hash_traverse): Follow warning symbol link.
2082         (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle
2083         warning symbols here.
2084         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
2085         * elf32-arm.c (allocate_dynrelocs_for_symbol,
2086         elf32_arm_readonly_dynrelocs): Likewise.
2087         * elf32-bfin.c (bfin_discard_copies): Likewise.
2088         * elf32-cris.c (elf_cris_adjust_gotplt_to_got,
2089         elf_cris_discard_excess_dso_dynamics,
2090         elf_cris_discard_excess_program_dynamics): Likewise.
2091         * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs,
2092         clobber_millicode_symbols, readonly_dynrelocs): Likewise.
2093         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
2094         * elf32-i386.c (elf_i386_allocate_dynrelocs,
2095         elf_i386_readonly_dynrelocs): Likewise.
2096         * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
2097         * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise.
2098         * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
2099         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
2100         * elf32-microblaze.c (allocate_dynrelocs): Likewise.
2101         * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise.
2102         * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
2103         * elf32-score.c (score_elf_sort_hash_table_f): Likewise.
2104         * elf32-score7.c (score_elf_sort_hash_table_f): Likewise.
2105         * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
2106         * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs,
2107         elf32_tic6x_readonly_dynrelocs): Likewise.
2108         * elf32-vax.c (elf_vax_discard_copies): Likewise.
2109         * elf32-xstormy16.c (xstormy16_relax_plt_check,
2110         xstormy16_relax_plt_realloc): Likewise.
2111         * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise.
2112         * elf64-alpha.c (elf64_alpha_output_extsym,
2113         elf64_alpha_calc_got_offsets_for_symbol,
2114         elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise.
2115         * elf64-hppa.c (elf64_hppa_mark_exported_functions,
2116         allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions,
2117         elf_hppa_unmark_useless_dynamic_symbols,
2118         elf_hppa_remark_useless_dynamic_symbols): Likewise.
2119         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust,
2120         adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs,
2121         readonly_dynrelocs, merge_global_got, reallocate_got,
2122         undo_symbol_twiddle): Likewise.
2123         * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
2124         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
2125         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs,
2126         elf_x86_64_readonly_dynrelocs): Likewise.
2127         * elflink.c (elf_link_renumber_hash_table_dynsyms,
2128         elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol,
2129         _bfd_elf_link_find_version_dependencies,
2130         _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol,
2131         _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets,
2132         elf_collect_hash_codes, elf_collect_gnu_hash_codes,
2133         elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol,
2134         elf_gc_propagate_vtable_entries_used,
2135         elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol,
2136         elf_gc_allocate_got_offsets): Likewise.
2137         * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free,
2138         elfNN_ia64_global_dyn_sym_thunk): Likewise.
2139         * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym,
2140         mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise.
2141         * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
2142         * i386linux.c (linux_tally_symbols): Likewise.
2143         * m68klinux.c (linux_tally_symbols): Likewise.
2144         * sparclinux.c (linux_tally_symbols): Likewise.
2145         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
2146         * xcofflink.c (xcoff_post_gc_symbol): Likewise.
2148         * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse
2149         function.  Update all callers.
2150         * aoutx.h (aout_link_write_other_symbol): Likewise.
2151         * pdp11.c (aout_link_write_other_symbol): Likewise.
2152         * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2153         * ecoff.c (ecoff_link_write_external): Likewise.
2154         * xcofflink.c (xcoff_write_global_symbol): Likewise.
2155         * vms-alpha.c (alpha_vms_link_output_symbol): Likewise.  Handle
2156         warning symbols.
2157         * ecoff.c (ecoff_link_hash_traverse): Delete.
2158         * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for
2159         _bfd_coff_write_global_sym.
2160         * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype.
2161         * libcoff.h: Regenerate.
2163 2011-06-10  Nick Clifton  <nickc@redhat.com>
2165         * elflink.c (_bfd_elf_link_create_dynamic_sections): If the
2166         backend does not provide a function for creating dynamic sections
2167         then fail.
2168         (bfd_elf_final_link): Issue a warning message if a dynamic section
2169         has the SHT_NOTE type.
2170         (bfd_elf_final_link): Do not look for dynamic strings in a section
2171         that does not have the SHT_STRTAB type or the name .dynstr.
2172         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Fail if the got
2173         section is not in the output binary.
2174         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Likewise.
2176 2011-06-09  Tristan Gingold  <gingold@adacore.com>
2178         * elfnn-ia64.c (elfNN_ia64_relax_section, elfNN_ia64_choose_gp)
2179         (elfNN_ia64_relocate_section, elfNN_vms_object_p): Remove trailing
2180         spaces.
2182 2011-06-09  Tristan Gingold  <gingold@adacore.com>
2184         * bfd.c (bfd_get_sign_extend_vma): Handle aixcoff.
2186 2011-06-09  Nick Clifton  <nickc@redhat.com>
2188         PR ld/12845
2189         * elf.c (_bfd_elf_init_private_section_data): Add an assertion
2190         that the output section has an allocated bfd_elf_section_data
2191         structure.
2192         * elfxx-mips.c (mips_elf_check_symbols): Do not create a stub for
2193         symbols in sections that have been removed by garbage collection.
2195 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
2197         * elf64-x86-64.c (elf_x86_64_check_relocs): Allow R_X86_64_64
2198         relocations in SEC_DEBUGGING sections when building shared
2199         libraries.
2201 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
2203         PR ld/12851
2204         * elflink.c (elf_gc_sweep): Don't check SHT_NOTE sections here.
2205         (bfd_elf_gc_sections): Also check SHT_NOTE sections.
2207 2011-06-08  Tristan Gingold  <gingold@adacore.com>
2209         * makefile.vms (OBJS): Add elfxx-ia64.obj
2210         Remove vax case.
2212 2011-06-08  Alan Modra  <amodra@gmail.com>
2214         * aix386-core.c, * cisco-core.c, * hpux-core.c, * osf-core.c,
2215         * sco5-core.c: Init match_priority field.
2217 2011-06-08  Alan Modra  <amodra@gmail.com>
2219         * elflink.c (_bfd_elf_archive_symbol_lookup): Follow warning and
2220         indirect links here.
2222 2011-06-07  Joel Brobecker  <brobecker@adacore.com>
2224         * irix-core.c (irix_core_vec): Add match_priority field.
2226 2011-06-06  Alan Modra  <amodra@gmail.com>
2228         * targets.c (bfd_target): Make ar_max_namelen an unsigned char.
2229         Add match_priority.
2230         * configure.in: Bump bfd version.
2231         * elfcode.h (elf_object_p): Delete hacks preventing match of
2232         EM_NONE and ELFOSABI_NONE targets when a better match exists.
2233         * elfxx-target.h (elf_match_priority): Define and use.
2234         * format.c (bfd_check_format_matches): Use target match_priority
2235         to choose best of multiple matching targets.  In cases with multiple
2236         matches rerun _bfd_check_format if we don't choose the last match.
2237         * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c,
2238         * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c,
2239         * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c,
2240         * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c,
2241         * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h,
2242         * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c,
2243         * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c,
2244         * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c,
2245         * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c,
2246         * vms-lib.c, * xsym.c: Init match_priority field.
2247         * configure: Regenerate.
2248         * bfd-in2.h: Regenerate.
2250 2011-06-04  H.J. Lu  <hongjiu.lu@intel.com>
2252         PR ld/12842
2253         * elfcode.h (elf_object_p): Revert the last change.
2255 2011-06-04  Alan Modra  <amodra@gmail.com>
2257         * archures.c (bfd_arch_get_compatible): If one arch is unknown,
2258         return the other arch.
2259         * elfcode.h (elf_object_p): Allow explicit match to generic ELF
2260         target.
2262 2011-06-03  Bertram Felgenhauer  <bertram.felgenhauer@gmail.com>
2264         PR ld/12682
2265         * hash.c (higher_primer_number): Add more, small, prime numbers.
2266         (bfd_hash_set_default_size): Likewise.
2268 2011-06-02  Nick Clifton  <nickc@redhat.com>
2270         * coff-mcore.c: Fix spelling typo.
2271         * coff-stgo32.c: Likewise.
2272         * elf32-arm.c: Likewise.
2273         * elf32-avr.c: Likewise.
2274         * elf-m68hc1x.c: Likewise.
2275         * elf32-mcore.c: Likewise.
2276         * elf32-mep.c: Likewise.
2277         * elf32-mt.c: Likewise.
2278         * elf32-ppc.c: Likewise.
2279         * elf32-xtensa.c: Likewise.
2280         * elf64-ppc.c: Likewise.
2281         * elfxx-mips.c: Likewise.
2282         * netbsd.h: Likewise.
2283         * nlmcode.h: Likewise.
2284         * vms-alpha.c: Likewise.
2285         * po/bfd.pot: Regenerate.
2286         * po/SRC-POTFILES.in: Regenerate.
2288 2011-06-01  DJ Delorie  <dj@redhat.com>
2290         * config.bfd: Add bfd_elf32_rx_be_ns_vec.
2291         * target.c: Likewise.
2292         * configure.in: Likewise.
2293         * configure.in: Regenerate.
2294         * elf32-rx.c: Add elf32-rx-be-ns target.
2295         (rx_elf_object_p): Never allow the be-ns target by default,
2296         only allow it if the user requests it.
2298 2011-06-01  H.J. Lu  <hongjiu.lu@intel.com>
2300         * elf32-i386.c (elf_i386_size_dynamic_sections): Properly warn
2301         relocation in readonly section in a shared object.
2302         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
2304 2011-05-31  Nick Clifton  <nickc@redhat.com>
2306         * archive.c (adjust_relative_path): Fix comment to prevent it
2307         corrupting the auto-generated bfd.h.
2309 2011-05-31  Paul Brook  <paul@codesourcery.com>
2311         * elf32-arm.c (elf32_arm_final_link_relocate): Only do bl conversion
2312         for known functions.
2313         (elf32_arm_swap_symbol_in): Only set ST_BRANCH_TO_ARM for function
2314         symbols.
2316 2011-05-31  Paul Brook  <paul@codesourcery.com>
2318         * elf32-arm.c (arm_stub_is_thumb): Add
2319         arm_stub_long_branch_v4t_thumb_tls_pic.
2320         (elf32_arm_final_link_relocate): TLS stubs are always ARM.
2321         Handle Thumb stubs.
2323 2011-05-27  Nick Clifton  <nickc@redhat.com>
2325         PR binutils/12710
2326         * archive.c (_bfd_get_elt_at_filepos): Set correct error value if
2327         unable to read a file pointed to by an entry in a thin archive.
2328         (adjust_relative_path): Use lrealpath to canonicalize paths.
2329         Handle the case where the reference path is above the current
2330         path in the directory tree.
2332 2011-05-26  H.J. Lu  <hongjiu.lu@intel.com>
2334         PR ld/12809
2335         * elf64-x86-64.c (elf_x86_64_relocate_section): Handle
2336         R_X86_64_TPOFF64 in executable.
2338 2011-05-26  Alan Modra  <amodra@gmail.com>
2340         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Remove most of comment.
2341         * elflink.c (_bfd_elf_symbol_refs_local_p): Expand
2342         local_protected comment.
2344 2011-05-25  Tristan Gingold  <gingold@adacore.com>
2346         * configure.in (bfd_elf32_ia64_big_vec, bfd_elf32_ia64_hpux_big_vec)
2347         (bfd_elf64_ia64_big_vec, bfd_elf64_ia64_hpux_big_vec)
2348         (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_vms_vec): Add elfxx-ia64.lo
2349         * Makefile.am (BFD64_BACKENDS): Add elfxx-ia64.lo
2350         (BFD64_BACKENDS_CFILES): Add elfxx-ia64.c
2351         (elf32-ia64.c): Created from elfnn-ia64.c
2352         (elf64-ia64.c): Likewise.
2353         * elfxx-ia64.h: New file.
2354         * elfxx-ia64.c: Split with elfnn-ia64.c.  Keep only the following
2355         functions.Includes elfxx-ia64.h.
2356         (elfNN_ia64_reloc): Renames to ia64_elf_reloc.  Adjust error message.
2357         (IA64_HOWTO): Adjust.
2358         (lookup_howto): Renames to ia64_elf_lookup_howto.  Make it public.
2359         (elfNN_ia64_reloc_type_lookup): Renames to
2360         ia64_elf_reloc_type_lookup. Make it public. Adjust calls.
2361         (elfNN_ia64_reloc_name_lookup): Renames to
2362         ia64_elf_reloc_name_lookup. Make it public.
2363         (elfNN_ia64_relax_br): Renames to ia64_elf_relax_br.  Make it public.
2364         (elfNN_ia64_relax_brl): Renames to ia64_elf_relax_brl. Make it
2365         public.
2366         (elfNN_ia64_relax_ldxmov): Renames to ia64_elf_relax_ldxmov.
2367         Move it and make it public.  Move prototype to elfxx-ia64.h
2368         (elfNN_ia64_install_value): Renames to ia64_elf_install_value.
2369         Move prototype to elfxx-ia64.h
2370         * elfnn-ia64.c: New file, split from elfxx-ia64.c.
2371         (elfNN_ia64_info_to_howto): Adjust calls.
2372         (elfNN_ia64_relax_section): Adjust calls.
2373         (count_dyn_reloc): Fix typo.
2374         (elfNN_ia64_relocate_section): Adjust calls.
2375         (elfNN_ia64_finish_dynamic_symbol): Likewise.
2376         (bfd_elfNN_bfd_reloc_type_lookup)
2377         (bfd_elfNN_bfd_reloc_name_lookup): Adjust macros.
2378         * configure: Regenerate.
2379         * Makefile.in: Regenerate.
2381 2011-05-23  DJ Delorie  <dj@redhat.com>
2383         * elf32-rx.c (rx_elf_object_p): When reading an RX object in, undo
2384         the vma/lma swapping done in elf32_rx_modify_program_headers.
2386 2011-05-23  Nick Clifton  <nickc@redhat.com>
2388         * elf-m10300.c (mn10300_elf_mkobject): New function.
2389         (bfd_elf32_mkobject): Define.
2391 2011-05-23  Alan Modra  <amodra@gmail.com>
2393         * elf-bfd.h: Comment typo fix.
2394         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Delete.  Replace with
2395         struct elf_dyn_relocs throughout.
2396         * elf64-ppc.c (struct ppc_dyn_relocs): Likewise.
2398 2011-05-23  Alan Modra  <amodra@gmail.com>
2400         * elf32-frv.c: Use info->callbacks->einfo throughout file in linker
2401         functions rather than warning callback or _bfd_error_handler.
2402         * elf32-ppc.c: Likewise.
2403         * elf64-ppc.c: Likewise.
2404         * elf32-ppc.c (ppc_elf_tls_optimize): Use %H in __tls_get_addr lost
2405         arg error.
2406         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
2408 2011-05-23  Alan Modra  <amodra@gmail.com>
2410         PR 12763
2411         * elf.c (assign_file_positions_for_load_sections): Set sh_offset for
2412         .tbss, and page align same for all SHT_NOBITS sections.
2414 2011-05-21  Alan Modra  <amodra@gmail.com>
2416         PR 12763
2417         * elf.c (_bfd_elf_make_section_from_shdr): Set up TLS section LMAs
2418         from PT_TLS header.
2419         (_bfd_elf_map_sections_to_segments): Don't create a final PT_LOAD
2420         segment if just for .tbss.
2421         (assign_file_positions_for_load_sections): Don't report "can't
2422         allocate in segment" errors for .tbss.
2423         (assign_file_positions_for_non_load_sections): Don't set p_filesz
2424         from SHT_NOBITS section filepos.
2426 2011-05-20  Bernd Schmidt  <bernds@codesourcery.com>
2428         * elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for
2429         R_C6000_PCR_H16 and R_C6000_PCR_L16.
2430         (elf32_tic6x_relocate_section): Handle them.
2432 2011-05-18  Nick Clifton  <nickc@redhat.com>
2434         PR ld/12761
2435         * elflink.c (elf_link_add_object_symbols): Process .gnu.warning
2436         sections when building shared libraries.
2438 2011-05-18  Rafał Krypa  <r.krypa@samsung.com>
2440         PR ld/12778
2441         * elf32-arm.c (elf32_arm_gc_sweep_hook): Use the computed dynamic
2442         reloc pointer.
2444 2011-05-18  Tristan Gingold  <gingold@adacore.com>
2446         * xcofflink.c (xcoff_link_add_symbols): Handle C_DWARF symbols.
2447         (xcoff_sweep): Always keep dwarf sections.
2448         (xcoff_link_input_bfd): Handle dwarf symbols and sections.
2450 2011-05-18  Tristan Gingold  <gingold@adacore.com>
2452         * libxcoff.h (struct xcoff_dwsect_name): New type.
2453         (XCOFF_DWSECT_NBR_NAMES): New macro.
2454         (xcoff_dwsect_names): Declare.
2455         * coffcode.h (sec_to_styp_flags): Handle xcoff dwarf sections.
2456         (styp_to_sec_flags): Ditto.
2457         (coff_new_section_hook): Ditto.
2458         (coff_slurp_symbol_table): Handle C_DWARF and C_INFO.
2459         * coff-rs6000.c (xcoff_dwsect_name): New variable.
2461 2011-05-17  Tomohiro Kashiwada  <kikairoya@gmail.com>
2463         PR ld/12759
2464         * elf32-rx.c (ignore_lma): New variable.
2465         (bfd_elf32_rx_set_target_flags): Add ignore_lma parameter.
2466         (rx_modify_program_headers): Only copy the LMA into the VMA if
2467         ignore_lma is true.
2469 2011-05-17  Alan Modra  <amodra@gmail.com>
2471         PR ld/12760
2472         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Adjust "notice" call.
2473         * elflink.c (elf_link_add_object_symbols): Likewise.
2474         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2476 2011-05-16  Alan Modra  <amodra@gmail.com>
2478         * linker.c (_bfd_generic_link_add_one_symbol): Don't init u.undef.weak.
2480 2011-05-15  Richard Sandiford  <rdsandiford@googlemail.com>
2482         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Record both local and
2483         global GOT entries for GOT_PAGE relocations against global symbols.
2485 2011-05-13  Bernd Schmidt  <bernds@codesourcery.com>
2487         * config.bfd (tic6x-*-elf, tic6x-*-uclinux): New.
2488         (tic6x-*-*): Replaced by these.
2489         * elf32-tic6x.c (elf32_tic6x_set_osabi): New static function.
2490         (elf32_tic6x_check_relocs): Create dynamic sections if -shared.
2491         (elf_backend_relocs_compatible, elf_backend_post_process_headers):
2492         Define.
2493         (elf32_bed, TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM,
2494         TARGET_BIG_NAME, ELF_OSABI): Redefine twice, and include
2495         "elf32-target.h" two more times.
2496         * configure.in: Handle bfd_elf32_tic6x_linux_be_vec,
2497         bfd_elf32_tic6x_linux_le_vec, bfd_elf32_tic6x_elf_be_vec and
2498         bfd_elf32_tic6x_elf_le_vec.
2499         * configure: Regenerate.
2501 2011-05-13  Jan Beulich  <jbeulich@novell.com>
2503         * config.bfd: Add targets x86_64-*-pe and x86_64-*-pep.
2505 2011-05-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
2507         * config.in: Regenerated.
2508         * configure: Regenerated.
2509         * configure.in: New tests for HAVE_PRPSINFO_T_PR_PID,
2510         HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and
2511         HAVE_PSINFO32_T_PR_PID.
2512         * elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by
2513         HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID
2514         and HAVE_PSINFO32_T_PR_PID.
2515         * hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition.
2517 2011-05-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
2519         * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and
2520         32bit psinfo.
2521         * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid.
2522         * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise.
2524 2011-05-09  Paul Brook  <paul@codesourcery.com>
2526         * bfd-in.h (elf32_tic6x_fix_exidx_coverage): Add prototype.
2527         * bfd-in2.h: Regenerate.
2528         * elf32-tic6x.c: Include limits.h.
2529         (tic6x_unwind_edit_type, tic6x_unwind_table_edit,
2530         _tic6x_elf_section_data): New.
2531         (elf32_tic6x_section_data): Define.
2532         (elf32_tic6x_new_section_hook): Allocate target specific data.
2533         (elf32_tic6x_add_unwind_table_edit): New function.
2534         (get_tic6x_elf_section_data, elf32_tic6x_adjust_exidx_size,
2535         elf32_tic6x_insert_cantunwind_after, elf32_tic6x_add_low31,
2536         elf32_tic6x_copy_exidx_entry): New functions.
2537         (elf_backend_write_section): Define.
2539 2011-05-09  Paul Brook  <paul@codesourcery.com>
2541         * elf32-tic6x.c (is_tic6x_elf_unwind_section_name,
2542         elf32_tic6x_fake_sections): New functions.
2543         (elf_backend_fake_sections): Define.
2545 2011-05-09  Paul Brook  <paul@codesourcery.com>
2547         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function.
2548         (elf_backend_gc_mark_extra_sections): Define.
2550 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
2552         PR ld/12365
2553         * cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
2554         references to symbols defined in discarded sections.
2556 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
2558         PR ld/12365
2559         * coffgen.c (coff_write_symbol): Assume input section is its own
2560         output section if output_section member not set.
2561         (coff_write_alien_symbol): Likewise.
2563 2011-05-07  H.J. Lu  <hongjiu.lu@intel.com>
2565         PR ld/12730
2566         * elf.c (_bfd_elf_section_offset): Check SEC_ELF_REVERSE_COPY.
2568         * elflink.c (elf_link_input_bfd): Reverse copy .ctors/.dtors
2569         sections if needed.
2571         * section.c (SEC_ELF_REVERSE_COPY): New.
2572         * bfd-in2.h: Regenerated.
2574 2011-05-07  Anders Kaseorg  <andersk@ksplice.com>
2576         PR 12739
2577         * libbfd.c (bfd_get_8, bfd_get_signed_8): Use const cast.
2578         * bfd-in2.h: Regenerate.
2580 2011-05-06  Tristan Gingold  <gingold@adacore.com>
2582         * vms-alpha.c (evax_section_flags): Remove SEC_IN_MEMORY.
2583         (_bfd_vms_slurp_egsd): Rename old_flags to vms_flags.  Handle
2584         any code section.  Add comments.
2585         (alpha_vms_object_p): Use void * instead of PTR.
2586         (alpha_vms_create_eisd_for_section): Fix test for setting DZRO.
2587         (build_module_list): Guard against no DST section.  Add comments.
2588         (alpha_vms_link_output_symbol): Discard undefined symbols.
2589         (alpha_vms_get_section_contents): Simply memcpy if the section was
2590         already loaded.  Fix typo.
2591         (vms_new_section_hook): Use void * instead of PTR.
2592         (vms_alpha_vec): Ditto.
2594 2011-05-06  Richard Sandiford  <richard.sandiford@linaro.org>
2596         * elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb
2597         branch to a PLT entry, redirect it to the PLT's Thumb entry point.
2599 2011-05-05  Bernd Schmidt  <bernds@codesourcery.com>
2601         * elf32-tic6x.c (elf32_tic6x_final_link): New function.
2602         (elf32_tic6x_merge_attributes): Do not warn for PID or PIC
2603         mismatch.  Choose the lower of the two values.
2604         (bfd_elf32_bfd_final_link): New macro.
2606 2011-04-28  Tristan Gingold  <gingold@adacore.com>
2608         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust for x_file.
2609         (bfd_xcoff_swap_aux_out): Ditto.
2610         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Ditto.
2611         (bfd_xcoff64_swap_aux_out): Ditto.
2613 2011-05-04  Alan Modra  <amodra@gmail.com>
2615         PR ld/12727
2616         * elf64-ppc.c (ppc_build_one_stub <ppc_sub_plt_call>): Clear
2617         was_undefined on dot-symbols.
2619 2011-05-03  Paul Brook  <paul@codesourcery.com>
2622         * elf32-tic6x.c (elf32_tic6x_howto_table,
2623         elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook,
2624         elf32_tic6x_relocate_section, elf32_tic6x_check_relocs):
2625         Add R_C6000_EHTYPE.
2627 2011-05-01  Alan Modra  <amodra@gmail.com>
2629         PR ld/12718
2630         * elf32-i386.c (elf_i386_check_relocs): Ensure dynobj set before
2631         creating ifunc sections.
2632         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2634 2011-04-30  H.J. Lu  <hongjiu.lu@intel.com>
2636         * elf64-x86-64.c (elf_x86_64_merge_symbol): Correct parameter
2637         names.
2639 2011-04-28  Tom Tromey  <tromey@redhat.com>
2641         * bfdio.c (memory_bstat): Pass correct size to memset.
2643 2011-04-28  Mike Frysinger  <vapier@gentoo.org>
2645         * dwarf2.c (dwarf_debug_sections): Mark const.
2646         * elf.c (special_sections): Likewise.
2647         * libbfd-in.h (dwarf_debug_sections): Likewise.
2648         * libbfd.h: Regenerate.
2650 2011-04-26  Kai Tietz  <ktietz@redhat.com>
2652         * coffcode.h (sec_to_styp_flags): Allow linkonce for
2653         debugging sections.
2655 2011-04-26  Tristan Gingold  <gingold@adacore.com>
2657         * coff64-rs6000.c: Convert to ISO-C.  Remove PARAMS and PTR macros.
2659 2011-04-24  Alan Modra  <amodra@gmail.com>
2661         PR ld/12365
2662         PR ld/12696
2663         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call.
2664         * linker.c (_bfd_link_hash_newfunc): Clear bitfields.
2665         (_bfd_generic_link_add_one_symbol): Update "notice" call.
2666         * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when
2667         it is a redef of an IR symbol in a real BFD.
2669 2011-04-22  H.J. Lu  <hongjiu.lu@intel.com>
2671         * elf32-i386.c (elf_i386_readonly_dynrelocs): Warn relocation
2672         in readonly section in a shared object.
2673         (elf_i386_size_dynamic_sections): Likewise.
2674         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
2675         (elf_x86_64_size_dynamic_sections): Likewise.
2677 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2679         PR ld/12694
2680         * elf32-i386.c (elf_i386_readonly_dynrelocs): Skip local IFUNC
2681         symbols.
2682         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
2684 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2686         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Return false
2687         on dynamic symbol error.
2688         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2690 2011-04-20  Tristan Gingold  <gingold@adacore.com>
2692         * config.bfd (alpha*-*-*vms*, ia64*-*-*vms*): Define targ_selvecs.
2694 2011-04-20  Alan Modra  <amodra@gmail.com>
2696         * hash.c (bfd_default_hash_table_size): Make it an unsigned long.
2697         (bfd_hash_table_init_n): Overflow checking.
2698         (bfd_hash_set_default_size): Return current size.  Take unsigned long
2699         arg.  Add 65537 to hash_size primes.
2700         * bfd-in.h (bfd_hash_set_default_size): Update prototype.
2701         * bfd-in2.h: Regenerate.
2703 2011-04-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
2705         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Fix +1 overrun of
2706         memmove elements.
2708 2011-04-20  Alan Modra  <amodra@gmail.com>
2710         * libbfd.c (bfd_log2): Do return rounded up value.
2711         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Replace bfd_log2
2712         call with expanded old round down version of the function.
2714         * archive.c (_bfd_get_elt_at_filepos): Don't release n_nfd.
2715         * elflink.c (elf_link_add_object_symbols): Delete redundant code.
2717 2011-04-20  Alan Modra  <amodra@gmail.com>
2719         PR ld/12365
2720         * elfcode.h (elf_slurp_symbol_table): Put common plugin IR symbols
2721         in their own common section.
2722         * elflink.c (elf_link_add_object_symbols): Likewise.
2723         * linker.c (generic_link_check_archive_element): Don't lose flags
2724         if common section is pre-existing.
2725         (_bfd_generic_link_add_one_symbol): Likewise.
2727 2011-04-20  Alan Modra  <amodra@gmail.com>
2729         PR ld/12365
2730         * elflink.c (_bfd_elf_merge_symbol): Update multiple_common calls.
2731         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.  Call
2732         multiple_definition regardless of allow_multiple_definition.
2733         * simple.c (simple_dummy_multiple_definition): Update.
2734         * xcofflink.c (xcoff_link_add_symbols): Update multiple_definition
2735         calls.
2737 2011-04-18  Tristan Gingold  <gingold@adacore.com>
2739         * coff-rs6000.c: Convert to ISO-C.  Remove PARAMS macro.
2741 2011-04-18  Alan Modra  <amodra@gmail.com>
2743         PR ld/12365
2744         PR ld/12672
2745         * bfd.c (BFD_PLUGIN): Define.
2746         (BFD_FLAGS_SAVED, BFD_FLAGS_FOR_BFD_USE_MASK): Add BFD_PLUGIN.
2747         * bfd-in2.h: Regenerate.
2748         * elflink.c (elf_link_output_extsym): Strip undefined plugin syms.
2749         * opncls.c (bfd_make_readable): Don't lose original bfd flags.
2751 2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
2753         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Do not check for
2754         SEC_LOAD.
2756 2011-04-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2758         * elf-bfd.h (struct sdt_note): New struct.
2759         (struct elf_obj_tdata) <sdt_note_head>: New field.
2760         * elf.c (elfobj_grok_stapsdt_note_1): New function.
2761         (elfobj_grok_stapsdt_note): Likewise.
2762         (elf_parse_notes): Added code to treat SystemTap note
2763         sections.
2765 2011-04-12  Richard Henderson  <rth@redhat.com>
2767         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Do not
2768         exclude empty .got sections.
2770 2011-04-11  H.J. Lu  <hongjiu.lu@intel.com>
2772         * elf32-i386.c (elf_i386_reloc_type_lookup): Fix the out of bound
2773         array access for BFD_RELOC_386_IRELATIVE.
2775 2011-04-11  Bernd Schmidt  <bernds@codesourcery.com>
2777         * elf32-tic6x.c (elf32_tic6x_check_relocs): Initialize pc_count field.
2779 2011-04-11  Mark Wielaard  <mjw@redhat.com>
2781         PR 10549
2782         * elf-bfd.h (has_ifunc_symbols): Renamed to has_gnu_symbols.
2783         (has_gnu_symbols): Renamed from has_ifunc_symbols.
2784         * elf.c (_bfd_elf_set_osabi): Use new has_gnu_symbols name.
2785         * elf32-arm.c (elf32_arm_add_symbol_hook): Set has_gnu_symbols
2786         also if STB_GNU_UNIQUE symbol binding was seen.
2787         * elf32-i386.c (elf_i386_add_symbol_hook): Likewise.
2788         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
2789         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
2790         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
2791         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
2792         * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
2794 2011-04-11  Alan Modra  <amodra@gmail.com>
2796         * bfd-in.h (bfd_get_section_limit): Don't use rawsize with output
2797         sections.
2798         * libbfd.c (_bfd_generic_get_section_contents): Likewise.
2799         (_bfd_generic_get_section_contents_in_window): Likewise.
2800         * section.c (bfd_get_section_contents): Likewise.
2801         * compress.c (bfd_get_full_section_contents): Likewise.
2802         * elf32-rx.c (rx_final_link): Ignore rawsize.
2803         * elf32-microblaze.c (microblaze_elf_relocate_section): Use correct
2804         bfd with bfd_get_section_limit.
2805         * elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter.  Use
2806         os->size during final link.  Update callers.
2807         * bfd-in2.h: Regenerate.
2809 2011-04-10  Richard Sandiford  <rdsandiford@googlemail.com>
2811         PR ld/12637
2812         * elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count
2813         as the number of global entries when merging with the primary GOT.
2815 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2817         * elf32-i386.c: Update copyright year.
2818         * elf64-x86-64.c: Likewise.
2820 2011-04-09  Kai Tietz  <ktietz@redhat.com>
2822         * peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary
2823         buffer and use rawsize for sorting.
2824         * coffcode.h (coff_compute_section_file_positions): Set rawsize
2825         before doing alignment.
2827 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2829         * elf32-i386.c (elf_i386_relocate_section): Return relocation
2830         error on unsupported relocation.
2831         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2833 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2835         PR binutils/12657
2836         * hosts/x86-64linux.h (elf_prstatus32): Replace __pid_t with
2837         pid_t.
2839 2011-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2841         PR ld/12654
2842         * elf32-i386.c (elf_i386_relocate_section): Check !executable
2843         instead of shared for R_386_TLS_LDO_32.
2845 2011-04-08  Tristan Gingold  <gingold@adacore.com>
2847         * Makefile.am (SOURCE_HFILES): Remove xcoff-target.h
2848         * coff-pmac: Remove
2849         * xcoff-target.h: Remove
2850         * Makefile.in: Regenerate.
2852 2011-04-07  Cary Coutant  <ccoutant@google.com>
2854         * dwarf2.c (scan_unit_for_symbols): Check for DW_AT_specification.
2856 2011-04-07  Paul Brook  <paul@codesourcery.com>
2858         * elf32-tic6x.c (elf32_tic6x_howto_table): R_C6000_PREL31 is
2859         pc-relative.
2860         (elf32_tic6x_howto_table_rel): Ditto.
2861         (elf32_tic6x_relocate_section): Implement R_C6000_PREL31.
2862         (elf32_tic6x_check_relocs): Ditto.
2864 2011-04-06  Joseph Myers  <joseph@codesourcery.com>
2866         * config.bfd (thumb-*-oabi): Don't handle in list of obsolete
2867         targets.
2868         (strongarm*, thumb*, xscale*): Remove architectures.
2869         (strongarm-*-kaos*, thumb-*-coff, thumb-*-elf, thumb-epoc-pe*,
2870         thumb-*-pe*, strongarm-*-elf, strongarm-*-coff, xscale-*-elf,
2871         xscale-*-coff): Remove targets.
2873 2011-04-01  Tristan Gingold  <gingold@adacore.com>
2875         * elfxx-ia64.c: include bfd_stdint.h
2877 2011-03-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
2879         * elf32-tic6x.c (elf32_tic6x_relocate_section): Remove unused variable
2880         dynobj and its initialization.
2882 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2884         * makefile.vms (DEFS): Add HAVE_bfd_elf64_ia64_vms_vec.
2885         * configure.com: Set BFD_HOST_64BIT_LONG_LONG and
2886         BFD_HOST_LONG_LONG to 1.
2888 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2890         * vms-alpha.c (vms_get_remaining_object_record): Fix dec-c warning.
2891         (_bfd_vms_write_etir): Ditto.
2892         (_bfd_vms_slurp_etir): Avoid to use intptr_t
2893         * configure.com: Generate bfd_stdint.h
2895 2011-03-31  Bernd Schmidt  <bernds@codesourcery.com>
2897         * elf32-tic6x.h (struct elf32_tic6x_params): New.
2898         (elf32_tic6x_setup): Declare.
2899         * elf32-tic6x.c: Include <limits.h>.
2900         (ELF_DYNAMIC_LINKER, DEFAULT_STACK_SIZE, PLT_ENTRY_SIZE): Define.
2901         (struct elf32_tic6x_link_hash_table, struct elf32_link_hash_entry):
2902         New structures.
2903         (elf32_tic6x_link_hash_table, is_tic6x_elf): New macros.
2904         (tic6x_elf_scom_section, tic6x_elf_scom_symbol,
2905         tic6x_elf_scom_symbol_ptr): New static variables.
2906         (elf32_tic6x_howto_table, elf32_tic6x_howto_table_rel,
2907         elf32_tic6x_reloc_map): Add R_C6000_JUMP_SLOT, R_C6000_EHTYPE,
2908         R_C6000_PCR_H16 and R_C6000_PCR_L16.
2909         (elf32_tic6x_link_hash_newfunc, elf32_tic6x_link_hash_table_create,
2910         elf32_tic6x_link_hash_table_free, elf32_tic6x_setup,
2911         elf32_tic6x_using_dsbt, elf32_tic6x_install_rela,
2912         elf32_tic6x_create_dynamic_sections, elf32_tic6x_make_got_dynreloc,
2913         elf32_tic6x_finish_dynamic_symbol, elf32_tic6x_gc_sweep_hook,
2914         elf32_tic6x_adjust_dynamic_symbol): New static functions.
2915         (elf32_tic6x_relocate_section): For R_C6000_PCR_S21, convert branches
2916         to weak symbols as required by the ABI.
2917         Handle GOT and DSBT_INDEX relocs, and copy relocs to the output file
2918         as needed when generating DSBT output.
2919         (elf32_tic6x_check_relocs, elf32_tic6x_add_symbol_hook,
2920         elf32_tic6x_symbol_processing, elf32_tic6x_section_from_bfd_section,
2921         elf32_tic6x_allocate_dynrelocs, elf32_tic6x_size_dynamic_sections,
2922         elf32_tic6x_always_size_sections, elf32_tic6x_modify_program_headers,
2923         elf32_tic6x_finish_dynamic_sections, elf32_tic6x_plt_sym_val,
2924         elf32_tic6x_copy_private_data, elf32_tic6x_link_omit_section_dynsym):
2925         New static functions.
2926         (ELF_MAXPAGESIZE): Define to 0x1000.
2927         (bfd_elf32_bfd_copy_private_bfd_data,
2928         bfd_elf32_bfd_link_hash_table_create,
2929         bfd_elf32_bfd_link_hash_table_free, elf_backend_can_refcount,
2930         elf_backend_want_got_plt, elf_backend_want_dynbss,
2931         elf_backend_plt_readonly, elf_backend_got_header_size,
2932         elf_backend_gc_sweep_hook, elf_backend_modify_program_headers,
2933         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
2934         elf_backend_check_relocs, elf_backend_add_symbol_hook,
2935         elf_backend_symbol_processing, elf_backend_link_output_symbol_hook,
2936         elf_backend_section_from_bfd_section,
2937         elf_backend_finish_dynamic_symbol, elf_backend_always_size_sections,
2938         elf32_tic6x_size_dynamic_sections, elf_backend_finish_dynamic_sections,
2939         elf_backend_omit_section_dynsym, elf_backend_plt_sym_val): Define.
2941         * bfd/reloc.c (BFD_RELOC_C6000_JUMP_SLOT, BFD_RELOC_C6000_EHTYPE,
2942         BFD_RELOC_C6000_PCR_H16, BFD_RELOC_C6000_PCR_S16): Add.
2943         * bfd/bfd-in2.h: Regenerate.
2944         * bfd/libbfd.h: Regenerate.
2945         * config.bfd: Accept tic6x-*-* instead of tic6x-*-elf.
2947 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2949         * coffcode.h (coff_slurp_symbol_table): Silently discard C_NULL
2950         entry on xcoff when value is C_NULL_VALUE.
2952 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2954         * libcoff-in.h (exec_hdr): Remove.
2955         * libcoff.h: Regenerate.
2957 2011-03-30  Nick Clifton  <nickc@redhat.com>
2959         * po/da.po: Updated Danish translation.
2961 2011-03-29  Richard Henderson  <rth@redhat.com>
2963         * elf64-alpha.c (elf64_alpha_gc_mark_hook): New.
2964         (elf64_alpha_gc_sweep_hook): New.
2965         (elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook): New.
2966         (elf_backend_can_gc_sections): New.
2968 2011-03-26  John Marino  <binutils@marino.st>
2970         * config.bfd: Add x86_64-*-dragonfly*, fix i386-*-dragonfly*.
2971         * configure.in: Delete unused bfd_elf32_i386_dragonfly_vec.
2972         * configure: Regenerate.
2974 2011-03-25  Michael Snyder  <msnyder@vmware.com>
2976         * coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.
2978 2011-03-25  Tristan Gingold  <gingold@adacore.com>
2980         * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Allow the use
2981         of find_nearest_line on object files.
2983 2011-03-25  Tristan Gingold  <gingold@adacore.com>
2985         * vms-alpha.c (evax_section_flags): Make $CODE$ section read-only.
2986         Minor reordering.
2987         (alpha_vms_create_eisd_for_section): Make code sections read-only.
2989 2011-03-24  Alan Modra  <amodra@gmail.com>
2991         * elf32-ppc.c (ppc_elf_tls_optimize): Catch more cases where
2992         old-style __tls_get_addr calls without marker relocs don't match
2993         their arg setup insn one for one.  If such mismatches are found
2994         report the reloc and don't do any tls optimization.
2995         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
2997 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
2999         * bfd-in2.h: Regenerate.
3001 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
3003         * archures.c: Add AVR XMEGA architecture information.
3004         * cpu-avr.c (arch_info_struct): Likewise.
3005         * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
3006         (elf32_avr_object_p): Likewise.
3008 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
3010         * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation.
3011         * bfd-in2.h: Regenerate.
3012         * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition
3013         to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE
3014         entry.
3015         (elf32_arm_howto_from_type): Update accordingly.
3016         (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE.
3017         (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3.
3018         (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry
3019         with an extra noncall_refcount field.
3020         (arm_local_iplt_info): New structure.
3021         (elf_arm_obj_tdata): Add local_iplt.
3022         (elf32_arm_local_iplt): New accessor macro.
3023         (elf32_arm_link_hash_entry): Replace plt_thumb_refcount,
3024         plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info.
3025         Change tls_type to a bitfield and add is_iplt.
3026         (elf32_arm_link_hash_newfunc): Update accordingly.
3027         (elf32_arm_allocate_local_sym_info): New function.
3028         (elf32_arm_create_local_iplt): Likewise.
3029         (elf32_arm_get_plt_info): Likewise.
3030         (elf32_arm_plt_needs_thumb_stub_p): Likewise.
3031         (elf32_arm_get_local_dynreloc_list): Likewise.
3032         (create_ifunc_sections): Likewise.
3033         (elf32_arm_copy_indirect_symbol): Update after the changes to
3034         elf32_arm_link_hash_entry.  Assert the is_iplt has not yet been set.
3035         (arm_type_of_stub): Add an st_type argument.  Use elf32_arm_get_plt_info
3036         to get PLT information.  Assert that all STT_GNU_IFUNC references
3037         are turned into PLT references.
3038         (arm_build_one_stub): Pass the symbol type to
3039         elf32_arm_final_link_relocate.
3040         (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub.
3041         (elf32_arm_allocate_irelocs): New function.
3042         (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for
3043         all R_ARM_IRELATIVE.
3044         (elf32_arm_allocate_plt_entry): New function.
3045         (elf32_arm_populate_plt_entry): Likewise.
3046         (elf32_arm_final_link_relocate): Add an st_type parameter.
3047         Set srelgot to null for static objects.  Use separate variables
3048         to record which st_value and st_type should be used when generating
3049         a dynamic relocation.  Use elf32_arm_get_plt_info to find the
3050         symbol's PLT information, setting has_iplt_entry, splt,
3051         plt_offset and gotplt_offset accordingly.  Check whether
3052         STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change
3053         the relocation target accordingly.  Broaden assert to include
3054         .iplts.  Don't set sreloc for static relocations.  Assert that
3055         we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32
3056         and R_ARM_ABS32_NOI.  Generate R_ARM_IRELATIVE relocations instead
3057         of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC
3058         symbol.  Pass the symbol type to arm_type_of_stub.  Conditionally
3059         resolve GOT references to the .igot.plt entry.
3060         (elf32_arm_relocate_section): Update the call to
3061         elf32_arm_final_link_relocate.
3062         (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT
3063         information.  Treat R_ARM_REL32 and R_ARM_REL32_NOI as call
3064         relocations in shared libraries and relocatable executables.
3065         Count non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
3066         to get the list of dynamic relocations for a local symbol.
3067         (elf32_arm_check_relocs): Always create ifunc sections.  Set isym
3068         at the same time as setting h.  Use elf32_arm_allocate_local_sym_info
3069         to allocate local symbol information.  Treat R_ARM_REL32 and
3070         R_ARM_REL32_NOI as call relocations in shared libraries and
3071         relocatable executables.  Record PLT information for local
3072         STT_GNU_IFUNC functions as well as global functions.   Count
3073         non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
3074         to get the list of dynamic relocations for a local symbol.
3075         (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols.
3076         Don't remove STT_GNU_IFUNC PLTs unless all references have been
3077         removed.  Update after the changes to elf32_arm_link_hash_entry.
3078         (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT
3079         entries should live in .plt or .iplt.  Check whether the .igot.plt
3080         and .got entries can be combined.  Use elf32_arm_allocate_plt_entry
3081         to allocate .plt and .(i)got.plt entries.  Detect which .got
3082         entries will need R_ARM_IRELATIVE relocations and use
3083         elf32_arm_allocate_irelocs to allocate them.  Likewise other
3084         non-.got dynamic relocations.
3085         (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt
3086         and dynamic relocations for local STT_GNU_IFUNC symbols.
3087         Check whether the .igot.plt and .got entries can be combined.
3088         Detect which .got entries will need R_ARM_IRELATIVE relocations
3089         and use elf32_arm_allocate_irelocs to allocate them.  Use stashed
3090         section pointers intead of strcmp checks.  Handle iplt and igotplt.
3091         (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry
3092         to fill in .plt, .got.plt and .rel(a).plt entries.  Point
3093         STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations
3094         resolve to it.
3095         (elf32_arm_output_plt_map_1): New function, split out from
3096         elf32_arm_output_plt_map.  Handle .iplt entries.  Use
3097         elf32_arm_plt_needs_thumb_stub_p.
3098         (elf32_arm_output_plt_map): Call it.
3099         (elf32_arm_output_arch_local_syms): Add mapping symbols for
3100         local .iplt entries.
3101         (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols.
3102         (elf32_arm_swap_symbol_out): Likewise.
3103         (elf32_arm_add_symbol_hook): New function.
3104         (elf_backend_add_symbol_hook): Define for all targets.
3106 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
3108         * elf-bfd.h (elf_link_hash_entry): Add target_internal.
3109         * elf.c (swap_out_syms): Set st_target_internal for each
3110         Elf_Internal_Sym.
3111         * elfcode.h (elf_swap_symbol_in): Likewise.
3112         * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
3113         * elf32-sh-symbian.c (sh_symbian_relocate_section): Likewise.
3114         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
3115         * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
3116         * elflink.c (elf_link_output_extsym): Likewise.
3117         (bfd_elf_final_link): Likewise.
3118         (elf_link_add_object_symbols): Copy st_target_internal
3119         to the hash table if we see a definition.
3120         (_bfd_elf_copy_link_hash_symbol_type): Copy target_internal.
3121         * elf32-arm.c (elf32_arm_stub_hash_entry): Replace st_type with
3122         a branch_type field.
3123         (a8_erratum_fix, a8_erratum_reloc): Likewise.
3124         (arm_type_of_stub): Replace actual_st_type with an
3125         actual_branch_type parameter.
3126         (arm_build_one_stub): Use branch types rather than st_types to
3127         determine the type of branch.
3128         (cortex_a8_erratum_scan): Likewise.
3129         (elf32_arm_size_stubs): Likewise.
3130         (bfd_elf32_arm_process_before_allocation): Likewise.
3131         (allocate_dynrelocs_for_symbol): Likewise.
3132         (elf32_arm_finish_dynamic_sections): Likewise.
3133         (elf32_arm_final_link_relocate): Replace sym_flags parameter with
3134         a branch_type parameter.
3135         (elf32_arm_relocate_section): Update call accordingly.
3136         (elf32_arm_adjust_dynamic_symbol): Don't check STT_ARM_TFUNC.
3137         (elf32_arm_output_map_sym): Initialize st_target_internal.
3138         (elf32_arm_output_stub_sym): Likewise.
3139         (elf32_arm_symbol_processing): Delete.
3140         (elf32_arm_swap_symbol_in): Convert STT_ARM_TFUNCs into STT_FUNCs.
3141         Use st_target_internal to record the branch type.
3142         (elf32_arm_swap_symbol_out): Use st_target_internal to test for
3143         Thumb functions.
3144         (elf32_arm_is_function_type): Delete.
3145         (elf_backend_symbol_processing): Likewise.
3146         (elf_backend_is_function_type): Likewise.
3148 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
3150         * elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj.
3151         (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion
3152         into the PLT block.
3154 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
3156         * elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p,
3157         may_need_local_target_p and may_become_dynamic_p to classify
3158         the relocation type.  Don't check info->symbolic or h->def_regular
3159         when deciding whether to record a potential dynamic reloc.
3160         Don't treat potential dynamic relocs as PLT references.
3161         (elf32_arm_gc_sweep_hook): Update to match.  Assert that we don't
3162         try to make the PLT reference count go negative.
3164 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
3166         * elf32-arm.c (elf32_arm_final_link_relocate): Always fill in the
3167         GOT entry here, rather than leaving it to finish_dynamic_symbol.
3168         Only create a dynamic relocation for local references if
3169         info->shared.
3170         (allocate_dynrelocs_for_symbol): Update dynamic relocation
3171         allocation accordingly.
3172         (elf32_arm_finish_dynamic_symbol): Don't initialise the GOT entry here.
3174 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
3176         * elf32-arm.c (elf32_arm_allocate_dynrelocs): New function.
3177         (elf32_arm_add_dynreloc): Likewise.
3178         (elf32_arm_adjust_dynamic_symbol): Use elf32_arm_allocate_dynrelocs
3179         to allocate dynamic relocations.
3180         (elf32_arm_size_dynamic_sections): Likewise.
3181         (allocate_dynrelocs): Likewise.  Rename to
3182         allocate_dynrelocs_for_symbol.
3183         (elf32_arm_final_link_relocate): Use elf32_arm_add_dynreloc to
3184         create dynamic relocations.
3185         (elf32_arm_finish_dynamic_symbol): Likewise.
3187 2011-03-12  H.J. Lu  <hongjiu.lu@intel.com>
3189         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
3190         x32 GD->IE and GD->LE transitions.
3191         (elf_x86_64_relocate_section): Supprt TLS x32 GD->IE, GD->LE
3192         and LD->LE transitions.
3194 2011-03-10  Alan Modra  <amodra@gmail.com>
3196         * elf64-ppc.c (ppc64_elf_relocate_section): Provide section/offset
3197         for LO_DS error message and correct multiple.
3199 2011-03-10  Alan Modra  <amodra@gmail.com>
3201         * elf64-ppc.c (bfd_elf64_bfd_link_just_syms): Define.
3202         (ppc64_elf_link_just_syms): New function.
3203         (opd_entry_value): Don't assume big-endian host.
3204         (get_r2off): New function.
3205         (ppc_build_one_stub, ppc_size_one_stub): Use it here.
3207 2011-03-06  Michael Snyder  <msnyder@vmware.com>
3209         * compress.c (bfd_compress_section_contents): Check for out of mem.
3211         * elf64-x86-64.c (elf_x86_64_relocate_section): Document
3212         that case statement falls through intentionally.
3214         * elf32-i386.c (elf_i386_relocate_section): Document fall through.
3216 2011-03-04  Alan Modra  <amodra@gmail.com>
3218         * archive.c (bsd_write_armap): Don't call stat in deterministic
3219         mode, and don't use st_mtime if stat returns error.
3221 2011-03-03  Michael Snyder  <msnyder@vmware.com>
3223         * elf64-x86-64.c (elf_x86_64_relocate_section): Remove dead code.
3225         * coff-x86_64.c (coff_amd64_rtype_to_howto): Fencepost error.
3227         * aoutx.h (aout_final_link): Use sizeof int not sizeof int*.
3228         (aout_link_write_other_symbol): Missing break statement.
3230         * dwarf2.c (scan_unit_for_symbols): Stop memory leak.
3232         * archive.c (_bfd_slurp_extended_name_table): Fail if bfd_seek fails.
3234 2011-03-03  H.J. Lu  <hongjiu.lu@intel.com>
3236         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
3237         x32 IE->LE transition.
3238         (elf_x86_64_relocate_section): Likewise.
3240 2011-03-02  Bernd Schmidt  <bernds@codesourcery.com>
3242         * elflink.c (is_reloc_section): Remove function.
3243         (get_dynamic_reloc_section_name): Construct string manually.
3245 2011-02-28  Kai Tietz  <kai.tietz@onevision.com>
3247         * archive.c (_bfd_find_nested_archive): Use filename_(n)cmp.
3248         (adjust_relative_path): Likewise.
3249         (_bfd_construct_extended_name_table): Likewise.
3250         * corefile.c (generic_core_file_matches_executable_p): Likewise.
3251         * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
3252         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
3253         * elf32-spu.c (sort_bfds): Likewise.
3254         (spu_elf_auto_overlay): Likewise.
3255         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
3256         * xcofflink.c (xcoff_set_import_path): Likewise.
3257         * xtensa-isa.c (xtensa_regfile_lookup): Likewise.
3258         (xtensa_regfile_lookup_shortname): Likewise.
3260 2011-02-28  Alan Modra  <amodra@gmail.com>
3262         PR 12513
3263         * archive.c (bfd_slurp_bsd_armap_f2): Sanity check parsed_size and
3264         stringsize.  Properly sanity check symdef_count.  Remove redundant
3265         bfd_release.
3267 2011-02-25  Rafael Ávila de Espíndola <respindola@mozilla.com>
3269         * plugin.c (bfd_plugin_object_p): Correctly set the filesize
3270         and handle claim_file seeking. Only try to load the plugin once.
3272 2011-02-22  Andreas Schwab  <schwab@redhat.com>
3274         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): For a TLS_GD
3275         relocation read the value from the second GOT slot.
3277 2011-02-15  Tristan Gingold  <gingold@adacore.com>
3279         * vms-alpha.c (alpha_vms_link_add_archive_symbols): Add a comment.
3281 2011-02-15  Alan Modra  <amodra@gmail.com>
3283         * elf64-ppc.c (ppc64_elf_edit_toc): Reinstate second read of
3284         toc relocs.  Fuss over free(NULL).
3286 2011-02-14  Mike Frysinger  <vapier@gentoo.org>
3288         * elflink.c (bfd_elf_size_dynamic_sections): Add
3289         bfd_get_symbol_leading_char to the start of newname.
3291 2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3293         * configure: Regenerate.
3295 2011-02-09  Alan Modra  <amodra@gmail.com>
3297         * elf64-ppc.c (ppc64_elf_edit_toc): Don't free toc relocs until
3298         we are done.  When optimising large toc, check that a global
3299         symbol on a toc reloc is defined in a kept section.
3301 2011-02-08  Nick Clifton  <nickc@redhat.com>
3303         PR binutils/12467
3304         * elf.c (assign_file_positions_for_load_sections): Set the program
3305         header offset and entry size to zero if there are no program
3306         headers.
3308 2011-02-08  Alan Modra  <amodra@gmail.com>
3310         * elf64-ppc.c (ppc64_elf_edit_toc): Don't segfault on NULL
3311         local_syms when looking for local symbols in .toc.
3313 2011-02-01  Alan Modra  <amodra@gmail.com>
3315         * elf64-ppc.c (ppc64_elf_next_input_section): Use elf_gp value
3316         for toc pointer on any section having makes_toc_func_call set.
3317         (check_pasted_section): Ensure pasted .init/.fini fragments use
3318         the same toc if any has makes_toc_func_call set.
3320 2011-01-28  Joseph Myers  <joseph@codesourcery.com>
3322         * elf32-ppc.c (ppc_elf_link_hash_newfunc): Initialize has_sda_refs
3323         field.
3325 2011-01-22  Richard Sandiford  <rdsandiford@googlemail.com>
3327         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Ignore
3328         common sections too.
3330 2011-01-18  H.J. Lu  <hongjiu.lu@intel.com>
3332         * elf64-x86-64.c (elf_backend_want_plt_sym): Redefine to 0 after
3333         Solaris target.
3335 2011-01-18  Pierre Muller  <muller@ics.u-strasbg.fr>
3337         Fix compilation for mingw64.
3338         * coffcode.h (coff_slurp_symbol_table): Add intptr_t intermediate
3339         typecast to avoid warning.
3340         * elf32-rx.c: Add "bfd_stdint.h" include required for int32_t type
3341         usage.
3342         * elfxx-ia64.c (elfNN_ia64_relax_br): Use intptr_t typeacast instead
3343         of long for pointer to avoid warning.
3344         (elfNN_ia64_relax_brl): Idem.
3345         (elfNN_ia64_install_value): Idem.
3346         * vms-alpha.c (_bfd_vms_slurp_etir): Idem.
3348 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
3350         * elf32-arm.c (elf32_arm_check_relocs): Check needs_plt rather than
3351         h->needs_plt when deciding whether to record a possible dynamic reloc.
3353 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
3355         * elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered
3356         dynamic relocs for the removed section.
3358 2011-01-15  H.J. Lu  <hongjiu.lu@intel.com>
3360         * elf64-x86-64.c (elf_x86_64_check_relocs): Check invalid x32
3361         relocations.
3363 2011-01-14  H.J. Lu  <hongjiu.lu@intel.com>
3365         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add pointer_r_type.
3366         (elf_x86_64_link_hash_table_create): Set pointer_r_type.
3367         (elf_x86_64_check_relocs): Handle R_X86_64_32 like R_X86_64_64
3368         for ILP32.  Remove ABI_64_P PIC check for R_X86_64_8,
3369         R_X86_64_16, R_X86_64_32 and R_X86_64_32S.
3370         (elf_x86_64_relocate_section):  Handle R_X86_64_32 like R_X86_64_64
3371         for ILP32.
3373 2011-01-14  Alan Modra  <amodra@gmail.com>
3375         * bfd.c (bfd_perror): Flush stdout before and stderr after printing
3376         error.
3377         (_bfd_default_error_handler): Likewise.
3378         * elf.c (print_segment_map): Likewise.
3379         * libbfd.c (warn_deprecated): Likewise.
3380         * som.c (som_sizeof_headers): No need to do so here.
3381         * coff-i860.c: Replace use of printf for error messages with
3382         _bfd_error_handler.
3383         * coff-ppc.c: Likewise.
3384         * coff-sh.c: Likewise.
3385         * elf32-bfin.c: Likewise.
3386         * elf32-dlx.c: Likewise.
3387         * elf32-mep.c: Likewise.
3388         * elf32-v850.c: Likewise.
3389         * mach-o.c: Likewise.
3390         * pef.c: Likewise.
3392 2011-01-13  H.J. Lu  <hongjiu.lu@intel.com>
3394         * elf64-x86-64.c (elf_x86_64_link_hash_table): Remove
3395         swap_reloca_out.
3396         (elf_x86_64_link_hash_table_create): Don't set swap_reloca_out.
3397         (elf_x86_64_check_relocs): Align relocation section to 4 byte
3398         for 32bit.
3399         (elf_x86_64_gc_sweep_hook): Replace ELF64_ST_TYPE with
3400         ELF_ST_TYPE.
3401         (elf_x86_64_finish_dynamic_symbol): Updated.
3402         (elf_x86_64_finish_dynamic_sections): Don't use
3403         Elf64_External_Dyn, bfd_elf64_swap_dyn_in, nor
3404         bfd_elf64_swap_dyn_out.
3406 2011-01-14  J. Park  <grassman@gmail.com>
3408         PR ld/12339
3409         * elf32-arm.c (allocate_dynrelocs): Don't set up eh before
3410         following bfd_link_hash_warning symbol link.
3412 2011-01-10  Nathan Sidwell  <nathan@codesourcery.com>
3413             Glauber de Oliveira Costa  <glommer@gmail.com>
3415         * reloc.c (BFD_RELOC_ARM_TLS_GOTDESC, BFD_RELOC_ARM_TLS_CALL,
3416         BFD_RELOC_ARM_THM_TLS_CALL, BFD_RELOC_ARM_TLS_DESCSEQ,
3417         BFD_RELOC_ARM_THM_TLS_DESCSEQ, BFD_RELOC_ARM_TLS_DESC): New
3418         relocations.
3419         * libbfd.h: Rebuilt.
3420         * bfd-in2.h: Rebuilt.
3421         * elf32-arm.c (elf32_arm_howto_table_1): Add new relocations.
3422         (elf32_arm_reloc_map): Likewise.
3423         (tls_trampoline, dl_tlsdesc_lazy_trampoline): New PLT templates.
3424         (elf32_arm_stub_long_branch_any_tls_pic,
3425         elf32_arm_stub_long_branch_v4t_thumb_tls_pic): New stub templates.
3426         (DEF_STUBS): Add new stubs.
3427         (struct_elf_arm_obj_data): Add local_tlsdesc_gotent field.
3428         (elf32_arm_local_tlsdesc_gotent): New.
3429         (GOT_TLS_GDESC): New mask.
3430         (GOT_TLS_GD_ANY): Define.
3431         (struct elf32_arm_link_hash_entry): Add tlsdesc_got field.
3432         (elf32_arm_compute_jump_table_size): New.
3433         (struct elf32_arm_link_hash_table): Add next_tls_desc_index,
3434         num_tls_desc, dt_tlsdesc_plt, dt_tlsdesc_got, tls_trampoline,
3435         sgotplt_jump_table_size fields.
3436         (elf32_arm_link_hash_newfunc): Initialize tlsdesc_got field.
3437         (elf32_arm_link_hash_table_create): Initialize new fields.
3438         (arm_type_of_stub): Check TLS desc relocs too.
3439         (elf32_arm_stub_name): TLS desc relocs can be shared.
3440         (elf32_arm_tls_transition): Determine relaxation.
3441         (arm_stub_required_alignment): Add tls stubs.
3442         (elf32_arm_size_stubs): Likewise.
3443         (elf32_arm_tls_relax): Perform TLS relaxing.
3444         (elf32_arm_final_link_relocate): Process TLS DESC relocations.
3445         (IS_ARM_TLS_GNU_RELOC): New.
3446         (IS_ARM_TLS_RELOC): Use it.
3447         (elf32_arm_relocate_section): Perform TLS relaxing.
3448         (elf32_arm_check_relocs): Anticipate TLS relaxing, process tls
3449         desc relocations.
3450         (allocate_dynrelocs): Allocate tls desc relcoations.
3451         (elf32_arm_output_arch_local_syms): Emit tls trampoline mapping
3452         symbols.
3453         (elf32_arm_size_dynamic_sections): Allocate tls trampolines and
3454         got slots.
3455         (elf32_arm_always_size_sections): New. Create _TLS_MODULE_BASE
3456         symbol.
3457         (elf32_arm_finish_dynamic_symbol): Adjust.
3458         (arm_put_trampoline): New.
3459         (elf32_arm_finish_dynamic_sections): Emit new dynamic tags and tls
3460         trampolines.
3461         (elf_backend_always_size_sections): Define.
3463 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
3465         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Optimized.
3467 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
3469         PR ld/12366
3470         PR ld/12371
3471         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Properly
3472         handle symbols marked with regular reference, but not non-GOT
3473         reference when building shared library.
3475         * elf32-i386.c (elf_i386_gc_sweep_hook): Properly handle
3476         local and global STT_GNU_IFUNC symols when building shared
3477         library.
3478         * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
3480 2011-01-05  DJ Delorie  <dj@redhat.com>
3482         * reloc.c: Add BFD_RELOC_RX_OP_NEG.
3483         * libbfd.h: Regenerate.
3484         * bfd-in2.h: Regenerate.
3485         * elf32-rx.c: Add it to the list, corresponding to R_RX_OPneg.
3487 2011-01-03  H.J. Lu  <hongjiu.lu@intel.com>
3489         * cpu-i386.c (bfd_i386_compatible): New.
3490         (bfd_x64_32_arch_intel_syntax): Replace bfd_default_compatible
3491         with bfd_i386_compatible.
3492         (bfd_x86_64_arch_intel_syntax): Likewise.
3493         (bfd_i386_arch_intel_syntax): Likewise.
3494         (i8086_arch): Likewise.
3495         (bfd_x64_32_arch): Likewise.
3496         (bfd_x86_64_arch): Likewise.
3497         (bfd_i386_arch): Likewise.
3499 For older changes see ChangeLog-2010
3501 Local Variables:
3502 mode: change-log
3503 left-margin: 8
3504 fill-column: 74
3505 version-control: never
3506 End: