include/coff/
[external/binutils.git] / bfd / ChangeLog
1 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2
3         * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to
4         check whether a symbol has csect information.
5         (coff_print_aux): Likewise.
6         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect
7         information for C_AIX_WEAKEXT too.
8         (_bfd_xcoff_swap_aux_out): Likewise.
9         (xcoff_reloc_type_br): Handle defweak symbols too.
10         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect
11         information for C_AIX_WEAKEXT too.
12         (_bfd_xcoff64_swap_aux_out): Likewise.
13         (xcoff64_reloc_type_br): Handle defweak symbols too.
14         * coffgen.c (coff_print_symbol): Handle auxillary function
15         information for C_AIX_WEAKEXT too.
16         * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK
17         instead of BSF_GLOBAL if the L_WEAK flag is set.
18         (xcoff_dynamic_definition_p): New function.
19         (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym
20         defines h.  Don't change h if ldsym isn't the definition.  Otherwise,
21         always take the symbol class from the ldsym.  Use weak bfd symbol
22         types for weak ldsyms.
23         (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P.
24         Fix the check for whether a definition is from a shared object.
25         Allow redefinitions of weak symbols.
26         (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P.
27         (xcoff_keep_symbol_p): Likewise.
28         (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P.
29         (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P.
30         Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols,
31         but mark them as L_WEAK.
32         (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT
33         instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT.
34
35 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
36
37         * xcofflink.c (xcoff_mark): When walking the relocations,
38         only mark the target symbol or the target section, not both.
39         (xcoff_final_definition_p): New function.
40         (xcoff_keep_symbol_p): Use it to check whether an external XCOFF
41         symbol is a valid definition of the associated output symbol.
42         Use XCOFF_ALLOCATED to stop the same hash table entry having
43         two output symbols.
44         (bfd_xcoff_size_dynamic_sections): Set XCOFF_ALLOCATED when
45         keeping a symbol.
46         (xcoff_link_input_bfd): Use xcoff_final_definition_p.
47
48 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
49
50         * xcofflink.c (bfd_xcoff_import_symbol): Treat imported absolute
51         symbols as XMC_XO.
52
53 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
54
55         * libcoff-in.h (xcoff_tdata): Add a lineno_counts field.
56         * libcoff.h: Regenerate.
57         * xcofflink.c (xcoff_link_add_symbols): Record per-symbol
58         line-number counts in the bfd's lineno_counts field.
59         Don't keep per-csect line-number counts.
60         (xcoff_sweep): Don't update per-csect line-number counts.
61         (bfd_xcoff_size_dynamic_sections): Count the number of line-number
62         entries in each output section.
63         (xcoff_link_input_bfd): Get the number of line numbers from
64         the bfd's lineno_counts field, rather than recalculating it
65         from scratch.  Fix the range check when updating C_BINCL and
66         C_EINCL symbols.
67         (_bfd_xcoff_bfd_final_link): Don't count the output line numbers
68         here.  Don't expect csects to have line-number counts.
69
70 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
71
72         * libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long.
73         * libcoff.h: Regenerate.
74         * xcofflink.c (xcoff_keep_symbol_p): New function, using the
75         "skip" logic from xcoff_link_input_bfd.
76         (bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic
77         objects in a dynamic link, rather than checking whether csectpp
78         is null.  Always allocate debug_index for other objects,
79         and always go through the loop.  Update the type of debug_index
80         after the change above.  Read the auxillary csect information
81         and use xcoff_keep_symbol_p to decide whether a symbol should
82         be kept.  Set its debug_index to -2 if not.
83         (xcoff_link_input_bfd): Update the type of debug_index after
84         the change above and always expect it to be nonnull.  Use it to
85         test whether a symbol should be stripped, rather than making the
86         decision here.  Postpone all symbol creation to the second pass.
87
88 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
89
90         * xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when
91         creating a descriptor.
92         (xcoff_sweep): Don't mark toc_section unless it's needed.
93         (bfd_xcoff_size_dynamic_sections): Skip the toc_section
94         when marking every bfd.
95         (xcoff_link_input_bfd): Skip all TOC anchors.
96         (xcoff_toc_section_p, xcoff_find_tc0): New functions.
97         (_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor
98         to -1; call xcoff_find_tc0 instead.
99
100 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
101
102         * libcoff-in.h (xcoff_section_tdata): Update commentary.
103         * libcoff.h: Regenerate.
104         * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
105         symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
106         the previous symbol's csect.  Treat last_symndx as an inclusive value
107         and simplify its handling.
108         (xcoff_mark): Treat last_symndx as an inclusive value.  Only mark
109         symbols with the right csect.  Don't mark rsec when processing
110         relocations against undefined or absolute sections.  
111         (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
112         of bfd_und_section_ptr.
113         (xcoff_link_input_bfd): Likewise.
114
115 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
116
117         * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
118         against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED
119         flag is set.  Assert that all undefined symbols are either
120         imported or defined by a dynamic object.
121         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
122         * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol
123         handling to all relocations.  Only set XCOFF_CALLED for function
124         symbols.
125         (xcoff_find_function): New function, split out from...
126         (bfd_xcoff_export_symbol) ...here.
127         (xcoff_set_import_path): New function, split out from...
128         (bfd_xcoff_import_symbol): ...here.  Remove assertion for old
129         meaning of XCOFF_CALLED.
130         (xcoff_mark_symbol): If we mark an undefined and unimported
131         symbol, find some way of defining it.  If the symbol is a function
132         descriptor, fill in its definition automatically.  If the symbol
133         is a function, mark its descriptor and allocate room for global
134         linkage code.  Otherwise mark the symbol as implicitly imported.
135         Move the code for creating function descriptors from...
136         (xcoff_build_ldsyms): ...here.  Use XCOFF_WAS_UNDEFINED to 
137         check for symbols that were implicitly defined.
138         (xcoff_mark): Don't count any dynamic relocations against
139         function symbols.
140         (bfd_xcoff_size_dynamic_sections): Save the rtld parameter
141         in the xcoff link info.
142         (xcoff_link_input_bfd): Remove handling of undefined and
143         unexported symbols.
144
145 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
146
147         * coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute
148         if the target is absolute.  Fix comment typo.
149         (xcoff_ppc_relocate_section): Remove FIXME.
150         * coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute
151         if the target is absolute.
152
153 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
154
155         * xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy
156         R_POS and R_NEG relocations against absolute symbols to the
157         .loader section.
158
159 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
160
161         * coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype
162         to 2 for bfd_mach_ppc_620.
163
164 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
165
166         * config.bfd: Treat AIX 6+ in the same way as AIX 5.
167         * configure.in: Likewise.
168         * configure: Regenerate.
169
170 2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>
171
172         PR binutils/9945
173         * elf.c (assign_section_numbers): Generate symbol table if there
174         is any relocation in output.
175         (_bfd_elf_compute_section_file_positions): Likewise.
176
177 2009-03-13  Nick Clifton  <nickc@redhat.com>
178
179         PR 9934
180         * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section.
181         * elflink.c (elf_link_read_relocs_from_section): Use
182         NUM_SHDR_ENTRIES.  Gracefully handle the case where there are
183         relocs but no symbol table.
184         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
185
186 2009-03-12  H.J. Lu  <hongjiu.lu@intel.com>
187
188         PR ld/9938
189         * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
190         to check ___tls_get_addr.
191
192         * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
193         strncmp to check __tls_get_addr.
194
195 2009-03-12  Andrew Stubbs  <ams@codesourcery.com>
196
197         * dwarf2.c (read_section): Always check the offset, even when the
198         section has been read before.
199
200 2009-03-11  H.J. Lu  <hongjiu.lu@intel.com>
201
202         * elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in
203         comments.
204
205 2009-03-11  Chris Demetriou  <cgd@google.com>
206
207         * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag.
208         * bfd-in2.h: Regenerate.
209         * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT
210         flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file
211         mode.
212         (bsd_write_armap): Likewise.
213         (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT
214         flag is set, do nothing.
215         (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0
216         for timestamp.
217
218 2009-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
219
220         * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
221         used to update stack pointer.
222
223 2009-03-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
224
225         PR binutils/9921
226         * som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE
227         for unknown symbols in absolute section.
228
229 2009-03-06  Nick Clifton  <nickc@redhat.com>
230
231         * po/es.po: Updated Spanish translation.
232
233 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
234
235         * elf32-arm.c (group_sections): Take next section size into
236         account before accepting to group it.
237
238 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
239
240         * elf32-arm.c (arm_type_of_stub): Handle long branches targetting
241         PLT entries.
242         (elf32_arm_final_link_relocate): Likewise.
243
244 2009-03-05  Moritz Kroll  <Moritz.Kroll@gmx.de>
245
246         PR 9923
247         * peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type.
248
249 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
250
251         * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New.
252         * section.c (struct bfd_section): Add has_tls_get_addr_call.
253         (BFD_FAKE_SECTION): Init new flag.
254         * ecoff.c (bfd_debug_section): Likewise.
255         * bfd-in2.h: Regenerate.
256         * libbfd.h: Regenerate.
257         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD.
258         (ppc_elf_reloc_type_lookup): Handle new relocs.
259         (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such
260         without marker relocs.
261         (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
262         if section has no old-style calls.
263         (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too.
264         Don't try to optimize new-style __tls_get_addr call when handling
265         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
266         relocs.
267         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD.
268         (ppc64_elf_reloc_type_lookup): Handle new relocs.
269         (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such
270         without marker relocs.
271         (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
272         if section has no old-style calls.  Set toc_ref for new relocs as
273         appropriate.
274         (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too.
275         Don't try to optimize new-style __tls_get_addr call when handling
276         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
277         relocs.
278
279 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
280
281         PR 6768
282         * configure.in: Test for ld --as-needed support.  Link shared
283         libbfd against libm.
284         * configure: Regenerate.
285
286 2009-03-03  Alan Modra  <amodra@bigpond.net.au>
287
288         * Makefile.am: Run "make dep-am".
289         * Makefile.in: Regenerate.
290
291 2009-03-02  Qinwei  <qinwei@sunnorth.com.cn>
292
293         * elf32-score7.c: New file.
294         * elf32-score.h: New file.
295         * elf32-score.c: Add code to support score 7.  Set score7 as the
296         default.
297         * cpu-score.c: Add score7 architecure.
298         (compatibile): New function.
299         * Makefile.am: Add rules for building elf32-score7 object.
300         * Makefile.in: Regenerate.
301         * configure.in: Add elf32-score7 object to score vectors.
302         * configure: Regenerate.
303         * reloc.c: Add score7 relocs.
304         * archures.c: Add score3 and score7 machine numbers.
305         * bfd-in2.h: Regenerate.
306         * libbfd.h: Regenerate.
307
308 2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
309
310         * configure: Regenerate.
311
312 2009-03-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
313
314         * elf32-hppa.c (hppa32_elf_local_refcounts): New function.
315         (elf32_hppa_check_relocs): Use it.
316
317         * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to
318         elf64-hppa.c.
319         (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
320         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
321         (elf_hppa_is_dynamic_loader_symbol): Likewise.
322         (elf_hppa_record_segment_addrs): Likewise.
323         (elf_hppa_final_link): Likewise.
324         (elf_hppa_relocate_insn): Likewise.
325         (elf_hppa_final_link_relocate): Likewise.
326         (elf64_hppa_relocate_section): Likewise.
327         * elf64-hppa.c: Insert above.
328
329 2009-02-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
330
331         * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
332         (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table.
333         (elf_hppa_relocate_section): Likewise.
334         * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive
335         from struct elf_link_hash_entry.  Add count field.
336         (struct elf64_hppa_dyn_hash_table): Delete.
337         (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field.
338         (elf64_hppa_hash_table): Rename to hppa_link_hash_table.
339         (hppa_elf_hash_entry, eh_name): Define.
340         (elf64_hppa_new_dyn_hash_entry): Delete.
341         (elf64_hppa_dyn_hash_lookup): Delete.
342         (elf64_hppa_dyn_hash_traverse): Delete.
343         (get_dyn_name): Delete.
344         (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead
345         of struct elf64_hppa_dyn_hash_entry *.
346         (elf64_hppa_finalize_dlt, llocate_global_data_dlt,
347         allocate_global_data_plt, allocate_global_data_stub,
348         allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries):
349         Likewise.
350         (hppa64_link_hash_newfunc): New.
351         (elf64_hppa_hash_table_create): Rework.
352         (count_dyn_reloc): Likewise.
353         (hppa64_elf_local_refcounts): New.
354         (elf64_hppa_check_relocs): Rework using standard technique for recording
355         local DLT, PLT and OPD reference counts.
356         (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct
357         elf_link_hash_entry *.
358         (elf64_hppa_mark_exported_functions, allocate_global_data_dlt,
359         allocate_global_data_plt, allocate_global_data_stub,
360         allocate_global_data_opd, allocate_dynrel_entries,
361         elf64_hppa_adjust_dynamic_symbol,
362         elf64_hppa_mark_milli_and_exported_functions): Likewise.
363         (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections):
364         Use hppa_link_hash_table.  Rework.
365         (elf64_hppa_link_output_symbol_hook): Rework.
366         (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd,
367         elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc,
368         elf64_hppa_finish_dynamic_sections): Likewise.
369
370 2009-02-26  Christophe Lyon  <christophe.lyon@st.com>
371
372         * elf32-arm.c (stub_reloc_type): Removed.
373         (insn_sequence): Renamed reloc_type field to r_type.
374         (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
375         (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
376         (elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
377         (elf32_arm_stub_type): Add new enum entries for the new stubs.
378         (arm_stub_is_thumb): Catch new stubs.
379         (arm_type_of_stub): Handle new stubs.
380         (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
381         (bfd_elf32_arm_process_before_allocation): Remove useless
382         condition.
383
384 2009-02-25  H.J. Lu  <hongjiu.lu@intel.com>
385
386         * elf.c (elf_find_function): Use is_function_type to check
387         function symbol.
388
389 2009-02-24  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
390
391         * xtensa-modules.c: Revert to previous version 1.11 due
392         to inadvertant commit.
393
394 2009-02-24  Sterling Augustine  <sterling@tensilica.com>
395
396         * elf32-xtensa.c (text_action_add): Separate test for action
397         type.  Break if saved action is ta_widen_insn at same offset.
398
399 2009-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
400
401         * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
402         to elf32_arm_stub_long_branch_any_arm_pic.
403         (elf32_arm_stub_long_branch_any_thumb_pic): New.
404         (enum elf32_arm_stub_type, arm_type_of_stub)
405         (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
406         separately.
407
408 2009-02-24  Joseph Myers  <joseph@codesourcery.com>
409
410         * elf32-arm.c (PREV_SEC): Update comment.
411         (group_sections): Rename argument to stubs_always_after_branch.
412         Reverse the list and place stubs at the end of input sections.
413         Undefine NEXT_SEC.
414         (elf32_arm_size_stubs): Update to use stubs_always_after_branch.
415
416 2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
417
418         * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
419         Fix formatting.
420         (arm_size_one_stub): Remove unnecessary break.
421         (arm_map_one_stub): Fix formatting.  Return after BFD_FAIL.
422
423 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
424
425         * elf32-arm.c (stub_insn_type): New type.
426         (stub_reloc_type): Likewise.
427         (insn_sequence): Likewise.
428         (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
429         (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
430         (elf32_arm_stub_long_branch_thumb_only): Likewise.
431         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
432         (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
433         (elf32_arm_stub_long_branch_any_any_pic): Likewise.
434         (elf32_arm_stub_hash_entry): Add new helper fields.
435         (stub_hash_newfunc): Initialize these new fields.
436         (arm_build_one_stub): Encode Arm and Thumb instructions separately
437         to take endianness into account.
438         (arm_size_one_stub): Compute size of stubs using insn_sequence.
439         (arm_map_one_stub): Code is now more generic, thanks to
440         insn_sequence.
441
442 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
443
444         * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
445         code.
446         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
447         (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when
448         BLX is not available. Fix typo in warning message. Add comments
449         and improve formatting.
450         (arm_build_one_stub): Adjust to new
451         elf32_arm_stub_long_branch_v4t_thumb_arm stub.
452         (arm_map_one_stub): Likewise.
453
454 2009-02-23  Tristan Gingold  <gingold@adacore.com>
455             Eric Botcazou  <ebotcazou@adacore.com>
456             Douglas B Rupp  <rupp@gnat.com>
457
458         * vms.h: Update copyright year, fix comments, reorder declarations.
459         (_bfd_save_vms_section): Remove the prototype.
460         (EGPS_S_V_NO_SHIFT): New constant.
461         (bfd_vms_set_section_flags): New prototype.
462         (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New
463         constants.
464         (EGSY_S_W_FLAGS): Ditto.
465         (EGSY_S_V_QUAD_VAL): Ditto.
466         (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto.
467         (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX,
468         EGST_S_B_NAMLNG): Ditto.
469         (ESRF_S_B_NAMLNG): Ditto.
470         (ETIR_S_C_HEADER_SIZE): Ditto.
471         (EGPS_S_V_ALLOC_64BIT): Ditto.
472         (DST_S_C_EPILOG): Ditto.
473         (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto.
474         (DST_S_C_SRC_INCRLNUM_B): Ditto.
475         (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto.
476         (DST_S_L_PCLINE_UNSLONG): Ditto.
477         (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto
478         (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto
479         (DST_S_C_SOURCE_HEADER_SIZE): Ditto.
480         (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto.
481         (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto.
482         (DST_S_B_SRC_UNSBYTE): Ditto.
483         (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto.
484         Add prototypes.
485         (vms_section, vms_reloc): Remove types.
486         (hdr_struc): Replaced by ...
487         (hdr_struct): ... new type.
488         (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants.
489         (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto.
490         (EMH_DATE_LENGTH): Ditto.
491         (eom_struc): Replaced by ...
492         (eom_struct): ... new type.
493         (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants.
494         (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto.
495         (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto.
496         (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto.
497         (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto.
498         (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto.
499         (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto.
500         (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto.
501         (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto.
502         (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto.
503         (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto.
504         (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto.
505         (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto.
506         (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto.
507         (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto.
508         (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto.
509         (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto.
510         (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH)
511         (DBG_S_C_DMT_PSECT_SIZE): Ditto.
512         (enum file_type_enum): New type.
513         (struct location_struct): Removed.
514         (struct fileinfo, struct srecinfo, struct lineinfo): New types.
515         (struct funcinfo, struct module): Ditto.
516         (struct vms_private_data_struct): Update fields.
517         (struct vms_section_data_struct): New type.
518
519         * vms.c: Update copyright year, fix comments,
520         Fix includes for DECC, add prototypes.
521         (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove
522         some initializers.
523         Use flavour to set is_vax, location_stack is removed.
524         (struct pair): Declare.
525         (fill_section_ptr): Initialize variables at declaration.
526         Add guard to set SECTION_SYM flag, handlde und section.
527         (vms_fixup_sections): Use struct pair for fill_section_ptr argument.
528         (_bfd_vms_slurp_object_records): New function, replaces previous
529         vms_object_p.
530         (vms_slurp_module): New function.
531         (vms_slurp_image): Ditto.
532         (vms_object_p): Complete rewrite.
533         (vms_mkobject): Use is_vax field to slect architecture.
534         (free_reloc_stream): New function.
535         (vms_convert_to_var): Ditto.
536         (vms_convert_to_var_1): Ditto.
537         (vms_convert_to_var_unix_filename): Ditto.
538         (vms_close_and_cleanup): Call free_reloc_stream, convert file to
539         VAR format on VMS.
540         (vms_new_section_hook): Set alignment to 0, allocate private data.
541         (vms_get_section_contents): Load content.
542         (vms_get_symbol_info): Handle undefined section.
543         (vms_find_nearest_line): Handle.
544         (alloc_reloc_stream): New function.
545         (vms_slurp_reloc_table): Ditto.
546         (vms_get_reloc_upper_bound): Make it real.
547         (vms_canonicalize_reloc): Do the real work.
548         (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA,
549         ALPHA_R_BOH.
550         (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH.
551         (vms_set_arch_mach): Check arch.
552         (vms_set_section_contents): Copy the content after allocation.
553         (vms_alpha_vec): Update object flags.
554
555         * vms-tir.c: Update copyright year, fix comments,
556         add prototypes for new functions.
557         (dst_define_location): New function.
558         (dst_restore_location): New function.
559         (dst_retrieve_location): New function.
560         (dst_check_allocation): New function.
561         (image_dump): Call dst_check_allocation.
562         (image_write_b): Ditto.
563         (image_write_w): Ditto.
564         (image_write_l): Ditto.
565         (image_write_q): Ditto.
566         (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW,
567         STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC,
568         CTL_STKDL.
569         Call error handler instead of abort if name is not known.
570         (etir_sta): Add quarter_relocs argument and set it.
571         Fix cast.
572         (etir_sto): Ditto.
573         (etir_opr): Ditto, return FALSE in case of error.
574         (etir_ctl): Add quarter_relocs argument and set it, fix cast.
575         Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL.
576         (etir_stc): Add quarter_relocs argument and set it, fix cast.
577         Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA.
578         Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL.
579         Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS.
580         Return FALSE in case of error.
581         (tir_sta): Change sign of psect.
582         (tir_ctl): Ditto.
583         (tir_cmd): Fix cast. Makes tir_table static const.
584         (etir_cmd): Add quarter_relocs argument, makes etir_table const,
585         add argument to explain.
586         (analyze_etir): Initialize maxptr, add quarter_relocs
587         declaration, move some declarations into inner scopes.
588         Handle quarter_relocs and STO_IMM.
589         (_bfd_vms_slurp_tir): Use constant instead of hard-coded values.
590         (_bfd_vms_slurp_relocs): New function.
591         (_bfd_vms_decode_relocs): New function.
592         (sto_imm): Rewritten.
593         (start_first_etbt_record): New function.
594         (start_another_etbt_record): Ditto.
595         (etir_output_check): Ditto.
596         (defer_reloc_p): Ditto.
597         (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to
598         a for-loop.  Correctly deals with contents, deals with .vmsdebug,
599         rewritte relocations handling.
600         (_bfd_vms_write_tbt): Removed.
601         (_bfd_vms_write_dbg): Ditto.
602
603         * vms-misc.c: Update copyright year, Fix comments.
604         (_bfd_vms_get_header_values): Use 'size' instead of 'length'.
605         (maybe_adjust_record_pointer_for_object): New function.
606         (_bfd_vms_get_first_record): New function, replaces ...
607         (_bfd_vms_get_record): ..  removed.
608         (_bfd_vms_get_object_record): New function.
609         (_bfd_vms_get_object_record): New function.
610         (vms_get_remaining_object_record): New function, replaces ...
611         (_bfd_vms_get_next_record): ... removed.
612         (add_new_contents): Removed.
613         (_bfd_save_vms_section): Removed.
614         (_bfd_get_vms_section): Removed.
615         (_bfd_vms_output_flush): Write in VAR format.
616         (new_symbol): Don't make UND section.
617
618         * vms-hdr.c: Update copyright year, update list of record handled.
619         (_bfd_vms_slurp_hdr): rec_length renamed to rec_size.
620         (_bfd_vms_write_hdr): Strip vms and unix patches,
621         add comments, truncate module name at 31 characters,
622         use constants instead of hard-coded value,
623         write BFD version instead of a fixed string.
624         (_bfd_vms_slurp_ihd): New function.
625         (_bfd_vms_slurp_isd): Ditto.
626         (_bfd_vms_slurp_ihs): Ditto.
627         (new_module): Ditto.
628         (parse_module): Ditto
629         (build_module_list): Ditto.
630         (module_find_nearest_line): Ditto.
631         (_bfd_vms_find_nearest_dst_line): Ditto.
632         (vms_slurp_debug): Ditto.
633         (_bfd_vms_slurp_dbg): Ditto.
634         (_bfd_vms_slurp_tbt): Ditto.
635         (_bfd_vms_write_dbg): Ditto.
636         (_bfd_vms_write_tbt): Ditto.
637
638         * vms-gsd.c: Update copyright year, update list of records handled.
639         (EVAX_LITERALS_NAME): New macro.
640         (evax_section_flags): Add an entry for EVAX_LITERALS_NAME.
641         (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd.
642         (register_universal_symbol): New function and prototype.
643         (_bfd_vms_slurp_gsd): Fix indentations and casts,
644         improve debug messages,
645         use constants instead of hard-coded value,
646         fix missing endianness conversion,
647         handle global symbol (SYMG).
648         (bfd_vms_set_section_flags): New function.
649         (_bfd_vms_write_gsd): Don't write .vmsdebug section,
650         handle section literals,
651         fix indentation,
652         handle section bfd and vms flags,
653         don't output LIB$INITIALIZE symbol,
654         fix handling of weak symbols,
655         fix evax vs vax procedure descriptor,
656         handle absolute symbols.
657
658         * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR,
659         BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations.
660
661         * makefile.vms (DEFS): Fix flags for VMS.
662
663         * bfdio.c (real_fopen): Handle multiple VMS fopen attributes.
664
665         * bfd-in2.h: Regenerated.
666         * libbfd.h: Regenerated.
667
668 2009-02-20  Cary Coutant  <ccoutant@google.com>
669
670         * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime
671         in struct stat.
672
673 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
674
675         PR gas/7059
676         * coffcode.h (coff_write_object_contents):  Don't let the string
677         table offset overflow the s_name field when using long section names.
678
679 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
680
681         * coff-alpha.c (alpha_ecoff_backend_data):  Initialise fields which
682         control long section name handling with ECOFF_NO_LONG_SECTION_NAMES.
683         * coff-mips.c (mips_ecoff_backend_data):  Likewise.
684         * coff-rs6000.c (bfd_xcoff_backend_data):  Initialise fields which
685         control long section name handling with XCOFF_NO_LONG_SECTION_NAMES.
686         (bfd_pmac_xcoff_backend_data):  Likewise.
687         * coff64-rs6000.c (bfd_xcoff_backend_data):  Likewise.
688         (bfd_xcoff_aix5_backend_data):  Likewise.
689         (xcoff64_write_object_contents):  Delete unused long_section_names
690         local variable.
691         * coff-sh.c (bfd_coff_small_swap_table):  Initialise long section
692         name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire
693         struct non-const.
694         * coffcode.h (documentation):  Update to describe long section names.
695         (COFFLONGSECTIONCATHELPER):  New helper macro.
696         (BLANKOR1TOODD):  Likewise.
697         (COFF_ENABLE_LONG_SECTION_NAMES):  Likewise.
698         (COFF_LONG_SECTION_NAMES_SETTER):  Likewise.
699         (COFF_DEFAULT_LONG_SECTION_NAMES):  Likewise.
700         (bfd_coff_set_long_section_names_allowed):  New function.
701         (bfd_coff_set_long_section_names_disallowed):  Likewise.
702         (struct bfd_coff_backend_data):  Add new backend hook function
703         pointer _bfd_coff_set_long_section_names.
704         (bfd_coff_set_long_section_names):  New backend hook.
705         (coff_write_object_contents):  Only generate long section names if
706         bfd_coff_long_section_names() indicates they are currently enabled.
707         (bfd_coff_std_swap_table):  Make non-const, and initialise long
708         section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
709         (ticoff0_swap_table):  Likewise to both.
710         (ticoff1_swap_table):  Again, likewise to both.
711         * coffgen.c (make_a_section_from_file):  Allow long section names
712         as inputs even if not currently allowed for outputs.
713         * ecoff.c (_bfd_ecoff_no_long_sections):  New function.
714         * efi-app-ia32.c (COFF_LONG_SECTION_NAMES):  Define to 0, not blank.
715         * efi-app-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
716         * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
717         * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
718         * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
719         * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
720         * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
721         * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
722         * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
723         * pei-arm.c (COFF_LONG_SECTION_NAMES):  Likewise.
724         * pei-i386.c (COFF_LONG_SECTION_NAMES):  Likewise.
725         * pei-mcore.c (COFF_LONG_SECTION_NAMES):  Likewise.
726         * pei-mips.c (COFF_LONG_SECTION_NAMES):  Likewise.
727         * pei-ppc.c (COFF_LONG_SECTION_NAMES):  Likewise.
728         * pei-sh.c (COFF_LONG_SECTION_NAMES):  Likewise.
729         * pei-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
730         * libcoff-in.h:  Update copyright year to cause updated copyright
731         year in generated libcoff.h, and fix typo.
732         * libcoff.h:  Regenerated.
733         * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES):  New macro.
734         (_bfd_ecoff_no_long_sections):  Add prototype.
735         * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES):  New macro.
736         * pe-mips.c (COFF_LONG_SECTION_NAMES):  Define empty if not already
737         defined by an including .c file.
738         * ticoff.h (ticoff0_swap_table):  Make non-const, and initialise
739         long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
740         (ticoff1_swap_table):  Likewise to both.
741
742 2009-02-18  Christophe Lyon  <christophe.lyon@st.com>
743
744         * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
745         stub. Catch default case error.
746         (arm_map_one_stub): Add missing Thumb mapping symbol.
747
748 2009-02-18  Bjoern Haase  <bjoern.m.haase@web.de>
749
750         PR 9841
751         * elf32-avr.c: Handle case where no local symbos exist correctly.
752
753 2009-02-16  Christophe Lyon  <christophe.lyon@st.com>
754
755         bfd/
756         * elf32-arm.c (arm_long_branch_stub,
757         arm_thumb_v4t_long_branch_stub,
758         arm_thumb_thumb_long_branch_stub,
759         arm_thumb_arm_v4t_long_branch_stub,
760         arm_thumb_arm_v4t_short_branch_stub,
761         arm_pic_long_branch_stub):
762         Renamed to elf32_arm_stub_long_branch_any_any,
763         elf32_arm_stub_long_branch_v4t_arm_thumb,
764         elf32_arm_stub_long_branch_thumb_only,
765         elf32_arm_stub_long_branch_v4t_thumb_arm,
766         elf32_arm_stub_short_branch_v4t_thumb_arm,
767         elf32_arm_stub_long_branch_any_any_pic.
768         (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch,
769         arm_thumb_thumb_stub_long_branch,
770         arm_thumb_arm_v4t_stub_long_branch,
771         arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch):
772         Renamed to arm_stub_long_branch_any_any,
773         arm_stub_long_branch_v4t_arm_thumb,
774         arm_stub_long_branch_thumb_only,
775         arm_stub_long_branch_v4t_thumb_arm,
776         arm_stub_short_branch_v4t_thumb_arm,
777         arm_stub_long_branch_any_any_pic.
778
779 2009-02-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
780
781         * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used
782         in branch offset check.
783
784 2009-02-15  Alan Modra  <amodra@bigpond.net.au>
785
786         * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,
787         add toc.symndx and toc.add.
788         (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here.
789         Set up toc.add.
790         (get_tls_mask): Add toc_addend param, set from toc.add.  Adjust all
791         callers.
792         (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd.
793         (branch_reloc_hash_match): New function, extracted from..
794         (ppc64_elf_tls_optimize): ..here.
795         (ppc64_elf_relocate_section): Properly set addends when optimizing
796         tls sequences.  Avoid unnecessary reading and writing of insns.
797         Only redo reloc when symbol changed.  Bypass symbol checks when
798         using tlsld_got.
799         * elf32-ppc.c (ppc_elf_tls_setup): Correct comment.
800         (branch_reloc_hash_match): New function, extracted from..
801         (ppc_elf_tls_optimize): ..here.
802         (ppc_elf_relocate_section): Avoid unnecessary reading of insns.
803         Don't clear addend on zapped __tls_get_addr reloc.
804
805 2009-02-12  Nick Clifton  <nickc@redhat.com>
806
807         PR 9827
808         * elflink.c (bfd_elf_final_link): When counting the relocations,
809         if the header size has not been set yet then assume that it will
810         match the output section's reloc type.
811
812 2009-02-12  Nathan Sidwell  <nathan@codesourcery.com>
813
814         * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
815         relocatable link.
816
817 2009-02-09  Alan Modra  <amodra@bigpond.net.au>
818
819         * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
820         (find_function): Likewise.
821         (pasted_function): Don't error if no prior function found.
822         (discover_functions): Revert 2008-12-10 change.  Extend first
823         function range to start of section.
824
825 2009-02-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
826
827         * elf64-hppa.c: Remove PARAMS macro.  Replace PTR with void *.  Convert
828         functions to C90.
829         * elf64-hppa.h: Likewise.
830
831 2009-02-06  Joseph Myers  <joseph@codesourcery.com>
832
833         * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special
834         .sbss handling.
835
836 2009-02-04  Alan Modra  <amodra@bigpond.net.au>
837
838         * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize.
839         Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*.
840
841 2009-02-03  Sandip Matte  <sandip@rmicorp.com>
842
843         * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr.
844         * archures.c (bfd_mach_mips_xlr): Define.
845         * bfd-in2.h: Regenerate.
846         * cpu-mips.c (I_xlr): Define.
847         (arch_info_struct): Add XLR entry.
848         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR.
849         (mips_set_isa_flags): Handle bfd_mach_mips_xlr
850         (mips_mach_extensions): Add XLR entry.
851
852 2009-02-03  Eric B. Weddington  <eric.weddington@atmel.com>
853
854         * elf32-avr.c (avr_final_link_relocate): Allow avr25 to wraparound.
855
856 2009-02-03  Carlos O'Donell  <carlos@codesourcery.com>
857
858         * configure.in: AC_SUBST pdfdir.
859         * Makefile.am: Add install-pdf, install-pdf-am 
860         and install-pdf-recursive targets. Define pdfdir.
861         * doc/Makefile.am: Define pdf__strip_dir. Add
862         install-pdf and install-pdf-am targets.
863         * po/Make-in: Add install-pdf target. 
864         * configure: Regenerate.
865         * Makefile.in: Regenerate
866         * doc/Makefile.in: Regenerate.
867
868 2009-02-03  Maxim Kuvyrkov  <maxim@codesourcery.com>
869
870         * bfd-in2.h: Regenerate.
871         * elf32-m68k.c: Handle 2-slot GOT entries.  Rename variables and
872         fields from n_entries to n_slots where appropriate, update comments.
873         (HOWTO): Add TLS relocations.
874         (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*.
875         (enum elf_m68k_got_offset_size): New enum.
876         (struct elf_m68k_got_entry.type): Move field to ...
877         (struct elf_m68k_got_entry_key): ... here.  Update all uses.
878         (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static
879         functions.
880         (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static
881         functions.
882         (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries
883         fields into n_entries array.  Update comments.
884         (elf_m68k_init_got): Simplify, update all uses.
885         (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update.
886         (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot
887         GOT entries; update name, update all uses.
888         (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto.
889         (elf_m68k_get_got_entry): Update.
890         (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries,
891         simplify.
892         (elf_m68k_remove_got_entry_type): Simplify.
893         (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update.
894         (elf_m68k_can_merge_gots): Update.
895         (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update.
896         (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot
897         GOT entries, simplify.
898         (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same.
899         (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff
900         field, remove obsoleted local_n_entries field.
901         (elf_m68k_partition_multi_got_2): New static function.
902         (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it;
903         update.
904         (elf_m68k_remove_got_entry_type): Update.
905         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
906         (elf_m68k_check_relocs): Handle TLS relocations.  Remove unnecessary 
907         update of sgot->size and srelgot->size.
908         (elf_m68k_gc_sweep_hook): Update.
909         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
910         (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle
911         TLS relocations.
912         * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations.
913         * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
914
915 2009-02-02  DJ Delorie  <dj@redhat.com>
916
917         * elf32-mep.c (config_names): Regenerate configuration.
918
919 2009-02-02  Alan Modra  <amodra@bigpond.net.au>
920
921         * elf-bfd.h (bfd_elf_get_str_section): Don't declare.
922         (bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise.
923         * elf.c (bfd_elf_get_str_section): Make static.
924         (bfd_elf_find_section): Delete.
925         * libbfd.h: Regenerate.
926
927 2009-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
928
929         * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove.
930         (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs.
931
932 2009-01-31  Alan Modra  <amodra@bigpond.net.au>
933
934         * elflink.c (on_needed_list): New function.
935         (elf_link_add_object_symbols): Link in --as-needed libs if they
936         satisfy undefined symbols in other libs.
937
938 2009-01-30  Julian Brown  <julian@codesourcery.com>
939
940         * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with
941         EXEC_P or DYNAMIC flags, and skip sections which are being linked
942         with --just-symbols (-R).
943
944 2009-01-29  Adam Nemet  <anemet@caviumnetworks.com>
945
946         * dwarf2.c (read_rangelist): Use read_address to read low_pc and
947         high_pc in order to properly sign-extend VMAs.
948
949 2009-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
950             Mark Shinwell  <shinwell@codesourcery.com>
951             Catherine Moore  <clm@codesourcery.com>
952
953         * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments.
954
955 2009-01-28  Catherine Moore <clm@codesourcery.com>
956
957         * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and
958         SEC_LOAD for dynamic relocation sections.
959
960 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
961
962         * elf32-cris.c (cris_elf_relocate_section): Use elf_hash_table
963         (info)->tls_size, not elf_hash_table (info)->tls_sec->size for
964         the size of local TLS data.
965
966 2009-01-27  Andreas Schwab  <schwab@suse.de>
967
968         * mach-o.c (bfd_mach_o_archive_p): Restrict the number of
969         architectures in the archive.
970
971 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
972
973         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
974         <R_CRIS_32_DTPREL>: Correct relocation value.
975
976         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
977         <R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined
978         symbols with non-default visibility.
979
980 2009-01-26  Nathan Sidwell  <nathan@codesourcery.com>
981
982         * elf32-ppc.c (ppc_elf_relax_section): Add space for relocs
983         describing the trampolines.
984         (ppc_elf_relocate_section): Update relocs to describe the
985         trampolines.
986
987 2009-01-25  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
988
989         * elf-hppa.h (elf_hppa_final_link_relocate): Add check to ensure that
990         branch targets can be reached for R_PARISC_PCREL22F, R_PARISC_PCREL17F
991         and R_PARISC_PCREL12F relocations.
992
993 2009-01-24  Alan Modra  <amodra@bigpond.net.au>
994
995         PR 6022
996         * elflink.c (find_version_for_sym): New function split out from,
997         but without export_dynamic test, ..
998         (_bfd_elf_link_assign_sym_version): ..here.
999         (_bfd_elf_export_symbol): Use it.
1000
1001 2009-01-23  Alan Modra  <amodra@bigpond.net.au>
1002
1003         * elf-bfd.h (struct elf_assign_sym_version_info): Delete.
1004         (struct elf_info_failed, struct elf_find_verdep_info): Move to..
1005         * elflink.c: ..here, somewhat modified.
1006         * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol,
1007         _bfd_elf_link_find_version_dependencies,
1008         _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section,
1009         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
1010         _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't
1011         declare..
1012         * elflink.c: ..and make static here.
1013         (_bfd_elf_link_find_version_dependencies): Adjust for removal
1014         of output_bfd from struct elf_find_verdep_info.
1015         (_bfd_elf_link_assign_sym_version): Similarly adjust to use
1016         struct elf_info_failed.
1017         (bfd_elf_size_dynamic_sections): Adjust.
1018
1019 2009-01-22  Alan Modra  <amodra@bigpond.net.au>
1020
1021         PR 6832
1022         * dwarf2.c (find_line): Don't update stash->sec_info_ptr until
1023         after comp_unit_find_line call.
1024
1025 2009-01-21  Nick Clifton  <nickc@redhat.com>
1026
1027         PR 9769
1028         * vmsutil.c (vms_file_stats_name): Remove use of unsupported
1029         tm_gmtoff field in struct tm.
1030
1031 2009-01-21  Alan Modra  <amodra@bigpond.net.au>
1032
1033         * elf32-spu.h (struct spu_elf_params): Add non_ia_text.
1034         * elf32-spu.c (mark_overlay_section): Only include .text.ia.*
1035         sections in soft-icache lines unless non_ia_text.  Don't add
1036         rodata if doing so would exceed line size.
1037
1038 2009-01-19  Hans-Peter Nilsson  <hp@axis.com>
1039
1040         * elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol
1041         types than bfd_link_hash_indirect, before early return, call
1042         _bfd_elf_link_hash_copy_indirect.
1043
1044 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
1045
1046         * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
1047         * elf-bfd.h (elf_backend_data): Add obj_attrs_order.
1048         * elf32-arm.c (elf32_arm_obj_attrs_order): New function.
1049         (elf_backend_obj_attrs_order): New define.
1050         * elfxx-target.h (elf_backend_obj_attrs_order): New define.
1051         (elfNN_bed): Add elf_backend_obj_attrs_order.
1052
1053 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
1054
1055         * elf-attrs.c (is_default_attr): Substitute magic numbers with macros.
1056         (obj_attr_size): Likewise.
1057         (write_obj_attribute): Likewise.
1058         (_bfd_elf_copy_obj_attributes): Likewise.
1059         (_bfd_elf_parse_attributes): Likewise.
1060         * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define.
1061         (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines.
1062         (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines.
1063         (ATTR_TYPE_HAS_NO_DEFAULT): New define.
1064         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers
1065         with macros.
1066
1067 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
1068
1069         * elf-attrs.c (is_default_attr): Support defaultless attributes.
1070         (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
1071         (bfd_elf_add_obj_attr_string): Likewise.
1072         (bfd_elf_add_obj_attr_int_string): Likewise.
1073         (_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
1074         * elf-bfd.h (struct obj_attribute): Document new flag bit.
1075         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
1076         Tag_nodefaults has no default value.
1077         (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
1078         comment to reflect the new state.
1079
1080 2009-01-19  Alan Modra  <amodra@bigpond.net.au>
1081
1082         PR 9695
1083         * pdp11.c (N_BADMAG): True for anything but OMAGIC, NMAGIC, ZMAGIC.
1084         (some_aout_object_p): Delete dead code handling QMAGIC and BMAGIC.
1085         (adjust_z_magix): Delete dead code handling QMAGIC.
1086
1087 2009-01-16  Kai Tietz  <kai.tietz@onevision.com>
1088
1089         * coffcode.h (styp_to_sec_flags): Correct interpretation of
1090         IMAGE_SCN_MEM_DISCARDABLE.
1091
1092 2009-01-16  Alan Modra  <amodra@bigpond.net.au>
1093
1094         * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute
1095         SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS.
1096         * configure.in (commonbfdlib): Delete.
1097         (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/
1098         (SHARED_LIBADD): Rename from WIN32LIBADD.  Add pic libiberty if such
1099         is available, not just for linux.
1100         * po/SRC-POTFILES.in: Regenerate.
1101         * Makefile.in: Regenerate.
1102         * configure: Regenerate.
1103
1104 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
1105             Julian Brown   <julian@codesourcery.com>
1106
1107         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known
1108         ARM attributes in ABI 2.07.
1109         * elf32-arm.c (get_secondary_compatible_arch): New function.
1110         (set_secondary_compatible_arch): New function.
1111         (tag_cpu_arch_combine): New function.
1112         (elf32_arm_copy_one_eabi_other_attribute): Delete function.
1113         (elf32_arm_copy_eabi_other_attribute_list): Delete function.
1114         (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to
1115         make it fit with order_01243.
1116         Add support for Tag_also_compatible_with,
1117         Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use,
1118         Tag_MPextension_use, Tag_nodefaults and Tag_conformance.
1119         Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name,
1120         Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension,
1121         Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed,
1122         Tag_VFP_arch and Tag_ABI_FP_16bit_format.
1123         Rework the way unknown attributes are handled.
1124         Defer errors until all attributes have been processed.
1125
1126 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
1127
1128         * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to
1129         bfd_elf_add_obj_attr_int_string.
1130         Read Tag_compatibility from its new location in the attribute array,
1131         rather than the attribute list.
1132         (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat ->
1133         bfd_elf_add_obj_attr_int_string.
1134         (_bfd_elf_parse_attributes): Likewise.
1135         (_bfd_elf_merge_object_attributes): There's now only one
1136         Tag_compatibility, and it's in the array, not the list.
1137         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include
1138         Tag_compatibility.
1139         (bfd_elf_add_obj_attr_compat): Rename to
1140         bfd_elf_add_obj_attr_int_string.
1141         (bfd_elf_add_proc_attr_compat): Rename to
1142         bfd_elf_add_proc_attr_int_string.
1143         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle
1144         Tag_compatibility.
1145
1146 2009-01-15  Douglas B Rupp  <rupp@gnat.com>
1147
1148         * Makefile.am (BFD32_BACKENDS): Add new object vmsutil.lo
1149         (BFD32_BACKENDS_CFILES): Add new file vmsutil.c
1150         (vmsutil.lo): Add dependency rule.
1151         * Makefile.in: Regenerate.
1152         * config.bfd (ia64*-*-*vms*): Add case.
1153         * configure.in (bfd_elf64_ia64_vms_vec): Add case.
1154         * configure: Regenerate.
1155         * vmsutil.c: New file.
1156         * vmsutil.h: New file.
1157         * elf-bfd.h (struct bfd_elf_special_section): Change type of
1158         attr to bfd_vma.
1159         * elfxx-ia64.c (elfNN_vms_post_process_headers,
1160         elfNN_vms_section_processing, elfNN_vms_final_write_processing,
1161         elfNN_vms_close_and_cleanup, elfNN_vms_section_from_shdr,
1162         elfNN_vms_object_p): New functions
1163         * targets.c (bfd_elf64_ia64_vms_vec): New target.
1164
1165 2009-01-14  H.J. Lu  <hongjiu.lu@intel.com>
1166
1167         PR ld/9727
1168         * elflink.c (elf_gc_sweep): Exclude the group section if the
1169         first member of the section group is excluded.
1170
1171 2009-01-14  Alan Modra  <amodra@bigpond.net.au>
1172
1173         PR 9735
1174         * syms.c (_bfd_stab_section_find_nearest_line): Don't free
1175         saved filename, use bfd_alloc rather than bfd_malloc for it.
1176
1177 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
1178
1179         * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute.
1180
1181 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
1182
1183         * elf32-spu.c (remove_cycles): Always set call->max_depth.
1184
1185 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
1186
1187         * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask.
1188
1189 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
1190
1191         * elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2,
1192         num_lines_log2.
1193         (struct got_entry): Add br_addr.
1194         (struct call_info): Add priority.
1195         (struct function_info): Add lr_store and sp_adjust.
1196         (spu_elf_setup): Init line_size_log2 and num_lines_log2.
1197         (spu_elf_find_overlays): For soft-icache, mark any section within cache
1198         area as an overlay, and check that no other overlays exist.  Look up
1199         icache overlay manager entry sym.
1200         (BRA_STUBS, BRA, BRASL): Define.
1201         (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub.
1202         (needs_ovl_stub): Adjust for soft-icache.  Return priority encoded
1203         in branch insn.
1204         (count_stub, build_stub): Support soft-icache.
1205         (build_spuear_stubs, process_stubs): Adjust build_stub call.
1206         (spu_elf_size_stubs): Size soft-icache stubs.
1207         (overlay_index): New function.
1208         (spu_elf_build_stubs): Make static.  Support soft-icache.
1209         (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache.
1210         (find_function_stack_adjust): Save lr store and stack adjust insn
1211         offsets.
1212         (maybe_insert_function): Adjust find_function_stack_adjust call.
1213         (mark_functions_via_relocs): Retrieve priority.
1214         (remove_cycles): Only warn about pruned arcs when stack_analysis.
1215         (sort_calls): Sort by priority first.
1216         (mark_overlay_section): Ignore .ovl.init.
1217         (sum_stack): Only print when stack_analysis.
1218         (print_one_overlay_section): New function, extracted from..
1219         (spu_elf_auto_overlay): ..here.  Support soft-icache overlays.
1220         (spu_elf_stack_analysis): Only print when htab->stack_analysis.
1221         (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive
1222         analysis.  Call spu_elf_build_stubs.
1223         (spu_elf_relocate_section): For soft-icache encode overlay index
1224         into addresses.
1225         (spu_elf_output_symbol_hook): Support soft-icache.
1226         (spu_elf_modify_program_headers: Likewise.
1227
1228         * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis.  Rename
1229         num_regions to num_lines.  Add line_size and max_branch.
1230         (enum _ovly_flavour): Add ovly_soft_icache.
1231         (spu_elf_build_stubs): Delete.
1232
1233 2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
1234
1235         * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
1236         relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.
1237
1238 2009-01-07  Hans-Peter Nilsson  <hp@axis.com>
1239
1240         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
1241         <case R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: For a symbol defined in
1242         the program, the known offset starts at the negative size of the
1243         TLS section.
1244         <case R_CRIS_32_IE, R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>:
1245         Similar.
1246
1247 2009-01-05  Joel Sherrill <joel.sherrill@oarcorp.com>
1248
1249         * config.bfd: Add lm32-*-rtems*.
1250
1251 2009-01-03  H.J. Lu  <hongjiu.lu@intel.com>
1252
1253         * coff-ppc.c: Add 2009 to Copyright.
1254         * elf32-cris.c: Likewise.
1255         * elflink.c: Likewise.
1256
1257 2009-01-03  Hans-Peter Nilsson  <hp@axis.com>
1258
1259         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Rename
1260         gotplt_index to rela_plt_index.  Adjust for R_CRIS_DTPMOD entry.
1261
1262 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
1263
1264         PR ld/9679
1265         * elflink.c (elf_merge_st_other): New.
1266         (_bfd_elf_merge_symbol): Use it on skipped weak definitions and
1267         hide them if needed.
1268         (elf_link_add_object_symbols): Updated.
1269
1270 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
1271
1272         PR ld/9676
1273         * elflink.c (elf_link_add_object_symbols): Update def_dynamic,
1274         ref_dynamic and dynamic_def fields when setting def_regular
1275         to 1.
1276
1277 2009-01-02  Curtis Mackie  <curtmackevo@gmail.com>
1278
1279         PR 9682
1280         * coff-ppc.c (dump_toc): Fix up calls to fprintf without a string
1281         literal.
1282
1283 For older changes see ChangeLog-2008
1284 \f
1285 Local Variables:
1286 mode: change-log
1287 left-margin: 8
1288 fill-column: 74
1289 version-control: never
1290 End: