OSDN Git Service

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