51b337c91acb782d82199ac2f34589483f0747c7
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2009-08-08 Alan Modra <amodra@bigpond.net.au>
2
3 PR 10494
4 * elf.c (_bfd_elf_make_section_from_shdr): When setting up section
5 LMAs, use ELF_IS_SECTION_IN_SEGMENT to match sections with headers.
6
7 2009-08-07 Tom Tromey <tromey@redhat.com>
8
9 * elf32-microblaze.c (microblaze_elf_check_relocs): Avoid strict
10 aliasing error.
11
12 2009-08-06 Michael Eager <eager@eagercon.com>
13
14 * Makefile.am: Add cpu-microblaze.{lo,c}, elf32-microblaze.{lo,c}.
15 * Makefile.in: Regenerate.
16 * archures.c: Add bfd_arch_microblaze.
17 * bfd-in2.h: Regenerate.
18 * config.bfd: Add microblaze target.
19 * configure.in: Add bfd_elf32_microblaze_vec target.
20 * configure: Regenerate.
21 * cpu-microblaze.c: New.
22 * elf32-microblaze.c: New.
23 * libbfd-in.h: Add prototype _bfd_dwarf2_fixup_section_debug_loc().
24 * libbfd.h: Regenerate.
25 * reloc.c: Add MICROBLAZE relocations.
26 * section.c: Add struct relax_table and relax_count to section.
27 * targets.c: Add bfd_elf32_microblaze_vec.
28
29 2009-08-06 Jakub Jelinek <jakub@redhat.com>
30 Alan Modra <amodra@bigpond.net.au>
31
32 PR binutils/10492
33 * elf.c (sym_is_global): Return true even for BSF_GNU_UNIQUE
34 symbols.
35 * elf32-mips.c (mips_elf_sym_is_global): Likewise.
36 * elfn32-mips.c (mips_elf_sym_is_global): Likewise.
37
38 2009-08-06 Nathan Sidwell <nathan@codesourcery.com>
39
40 * elf32-arm.c (elf32_arm_size_stubs): Call layout_sections_again
41 at least once when fixing cortex-a8.
42
43 2009-08-05 Chao-ying Fu <fu@mips.com>
44
45 * elf32-mips.c (mips_reloc_map): Add BFD_RELOC_MIPS_JALR.
46 * elfxx-mips.c (JAL_TO_BAL_P): New define to transform JAL to BAL
47 for CPUs. It is true for RM9000.
48 (JALR_TO_BAL_P): New define to transform JALR to BAL. It is true
49 for all CPUs.
50 (mips_elf_perform_relocation): Use JAL_TO_BAL_P and JALR_TO_BAL_P
51 to guard the transformation.
52
53 2009-08-05 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
54
55 * elf32-spu.h (spu_elf_params): Add member emit_fixups.
56 (spu_elf_size_sections): Declare prototype.
57 * elf32-spu.c (spu_link_hash_table): Add member sfixup.
58 (FIXUP_RECORD_SIZE, FIXUP_GET, FIXUP_PUT): New macros.
59 (spu_elf_emit_fixup): New function.
60 (spu_elf_relocate_section): Emit fixup for each SPU_ADDR32.
61 (spu_elf_size_sections): New function.
62
63 2009-08-05 Nathan Sidwell <nathan@codesourcery.com>
64
65 * elf32-arm.c (elf32_arm_stub_type): Add arm_stub_a8_veneer_lwm.
66 (arm_build_one_stub): Build a8 veneers as a separate pass.
67 (cortex_a8_erratum_scan): Add prev_num_a8_fixes and stub_changed_p
68 parameters. Use them to check if we create a different a8 fixup
69 than the previous pass.
70 (elf32_arm_size_stubs): Move scope of stub_changed and
71 prev_num_a8_fixes into main loop.
72 (elf32_arm_build_stubs): Build a8 veneers in a second pass.
73
74 2009-08-04 Alan Modra <amodra@bigpond.net.au>
75
76 * elf32-ppc.c (ppc_elf_relax_section): Correct conditions under
77 which find_plt_ent is called. Delete redundant code.
78
79 2009-08-03 H.J. Lu <hongjiu.lu@intel.com>
80
81 PR binutils/10363
82 * elf.c (bfd_elf_string_from_elf_section): Return NULL on
83 invalid string offset.
84
85 2009-08-03 H.J. Lu <hongjiu.lu@intel.com>
86
87 PR ld/10433
88 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Set got
89 to htab->init_got_offset and plt to htab->init_plt_offset
90 when discarding space for dynamic relocations.
91
92 2009-08-03 Alan Modra <amodra@bigpond.net.au>
93
94 * elf32-ppc.c (struct plt_entry): Revise comments.
95 (ppc_elf_check_relocs): Don't create needless plt_entry info
96 for non-pie executables. Don't test info->pie when info->shared
97 already covers that case.
98 (ppc_elf_gc_sweep_hook): Adjust for above change.
99 (add_stub_sym): Don't test info->pie when info->shared tested.
100 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Likewise.
101 (write_glink_stub, ppc_elf_finish_dynamic_symbol): Likewise.
102 (ppc_elf_relax_section): Adjust find_plt_ent arguments.
103 (ppc_elf_relocate_section): Likewise.
104
105 2009-08-03 Alan Modra <amodra@bigpond.net.au>
106
107 * elf32-ppc.c (ppc_elf_check_relocs): Always add a plt ref count
108 for local ifunc symbols in non-pie executables, regardless of
109 reloc type. Don't specially create ifunc dyn relocs. Tidy ifunc
110 code so that it's obvious that we only do anything special for
111 local ifunc syms.
112 (ppc_elf_gc_sweep_hook): Adjust to suit check_relocs changes.
113 (allocate_dynrelocs): Correct comment for syms defined in plt.
114 Don't specially allocate ifunc dyn relocs.
115 (ppc_elf_relax_section): Relax branches to ifunc plt entries too.
116 (ppc_elf_relocate_section): Set "relocation" value for ifunc
117 syms in non-pie executables. No specially allocated dyn relocs
118 for ifunc to write. Allow for local sym on R_PPC_RELAX32_PLT.
119 (ppc_elf_finish_dynamic_symbol): Set value of ifunc symbols in
120 a non-pie executable.
121
122 2009-08-02 H.J. Lu <hongjiu.lu@intel.com>
123 Jakub Jelinek <jakub@redhat.com>
124
125 PR ld/6443
126 * elf32-i386.c (elf_i386_tls_transition): Check executable
127 instead of shared for TLS when building PIE.
128 (elf_i386_check_relocs): Likewise.
129 (elf_i386_allocate_dynrelocs): Likewise.
130 (elf_i386_relocate_section): Likewise.
131
132 * elf64-x86-64.c (elf64_x86_64_tls_transition): Check executable
133 instead of shared for TLS when building PIE.
134 (elf64_x86_64_check_relocs): Likewise.
135 (elf64_x86_64_allocate_dynrelocs): Likewise.
136 (elf64_x86_64_relocate_section): Likewise.
137
138 2009-07-31 Anthony Green <green@moxielogic.com>
139
140 * config.bfd (targ_cpu): Add moxie-uclinux support.
141
142 2009-07-31 Hans-Peter Nilsson <hp@bitrange.com>
143
144 * linker.c (fix_syms): Consider SEC_LOAD when choosing section.
145
146 2009-07-30 Alan Modra <amodra@bigpond.net.au>
147
148 * elf32-ppc.c (ppc_elf_check_relocs): Always set up sections
149 used by indirect function support. Count dynamic relocs for
150 ifunc syms.
151 (ppc_elf_adjust_dynamic_symbol): Tweak for ifunc.
152 (allocate_dynrelocs): Allocate all non-dynamic ifunc plt entries
153 in iplt and their relocs in reliplt. Don't make ifunc syms
154 dynamic. Allocate got entry relocs for non-dynamic ifunc in
155 reliplt. Handle other dynamic relocs for ifunc.
156 (ppc_elf_size_dynamic_sections): Alloc dyn relocs for static
157 ifunc in reliplt, likewise relocs for got against local ifunc.
158 Typo fix on reliplt size adjust.
159 (ppc_elf_relocate_section): Don't use plt scheme of allocating
160 relocs 1-1 with entries for iplt, instead just add using
161 reloc_count. Write got relocs and dyn relocs for ifunc to reliplt.
162 Error on invalid ifunc dyn relocs.
163 (ppc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc plt
164 in iplt/reliplt.
165 * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_JMP_IREL,
166 R_PPC64_REL16, R_PPC64_REL16_LO, R_PPC64_REL16_HI, R_PPC64_REL16_HA.
167 (ppc64_elf_reloc_type_lookup): Handle new relocs.
168 (ppc64_elf_check_relocs): Likewise. Count dyn relocs for ifunc.
169 (allocate_dynrelocs): As for elf32-ppc.c above.
170 (ppc64_elf_size_dynamic_sections): Likewise.
171 (ppc_build_one_stub): Put non-dynamic ifunc plt call stubs in iplt,
172 and their relocs in reliplt. Use R_PPC64_JMP_IREL.
173 (ppc_size_one_stub): Similarly.
174 (ppc64_elf_relocate_section): As for elf32-ppc.c above. Handle new
175 relocs too.
176 (ppc64_elf_finish_dynamic_symbol): As for elf32-ppc.c above.
177
178 2009-07-29 Hans-Peter Nilsson <hp@bitrange.com>
179
180 * elf64-mmix.c (mmix_elf_relax_section): Revert 2009-05-27
181 change. Add note to head comment.
182
183 2009-07-28 Jan Beulich <jbeulich@novell.com>
184
185 * archive.c (get_extended_arelt_filename): Remove redundant
186 range check on index.
187
188 2009-07-27 Doug Kwan <dougkwan@google.com>
189
190 * elf32-arm.c (stub_hash_newfunc): Initialize field output_name.
191
192 2009-07-27 H.J. Lu <hongjiu.lu@intel.com>
193
194 * archures.c bfd_*_arch): Sorted.
195 (bfd_archures_list): Likewise.
196
197 2009-07-27 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
198
199 * elf32-cr16.c (elf_cr16_final_link_relocate): Add code to handle
200 to R_cr16_NUM32 relocation.
201
202 2009-07-26 Michael Eager <eager@eagercon.com>
203
204 * archures.c: Add bfd_mach_ppc_405
205 * bfd-in2.h: Same.
206
207 2009-07-25 H.J. Lu <hongjiu.lu@intel.com>
208
209 * cpu-i386.c (bfd_x86_64_arch): Fix comment typos.
210 * cpu-l1om.c (bfd_l1om_arch): Likewise.
211
212 2009-07-25 H.J. Lu <hongjiu.lu@intel.com>
213
214 * archures.c (bfd_architecture): Add bfd_arch_l1om.
215 (bfd_l1om_arch): New.
216 (bfd_archures_list): Add &bfd_l1om_arch.
217 * bfd-in2.h: Regenerated.
218
219 * config.bfd (targ64_selvecs): Add bfd_elf64_l1om_vec if
220 bfd_elf64_x86_64_vec is supported. Add bfd_elf64_l1om_freebsd_vec
221 if bfd_elf64_x86_64_freebsd_vec is supported.
222 (targ_selvecs): Likewise.
223
224 * configure.in: Support bfd_elf64_l1om_vec and
225 bfd_elf64_l1om_freebsd_vec.
226 * configure: Regenerated.
227
228 * cpu-l1om.c: New.
229
230 * elf64-x86-64.c (elf64_l1om_elf_object_p): New.
231 (bfd_elf64_l1om_vec): Likewise.
232 (bfd_elf64_l1om_freebsd_vec): Likewise.
233
234 * Makefile.am (ALL_MACHINES): Add cpu-l1om.lo.
235 (ALL_MACHINES_CFILES): Add cpu-l1om.c.
236 * Makefile.in: Regenerated.
237
238 * targets.c (bfd_elf64_l1om_vec): New.
239 (bfd_elf64_l1om_freebsd_vec): Likewise.
240 (_bfd_target_vector): Add bfd_elf64_l1om_vec and
241 bfd_elf64_l1om_freebsd_vec.
242
243 2009-07-24 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
244 Alan Modra <amodra@bigpond.net.au>
245
246 * reloc.c (BFD_RELOC_SPU_ADD_PIC): Define.
247 * bfd-in2.h: Regenerate.
248 * libbfd.h: Regenerate.
249 * elf32-spu.c (elf_howto_table): Add entries SPU_ADD_PIC.
250 (spu_elf_bfd_to_reloc_type): Handle SPU_ADD_PIC.
251 (spu_elf_relocate_section): Patch instructions marked by SPU_ADD_PIC.
252
253 2009-07-23 H.J. Lu <hongjiu.lu@intel.com>
254
255 PR ld/10434
256 * elf64-x86-64.c (elf64_x86_64_check_relocs): Check executable
257 instead of shared for R_X86_64_TPOFF32.
258 (elf64_x86_64_relocate_section): Likewise.
259
260 2009-07-23 Ulrich Drepper <drepper@redhat.com>
261
262 * elf-bfd.h (struct elf_link_hash_entry): Add unique_global field.
263 * elf.c (swap_out_syms): Set binding to STB_GNU_UNIQUE for symbols
264 with the BSF_GNU_UNIQUE flag bit set.
265 * elfcode.h (elf_slurp_symbol_table): Set the BSF_GNU_UNIQUE flag
266 for symbols with STB_GNU_UNIQUE binding.
267 * elflink.c (_bfd_elf_merge_symbol): Set unique_global for symbols
268 with the STB_GNU_UNIQUE binding.
269 (elf_link_add_object_symbols): Set the BSF_GNU_UNIQUE flag for
270 symbols with STB_GNU_UNIQUE binding. Set STB_GNU_UNIQUE for
271 symbols with the unique_global field set.
272 (elf_link_output_extsym): Set unique_global field for symbols with
273 the STB_GNU_UNIQUE binding.
274 * syms.c (struct bfd_symbol): Define BSF_GNU_UNIQUE flag bit.
275 (bfd_print_symbol_vandf): Print a 'u' character for BSF_GNU_UNIQUE
276 symbols.
277 (bfd_decode_symclass): Return a 'u' character for BSF_GNU_UNIQUE
278 symbols.
279 * bfd-in2.h: Regenerate.
280
281 2009-07-22 H.J. Lu <hongjiu.lu@intel.com>
282
283 * elflink.c (elf_link_output_extsym): Revert the last change.
284
285 2009-07-22 H.J. Lu <hongjiu.lu@intel.com>
286
287 PR ld/10433
288 * elflink.c (elf_link_output_extsym): Special case ifunc syms
289 when ref_regular, not def_regular.
290
291 2009-07-21 H.J. Lu <hongjiu.lu@intel.com>
292
293 PR ld/10426
294 * elflink.c (elf_link_add_object_symbols): Turn an IFUNC symbol
295 from a DSO into a normal FUNC symbol.
296 (elf_link_output_extsym): Turn an undefined IFUNC symbol into
297 a normal FUNC symbol.
298
299 2009-07-17 Chao-ying Fu <fu@mips.com>
300
301 * elfxx-mips.c (LOAD_INTERLOCKS_P): New define.
302 (_bfd_mips_elf_size_dynamic_sections): For CPUs without load
303 interlocking, the last PLT entry needs a nop in the branch delay slot.
304 (_bfd_mips_elf_finish_dynamic_symbol): For CPUs with load itnerlocking,
305 output the last two PLT entries in reverse order.
306
307 2009-07-16 H.J. Lu <hongjiu.lu@intel.com>
308
309 * elf32-i386.c (elf_i386_relocate_section): Don't get local
310 STT_GNU_IFUNC symbol for relocatable link.
311 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
312
313 2009-07-10 H.J. Lu <hongjiu.lu@intel.com>
314
315 * bfdio.c (bfd_iovec): Add comments for bmmap.
316 * bfd-in2.h: Regenerated.
317
318 2009-07-10 H.J. Lu <hongjiu.lu@intel.com>
319
320 * Makefile.am: Run "make dep-am".
321 * Makefile.in: Regenerated.
322
323 2009-07-10 Doug Kwan <dougkwan@google.com>
324
325 * elf32-arm.c (stub_hash_newfunc): Initialize fields
326 target_addend and orig_insn.
327
328 2009-07-10 Tom Tromey <tromey@redhat.com>
329
330 * Makefile.am (dwarf2.lo): Use dwarf2.h, not elf/dwarf2.h.
331 (elf-eh-frame.lo): Likewise.
332 (elf32-bfin.lo): Likewise.
333 (elf32-frv.lo): Likewise.
334 (elf32-xc16x.lo): Likewise.
335 * Makefile.in: Rebuild.
336 * dwarf2.c: Included dwarf.h, not elf/dwarf2.h.
337 * elf-eh-frame.c: Likewise.
338 * elf32-bfin.c: Likewise.
339 * elf32-frv.c: Likewise.
340 * elf32-xc16x.c: Likewise.
341
342 2009-07-10 Julian Brown <julian@codesourcery.com>
343
344 * elf32-arm.c (arm_build_one_stub): Use the hash entry of the
345 symbol a stub entry is derived from, not the entry for the stub
346 itself, in call to elf32_arm_final_link_relocate.
347
348 2009-07-10 H.J. Lu <hongjiu.lu@intel.com>
349
350 * elf.c (_bfd_elf_get_synthetic_symtab): Remove leading zeros
351 when reporting addends.
352
353 2009-07-10 Alan Modra <amodra@bigpond.net.au>
354
355 * elf32-spu.c (spu_elf_size_stubs): Do set up soft-icache manager
356 data even when no stubs.
357 (spu_elf_place_overlay_data, spu_elf_build_stubs): Adjust.
358
359 2009-07-10 Alan Modra <amodra@bigpond.net.au>
360
361 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_IRELATIVE.
362 (ppc_elf_get_synthetic_symtab): Report addend.
363 (PLT_IFUNC): Define.
364 (struct ppc_elf_link_hash_table): Add iplt and reliplt.
365 (ppc_elf_create_glink): New function.
366 (ppc_elf_create_dynamic_sections): Use it.
367 (ppc_elf_add_symbol_hook): Set has_ifunc_symbols.
368 (update_local_sym_info): Allocate space for local_plt array.
369 Don't bump local_got_refcounts for PLT_IFUNC. Return local_plt
370 entry pointer.
371 (is_branch_reloc): New function.
372 (ppc_elf_check_relocs): Handle STT_GNU_IFUNC symbols.
373 (ppc_elf_gc_sweep_hook): Likewise.
374 (ppc_elf_adjust_dynamic_symbol): Likewise.
375 (allocate_dynrelocs): Likewise.
376 (ppc_elf_size_dynamic_sections): Likewise.
377 (ppc_elf_relocate_section): Likewise.
378 (branch_reloc_hash_match): Use is_branch_reloc.
379 (ppc_elf_tls_optimize): Adjust for local_plt.
380 (write_glink_stub): New function, extracted from..
381 (ppc_elf_finish_dynamic_symbol): ..here. Handle STT_GNU_IFUNC.
382 (ppc_elf_finish_dynamic_sections): Only write plt resolver and
383 branch table when dynamic.
384 (elf_backend_post_process_headers): Define.
385 * elf64-ppc.c (elf_backend_post_process_headers): Define.
386 (ppc64_elf_howto_raw): Add R_PPC64_IRELATIVE.
387 (ppc64_elf_get_synthetic_symtab): Report addend.
388 (struct ppc_stub_hash_entry): Add plt_ent.
389 (PLT_IFUNC): Define.
390 (struct ppc_link_hash_table): Add iplt and reliplt.
391 (create_linkage_sections): Make .iplt and .rela.iplt sections.
392 (ppc64_elf_add_symbol_hook): Set has_ifunc_symbols.
393 (update_local_sym_info): Allocate space for local_plt array.
394 Don't bump local_got_ents for PLT_IFUNC. Return local_plt
395 entry pointer.
396 (update_plt_info): Pass pointer to plt_entry rather than sym hash,
397 and don't change hash flags here.
398 (is_branch_reloc): New function.
399 (ppc64_elf_check_relocs): Handle STT_GNU_IFUNC.
400 (ppc64_elf_gc_sweep_hook): Likewise.
401 (ppc64_elf_adjust_dynamic_symbol): Likewise.
402 (allocate_dynrelocs): Likewise.
403 (ppc64_elf_size_dynamic_sections): Likewise.
404 (ppc_build_one_stub, ppc_size_one_stub): Likewise.
405 (ppc64_elf_size_stubs): Likewise.
406 (ppc64_elf_relocate_section): Likewise.
407 (get_sym_h): Adjust for local_plt.
408 (branch_reloc_hash_match): Use is_branch_reloc.
409 (ppc_type_of_stub): Pass plt_entry pointer and handle ifunc.
410 (ppc64_elf_toc): Ignore SEC_EXCLUDE sections.
411
412 2009-07-10 Alan Modra <amodra@bigpond.net.au>
413
414 * elf.c (_bfd_elf_get_synthetic_symtab): Report addends.
415
416 2009-07-10 Alan Modra <amodra@bigpond.net.au>
417
418 * elf-bfd.h (struct elf_link_hash_entry): Clarify ref_regular
419 and ref_regular_nonweak comment.
420 * elflink.c (elf_link_output_extsym): Special case ifunc syms
421 when def_regular, not ref_regular.
422 (elf_link_add_object_symbols): Don't set needs_plt on ifunc syms,..
423 * elf32-i386.c (elf_i386_check_relocs): ..set it here instead..
424 * elf64-x86-64.c (elf64_x86_64_check_relocs): ..and here.
425
426 2009-07-09 Alan Modra <amodra@bigpond.net.au>
427
428 * elf32-spu.c (mark_functions_via_relocs): Init broken_cycle field
429 of malloc'd struct call_info.
430 (pasted_function): Likewise, priority too.
431
432 2009-07-07 Alan Modra <amodra@bigpond.net.au>
433
434 * elf32-spu.c (spu_elf_auto_overlay): Take into account section
435 alignment when packing sections into overlays.
436
437 2009-07-03 Cary Coutant <ccoutant@google.com>
438
439 * dwarf2.c (decode_line_info): Ignore DW_LNE_set_discriminator.
440
441 2009-07-03 Dave Korn <dave.korn.cygwin@gmail.com>
442
443 * coffcode.h (sec_to_styp_flags): Partially revert (functional
444 changes only) earlier patch:-
445
446 2009-06-25 Kai Tietz <kai.tietz@onevision.com>
447
448 * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
449 give .debug and .reloc data characteristics.
450 (DOT_RELOC): New define for .reloc section string.
451 (coff_write_object_contents): Use DOT_RELOC instead of string.
452
453 2009-07-02 Tom Tromey <tromey@redhat.com>
454
455 * aoutx.h (aout_get_external_symbols): Declare 'amt' locally.
456 * bfdwin.c (bfd_free_window): Cast to unsigned long.
457
458 2009-07-01 Nick Clifton <nickc@redhat.com>
459
460 * elf-m10300.c: Remove trailing white space.
461 * reloc.c: Likewise.
462
463 2009-07-01 Douglas B Rupp <rupp@gnat.com>
464
465 * bfd.m4 (BFD_HAVE_TIME_TYPE_MEMBER,
466 BFD_HAVE_SYS_STAT_TYPE_MEMBER): New config functions.
467 * configure.in: Use them.
468 * configure: Regenerate.
469 * config.in: Regnerate.
470 * vmsutil.c: Include sysdep.h, remove ansidecl.h.
471 #define _BSD_SOURCE. Add comments.
472 (vms_file_stats_name): Calculate creation date based on available
473 runtime data. Return 1 for version instead of 0.
474
475 2009-07-01 Nick Clifton <nickc@redhat.com>
476
477 PR 10072
478 * elf32-arm.c (elf32_arm_final_link_relocate): Add code to handle
479 to R_ARM_THM_PC8 relocation.
480
481 2009-06-29 Nick Clifton <nickc@redhat.com>
482
483 * elf-m10300.c (mn10300_elf_relax_section): Allow for the
484 different uses of the relocations addend when a symbol is in a
485 merged section.
486
487 2009-06-27 H.J. Lu <hongjiu.lu@intel.com>
488
489 PR ld/10337
490 * elf.c (bfd_section_from_shdr): Don't change sh_link for
491 SHT_REL/SHT_RELA sections on executable nor shared library.
492 Treat SHT_REL/SHT_RELA sections with sh_link set to SHN_UNDEF
493 as a normal section.
494
495 2009-06-25 Nick Clifton <nickc@redhat.com>
496
497 * elf-m10300.c (mn10300_elf_relax_section): Handle non-section
498 symbols with SEC_MERGE flag.
499
500 2009-06-25 Kai Tietz <kai.tietz@onevision.com>
501
502 * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
503 give .debug and .reloc data characteristics.
504 (DOT_RELOC): New define for .reloc section string.
505 (coff_write_object_contents): Use DOT_RELOC instead of string.
506
507 2009-06-25 Tristan Gingold <gingold@adacore.com>
508
509 * mach-o-target.c (bfd_mach_o_get_dynamic_symtab_upper_bound)
510 (bfd_mach_o_canonicalize_dynamic_symtab)
511 (bfd_mach_o_get_synthetic_symtab): Defines.
512 (TARGET_NAME_BACKEND): Add bfd_mach_o_print_thread entry.
513 (TARGET_NAME): Use Mach-O specific functions for dynamic.
514
515 * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_in): Fix howto indexes
516 for scattered relocations.
517 (bfd_mach_o_i386_print_thread): New function.
518 (bfd_mach_o_print_thread): Define.
519
520 * mach-o.c (text_section_names_xlat): Add an entry for __const.
521 (bfd_mach_o_canonicalize_one_reloc, bfd_mach_o_canonicalize_relocs):
522 New functions extracted from ...
523 (bfd_mach_o_canonicalize_reloc): ... This. Simplified.
524 (bfd_mach_o_get_dynamic_reloc_upper_bound): New function.
525 (bfd_mach_o_canonicalize_dynamic_reloc): New function.
526 (bfd_mach_o_i386_flavour_string): Adjusted after enum renaming.
527 (bfd_mach_o_ppc_flavour_string): Reindentation. Add 64 bits cases.
528 (bfd_mach_o_scan_read_dylinker): Do not create a section anymore.
529 Set name_str field.
530 (bfd_mach_o_scan_read_dylib): Ditto.
531 (bfd_mach_o_scan_read_thread): Set mdata at declaration. Add comments,
532 reindent.
533 (bfd_mach_o_scan_read_dysymtab): Set mdata at declaration. Correctly
534 decode isym and flags on little endian targets. Set dysymtab field.
535 (bfd_mach_o_scan_start_address): Adjust for enum names.
536 (bfd_mach_o_lookup_section): Do not look for segments anymore.
537 (bfd_mach_o_print_section): Display bfd section name.
538 (bfd_mach_o_print_segment): Display none if no name.
539 (bfd_mach_o_print_dysymtab): Display next index for local, external
540 and undefined symbols.
541 (bfd_mach_o_bfd_print_private_bfd_data): Adjust code by using name_str.
542 Display dylinker name. Display thread and unixthread commands content.
543 (bfd_mach_o_print_thread): New macro.
544
545 * mach-o.h (bfd_mach_o_mach_header_magic): Align numbers.
546 (bfd_mach_o_ppc_thread_flavour): Ditto.
547 (bfd_mach_o_i386_thread_flavour): Ditto.
548 (BFD_MACH_O_PPC_THREAD_STATE_NONE): New enum.
549 (BFD_MACH_O_x86_THREAD_STATE_NONE): Replaces
550 BFD_MACH_O_THREAD_STATE_NONE.
551 (bfd_mach_o_segment_command): Remove segment field.
552 (bfd_mach_o_thread_flavour): Field offset is now unsigned long.
553 (bfd_mach_o_dylinker_command): Remove section field, add name_str.
554 (bfd_mach_o_prebound_dylib_command): Ditto.
555 (bfd_mach_o_dylib_command): Ditto.
556 (bfd_mach_o_prebound_dylib_command): Remove section field.
557 (mach_o_data_struct): Add dysymtab field.
558 (bfd_mach_o_backend_data): Add _bfd_mach_o_print_thread field.
559 (bfd_mach_o_get_reloc_upper_bound, bfd_mach_o_canonicalize_reloc)
560 (bfd_mach_o_build_commands): Remove parameter names and attributes.
561 (bfd_mach_o_get_dynamic_reloc_upper_bound)
562 (bfd_mach_o_canonicalize_dynamic_reloc): New prototypes.
563
564 2009-06-25 Rafael Avila de Espindola <espindola@google.com>
565
566 * plugin.c (load_plugin): Use stat and S_ISREG instead of the d_type
567 field of struct dirent.
568
569 2009-06-23 Tristan Gingold <gingold@adacore.com>
570
571 * vms.c (vms_get_synthetic_symtab): Remove duplicate definition
572 of this macro. Fix indentation.
573
574 2009-06-22 Christophe Lyon <christophe.lyon@st.com>
575
576 * elf32-arm.c (elf32_arm_size_stubs): Use PLT address as
577 destination for defined dynamic symbols when deciding whether to
578 insert a stub or not.
579 (allocate_dynrelocs): Make sure functions are not marked as Thumb
580 when actually accessed through a PLT, even when generating a
581 shared lib.
582
583 2009-06-22 Tristan Gingold <gingold@adacore.com>
584
585 * mach-o.c (bfd_mach_o_canonicalize_reloc): Append a sentinel to
586 the relocs array.
587
588 2009-06-22 Alan Modra <amodra@bigpond.net.au>
589
590 * elf32-ppc.c (ppc_elf_check_relocs): Handle R_PPC_RELAX* in switch.
591 * elf32-v850.c (v850_elf_relocate_section): Warning fix.
592
593 2009-06-22 Alan Modra <amodra@bigpond.net.au>
594
595 * elf64-ppc.c (ppc64_elf_edit_opd): Avoid gcc warning.
596
597 2009-06-19 H.J. Lu <hongjiu.lu@intel.com>
598
599 * elflink.c (elf_link_add_object_symbols): Avoid warning
600 from -Wjump-misses-init in gcc 4.5.0.
601
602 2009-06-19 H.J. Lu <hongjiu.lu@intel.com>
603
604 * elf32-i386.c (elf_i386_check_relocs): Properly check local
605 symbol on error.
606 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
607
608 2009-06-19 H.J. Lu <hongjiu.lu@intel.com>
609
610 * elf32-i386.c (elf_i386_tls_transition): Add a parameter,
611 r_symndx. Report local symbol name on error.
612 (elf_i386_check_relocs): Updated. Report local symbol name on
613 error.
614 (elf_i386_gc_sweep_hook): Updated.
615 (elf_i386_relocate_section): Likewise.
616
617 * elf64-x86-64.c (elf64_x86_64_tls_transition): Add a parameter,
618 r_symndx. Report local symbol name on error.
619 (elf64_x86_64_check_relocs): Updated. Report local symbol name
620 on error.
621 (elf64_x86_64_gc_sweep_hook): Updated.
622 (elf64_x86_64_relocate_section): Likewise.
623
624 2009-06-19 Tristan Gingold <gingold@adacore.com>
625
626 * mach-o.c (bfd_mach_o_print_private_header): Fix format character.
627
628 2009-06-19 Tristan Gingold <gingold@adacore.com>
629
630 * mach-o.c (bfd_mach_o_scan_read_symtab_symbols): Add prototype.
631 (bfd_mach_o_version): Use bfd_mach_o_get_data instead of direct access.
632 (bfd_mach_o_valid): Ditto.
633 (bfd_mach_o_wide_p): Ditto.
634 (bfd_mach_o_canonicalize_reloc): Ditto.
635 (bfd_mach_o_build_commands): Ditto.
636 (bfd_mach_o_scan_read_thread): Ditto.
637 (bfd_mach_o_flatten_sections): Ditto.
638 (bfd_mach_o_scan_start_address): Ditto.
639 (bfd_mach_o_lookup_section): Ditto.
640 (bfd_mach_o_core_fetch_environment): Ditto.
641 (bfd_mach_o_write_contents): Ditto. Handle reexport_dylib.
642 (bfd_mach_o_scan_write_relocs): Adjust for bfd_mach_o_get_data.
643 (bfd_mach_o_scan_write_symtab): Ditto.
644 Use macros instead of hard-coded values.
645 (bfd_mach_o_scan_read_symtab_symbol): Make the function static.
646 Use bfd_mach_o_get_data instead of direct access. Use macros
647 instead of hard-coded values.
648 (bfd_mach_o_scan_read_symtab_strtab): Make the function static.
649 Remove sym argument and get section from mdata.
650 Move code into the else branch.
651 (bfd_mach_o_scan_read_symtab_symbols): Make the function static.
652 Remove sym argument and get section from mdata. Adjust code.
653 (bfd_mach_o_scan_read_dylib): Move assertion into the created
654 switch (which replaces consecutive if statements).
655 (bfd_mach_o_scan_read_dysymtab): Rename seg to cmd. Load
656 module table, table of content, indirect symbols and external
657 referenced symbols.
658 (bfd_mach_o_scan_read_symtab): Renames seg to symtab. Set symtab
659 field.
660 (bfd_mach_o_scan_read_linkedit): New function.
661 (bfd_mach_o_scan_read_str): Ditto.
662 (bfd_mach_o_count_symbols): Simplify the code by using the symtab
663 field of mdata.
664 (bfd_mach_o_get_symtab_upper_bound): Remove check as
665 bfd_mach_o_count_symbols never returns an error.
666 (bfd_mach_o_canonicalize_symtab): Simplify the code by using the
667 symtab field (there might be only one symtab).
668 (bfd_mach_o_scan_read_command): Handle reexported dylib.
669 Handle sub frameworks, sub umbrella, sub library and sub client.
670 Read code signature and segment split info commands.
671 (bfd_mach_o_scan): Reindent.
672 (bfd_mach_o_xlat_name): New type.
673 (bfd_mach_o_print_flags): New function.
674 (bfd_mach_o_get_name): Ditto.
675 (bfd_mach_o_cpu_name): New variable.
676 (bfd_mach_o_filetype_name, bfd_mach_o_header_flags_name)
677 (bfd_mach_o_section_type_name)
678 (bfd_mach_o_section_attribute_name)
679 (bfd_mach_o_load_command_name): New variables.
680 (bfd_mach_o_print_private_header): New function.
681 (bfd_mach_o_print_section_map): New function extracted from
682 bfd_mach_o_print_private_bfd_data.
683 (bfd_mach_o_print_section): Ditto. Print more infos.
684 (bfd_mach_o_print_segment): Ditto.
685 (bfd_mach_o_print_dysymtab): Ditto.
686 (bfd_mach_o_bfd_print_private_bfd_data): Reworked. Handle
687 load weak dylib, reexport dylib and id dylib.
688 Handle code signature and segment_split info.
689 Handle sub frameworks, sub umbrella, sub library and sub client.
690 (bfd_mach_o_section_get_nbr_indirect): New function.
691
692 * mach-o.h (BFD_MACH_O_REFERENCE_MASK): New macro. Add comment.
693 (bfd_mach_o_header_flags): New enum to define header flags.
694 (bfd_mach_o_section_attribute): New enum to replace ...
695 (BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC,
696 BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG,
697 BFD_MACH_O_S_SELF_MODIFYING_CODE, BFD_MACH_O_S_ATTR_LIVE_SUPPORT,
698 BFD_MACH_O_S_ATTR_NO_DEAD_STRIP, BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS,
699 BFD_MACH_O_S_ATTR_NO_TOC, BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): ...
700 these removed macros.
701 (BFD_MACH_O_NLIST_SIZE, BFD_MACH_O_NLIST_64_SIZE): New macros.
702 (bfd_mach_o_dylib_module): New type.
703 (BFD_MACH_O_DYLIB_MODULE_SIZE, BFD_MACH_O_DYLIB_MODULE_64_SIZE): New
704 macros.
705 (bfd_mach_o_dylib_table_of_content): New type.
706 (BFD_MACH_O_TABLE_OF_CONTENT_SIZE): New macro.
707 (bfd_mach_o_dylib_reference): New type.
708 (BFD_MACH_O_REFERENCE_SIZE): New macro.
709 (bfd_mach_o_dysymtab_command): Add fields for loaded and decoded
710 modules, toc, references and indirect syms.
711 (BFD_MACH_O_INDIRECT_SYMBOL_SIZE): New macro.
712 (bfd_mach_o_dylinker_command): Remove cmd and cmdsize fields (were
713 unused). Add comment.
714 (bfd_mach_o_dylib_command): Ditto.
715 (bfd_mach_o_prebound_dylib_command): Ditto.
716 (bfd_mach_o_linkedit_command): New type.
717 (bfd_mach_o_str_command): New type.
718 (bfd_mach_o_load_command): Add linkedit and str fields.
719 (mach_o_data_struct): Add symtab field.
720 (bfd_get_mach_o_data): Renamed to ...
721 (bfd_mach_o_get_data): ... this new macro.
722 (bfd_mach_o_scan_read_symtab_symbol,
723 bfd_mach_o_scan_read_symtab_strtab,
724 bfd_mach_o_scan_read_symtab_symbols): Prototypes removed.
725
726 * mach-o-i386.c (bfd_mach_o_i386_mkobject): Use bfd_mach_o_get_data
727 instead of direct access.
728
729 2009-06-19 Alan Modra <amodra@bigpond.net.au>
730
731 * elf32-ppc.c (ppc_elf_check_relocs): Allow local symbols for
732 R_PPC_PLTREL24 relocs.
733 (ppc_elf_relocate_section): Likewise.
734
735 2009-06-19 Alan Modra <amodra@bigpond.net.au>
736
737 * elf32-ppc.c (find_plt_ent): Pass pointer to plist rather than
738 pointer to sym hash. Update all uses.
739 (update_plt_info): Likewise. Don't check addend here.
740
741 2009-06-18 H.J. Lu <hongjiu.lu@intel.com>
742
743 * elf32-i386.c (elf_i386_check_relocs): Remove isymbuf and use
744 bfd_sym_from_r_symndx.
745 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
746
747 2009-06-18 Alan Modra <amodra@bigpond.net.au>
748
749 * elf-bfd.h (struct sym_sec_cache): Delete.
750 (struct sym_cache): New.
751 (bfd_section_from_r_symndx): Delete prototype.
752 (bfd_sym_from_r_symndx): Define prototype.
753 * elf.c (bfd_section_from_r_symndx): Delete, replace with..
754 (bfd_sym_from_r_symndx): ..new function.
755 * elf32-arm.c: Update all uses of struct sym_sec_cache and
756 bfd_section_from_r_symndx to new struct and function.
757 * elf32-bfin.c: Likewise.
758 * elf32-hppa.c: Likewise.
759 * elf32-i386.c: Likewise.
760 * elf32-m32r.c: Likewise.
761 * elf32-m68hc1x.c: Likewise.
762 * elf32-m68hc1x.h: Likewise.
763 * elf32-m68k.c: Likewise.
764 * elf32-ppc.c: Likewise.
765 * elf32-s390.c: Likewise.
766 * elf32-sh.c: Likewise.
767 * elf64-ppc.c: Likewise.
768 * elf64-s390.c: Likewise.
769 * elf64-x86-64.c: Likewise.
770 * elfxx-sparc.c: Likewise.
771 * elfxx-sparc.h: Likewise.
772
773 2009-06-18 H.J. Lu <hongjiu.lu@intel.com>
774
775 * elf32-i386.c (elf_i386_check_relocs): Cache or free isymbuf.
776 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
777
778 2009-06-18 Nick Clifton <nickc@redhat.com>
779
780 * elflink.c (elf_link_sort_relocs): Return early if there are no
781 relocs to sort.
782
783 2009-06-18 Dave Korn <dave.korn.cygwin@gmail.com>
784
785 Merge cegcc and mingw32ce target name changes from
786 CeGCC project:
787
788 2007-12-25 Pedro Alves <pedro_alves@portugalmail.pt>
789
790 * config.bfd: Add arm*-*-cegcc* target.
791
792 2007-12-17 Pedro Alves <pedro_alves@portugalmail.pt>
793
794 * config.bfd: Add arm-*-mingw32ce* target.
795
796 2009-06-17 H.J. Lu <hongjiu.lu@intel.com>
797
798 * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): New.
799 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Likewise.
800 * elf32-i386.c (elf_i386_allocate_dynrelocs): Use it.
801 * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
802
803 2009-06-17 H.J. Lu <hongjiu.lu@intel.com>
804
805 * elf-bfd.h (_bfd_elf_create_ifunc_dyn_reloc): New.
806 * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Likewise.
807 * elf32-i386.c (elf_i386_check_relocs): Use it.
808 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
809
810 2009-06-17 H.J. Lu <hongjiu.lu@intel.com>
811
812 * elf-bfd.h (elf_dyn_relocs): New.
813
814 * elf32-i386.c (elf_i386_dyn_relocs): Removed.
815 (elf_i386_link_hash_entry): Replace elf_i386_dyn_relocs with
816 elf_dyn_relocs.
817 (elf_i386_copy_indirect_symbol): Likewise.
818 (elf_i386_check_relocs): Likewise.
819 (elf_i386_gc_sweep_hook): Likewise.
820 (elf_i386_allocate_dynrelocs): Likewise.
821 (elf_i386_readonly_dynrelocs): Likewise.
822 (elf_i386_size_dynamic_sections): Likewise.
823
824 * elf64-x86-64.c (elf64_x86_64_dyn_relocs): Removed.
825 (elf64_x86_64_link_hash_entry): Replace elf64_x86_64_dyn_relocs
826 with elf_dyn_relocs.
827 (elf64_x86_64_copy_indirect_symbol): Updated.
828 (elf64_x86_64_check_relocs): Likewise.
829 (elf64_x86_64_gc_sweep_hook): Likewise.
830 (elf64_x86_64_adjust_dynamic_symbol): Likewise.
831 (elf64_x86_64_allocate_dynrelocs): Likewise.
832 (elf64_x86_64_readonly_dynrelocs): Likewise.
833 (elf64_x86_64_size_dynamic_sections): Likewise.
834
835 2009-06-17 H.J. Lu <hongjiu.lu@intel.com>
836
837 * elf32-arm.c (create_got_section): Get existing .rela.got
838 section.
839 * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise.
840 * elf32-lm32.c (create_got_section): Likewise.
841 * elf32-m32r.c (create_got_section): Likewise.
842 * elf32-ppc.c (ppc_elf_create_got): Likewise.
843 * elf32-s390.c (create_got_section): Likewise.
844 * elf32-sh.c (create_got_section): Likewise.
845 * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise.
846 * elf64-s390.c (create_got_section): Likewise.
847 * elfxx-sparc.c (create_got_section): Likewise.
848
849 * elflink.c (_bfd_elf_create_got_section): Properly initialize
850 the GOT size.
851
852 2009-06-16 H.J. Lu <hongjiu.lu@intel.com>
853
854 * elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): New.
855
856 * elf32-i386.c (elf_i386_local_hash): Removed.
857 (elf_i386_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
858 (elf_i386_get_local_sym_hash): Likewise.
859
860 * elf64-x86-64.c (elf64_x86_64_local_hash): Removed.
861 (elf64_x86_64_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
862 (elf64_x86_64_get_local_sym_hash): Likewise.
863 * elfxx-ia64.c (elfNN_ia64_local_htab_hash): Likewise.
864 (get_local_sym_hash): Likewise.
865
866 2009-06-16 H.J. Lu <hongjiu.lu@intel.com>
867
868 * elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec,
869 rel_got_sec and plt_sec.
870 (elfNN_ia64_relax_section): Updated.
871 (elfNN_ia64_create_dynamic_sections): Likewise.
872 (get_got): Likewise.
873 (allocate_dynrel_entries): Likewise.
874 (elfNN_ia64_size_dynamic_sections): Likewise.
875 (set_got_entry): Likewise.
876 (elfNN_ia64_choose_gp): Likewise.
877 (elfNN_ia64_relocate_section): Likewise.
878 (elfNN_ia64_finish_dynamic_symbol): Likewise.
879 (elfNN_ia64_finish_dynamic_sections): Likewise.
880
881 2009-06-16 Ulrich Weigand <uweigand@de.ibm.com>
882
883 * elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bits
884 also for calls.
885
886 2009-06-16 H.J. Lu <hongjiu.lu@intel.com>
887
888 * configure.in (elf): Add elf-ifunc.lo.
889
890 * configure: Regenerated.
891 * Makefile.in: Likewise.
892
893 * elf-bfd.h (elf_link_hash_table): Add sgot, sgotplt,
894 srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc.
895
896 * elf32-i386.c (elf_i386_link_hash_table): Remove sgot,
897 sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
898 irelifunc.
899 (elf_i386_link_hash_table_create): Likewise.
900 (elf_i386_create_dynamic_sections): Likewise.
901 (elf_i386_check_relocs): Likewise.
902 (elf_i386_allocate_dynrelocs): Likewise.
903 (elf_i386_size_dynamic_sections): Likewise.
904 (elf_i386_relocate_section): Likewise.
905 (elf_i386_finish_dynamic_symbol): Likewise.
906 (elf_i386_finish_dynamic_sections): Likewise.
907 (elf_i386_create_got_section): Removed.
908
909 * elf64-x86-64.c (elf64_x86_64_link_hash_table): Remove sgot,
910 sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
911 irelifunc.
912 (elf64_x86_64_compute_jump_table_size): Updated.
913 (elf64_x86_64_link_hash_table_create): Likewise.
914 (elf64_x86_64_create_dynamic_sections): Likewise.
915 (elf64_x86_64_check_relocs): Likewise.
916 (elf64_x86_64_allocate_dynrelocs): Likewise.
917 (elf64_x86_64_size_dynamic_sections): Likewise.
918 (elf64_x86_64_relocate_section): Likewise.
919 (elf64_x86_64_finish_dynamic_symbol): Likewise.
920 (elf64_x86_64_finish_dynamic_sections): Likewise.
921 (elf64_x86_64_create_got_section): Removed.
922
923 * elflink.c (_bfd_elf_create_got_section): Use log_file_align
924 for pointer alignment. Set up section pointers.
925 (_bfd_elf_create_dynamic_sections): Likewise.
926 (_bfd_elf_create_ifunc_sections): Moved to ...
927 * elf-ifunc.c: Here. New.
928
929 * Makefile.am (BFD32_BACKENDS): Add elf-ifunc.lo.
930 (BFD32_BACKENDS_CFILES): Add elf-ifunc.c.
931 Run "make dep-am".
932
933 2009-06-16 Doug Kwan <dougkwan@google.com>
934
935 * elf32-arm.c (cortex_a8_erratum_scan): Change type of offset
936 to bfd_signed_vma. Cast constant operands which are used in
937 offset related expressions to bfd_signed_vma type as appropriate.
938
939 2009-06-16 Maciej W. Rozycki <macro@linux-mips.org>
940
941 * elf32-vax.c (elf_vax_plt_sym_val): New function.
942 (elf_backend_plt_sym_val): Define.
943
944 2009-06-16 Maciej W. Rozycki <macro@linux-mips.org>
945
946 * elf32-vax.c (elf_vax_reloc_type_class): New function.
947 (elf_backend_reloc_type_class): Define.
948
949 2009-06-16 Maciej W. Rozycki <macro@linux-mips.org>
950
951 * elf32-vax.c (elf_vax_relocate_section): For symbol references
952 from an executable to a shared library treat R_VAX_PC32
953 relocations as R_VAX_PLT32 ones.
954
955 2009-06-16 Maciej W. Rozycki <macro@linux-mips.org>
956
957 * elf32-vax.c (elf_vax_instantiate_got_entries): Skip local
958 symbols in GOT space calculation.
959 (elf_vax_relocate_section): Adjust accordingly.
960
961 2009-06-16 Maciej W. Rozycki <macro@linux-mips.org>
962
963 * elf32-vax.c (elf_vax_plt_entry): Set the entry mask to
964 include <R11:R2>.
965
966 2009-06-16 Maciej W. Rozycki <macro@linux-mips.org>
967
968 * elf32-vax.c (elf_vax_check_relocs): Handle the visibility
969 attribute.
970 (elf_vax_relocate_section): Likewise.
971
972 2009-06-15 H.J. Lu <hongjiu.lu@intel.com>
973
974 * elf32-i386.c (elf_i386_allocate_dynrelocs): Update comments.
975 * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
976
977 2009-06-15 H.J. Lu <hongjiu.lu@intel.com>
978
979 * elf32-i386.c (elf_i386_check_relocs): Reformat.
980 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
981
982 2009-06-15 H.J. Lu <hongjiu.lu@intel.com>
983
984 * Makefile.am: Run "make dep-am".
985 * Makefile.in: Regenerated.
986
987 2009-06-15 H.J. Lu <hongjiu.lu@intel.com>
988
989 * elf32-i386.c (elf_i386_allocate_dynrelocs): Fix a typo.
990 * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
991
992 2009-06-15 Nick Clifton <nickc@redhat.com>
993
994 * po/ru.po: New Russian translation.
995 * configure.in (ALL_LINGUAS): Add ru.
996 * configure: Regenerate.
997
998 2009-06-14 H.J. Lu <hongjiu.lu@intel.com>
999
1000 * elf32-i386.c: Remove duplicated comments.
1001
1002 2009-06-14 H.J. Lu <hongjiu.lu@intel.com>
1003
1004 PR ld/10270
1005 * elf32-i386.c (elf_i386_allocate_dynrelocs): Disallow
1006 dynamic IFUNC pointer in non-shared object. Use .got.plt
1007 for IFUNC definition in PIE.
1008 (elf_i386_allocate_dynrelocs): Resolve IFUNC definition in
1009 PIE locally.
1010
1011 * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Disallow
1012 dynamic IFUNC pointer in non-shared object. Use .got.plt
1013 for IFUNC definition in PIE.
1014 (elf64_x86_64_relocate_section): Resolve IFUNC definition in
1015 PIE locally.
1016
1017 2009-06-13 H.J. Lu <hongjiu.lu@intel.com>
1018
1019 * elf32-i386.c (elf_i386_check_relocs): Properly report
1020 local symbol for unhandled relocation against STT_GNU_IFUNC
1021 symbol.
1022 (elf_i386_relocate_section): Likewise.
1023 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
1024 (elf64_x86_64_relocate_section): Likewise.
1025
1026 2009-06-13 H.J. Lu <hongjiu.lu@intel.com>
1027
1028 PR ld/10269
1029 * elf32-i386.c: Include "objalloc.h" and "hashtab.h".
1030 (elf_i386_link_hash_table): Add loc_hash_table and
1031 loc_hash_memory.
1032 (elf_i386_local_hash): New.
1033 (elf_i386_local_htab_hash): Likewise.
1034 (elf_i386_local_htab_eq): Likewise.
1035 (elf_i386_get_local_sym_hash): Likewise.
1036 (elf_i386_link_hash_table_free): Likewise.
1037 (elf_i386_allocate_local_dynrelocs): Likewise.
1038 (elf_i386_finish_local_dynamic_symbol): Likewise.
1039 (bfd_elf64_bfd_link_hash_table_free): Likewise.
1040 (elf_i386_link_hash_table_create): Create loc_hash_table and
1041 loc_hash_memory.
1042 (elf_i386_check_relocs): Handle local STT_GNU_IFUNC symbols.
1043 (elf_i386_size_dynamic_sections): Likewise.
1044 (elf_i386_relocate_section): Likewise.
1045 (elf_i386_finish_dynamic_sections): Likewise.
1046 (elf_i386_finish_dynamic_symbol): Check _DYNAMIC only if sym
1047 isn't NULL.
1048
1049 * elf64-x86-64.c: Include "objalloc.h" and "hashtab.h".
1050 (elf64_x86_64_link_hash_table): Add loc_hash_table and
1051 loc_hash_memory.
1052 (elf64_x86_64_local_hash): New.
1053 (elf64_x86_64_local_htab_hash): Likewise.
1054 (elf64_x86_64_local_htab_eq): Likewise.
1055 (elf64_x86_64_get_local_sym_hash): Likewise.
1056 (elf64_x86_64_link_hash_table_free): Likewise.
1057 (elf64_x86_64_allocate_local_dynrelocs): Likewise.
1058 (elf64_x86_64_finish_local_dynamic_symbol): Likewise.
1059 (bfd_elf64_bfd_link_hash_table_free): Likewise.
1060 (elf64_x86_64_link_hash_table_create): Create loc_hash_table
1061 and loc_hash_memory.
1062 (elf64_x86_64_check_relocs): Handle local STT_GNU_IFUNC
1063 symbols.
1064 (elf64_x86_64_size_dynamic_sections): Likewise.
1065 (elf64_x86_64_relocate_section): Likewise.
1066 (elf64_x86_64_finish_dynamic_sections): Likewise.
1067 (elf64_x86_64_finish_dynamic_symbol): Check _DYNAMIC only if
1068 sym isn't NULL.
1069
1070 2009-06-10 Philip Blundell <philb@gnu.org>
1071
1072 * elf32-arm.c (elf32_arm_fix_exidx_coverage): Avoid crash if
1073 elf_sec->this_hdr == NULL.
1074
1075 2009-06-12 Tristan Gingold <gingold@adacore.com>
1076
1077 * reloc.c: Add BFD_RELOC_MACH_O_SECTDIFF and BFD_RELOC_MACH_O_PAIR.
1078 * bfd-in2.h: Regenerated.
1079 * libbfd.h: Regenerated.
1080
1081 * mach-o.c (FILE_ALIGN): New macro.
1082 (bfd_mach_o_canonicalize_symtab): Adjust for bfd_mach_o_asymbol.
1083 (bfd_mach_o_print_symbol): Ditto.
1084 (bfd_mach_o_scan_write_thread): Adjust type of variable offset.
1085 (bfd_mach_o_get_reloc_upper_bound): New function.
1086 (bfd_mach_o_canonicalize_reloc): Ditto.
1087 (bfd_mach_o_scan_write_relocs): Ditto.
1088 (bfd_mach_o_scan_write_section_32): Remove offset argument.
1089 (bfd_mach_o_scan_write_section_64): Ditto.
1090 (bfd_mach_o_scan_write_segment_32): Write relocs. Fix size of data
1091 written for load command. Do not compute section file offset.
1092 (bfd_mach_o_scan_write_segment_64): Ditto.
1093 (bfd_mach_o_scan_write_symtab): Compute file offset first.
1094 Adjust for bfd_mach_o_asymbol. Move code to convert from BFD to
1095 Mach-O to ...
1096 (bfd_mach_o_mangle_symbols): ... this new function.
1097 (bfd_mach_o_write_contents): Be sure to have load commands built.
1098 Call bfd_mach_o_mangle_symbols.
1099 (bfd_mach_o_build_commands): Adjust for filelen field.
1100 Use FILE_ALIGN macro. Clear section file offset if section is empty.
1101 Do not set symtab file offset anymore here.
1102 (bfd_mach_o_make_empty_symbol): Allocate a bfd_mach_o_asymbol.
1103 (bfd_mach_o_make_bfd_section): Set SEC_RELOC if has reloc.
1104 Set reloc_count and rel_filepos section fields.
1105 (bfd_mach_o_scan_read_section_32): Type of argument offset is now
1106 unsigned int.
1107 (bfd_mach_o_scan_read_section_64): Ditto.
1108 (bfd_mach_o_scan_read_section): Ditto.
1109 (bfd_mach_o_scan_read_symtab_symbol): Typr of argument s is now
1110 bfd_mach_o_asymbol. Use unsigned int for file offset type.
1111 (bfd_mach_o_scan_read_symtab_symbol): Adjust for bfd_mach_o_asymbol.
1112 Handle weak-ref symbols.
1113 (bfd_mach_o_scan_read_symtab_symbols): Adjust for bfd_mach_o_asymbol.
1114 (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
1115 (bfd_mach_o_scan): Remove assignment to removed field.
1116 (bfd_mach_o_mkobject_init): Ditto.
1117 (bfd_mach_o_bfd_print_private_bfd_data): Adjust printf formatter.
1118 (bfd_mach_o_bfd_reloc_type_lookup): New macro.
1119 (bfd_mach_o_bfd_reloc_name_lookup): Ditto.
1120 (bfd_mach_o_swap_reloc_in): Ditto.
1121 (bfd_mach_o_swap_reloc_out): Ditto.
1122
1123 * mach-o.h (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_NON_LAZY)
1124 (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_LAZY)
1125 (BFD_MACH_O_REFERENCE_FLAG_DEFINED)
1126 (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_DEFINED)
1127 (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY)
1128 (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY)
1129 (BFD_MACH_O_REFERENCED_DYNAMICALLY, BFD_MACH_O_N_DESC_DISCARDED)
1130 (BFD_MACH_O_N_NO_DEAD_STRIP, BFD_MACH_O_N_WEAK_REF)
1131 (BFD_MACH_O_N_WEAK_DEF): New macros.
1132 Add comments.
1133 (bfd_mach_o_section_type): Add new enumeration values.
1134 (BFD_MACH_O_S_SELF_MODIFYING_CODE)
1135 (BFD_MACH_O_S_ATTR_LIVE_SUPPORT)
1136 (BFD_MACH_O_S_ATTR_NO_DEAD_STRIP)
1137 (BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS, BFD_MACH_O_S_ATTR_NO_TOC): New
1138 macros.
1139 (BFD_MACH_O_GENERIC_RELOC_VANILLA)
1140 (BFD_MACH_O_GENERIC_RELOC_PAIR)
1141 (BFD_MACH_O_GENERIC_RELOC_SECTDIFF)
1142 (BFD_MACH_O_GENERIC_RELOC_PB_LA_PTR)
1143 (BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF): Ditto.
1144 (BFD_MACH_O_RELENT_SIZE): Ditto.
1145 (BFD_MACH_O_R_PCREL, BFD_MACH_O_GET_R_LENGTH)
1146 (BFD_MACH_O_R_EXTERN, BFD_MACH_O_GET_R_TYPE)
1147 (BFD_MACH_O_GET_R_SYMBOLNUM, BFD_MACH_O_SET_R_LENGTH)
1148 (BFD_MACH_O_SET_R_TYPE, BFD_MACH_O_SET_R_SYMBOLNUM): Ditto.
1149 (BFD_MACH_O_SR_SCATTERED, BFD_MACH_O_SR_PCREL)
1150 (BFD_MACH_O_GET_SR_LENGTH, BFD_MACH_O_GET_SR_TYPE)
1151 (BFD_MACH_O_GET_SR_ADDRESS, BFD_MACH_O_SET_SR_LENGTH)
1152 (BFD_MACH_O_SET_SR_TYPE, BFD_MACH_O_SET_SR_ADDRESS): Ditto.
1153 (bfd_mach_o_reloc_info): New struct.
1154 (bfd_mach_o_asymbol): New struct.
1155 (bfd_mach_o_symtab_command): The symbols field is now of type
1156 bfd_mach_o_asymbol.
1157 (bfd_mach_o_load_command): The offset and len fields are now of type
1158 unsigned int.
1159 (mach_o_data_struct): Remove symbols, nsymbols and ibfd fields.
1160 Add a filelen field. Add comments.
1161 (bfd_mach_o_backend_data): New struct.
1162 (bfd_mach_o_get_backend_data): New macro.
1163 (bfd_mach_o_scan_read_symtab_symbol): Parameter symbol now of type
1164 bfd_mach_o_asymbol.
1165 (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
1166 (bfd_mach_o_get_reloc_upper_bound): New prototype.
1167 (bfd_mach_o_canonicalize_reloc): Ditto.
1168
1169 * mach-o-target.c (bfd_mach_o_bfd_is_local_label_name): Remove
1170 duplicated macro. Now defined to _bfd_generic_is_local_label.
1171 (TARGET_NAME_BACKEND): New macro...
1172 (TARGET_NAME_BACKEND): ... used to name a new variable.
1173 (TARGET_NAME): Define relocs table using bfd_mach_o, reference
1174 Mach-O backend data.
1175
1176 * mach-o-i386.c (i386_howto_table): New variable.
1177 (bfd_mach_o_i386_swap_reloc_in): New function.
1178 (bfd_mach_o_i386_swap_reloc_out): Ditto.
1179 (bfd_mach_o_i386_bfd_reloc_type_lookup): Ditto.
1180 (bfd_mach_o_i386_bfd_reloc_name_lookup): Ditto.
1181 (bfd_mach_o_swap_reloc_in, bfd_mach_o_swap_reloc_out): New macros.
1182 (bfd_mach_o_bfd_reloc_type_lookup)
1183 (bfd_mach_o_bfd_reloc_name_lookup): Ditto.
1184
1185 2009-06-11 Eric Paris <eparis@redhat.com>
1186 Nick Clifton <nickc@redhat.com>
1187
1188 * opncls.c (_maybe_make_executable): New function. Gives execute
1189 permission to an executable bfd that was opened for writing
1190 provided that it is a regular file. Replaces common code found in...
1191 (bfd_close): here and ...
1192 (bfd_close_all_done): here.
1193
1194 2009-06-11 Anthony Green <green@moxielogic.com>
1195
1196 * reloc.c: Add BFD_RELOC_MOXIE_10_PCREL.
1197 * bfd-in2.h: Rebuilt.
1198 * libbfd.h: Rebuilt.
1199 * elf32-moxie.c (moxie_elf_howto_table): Add R_MOXIE_PCREL10
1200 relocation support.
1201 (moxie_reloc_map): Ditto.
1202 Clean up copyright notice.
1203
1204 2009-06-10 Paul Pluzhnikov <ppluzhnikov@google.com>
1205
1206 * bfd-in2.h: bfd_mmap prototype.
1207 * bfdio.c (bfd_mmap): New function.
1208 * libbfd.h (bfd_iovec): Add bmmap.
1209 * cache.c (cache_bmmap): New function.
1210 (cache_iovec): Initialize bmmap member.
1211 * opencls.c (opncls_bmmap): New function.
1212 (opncls_iovec): Initialize bmmap member.
1213
1214 2009-06-09 Tristan Gingold <gingold@adacore.com>
1215
1216 * mach-o.h (bfd_mach_o_symtab_command): Remove stabs_segment
1217 and stabstr_segment fields.
1218 (mach_o_be_vec, mach_o_le_vec): Removed
1219 (bfd_mach_o_version): New prototype.
1220
1221 * mach-o.c (bfd_mach_o_version): Make this function public.
1222 (mach_o_wide_p): New function.
1223 (bfd_mach_o_wide_p): Ditto.
1224 (bfd_mach_o_convert_section_name_to_bfd): Add prefix only for
1225 weird names.
1226 (bfd_mach_o_convert_section_name_to_mach_o): Fix typo in comment.
1227 Search in the list only if the name starts with a dot.
1228 (bfd_mach_o_write_header): Use mach_o_wide_p instead of hard-coded
1229 test. Check bfd_seek status.
1230 (bfd_mach_o_scan_write_thread): Check bfd_seek status.
1231 (bfd_mach_o_scan_write_section_32): Ditto.
1232 (bfd_mach_o_scan_write_section_64): Ditto.
1233 (bfd_mach_o_scan_write_section): Removed.
1234 (bfd_mach_o_scan_write_segment): Split into ...
1235 (bfd_mach_o_scan_write_segment_32): ... this and ...
1236 (bfd_mach_o_scan_write_segment_64): ... this. Check bfd_seek status.
1237 (bfd_mach_o_scan_write_symtab_symbols): Moved into ...
1238 (bfd_mach_o_scan_write_symtab): ... this. Write symtab from BFD
1239 symbol table. Now returns a boolean.
1240 (bfd_mach_o_write_contents): Set filetype. Check bfd_seek status.
1241 Adjust for status type.
1242 (bfd_mach_o_build_commands): Use mach_o_wide_p instead of hard-coded
1243 test. Write symbol table. Numbers the sections.
1244 (bfd_mach_o_read_header): Check bfd_seek status.
1245 Use mach_o_wide_p instead of hard-coded test.
1246 (bfd_mach_o_scan_read_section_32): Check bfd_seek status.
1247 (bfd_mach_o_scan_read_section_64): Ditto.
1248 (bfd_mach_o_scan_read_symtab_symbol): Ditto. Check bfd_seek status.
1249 Use BFD_MACH_O_N_TYPE instead of hard-coded value. Correctly
1250 handled common symbols.
1251 (bfd_mach_o_scan_read_symtab_strtab): Check bfd_seek status.
1252 (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
1253 (bfd_mach_o_scan_read_dylinker): Ditto.
1254 (bfd_mach_o_scan_read_dylib): Ditto.
1255 (bfd_mach_o_scan_read_thread): Ditto.
1256 (bfd_mach_o_scan_read_symtab): Ditto.
1257 Do not create a section for the stabs.
1258 (bfd_mach_o_scan_read_uuid): Check bfd_seek status.
1259 (bfd_mach_o_scan_read_segment): Ditto.
1260 (bfd_mach_o_scan_read_command): Ditto.
1261 (bfd_mach_o_scan_start_address): Ditto.
1262 (bfd_mach_o_scan): Use mach_o_wide_p instead of hard-coded test.
1263 (bfd_mach_o_archive_p): Check bfd_seek status.
1264 (bfd_mach_o_core_fetch_environment): Ditto.
1265
1266 * mach-o-i386.c (bfd_mach_o_i386_mkobject): Don't set filetype.
1267
1268 2009-06-06 H.J. Lu <hongjiu.lu@intel.com>
1269
1270 * elf32-i386.c (elf_i386_link_hash_table): Add irelifunc.
1271 (elf_i386_link_hash_table_create): Initialize irelifunc.
1272 (elf_i386_check_relocs): Updated. Set up irelifunc for
1273 shared objects.
1274 (elf_i386_allocate_dynrelocs): Use irelifunc for dynamic
1275 relocation for non-GOT reference of STT_GNU_IFUNC symbol in
1276 shared objects.
1277 (elf_i386_relocate_section): Likewise.
1278
1279 * elf64-x86-64.c (elf64_x86_64_link_hash_table): Add irelifunc.
1280 (elf64_x86_64_link_hash_table_create): Initialize irelifunc.
1281 (elf64_x86_64_check_relocs): Updated. Set up irelifunc for
1282 shared objects.
1283 (elf64_x86_64_allocate_dynrelocs): Use irelifunc for dynamic
1284 relocation for non-GOT reference of STT_GNU_IFUNC symbol in
1285 shared objects.
1286 (elf64_x86_64_relocate_section): Likewise.
1287
1288 * elf-bfd.h (_bfd_elf_create_static_ifunc_sections): Renamed to
1289 ...
1290 (_bfd_elf_create_ifunc_sections): This.
1291
1292 * elflink.c (_bfd_elf_create_static_ifunc_sections): Renamed to
1293 ...
1294 (_bfd_elf_create_ifunc_sections): This. Create .rel[a].ifunc
1295 for shared objects.
1296
1297 2009-06-06 H.J. Lu <hongjiu.lu@intel.com>
1298
1299 * elf32-i386.c (elf_i386_check_relocs): Make room for dynamic
1300 relocation for R_386_32 against STT_GNU_IFUNC symbol when
1301 building shared object. Check info->executable instead of
1302 !info->shared when setting non_got_ref.
1303 (elf_i386_allocate_dynrelocs): Allocate dynamic relocation
1304 for non-GOT reference of STT_GNU_IFUNC symbol in shared
1305 object. Allocate GOT relocation agsinst STT_GNU_IFUNC
1306 symbol if needed.
1307 (elf_i386_relocate_section): Output dynamic relocation for
1308 R_386_32 against STT_GNU_IFUNC symbol to get the real
1309 function address when building shared object.
1310 (elf_i386_finish_dynamic_symbol): Output R_386_GLOB_DAT
1311 relocation for STT_GNU_IFUNC symbol in shared object.
1312
1313 * elf64-x86-64.c (elf64_x86_64_check_relocs): Make room for
1314 dynamic relocation for R_X86_64_64 against STT_GNU_IFUNC
1315 symbol when building shared object. Check info->executable
1316 instead of !info->shared when setting non_got_ref.
1317 (elf64_x86_64_allocate_dynrelocs): Allocate dynamic relocation
1318 for non-GOT reference of STT_GNU_IFUNC symbol in shared
1319 library. Allocate GOT relocation agsinst STT_GNU_IFUNC symbol
1320 if needed.
1321 (elf64_x86_64_relocate_section): Output dynamic relocation
1322 for R_X86_64_64 against STT_GNU_IFUNC symbol to get the real
1323 function address when building shared object.
1324 (elf64_x86_64_finish_dynamic_symbol): Output R_X86_64_GLOB_DAT
1325 relocation for STT_GNU_IFUNC symbol in shared object.
1326
1327 2009-06-06 Jan Kratochvil <jan.kratochvil@redhat.com>
1328
1329 * Makefile.am: Run "make dep-am".
1330 (BFD32_BACKENDS): Add mach-o-i386.lo.
1331 (BFD32_BACKENDS_CFILES): Add mach-o-i386.c.
1332 * Makefile.in: Regenerate.
1333
1334 2009-06-06 Alan Modra <amodra@bigpond.net.au>
1335
1336 * elf32-spu.c (spu_elf_relocate_section): Match overlay number
1337 when looking for soft-icache stubs.
1338
1339 2009-06-05 Tristan Gingold <gingold@adacore.com>
1340
1341 * mach-o.h: Update copyright year.
1342 (bfd_mach_o_mach_header_magic): New enum.
1343 (bfd_mach_o_cpu_subtype): Now an enum.
1344 (BFD_MACH_O_HEADER_SIZE, BFD_MACH_O_HEADER_64_SIZE): New macros.
1345 (BFD_MACH_O_SECTION_SIZE, BFD_MACH_O_SECTION_64_SIZE): Ditto.
1346 (BFD_MACH_O_LC_SEGMENT_SIZE, BFD_MACH_O_LC_SEGMENT_64_SIZE): Ditto.
1347 (bfd_mach_o_load_command): Field type_required is now a boolean.
1348 Reindent prototypes.
1349 (bfd_mach_o_object_p, bfd_mach_o_core_p): Remove.
1350 (bfd_mach_o_bfd_copy_private_symbol_data): Add a prototype.
1351 (bfd_mach_o_bfd_copy_private_section_data): Ditto.
1352 (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
1353 (bfd_mach_o_get_symtab_upper_bound): Ditto.
1354 (bfd_mach_o_canonicalize_symtab): Ditto.
1355 (bfd_mach_o_get_symbol_info): Ditto.
1356 (bfd_mach_o_print_symbol): Ditto.
1357 (bfd_mach_o_bfd_print_private_bfd_data): Ditto.
1358 (bfd_mach_o_make_empty_symbol): Ditto.
1359 (bfd_mach_o_write_contents): Ditto.
1360
1361 * mach-o.c (bfd_mach_o_object_p, bfd_mach_o_core_p,
1362 bfd_mach_o_mkobject): Defines.
1363 (bfd_mach_o_valid): Returns FALSE/TRUE instead of 0/1.
1364 Do not check with target vector but with flavour.
1365 (struct mach_o_section_name_xlat): New declaration.
1366 (dwarf_section_names_xlat): Ditto.
1367 (text_section_names_xlat): Ditto.
1368 (data_section_names_xlat): Ditto.
1369 (struct mach_o_segment_name_xlat): Ditto.
1370 (segsec_names_xlat): Ditto.
1371 (bfd_mach_o_convert_section_name_to_bfd): New function.
1372 (bfd_mach_o_convert_section_name_to_mach_o): Ditto.
1373 (bfd_mach_o_bfd_copy_private_symbol_data): Make it public.
1374 (bfd_mach_o_bfd_copy_private_section_data): Ditto.
1375 (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
1376 Accept any input and output flavour. Do not share private data
1377 anymore.
1378 (bfd_mach_o_count_symbols): Add a comment.
1379 (bfd_mach_o_get_symtab_upper_bound): Make it public.
1380 (bfd_mach_o_canonicalize_symtab): Ditto.
1381 (bfd_mach_o_get_symbol_info): Ditto.
1382 (bfd_mach_o_print_symbol): Ditto.
1383 (bfd_mach_o_write_header): Now returns a boolean instead of an int.
1384 Use constants instead of hard-coded values.
1385 (bfd_mach_o_scan_write_section_32): Use constants instead of hard-coded
1386 values.
1387 (bfd_mach_o_scan_write_section_64): Ditto.
1388 (bfd_mach_o_scan_write_segment): Ditto.
1389 Do not copy sections anymore.
1390 (bfd_mach_o_write_contents): Make it public.
1391 Remove dead code. Rewrite typeflag assignment.
1392 (bfd_mach_o_build_commands): New function.
1393 (bfd_mach_o_set_section_contents): Ditto.
1394 (bfd_mach_o_make_empty_symbol): Make it public.
1395 (bfd_mach_o_read_header): Make it static.
1396 Convert to bfd_boolean.
1397 Use constants instead of hard-coded values.
1398 (bfd_mach_o_make_bfd_section): Call
1399 bfd_mach_o_convert_section_name_to_bfd to create name.
1400 (bfd_mach_o_scan_read_section_32): Use constants instead of hard-coded
1401 values.
1402 (bfd_mach_o_scan_read_section_64): Ditto.
1403 (bfd_mach_o_scan_read_segment): Do not create a bfd section for
1404 a segment anymore. Use constants instead of hard-coded values.
1405 (bfd_mach_o_scan_read_command): Fix style.
1406 (bfd_mach_o_scan): Use constants instead of hard-coded values.
1407 Get rid of BFD_IO_FUNCS.
1408 (bfd_mach_o_mkobject_init): Renamed from bfd_mach_o_mkobject.
1409 (bfd_mach_o_header_p): Created from bfd_mach_o_object_p.
1410 (bfd_mach_o_gen_object_p): New function, replaces bfd_mach_o_object_p.
1411 (bfd_mach_o_object_p): Removed.
1412 (bfd_mach_o_gen_core_p): New function, replaces ...
1413 (bfd_mach_o_core_p): ... deleted.
1414 (bfd_mach_o_bfd_print_private_bfd_data): Make it public.
1415
1416 * mach-o-i386.c: New file.
1417 * config.bfd: Use mach_o_i386_vec as targ_defvec for ix86-darwin.
1418 * configure.in (TDEFINES): Add mach_o_i386_vec.
1419 * configure: Regenerated.
1420 * targets.c: Add mach_o_i386_vec.
1421
1422 * mach-o.c: Update copyright years.
1423 (BFD_IO_FUNCS): Remove (was not used).
1424 (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr, bfd_mach_o_slurp_armap
1425 bfd_mach_o_slurp_extended_name_table,
1426 bfd_mach_o_construct_extended_name_table,
1427 bfd_mach_o_truncate_arname, bfd_mach_o_write_armap,
1428 bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt,
1429 bfd_mach_o_update_armap_timestamp, bfd_mach_o_close_and_cleanup,
1430 bfd_mach_o_bfd_free_cached_info, bfd_mach_o_new_section_hook,
1431 bfd_mach_o_get_section_contents_in_window,
1432 bfd_mach_o_bfd_is_local_label_name,
1433 bfd_mach_o_bfd_is_target_special_symbol,
1434 bfd_mach_o_bfd_is_local_label_name, bfd_mach_o_get_lineno,
1435 bfd_mach_o_find_nearest_line, bfd_mach_o_find_inliner_info,
1436 bfd_mach_o_bfd_make_debug_symbol, bfd_mach_o_read_minisymbols,
1437 bfd_mach_o_minisymbol_to_symbol,
1438 bfd_mach_o_bfd_get_relocated_section_contents,
1439 bfd_mach_o_bfd_relax_section, bfd_mach_o_bfd_link_hash_table_create,
1440 bfd_mach_o_bfd_link_hash_table_free, bfd_mach_o_bfd_link_add_symbols,
1441 bfd_mach_o_bfd_link_just_syms, bfd_mach_o_bfd_final_link,
1442 bfd_mach_o_bfd_link_split_section, bfd_mach_o_set_arch_mach,
1443 bfd_mach_o_bfd_merge_private_bfd_data,
1444 bfd_mach_o_bfd_set_private_flags, bfd_mach_o_get_section_contents,
1445 bfd_mach_o_bfd_gc_sections, bfd_mach_o_bfd_merge_sections,
1446 bfd_mach_o_bfd_is_group_section, bfd_mach_o_bfd_discard_group,
1447 bfd_mach_o_section_already_linked, bfd_mach_o_bfd_define_common_symbol,
1448 bfd_mach_o_bfd_copy_private_header_data,
1449 bfd_mach_o_core_file_matches_executable_p): Move these defines ...
1450 * mach-o-target.c: ... here.
1451 Update copyright years.
1452
1453 2009-06-04 Alan Modra <amodra@bigpond.net.au>
1454
1455 * dep-in.sed: Don't use \n in replacement part of s command.
1456 * Makefile.am (DEP1): LC_ALL for uniq.
1457 Run "make dep-am".
1458 * Makefile.in: Regenerate.
1459
1460 2009-06-03 H.J. Lu <hongjiu.lu@intel.com>
1461
1462 * elf32-i386.c (elf_i386_allocate_dynrelocs): Remove check of
1463 h->plt.refcount > 0 on STT_GNU_IFUNC symbol.
1464 * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
1465
1466 2009-06-03 H.J. Lu <hongjiu.lu@intel.com>
1467
1468 * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate
1469 GOT entry for STT_GNU_IFUNC symbol with pointer equality.
1470 (elf_i386_relocate_section): Adjust R_386_GOT32 relocation
1471 against STT_GNU_IFUNC symbols for static executables.
1472 (elf_i386_finish_dynamic_symbol): Load GOT entry with
1473 PLT entry for STT_GNU_IFUNC symbol with pointer equality.
1474
1475 * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Allocate
1476 GOT entry for STT_GNU_IFUNC symbol with pointer equality.
1477 (elf64_x86_64_finish_dynamic_symbol): Load GOT entry with
1478 PLT entry for STT_GNU_IFUNC symbol with pointer equality.
1479
1480 2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com>
1481
1482 * coff-rs6000.c (xcoff_ppc_relocate_section): Allow undefined
1483 symbols to be left unimported when linking statically.
1484 * xcofflink.c (xcoff_link_add_symbols): Ignore global linkage
1485 code when linking statically.
1486
1487 2009-06-02 H.J. Lu <hongjiu.lu@intel.com>
1488
1489 * elf32-i386.c (elf_i386_check_relocs): Increment
1490 got.refcount for R_386_GOT32/R_386_GOTOFF relocations
1491 against STT_GNU_IFUNC symbol.
1492 (elf_i386_allocate_dynrelocs): Set got.refcount to 0 if
1493 local STT_GNU_IFUNC definition is used.
1494 (elf_i386_relocate_section): Handle got.offset != -1 for
1495 R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC
1496 symbol.
1497
1498 * elf64-x86-64.c (elf64_x86_64_check_relocs): Increment
1499 got.refcount for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64
1500 relocations against STT_GNU_IFUNC symbol.
1501 (elf64_x86_64_allocate_dynrelocs): Set got.refcount to 0 if
1502 local STT_GNU_IFUNC definition is used.
1503 (elf64_x86_64_relocate_section): Handle got.offset != -1
1504 for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against
1505 STT_GNU_IFUNC symbol.
1506
1507 2009-06-01 H.J. Lu <hongjiu.lu@intel.com>
1508
1509 PR ld/10205
1510 * elf32-i386.c (elf_howto_table): Add R_386_IRELATIVE.
1511 (elf_i386_reloc_type_lookup): Likewise.
1512 (R_386_tls): Removed.
1513 (R_386_irelative): New.
1514 (R_386_vt_offset): Updated.
1515 (elf_i386_rtype_to_howto): Likewise.
1516 (elf_i386_link_hash_table): Add igotplt, iplt and irelplt.
1517 (elf_i386_link_hash_table_create): Initialize igotplt,
1518 iplt and irelplt.
1519 (elf_i386_check_relocs): Handle STT_GNU_IFUNC symbol first.
1520 (elf_i386_adjust_dynamic_symbol): Likewise.
1521 (elf_i386_allocate_dynrelocs): Likewise.
1522 (elf_i386_relocate_section): Likewise.
1523 (elf_i386_size_dynamic_sections): Set up .iplt and .igot.plt
1524 sections.
1525 (elf_i386_finish_dynamic_symbol): When building a static
1526 executable, use .iplt, .igot.plt and .rel.iplt sections for
1527 STT_GNU_IFUNC symbols. Generate R_386_IRELATIVE relocation for
1528 locally defined STT_GNU_IFUNC symbol.
1529
1530 * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_IRELATIVE.
1531 (x86_64_reloc_map): Likewise.
1532 (R_X86_64_standard): Updated.
1533 (elf64_x86_64_link_hash_table): Add igotplt, iplt and irelplt.
1534 (elf64_x86_64_link_hash_table_create): Initialize igotplt,
1535 iplt and irelplt.
1536 (elf64_x86_64_check_relocs): Handle STT_GNU_IFUNC symbol first.
1537 (elf64_x86_64_adjust_dynamic_symbol): Likewise.
1538 (elf64_x86_64_allocate_dynrelocs): Likewise.
1539 (elf64_x86_64_relocate_section): Likewise.
1540 (elf64_x86_64_size_dynamic_sections): Set up .iplt and .igot.plt
1541 sections.
1542 (elf64_x86_64_finish_dynamic_symbol): When building a static
1543 executable, use .iplt, .igot.plt and .rela.iplt sections for
1544 STT_GNU_IFUNC symbols. Generate R_X86_64_IRELATIVE relocation
1545 for locally defined STT_GNU_IFUNC symbol.
1546
1547 * reloc.c (BFD_RELOC_386_IRELATIVE): New.
1548 (BFD_RELOC_X86_64_IRELATIVE): Likewise.
1549
1550 * bfd-in2.h: Regenerated.
1551 * libbfd.h: Likewise.
1552
1553 2009-06-01 H.J. Lu <hongjiu.lu@intel.com>
1554
1555 * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs.
1556 (_bfd_elf_make_ifunc_reloc_section): Removed.
1557 (_bfd_elf_is_ifunc_symbol): Likewise.
1558 (_bfd_elf_create_static_ifunc_sections): New.
1559
1560 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC
1561 symbol check to ...
1562 (elf_link_add_object_symbols): Here.
1563 (_bfd_elf_link_hash_hide_symbol): Don't clean plt on
1564 STT_GNU_IFUNC symbol.
1565 (elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol
1566 if a STT_GNU_IFUNC symbol is referenced in a non-shared object.
1567 (IFUNC_INFIX): Removed.
1568 (get_ifunc_reloc_section_name): Likewise.
1569 (_bfd_elf_make_ifunc_reloc_section): Likewise.
1570 (_bfd_elf_is_ifunc_symbol): Likewise.
1571 (_bfd_elf_create_static_ifunc_sections): New.
1572
1573 2009-05-29 H.J. Lu <hongjiu.lu@intel.com>
1574
1575 * elf32-i386.c (link_hash_newfunc): Add elf_i386_ prefix.
1576 (create_got_section): Likewise.
1577 (allocate_dynrelocs): Likewise.
1578 (readonly_dynrelocs): Likewise.
1579 (set_tls_module_base): Likewise.
1580 (dtpoff_base): Likewise.
1581 (tpoff): Likewise.
1582 (elf_i386_link_hash_table_create): Updated.
1583 (elf_i386_create_dynamic_sections): Likewise.
1584 (elf_i386_check_relocs): Likewise.
1585 (elf_i386_size_dynamic_sections): Likewise.
1586 (elf_i386_relocate_section): Likewise.
1587
1588 * elf64-x86-64.c (link_hash_newfunc): Add elf64_x86_64_ prefix.
1589 (create_got_section): Likewise.
1590 (allocate_dynrelocs): Likewise.
1591 (readonly_dynrelocs): Likewise.
1592 (set_tls_module_base): Likewise.
1593 (dtpoff_base): Likewise.
1594 (tpoff): Likewise.
1595 (elf64_x86_64_link_hash_table_create): Updated.
1596 (elf64_x86_64_create_dynamic_sections): Likewise.
1597 (elf64_x86_64_check_relocs): Likewise.
1598 (elf64_x86_64_size_dynamic_sections): Likewise.
1599 (elf64_x86_64_relocate_section): Likewise.
1600
1601 2009-05-28 Nick Clifton <nickc@redhat.com>
1602
1603 * targets.c (_bfd_target_vector): Only include plugin target in
1604 all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.
1605
1606 2009-05-28 Ulrich Weigand <uweigand@de.ibm.com>
1607
1608 * elf32-spu.c (struct call_info): New member broken_cycle.
1609 (remove_cycle): Instead of physically removing call_info structures
1610 to break call graph cycles, mark them using the broken_cycle flag.
1611 (mark_overlay_section): Respect broken_cycle flag.
1612 (unmark_overlay_section): Likewise.
1613 (collect_lib_sections): Likewise.
1614 (collect_overlays): Likewise.
1615 (sum_stack): Likewise.
1616
1617 2009-05-28 Ulrich Weigand <uweigand@de.ibm.com>
1618
1619 * elf32-spu.c (insert_callee): Accumulate incoming callee->count.
1620 (mark_functions_via_relocs): Initialize callee->count to 1.
1621 (pasted_function): Likewise.
1622 (spu_elf_auto_overlay): Honor call counts when determining number
1623 of stubs required in software i-cache mode.
1624
1625 2009-05-27 Rafael Avila de Espindola <espindola@google.com>
1626
1627 * plugin.c (program_name): Remove.
1628 (plugin_program_name): New.
1629 (bfd_plugin_set_program_name): New.
1630 (try_load_plugin): Use plugin_program_name.
1631 * plugin.h (bfd_plugin_set_program_name): New.
1632
1633 2009-05-27 Rafael Avila de Espindola <espindola@google.com>
1634
1635 * aclocal.m4: Include ../config/plugins.m4.
1636 * configure.in: Use AC_PLUGINS.
1637 * configure: Regenerate.
1638 * Makefile.in: Regenerate.
1639 * doc/Makefile.in: Regenerate.
1640
1641 2009-05-27 Nathan Sidwell <nathan@codesourcery.com>
1642
1643 * elf32-ppc.c (ppc_elf_relax_section): Work with a partial
1644 link.
1645 * bout.c (b_out_bfd_relax_section): Reject relocatable links.
1646 * elf32-m10300.c (mn10300_elf_relax_section): Likewise.
1647 * elf32-avr.c (elf32_avr_relax_section): Likewise.
1648 * elf32-frv.c (elf32_avr_relax_section): Likewise.
1649 * elf32-xtensa.c (elf_xtensa_relax_section): Likewise.
1650 * elf64-mmix.c (mmix_elf_relax_section): Likewise.
1651 * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
1652 * elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise.
1653 * reloc.c (bfd_generic_relax_section): Likewise.
1654 * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
1655 * vms.c (vms_bfd_relax_section): Likewise.
1656
1657 2009-05-26 H.J. Lu <hongjiu.lu@intel.com>
1658
1659 * elf-bfd.h (_bfd_elf_is_ifunc_symbol): New.
1660
1661 * elf32-i386.c (is_indirect_symbol): Renamed to ...
1662 * elflink.c (_bfd_elf_is_ifunc_symbol): This.
1663
1664 * elf32-i386.c (allocate_dynrelocs): Updated.
1665 (elf_i386_relocate_section): Likewise.
1666 * elf64-x86-64.c (allocate_dynrelocs): Likewise.
1667 (elf64_x86_64_relocate_section): Likewise.
1668
1669 * elf64-x86-64.c (is_indirect_symbol): Removed.
1670
1671 2009-05-26 Nick Clifton <nickc@redhat.com>
1672
1673 * po/id.po: Updated Indonesian translation.
1674
1675 2009-05-26 Rafael Avila de Espindola <espindola@google.com>
1676
1677 * Makefile.am: Run "make dep-am".
1678 (AM_CPPFLAGS): New.
1679 (LIBDL): New.
1680 (ALL_MACHINES): Add cpu-plugin.lo.
1681 (ALL_MACHINES_CFILES): Add cpu-plugin.c.
1682 (BFD32_BACKENDS): Add plugin.lo.
1683 (BFD32_BACKENDS_CFILES): Add plugin.c.
1684 (libbfd_la_LIBADD): Add LIBDL
1685 * archures.c (bfd_architecture): Add bfd_arch_plugin.
1686 (bfd_plugin_arch): Declare.
1687 * bfd-in.h (BFD_SUPPORTS_PLUGINS): New.
1688 * bfd.c (bfd): Add plugin_data.
1689 * config.bfd: Handle the plugin target.
1690 * configure.in: Check for --enable-plugins.
1691 (LT_INIT): Use the dlopen option.
1692 * cpu-plugin.c: New.
1693 * plugin.c: New.
1694 * plugin.h: New.
1695 * targets.c (plugin_vec): Declare.
1696 (_bfd_target_vector): Add plugin_vec.
1697 * Makefile.in: Regenerate.
1698 * bfd-in2.h: Regenerate.
1699 * configure: Regenerate.
1700
1701 2009-05-26 Alan Modra <amodra@bigpond.net.au>
1702
1703 * dep-in.sed: Don't modify .o to .lo here. Output one filename
1704 per line with all lines having continuation backslash. Prefix
1705 first line with "A", following lines with "B".
1706 * Makefile.am (DEP): Don't use dep.sed here.
1707 (DEP1): Run $MKDEP on single files, modify .o to .lo here. Use
1708 dep.sed here on dependencies, sort and uniq.
1709 * Makefile.in: Regenerate.
1710
1711 2009-05-25 Tristan Gingold <gingold@adacore.com>
1712
1713 * makefile.vms: Add verilog.obj to object list OBJS.
1714
1715 2009-05-24 Alan Modra <amodra@bigpond.net.au>
1716
1717 * bfdio.c (bfd_seek): Formatting. Ensure newly allocated memory
1718 for BFD_IN_MEMORY is cleared.
1719 (bfd_bwrite): Zero excess memory allocated.
1720
1721 2009-05-22 Julian Brown <julian@codesourcery.com>
1722
1723 * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New
1724 macros.
1725 (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
1726 (elf32_arm_stub_a8_veneer_blx): New stub sequences.
1727 (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
1728 arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
1729 (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
1730 (a8_erratum_fix, a8_erratum_reloc): New structs.
1731 (elf32_arm_link_hash_table): Add a8_erratum_fixes,
1732 num_a8_erratum_fixes, fix_cortex_a8 fields.
1733 (elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
1734 (elf32_arm_add_stub): Split into two parts, creating...
1735 (elf32_arm_create_or_find_stub_sec): New function.
1736 (elf32_arm_final_link_relocate): Add forward declaration.
1737 (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
1738 relocations, multiple relocations per stub.
1739 (find_stub_size_and_template): New (using parts of arm_size_one_stub).
1740 (arm_size_one_stub): Use find_stub_size_and_template.
1741 (a8_reloc_compare): New.
1742 (find_thumb_glue): Add forward declaration.
1743 (cortex_a8_erratum_scan): New.
1744 (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
1745 (bfd_elf32_arm_set_cortex_a8_fix): New.
1746 (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
1747 (arm_map_one_stub): Add THUMB32_TYPE support.
1748 (a8_branch_to_stub_data): New.
1749 (make_branch_to_a8_stub): New.
1750 (elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
1751 * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
1752 (bfd_elf32_arm_set_target_relocs): Add argument for controlling
1753 Cortex-A8 erratum workaround.
1754 * bfd-in2.h: Regenerate.
1755
1756 2009-05-22 Alan Modra <amodra@bigpond.net.au>
1757
1758 * Makefile.am: Run "make dep-am".
1759 * Makefile.in: Regenerate.
1760 * po/SRC-POTFILES.in: Regenerate.
1761
1762 2009-05-21 Alan Modra <amodra@bigpond.net.au>
1763
1764 * elflink.c (elf_link_input_bfd): Correct *pindex change in last
1765 commit.
1766
1767 2009-05-21 Alan Modra <amodra@bigpond.net.au>
1768
1769 * elf-bfd.h (struct elf_backend_data
1770 <elf_backend_link_output_symbol_hook>): Return an int.
1771 * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop
1772 symbols on deleted .opd entries.
1773 * elflink.c (elf_link_output_sym): Return without outputting sym
1774 if output_symbol_hook returns 2.
1775 (elf_link_output_extsym): Don't assign h->indx when symbol discarded.
1776 Abort if we must not discard sym.
1777 (elf_link_input_bfd): Similarly, don't set finfo->indices for
1778 local syms.
1779 (bfd_elf_final_link): Adjust elf_link_output_sym calls.
1780 * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for
1781 elf_backend_link_output_symbol_hook return type change.
1782 * elf32-arm.c (output_arch_syminfo): Likewise.
1783 (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise.
1784 (elf32_arm_output_arch_local_syms): Likewise.
1785 * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise.
1786 * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise.
1787 (bfd_score_elf_link_output_symbol_hook): Likewise.
1788 * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
1789 * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
1790 * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise.
1791 * elf32-spu.c (spu_elf_output_symbol_hook): Likewise.
1792 * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise.
1793 * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise.
1794 * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise.
1795 * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise.
1796 * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
1797 * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise.
1798 * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
1799
1800 2009-05-21 Alan Modra <amodra@bigpond.net.au>
1801
1802 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
1803 out of range .opd symbols.
1804
1805 2009-05-21 Dave Korn <dave.korn.cygwin@gmail.com>
1806
1807 * coffgen.c (coff_print_symbol): Use bfd_fprintf_vma, not
1808 fprintf_vma directly.
1809 * peXXigen.c (pe_print_edata): Likewise.
1810 (pe_print_pdata): Likewise.
1811 (_bfd_XX_print_ce_compressed_pdata): Likewise.
1812 (_bfd_XX_print_private_bfd_data_common): Likewise.
1813
1814 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com>
1815
1816 * cofflink.c (process_embedded_commands): Ignore "-aligncomm".
1817
1818 2009-05-15 Andrew Stubbs <ams@codesourcery.com>
1819 Paul Brook <paul@codesourcery.com>
1820
1821 * elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
1822 fix discarded sections.
1823
1824 2009-05-14 Ulrich Weigand <uweigand@de.ibm.com>
1825
1826 * elf32-spu.c (mark_overlay_section): Move .init and .fini
1827 sections into the software icache.
1828
1829 2009-05-14 Ulrich Weigand <uweigand@de.ibm.com>
1830
1831 * elf32-spu.c (build_stub): Always build "compact" sofware
1832 i-cache stubs.
1833
1834 2009-05-14 Ulrich Weigand <uweigand@de.ibm.com>
1835
1836 * elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2.
1837 (spu_elf_setup): Initialize it.
1838 (spu_elf_size_stubs): Move .ovtab into .bss for software i-cache.
1839 Update to new-sytle cache manager data structures.
1840 (spu_elf_build_stubs): Generate new-style cache manager data
1841 structures and symbols.
1842 (spu_elf_auto_overlay): Update size computation.
1843
1844 2009-05-14 Ulrich Weigand <uweigand@de.ibm.com>
1845
1846 * elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY
1847 segments first amongst the program headers.
1848
1849 2009-05-14 Ulrich Weigand <uweigand@de.ibm.com>
1850
1851 * elf32-spu.c (spu_elf_relocate_section): Only encode overlay index
1852 into addresses for relocation types that look at high bits. Remove
1853 special handling of relocation overflow warnings.
1854
1855 2009-05-14 Ulrich Weigand <uweigand@de.ibm.com>
1856
1857 * elf32-spu.c (mark_functions_via_relocs): Handle cycles in the
1858 control flow graph between fragments of a function.
1859
1860 2009-05-14 Ulrich Weigand <uweigand@de.ibm.com>
1861
1862 * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode,
1863 generate only a 16-byte .toe section.
1864 (spu_elf_build_stubs, spu_elf_auto_overlay): Likewise.
1865
1866 2009-05-14 Alan Modra <amodra@bigpond.net.au>
1867
1868 * elf32-spu.c (spu_elf_size_stubs): Split out section placement to..
1869 (spu_elf_place_overlay_data): ..here. New function.
1870 * elf32-spu.h (spu_elf_place_overlay_data): Declare.
1871
1872 2009-05-13 Andrew Jenner <andrew@codesourcery.com>
1873
1874 * elf32-arm.c: Move sysdep.h to start of file.
1875
1876 2009-05-11 Ulrich Weigand <uweigand@de.ibm.com>
1877
1878 * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as
1879 start of overlays.
1880 (spu_elf_build_stubs): Don't define __icache_tagbase. Define
1881 __icache_tag_array and __icache_tag_array_size.
1882
1883 2009-05-11 Masaki Muranaka <monaka@monami-software.com>
1884
1885 * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Remove unnecessary
1886 ATTRIBUTE_UNUSED.
1887 (bfinfdpic_link_omit_section_dynsym): Likewise.
1888 (elf32_bfinfdpic_finish_dynamic_sections): Likewise.
1889
1890 2009-05-05 Paul Brook <paul@codesourcery.com>
1891
1892 * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype.
1893 * bfd-in2.h: Regenerate.
1894 * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define.
1895 (_arm_elf_section_data): Add text and exidx fields.
1896 (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size,
1897 insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31,
1898 copy_exidx_entry): New functions.
1899 (elf32_arm_write_section): Fixup .ARM.exidx contents.
1900
1901 2009-05-05 Christophe lyon <christophe.lyon@st.com>
1902
1903 * elf32-arm.c (DEF_STUBS): New helper define.
1904 (DEF_STUB): Likewise.
1905 (stub_def): New type.
1906 (stub_definitions): New array, containing stub template pointers
1907 and sizes.
1908 (arm_size_one_stub): Make use of stub_definitions.
1909
1910 2009-05-04 Dave Korn <dave.korn.cygwin@gmail.com>
1911
1912 * elflink.c (find_version_for_sym): Remove from here, ...
1913 * linker.c (bfd_find_version_for_sym): ... rename, replace
1914 here, make public and update all callers.
1915 * bfd-in2.h: Regenerate.
1916
1917 2009-04-30 Nick Clifton <nickc@redhat.com>
1918
1919 * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs
1920 section pointer.
1921 (struct elf_obj_data): Add has_ifunc_symbols boolean.
1922 * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags
1923 into a STT_GNU_IFUNC symbol type.
1924 (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function
1925 type.
1926 (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if
1927 the binary contains ifunc symbols.
1928 * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC
1929 symbol type into a BSF_GNU_INDIRECT_FUNCTION flag.
1930 * elf32-i386.c (is_indirect_function): New function.
1931 (elf_i386_check_relocs): Create an ifunc output section.
1932 (allocate_dynrelocs): Create dynamic relocs in the ifunc output
1933 section if necessary.
1934 (elf_i386_relocate_section): Emit a reloc against an ifunc symbol
1935 if necessary.
1936 (elf_i386_add_symbol_hook): New function. Set the
1937 has_ifunc_symbols field of the elf_obj_data structure if an ifunc
1938 symbol is encountered.
1939 (elf_backend_post_process_headers): Define.
1940 (elf_backend_add_symbol_hook): Define.
1941 (elf_i386_post_process_headers): Rename to
1942 elf_i388_fbsd_post_process_headers.
1943 * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro.
1944 (is_indirect_function): New function.
1945 (elf64_x86_64_check_relocs): Create an ifunc output section.
1946 (allocate_dynrelocs): Create dynamic relocs in the ifunc output
1947 section if necessary.
1948 (elf64_x86_64_relocate_section): Emit a reloc against an ifunc
1949 symbol if necessary.
1950 (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the
1951 elf_obj_data structure if an ifunc symbol is encountered.
1952 (elf_backend_post_process_headers): Define.
1953 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT
1954 if we have ifunc symbols to handle.
1955 (get_ifunc_reloc_section_name): New function. Computes the name
1956 for an ifunc section.
1957 (_bfd_elf_make_ifunc_reloc_section): New function. Creates a
1958 section to hold ifunc relocs.
1959 * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define.
1960 (bfd_print_symbol_vandf): Handle ifunc symbols.
1961 (bfd_decode_symclass): Likewise.
1962 * bfd-in2.h: Regenerate.
1963
1964 2009-04-30 Joseph Myers <joseph@codesourcery.com>
1965
1966 * elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
1967 MOVW and MOVT relocations in a shared library link.
1968
1969 2009-04-27 Anthony Green <green@moxielogic.com>
1970
1971 * verilog.c: New file.
1972 * Makefile.am (BFD32_LIBS): Add verilog.c.
1973 (BFD32_LIBS_CFILES): Add verilog.c.
1974 (verilog.lo): New build rule.
1975 * Makefile.in: Rebuilt.
1976 * targets.c: Add verilog support.
1977 * bfd.c (tdata union): Add Verilog private data field.
1978 * bfd-in2.h: Regenerate.
1979
1980 2009-04-27 H.J. Lu <hongjiu.lu@intel.com>
1981
1982 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
1983 copy pe_opthdr.
1984
1985 2009-04-23 Matthias Klose <doko@ubuntu.com>
1986
1987 * peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
1988
1989 2009-04-22 Christophe Lyon <christophe.lyon@st.com>
1990
1991 PR9743
1992 * elf32-arm.c (arm_type_of_stub): Handle R_ARM_THM_JUMP24,
1993 R_ARM_JUMP24 and R_ARM_PLT32 relocations.
1994 (elf32_arm_size_stubs): Likewise.
1995 (record_thumb_to_arm_glue): Deleted unused function.
1996 (bfd_elf32_arm_process_before_allocation): No longer handle
1997 R_ARM_THM_JUMP24, R_ARM_JUMP24 and R_ARM_PLT32 relocations here.
1998 (elf32_arm_final_link_relocate): Handle R_ARM_THM_JUMP24,
1999 R_ARM_JUMP24 and R_ARM_PLT32 relocations.
2000
2001 2009-04-21 Daniel Jacobowitz <dan@codesourcery.com>
2002
2003 * elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED.
2004 (elf32_arm_write_section): Declare early.
2005 (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD.
2006 (arm_allocate_glue_section_space): Exclude empty sections.
2007 (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED.
2008 (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub
2009 BFD.
2010 (elf32_arm_output_glue_section, elf32_arm_final_link): New.
2011 (elf32_arm_merge_eabi_attributes): Skip the stub BFD.
2012 (elf32_arm_size_dynamic_sections): Allocate interworking
2013 sections here.
2014 (bfd_elf32_bfd_final_link): Define.
2015
2016 2009-04-21 H.J. Lu <hongjiu.lu@intel.com>
2017
2018 * coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K.
2019
2020 * coffcode.h (coff_compute_section_file_positions): Clear
2021 D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE.
2022
2023 * libcoff-in.h (pe_tdata): Remove force_minimum_alignment and
2024 force_minimum_alignment.
2025
2026 * libcoff.h: Regenerated.
2027
2028 * pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed.
2029 (PEI_FORCE_MINIMUM_ALIGNMENT): Likewise.
2030
2031 * peicode.h (pe_mkobject): Don't set force_minimum_alignment
2032 nor target_subsystem.
2033
2034 * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check
2035 force_minimum_alignment nor target_subsystem.
2036
2037 2009-04-21 Kai Tietz <kai.tietz@onevision.com>
2038
2039 * coff-x86_64.c (PEI_HEADERS): Protect includes.
2040 (bfd_pe_print_pdata): Remove #ifdef PE variation.
2041 * pei-x86_64.c (PEI_HEADERS): Define to prevent double
2042 include in coff-x86_64.c of headers.
2043 (PDATA_ROW_SIZE): New define.
2044 (pex_regs[]): New static array.
2045 (pex64_get_runtime_function): New static function.
2046 (pex64_get_unwind_info): Likewise.
2047 (pex64_get_scope_entry): Likewise.
2048 (pex64_xdata_print_uwd_codes): Likewise.
2049 (pex64_get_section_by_rva): Likewise.
2050 (pex64_dump_xdata): Likewise.
2051 (pex64_bfd_print_pdata): Likewise.
2052 (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata.
2053 * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation.
2054 * libpei.h (_bfd_pex64_print_pdata): Removed declaration.
2055
2056 2009-04-19 Peter O'Gorman <binutils@mlists.thewrittenword.com>
2057 Alan Modra <amodra@bigpond.net.au>
2058 Dave Korn <dave.korn.cygwin@gmail.com>
2059
2060 * peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t
2061 long names and non-NUL-terminated strings.
2062
2063 2009-04-17 H.J. Lu <hongjiu.lu@intel.com>
2064
2065 * bfd-in2.h: Regenerated.
2066
2067 2009-04-17 H.J. Lu <hongjiu.lu@intel.com>
2068
2069 * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace
2070 IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER.
2071
2072 2009-04-17 H.J. Lu <hongjiu.lu@intel.com>
2073
2074 PR binutils/10074
2075 * coffcode.h (bfd_pei_p): New.
2076
2077 * config.bfd: Remove bfd_efi_bsdrv_ia32_vec,
2078 bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
2079 bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and
2080 bfd_efi_rtdrv_ia64_vec. Replace bfd_efi_app_ia32_vec,
2081 bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with
2082 i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively.
2083
2084 * configure.in: Remove bfd_efi_bsdrv_ia32_vec,
2085 bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
2086 bfd_efi_rtdrv_x86_64_vec,
2087 bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec. Replace
2088 bfd_efi_ia64_vec with bfd_pei_ia64_vec.
2089 * targets.c: Likewise.
2090
2091 * configure: Regenerated.
2092 * libcoff.h: Likewise.
2093 * Makefile.in: Likewise.
2094
2095 * efi-app-ia32.c: Removed.
2096 * efi-app-x86_64.c: Likewise.
2097 * efi-bsdrv-ia32.c: Likewise.
2098 * efi-bsdrv-ia64.c: Likewise.
2099 * efi-bsdrv-x86_64.c: Likewise.
2100 * efi-rtdrv-ia32.c: Likewise.
2101 * efi-rtdrv-ia64.c: Likewise.
2102 * efi-rtdrv-x86_64.c: Likewise.
2103 * efi-rtdrv-ia32.c: Likewise.
2104
2105 * efi-app-ia64.c: Moved to ...
2106 * pei-ia64.c: This.
2107 (TARGET_SYM): Set to bfd_pei_ia64_vec.
2108 (TARGET_NAME): Set to pei-ia64.
2109
2110 * libpei.h (bfd_target_pei_p): Removed.
2111 (bfd_target_pei_arch): Likewise.
2112 (bfd_target_efi_app_p): Likewise.
2113 (bfd_target_efi_app_arch): Likewise.
2114 (bfd_target_efi_bsdrv_p): Likewise.
2115 (bfd_target_efi_bsdrv_arch): Likewise.
2116 (bfd_target_efi_rtdrv_p): Likewise.
2117 (bfd_target_efi_rtdrv_arch): Likewise.
2118 (bfd_pe_executable_p): Likewise.
2119
2120 * Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo,
2121 efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo.
2122 (BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c
2123 and efi-rtdrv-ia32.c.
2124 (BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo,
2125 efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and
2126 efi-rtdrv-x86_64.lo. Add pei-ia64.lo.
2127 (BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c,
2128 efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and
2129 efi-rtdrv-x86_64.c. Add pei-ia64.c.
2130 (efi-app-ia64.lo): Removed.
2131 (efi-bsdrv-ia32.lo): Likewise.
2132 (efi-rtdrv-ia32.lo): Likewise.
2133 (efi-app-ia64.lo): Likewise.
2134 (efi-bsdrv-ia64.lo): Likewise.
2135 (efi-rtdrv-ia64.lo): Likewise.
2136 (efi-app-x86_64.lo): Likewise.
2137 (efi-bsdrv-x86_64.lo): Likewise.
2138 (efi-rtdrv-x86_64.lo): Likewise.
2139 (pei-ia64.lo): New.
2140
2141 * peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p
2142 with bfd_pei_p.
2143 (arch_type): Removed.
2144 (pe_arch): Likewise.
2145 (pe_bfd_object_p): Just return coff_object_p.
2146
2147 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace
2148 bfd_pe_executable_p with bfd_pei_p.
2149
2150 2009-04-17 Christophe Lyon <christophe.lyon@st.com>
2151
2152 * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through
2153 PLT entries to an undefined symbol when generating a shared
2154 library.
2155
2156 2009-04-17 Nick Clifton <nickc@redhat.com>
2157
2158 PR 9909
2159 * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols.
2160
2161 2009-04-16 Richard Sandiford <r.sandiford@uk.ibm.com>
2162
2163 * aout-adobe.c (aout_32_bfd_define_common_symbol): Define.
2164 * aout-target.h (MY_bfd_define_common_symbol): Likewise.
2165 * aout-tic30.c (MY_bfd_define_common_symbol): Likewise.
2166 * binary.c (binary_bfd_define_common_symbol): Likewise.
2167 * bout.c (b_out_bfd_define_common_symbol): Likewise.
2168 * coff-alpha.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
2169 * coff-mips.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
2170 * coffcode.h (coff_bfd_define_common_symbol): Likewise.
2171 * elfxx-target.h (bfd_elfNN_bfd_define_common_symbol): Likewise.
2172 * i386msdos.c (msdos_bfd_define_common_symbol): Likewise.
2173 * i386os9k.c (os9k_bfd_define_common_symbol): Likewise.
2174 * ieee.c (ieee_bfd_define_common_symbol): Likewise.
2175 * ihex.c (ihex_bfd_define_common_symbol): Likewise.
2176 * libbfd-in.h (_bfd_nolink_bfd_define_common_symbol): Likewise.
2177 * mach-o.c (bfd_mach_o_bfd_define_common_symbol): Likewise.
2178 * mmo.c (mmo_bfd_define_common_symbol): Likewise.
2179 * nlm-target.h (nlm_bfd_define_common_symbol): Likewise.
2180 * oasys.c (oasys_bfd_define_common_symbol): Likewise.
2181 * pef.c (bfd_pef_bfd_define_common_symbol): Likewise.
2182 * ppcboot.c (ppcboot_bfd_define_common_symbol): Likewise.
2183 * som.c (som_bfd_define_common_symbol): Likewise.
2184 * srec.c (srec_bfd_define_common_symbol): Likewise.
2185 * tekhex.c (tekhex_bfd_define_common_symbol): Likewise.
2186 * versados.c (versados_bfd_define_common_symbol): Likewise.
2187 * vms.c (vms_bfd_define_common_symbol): Likewise.
2188 * xcoff-target.h (_bfd_xcoff_bfd_define_common_symbol): Likewise.
2189 * xsym.c (bfd_sym_bfd_define_common_symbol): Likewise.
2190 * coff-rs6000.c (rs6000coff_vec): Add _bfd_xcoff_define_common_symbol.
2191 (pmac_xcoff_vec): Likewise.
2192 * coff64-rs6000.c (rs6000coff64_vec): Likewise.
2193 (aix5coff64_vec): Likewise.
2194 * linker.c (bfd_generic_define_common_symbol): New function.
2195 * targets.c (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_define_common_symbol.
2196 (_bfd_define_common_symbol): New field.
2197 * libcoff-in.h (_bfd_xcoff_define_common_symbol): Declare.
2198 * xcofflink.c (_bfd_xcoff_define_common_symbol): New function.
2199 (xcoff_build_ldsyms): Don't set XCOFF_DEF_REGULAR for common
2200 symbols here.
2201 * bfd-in2.h: Regenerate.
2202 * libbfd.h: Likewise.
2203 * libcoff.h: Likewise.
2204
2205 2009-04-15 Anthony Green <green@moxielogic.com>
2206
2207 * targets.c: Add moxie support.
2208 * Makefile.am: Ditto.
2209 * Makefile.in: Rebuilt.
2210 * cpu-moxie.c, elf32-moxie.c: New files.
2211 * archures.c: Add moxie support.
2212 * configure.in: Add moxie support.
2213 * configure: Rebuilt.
2214 * config.bfd, archures.c: Add moxie support.
2215 * bfd-in2.h: Rebuilt.
2216
2217 2009-04-15 Christophe Lyon <christophe.lyon@st.com>
2218
2219 * elf32-arm.c (elf32_arm_final_link_relocate): Don't convert ARM
2220 branch to an undef weak symbol into a jump to next instruction if
2221 a PLT entry will be created.
2222
2223 2009-04-14 Dave Korn <dave.korn.cygwin@gmail.com>
2224
2225 * coffgen.c (make_a_section_from_file): Set the backend long
2226 section names enable if long section names found on input.
2227 * coffcode.h: Extend long section names documentation to match.
2228
2229 2009-04-08 H.J. Lu <hongjiu.lu@intel.com>
2230
2231 * elflink.c (elf_link_add_object_symbols): Warn alternate ELF
2232 machine code.
2233
2234 2009-04-07 DJ Delorie <dj@redhat.com>
2235
2236 * archures.c: Add bfd_mach_mep_c5.
2237 * bfd-in2.h: Likewise.
2238 * cpu-mep.c: Add bfd_c5_arch.
2239 * elf32-mep.c: Support it.
2240
2241 2009-04-07 H.J. Lu <hongjiu.lu@intel.com>
2242
2243 * elflink.c (_bfd_elf_section_already_linked): Add `\n' for
2244 info->callbacks->einfo.
2245 * linker.c (_bfd_generic_section_already_linked): Likewise.
2246
2247 2009-04-06 DJ Delorie <dj@redhat.com>
2248
2249 * elf32-h8300.c (elf32_h8_relax_section): Relax MOVA opcodes.
2250
2251 2009-04-06 H.J. Lu <hongjiu.lu@intel.com>
2252
2253 * coff-x86_64.c (bfd_pe_print_pdata): Defined to
2254 _bfd_pex64_print_pdata only if PE is defined.
2255
2256 * libpei.h (_bfd_pep_print_x64_pdata): Renamed to ...
2257 (_bfd_pex64_print_pdata): This.
2258
2259 * peXXigen.c (_bfd_pep_print_x64_pdata): Renamed to ...
2260 (_bfd_pex64_print_pdata): This. Defined only if COFF_WITH_pex64
2261 is defined.
2262
2263 2009-04-05 Kai Tietz <kai.tietz@onevision.com>
2264
2265 * coff-x86_64.c (bfd_pe_print_pdata): Define as
2266 _bfd_pep_print_x64_pdata.
2267 * libpei.h (_bfd_pep_print_x64_pdata): Add prototype.
2268 * peXXigen.c (_bfd_pep_print_x64_pdata): New.
2269
2270 2009-04-02 Sterling Augustine <sterling@jaw.hq.tensilica.com>
2271
2272 * elf32-xtensa.c (relax_property_section): Always set r_offset
2273 to zero.
2274
2275 2009-04-02 Christophe Lyon <christophe.lyon@st.com>
2276
2277 * elf32-arm.c (elf32_arm_stub_long_branch_v4t_thumb_thumb,
2278 elf32_arm_stub_long_branch_v4t_thumb_thumb_pic): Two new long
2279 branch stubs.
2280 (elf32_arm_stub_type): New enum values for the two new stubs.
2281 (arm_type_of_stub): Make use of the two new stubs.
2282 (arm_size_one_stub): Handle the two new stubs.
2283
2284 2009-04-01 Matt Thomas <matt@netbsd.org>
2285
2286 * elf32-vax.c (elf_vax_check_relocs): Do not put relocations against
2287 hidden symbols into the GOT or PLT.GOT.
2288 (elf_vax_relocate_section): Do not emit a PCREL reloc
2289 into a shared object if it is against a hidden symbol.
2290
2291 2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
2292
2293 * xcofflink.c (xcoff_archive_info): Add contains_shared_object_p
2294 and know_contains_shared_object_p.
2295 (xcoff_archive_contains_shared_object_p): Add an "info" parameter.
2296 Cache the result in the archive_info table.
2297 (xcoff_auto_export_p): Add an "info" parameter and update the
2298 call to xcoff_archive_contains_shared_object_p.
2299 (xcoff_mark_auto_exports): Update accordingly.
2300 (xcoff_post_gc_symbol): Likewise.
2301
2302 2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
2303
2304 * xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
2305 rather than C_EXT.
2306
2307 2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
2308
2309 * coff-rs6000.c (member_layout): New structure.
2310 (archive_iterator): Likewise.
2311 (member_layout_init): New function.
2312 (archive_iterator_begin): Likewise.
2313 (archive_iterator_next): Likewise.
2314 (xcoff_write_armap_old): Use the new iterator functions.
2315 (do_shared_object_padding): Delete.
2316 (xcoff_write_armap_big): Use the new iterator functions. Simplify
2317 handling of arch_info.
2318 (xcoff_write_archive_contents_old): Allocate arelt_data in the
2319 first loop rather than the second. Allocate a member header if
2320 there isn't one, then work out the stat information and length
2321 in the first loop too. Use the new iterators for the second loop.
2322 (xcoff_write_archive_contents_big): Likewise.
2323
2324 2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
2325
2326 * bfd-in.h (bfd_xcoff_split_import_path): Declare.
2327 (bfd_xcoff_set_archive_import_path): Likewise.
2328 * bfd-in2.h: Regenerate.
2329 * xcofflink.c: Include libiberty.h.
2330 (xcoff_archive_info): New structure.
2331 (xcoff_archive_info_hash): New function.
2332 (xcoff_archive_info_eq): Likewise.
2333 (xcoff_get_archive_info): Likewise.
2334 (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info.
2335 (bfd_xcoff_split_import_path): New function.
2336 (bfd_xcoff_set_archive_import_path): Likewise.
2337 (xcoff_set_import_path): Move earlier in file.
2338 (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive
2339 object to the the directory part of the bfd's filename. Get the
2340 import path and filename of an archive object from the archive's
2341 xcoff_tdata, initializing it if necessary. Update use of
2342 import_file_id.
2343 (bfd_link_input_bfd): Update use of import_file_id.
2344 (xcoff_write_global_symbol): Likewise.
2345
2346 2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
2347
2348 * xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
2349
2350 2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
2351
2352 * xcofflink.c (xcoff_link_create_extra_sections): Don't create
2353 a .loader section for relocatable links.
2354 (xcoff_need_ldrel_p): New function.
2355 (xcoff_mark): Use it.
2356 (bfd_xcoff_link_count_reloc): Only count loader relocs if there's
2357 a loader section.
2358 (xcoff_build_ldsym): New function, split out from...
2359 (xcoff_build_ldsyms): ...here. Rename to...
2360 (xcoff_post_gc_symbol): ...this. Only export symbols, and only
2361 call xcoff_build_ldsym, if there's a loader section.
2362 (xcoff_build_loader_section): New function, extracted verbatim from...
2363 (bfd_xcoff_size_dynamic_sections): ...here. Only call it if
2364 there's a loader section. Only add an __rtinit loader symbol
2365 if there's a loader section. Update after above name change.
2366 (xcoff_symbol_section, xcoff_create_ldrel): New functions.
2367 (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
2368 and xcoff_create_ldrel.
2369 (xcoff_write_global_symbol): Use xcoff_create_ldrel.
2370 (xcoff_reloc_link_order): Likewise, but only call it if there's
2371 a loader section. Use xcoff_symbol_section.
2372 (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
2373 if there's a loader section.
2374
2375 2009-04-01 Richard Sandiford <rdsandiford@googlemail.com>
2376
2377 * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
2378
2379 2009-04-01 Christophe Lyon <christophe.lyon@st.com>
2380
2381 * elf32-arm.c (group_sections): Rewrite loops for better
2382 readability.
2383
2384 2009-03-30 DJ Delorie <dj@redhat.com>
2385
2386 * elflink.c (elf_link_input_bfd): Don't try to resolve complex
2387 relocs when doing a relocatable link.
2388
2389 2009-03-28 Mark Mitchell <mark@codesourcery.com>
2390
2391 * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not
2392 "ERROR:", in error messages.
2393 * cpu-arm.c (bfd_arm_merge_machines): Likewise.
2394 * elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
2395 * elf32-arm.c (tag_cpu_arch_combine): Likewise.
2396 (elf32_arm_merge_eabi_attributes): Likewise.
2397 (elf32_arm_merge_private_bfd_data): Likewise.
2398
2399 2009-03-27 Nick Clifton <nickc@redhat.com>
2400
2401 * section.c (bfd_get_section_contents): Detect and handle the case
2402 where a section has the SEC_IN_MEMORY flag set but no actual
2403 contents allocated.
2404
2405 2009-03-26 Alan Modra <amodra@bigpond.net.au>
2406
2407 PR 6494
2408 * elf.c (copy_elf_program_header): Do not check that PT_GNU_RELRO
2409 p_filesz and p_memsz are equal. Use p_memsz as the segment size.
2410 (assign_file_positions_for_non_load_sections): Zap PT_GNU_RELRO
2411 if we don't find matching PT_LOAD when copying.
2412
2413 2009-03-25 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
2414
2415 * elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of
2416 the reloc descriptions.
2417
2418 2009-03-25 Hans-Peter Nilsson <hp@axis.com>
2419
2420 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
2421 <R_CRIS_16_GOT_GD, case R_CRIS_32_GOT_GD>: Handle COMMON symbols.
2422 <case R_CRIS_16_TPREL, R_CRIS_32_TPREL>: Ditto.
2423
2424 2009-03-24 H.J. Lu <hongjiu.lu@intel.com>
2425
2426 * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Make it static.
2427 (bfd_i386_arch_intel_syntax): Likewise.
2428 (i8086_arch): Likewise.
2429 (bfd_x86_64_arch): Likewise.
2430
2431 2009-03-24 Hans-Peter Nilsson <hp@axis.com>
2432
2433 * elf32-cris.c (cris_elf_relocate_section): <case
2434 R_CRIS_16_DTPREL, R_CRIS_32_DTPREL>: Allow use of non-local
2435 symbols for non-allocated sections. Don't check whether to
2436 generate R_CRIS_DTPMOD for non-allocated sections.
2437 (cris_elf_gc_sweep_hook) <case R_CRIS_32_DTPREL>: Don't
2438 handle relocation GC:ing if applied to non-allocated section.
2439 (cris_elf_check_relocs): Similar.
2440
2441 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
2442 <R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: Don't include the TLS size
2443 when emitting a known TP offset in the GOT.
2444
2445 2009-03-23 Alan Modra <amodra@bigpond.net.au>
2446
2447 * elf64-ppc.c (synthetic_opd): Delete.
2448 (compare_symbols): Look for .opd name rather than section match.
2449 (ppc64_elf_get_synthetic_symtab): Likewise.
2450
2451 2009-03-21 Alan Modra <amodra@bigpond.net.au>
2452
2453 * elf32-ppc.c (is_pic_glink_stub): Delete.
2454 (is_nonpic_glink_stub): New function.
2455 (ppc_elf_get_synthetic_symtab): Check for last non-pic stub rather
2456 than first pic one.
2457 (struct ppc_elf_link_hash_table <glink_pltresolve>): Comment fix.
2458
2459 2009-03-20 Martin Schwidefsky <schwidefsky@de.ibm.com>
2460 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
2461
2462 * elf32-s390.c (elf_s390_check_relocs): Use the SYMBOL_*
2463 macros for visibilty and locality checks.
2464 (elf_s390_adjust_dynamic_symbol): Likewise.
2465 (allocate_dynrelocs): Likewise.
2466 (elf_s390_relocate_section): Likewise.
2467 (elf_s390_finish_dynamic_symbol): Likewise.
2468 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2469 (elf_s390_adjust_dynamic_symbol): Likewise.
2470 (allocate_dynrelocs): Likewise.
2471 (elf_s390_relocate_section): Likewise.
2472 (elf_s390_finish_dynamic_symbol): Likewise.
2473
2474 2009-03-19 Kai Tietz <kai.tietz@onevision.com>
2475
2476 * bfd-in2.h: Regenerated.
2477 * coffcode.h (sec_to_styp_flags): For pe-coff add SEC_READONLY
2478 for debugging sections and map memory read/write dependent on
2479 SEC_COFF_NOREAD.
2480 (styp_to_sec_flags): Set SEC_COFF_NOREAD for sections
2481 without memory read flags set.
2482 * section.c: Add SEC_COFF_NOREAD to section flags.
2483
2484 2009-03-19 Andreas Schwab <schwab@linux-m68k.org>
2485
2486 * elf32-hppa.c (final_link_relocate): Cast bfd_vma values to long
2487 for format string.
2488
2489 2009-03-19 Alan Modra <amodra@bigpond.net.au>
2490
2491 * elf32-spu.c (spu_elf_find_overlays): Separate error return from
2492 "no overlays" return. If there are overlays, create overlay
2493 manager entry symbols here, so that..
2494 (spu_elf_build_stubs): ..we don't need to set them up here.
2495 Simplify entry symbol tests.
2496 * elf32-spu.h (spu_elf_find_overlays): Update prototype.
2497
2498 2009-03-18 Mark Kettenis <kettenis@gnu.org>
2499
2500 * elf.c (elfcore_grok_openbsd_procinfo)
2501 (elfcore_grok_openbsd_note): New functions.
2502 (elf_parse_notes): Handle notes from OpenBSD ELF core files.
2503
2504 2009-03-18 Alan Modra <amodra@bigpond.net.au>
2505
2506 * vms-hdr.c: Don't include alloca.h.
2507 * elf32-m68hc1x.c: Include alloca-conf.h.
2508 * xsym.c: Likewise.
2509 * elf64-hppa.c: Likewise. Remove existing #if's handling alloca.
2510 * som.c: Likewise.
2511 * Makefile.am: Run "make dep-am".
2512 * Makefile.in: Regenerate.
2513
2514 2009-03-17 Daniel Jacobowitz <dan@codesourcery.com>
2515
2516 * elf32-arm.c (elf32_arm_check_relocs): Correct symbian_p test.
2517
2518 2009-03-17 Alan Modra <amodra@bigpond.net.au>
2519
2520 * elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit.
2521 Add compact_stub.
2522 (emum _ovly_flavour): Delete ovly_compact, ovly_none.
2523 * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and
2524 ovly_return fields with ovly_entry[2]. Adjust all users.
2525 (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler
2526 when soft-icache.
2527 (spu_elf_build_stubs): Likewise.
2528 (ovl_stub_size): Change arg to spu_elf_params pointer. Adjust for
2529 ovly_flavour changes. Update all callers.
2530 (ovl_stub_size_log2): New function.
2531 (build_stub): Handle compact icache stubs. Use different manager
2532 entry point for stubs in non-icache area.
2533 (spu_elf_size_stubs): Don't allocate space for indirect branch
2534 descriptors.
2535 (spu_elf_build_stubs): And don't built them.
2536
2537 2009-03-16 Andrew Stubbs <ams@codesourcery.com>
2538
2539 * dwarf2.c (read_section): Always use rawsize, if available.
2540
2541 2009-03-16 Alan Modra <amodra@bigpond.net.au>
2542
2543 * simple.c (bfd_simple_get_relocated_section_contents): Use larger
2544 of rawsize and size for buffer.
2545
2546 2009-03-15 Ulrich Weigand <uweigand@de.ibm.com>
2547
2548 * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay
2549 parameter just because fixed sections fit into local store.
2550 (spu_elf_auto_overlay): Do not declare as "noreturn". Skip
2551 generating overlays if fixed sections plus reserved stack
2552 and heap space fit into local store.
2553
2554 2009-03-15 Alan Modra <amodra@bigpond.net.au>
2555
2556 * elf32-spu.c (build_stub): Correct icache set_id.
2557 (spu_elf_relocate_section): Likewise.
2558
2559 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2560
2561 * xcofflink.c (xcoff_link_check_archive_element): Only free the
2562 symbol table if it was created by the current call.
2563
2564 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2565
2566 * xcofflink.c (xcoff_build_ldsyms): Give imported descriptors
2567 class XMC_DS rather than XMC_UA.
2568
2569 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2570
2571 * bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the
2572 bfd_boolean export_defineds parameter with an unsigned int
2573 auto_export_flags parameter.
2574 * bfd-in2.h: Regenerate.
2575 * xcofflink.c (xcoff_archive_contains_shared_object_p): New function,
2576 split out from xcoff_build_ldsyms.
2577 (xcoff_covered_by_expall_p): New function.
2578 (xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms
2579 but with extra code to handle -bexpfull and -bexpall.
2580 (xcoff_mark_auto_exports): New function.
2581 (xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether
2582 a function should be automatically exported.
2583 (bfd_xcoff_size_dynamic_sections): Replace the export_defineds
2584 parameter with an auto_export_flags parameter. Update ldinfo
2585 accordingly. Use xcoff_mark_auto_exports to mark all automatically-
2586 exported symbols.
2587
2588 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2589
2590 * xcofflink.c (xcoff_mark_symbol_by_name): New function.
2591 (bfd_xcoff_size_dynamic_sections): Use it to mark the entry,
2592 init and fini functions. Do garbage collection for objects
2593 without an entry point too.
2594
2595 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2596
2597 * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to
2598 check whether a symbol has csect information.
2599 (coff_print_aux): Likewise.
2600 * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect
2601 information for C_AIX_WEAKEXT too.
2602 (_bfd_xcoff_swap_aux_out): Likewise.
2603 (xcoff_reloc_type_br): Handle defweak symbols too.
2604 * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect
2605 information for C_AIX_WEAKEXT too.
2606 (_bfd_xcoff64_swap_aux_out): Likewise.
2607 (xcoff64_reloc_type_br): Handle defweak symbols too.
2608 * coffgen.c (coff_print_symbol): Handle auxillary function
2609 information for C_AIX_WEAKEXT too.
2610 * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK
2611 instead of BSF_GLOBAL if the L_WEAK flag is set.
2612 (xcoff_dynamic_definition_p): New function.
2613 (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym
2614 defines h. Don't change h if ldsym isn't the definition. Otherwise,
2615 always take the symbol class from the ldsym. Use weak bfd symbol
2616 types for weak ldsyms.
2617 (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P.
2618 Fix the check for whether a definition is from a shared object.
2619 Allow redefinitions of weak symbols.
2620 (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P.
2621 (xcoff_keep_symbol_p): Likewise.
2622 (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P.
2623 (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P.
2624 Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols,
2625 but mark them as L_WEAK.
2626 (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT
2627 instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT.
2628
2629 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2630
2631 * xcofflink.c (xcoff_mark): When walking the relocations,
2632 only mark the target symbol or the target section, not both.
2633 (xcoff_final_definition_p): New function.
2634 (xcoff_keep_symbol_p): Use it to check whether an external XCOFF
2635 symbol is a valid definition of the associated output symbol.
2636 Use XCOFF_ALLOCATED to stop the same hash table entry having
2637 two output symbols.
2638 (bfd_xcoff_size_dynamic_sections): Set XCOFF_ALLOCATED when
2639 keeping a symbol.
2640 (xcoff_link_input_bfd): Use xcoff_final_definition_p.
2641
2642 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2643
2644 * xcofflink.c (bfd_xcoff_import_symbol): Treat imported absolute
2645 symbols as XMC_XO.
2646
2647 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2648
2649 * libcoff-in.h (xcoff_tdata): Add a lineno_counts field.
2650 * libcoff.h: Regenerate.
2651 * xcofflink.c (xcoff_link_add_symbols): Record per-symbol
2652 line-number counts in the bfd's lineno_counts field.
2653 Don't keep per-csect line-number counts.
2654 (xcoff_sweep): Don't update per-csect line-number counts.
2655 (bfd_xcoff_size_dynamic_sections): Count the number of line-number
2656 entries in each output section.
2657 (xcoff_link_input_bfd): Get the number of line numbers from
2658 the bfd's lineno_counts field, rather than recalculating it
2659 from scratch. Fix the range check when updating C_BINCL and
2660 C_EINCL symbols.
2661 (_bfd_xcoff_bfd_final_link): Don't count the output line numbers
2662 here. Don't expect csects to have line-number counts.
2663
2664 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2665
2666 * libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long.
2667 * libcoff.h: Regenerate.
2668 * xcofflink.c (xcoff_keep_symbol_p): New function, using the
2669 "skip" logic from xcoff_link_input_bfd.
2670 (bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic
2671 objects in a dynamic link, rather than checking whether csectpp
2672 is null. Always allocate debug_index for other objects,
2673 and always go through the loop. Update the type of debug_index
2674 after the change above. Read the auxillary csect information
2675 and use xcoff_keep_symbol_p to decide whether a symbol should
2676 be kept. Set its debug_index to -2 if not.
2677 (xcoff_link_input_bfd): Update the type of debug_index after
2678 the change above and always expect it to be nonnull. Use it to
2679 test whether a symbol should be stripped, rather than making the
2680 decision here. Postpone all symbol creation to the second pass.
2681
2682 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2683
2684 * xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when
2685 creating a descriptor.
2686 (xcoff_sweep): Don't mark toc_section unless it's needed.
2687 (bfd_xcoff_size_dynamic_sections): Skip the toc_section
2688 when marking every bfd.
2689 (xcoff_link_input_bfd): Skip all TOC anchors.
2690 (xcoff_toc_section_p, xcoff_find_tc0): New functions.
2691 (_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor
2692 to -1; call xcoff_find_tc0 instead.
2693
2694 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2695
2696 * libcoff-in.h (xcoff_section_tdata): Update commentary.
2697 * libcoff.h: Regenerate.
2698 * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
2699 symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
2700 the previous symbol's csect. Treat last_symndx as an inclusive value
2701 and simplify its handling.
2702 (xcoff_mark): Treat last_symndx as an inclusive value. Only mark
2703 symbols with the right csect. Don't mark rsec when processing
2704 relocations against undefined or absolute sections.
2705 (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
2706 of bfd_und_section_ptr.
2707 (xcoff_link_input_bfd): Likewise.
2708
2709 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2710
2711 * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
2712 against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED
2713 flag is set. Assert that all undefined symbols are either
2714 imported or defined by a dynamic object.
2715 * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
2716 * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol
2717 handling to all relocations. Only set XCOFF_CALLED for function
2718 symbols.
2719 (xcoff_find_function): New function, split out from...
2720 (bfd_xcoff_export_symbol) ...here.
2721 (xcoff_set_import_path): New function, split out from...
2722 (bfd_xcoff_import_symbol): ...here. Remove assertion for old
2723 meaning of XCOFF_CALLED.
2724 (xcoff_mark_symbol): If we mark an undefined and unimported
2725 symbol, find some way of defining it. If the symbol is a function
2726 descriptor, fill in its definition automatically. If the symbol
2727 is a function, mark its descriptor and allocate room for global
2728 linkage code. Otherwise mark the symbol as implicitly imported.
2729 Move the code for creating function descriptors from...
2730 (xcoff_build_ldsyms): ...here. Use XCOFF_WAS_UNDEFINED to
2731 check for symbols that were implicitly defined.
2732 (xcoff_mark): Don't count any dynamic relocations against
2733 function symbols.
2734 (bfd_xcoff_size_dynamic_sections): Save the rtld parameter
2735 in the xcoff link info.
2736 (xcoff_link_input_bfd): Remove handling of undefined and
2737 unexported symbols.
2738
2739 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2740
2741 * coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute
2742 if the target is absolute. Fix comment typo.
2743 (xcoff_ppc_relocate_section): Remove FIXME.
2744 * coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute
2745 if the target is absolute.
2746
2747 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2748
2749 * xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy
2750 R_POS and R_NEG relocations against absolute symbols to the
2751 .loader section.
2752
2753 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2754
2755 * coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype
2756 to 2 for bfd_mach_ppc_620.
2757
2758 2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
2759
2760 * config.bfd: Treat AIX 6+ in the same way as AIX 5.
2761 * configure.in: Likewise.
2762 * configure: Regenerate.
2763
2764 2009-03-13 H.J. Lu <hongjiu.lu@intel.com>
2765
2766 PR binutils/9945
2767 * elf.c (assign_section_numbers): Generate symbol table if there
2768 is any relocation in output.
2769 (_bfd_elf_compute_section_file_positions): Likewise.
2770
2771 2009-03-13 Nick Clifton <nickc@redhat.com>
2772
2773 PR 9934
2774 * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section.
2775 * elflink.c (elf_link_read_relocs_from_section): Use
2776 NUM_SHDR_ENTRIES. Gracefully handle the case where there are
2777 relocs but no symbol table.
2778 * elf32-arm.c (elf32_arm_check_relocs): Likewise.
2779
2780 2009-03-12 H.J. Lu <hongjiu.lu@intel.com>
2781
2782 PR ld/9938
2783 * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
2784 to check ___tls_get_addr.
2785
2786 * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
2787 strncmp to check __tls_get_addr.
2788
2789 2009-03-12 Andrew Stubbs <ams@codesourcery.com>
2790
2791 * dwarf2.c (read_section): Always check the offset, even when the
2792 section has been read before.
2793
2794 2009-03-11 H.J. Lu <hongjiu.lu@intel.com>
2795
2796 * elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in
2797 comments.
2798
2799 2009-03-11 Chris Demetriou <cgd@google.com>
2800
2801 * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag.
2802 * bfd-in2.h: Regenerate.
2803 * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT
2804 flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file
2805 mode.
2806 (bsd_write_armap): Likewise.
2807 (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT
2808 flag is set, do nothing.
2809 (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0
2810 for timestamp.
2811
2812 2009-03-11 Ulrich Weigand <uweigand@de.ibm.com>
2813
2814 * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
2815 used to update stack pointer.
2816
2817 2009-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2818
2819 PR binutils/9921
2820 * som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE
2821 for unknown symbols in absolute section.
2822
2823 2009-03-06 Nick Clifton <nickc@redhat.com>
2824
2825 * po/es.po: Updated Spanish translation.
2826
2827 2009-03-05 Christophe Lyon <christophe.lyon@st.com>
2828
2829 * elf32-arm.c (group_sections): Take next section size into
2830 account before accepting to group it.
2831
2832 2009-03-05 Christophe Lyon <christophe.lyon@st.com>
2833
2834 * elf32-arm.c (arm_type_of_stub): Handle long branches targetting
2835 PLT entries.
2836 (elf32_arm_final_link_relocate): Likewise.
2837
2838 2009-03-05 Moritz Kroll <Moritz.Kroll@gmx.de>
2839
2840 PR 9923
2841 * peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type.
2842
2843 2009-03-04 Alan Modra <amodra@bigpond.net.au>
2844
2845 * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New.
2846 * section.c (struct bfd_section): Add has_tls_get_addr_call.
2847 (BFD_FAKE_SECTION): Init new flag.
2848 * ecoff.c (bfd_debug_section): Likewise.
2849 * bfd-in2.h: Regenerate.
2850 * libbfd.h: Regenerate.
2851 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD.
2852 (ppc_elf_reloc_type_lookup): Handle new relocs.
2853 (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such
2854 without marker relocs.
2855 (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
2856 if section has no old-style calls.
2857 (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too.
2858 Don't try to optimize new-style __tls_get_addr call when handling
2859 arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
2860 relocs.
2861 * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD.
2862 (ppc64_elf_reloc_type_lookup): Handle new relocs.
2863 (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such
2864 without marker relocs.
2865 (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
2866 if section has no old-style calls. Set toc_ref for new relocs as
2867 appropriate.
2868 (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too.
2869 Don't try to optimize new-style __tls_get_addr call when handling
2870 arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
2871 relocs.
2872
2873 2009-03-04 Alan Modra <amodra@bigpond.net.au>
2874
2875 PR 6768
2876 * configure.in: Test for ld --as-needed support. Link shared
2877 libbfd against libm.
2878 * configure: Regenerate.
2879
2880 2009-03-03 Alan Modra <amodra@bigpond.net.au>
2881
2882 * Makefile.am: Run "make dep-am".
2883 * Makefile.in: Regenerate.
2884
2885 2009-03-02 Qinwei <qinwei@sunnorth.com.cn>
2886
2887 * elf32-score7.c: New file.
2888 * elf32-score.h: New file.
2889 * elf32-score.c: Add code to support score 7. Set score7 as the
2890 default.
2891 * cpu-score.c: Add score7 architecure.
2892 (compatibile): New function.
2893 * Makefile.am: Add rules for building elf32-score7 object.
2894 * Makefile.in: Regenerate.
2895 * configure.in: Add elf32-score7 object to score vectors.
2896 * configure: Regenerate.
2897 * reloc.c: Add score7 relocs.
2898 * archures.c: Add score3 and score7 machine numbers.
2899 * bfd-in2.h: Regenerate.
2900 * libbfd.h: Regenerate.
2901
2902 2009-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2903
2904 * configure: Regenerate.
2905
2906 2009-03-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2907
2908 * elf32-hppa.c (hppa32_elf_local_refcounts): New function.
2909 (elf32_hppa_check_relocs): Use it.
2910
2911 * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to
2912 elf64-hppa.c.
2913 (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
2914 (elf_hppa_remark_useless_dynamic_symbols): Likewise.
2915 (elf_hppa_is_dynamic_loader_symbol): Likewise.
2916 (elf_hppa_record_segment_addrs): Likewise.
2917 (elf_hppa_final_link): Likewise.
2918 (elf_hppa_relocate_insn): Likewise.
2919 (elf_hppa_final_link_relocate): Likewise.
2920 (elf64_hppa_relocate_section): Likewise.
2921 * elf64-hppa.c: Insert above.
2922
2923 2009-02-28 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2924
2925 * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
2926 (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table.
2927 (elf_hppa_relocate_section): Likewise.
2928 * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive
2929 from struct elf_link_hash_entry. Add count field.
2930 (struct elf64_hppa_dyn_hash_table): Delete.
2931 (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field.
2932 (elf64_hppa_hash_table): Rename to hppa_link_hash_table.
2933 (hppa_elf_hash_entry, eh_name): Define.
2934 (elf64_hppa_new_dyn_hash_entry): Delete.
2935 (elf64_hppa_dyn_hash_lookup): Delete.
2936 (elf64_hppa_dyn_hash_traverse): Delete.
2937 (get_dyn_name): Delete.
2938 (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead
2939 of struct elf64_hppa_dyn_hash_entry *.
2940 (elf64_hppa_finalize_dlt, llocate_global_data_dlt,
2941 allocate_global_data_plt, allocate_global_data_stub,
2942 allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries):
2943 Likewise.
2944 (hppa64_link_hash_newfunc): New.
2945 (elf64_hppa_hash_table_create): Rework.
2946 (count_dyn_reloc): Likewise.
2947 (hppa64_elf_local_refcounts): New.
2948 (elf64_hppa_check_relocs): Rework using standard technique for recording
2949 local DLT, PLT and OPD reference counts.
2950 (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct
2951 elf_link_hash_entry *.
2952 (elf64_hppa_mark_exported_functions, allocate_global_data_dlt,
2953 allocate_global_data_plt, allocate_global_data_stub,
2954 allocate_global_data_opd, allocate_dynrel_entries,
2955 elf64_hppa_adjust_dynamic_symbol,
2956 elf64_hppa_mark_milli_and_exported_functions): Likewise.
2957 (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections):
2958 Use hppa_link_hash_table. Rework.
2959 (elf64_hppa_link_output_symbol_hook): Rework.
2960 (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd,
2961 elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc,
2962 elf64_hppa_finish_dynamic_sections): Likewise.
2963
2964 2009-02-26 Christophe Lyon <christophe.lyon@st.com>
2965
2966 * elf32-arm.c (stub_reloc_type): Removed.
2967 (insn_sequence): Renamed reloc_type field to r_type.
2968 (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
2969 (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
2970 (elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
2971 (elf32_arm_stub_type): Add new enum entries for the new stubs.
2972 (arm_stub_is_thumb): Catch new stubs.
2973 (arm_type_of_stub): Handle new stubs.
2974 (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
2975 (bfd_elf32_arm_process_before_allocation): Remove useless
2976 condition.
2977
2978 2009-02-25 H.J. Lu <hongjiu.lu@intel.com>
2979
2980 * elf.c (elf_find_function): Use is_function_type to check
2981 function symbol.
2982
2983 2009-02-24 Sterling Augustine <sterling@jaw.hq.tensilica.com>
2984
2985 * xtensa-modules.c: Revert to previous version 1.11 due
2986 to inadvertant commit.
2987
2988 2009-02-24 Sterling Augustine <sterling@tensilica.com>
2989
2990 * elf32-xtensa.c (text_action_add): Separate test for action
2991 type. Break if saved action is ta_widen_insn at same offset.
2992
2993 2009-02-24 Daniel Jacobowitz <dan@codesourcery.com>
2994
2995 * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
2996 to elf32_arm_stub_long_branch_any_arm_pic.
2997 (elf32_arm_stub_long_branch_any_thumb_pic): New.
2998 (enum elf32_arm_stub_type, arm_type_of_stub)
2999 (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
3000 separately.
3001
3002 2009-02-24 Joseph Myers <joseph@codesourcery.com>
3003
3004 * elf32-arm.c (PREV_SEC): Update comment.
3005 (group_sections): Rename argument to stubs_always_after_branch.
3006 Reverse the list and place stubs at the end of input sections.
3007 Undefine NEXT_SEC.
3008 (elf32_arm_size_stubs): Update to use stubs_always_after_branch.
3009
3010 2009-02-23 Daniel Jacobowitz <dan@codesourcery.com>
3011
3012 * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
3013 Fix formatting.
3014 (arm_size_one_stub): Remove unnecessary break.
3015 (arm_map_one_stub): Fix formatting. Return after BFD_FAIL.
3016
3017 2009-02-23 Christophe Lyon <christophe.lyon@st.com>
3018
3019 * elf32-arm.c (stub_insn_type): New type.
3020 (stub_reloc_type): Likewise.
3021 (insn_sequence): Likewise.
3022 (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
3023 (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
3024 (elf32_arm_stub_long_branch_thumb_only): Likewise.
3025 (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
3026 (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
3027 (elf32_arm_stub_long_branch_any_any_pic): Likewise.
3028 (elf32_arm_stub_hash_entry): Add new helper fields.
3029 (stub_hash_newfunc): Initialize these new fields.
3030 (arm_build_one_stub): Encode Arm and Thumb instructions separately
3031 to take endianness into account.
3032 (arm_size_one_stub): Compute size of stubs using insn_sequence.
3033 (arm_map_one_stub): Code is now more generic, thanks to
3034 insn_sequence.
3035
3036 2009-02-23 Christophe Lyon <christophe.lyon@st.com>
3037
3038 * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
3039 code.
3040 (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
3041 (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when
3042 BLX is not available. Fix typo in warning message. Add comments
3043 and improve formatting.
3044 (arm_build_one_stub): Adjust to new
3045 elf32_arm_stub_long_branch_v4t_thumb_arm stub.
3046 (arm_map_one_stub): Likewise.
3047
3048 2009-02-23 Tristan Gingold <gingold@adacore.com>
3049 Eric Botcazou <ebotcazou@adacore.com>
3050 Douglas B Rupp <rupp@gnat.com>
3051
3052 * vms.h: Update copyright year, fix comments, reorder declarations.
3053 (_bfd_save_vms_section): Remove the prototype.
3054 (EGPS_S_V_NO_SHIFT): New constant.
3055 (bfd_vms_set_section_flags): New prototype.
3056 (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New
3057 constants.
3058 (EGSY_S_W_FLAGS): Ditto.
3059 (EGSY_S_V_QUAD_VAL): Ditto.
3060 (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto.
3061 (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX,
3062 EGST_S_B_NAMLNG): Ditto.
3063 (ESRF_S_B_NAMLNG): Ditto.
3064 (ETIR_S_C_HEADER_SIZE): Ditto.
3065 (EGPS_S_V_ALLOC_64BIT): Ditto.
3066 (DST_S_C_EPILOG): Ditto.
3067 (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto.
3068 (DST_S_C_SRC_INCRLNUM_B): Ditto.
3069 (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto.
3070 (DST_S_L_PCLINE_UNSLONG): Ditto.
3071 (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto
3072 (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto
3073 (DST_S_C_SOURCE_HEADER_SIZE): Ditto.
3074 (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto.
3075 (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto.
3076 (DST_S_B_SRC_UNSBYTE): Ditto.
3077 (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto.
3078 Add prototypes.
3079 (vms_section, vms_reloc): Remove types.
3080 (hdr_struc): Replaced by ...
3081 (hdr_struct): ... new type.
3082 (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants.
3083 (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto.
3084 (EMH_DATE_LENGTH): Ditto.
3085 (eom_struc): Replaced by ...
3086 (eom_struct): ... new type.
3087 (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants.
3088 (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto.
3089 (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto.
3090 (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto.
3091 (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto.
3092 (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto.
3093 (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto.
3094 (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto.
3095 (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto.
3096 (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto.
3097 (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto.
3098 (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto.
3099 (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto.
3100 (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto.
3101 (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto.
3102 (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto.
3103 (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto.
3104 (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH)
3105 (DBG_S_C_DMT_PSECT_SIZE): Ditto.
3106 (enum file_type_enum): New type.
3107 (struct location_struct): Removed.
3108 (struct fileinfo, struct srecinfo, struct lineinfo): New types.
3109 (struct funcinfo, struct module): Ditto.
3110 (struct vms_private_data_struct): Update fields.
3111 (struct vms_section_data_struct): New type.
3112
3113 * vms.c: Update copyright year, fix comments,
3114 Fix includes for DECC, add prototypes.
3115 (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove
3116 some initializers.
3117 Use flavour to set is_vax, location_stack is removed.
3118 (struct pair): Declare.
3119 (fill_section_ptr): Initialize variables at declaration.
3120 Add guard to set SECTION_SYM flag, handlde und section.
3121 (vms_fixup_sections): Use struct pair for fill_section_ptr argument.
3122 (_bfd_vms_slurp_object_records): New function, replaces previous
3123 vms_object_p.
3124 (vms_slurp_module): New function.
3125 (vms_slurp_image): Ditto.
3126 (vms_object_p): Complete rewrite.
3127 (vms_mkobject): Use is_vax field to slect architecture.
3128 (free_reloc_stream): New function.
3129 (vms_convert_to_var): Ditto.
3130 (vms_convert_to_var_1): Ditto.
3131 (vms_convert_to_var_unix_filename): Ditto.
3132 (vms_close_and_cleanup): Call free_reloc_stream, convert file to
3133 VAR format on VMS.
3134 (vms_new_section_hook): Set alignment to 0, allocate private data.
3135 (vms_get_section_contents): Load content.
3136 (vms_get_symbol_info): Handle undefined section.
3137 (vms_find_nearest_line): Handle.
3138 (alloc_reloc_stream): New function.
3139 (vms_slurp_reloc_table): Ditto.
3140 (vms_get_reloc_upper_bound): Make it real.
3141 (vms_canonicalize_reloc): Do the real work.
3142 (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA,
3143 ALPHA_R_BOH.
3144 (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH.
3145 (vms_set_arch_mach): Check arch.
3146 (vms_set_section_contents): Copy the content after allocation.
3147 (vms_alpha_vec): Update object flags.
3148
3149 * vms-tir.c: Update copyright year, fix comments,
3150 add prototypes for new functions.
3151 (dst_define_location): New function.
3152 (dst_restore_location): New function.
3153 (dst_retrieve_location): New function.
3154 (dst_check_allocation): New function.
3155 (image_dump): Call dst_check_allocation.
3156 (image_write_b): Ditto.
3157 (image_write_w): Ditto.
3158 (image_write_l): Ditto.
3159 (image_write_q): Ditto.
3160 (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW,
3161 STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC,
3162 CTL_STKDL.
3163 Call error handler instead of abort if name is not known.
3164 (etir_sta): Add quarter_relocs argument and set it.
3165 Fix cast.
3166 (etir_sto): Ditto.
3167 (etir_opr): Ditto, return FALSE in case of error.
3168 (etir_ctl): Add quarter_relocs argument and set it, fix cast.
3169 Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL.
3170 (etir_stc): Add quarter_relocs argument and set it, fix cast.
3171 Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA.
3172 Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL.
3173 Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS.
3174 Return FALSE in case of error.
3175 (tir_sta): Change sign of psect.
3176 (tir_ctl): Ditto.
3177 (tir_cmd): Fix cast. Makes tir_table static const.
3178 (etir_cmd): Add quarter_relocs argument, makes etir_table const,
3179 add argument to explain.
3180 (analyze_etir): Initialize maxptr, add quarter_relocs
3181 declaration, move some declarations into inner scopes.
3182 Handle quarter_relocs and STO_IMM.
3183 (_bfd_vms_slurp_tir): Use constant instead of hard-coded values.
3184 (_bfd_vms_slurp_relocs): New function.
3185 (_bfd_vms_decode_relocs): New function.
3186 (sto_imm): Rewritten.
3187 (start_first_etbt_record): New function.
3188 (start_another_etbt_record): Ditto.
3189 (etir_output_check): Ditto.
3190 (defer_reloc_p): Ditto.
3191 (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to
3192 a for-loop. Correctly deals with contents, deals with .vmsdebug,
3193 rewritte relocations handling.
3194 (_bfd_vms_write_tbt): Removed.
3195 (_bfd_vms_write_dbg): Ditto.
3196
3197 * vms-misc.c: Update copyright year, Fix comments.
3198 (_bfd_vms_get_header_values): Use 'size' instead of 'length'.
3199 (maybe_adjust_record_pointer_for_object): New function.
3200 (_bfd_vms_get_first_record): New function, replaces ...
3201 (_bfd_vms_get_record): .. removed.
3202 (_bfd_vms_get_object_record): New function.
3203 (_bfd_vms_get_object_record): New function.
3204 (vms_get_remaining_object_record): New function, replaces ...
3205 (_bfd_vms_get_next_record): ... removed.
3206 (add_new_contents): Removed.
3207 (_bfd_save_vms_section): Removed.
3208 (_bfd_get_vms_section): Removed.
3209 (_bfd_vms_output_flush): Write in VAR format.
3210 (new_symbol): Don't make UND section.
3211
3212 * vms-hdr.c: Update copyright year, update list of record handled.
3213 (_bfd_vms_slurp_hdr): rec_length renamed to rec_size.
3214 (_bfd_vms_write_hdr): Strip vms and unix patches,
3215 add comments, truncate module name at 31 characters,
3216 use constants instead of hard-coded value,
3217 write BFD version instead of a fixed string.
3218 (_bfd_vms_slurp_ihd): New function.
3219 (_bfd_vms_slurp_isd): Ditto.
3220 (_bfd_vms_slurp_ihs): Ditto.
3221 (new_module): Ditto.
3222 (parse_module): Ditto
3223 (build_module_list): Ditto.
3224 (module_find_nearest_line): Ditto.
3225 (_bfd_vms_find_nearest_dst_line): Ditto.
3226 (vms_slurp_debug): Ditto.
3227 (_bfd_vms_slurp_dbg): Ditto.
3228 (_bfd_vms_slurp_tbt): Ditto.
3229 (_bfd_vms_write_dbg): Ditto.
3230 (_bfd_vms_write_tbt): Ditto.
3231
3232 * vms-gsd.c: Update copyright year, update list of records handled.
3233 (EVAX_LITERALS_NAME): New macro.
3234 (evax_section_flags): Add an entry for EVAX_LITERALS_NAME.
3235 (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd.
3236 (register_universal_symbol): New function and prototype.
3237 (_bfd_vms_slurp_gsd): Fix indentations and casts,
3238 improve debug messages,
3239 use constants instead of hard-coded value,
3240 fix missing endianness conversion,
3241 handle global symbol (SYMG).
3242 (bfd_vms_set_section_flags): New function.
3243 (_bfd_vms_write_gsd): Don't write .vmsdebug section,
3244 handle section literals,
3245 fix indentation,
3246 handle section bfd and vms flags,
3247 don't output LIB$INITIALIZE symbol,
3248 fix handling of weak symbols,
3249 fix evax vs vax procedure descriptor,
3250 handle absolute symbols.
3251
3252 * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR,
3253 BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations.
3254
3255 * makefile.vms (DEFS): Fix flags for VMS.
3256
3257 * bfdio.c (real_fopen): Handle multiple VMS fopen attributes.
3258
3259 * bfd-in2.h: Regenerated.
3260 * libbfd.h: Regenerated.
3261
3262 2009-02-20 Cary Coutant <ccoutant@google.com>
3263
3264 * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime
3265 in struct stat.
3266
3267 2009-18-02 Dave Korn <dave.korn.cygwin@gmail.com>
3268
3269 PR gas/7059
3270 * coffcode.h (coff_write_object_contents): Don't let the string
3271 table offset overflow the s_name field when using long section names.
3272
3273 2009-18-02 Dave Korn <dave.korn.cygwin@gmail.com>
3274
3275 * coff-alpha.c (alpha_ecoff_backend_data): Initialise fields which
3276 control long section name handling with ECOFF_NO_LONG_SECTION_NAMES.
3277 * coff-mips.c (mips_ecoff_backend_data): Likewise.
3278 * coff-rs6000.c (bfd_xcoff_backend_data): Initialise fields which
3279 control long section name handling with XCOFF_NO_LONG_SECTION_NAMES.
3280 (bfd_pmac_xcoff_backend_data): Likewise.
3281 * coff64-rs6000.c (bfd_xcoff_backend_data): Likewise.
3282 (bfd_xcoff_aix5_backend_data): Likewise.
3283 (xcoff64_write_object_contents): Delete unused long_section_names
3284 local variable.
3285 * coff-sh.c (bfd_coff_small_swap_table): Initialise long section
3286 name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire
3287 struct non-const.
3288 * coffcode.h (documentation): Update to describe long section names.
3289 (COFFLONGSECTIONCATHELPER): New helper macro.
3290 (BLANKOR1TOODD): Likewise.
3291 (COFF_ENABLE_LONG_SECTION_NAMES): Likewise.
3292 (COFF_LONG_SECTION_NAMES_SETTER): Likewise.
3293 (COFF_DEFAULT_LONG_SECTION_NAMES): Likewise.
3294 (bfd_coff_set_long_section_names_allowed): New function.
3295 (bfd_coff_set_long_section_names_disallowed): Likewise.
3296 (struct bfd_coff_backend_data): Add new backend hook function
3297 pointer _bfd_coff_set_long_section_names.
3298 (bfd_coff_set_long_section_names): New backend hook.
3299 (coff_write_object_contents): Only generate long section names if
3300 bfd_coff_long_section_names() indicates they are currently enabled.
3301 (bfd_coff_std_swap_table): Make non-const, and initialise long
3302 section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
3303 (ticoff0_swap_table): Likewise to both.
3304 (ticoff1_swap_table): Again, likewise to both.
3305 * coffgen.c (make_a_section_from_file): Allow long section names
3306 as inputs even if not currently allowed for outputs.
3307 * ecoff.c (_bfd_ecoff_no_long_sections): New function.
3308 * efi-app-ia32.c (COFF_LONG_SECTION_NAMES): Define to 0, not blank.
3309 * efi-app-ia64.c (COFF_LONG_SECTION_NAMES): Likewise.
3310 * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise.
3311 * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise.
3312 * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise.
3313 * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise.
3314 * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise.
3315 * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise.
3316 * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise.
3317 * pei-arm.c (COFF_LONG_SECTION_NAMES): Likewise.
3318 * pei-i386.c (COFF_LONG_SECTION_NAMES): Likewise.
3319 * pei-mcore.c (COFF_LONG_SECTION_NAMES): Likewise.
3320 * pei-mips.c (COFF_LONG_SECTION_NAMES): Likewise.
3321 * pei-ppc.c (COFF_LONG_SECTION_NAMES): Likewise.
3322 * pei-sh.c (COFF_LONG_SECTION_NAMES): Likewise.
3323 * pei-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise.
3324 * libcoff-in.h: Update copyright year to cause updated copyright
3325 year in generated libcoff.h, and fix typo.
3326 * libcoff.h: Regenerated.
3327 * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES): New macro.
3328 (_bfd_ecoff_no_long_sections): Add prototype.
3329 * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES): New macro.
3330 * pe-mips.c (COFF_LONG_SECTION_NAMES): Define empty if not already
3331 defined by an including .c file.
3332 * ticoff.h (ticoff0_swap_table): Make non-const, and initialise
3333 long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
3334 (ticoff1_swap_table): Likewise to both.
3335
3336 2009-02-18 Christophe Lyon <christophe.lyon@st.com>
3337
3338 * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
3339 stub. Catch default case error.
3340 (arm_map_one_stub): Add missing Thumb mapping symbol.
3341
3342 2009-02-18 Bjoern Haase <bjoern.m.haase@web.de>
3343
3344 PR 9841
3345 * elf32-avr.c: Handle case where no local symbos exist correctly.
3346
3347 2009-02-16 Christophe Lyon <christophe.lyon@st.com>
3348
3349 bfd/
3350 * elf32-arm.c (arm_long_branch_stub,
3351 arm_thumb_v4t_long_branch_stub,
3352 arm_thumb_thumb_long_branch_stub,
3353 arm_thumb_arm_v4t_long_branch_stub,
3354 arm_thumb_arm_v4t_short_branch_stub,
3355 arm_pic_long_branch_stub):
3356 Renamed to elf32_arm_stub_long_branch_any_any,
3357 elf32_arm_stub_long_branch_v4t_arm_thumb,
3358 elf32_arm_stub_long_branch_thumb_only,
3359 elf32_arm_stub_long_branch_v4t_thumb_arm,
3360 elf32_arm_stub_short_branch_v4t_thumb_arm,
3361 elf32_arm_stub_long_branch_any_any_pic.
3362 (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch,
3363 arm_thumb_thumb_stub_long_branch,
3364 arm_thumb_arm_v4t_stub_long_branch,
3365 arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch):
3366 Renamed to arm_stub_long_branch_any_any,
3367 arm_stub_long_branch_v4t_arm_thumb,
3368 arm_stub_long_branch_thumb_only,
3369 arm_stub_long_branch_v4t_thumb_arm,
3370 arm_stub_short_branch_v4t_thumb_arm,
3371 arm_stub_long_branch_any_any_pic.
3372
3373 2009-02-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3374
3375 * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used
3376 in branch offset check.
3377
3378 2009-02-15 Alan Modra <amodra@bigpond.net.au>
3379
3380 * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,
3381 add toc.symndx and toc.add.
3382 (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here.
3383 Set up toc.add.
3384 (get_tls_mask): Add toc_addend param, set from toc.add. Adjust all
3385 callers.
3386 (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd.
3387 (branch_reloc_hash_match): New function, extracted from..
3388 (ppc64_elf_tls_optimize): ..here.
3389 (ppc64_elf_relocate_section): Properly set addends when optimizing
3390 tls sequences. Avoid unnecessary reading and writing of insns.
3391 Only redo reloc when symbol changed. Bypass symbol checks when
3392 using tlsld_got.
3393 * elf32-ppc.c (ppc_elf_tls_setup): Correct comment.
3394 (branch_reloc_hash_match): New function, extracted from..
3395 (ppc_elf_tls_optimize): ..here.
3396 (ppc_elf_relocate_section): Avoid unnecessary reading of insns.
3397 Don't clear addend on zapped __tls_get_addr reloc.
3398
3399 2009-02-12 Nick Clifton <nickc@redhat.com>
3400
3401 PR 9827
3402 * elflink.c (bfd_elf_final_link): When counting the relocations,
3403 if the header size has not been set yet then assume that it will
3404 match the output section's reloc type.
3405
3406 2009-02-12 Nathan Sidwell <nathan@codesourcery.com>
3407
3408 * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
3409 relocatable link.
3410
3411 2009-02-09 Alan Modra <amodra@bigpond.net.au>
3412
3413 * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
3414 (find_function): Likewise.
3415 (pasted_function): Don't error if no prior function found.
3416 (discover_functions): Revert 2008-12-10 change. Extend first
3417 function range to start of section.
3418
3419 2009-02-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3420
3421 * elf64-hppa.c: Remove PARAMS macro. Replace PTR with void *. Convert
3422 functions to C90.
3423 * elf64-hppa.h: Likewise.
3424
3425 2009-02-06 Joseph Myers <joseph@codesourcery.com>
3426
3427 * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special
3428 .sbss handling.
3429
3430 2009-02-04 Alan Modra <amodra@bigpond.net.au>
3431
3432 * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize.
3433 Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*.
3434
3435 2009-02-03 Sandip Matte <sandip@rmicorp.com>
3436
3437 * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr.
3438 * archures.c (bfd_mach_mips_xlr): Define.
3439 * bfd-in2.h: Regenerate.
3440 * cpu-mips.c (I_xlr): Define.
3441 (arch_info_struct): Add XLR entry.
3442 * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR.
3443 (mips_set_isa_flags): Handle bfd_mach_mips_xlr
3444 (mips_mach_extensions): Add XLR entry.
3445
3446 2009-02-03 Eric B. Weddington <eric.weddington@atmel.com>
3447
3448 * elf32-avr.c (avr_final_link_relocate): Allow avr25 to wraparound.
3449
3450 2009-02-03 Carlos O'Donell <carlos@codesourcery.com>
3451
3452 * configure.in: AC_SUBST pdfdir.
3453 * Makefile.am: Add install-pdf, install-pdf-am
3454 and install-pdf-recursive targets. Define pdfdir.
3455 * doc/Makefile.am: Define pdf__strip_dir. Add
3456 install-pdf and install-pdf-am targets.
3457 * po/Make-in: Add install-pdf target.
3458 * configure: Regenerate.
3459 * Makefile.in: Regenerate
3460 * doc/Makefile.in: Regenerate.
3461
3462 2009-02-03 Maxim Kuvyrkov <maxim@codesourcery.com>
3463
3464 * bfd-in2.h: Regenerate.
3465 * elf32-m68k.c: Handle 2-slot GOT entries. Rename variables and
3466 fields from n_entries to n_slots where appropriate, update comments.
3467 (HOWTO): Add TLS relocations.
3468 (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*.
3469 (enum elf_m68k_got_offset_size): New enum.
3470 (struct elf_m68k_got_entry.type): Move field to ...
3471 (struct elf_m68k_got_entry_key): ... here. Update all uses.
3472 (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static
3473 functions.
3474 (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static
3475 functions.
3476 (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries
3477 fields into n_entries array. Update comments.
3478 (elf_m68k_init_got): Simplify, update all uses.
3479 (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update.
3480 (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot
3481 GOT entries; update name, update all uses.
3482 (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto.
3483 (elf_m68k_get_got_entry): Update.
3484 (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries,
3485 simplify.
3486 (elf_m68k_remove_got_entry_type): Simplify.
3487 (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update.
3488 (elf_m68k_can_merge_gots): Update.
3489 (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update.
3490 (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot
3491 GOT entries, simplify.
3492 (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same.
3493 (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff
3494 field, remove obsoleted local_n_entries field.
3495 (elf_m68k_partition_multi_got_2): New static function.
3496 (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it;
3497 update.
3498 (elf_m68k_remove_got_entry_type): Update.
3499 (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
3500 (elf_m68k_check_relocs): Handle TLS relocations. Remove unnecessary
3501 update of sgot->size and srelgot->size.
3502 (elf_m68k_gc_sweep_hook): Update.
3503 (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
3504 (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle
3505 TLS relocations.
3506 * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations.
3507 * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
3508
3509 2009-02-02 DJ Delorie <dj@redhat.com>
3510
3511 * elf32-mep.c (config_names): Regenerate configuration.
3512
3513 2009-02-02 Alan Modra <amodra@bigpond.net.au>
3514
3515 * elf-bfd.h (bfd_elf_get_str_section): Don't declare.
3516 (bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise.
3517 * elf.c (bfd_elf_get_str_section): Make static.
3518 (bfd_elf_find_section): Delete.
3519 * libbfd.h: Regenerate.
3520
3521 2009-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
3522
3523 * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove.
3524 (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs.
3525
3526 2009-01-31 Alan Modra <amodra@bigpond.net.au>
3527
3528 * elflink.c (on_needed_list): New function.
3529 (elf_link_add_object_symbols): Link in --as-needed libs if they
3530 satisfy undefined symbols in other libs.
3531
3532 2009-01-30 Julian Brown <julian@codesourcery.com>
3533
3534 * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with
3535 EXEC_P or DYNAMIC flags, and skip sections which are being linked
3536 with --just-symbols (-R).
3537
3538 2009-01-29 Adam Nemet <anemet@caviumnetworks.com>
3539
3540 * dwarf2.c (read_rangelist): Use read_address to read low_pc and
3541 high_pc in order to properly sign-extend VMAs.
3542
3543 2009-01-29 Daniel Jacobowitz <dan@codesourcery.com>
3544 Mark Shinwell <shinwell@codesourcery.com>
3545 Catherine Moore <clm@codesourcery.com>
3546
3547 * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments.
3548
3549 2009-01-28 Catherine Moore <clm@codesourcery.com>
3550
3551 * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and
3552 SEC_LOAD for dynamic relocation sections.
3553
3554 2009-01-27 Hans-Peter Nilsson <hp@axis.com>
3555
3556 * elf32-cris.c (cris_elf_relocate_section): Use elf_hash_table
3557 (info)->tls_size, not elf_hash_table (info)->tls_sec->size for
3558 the size of local TLS data.
3559
3560 2009-01-27 Andreas Schwab <schwab@suse.de>
3561
3562 * mach-o.c (bfd_mach_o_archive_p): Restrict the number of
3563 architectures in the archive.
3564
3565 2009-01-27 Hans-Peter Nilsson <hp@axis.com>
3566
3567 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
3568 <R_CRIS_32_DTPREL>: Correct relocation value.
3569
3570 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
3571 <R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined
3572 symbols with non-default visibility.
3573
3574 2009-01-26 Nathan Sidwell <nathan@codesourcery.com>
3575
3576 * elf32-ppc.c (ppc_elf_relax_section): Add space for relocs
3577 describing the trampolines.
3578 (ppc_elf_relocate_section): Update relocs to describe the
3579 trampolines.
3580
3581 2009-01-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3582
3583 * elf-hppa.h (elf_hppa_final_link_relocate): Add check to ensure that
3584 branch targets can be reached for R_PARISC_PCREL22F, R_PARISC_PCREL17F
3585 and R_PARISC_PCREL12F relocations.
3586
3587 2009-01-24 Alan Modra <amodra@bigpond.net.au>
3588
3589 PR 6022
3590 * elflink.c (find_version_for_sym): New function split out from,
3591 but without export_dynamic test, ..
3592 (_bfd_elf_link_assign_sym_version): ..here.
3593 (_bfd_elf_export_symbol): Use it.
3594
3595 2009-01-23 Alan Modra <amodra@bigpond.net.au>
3596
3597 * elf-bfd.h (struct elf_assign_sym_version_info): Delete.
3598 (struct elf_info_failed, struct elf_find_verdep_info): Move to..
3599 * elflink.c: ..here, somewhat modified.
3600 * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol,
3601 _bfd_elf_link_find_version_dependencies,
3602 _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section,
3603 _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
3604 _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't
3605 declare..
3606 * elflink.c: ..and make static here.
3607 (_bfd_elf_link_find_version_dependencies): Adjust for removal
3608 of output_bfd from struct elf_find_verdep_info.
3609 (_bfd_elf_link_assign_sym_version): Similarly adjust to use
3610 struct elf_info_failed.
3611 (bfd_elf_size_dynamic_sections): Adjust.
3612
3613 2009-01-22 Alan Modra <amodra@bigpond.net.au>
3614
3615 PR 6832
3616 * dwarf2.c (find_line): Don't update stash->sec_info_ptr until
3617 after comp_unit_find_line call.
3618
3619 2009-01-21 Nick Clifton <nickc@redhat.com>
3620
3621 PR 9769
3622 * vmsutil.c (vms_file_stats_name): Remove use of unsupported
3623 tm_gmtoff field in struct tm.
3624
3625 2009-01-21 Alan Modra <amodra@bigpond.net.au>
3626
3627 * elf32-spu.h (struct spu_elf_params): Add non_ia_text.
3628 * elf32-spu.c (mark_overlay_section): Only include .text.ia.*
3629 sections in soft-icache lines unless non_ia_text. Don't add
3630 rodata if doing so would exceed line size.
3631
3632 2009-01-19 Hans-Peter Nilsson <hp@axis.com>
3633
3634 * elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol
3635 types than bfd_link_hash_indirect, before early return, call
3636 _bfd_elf_link_hash_copy_indirect.
3637
3638 2009-01-19 Andrew Stubbs <ams@codesourcery.com>
3639
3640 * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
3641 * elf-bfd.h (elf_backend_data): Add obj_attrs_order.
3642 * elf32-arm.c (elf32_arm_obj_attrs_order): New function.
3643 (elf_backend_obj_attrs_order): New define.
3644 * elfxx-target.h (elf_backend_obj_attrs_order): New define.
3645 (elfNN_bed): Add elf_backend_obj_attrs_order.
3646
3647 2009-01-19 Andrew Stubbs <ams@codesourcery.com>
3648
3649 * elf-attrs.c (is_default_attr): Substitute magic numbers with macros.
3650 (obj_attr_size): Likewise.
3651 (write_obj_attribute): Likewise.
3652 (_bfd_elf_copy_obj_attributes): Likewise.
3653 (_bfd_elf_parse_attributes): Likewise.
3654 * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define.
3655 (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines.
3656 (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines.
3657 (ATTR_TYPE_HAS_NO_DEFAULT): New define.
3658 * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers
3659 with macros.
3660
3661 2009-01-19 Andrew Stubbs <ams@codesourcery.com>
3662
3663 * elf-attrs.c (is_default_attr): Support defaultless attributes.
3664 (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
3665 (bfd_elf_add_obj_attr_string): Likewise.
3666 (bfd_elf_add_obj_attr_int_string): Likewise.
3667 (_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
3668 * elf-bfd.h (struct obj_attribute): Document new flag bit.
3669 * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
3670 Tag_nodefaults has no default value.
3671 (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
3672 comment to reflect the new state.
3673
3674 2009-01-19 Alan Modra <amodra@bigpond.net.au>
3675
3676 PR 9695
3677 * pdp11.c (N_BADMAG): True for anything but OMAGIC, NMAGIC, ZMAGIC.
3678 (some_aout_object_p): Delete dead code handling QMAGIC and BMAGIC.
3679 (adjust_z_magix): Delete dead code handling QMAGIC.
3680
3681 2009-01-16 Kai Tietz <kai.tietz@onevision.com>
3682
3683 * coffcode.h (styp_to_sec_flags): Correct interpretation of
3684 IMAGE_SCN_MEM_DISCARDABLE.
3685
3686 2009-01-16 Alan Modra <amodra@bigpond.net.au>
3687
3688 * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute
3689 SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS.
3690 * configure.in (commonbfdlib): Delete.
3691 (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/
3692 (SHARED_LIBADD): Rename from WIN32LIBADD. Add pic libiberty if such
3693 is available, not just for linux.
3694 * po/SRC-POTFILES.in: Regenerate.
3695 * Makefile.in: Regenerate.
3696 * configure: Regenerate.
3697
3698 2009-01-15 Andrew Stubbs <ams@codesourcery.com>
3699 Julian Brown <julian@codesourcery.com>
3700
3701 * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known
3702 ARM attributes in ABI 2.07.
3703 * elf32-arm.c (get_secondary_compatible_arch): New function.
3704 (set_secondary_compatible_arch): New function.
3705 (tag_cpu_arch_combine): New function.
3706 (elf32_arm_copy_one_eabi_other_attribute): Delete function.
3707 (elf32_arm_copy_eabi_other_attribute_list): Delete function.
3708 (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to
3709 make it fit with order_01243.
3710 Add support for Tag_also_compatible_with,
3711 Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use,
3712 Tag_MPextension_use, Tag_nodefaults and Tag_conformance.
3713 Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name,
3714 Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension,
3715 Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed,
3716 Tag_VFP_arch and Tag_ABI_FP_16bit_format.
3717 Rework the way unknown attributes are handled.
3718 Defer errors until all attributes have been processed.
3719
3720 2009-01-15 Andrew Stubbs <ams@codesourcery.com>
3721
3722 * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to
3723 bfd_elf_add_obj_attr_int_string.
3724 Read Tag_compatibility from its new location in the attribute array,
3725 rather than the attribute list.
3726 (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat ->
3727 bfd_elf_add_obj_attr_int_string.
3728 (_bfd_elf_parse_attributes): Likewise.
3729 (_bfd_elf_merge_object_attributes): There's now only one
3730 Tag_compatibility, and it's in the array, not the list.
3731 * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include
3732 Tag_compatibility.
3733 (bfd_elf_add_obj_attr_compat): Rename to
3734 bfd_elf_add_obj_attr_int_string.
3735 (bfd_elf_add_proc_attr_compat): Rename to
3736 bfd_elf_add_proc_attr_int_string.
3737 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle
3738 Tag_compatibility.
3739
3740 2009-01-15 Douglas B Rupp <rupp@gnat.com>
3741
3742 * Makefile.am (BFD32_BACKENDS): Add new object vmsutil.lo
3743 (BFD32_BACKENDS_CFILES): Add new file vmsutil.c
3744 (vmsutil.lo): Add dependency rule.
3745 * Makefile.in: Regenerate.
3746 * config.bfd (ia64*-*-*vms*): Add case.
3747 * configure.in (bfd_elf64_ia64_vms_vec): Add case.
3748 * configure: Regenerate.
3749 * vmsutil.c: New file.
3750 * vmsutil.h: New file.
3751 * elf-bfd.h (struct bfd_elf_special_section): Change type of
3752 attr to bfd_vma.
3753 * elfxx-ia64.c (elfNN_vms_post_process_headers,
3754 elfNN_vms_section_processing, elfNN_vms_final_write_processing,
3755 elfNN_vms_close_and_cleanup, elfNN_vms_section_from_shdr,
3756 elfNN_vms_object_p): New functions
3757 * targets.c (bfd_elf64_ia64_vms_vec): New target.
3758
3759 2009-01-14 H.J. Lu <hongjiu.lu@intel.com>
3760
3761 PR ld/9727
3762 * elflink.c (elf_gc_sweep): Exclude the group section if the
3763 first member of the section group is excluded.
3764
3765 2009-01-14 Alan Modra <amodra@bigpond.net.au>
3766
3767 PR 9735
3768 * syms.c (_bfd_stab_section_find_nearest_line): Don't free
3769 saved filename, use bfd_alloc rather than bfd_malloc for it.
3770
3771 2009-01-13 Alan Modra <amodra@bigpond.net.au>
3772
3773 * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute.
3774
3775 2009-01-13 Alan Modra <amodra@bigpond.net.au>
3776
3777 * elf32-spu.c (remove_cycles): Always set call->max_depth.
3778
3779 2009-01-12 Alan Modra <amodra@bigpond.net.au>
3780
3781 * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask.
3782
3783 2009-01-12 Alan Modra <amodra@bigpond.net.au>
3784
3785 * elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2,
3786 num_lines_log2.
3787 (struct got_entry): Add br_addr.
3788 (struct call_info): Add priority.
3789 (struct function_info): Add lr_store and sp_adjust.
3790 (spu_elf_setup): Init line_size_log2 and num_lines_log2.
3791 (spu_elf_find_overlays): For soft-icache, mark any section within cache
3792 area as an overlay, and check that no other overlays exist. Look up
3793 icache overlay manager entry sym.
3794 (BRA_STUBS, BRA, BRASL): Define.
3795 (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub.
3796 (needs_ovl_stub): Adjust for soft-icache. Return priority encoded
3797 in branch insn.
3798 (count_stub, build_stub): Support soft-icache.
3799 (build_spuear_stubs, process_stubs): Adjust build_stub call.
3800 (spu_elf_size_stubs): Size soft-icache stubs.
3801 (overlay_index): New function.
3802 (spu_elf_build_stubs): Make static. Support soft-icache.
3803 (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache.
3804 (find_function_stack_adjust): Save lr store and stack adjust insn
3805 offsets.
3806 (maybe_insert_function): Adjust find_function_stack_adjust call.
3807 (mark_functions_via_relocs): Retrieve priority.
3808 (remove_cycles): Only warn about pruned arcs when stack_analysis.
3809 (sort_calls): Sort by priority first.
3810 (mark_overlay_section): Ignore .ovl.init.
3811 (sum_stack): Only print when stack_analysis.
3812 (print_one_overlay_section): New function, extracted from..
3813 (spu_elf_auto_overlay): ..here. Support soft-icache overlays.
3814 (spu_elf_stack_analysis): Only print when htab->stack_analysis.
3815 (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive
3816 analysis. Call spu_elf_build_stubs.
3817 (spu_elf_relocate_section): For soft-icache encode overlay index
3818 into addresses.
3819 (spu_elf_output_symbol_hook): Support soft-icache.
3820 (spu_elf_modify_program_headers: Likewise.
3821
3822 * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis. Rename
3823 num_regions to num_lines. Add line_size and max_branch.
3824 (enum _ovly_flavour): Add ovly_soft_icache.
3825 (spu_elf_build_stubs): Delete.
3826
3827 2009-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
3828
3829 * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
3830 relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.
3831
3832 2009-01-07 Hans-Peter Nilsson <hp@axis.com>
3833
3834 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
3835 <case R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: For a symbol defined in
3836 the program, the known offset starts at the negative size of the
3837 TLS section.
3838 <case R_CRIS_32_IE, R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>:
3839 Similar.
3840
3841 2009-01-05 Joel Sherrill <joel.sherrill@oarcorp.com>
3842
3843 * config.bfd: Add lm32-*-rtems*.
3844
3845 2009-01-03 H.J. Lu <hongjiu.lu@intel.com>
3846
3847 * coff-ppc.c: Add 2009 to Copyright.
3848 * elf32-cris.c: Likewise.
3849 * elflink.c: Likewise.
3850
3851 2009-01-03 Hans-Peter Nilsson <hp@axis.com>
3852
3853 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Rename
3854 gotplt_index to rela_plt_index. Adjust for R_CRIS_DTPMOD entry.
3855
3856 2009-01-02 H.J. Lu <hongjiu.lu@intel.com>
3857
3858 PR ld/9679
3859 * elflink.c (elf_merge_st_other): New.
3860 (_bfd_elf_merge_symbol): Use it on skipped weak definitions and
3861 hide them if needed.
3862 (elf_link_add_object_symbols): Updated.
3863
3864 2009-01-02 H.J. Lu <hongjiu.lu@intel.com>
3865
3866 PR ld/9676
3867 * elflink.c (elf_link_add_object_symbols): Update def_dynamic,
3868 ref_dynamic and dynamic_def fields when setting def_regular
3869 to 1.
3870
3871 2009-01-02 Curtis Mackie <curtmackevo@gmail.com>
3872
3873 PR 9682
3874 * coff-ppc.c (dump_toc): Fix up calls to fprintf without a string
3875 literal.
3876
3877 For older changes see ChangeLog-2008
3878 \f
3879 Local Variables:
3880 mode: change-log
3881 left-margin: 8
3882 fill-column: 74
3883 version-control: never
3884 End:
This page took 0.104832 seconds and 3 git commands to generate.