6d9f246b1c62cef3d9fb83f02963282e349098b9
[external/binutils.git] / bfd / ChangeLog
1 2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
2             Thomas Schwinge  <thomas@schwinge.name>
3
4         PR binutils/12913
5         * elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of
6         ELFOSABI_LINUX alias.
7         * elf32-hppa.c: Likewise.
8         * elf32-i370.c: Likewise.
9         * elf64-hppa.c: Likewise.
10
11 2011-07-01  Ian Lance Taylor  <iant@google.com>
12
13         * elf32-i386.c (elf_i386_eh_frame_plt): Correct expression: change
14         DW_OP_lit3 to DW_OP_lit2.
15
16 2011-07-01  Alan Modra  <amodra@gmail.com>
17
18         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't look at
19         dyn relocs when called to copy flags for a weak sym.
20         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
21         (ppc64_elf_merge_private_bfd_data): Delete.
22         (bfd_elf64_bfd_merge_private_bfd_data): Define as
23         _bfd_generic_verify_endian_match.
24
25 2011-06-30  Bernd Schmidt  <bernds@codesourcery.com>
26
27         * bfd/elf32-tic6x.c (elf32_tic6x_set_osabi): Also set it if
28         link_info is NULL.
29
30 2011-06-28  Tristan Gingold  <gingold@adacore.com>
31
32         * vms-alpha.c (vms_private_data_struct): Make vms_linkage_index
33         unsigned int.
34         (_bfd_vms_write_etir): Write linkage index from reloc.
35
36 2011-06-28  Fawzi Mohamed <fawzi.mohamed@nokia.com>
37
38         * mach-o.c (bfd_mach_o_read_command): Also ignore
39         BFD_MACH_O_LC_ROUTINES_64.
40
41 2011-06-27  Tristan Gingold  <gingold@adacore.com>
42
43         * vms-alpha.c (_bfd_vms_write_etir): Use 'section' to get current
44         section target index.
45
46 2011-06-27  Nick Clifton  <nickc@redhat.com>
47
48         * cisco-core.c (cisco_core_little_vec): Add initialization of
49         match_priority field.
50
51 2011-06-27  Tristan Gingold  <gingold@adacore.com>
52
53         * cache.c: Include bfd_stdint.h.
54         (cache_bmmap): Change profile.  Return region start and size.
55         * bfdio.c (struct bfd_iovec): Change bmmap profile.
56         (bfd_mmap): Change profile and adjust.   Update comment.
57         (memory_bmmap): Change profile.
58         * opncls.c (opncls_bmmap): Change profile.
59         * vms-lib.c (vms_lib_bmmap): Likewise.
60         * libbfd.h: Regenerate.
61         * bfd-in2.h: Regenerate.
62
63 2011-06-27  Tristan Gingold  <gingold@adacore.com>
64
65         * vms-misc.c (vms_time_to_time_t): Adjust overflow detection.
66         Add comment.
67
68 2011-06-25  H.J. Lu  <hongjiu.lu@intel.com>
69
70         * elf64-x86-64.c (elf_backend_post_process_headers): Don't
71         define for FreeBSD/x86-64 nor FreeBSD/L1OM.  Define for L1OM.
72
73 2011-06-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
74
75         * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Initialize
76         PLT_EH_FRAME.
77         * elf32-i386.c (elf_i386_link_hash_table): Likewise.
78
79 2011-06-24  Richard Henderson  <rth@redhat.com>
80
81         PR ld/12928
82         * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Recover the
83         tlsgd insn before swapping adjacent insns.
84
85 2011-06-24  Tristan Gingold  <gingold@adacore.com>
86
87         * vms-alpha.c (alpha_vms_slurp_relocs): Add a guard for relocs in the
88         absolute section.
89
90 2011-06-24  Alan Modra  <amodra@gmail.com>
91
92         PR ld/12921
93         * elf.c (assign_file_positions_for_load_sections): Don't align
94         sh_offset for all SHT_NOBITS sections here, just .tbss sections
95         that don't get a PT_LOAD.
96
97 2011-06-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
98
99         * elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE.
100         (sh_elf_check_relocs): Likewise.
101
102 2011-06-22  Richard Henderson  <rth@redhat.com>
103
104         * elf64-alpha.c (elf64_alpha_check_relocs): No dynamic reloc for
105         TPREL in a PIE image.
106         (alpha_dynamic_entries_for_reloc): Likewise.
107         (elf64_alpha_relocate_section): Allow TPREL in PIE images.
108         (elf64_alpha_relax_got_load): Likewise.
109
110 2011-06-22  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
111
112         * elf32-arm.c (elf32_arm_final_link_relocate): Allow R_ARM_TLS_LE32
113         for PIE.
114
115 2011-06-22  Alan Modra  <amodra@gmail.com>
116
117         * elflink.c (_bfd_elf_merge_symbol): Allow type changes for
118         plugin symbols.  Fix segfault on linker scrip defined syms.
119
120 2011-06-20  Jakub Jelinek  <jakub@redhat.com>
121
122         PR ld/12570
123         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Allow no relocations
124         at all for linker created .eh_frame sections.
125         (_bfd_elf_discard_section_eh_frame): Handle linker created
126         .eh_frame sections with no relocations.
127         * elf64-x86-64.c: Include dwarf2.h.
128         (elf_x86_64_eh_frame_plt): New variable.
129         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
130         PLT_FDE_LEN_OFFSET): Define.
131         (struct elf_x86_64_link_hash_table): Add plt_eh_frame field.
132         (elf_x86_64_create_dynamic_sections): Create and fill in
133         .eh_frame section for .plt section.
134         (elf_x86_64_size_dynamic_sections): Write .plt section size
135         into .eh_frame FDE covering .plt section.
136         (elf_x86_64_finish_dynamic_sections): Write .plt section
137         start into .eh_frame FDE covering .plt section.  Call
138         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
139         (elf_backend_plt_alignment): Define to 4.
140         * elf32-i386.c: Include dwarf2.h.
141         (elf_i386_eh_frame_plt): New variable.
142         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
143         PLT_FDE_LEN_OFFSET): Define.
144         (struct elf_i386_link_hash_table): Add plt_eh_frame field.
145         (elf_i386_create_dynamic_sections): Create and fill in
146         .eh_frame section for .plt section.
147         (elf_i386_size_dynamic_sections): Write .plt section size
148         into .eh_frame FDE covering .plt section.
149         (elf_i386_finish_dynamic_sections): Write .plt section
150         start into .eh_frame FDE covering .plt section.  Call
151         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
152         (elf_backend_plt_alignment): Define to 4.
153
154 2011-06-19  H.J. Lu  <hongjiu.lu@intel.com>
155
156         * elf64-x86-64.c (elf_backend_post_process_headers): Defined
157         for x32.
158
159 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
160
161         * elf64-x86-64.c: Include <stdarg.h> and CORE_HEADER if
162         CORE_HEADER is defined.
163         (elf_x86_64_write_core_note): New.
164         (elf_backend_write_core_note): Likewise.
165
166         * hosts/x86-64linux.h (uint64_t): New.
167         (user_regsx32_struct): Likewise.
168         (elf_gregx32_t): Likewise.
169         (ELF_NGREGX32): Likewise.
170         (elf_gregsetx32_t): Likewise.
171         (elf_prstatusx32): Likewise.
172         (prstatusx32_t): Likewise.
173         (user_fpregs32_struct): Removed.
174         (user_fpxregs32_struct): Likewise.
175         (user32): Likewise.
176         (elf_fpregset32_t): Likewise.
177         (elf_fpxregset32_t): Likewise.
178         (prgregset32_t): Likewise.
179         (prfpregset32_t): Likewise.
180
181 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
182
183         * elf64-x86-64.c (elf_x86_64_grok_prstatus): Support x32.
184         (elf_x86_64_grok_psinfo): Likewise.
185
186 2011-06-16  Nick Clifton  <nickc@redhat.com>
187
188         * elf.c (elf_find_function): Fail if not provided with a symbol
189         table.
190
191 2011-06-15  Ulrich Weigand  <ulrich.weigand@linaro.org>
192
193         * elf-bfd.h (elfcore_write_arm_vfp): Add prototype.
194         * elf.c (elfcore_grok_arm_vfp): New function.
195         (elfcore_grok_note): Call it to handle NT_ARM_VFP notes.
196         (elfcore_write_arm_vfp): New function.
197         (elfcore_write_register_note): Call it to handle .reg-arm-vfp.
198
199 2011-06-14  Richard Henderson  <rth@redhat.com>
200
201         * elf64-alpha.c (elf64_alpha_copy_indirect_symbol): Rename from
202         elf64_alpha_merge_ind_symbols; adjust for the generic interface.
203         (elf64_alpha_always_size_sections): Don't call
204         elf64_alpha_merge_ind_symbols.
205         (elf_backend_copy_indirect_symbol): New.
206
207 2011-06-14  Alan Modra  <amodra@gmail.com>
208
209         PR ld/12887
210         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Check sec_info_type
211         before doing anything.
212         (_bfd_elf_discard_section_eh_frame): Likewise.
213
214 2011-06-14  Alan Modra  <amodra@gmail.com>
215
216         * Makefile.am: Formatting.
217         * Makefile.in: Regenerate.
218         * configure.in (bfd_elf64_tilegx_vec): Add elfxx-tilegx.lo.
219         * po/SRC-POTFILES.in: Regnerate.
220
221 2011-06-14  Alan Modra  <amodra@gmail.com>
222
223         * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Don't use PTR.
224         (allocate_dynrelocs, readonly_dynrelocs): Replace PTR with void *.
225         Don't handle warning symbols here.
226         * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): As above.
227         (allocate_dynrelocs, readonly_dynrelocs): As above.
228
229 2011-06-14  Alan Modra  <amodra@gmail.com>
230
231         PR ld/12851
232         * elflink.c (_bfd_elf_gc_mark_extra_sections): New function.
233         (elf_gc_sweep): Don't treat debug and sections like .comment
234         specially here.
235         (bfd_elf_gc_sections): Treat note sections as gc roots only when
236         not part of a group.  Always call gc_mark_extra_sections.
237         * elf-bfd.h (_bfd_elf_gc_mark_extra_sections): Declare.
238         * elfxx-target.h (elf_backend_gc_mark_extra_sections): Default to
239         _bfd_elf_gc_mark_extra_sections.
240         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Call
241         _bfd_elf_gc_mark_extra_sections.
242         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): Likewise.
243
244 2011-06-13  Nick Clifton  <nickc@redhat.com>
245
246         * elf32-tilepro.c (tilepro_elf_check_relocs): Delete unused local
247         variable 'local_got_offsets'.
248         * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
249         (tilegx_finish_dyn): Delete unused local variable 'abi_64_p'.
250
251 2011-06-13  Walter Lee  <walt@tilera.com>
252
253         * Makefile.am (ALL_MACHINES): Add cpu-tilegx.lo and cpu-tilepro.lo.
254         (ALL_MACHINE_CFILES): Add cpu-tilegx.c and cpu-tilepro.c.
255         (BFD32_BACKENDS): Add elf32-tilegx.lo, elf32-tilepro.lo,
256         and elfxx-tilegx.lo.
257         (BFD32_BACKENDS_CFILES): Add elf32-tilegx.c elf32-tilepro.c, and
258         elfxx-tilegx.c.
259         (BFD64_BACKENDS): Add elf64-tilegx.lo.
260         (BFD64_BACKENDS_CFILES): Add elf64-tilegx.c.
261         * Makefile.in: Regenerate.
262         * arctures.c (bfd_architecture): Define bfd_arch_tilepro,
263         bfd_arch_tilegx, bfd_mach_tilepro, bfd_mach_tilegx.
264         (bfd_arch_info): Add bfd_tilegx_arch, bfd_tilepro_arch.
265         (bfd_archures_list): Add bfd_tilegx_arch, bfd_tilepro_arch.
266         bfd-in2.h: Regenerate.
267         * config.bfd: Handle tilegx-*-* and tilepro-*-*.
268         * configure.in: Handle bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
269         and bfd_elf64_tilegx_vec.
270         * configure: Regenerate.
271         * elf-bfd.h (enum elf_target_id): Define TILEGX_ELF_DATA and
272         TILEPRO_ELF_DATA.
273         * libbfd.h: Regenerate.
274         * reloc.c: Add BFD_RELOC_TILEPRO_{COPY, GLOB_DAT, JMP_SLOT,
275         RELATIVE, BROFF_X1, JOFFLONG_X1, JOFFLONG_X1_PLT, IMM8_X0,
276         IMM8_Y0, IMM8_X1, IMM8_Y1, DEST_IMM8_X1, MT_IMM15_X1, MF_IMM15_X1,
277         IMM16_X0, IMM16_X1, IMM16_X0_LO, IMM16_X1_LO, IMM16_X0_HI,
278         IMM16_X1_HI, IMM16_X0_HA, IMM16_X1_HA, IMM16_X0_PCREL,
279         IMM16_X1_PCREL, IMM16_X0_LO_PCREL, IMM16_X1_LO_PCREL,
280         IMM16_X0_HI_PCREL, IMM16_X1_HI_PCREL, IMM16_X0_HA_PCREL,
281         IMM16_X1_HA_PCREL, IMM16_X0_GOT, IMM16_X1_GOT, IMM16_X0_GOT_LO,
282         IMM16_X1_GOT_LO, IMM16_X0_GOT_HI, IMM16_X1_GOT_HI,
283         IMM16_X0_GOT_HA, IMM16_X1_GOT_HA, MMSTART_X0, MMEND_X0,
284         MMSTART_X1, MMEND_X1, SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1,
285         IMM16_X0_TLS_GD, IMM16_X1_TLS_GD, IMM16_X0_TLS_GD_LO,
286         IMM16_X1_TLS_GD_LO, IMM16_X0_TLS_GD_HI, IMM16_X1_TLS_GD_HI,
287         IMM16_X0_TLS_GD_HA, IMM16_X1_TLS_GD_HA, IMM16_X0_TLS_IE,
288         IMM16_X1_TLS_IE, IMM16_X0_TLS_IE_LO, IMM16_X1_TLS_IE_LO,
289         IMM16_X0_TLS_IE_HI, IMM16_X1_TLS_IE_HI, IMM16_X0_TLS_IE_HA,
290         IMM16_X1_TLS_IE_HA, TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
291         Add BFD_RELOC_TILEGX_{HW0, HW1, HW2, HW3, HW0_LAST, HW1_LAST,
292         HW2_LAST, COPY, GLOB_DAT, JMP_SLOT, RELATIVE, BROFF_X1,
293         JUMPOFF_X1, JUMPOFF_X1_PLT, IMM8_X0, IMM8_Y0, IMM8_X1, IMM8_Y1,
294         DEST_IMM8_X1, MT_IMM14_X1, MF_IMM14_X1, MMSTART_X0, MMEND_X0,
295         SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1, IMM16_X0_HW0,
296         IMM16_X1_HW0, IMM16_X0_HW1, IMM16_X1_HW1, IMM16_X0_HW2,
297         IMM16_X1_HW2, IMM16_X0_HW3, IMM16_X1_HW3, IMM16_X0_HW0_LAST,
298         IMM16_X1_HW0_LAST, IMM16_X0_HW1_LAST, IMM16_X1_HW1_LAST,
299         IMM16_X0_HW2_LAST, IMM16_X1_HW2_LAST, IMM16_X0_HW0_PCREL,
300         IMM16_X1_HW0_PCREL, IMM16_X0_HW1_PCREL, IMM16_X1_HW1_PCREL,
301         IMM16_X0_HW2_PCREL, IMM16_X1_HW2_PCREL, IMM16_X0_HW3_PCREL,
302         IMM16_X1_HW3_PCREL, IMM16_X0_HW0_LAST_PCREL,
303         IMM16_X1_HW0_LAST_PCREL, IMM16_X0_HW1_LAST_PCREL,
304         IMM16_X1_HW1_LAST_PCREL, IMM16_X0_HW2_LAST_PCREL,
305         IMM16_X1_HW2_LAST_PCREL, IMM16_X0_HW0_GOT, IMM16_X1_HW0_GOT,
306         IMM16_X0_HW1_GOT, IMM16_X1_HW1_GOT, IMM16_X0_HW2_GOT,
307         IMM16_X1_HW2_GOT, IMM16_X0_HW3_GOT, IMM16_X1_HW3_GOT,
308         IMM16_X0_HW0_LAST_GOT, IMM16_X1_HW0_LAST_GOT,
309         IMM16_X0_HW1_LAST_GOT, IMM16_X1_HW1_LAST_GOT,
310         IMM16_X0_HW2_LAST_GOT, IMM16_X1_HW2_LAST_GOT, IMM16_X0_HW0_TLS_GD,
311         IMM16_X1_HW0_TLS_GD, IMM16_X0_HW1_TLS_GD, IMM16_X1_HW1_TLS_GD,
312         IMM16_X0_HW2_TLS_GD, IMM16_X1_HW2_TLS_GD, IMM16_X0_HW3_TLS_GD,
313         IMM16_X1_HW3_TLS_GD, IMM16_X0_HW0_LAST_TLS_GD,
314         IMM16_X1_HW0_LAST_TLS_GD, IMM16_X0_HW1_LAST_TLS_GD,
315         IMM16_X1_HW1_LAST_TLS_GD, IMM16_X0_HW2_LAST_TLS_GD,
316         IMM16_X1_HW2_LAST_TLS_GD, IMM16_X0_HW0_TLS_IE,
317         IMM16_X1_HW0_TLS_IE, IMM16_X0_HW1_TLS_IE, IMM16_X1_HW1_TLS_IE,
318         IMM16_X0_HW2_TLS_IE, IMM16_X1_HW2_TLS_IE, IMM16_X0_HW3_TLS_IE,
319         IMM16_X1_HW3_TLS_IE, IMM16_X0_HW0_LAST_TLS_IE,
320         IMM16_X1_HW0_LAST_TLS_IE, IMM16_X0_HW1_LAST_TLS_IE,
321         IMM16_X1_HW1_LAST_TLS_IE, IMM16_X0_HW2_LAST_TLS_IE,
322         IMM16_X1_HW2_LAST_TLS_IE, TLS_DTPMOD64, TLS_DTPOFF64, TLS_TPOFF64,
323         TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
324         * targets.c (bfd_elf32_tilegx_vec): Declare.
325         (bfd_elf32_tilepro_vec): Declare.
326         (bfd_elf64_tilegx_vec): Declare.
327         (bfd_target_vector): Add bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
328         and bfd_elf64_tilegx_vec.
329         * cpu-tilegx.c: New file.
330         * cpu-tilepro.c: New file.
331         * elf32-tilepro.h: New file.
332         * elf32-tilepro.c: New file.
333         * elf32-tilegx.c: New file.
334         * elf32-tilegx.h: New file.
335         * elf64-tilegx.c: New file.
336         * elf64-tilegx.h: New file.
337         * elfxx-tilegx.c: New file.
338         * elfxx-tilegx.h: New file.
339
340 2011-06-13  Alan Modra  <amodra@gmail.com>
341
342         * linker.c (bfd_link_hash_traverse): Follow warning symbol link.
343         (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle
344         warning symbols here.
345         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
346         * elf32-arm.c (allocate_dynrelocs_for_symbol,
347         elf32_arm_readonly_dynrelocs): Likewise.
348         * elf32-bfin.c (bfin_discard_copies): Likewise.
349         * elf32-cris.c (elf_cris_adjust_gotplt_to_got,
350         elf_cris_discard_excess_dso_dynamics,
351         elf_cris_discard_excess_program_dynamics): Likewise.
352         * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs,
353         clobber_millicode_symbols, readonly_dynrelocs): Likewise.
354         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
355         * elf32-i386.c (elf_i386_allocate_dynrelocs,
356         elf_i386_readonly_dynrelocs): Likewise.
357         * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
358         * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise.
359         * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
360         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
361         * elf32-microblaze.c (allocate_dynrelocs): Likewise.
362         * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise.
363         * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
364         * elf32-score.c (score_elf_sort_hash_table_f): Likewise.
365         * elf32-score7.c (score_elf_sort_hash_table_f): Likewise.
366         * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
367         * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs,
368         elf32_tic6x_readonly_dynrelocs): Likewise.
369         * elf32-vax.c (elf_vax_discard_copies): Likewise.
370         * elf32-xstormy16.c (xstormy16_relax_plt_check,
371         xstormy16_relax_plt_realloc): Likewise.
372         * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise.
373         * elf64-alpha.c (elf64_alpha_output_extsym,
374         elf64_alpha_calc_got_offsets_for_symbol,
375         elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise.
376         * elf64-hppa.c (elf64_hppa_mark_exported_functions,
377         allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions,
378         elf_hppa_unmark_useless_dynamic_symbols,
379         elf_hppa_remark_useless_dynamic_symbols): Likewise.
380         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust,
381         adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs,
382         readonly_dynrelocs, merge_global_got, reallocate_got,
383         undo_symbol_twiddle): Likewise.
384         * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
385         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
386         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs,
387         elf_x86_64_readonly_dynrelocs): Likewise.
388         * elflink.c (elf_link_renumber_hash_table_dynsyms,
389         elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol,
390         _bfd_elf_link_find_version_dependencies,
391         _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol,
392         _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets,
393         elf_collect_hash_codes, elf_collect_gnu_hash_codes,
394         elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol,
395         elf_gc_propagate_vtable_entries_used,
396         elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol,
397         elf_gc_allocate_got_offsets): Likewise.
398         * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free,
399         elfNN_ia64_global_dyn_sym_thunk): Likewise.
400         * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym,
401         mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise.
402         * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
403         * i386linux.c (linux_tally_symbols): Likewise.
404         * m68klinux.c (linux_tally_symbols): Likewise.
405         * sparclinux.c (linux_tally_symbols): Likewise.
406         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
407         * xcofflink.c (xcoff_post_gc_symbol): Likewise.
408
409         * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse
410         function.  Update all callers.
411         * aoutx.h (aout_link_write_other_symbol): Likewise.
412         * pdp11.c (aout_link_write_other_symbol): Likewise.
413         * cofflink.c (_bfd_coff_write_global_sym): Likewise.
414         * ecoff.c (ecoff_link_write_external): Likewise.
415         * xcofflink.c (xcoff_write_global_symbol): Likewise.
416         * vms-alpha.c (alpha_vms_link_output_symbol): Likewise.  Handle
417         warning symbols.
418         * ecoff.c (ecoff_link_hash_traverse): Delete.
419         * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for
420         _bfd_coff_write_global_sym.
421         * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype.
422         * libcoff.h: Regenerate.
423
424 2011-06-10  Nick Clifton  <nickc@redhat.com>
425
426         * elflink.c (_bfd_elf_link_create_dynamic_sections): If the
427         backend does not provide a function for creating dynamic sections
428         then fail.
429         (bfd_elf_final_link): Issue a warning message if a dynamic section
430         has the SHT_NOTE type.
431         (bfd_elf_final_link): Do not look for dynamic strings in a section
432         that does not have the SHT_STRTAB type or the name .dynstr.
433         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Fail if the got
434         section is not in the output binary.
435         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Likewise.
436
437 2011-06-09  Tristan Gingold  <gingold@adacore.com>
438
439         * elfnn-ia64.c (elfNN_ia64_relax_section, elfNN_ia64_choose_gp)
440         (elfNN_ia64_relocate_section, elfNN_vms_object_p): Remove trailing
441         spaces.
442
443 2011-06-09  Tristan Gingold  <gingold@adacore.com>
444
445         * bfd.c (bfd_get_sign_extend_vma): Handle aixcoff.
446
447 2011-06-09  Nick Clifton  <nickc@redhat.com>
448
449         PR ld/12845
450         * elf.c (_bfd_elf_init_private_section_data): Add an assertion
451         that the output section has an allocated bfd_elf_section_data
452         structure.
453         * elfxx-mips.c (mips_elf_check_symbols): Do not create a stub for
454         symbols in sections that have been removed by garbage collection.
455
456 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
457
458         * elf64-x86-64.c (elf_x86_64_check_relocs): Allow R_X86_64_64
459         relocations in SEC_DEBUGGING sections when building shared
460         libraries.
461
462 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
463
464         PR ld/12851
465         * elflink.c (elf_gc_sweep): Don't check SHT_NOTE sections here.
466         (bfd_elf_gc_sections): Also check SHT_NOTE sections.
467
468 2011-06-08  Tristan Gingold  <gingold@adacore.com>
469
470         * makefile.vms (OBJS): Add elfxx-ia64.obj
471         Remove vax case.
472
473 2011-06-08  Alan Modra  <amodra@gmail.com>
474
475         * aix386-core.c, * cisco-core.c, * hpux-core.c, * osf-core.c,
476         * sco5-core.c: Init match_priority field.
477
478 2011-06-08  Alan Modra  <amodra@gmail.com>
479
480         * elflink.c (_bfd_elf_archive_symbol_lookup): Follow warning and
481         indirect links here.
482
483 2011-06-07  Joel Brobecker  <brobecker@adacore.com>
484
485         * irix-core.c (irix_core_vec): Add match_priority field.
486
487 2011-06-06  Alan Modra  <amodra@gmail.com>
488
489         * targets.c (bfd_target): Make ar_max_namelen an unsigned char.
490         Add match_priority.
491         * configure.in: Bump bfd version.
492         * elfcode.h (elf_object_p): Delete hacks preventing match of
493         EM_NONE and ELFOSABI_NONE targets when a better match exists.
494         * elfxx-target.h (elf_match_priority): Define and use.
495         * format.c (bfd_check_format_matches): Use target match_priority
496         to choose best of multiple matching targets.  In cases with multiple
497         matches rerun _bfd_check_format if we don't choose the last match.
498         * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c,
499         * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c,
500         * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c,
501         * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c,
502         * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h,
503         * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c,
504         * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c,
505         * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c,
506         * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c,
507         * vms-lib.c, * xsym.c: Init match_priority field.
508         * configure: Regenerate.
509         * bfd-in2.h: Regenerate.
510
511 2011-06-04  H.J. Lu  <hongjiu.lu@intel.com>
512
513         PR ld/12842
514         * elfcode.h (elf_object_p): Revert the last change.
515
516 2011-06-04  Alan Modra  <amodra@gmail.com>
517
518         * archures.c (bfd_arch_get_compatible): If one arch is unknown,
519         return the other arch.
520         * elfcode.h (elf_object_p): Allow explicit match to generic ELF
521         target.
522
523 2011-06-03  Bertram Felgenhauer  <bertram.felgenhauer@gmail.com>
524
525         PR ld/12682
526         * hash.c (higher_primer_number): Add more, small, prime numbers.
527         (bfd_hash_set_default_size): Likewise.
528
529 2011-06-02  Nick Clifton  <nickc@redhat.com>
530
531         * coff-mcore.c: Fix spelling typo.
532         * coff-stgo32.c: Likewise.
533         * elf32-arm.c: Likewise.
534         * elf32-avr.c: Likewise.
535         * elf-m68hc1x.c: Likewise.
536         * elf32-mcore.c: Likewise.
537         * elf32-mep.c: Likewise.
538         * elf32-mt.c: Likewise.
539         * elf32-ppc.c: Likewise.
540         * elf32-xtensa.c: Likewise.
541         * elf64-ppc.c: Likewise.
542         * elfxx-mips.c: Likewise.
543         * netbsd.h: Likewise.
544         * nlmcode.h: Likewise.
545         * vms-alpha.c: Likewise.
546         * po/bfd.pot: Regenerate.
547         * po/SRC-POTFILES.in: Regenerate.
548
549 2011-06-01  DJ Delorie  <dj@redhat.com>
550
551         * config.bfd: Add bfd_elf32_rx_be_ns_vec.
552         * target.c: Likewise.
553         * configure.in: Likewise.
554         * configure.in: Regenerate.
555         * elf32-rx.c: Add elf32-rx-be-ns target.
556         (rx_elf_object_p): Never allow the be-ns target by default,
557         only allow it if the user requests it.
558
559 2011-06-01  H.J. Lu  <hongjiu.lu@intel.com>
560
561         * elf32-i386.c (elf_i386_size_dynamic_sections): Properly warn
562         relocation in readonly section in a shared object.
563         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
564
565 2011-05-31  Nick Clifton  <nickc@redhat.com>
566
567         * archive.c (adjust_relative_path): Fix comment to prevent it
568         corrupting the auto-generated bfd.h.
569
570 2011-05-31  Paul Brook  <paul@codesourcery.com>
571
572         * elf32-arm.c (elf32_arm_final_link_relocate): Only do bl conversion
573         for known functions.
574         (elf32_arm_swap_symbol_in): Only set ST_BRANCH_TO_ARM for function
575         symbols.
576
577 2011-05-31  Paul Brook  <paul@codesourcery.com>
578
579         * elf32-arm.c (arm_stub_is_thumb): Add
580         arm_stub_long_branch_v4t_thumb_tls_pic.
581         (elf32_arm_final_link_relocate): TLS stubs are always ARM.
582         Handle Thumb stubs.
583
584 2011-05-27  Nick Clifton  <nickc@redhat.com>
585
586         PR binutils/12710
587         * archive.c (_bfd_get_elt_at_filepos): Set correct error value if
588         unable to read a file pointed to by an entry in a thin archive.
589         (adjust_relative_path): Use lrealpath to canonicalize paths.
590         Handle the case where the reference path is above the current
591         path in the directory tree.
592
593 2011-05-26  H.J. Lu  <hongjiu.lu@intel.com>
594
595         PR ld/12809
596         * elf64-x86-64.c (elf_x86_64_relocate_section): Handle
597         R_X86_64_TPOFF64 in executable.
598
599 2011-05-26  Alan Modra  <amodra@gmail.com>
600
601         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Remove most of comment.
602         * elflink.c (_bfd_elf_symbol_refs_local_p): Expand
603         local_protected comment.
604
605 2011-05-25  Tristan Gingold  <gingold@adacore.com>
606
607         * configure.in (bfd_elf32_ia64_big_vec, bfd_elf32_ia64_hpux_big_vec)
608         (bfd_elf64_ia64_big_vec, bfd_elf64_ia64_hpux_big_vec)
609         (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_vms_vec): Add elfxx-ia64.lo
610         * Makefile.am (BFD64_BACKENDS): Add elfxx-ia64.lo
611         (BFD64_BACKENDS_CFILES): Add elfxx-ia64.c
612         (elf32-ia64.c): Created from elfnn-ia64.c
613         (elf64-ia64.c): Likewise.
614         * elfxx-ia64.h: New file.
615         * elfxx-ia64.c: Split with elfnn-ia64.c.  Keep only the following
616         functions.Includes elfxx-ia64.h.
617         (elfNN_ia64_reloc): Renames to ia64_elf_reloc.  Adjust error message.
618         (IA64_HOWTO): Adjust.
619         (lookup_howto): Renames to ia64_elf_lookup_howto.  Make it public.
620         (elfNN_ia64_reloc_type_lookup): Renames to
621         ia64_elf_reloc_type_lookup. Make it public. Adjust calls.
622         (elfNN_ia64_reloc_name_lookup): Renames to
623         ia64_elf_reloc_name_lookup. Make it public.
624         (elfNN_ia64_relax_br): Renames to ia64_elf_relax_br.  Make it public.
625         (elfNN_ia64_relax_brl): Renames to ia64_elf_relax_brl. Make it
626         public.
627         (elfNN_ia64_relax_ldxmov): Renames to ia64_elf_relax_ldxmov.
628         Move it and make it public.  Move prototype to elfxx-ia64.h
629         (elfNN_ia64_install_value): Renames to ia64_elf_install_value.
630         Move prototype to elfxx-ia64.h
631         * elfnn-ia64.c: New file, split from elfxx-ia64.c.
632         (elfNN_ia64_info_to_howto): Adjust calls.
633         (elfNN_ia64_relax_section): Adjust calls.
634         (count_dyn_reloc): Fix typo.
635         (elfNN_ia64_relocate_section): Adjust calls.
636         (elfNN_ia64_finish_dynamic_symbol): Likewise.
637         (bfd_elfNN_bfd_reloc_type_lookup)
638         (bfd_elfNN_bfd_reloc_name_lookup): Adjust macros.
639         * configure: Regenerate.
640         * Makefile.in: Regenerate.
641
642 2011-05-23  DJ Delorie  <dj@redhat.com>
643
644         * elf32-rx.c (rx_elf_object_p): When reading an RX object in, undo
645         the vma/lma swapping done in elf32_rx_modify_program_headers.
646
647 2011-05-23  Nick Clifton  <nickc@redhat.com>
648
649         * elf-m10300.c (mn10300_elf_mkobject): New function.
650         (bfd_elf32_mkobject): Define.
651
652 2011-05-23  Alan Modra  <amodra@gmail.com>
653
654         * elf-bfd.h: Comment typo fix.
655         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Delete.  Replace with
656         struct elf_dyn_relocs throughout.
657         * elf64-ppc.c (struct ppc_dyn_relocs): Likewise.
658
659 2011-05-23  Alan Modra  <amodra@gmail.com>
660
661         * elf32-frv.c: Use info->callbacks->einfo throughout file in linker
662         functions rather than warning callback or _bfd_error_handler.
663         * elf32-ppc.c: Likewise.
664         * elf64-ppc.c: Likewise.
665         * elf32-ppc.c (ppc_elf_tls_optimize): Use %H in __tls_get_addr lost
666         arg error.
667         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
668
669 2011-05-23  Alan Modra  <amodra@gmail.com>
670
671         PR 12763
672         * elf.c (assign_file_positions_for_load_sections): Set sh_offset for
673         .tbss, and page align same for all SHT_NOBITS sections.
674
675 2011-05-21  Alan Modra  <amodra@gmail.com>
676
677         PR 12763
678         * elf.c (_bfd_elf_make_section_from_shdr): Set up TLS section LMAs
679         from PT_TLS header.
680         (_bfd_elf_map_sections_to_segments): Don't create a final PT_LOAD
681         segment if just for .tbss.
682         (assign_file_positions_for_load_sections): Don't report "can't
683         allocate in segment" errors for .tbss.
684         (assign_file_positions_for_non_load_sections): Don't set p_filesz
685         from SHT_NOBITS section filepos.
686
687 2011-05-20  Bernd Schmidt  <bernds@codesourcery.com>
688
689         * elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for
690         R_C6000_PCR_H16 and R_C6000_PCR_L16.
691         (elf32_tic6x_relocate_section): Handle them.
692
693 2011-05-18  Nick Clifton  <nickc@redhat.com>
694
695         PR ld/12761
696         * elflink.c (elf_link_add_object_symbols): Process .gnu.warning
697         sections when building shared libraries.
698
699 2011-05-18  Rafał Krypa  <r.krypa@samsung.com>
700
701         PR ld/12778
702         * elf32-arm.c (elf32_arm_gc_sweep_hook): Use the computed dynamic
703         reloc pointer.
704
705 2011-05-18  Tristan Gingold  <gingold@adacore.com>
706
707         * xcofflink.c (xcoff_link_add_symbols): Handle C_DWARF symbols.
708         (xcoff_sweep): Always keep dwarf sections.
709         (xcoff_link_input_bfd): Handle dwarf symbols and sections.
710
711 2011-05-18  Tristan Gingold  <gingold@adacore.com>
712
713         * libxcoff.h (struct xcoff_dwsect_name): New type.
714         (XCOFF_DWSECT_NBR_NAMES): New macro.
715         (xcoff_dwsect_names): Declare.
716         * coffcode.h (sec_to_styp_flags): Handle xcoff dwarf sections.
717         (styp_to_sec_flags): Ditto.
718         (coff_new_section_hook): Ditto.
719         (coff_slurp_symbol_table): Handle C_DWARF and C_INFO.
720         * coff-rs6000.c (xcoff_dwsect_name): New variable.
721
722 2011-05-17  Tomohiro Kashiwada  <kikairoya@gmail.com>
723
724         PR ld/12759
725         * elf32-rx.c (ignore_lma): New variable.
726         (bfd_elf32_rx_set_target_flags): Add ignore_lma parameter.
727         (rx_modify_program_headers): Only copy the LMA into the VMA if
728         ignore_lma is true.
729
730 2011-05-17  Alan Modra  <amodra@gmail.com>
731
732         PR ld/12760
733         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Adjust "notice" call.
734         * elflink.c (elf_link_add_object_symbols): Likewise.
735         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
736
737 2011-05-16  Alan Modra  <amodra@gmail.com>
738
739         * linker.c (_bfd_generic_link_add_one_symbol): Don't init u.undef.weak.
740
741 2011-05-15  Richard Sandiford  <rdsandiford@googlemail.com>
742
743         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Record both local and
744         global GOT entries for GOT_PAGE relocations against global symbols.
745
746 2011-05-13  Bernd Schmidt  <bernds@codesourcery.com>
747
748         * config.bfd (tic6x-*-elf, tic6x-*-uclinux): New.
749         (tic6x-*-*): Replaced by these.
750         * elf32-tic6x.c (elf32_tic6x_set_osabi): New static function.
751         (elf32_tic6x_check_relocs): Create dynamic sections if -shared.
752         (elf_backend_relocs_compatible, elf_backend_post_process_headers):
753         Define.
754         (elf32_bed, TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM,
755         TARGET_BIG_NAME, ELF_OSABI): Redefine twice, and include
756         "elf32-target.h" two more times.
757         * configure.in: Handle bfd_elf32_tic6x_linux_be_vec,
758         bfd_elf32_tic6x_linux_le_vec, bfd_elf32_tic6x_elf_be_vec and
759         bfd_elf32_tic6x_elf_le_vec.
760         * configure: Regenerate.
761
762 2011-05-13  Jan Beulich  <jbeulich@novell.com>
763
764         * config.bfd: Add targets x86_64-*-pe and x86_64-*-pep.
765
766 2011-05-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
767
768         * config.in: Regenerated.
769         * configure: Regenerated.
770         * configure.in: New tests for HAVE_PRPSINFO_T_PR_PID,
771         HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and
772         HAVE_PSINFO32_T_PR_PID.
773         * elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by
774         HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID
775         and HAVE_PSINFO32_T_PR_PID.
776         * hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition.
777
778 2011-05-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
779
780         * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and
781         32bit psinfo.
782         * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid.
783         * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise.
784
785 2011-05-09  Paul Brook  <paul@codesourcery.com>
786
787         * bfd-in.h (elf32_tic6x_fix_exidx_coverage): Add prototype.
788         * bfd-in2.h: Regenerate.
789         * elf32-tic6x.c: Include limits.h.
790         (tic6x_unwind_edit_type, tic6x_unwind_table_edit,
791         _tic6x_elf_section_data): New.
792         (elf32_tic6x_section_data): Define.
793         (elf32_tic6x_new_section_hook): Allocate target specific data.
794         (elf32_tic6x_add_unwind_table_edit): New function.
795         (get_tic6x_elf_section_data, elf32_tic6x_adjust_exidx_size,
796         elf32_tic6x_insert_cantunwind_after, elf32_tic6x_add_low31,
797         elf32_tic6x_copy_exidx_entry): New functions.
798         (elf_backend_write_section): Define.
799
800 2011-05-09  Paul Brook  <paul@codesourcery.com>
801
802         * elf32-tic6x.c (is_tic6x_elf_unwind_section_name,
803         elf32_tic6x_fake_sections): New functions.
804         (elf_backend_fake_sections): Define.
805
806 2011-05-09  Paul Brook  <paul@codesourcery.com>
807
808         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function.
809         (elf_backend_gc_mark_extra_sections): Define.
810
811 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
812
813         PR ld/12365
814         * cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
815         references to symbols defined in discarded sections.
816
817 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
818
819         PR ld/12365
820         * coffgen.c (coff_write_symbol): Assume input section is its own
821         output section if output_section member not set.
822         (coff_write_alien_symbol): Likewise.
823
824 2011-05-07  H.J. Lu  <hongjiu.lu@intel.com>
825
826         PR ld/12730
827         * elf.c (_bfd_elf_section_offset): Check SEC_ELF_REVERSE_COPY.
828
829         * elflink.c (elf_link_input_bfd): Reverse copy .ctors/.dtors
830         sections if needed.
831
832         * section.c (SEC_ELF_REVERSE_COPY): New.
833         * bfd-in2.h: Regenerated.
834
835 2011-05-07  Anders Kaseorg  <andersk@ksplice.com>
836
837         PR 12739
838         * libbfd.c (bfd_get_8, bfd_get_signed_8): Use const cast.
839         * bfd-in2.h: Regenerate.
840
841 2011-05-06  Tristan Gingold  <gingold@adacore.com>
842
843         * vms-alpha.c (evax_section_flags): Remove SEC_IN_MEMORY.
844         (_bfd_vms_slurp_egsd): Rename old_flags to vms_flags.  Handle
845         any code section.  Add comments.
846         (alpha_vms_object_p): Use void * instead of PTR.
847         (alpha_vms_create_eisd_for_section): Fix test for setting DZRO.
848         (build_module_list): Guard against no DST section.  Add comments.
849         (alpha_vms_link_output_symbol): Discard undefined symbols.
850         (alpha_vms_get_section_contents): Simply memcpy if the section was
851         already loaded.  Fix typo.
852         (vms_new_section_hook): Use void * instead of PTR.
853         (vms_alpha_vec): Ditto.
854
855 2011-05-06  Richard Sandiford  <richard.sandiford@linaro.org>
856
857         * elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb
858         branch to a PLT entry, redirect it to the PLT's Thumb entry point.
859
860 2011-05-05  Bernd Schmidt  <bernds@codesourcery.com>
861
862         * elf32-tic6x.c (elf32_tic6x_final_link): New function.
863         (elf32_tic6x_merge_attributes): Do not warn for PID or PIC
864         mismatch.  Choose the lower of the two values.
865         (bfd_elf32_bfd_final_link): New macro.
866
867 2011-04-28  Tristan Gingold  <gingold@adacore.com>
868
869         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust for x_file.
870         (bfd_xcoff_swap_aux_out): Ditto.
871         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Ditto.
872         (bfd_xcoff64_swap_aux_out): Ditto.
873
874 2011-05-04  Alan Modra  <amodra@gmail.com>
875
876         PR ld/12727
877         * elf64-ppc.c (ppc_build_one_stub <ppc_sub_plt_call>): Clear
878         was_undefined on dot-symbols.
879
880 2011-05-03  Paul Brook  <paul@codesourcery.com>
881
882
883         * elf32-tic6x.c (elf32_tic6x_howto_table,
884         elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook,
885         elf32_tic6x_relocate_section, elf32_tic6x_check_relocs):
886         Add R_C6000_EHTYPE.
887
888 2011-05-01  Alan Modra  <amodra@gmail.com>
889
890         PR ld/12718
891         * elf32-i386.c (elf_i386_check_relocs): Ensure dynobj set before
892         creating ifunc sections.
893         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
894
895 2011-04-30  H.J. Lu  <hongjiu.lu@intel.com>
896
897         * elf64-x86-64.c (elf_x86_64_merge_symbol): Correct parameter
898         names.
899
900 2011-04-28  Tom Tromey  <tromey@redhat.com>
901
902         * bfdio.c (memory_bstat): Pass correct size to memset.
903
904 2011-04-28  Mike Frysinger  <vapier@gentoo.org>
905
906         * dwarf2.c (dwarf_debug_sections): Mark const.
907         * elf.c (special_sections): Likewise.
908         * libbfd-in.h (dwarf_debug_sections): Likewise.
909         * libbfd.h: Regenerate.
910
911 2011-04-26  Kai Tietz  <ktietz@redhat.com>
912
913         * coffcode.h (sec_to_styp_flags): Allow linkonce for
914         debugging sections.
915
916 2011-04-26  Tristan Gingold  <gingold@adacore.com>
917
918         * coff64-rs6000.c: Convert to ISO-C.  Remove PARAMS and PTR macros.
919
920 2011-04-24  Alan Modra  <amodra@gmail.com>
921
922         PR ld/12365
923         PR ld/12696
924         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call.
925         * linker.c (_bfd_link_hash_newfunc): Clear bitfields.
926         (_bfd_generic_link_add_one_symbol): Update "notice" call.
927         * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when
928         it is a redef of an IR symbol in a real BFD.
929
930 2011-04-22  H.J. Lu  <hongjiu.lu@intel.com>
931
932         * elf32-i386.c (elf_i386_readonly_dynrelocs): Warn relocation
933         in readonly section in a shared object.
934         (elf_i386_size_dynamic_sections): Likewise.
935         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
936         (elf_x86_64_size_dynamic_sections): Likewise.
937
938 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
939
940         PR ld/12694
941         * elf32-i386.c (elf_i386_readonly_dynrelocs): Skip local IFUNC
942         symbols.
943         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
944
945 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
946
947         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Return false
948         on dynamic symbol error.
949         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
950
951 2011-04-20  Tristan Gingold  <gingold@adacore.com>
952
953         * config.bfd (alpha*-*-*vms*, ia64*-*-*vms*): Define targ_selvecs.
954
955 2011-04-20  Alan Modra  <amodra@gmail.com>
956
957         * hash.c (bfd_default_hash_table_size): Make it an unsigned long.
958         (bfd_hash_table_init_n): Overflow checking.
959         (bfd_hash_set_default_size): Return current size.  Take unsigned long
960         arg.  Add 65537 to hash_size primes.
961         * bfd-in.h (bfd_hash_set_default_size): Update prototype.
962         * bfd-in2.h: Regenerate.
963
964 2011-04-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
965
966         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Fix +1 overrun of
967         memmove elements.
968
969 2011-04-20  Alan Modra  <amodra@gmail.com>
970
971         * libbfd.c (bfd_log2): Do return rounded up value.
972         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Replace bfd_log2
973         call with expanded old round down version of the function.
974
975         * archive.c (_bfd_get_elt_at_filepos): Don't release n_nfd.
976         * elflink.c (elf_link_add_object_symbols): Delete redundant code.
977
978 2011-04-20  Alan Modra  <amodra@gmail.com>
979
980         PR ld/12365
981         * elfcode.h (elf_slurp_symbol_table): Put common plugin IR symbols
982         in their own common section.
983         * elflink.c (elf_link_add_object_symbols): Likewise.
984         * linker.c (generic_link_check_archive_element): Don't lose flags
985         if common section is pre-existing.
986         (_bfd_generic_link_add_one_symbol): Likewise.
987
988 2011-04-20  Alan Modra  <amodra@gmail.com>
989
990         PR ld/12365
991         * elflink.c (_bfd_elf_merge_symbol): Update multiple_common calls.
992         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.  Call
993         multiple_definition regardless of allow_multiple_definition.
994         * simple.c (simple_dummy_multiple_definition): Update.
995         * xcofflink.c (xcoff_link_add_symbols): Update multiple_definition
996         calls.
997
998 2011-04-18  Tristan Gingold  <gingold@adacore.com>
999
1000         * coff-rs6000.c: Convert to ISO-C.  Remove PARAMS macro.
1001
1002 2011-04-18  Alan Modra  <amodra@gmail.com>
1003
1004         PR ld/12365
1005         PR ld/12672
1006         * bfd.c (BFD_PLUGIN): Define.
1007         (BFD_FLAGS_SAVED, BFD_FLAGS_FOR_BFD_USE_MASK): Add BFD_PLUGIN.
1008         * bfd-in2.h: Regenerate.
1009         * elflink.c (elf_link_output_extsym): Strip undefined plugin syms.
1010         * opncls.c (bfd_make_readable): Don't lose original bfd flags.
1011
1012 2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
1013
1014         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Do not check for
1015         SEC_LOAD.
1016
1017 2011-04-15  Sergio Durigan Junior  <sergiodj@redhat.com>
1018
1019         * elf-bfd.h (struct sdt_note): New struct.
1020         (struct elf_obj_tdata) <sdt_note_head>: New field.
1021         * elf.c (elfobj_grok_stapsdt_note_1): New function.
1022         (elfobj_grok_stapsdt_note): Likewise.
1023         (elf_parse_notes): Added code to treat SystemTap note
1024         sections.
1025
1026 2011-04-12  Richard Henderson  <rth@redhat.com>
1027
1028         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Do not
1029         exclude empty .got sections.
1030
1031 2011-04-11  H.J. Lu  <hongjiu.lu@intel.com>
1032
1033         * elf32-i386.c (elf_i386_reloc_type_lookup): Fix the out of bound
1034         array access for BFD_RELOC_386_IRELATIVE.
1035
1036 2011-04-11  Bernd Schmidt  <bernds@codesourcery.com>
1037
1038         * elf32-tic6x.c (elf32_tic6x_check_relocs): Initialize pc_count field.
1039
1040 2011-04-11  Mark Wielaard  <mjw@redhat.com>
1041
1042         PR 10549
1043         * elf-bfd.h (has_ifunc_symbols): Renamed to has_gnu_symbols.
1044         (has_gnu_symbols): Renamed from has_ifunc_symbols.
1045         * elf.c (_bfd_elf_set_osabi): Use new has_gnu_symbols name.
1046         * elf32-arm.c (elf32_arm_add_symbol_hook): Set has_gnu_symbols
1047         also if STB_GNU_UNIQUE symbol binding was seen.
1048         * elf32-i386.c (elf_i386_add_symbol_hook): Likewise.
1049         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
1050         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
1051         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
1052         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
1053         * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
1054
1055 2011-04-11  Alan Modra  <amodra@gmail.com>
1056
1057         * bfd-in.h (bfd_get_section_limit): Don't use rawsize with output
1058         sections.
1059         * libbfd.c (_bfd_generic_get_section_contents): Likewise.
1060         (_bfd_generic_get_section_contents_in_window): Likewise.
1061         * section.c (bfd_get_section_contents): Likewise.
1062         * compress.c (bfd_get_full_section_contents): Likewise.
1063         * elf32-rx.c (rx_final_link): Ignore rawsize.
1064         * elf32-microblaze.c (microblaze_elf_relocate_section): Use correct
1065         bfd with bfd_get_section_limit.
1066         * elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter.  Use
1067         os->size during final link.  Update callers.
1068         * bfd-in2.h: Regenerate.
1069
1070 2011-04-10  Richard Sandiford  <rdsandiford@googlemail.com>
1071
1072         PR ld/12637
1073         * elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count
1074         as the number of global entries when merging with the primary GOT.
1075
1076 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1077
1078         * elf32-i386.c: Update copyright year.
1079         * elf64-x86-64.c: Likewise.
1080
1081 2011-04-09  Kai Tietz  <ktietz@redhat.com>
1082
1083         * peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary
1084         buffer and use rawsize for sorting.
1085         * coffcode.h (coff_compute_section_file_positions): Set rawsize
1086         before doing alignment.
1087
1088 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1089
1090         * elf32-i386.c (elf_i386_relocate_section): Return relocation
1091         error on unsupported relocation.
1092         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1093
1094 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1095
1096         PR binutils/12657
1097         * hosts/x86-64linux.h (elf_prstatus32): Replace __pid_t with
1098         pid_t.
1099
1100 2011-04-08  H.J. Lu  <hongjiu.lu@intel.com>
1101
1102         PR ld/12654
1103         * elf32-i386.c (elf_i386_relocate_section): Check !executable
1104         instead of shared for R_386_TLS_LDO_32.
1105
1106 2011-04-08  Tristan Gingold  <gingold@adacore.com>
1107
1108         * Makefile.am (SOURCE_HFILES): Remove xcoff-target.h
1109         * coff-pmac: Remove
1110         * xcoff-target.h: Remove
1111         * Makefile.in: Regenerate.
1112
1113 2011-04-07  Cary Coutant  <ccoutant@google.com>
1114
1115         * dwarf2.c (scan_unit_for_symbols): Check for DW_AT_specification.
1116
1117 2011-04-07  Paul Brook  <paul@codesourcery.com>
1118
1119         * elf32-tic6x.c (elf32_tic6x_howto_table): R_C6000_PREL31 is
1120         pc-relative.
1121         (elf32_tic6x_howto_table_rel): Ditto.
1122         (elf32_tic6x_relocate_section): Implement R_C6000_PREL31.
1123         (elf32_tic6x_check_relocs): Ditto.
1124
1125 2011-04-06  Joseph Myers  <joseph@codesourcery.com>
1126
1127         * config.bfd (thumb-*-oabi): Don't handle in list of obsolete
1128         targets.
1129         (strongarm*, thumb*, xscale*): Remove architectures.
1130         (strongarm-*-kaos*, thumb-*-coff, thumb-*-elf, thumb-epoc-pe*,
1131         thumb-*-pe*, strongarm-*-elf, strongarm-*-coff, xscale-*-elf,
1132         xscale-*-coff): Remove targets.
1133
1134 2011-04-01  Tristan Gingold  <gingold@adacore.com>
1135
1136         * elfxx-ia64.c: include bfd_stdint.h
1137
1138 2011-03-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
1139
1140         * elf32-tic6x.c (elf32_tic6x_relocate_section): Remove unused variable
1141         dynobj and its initialization.
1142
1143 2011-03-31  Tristan Gingold  <gingold@adacore.com>
1144
1145         * makefile.vms (DEFS): Add HAVE_bfd_elf64_ia64_vms_vec.
1146         * configure.com: Set BFD_HOST_64BIT_LONG_LONG and
1147         BFD_HOST_LONG_LONG to 1.
1148
1149 2011-03-31  Tristan Gingold  <gingold@adacore.com>
1150
1151         * vms-alpha.c (vms_get_remaining_object_record): Fix dec-c warning.
1152         (_bfd_vms_write_etir): Ditto.
1153         (_bfd_vms_slurp_etir): Avoid to use intptr_t
1154         * configure.com: Generate bfd_stdint.h
1155
1156 2011-03-31  Bernd Schmidt  <bernds@codesourcery.com>
1157
1158         * elf32-tic6x.h (struct elf32_tic6x_params): New.
1159         (elf32_tic6x_setup): Declare.
1160         * elf32-tic6x.c: Include <limits.h>.
1161         (ELF_DYNAMIC_LINKER, DEFAULT_STACK_SIZE, PLT_ENTRY_SIZE): Define.
1162         (struct elf32_tic6x_link_hash_table, struct elf32_link_hash_entry):
1163         New structures.
1164         (elf32_tic6x_link_hash_table, is_tic6x_elf): New macros.
1165         (tic6x_elf_scom_section, tic6x_elf_scom_symbol,
1166         tic6x_elf_scom_symbol_ptr): New static variables.
1167         (elf32_tic6x_howto_table, elf32_tic6x_howto_table_rel,
1168         elf32_tic6x_reloc_map): Add R_C6000_JUMP_SLOT, R_C6000_EHTYPE,
1169         R_C6000_PCR_H16 and R_C6000_PCR_L16.
1170         (elf32_tic6x_link_hash_newfunc, elf32_tic6x_link_hash_table_create,
1171         elf32_tic6x_link_hash_table_free, elf32_tic6x_setup,
1172         elf32_tic6x_using_dsbt, elf32_tic6x_install_rela,
1173         elf32_tic6x_create_dynamic_sections, elf32_tic6x_make_got_dynreloc,
1174         elf32_tic6x_finish_dynamic_symbol, elf32_tic6x_gc_sweep_hook,
1175         elf32_tic6x_adjust_dynamic_symbol): New static functions.
1176         (elf32_tic6x_relocate_section): For R_C6000_PCR_S21, convert branches
1177         to weak symbols as required by the ABI.
1178         Handle GOT and DSBT_INDEX relocs, and copy relocs to the output file
1179         as needed when generating DSBT output.
1180         (elf32_tic6x_check_relocs, elf32_tic6x_add_symbol_hook,
1181         elf32_tic6x_symbol_processing, elf32_tic6x_section_from_bfd_section,
1182         elf32_tic6x_allocate_dynrelocs, elf32_tic6x_size_dynamic_sections,
1183         elf32_tic6x_always_size_sections, elf32_tic6x_modify_program_headers,
1184         elf32_tic6x_finish_dynamic_sections, elf32_tic6x_plt_sym_val,
1185         elf32_tic6x_copy_private_data, elf32_tic6x_link_omit_section_dynsym):
1186         New static functions.
1187         (ELF_MAXPAGESIZE): Define to 0x1000.
1188         (bfd_elf32_bfd_copy_private_bfd_data,
1189         bfd_elf32_bfd_link_hash_table_create,
1190         bfd_elf32_bfd_link_hash_table_free, elf_backend_can_refcount,
1191         elf_backend_want_got_plt, elf_backend_want_dynbss,
1192         elf_backend_plt_readonly, elf_backend_got_header_size,
1193         elf_backend_gc_sweep_hook, elf_backend_modify_program_headers,
1194         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
1195         elf_backend_check_relocs, elf_backend_add_symbol_hook,
1196         elf_backend_symbol_processing, elf_backend_link_output_symbol_hook,
1197         elf_backend_section_from_bfd_section,
1198         elf_backend_finish_dynamic_symbol, elf_backend_always_size_sections,
1199         elf32_tic6x_size_dynamic_sections, elf_backend_finish_dynamic_sections,
1200         elf_backend_omit_section_dynsym, elf_backend_plt_sym_val): Define.
1201
1202         * bfd/reloc.c (BFD_RELOC_C6000_JUMP_SLOT, BFD_RELOC_C6000_EHTYPE,
1203         BFD_RELOC_C6000_PCR_H16, BFD_RELOC_C6000_PCR_S16): Add.
1204         * bfd/bfd-in2.h: Regenerate.
1205         * bfd/libbfd.h: Regenerate.
1206         * config.bfd: Accept tic6x-*-* instead of tic6x-*-elf.
1207
1208 2011-03-31  Tristan Gingold  <gingold@adacore.com>
1209
1210         * coffcode.h (coff_slurp_symbol_table): Silently discard C_NULL
1211         entry on xcoff when value is C_NULL_VALUE.
1212
1213 2011-03-31  Tristan Gingold  <gingold@adacore.com>
1214
1215         * libcoff-in.h (exec_hdr): Remove.
1216         * libcoff.h: Regenerate.
1217
1218 2011-03-30  Nick Clifton  <nickc@redhat.com>
1219
1220         * po/da.po: Updated Danish translation.
1221
1222 2011-03-29  Richard Henderson  <rth@redhat.com>
1223
1224         * elf64-alpha.c (elf64_alpha_gc_mark_hook): New.
1225         (elf64_alpha_gc_sweep_hook): New.
1226         (elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook): New.
1227         (elf_backend_can_gc_sections): New.
1228
1229 2011-03-26  John Marino  <binutils@marino.st>
1230
1231         * config.bfd: Add x86_64-*-dragonfly*, fix i386-*-dragonfly*.
1232         * configure.in: Delete unused bfd_elf32_i386_dragonfly_vec.
1233         * configure: Regenerate.
1234
1235 2011-03-25  Michael Snyder  <msnyder@vmware.com>
1236
1237         * coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.
1238
1239 2011-03-25  Tristan Gingold  <gingold@adacore.com>
1240
1241         * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Allow the use
1242         of find_nearest_line on object files.
1243
1244 2011-03-25  Tristan Gingold  <gingold@adacore.com>
1245
1246         * vms-alpha.c (evax_section_flags): Make $CODE$ section read-only.
1247         Minor reordering.
1248         (alpha_vms_create_eisd_for_section): Make code sections read-only.
1249
1250 2011-03-24  Alan Modra  <amodra@gmail.com>
1251
1252         * elf32-ppc.c (ppc_elf_tls_optimize): Catch more cases where
1253         old-style __tls_get_addr calls without marker relocs don't match
1254         their arg setup insn one for one.  If such mismatches are found
1255         report the reloc and don't do any tls optimization.
1256         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
1257
1258 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
1259
1260         * bfd-in2.h: Regenerate.
1261
1262 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
1263
1264         * archures.c: Add AVR XMEGA architecture information.
1265         * cpu-avr.c (arch_info_struct): Likewise.
1266         * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
1267         (elf32_avr_object_p): Likewise.
1268
1269 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
1270
1271         * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation.
1272         * bfd-in2.h: Regenerate.
1273         * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition
1274         to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE
1275         entry.
1276         (elf32_arm_howto_from_type): Update accordingly.
1277         (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE.
1278         (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3.
1279         (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry
1280         with an extra noncall_refcount field.
1281         (arm_local_iplt_info): New structure.
1282         (elf_arm_obj_tdata): Add local_iplt.
1283         (elf32_arm_local_iplt): New accessor macro.
1284         (elf32_arm_link_hash_entry): Replace plt_thumb_refcount,
1285         plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info.
1286         Change tls_type to a bitfield and add is_iplt.
1287         (elf32_arm_link_hash_newfunc): Update accordingly.
1288         (elf32_arm_allocate_local_sym_info): New function.
1289         (elf32_arm_create_local_iplt): Likewise.
1290         (elf32_arm_get_plt_info): Likewise.
1291         (elf32_arm_plt_needs_thumb_stub_p): Likewise.
1292         (elf32_arm_get_local_dynreloc_list): Likewise.
1293         (create_ifunc_sections): Likewise.
1294         (elf32_arm_copy_indirect_symbol): Update after the changes to
1295         elf32_arm_link_hash_entry.  Assert the is_iplt has not yet been set.
1296         (arm_type_of_stub): Add an st_type argument.  Use elf32_arm_get_plt_info
1297         to get PLT information.  Assert that all STT_GNU_IFUNC references
1298         are turned into PLT references.
1299         (arm_build_one_stub): Pass the symbol type to
1300         elf32_arm_final_link_relocate.
1301         (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub.
1302         (elf32_arm_allocate_irelocs): New function.
1303         (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for
1304         all R_ARM_IRELATIVE.
1305         (elf32_arm_allocate_plt_entry): New function.
1306         (elf32_arm_populate_plt_entry): Likewise.
1307         (elf32_arm_final_link_relocate): Add an st_type parameter.
1308         Set srelgot to null for static objects.  Use separate variables
1309         to record which st_value and st_type should be used when generating
1310         a dynamic relocation.  Use elf32_arm_get_plt_info to find the
1311         symbol's PLT information, setting has_iplt_entry, splt,
1312         plt_offset and gotplt_offset accordingly.  Check whether
1313         STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change
1314         the relocation target accordingly.  Broaden assert to include
1315         .iplts.  Don't set sreloc for static relocations.  Assert that
1316         we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32
1317         and R_ARM_ABS32_NOI.  Generate R_ARM_IRELATIVE relocations instead
1318         of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC
1319         symbol.  Pass the symbol type to arm_type_of_stub.  Conditionally
1320         resolve GOT references to the .igot.plt entry.
1321         (elf32_arm_relocate_section): Update the call to
1322         elf32_arm_final_link_relocate.
1323         (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT
1324         information.  Treat R_ARM_REL32 and R_ARM_REL32_NOI as call
1325         relocations in shared libraries and relocatable executables.
1326         Count non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
1327         to get the list of dynamic relocations for a local symbol.
1328         (elf32_arm_check_relocs): Always create ifunc sections.  Set isym
1329         at the same time as setting h.  Use elf32_arm_allocate_local_sym_info
1330         to allocate local symbol information.  Treat R_ARM_REL32 and
1331         R_ARM_REL32_NOI as call relocations in shared libraries and
1332         relocatable executables.  Record PLT information for local
1333         STT_GNU_IFUNC functions as well as global functions.   Count
1334         non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
1335         to get the list of dynamic relocations for a local symbol.
1336         (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols.
1337         Don't remove STT_GNU_IFUNC PLTs unless all references have been
1338         removed.  Update after the changes to elf32_arm_link_hash_entry.
1339         (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT
1340         entries should live in .plt or .iplt.  Check whether the .igot.plt
1341         and .got entries can be combined.  Use elf32_arm_allocate_plt_entry
1342         to allocate .plt and .(i)got.plt entries.  Detect which .got
1343         entries will need R_ARM_IRELATIVE relocations and use
1344         elf32_arm_allocate_irelocs to allocate them.  Likewise other
1345         non-.got dynamic relocations.
1346         (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt
1347         and dynamic relocations for local STT_GNU_IFUNC symbols.
1348         Check whether the .igot.plt and .got entries can be combined.
1349         Detect which .got entries will need R_ARM_IRELATIVE relocations
1350         and use elf32_arm_allocate_irelocs to allocate them.  Use stashed
1351         section pointers intead of strcmp checks.  Handle iplt and igotplt.
1352         (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry
1353         to fill in .plt, .got.plt and .rel(a).plt entries.  Point
1354         STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations
1355         resolve to it.
1356         (elf32_arm_output_plt_map_1): New function, split out from
1357         elf32_arm_output_plt_map.  Handle .iplt entries.  Use
1358         elf32_arm_plt_needs_thumb_stub_p.
1359         (elf32_arm_output_plt_map): Call it.
1360         (elf32_arm_output_arch_local_syms): Add mapping symbols for
1361         local .iplt entries.
1362         (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols.
1363         (elf32_arm_swap_symbol_out): Likewise.
1364         (elf32_arm_add_symbol_hook): New function.
1365         (elf_backend_add_symbol_hook): Define for all targets.
1366
1367 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
1368
1369         * elf-bfd.h (elf_link_hash_entry): Add target_internal.
1370         * elf.c (swap_out_syms): Set st_target_internal for each
1371         Elf_Internal_Sym.
1372         * elfcode.h (elf_swap_symbol_in): Likewise.
1373         * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
1374         * elf32-sh-symbian.c (sh_symbian_relocate_section): Likewise.
1375         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
1376         * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1377         * elflink.c (elf_link_output_extsym): Likewise.
1378         (bfd_elf_final_link): Likewise.
1379         (elf_link_add_object_symbols): Copy st_target_internal
1380         to the hash table if we see a definition.
1381         (_bfd_elf_copy_link_hash_symbol_type): Copy target_internal.
1382         * elf32-arm.c (elf32_arm_stub_hash_entry): Replace st_type with
1383         a branch_type field.
1384         (a8_erratum_fix, a8_erratum_reloc): Likewise.
1385         (arm_type_of_stub): Replace actual_st_type with an
1386         actual_branch_type parameter.
1387         (arm_build_one_stub): Use branch types rather than st_types to
1388         determine the type of branch.
1389         (cortex_a8_erratum_scan): Likewise.
1390         (elf32_arm_size_stubs): Likewise.
1391         (bfd_elf32_arm_process_before_allocation): Likewise.
1392         (allocate_dynrelocs_for_symbol): Likewise.
1393         (elf32_arm_finish_dynamic_sections): Likewise.
1394         (elf32_arm_final_link_relocate): Replace sym_flags parameter with
1395         a branch_type parameter.
1396         (elf32_arm_relocate_section): Update call accordingly.
1397         (elf32_arm_adjust_dynamic_symbol): Don't check STT_ARM_TFUNC.
1398         (elf32_arm_output_map_sym): Initialize st_target_internal.
1399         (elf32_arm_output_stub_sym): Likewise.
1400         (elf32_arm_symbol_processing): Delete.
1401         (elf32_arm_swap_symbol_in): Convert STT_ARM_TFUNCs into STT_FUNCs.
1402         Use st_target_internal to record the branch type.
1403         (elf32_arm_swap_symbol_out): Use st_target_internal to test for
1404         Thumb functions.
1405         (elf32_arm_is_function_type): Delete.
1406         (elf_backend_symbol_processing): Likewise.
1407         (elf_backend_is_function_type): Likewise.
1408
1409 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
1410
1411         * elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj.
1412         (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion
1413         into the PLT block.
1414
1415 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
1416
1417         * elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p,
1418         may_need_local_target_p and may_become_dynamic_p to classify
1419         the relocation type.  Don't check info->symbolic or h->def_regular
1420         when deciding whether to record a potential dynamic reloc.
1421         Don't treat potential dynamic relocs as PLT references.
1422         (elf32_arm_gc_sweep_hook): Update to match.  Assert that we don't
1423         try to make the PLT reference count go negative.
1424
1425 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
1426
1427         * elf32-arm.c (elf32_arm_final_link_relocate): Always fill in the
1428         GOT entry here, rather than leaving it to finish_dynamic_symbol.
1429         Only create a dynamic relocation for local references if
1430         info->shared.
1431         (allocate_dynrelocs_for_symbol): Update dynamic relocation
1432         allocation accordingly.
1433         (elf32_arm_finish_dynamic_symbol): Don't initialise the GOT entry here.
1434
1435 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
1436
1437         * elf32-arm.c (elf32_arm_allocate_dynrelocs): New function.
1438         (elf32_arm_add_dynreloc): Likewise.
1439         (elf32_arm_adjust_dynamic_symbol): Use elf32_arm_allocate_dynrelocs
1440         to allocate dynamic relocations.
1441         (elf32_arm_size_dynamic_sections): Likewise.
1442         (allocate_dynrelocs): Likewise.  Rename to
1443         allocate_dynrelocs_for_symbol.
1444         (elf32_arm_final_link_relocate): Use elf32_arm_add_dynreloc to
1445         create dynamic relocations.
1446         (elf32_arm_finish_dynamic_symbol): Likewise.
1447
1448 2011-03-12  H.J. Lu  <hongjiu.lu@intel.com>
1449
1450         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
1451         x32 GD->IE and GD->LE transitions.
1452         (elf_x86_64_relocate_section): Supprt TLS x32 GD->IE, GD->LE
1453         and LD->LE transitions.
1454
1455 2011-03-10  Alan Modra  <amodra@gmail.com>
1456
1457         * elf64-ppc.c (ppc64_elf_relocate_section): Provide section/offset
1458         for LO_DS error message and correct multiple.
1459
1460 2011-03-10  Alan Modra  <amodra@gmail.com>
1461
1462         * elf64-ppc.c (bfd_elf64_bfd_link_just_syms): Define.
1463         (ppc64_elf_link_just_syms): New function.
1464         (opd_entry_value): Don't assume big-endian host.
1465         (get_r2off): New function.
1466         (ppc_build_one_stub, ppc_size_one_stub): Use it here.
1467
1468 2011-03-06  Michael Snyder  <msnyder@vmware.com>
1469
1470         * compress.c (bfd_compress_section_contents): Check for out of mem.
1471
1472         * elf64-x86-64.c (elf_x86_64_relocate_section): Document
1473         that case statement falls through intentionally.
1474
1475         * elf32-i386.c (elf_i386_relocate_section): Document fall through.
1476
1477 2011-03-04  Alan Modra  <amodra@gmail.com>
1478
1479         * archive.c (bsd_write_armap): Don't call stat in deterministic
1480         mode, and don't use st_mtime if stat returns error.
1481
1482 2011-03-03  Michael Snyder  <msnyder@vmware.com>
1483
1484         * elf64-x86-64.c (elf_x86_64_relocate_section): Remove dead code.
1485
1486         * coff-x86_64.c (coff_amd64_rtype_to_howto): Fencepost error.
1487
1488         * aoutx.h (aout_final_link): Use sizeof int not sizeof int*.
1489         (aout_link_write_other_symbol): Missing break statement.
1490
1491         * dwarf2.c (scan_unit_for_symbols): Stop memory leak.
1492
1493         * archive.c (_bfd_slurp_extended_name_table): Fail if bfd_seek fails.
1494
1495 2011-03-03  H.J. Lu  <hongjiu.lu@intel.com>
1496
1497         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
1498         x32 IE->LE transition.
1499         (elf_x86_64_relocate_section): Likewise.
1500
1501 2011-03-02  Bernd Schmidt  <bernds@codesourcery.com>
1502
1503         * elflink.c (is_reloc_section): Remove function.
1504         (get_dynamic_reloc_section_name): Construct string manually.
1505
1506 2011-02-28  Kai Tietz  <kai.tietz@onevision.com>
1507
1508         * archive.c (_bfd_find_nested_archive): Use filename_(n)cmp.
1509         (adjust_relative_path): Likewise.
1510         (_bfd_construct_extended_name_table): Likewise.
1511         * corefile.c (generic_core_file_matches_executable_p): Likewise.
1512         * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1513         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1514         * elf32-spu.c (sort_bfds): Likewise.
1515         (spu_elf_auto_overlay): Likewise.
1516         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
1517         * xcofflink.c (xcoff_set_import_path): Likewise.
1518         * xtensa-isa.c (xtensa_regfile_lookup): Likewise.
1519         (xtensa_regfile_lookup_shortname): Likewise.
1520
1521 2011-02-28  Alan Modra  <amodra@gmail.com>
1522
1523         PR 12513
1524         * archive.c (bfd_slurp_bsd_armap_f2): Sanity check parsed_size and
1525         stringsize.  Properly sanity check symdef_count.  Remove redundant
1526         bfd_release.
1527
1528 2011-02-25  Rafael Ávila de Espíndola <respindola@mozilla.com>
1529
1530         * plugin.c (bfd_plugin_object_p): Correctly set the filesize
1531         and handle claim_file seeking. Only try to load the plugin once.
1532
1533 2011-02-22  Andreas Schwab  <schwab@redhat.com>
1534
1535         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): For a TLS_GD
1536         relocation read the value from the second GOT slot.
1537
1538 2011-02-15  Tristan Gingold  <gingold@adacore.com>
1539
1540         * vms-alpha.c (alpha_vms_link_add_archive_symbols): Add a comment.
1541
1542 2011-02-15  Alan Modra  <amodra@gmail.com>
1543
1544         * elf64-ppc.c (ppc64_elf_edit_toc): Reinstate second read of
1545         toc relocs.  Fuss over free(NULL).
1546
1547 2011-02-14  Mike Frysinger  <vapier@gentoo.org>
1548
1549         * elflink.c (bfd_elf_size_dynamic_sections): Add
1550         bfd_get_symbol_leading_char to the start of newname.
1551
1552 2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1553
1554         * configure: Regenerate.
1555
1556 2011-02-09  Alan Modra  <amodra@gmail.com>
1557
1558         * elf64-ppc.c (ppc64_elf_edit_toc): Don't free toc relocs until
1559         we are done.  When optimising large toc, check that a global
1560         symbol on a toc reloc is defined in a kept section.
1561
1562 2011-02-08  Nick Clifton  <nickc@redhat.com>
1563
1564         PR binutils/12467
1565         * elf.c (assign_file_positions_for_load_sections): Set the program
1566         header offset and entry size to zero if there are no program
1567         headers.
1568
1569 2011-02-08  Alan Modra  <amodra@gmail.com>
1570
1571         * elf64-ppc.c (ppc64_elf_edit_toc): Don't segfault on NULL
1572         local_syms when looking for local symbols in .toc.
1573
1574 2011-02-01  Alan Modra  <amodra@gmail.com>
1575
1576         * elf64-ppc.c (ppc64_elf_next_input_section): Use elf_gp value
1577         for toc pointer on any section having makes_toc_func_call set.
1578         (check_pasted_section): Ensure pasted .init/.fini fragments use
1579         the same toc if any has makes_toc_func_call set.
1580
1581 2011-01-28  Joseph Myers  <joseph@codesourcery.com>
1582
1583         * elf32-ppc.c (ppc_elf_link_hash_newfunc): Initialize has_sda_refs
1584         field.
1585
1586 2011-01-22  Richard Sandiford  <rdsandiford@googlemail.com>
1587
1588         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Ignore
1589         common sections too.
1590
1591 2011-01-18  H.J. Lu  <hongjiu.lu@intel.com>
1592
1593         * elf64-x86-64.c (elf_backend_want_plt_sym): Redefine to 0 after
1594         Solaris target.
1595
1596 2011-01-18  Pierre Muller  <muller@ics.u-strasbg.fr>
1597
1598         Fix compilation for mingw64.
1599         * coffcode.h (coff_slurp_symbol_table): Add intptr_t intermediate
1600         typecast to avoid warning.
1601         * elf32-rx.c: Add "bfd_stdint.h" include required for int32_t type
1602         usage.
1603         * elfxx-ia64.c (elfNN_ia64_relax_br): Use intptr_t typeacast instead
1604         of long for pointer to avoid warning.
1605         (elfNN_ia64_relax_brl): Idem.
1606         (elfNN_ia64_install_value): Idem.
1607         * vms-alpha.c (_bfd_vms_slurp_etir): Idem.
1608
1609 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
1610
1611         * elf32-arm.c (elf32_arm_check_relocs): Check needs_plt rather than
1612         h->needs_plt when deciding whether to record a possible dynamic reloc.
1613
1614 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
1615
1616         * elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered
1617         dynamic relocs for the removed section.
1618
1619 2011-01-15  H.J. Lu  <hongjiu.lu@intel.com>
1620
1621         * elf64-x86-64.c (elf_x86_64_check_relocs): Check invalid x32
1622         relocations.
1623
1624 2011-01-14  H.J. Lu  <hongjiu.lu@intel.com>
1625
1626         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add pointer_r_type.
1627         (elf_x86_64_link_hash_table_create): Set pointer_r_type.
1628         (elf_x86_64_check_relocs): Handle R_X86_64_32 like R_X86_64_64
1629         for ILP32.  Remove ABI_64_P PIC check for R_X86_64_8,
1630         R_X86_64_16, R_X86_64_32 and R_X86_64_32S.
1631         (elf_x86_64_relocate_section):  Handle R_X86_64_32 like R_X86_64_64
1632         for ILP32.
1633
1634 2011-01-14  Alan Modra  <amodra@gmail.com>
1635
1636         * bfd.c (bfd_perror): Flush stdout before and stderr after printing
1637         error.
1638         (_bfd_default_error_handler): Likewise.
1639         * elf.c (print_segment_map): Likewise.
1640         * libbfd.c (warn_deprecated): Likewise.
1641         * som.c (som_sizeof_headers): No need to do so here.
1642         * coff-i860.c: Replace use of printf for error messages with
1643         _bfd_error_handler.
1644         * coff-ppc.c: Likewise.
1645         * coff-sh.c: Likewise.
1646         * elf32-bfin.c: Likewise.
1647         * elf32-dlx.c: Likewise.
1648         * elf32-mep.c: Likewise.
1649         * elf32-v850.c: Likewise.
1650         * mach-o.c: Likewise.
1651         * pef.c: Likewise.
1652
1653 2011-01-13  H.J. Lu  <hongjiu.lu@intel.com>
1654
1655         * elf64-x86-64.c (elf_x86_64_link_hash_table): Remove
1656         swap_reloca_out.
1657         (elf_x86_64_link_hash_table_create): Don't set swap_reloca_out.
1658         (elf_x86_64_check_relocs): Align relocation section to 4 byte
1659         for 32bit.
1660         (elf_x86_64_gc_sweep_hook): Replace ELF64_ST_TYPE with
1661         ELF_ST_TYPE.
1662         (elf_x86_64_finish_dynamic_symbol): Updated.
1663         (elf_x86_64_finish_dynamic_sections): Don't use
1664         Elf64_External_Dyn, bfd_elf64_swap_dyn_in, nor
1665         bfd_elf64_swap_dyn_out.
1666
1667 2011-01-14  J. Park  <grassman@gmail.com>
1668
1669         PR ld/12339
1670         * elf32-arm.c (allocate_dynrelocs): Don't set up eh before
1671         following bfd_link_hash_warning symbol link.
1672
1673 2011-01-10  Nathan Sidwell  <nathan@codesourcery.com>
1674             Glauber de Oliveira Costa  <glommer@gmail.com>
1675
1676         * reloc.c (BFD_RELOC_ARM_TLS_GOTDESC, BFD_RELOC_ARM_TLS_CALL,
1677         BFD_RELOC_ARM_THM_TLS_CALL, BFD_RELOC_ARM_TLS_DESCSEQ,
1678         BFD_RELOC_ARM_THM_TLS_DESCSEQ, BFD_RELOC_ARM_TLS_DESC): New
1679         relocations.
1680         * libbfd.h: Rebuilt.
1681         * bfd-in2.h: Rebuilt.
1682         * elf32-arm.c (elf32_arm_howto_table_1): Add new relocations.
1683         (elf32_arm_reloc_map): Likewise.
1684         (tls_trampoline, dl_tlsdesc_lazy_trampoline): New PLT templates.
1685         (elf32_arm_stub_long_branch_any_tls_pic,
1686         elf32_arm_stub_long_branch_v4t_thumb_tls_pic): New stub templates.
1687         (DEF_STUBS): Add new stubs.
1688         (struct_elf_arm_obj_data): Add local_tlsdesc_gotent field.
1689         (elf32_arm_local_tlsdesc_gotent): New.
1690         (GOT_TLS_GDESC): New mask.
1691         (GOT_TLS_GD_ANY): Define.
1692         (struct elf32_arm_link_hash_entry): Add tlsdesc_got field.
1693         (elf32_arm_compute_jump_table_size): New.
1694         (struct elf32_arm_link_hash_table): Add next_tls_desc_index,
1695         num_tls_desc, dt_tlsdesc_plt, dt_tlsdesc_got, tls_trampoline,
1696         sgotplt_jump_table_size fields.
1697         (elf32_arm_link_hash_newfunc): Initialize tlsdesc_got field.
1698         (elf32_arm_link_hash_table_create): Initialize new fields.
1699         (arm_type_of_stub): Check TLS desc relocs too.
1700         (elf32_arm_stub_name): TLS desc relocs can be shared.
1701         (elf32_arm_tls_transition): Determine relaxation.
1702         (arm_stub_required_alignment): Add tls stubs.
1703         (elf32_arm_size_stubs): Likewise.
1704         (elf32_arm_tls_relax): Perform TLS relaxing.
1705         (elf32_arm_final_link_relocate): Process TLS DESC relocations.
1706         (IS_ARM_TLS_GNU_RELOC): New.
1707         (IS_ARM_TLS_RELOC): Use it.
1708         (elf32_arm_relocate_section): Perform TLS relaxing.
1709         (elf32_arm_check_relocs): Anticipate TLS relaxing, process tls
1710         desc relocations.
1711         (allocate_dynrelocs): Allocate tls desc relcoations.
1712         (elf32_arm_output_arch_local_syms): Emit tls trampoline mapping
1713         symbols.
1714         (elf32_arm_size_dynamic_sections): Allocate tls trampolines and
1715         got slots.
1716         (elf32_arm_always_size_sections): New. Create _TLS_MODULE_BASE
1717         symbol.
1718         (elf32_arm_finish_dynamic_symbol): Adjust.
1719         (arm_put_trampoline): New.
1720         (elf32_arm_finish_dynamic_sections): Emit new dynamic tags and tls
1721         trampolines.
1722         (elf_backend_always_size_sections): Define.
1723
1724 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
1725
1726         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Optimized.
1727
1728 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
1729
1730         PR ld/12366
1731         PR ld/12371
1732         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Properly
1733         handle symbols marked with regular reference, but not non-GOT
1734         reference when building shared library.
1735
1736         * elf32-i386.c (elf_i386_gc_sweep_hook): Properly handle
1737         local and global STT_GNU_IFUNC symols when building shared
1738         library.
1739         * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
1740
1741 2011-01-05  DJ Delorie  <dj@redhat.com>
1742
1743         * reloc.c: Add BFD_RELOC_RX_OP_NEG.
1744         * libbfd.h: Regenerate.
1745         * bfd-in2.h: Regenerate.
1746         * elf32-rx.c: Add it to the list, corresponding to R_RX_OPneg.
1747
1748 2011-01-03  H.J. Lu  <hongjiu.lu@intel.com>
1749
1750         * cpu-i386.c (bfd_i386_compatible): New.
1751         (bfd_x64_32_arch_intel_syntax): Replace bfd_default_compatible
1752         with bfd_i386_compatible.
1753         (bfd_x86_64_arch_intel_syntax): Likewise.
1754         (bfd_i386_arch_intel_syntax): Likewise.
1755         (i8086_arch): Likewise.
1756         (bfd_x64_32_arch): Likewise.
1757         (bfd_x86_64_arch): Likewise.
1758         (bfd_i386_arch): Likewise.
1759
1760 For older changes see ChangeLog-2010
1761 \f
1762 Local Variables:
1763 mode: change-log
1764 left-margin: 8
1765 fill-column: 74
1766 version-control: never
1767 End: