]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - bfd/ChangeLog
2008-12-23 H.J. Lu <hongjiu.lu@intel.com>
[thirdparty/binutils-gdb.git] / bfd / ChangeLog
1 2008-12-23 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR ld/7036
4 * elfxx-ia64.c (elfNN_ia64_relax_section): Assume linker will
5 always insert 32byte between the .plt and .text sections after
6 the the first relaxation pass.
7
8 2008-12-23 Nick Clifton <nickc@redhat.com>
9
10 PR 7093
11 * elf32-arm.c (bfd_elf32_arm_init_maps): Only process ARM ELF
12 object files.
13
14 2008-12-23 Tristan Gingold <gingold@adacore.com>
15
16 * mach-o.c (bfd_mach_o_make_bfd_section): Use the standard ELF name
17 .eh_frame for __TEXT.__eh_frame so that it is recognized by gdb.
18 Use shorter sections name for well known sections.
19 (bfd_mach_o_scan_read_dylinker): Only put dylinker name in the
20 section content.
21 (bfd_mach_o_scan_read_segment): Use shorter sections name for
22 well known segments.
23 (bfd_mach_o_scan_read_command): Ignore some new commands.
24 (bfd_mach_o_openr_next_archived_file): Use more descriptive names
25 for members filename.
26 (bfd_mach_o_fat_extract): New function to easily extract members
27 of a fat binary.
28 * mach-o.h (bfd_mach_o_load_command_type): Add new constants.
29 (bfd_mach_o_dylinker_command): Fix comment and reindent.
30 (bfd_mach_o_fat_extract): New prototype.
31
32 2008-12-23 Johan Olmutz Nielsen <jnielsen@ddci.com>
33
34 * coffcode.h (coff_write_object_contents): Always initialise
35 section.s_page.
36
37 2008-12-23 Andreas Schwab <schwab@suse.de>
38
39 * elf32-m68k.c (elf_m68k_discard_copies): Use SYMBOL_CALLS_LOCAL.
40 (elf_m68k_relocate_section): Use SYMBOL_CALLS_LOCAL and
41 SYMBOL_REFERENCES_LOCAL.
42 (elf_m68k_relocate_section): Likewise.
43
44 2008-12-23 Nick Clifton <nickc@redhat.com>
45
46 * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs
47 field.
48 (_bfd_elf_make_ifunc_reloc_section): Remove prototype.
49 * elf.c (swap_out_syms): Remove STT_IFUNC support.
50 (elf_find_function): Likewise.
51 * elf32-arm.c (arm_elf_find_function): Likewise.
52 (elf32_arm_adjust_dynamic_symbol): Likewise.
53 (elf32_arm_swap_symbol_in): Likewise.
54 (elf32_arm_is_function_type): Likewise.
55 * elf32-i386.c (is_indirect_symbol): Delete.
56 (elf_i386_check_relocs): Remove STT_IFUNC support.
57 (allocate_dynrelocs): Likewise.
58 (elf_i386_relocate_section): Likewise.
59 * elf64-x86-64.c (is_indirect_symbol): Delete.
60 (elf64_x86_64_check_relocs): Remove STT_IFUNC support.
61 (allocate_dynrelocs): Likewise.
62 (elf64_x86_64_relocate_section): Likewise.
63 * elfcode.h (elf_slurp_symbol_table): Likewise.
64 * elflink.c (_bfd_elf_adjust_symbol): Likewise.
65 (get_ifunc_reloc_section_name): Delete.
66 (_bfd_elf_make_ifunc_reloc_section): Delete.
67 * syms.c (BSF_INDIRECT_FUNCTION): Delete.
68 (bfd_print_symbol_vandf): Remove STT_IFUNC support.
69 (bfd_decode_symclass): Likewise.
70 * bfd-in2.h: Regenerate.
71
72 2008-12-20 Hans-Peter Nilsson <hp@axis.com>
73
74 * elf32-cris.c (cris_elf_howto_table): Add entry for R_CRIS_32_IE.
75 (cris_reloc_map): Similarly.
76 (cris_elf_relocate_section, cris_elf_gc_sweep_hook)
77 (cris_elf_check_relocs): Handle R_CRIS_32_IE.
78 * reloc.c (bfd_reloc_code_type): Add entry for R_CRIS_32_IE.
79 * bfd-in2.h, libbfd.h: Regenerate.
80
81 2008-12-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
82
83 * configure: Regenerate.
84
85 2008-12-17 Hans-Peter Nilsson <hp@axis.com>
86
87 * elf32-cris.c (elf_cris_copy_indirect_symbol): Return without
88 action for symbols other than bfd_link_hash_indirect.
89 (cris_elf_relocate_section) <R_CRIS_8, R_CRIS_16, R_CRIS_32>: Add missing
90 gate h != NULL for h->def_regular test.
91
92 2008-12-15 Hans-Peter Nilsson <hp@axis.com>
93
94 * elf32-cris.c (elf_cris_copy_indirect_symbol): New function.
95 (elf_backend_copy_indirect_symbol): Define to above.
96
97 * elf32-cris.c (struct elf_cris_pcrel_relocs_copied): New member
98 r_type. Fix formatting.
99 (cris_elf_relocate_section) <R_CRIS_8_PCREL, R_CRIS_16_PCREL>
100 <R_CRIS_32_PCREL>: Also break early if the symbol doesn't get
101 emitted as a dynamic one.
102 (cris_elf_check_relocs) <R_CRIS_7, R_CRIS_16, R_CRIS_32>: Fork
103 from PCREL relocs code and simplify; don't fall through.
104 <R_CRIS_8_PCREL, R_CRIS_16_PCREL, R_CRIS_32_PCREL>: Simplify for
105 pcrel only. For non-local or overridable symbols in a DSO, always
106 keep count of relocs, not just when -Bsymbolic. Don't emit
107 message nor mark as TEXTREL here.
108 (elf_cris_discard_excess_dso_dynamics): Emit warning and mark as
109 TEXTREL here, if there are nondiscarded pcrel relocs.
110
111 * elf32-cris.c (elf_cris_got_elt_size) <symtab_hdr>: Initialize
112 using ibfd, not abfd.
113
114 2008-12-11 Alan Modra <amodra@bigpond.net.au>
115
116 PR 7041
117 * elf64-ppc.c (func_desc_adjust): Correct logic making fake function
118 descriptors. Similarly correct making function descriptors dynamic.
119
120 2008-12-10 Alan Modra <amodra@bigpond.net.au>
121
122 * elf32-spu.h (struct spu_elf_params): Add num_regions.
123 * elf32-spu.c (spu_elf_auto_overlay): Handle multiple overlay regions.
124
125 2008-12-10 Alan Modra <amodra@bigpond.net.au>
126
127 * elf32-spu.g (struct spu_elf_params, enum _ovly_flavour): New.
128 (spu_elf_setup): Declare.
129 (spu_elf_create_sections, spu_elf_size_stubs): Update prototype.
130 (spu_elf_build_stubs, spu_elf_check_vma): Likewise.
131 * elf32-spu.c (struct spu_link_hash_table): Add "params". Remove
132 various other fields now in "params". Adjust code throughout.
133 (struct call_info, struct function_info): Move earlier in file.
134 (struct spu_elf_stack_info): Likewise.
135 (spu_elf_setup): New function.
136 (spu_elf_create_sections): Remove args other than "info".
137 (spu_elf_size_stubs, spu_elf_build_stubs, spu_elf_check_vma): Likewise.
138 (maybe_needs_stubs): Remove "output_bfd" arg. Adjust all calls.
139 (interesting_section): Similarly with "obfd" arg.
140 (needs_ovl_stub): Adjust output_section test.
141 (allocate_spuear_stubs): Likewise.
142 (OVL_STUB_SIZE): Don't define.
143 (ovl_stub_size): New function, use in place of OVL_STUB_SIZE.
144 (build_stub): Test params->ovly_flavour rather than OVL_STUB_SIZE.
145 (spu_elf_auto_overlay): Remove args other than "info". Make use
146 of size returned from spu_elf_load_ovl_mgr.
147 (spu_elf_stack_analysis): Remove args other than "info".
148 (spu_elf_relocate_section): Tidy setting of "ea".
149
150 2008-12-10 Alan Modra <amodra@bigpond.net.au>
151
152 * elf32-spu.c (find_function_stack_adjust): Don't limit number
153 of insns scanned. Correct sp tests. Handle "fsmbi" and "andbi".
154 (mark_detached_root): New function.
155 (build_call_tree): Call it.
156 (sort_calls): Don't do void* arithmetic.
157 (define_ovtab_symbol): Don't abort on symbols defined in linker scripts.
158 (discover_functions): Consider STT_SECTION symbols too.
159 (collect_lib_sections): Don't cut short call tree traversal
160 when function size is too large.
161
162 2008-12-09 Tom Tromey <tromey@redhat.com>
163
164 * pef.c (bfd_pef_parse_traceback_table): Add parens to placate gcc
165 4.4.
166
167 2008-12-09 Tristan Gingold <gingold@adacore.com>
168
169 * cpu-avr.c (compatible): Makes avr-6 compatible only with itself.
170
171 2008-12-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
172
173 * elf64-s390.c (elf_s390_check_relocs): Initialize
174 htab->elf.dynobj if necessary.
175
176 2008-12-03 Nick Clifton <nickc@redhat.com>
177
178 * syms.c (struct bfd_symbol): Add new flag BSF_INDIRECT_FUNCTION.
179 Remove redundant flag BFD_FORT_COMM_DEFAULT_VALUE. Renumber flags
180 to remove gaps.
181 (bfd_print_symbol_vandf): Return 'i' for BSF_INDIRECT_FUNCTION.
182 (bfd_decode_symclass): Likewise.
183 * elf.c (swap_out_syms): Translate BSF_INDIRECT_FUNCTION into
184 STT_IFUNC.
185 (elf_find_function): Treat STT_IFUNC in the same way as STT_FUNC.
186 (_bfd_elf_is_function_type): Likewise.
187 * elf32-arm.c (arm_elf_find_function): Likewise.
188 (elf32_arm_adjust_dynamic_symbol): Likewise.
189 (elf32_arm_swap_symbol_in): Likewise.
190 (elf32_arm_additional_program_headers): Likewise.
191 * elf32-i386.c (is_indirect_symbol): New function.
192 (elf_i386_check_relocs): Also generate dynamic relocs for
193 relocations against STT_IFUNC symbols.
194 (allocate_dynrelocs): Likewise.
195 (elf_i386_relocate_section): Likewise.
196 * elf64-x86-64.c (is_indirect_symbol): New function.
197 (elf64_x86_64_check_relocs): Also generate dynamic relocs for
198 relocations against STT_IFUNC symbols.
199 (allocate_dynrelocs): Likewise.
200 (elf64_x86_64_relocate_section): Likewise.
201 * elfcode.h (elf_slurp_symbol_table): Translate STT_IFUNC into
202 BSF_INDIRECT_FUNCTION.
203 * elflink.c (_bfd_elf_adjust_dynamic_reloc_section): Add support
204 for STT_IFUNC symbols.
205 (get_ifunc_reloc_section_name): New function.
206 (_bfd_elf_make_ifunc_reloc_section): New function.
207 * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs field.
208 * bfd-in2.h: Regenerate.
209
210 2008-12-02 Tristan Gingold <gingold@adacore.com>
211
212 * config.bfd: Add x86_64-*-darwin*
213
214 2008-11-28 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
215
216 * hpux-core.c: Don't include sys/file.h.
217
218 2008-11-28 Joshua Kinard <kumba@gentoo.org>
219
220 * aoutx.h (NAME): Add case statements for bfd_mach_mips14000,
221 bfd_mach_mips16000.
222 * archures.c (bfd_architecture): Add .#defines for bfd_mach_mips14000,
223 bfd_mach_mips16000.
224 * bfd-in2.h: Regenerate.
225 * cpu-mips.c: Add enums I_mips14000, I_mips16000.
226 (arch_info_struct): Add refs to R14000, R16000.
227 * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips14000,
228 bfd_mach_mips16000.
229 (mips_mach_extensions): Map R14000, R16000 to R10000.
230
231 2008-11-27 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
232
233 * Add PIC support for CR16 target.
234 * elf32-cr16.c (R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and
235 R_CR16_GLOB_DAT): New macros
236 (cr16_elf_howto_table): Add entries for for R_CR16_GOT_REGREL20,
237 R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
238 (cr16_reloc_map): Ditto
239 (_bfd_cr16_elf_create_got_section): New function to create GOT section.
240 (_bfd_cr16_elf_create_dynamic_sections): New function to create dynamic
241 section.
242 (_bfd_cr16_elf_adjust_dynamic_symbol): New function to adjust symbol
243 defined by dynamic object.
244 (_bfd_cr16_elf_size_dynamic_sections): New function to find the size of
245 dynamic sections.
246 (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
247 symbols.
248 (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
249 sections.
250 (bfd_cr16_elf32_create_embedded_relocs): New function to create
251 embedded relocs in .emreloc section in memory for .data.rel section.
252 (_bfd_cr16_elf_reloc_type_class): New function for classify reloc types.
253 (cr16_elf_check_relocs): New function for checking reloc types in first
254 phase.
255 (cr16_elf_final_link_relocate): Update for handling the new reloc types
256 R_CR16_GOT_REGREL20 and R_CR16_GOTC_REGREL20.
257 (elf32_cr16_relax_section): Update relax implementation.
258 * reloc.c (bfd_reloc_code_type): Add entries for R_CR16_GOT_REGREL20,
259 R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
260 * bfd-in.h (bfd_boolean bfd_cr16_elf32_create_embedded_relocs): Declared
261 * libbfd.h, bfd-in2.h: Regenerate.
262
263 2008-11-26 Alan Modra <amodra@bigpond.net.au>
264
265 PR 7047
266 * configure.in: Bump version.
267 * configure: Regenerate.
268 * elflink.c (_bfd_elf_link_assign_sym_version): Continue matching
269 against version nodes when a global match is a wildcard. Similarly
270 continue matching on local wildcard matches, rather than only
271 continuing for "*". Have any global wildcard match override a
272 local wildcard match. Correct logic hiding unversioned symbol.
273 (bfd_elf_size_dynamic_sections): Update for changes to struct
274 bfd_elf_version_expr.
275
276 2008-11-25 Joel Brobecker <brobecker@adacore.com>
277
278 * configure.in: Deactivate large-file support on native x86-solaris
279 as well unless the user explicitly requested it.
280 * configure: Regenerate.
281
282 2008-11-25 Joseph Myers <joseph@codesourcery.com>
283
284 * elf32-arm.c (elf32_arm_final_link_relocate): Do not turn
285 branches to undefine weak symbols into branches to the next
286 instruction if creating PLT entries for those symbols.
287
288 2008-11-25 Nick Clifton <nickc@redhat.com>
289
290 * elflink.c (is_reloc_section): New function. Returns true if the
291 given name matches the name of the reloc-containing section
292 associated with the given section.
293 (get_dynamic_reloc_section_name): New function. Computes the name
294 of the section that contains the dynamic relocs associated with
295 the given section.
296 (_bfd_elf_get_dynamic_reloc_section): New function. Returns a
297 pointer to the section containing the dynamic relocs associated
298 with the given section.
299 (_bfd_elf_make_dynamic_reloc_section): New function. Creates a
300 section to contain the dynamic relocs associated with a given
301 section.
302 * elf-bfd.h: Prototype the new functions.
303 * elf-m10300.c (mn10300_elf_check_relocs): Use new functions.
304 (mn10300_elf_final_link_relocs): Likewise.
305 * elf32-arm.c (reloc_section_p): Delete - replaced by new
306 functions.
307 (elf32_arm_final_link_relocate): Use new functions.
308 (elf32_arm_check_relocs): Likewise.
309 * elf32-cris.c (cris_elf_relocate_section): Likewise.
310 (elf_cris_check_relocs): Likewise.
311 * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
312 * elf32-i370.c (i370_elf_check_relocs): Likewise.
313 (i370_elf_relocate_section): Likewise.
314 * elf32-i386.c (elf_i386_check_relocs): Likewise.
315 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
316 (m32r_elf_check_relocs): Likewise.
317 * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
318 * elf32_ppc.c (ppc_elf_check_relocs): Likewise.
319 (ppc_elf_relocate_section): Likewise.
320 * elf32-s390.c (elf_s390_check_relocs): Likewise.
321 * elf32-sh.c (sh_elf_relocate_section): Likewise.
322 (sh_elf_check_relocs): Likewise.
323 * elf32-vax.c (elf_vax_check_relocs): Likewise.
324 (elf_vax_relocate_section): Likewise.
325 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
326 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
327 * elf64-s390.c (elf_s390_check_relocs): Likewise.
328 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
329 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
330 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
331 * elf32-bfin.c (bfin_check_relocs): Remove redundant local
332 variable 'sreloc'.
333 (bfin_relocate_section): Likewise.
334 * elf32-v850.c (v850_elf_check_relocs): Likewise.
335
336 2008-11-23 Hans-Peter Nilsson <hp@axis.com>
337
338 Implement TLS for CRIS.
339 * elf32-cris.c: Include limits.h.
340 (TLSHOWTO16): Redefine in terms of and move contents to...
341 (TLSHOWTO16X): New macro.
342 (TLSHOWTO16S, LGOT_REG_NDX, LGOT_DTP_NDX, LGOT_ALLOC_NELTS_FOR)
343 (elf_cris_hash_entry): New macros.
344 (cris_elf_howto_table): Make R_CRIS_16_DTPREL,
345 R_CRIS_16_GOT_TPREL, R_CRIS_16_TPREL check overflow for signed,
346 not unsigned values.
347 (cris_info_to_howto_rela): Make r_type a enum elf_cris_reloc_type,
348 not unsigned int.
349 (struct elf_cris_link_hash_entry): New members reg_got_refcount,
350 tprel_refcount, and dtp_refcount.
351 (struct elf_cris_link_hash_table): New member dtpmod_refcount.
352 (elf_cris_link_hash_newfunc): Initialize new members.
353 (elf_cris_link_hash_table_create): Similar.
354 (cris_final_link_relocate, elf_cris_reloc_type_class): Use a
355 temporary variable when testing the relocation type.
356 (cris_elf_gc_mark_hook): Ditto. Add default case where needed.
357 (cris_elf_gc_sweep_hook): Ditto. Handle reference-counting for
358 the new assembly-generated relocs. Rewrite refcount handling to
359 set temporary variables to pointers to reloc-specific variables
360 and entry size and common code for the update.
361 (additional_relocation_error_msg_count): New variable.
362 (cris_elf_relocate_section): Use a function-local variable srelgot
363 for the .rela.got section instead of looking it up for every need.
364 Make r_type a enum elf_cris_reloc_type, not int. Actually set
365 symname for non-local symbols. Handle new assembly-generated
366 relocs. For overflow, emit additional messages for the new 16-bit
367 relocs as well as R_CRIS_16_GOTPLT and R_CRIS_16_GOT.
368 (elf_cris_finish_dynamic_symbol): Use elf_cris_finish_dynamic_symbol
369 instead of plain casts. Check new hash entry member
370 reg_got_refcount when checking whether to emit a GOT entry.
371 (elf_cris_finish_dynamic_sections): Update head comment to warn
372 about emitting relocs here. Use a temporary variable when testing
373 the relocation type.
374 (elf_cris_discard_excess_program_dynamics)
375 (elf_cris_adjust_gotplt_to_got): Handle reference counting change
376 regarding h->reg_got_refcount.
377 (cris_elf_check_relocs): Rewrite refcount handling to set
378 temporary variables and entry size and common code for the update
379 for local symbols. Use new macro elf_cris_hash_entry. Adjust
380 allocation for change in reference counting of GOT entries for
381 local symbols.
382 (elf_cris_size_dynamic_sections): Adjust calculated size of
383 .got.plt and .rela.got if we need a GOT entry for a
384 R_CRIS_DTPMOD relocation.
385 (elf_cris_got_elt_size): New function.
386 (elf_backend_got_elt_size): Define.
387
388 2008-11-21 Sterling Augustine <sterling@tensilica.com>
389
390 * xtensa-isa.c (xtensa_state_is_shared_or): New function.
391
392 2008-11-21 Hans-Peter Nilsson <hp@axis.com>
393
394 * elf-bfd.h (struct elf_backend_data): New member got_elt_size.
395 (_bfd_elf_default_got_elt_size): Declare.
396 * elflink.c (struct alloc_got_off_arg): Replace member got_elt_size
397 by new member info.
398 (elf_gc_allocate_got_offsets): Adjust for calling bed->got_elt_size
399 to get the element size instead of using a gofarg entry.
400 (bfd_elf_gc_common_finalize_got_offsets): Similar.
401 (_bfd_elf_default_got_elt_size): New function.
402 * elfxx-target.h: New macro elf_backend_got_elt_size.
403 (elfNN_bed): Use it.
404
405 2008-11-20 Tristan Gingold <gingold@adacore.com>
406
407 * bfdwin.c: Fix comment.
408
409 2008-11-20 Tristan Gingold <gingold@adacore.com>
410
411 * bfd.c (is32bit): Use architecture information for non-ELF
412 targets.
413
414 2008-11-20 Alan Modra <amodra@bigpond.net.au>
415
416 * elf32-ppc.c (allocate_dynrelocs): Always use tlsld_got for
417 TLS_LD even when symbol is used with other TLS reloc types.
418 (ppc_elf_relocate_section): Bypass symbol checks when using tlsld_got.
419 Leave addend zero on LD DTPMOD dynamic reloc.
420
421 2008-11-19 Bob Wilson <bob.wilson@acm.org>
422
423 * xtensa-modules.c (sysregs): Add MMID, VECBASE, EPC5, EPC6, EPC7,
424 EXCSAVE5, EXCSAVE6, EXCSAVE7, EPS5, EPS6, EPS7, CPENABLE,
425 SCOMPARE1, and THREADPTR registers.
426 (NUM_SYSREGS, MAX_USER_REG): Update.
427 (states): Change width of INTERRUPT, WindowBase, WindowStart, and
428 INTENABLE. Add VECBASE, EPC5, EPC6, EPC7, EXCSAVE5, EXCSAVE6,
429 EXCSAVE7, EPS6, EPS6, EPS7, THREADPTR, CPENABLE, and SCOMPARE1 states.
430 (NUM_STATES): Update.
431 (enum xtensa_state_id): Add entries for new states.
432 (enum xtensa_field_id): Add entries for xt_wbr15_imm and xt_wbr18_imm
433 fields, along with functions to extract and set them.
434 (regfiles): Change number of AR registers to 32.
435 (Operand_ar0_encode, Operand_ar4_encode, Operand_ar8_encode,
436 Operand_ar12_encode, Operand_ars_entry_encode): Update register mask.
437 (operands): Add entries for tp7, xt_wbr15_label, xt_wbr18_label,
438 xt_wbr15_imm, and xt_wbr18_imm operands, along with functions to
439 encode and decode them.
440 (enum xtensa_operand_id): Add entries for new operands.
441 (Iclass_xt_iclass_rfi_stateArgs): Add EPC5, EPC6, EPC7, EPS5, EPS6, and
442 EPC7 states.
443 (Iclass_xt_iclass_rfdo_stateArgs): Replace EPC4 and EPS4 by EPC6 and
444 EPS6, respectively.
445 (iclasses): Add entries for rur_threadptr, wur_threadptr,
446 xt_iclass_wsr_176, xt_iclass_rsr_epc5, xt_iclass_wsr_epc5,
447 xt_iclass_xsr_epc5, xt_iclass_rsr_excsave5, xt_iclass_wsr_excsave5,
448 xt_iclass_xsr_excsave5, xt_iclass_rsr_epc6, xt_iclass_wsr_epc6,
449 xt_iclass_xsr_epc6, xt_iclass_rsr_excsave6, xt_iclass_wsr_excsave6,
450 xt_iclass_xsr_excsave6, xt_iclass_rsr_epc7, xt_iclass_wsr_epc7,
451 xt_iclass_xsr_epc7, xt_iclass_rsr_excsave7, xt_iclass_wsr_excsave7,
452 xt_iclass_xsr_excsave7, xt_iclass_rsr_eps5, xt_iclass_wsr_eps5,
453 xt_iclass_xsr_eps5, xt_iclass_rsr_eps6, xt_iclass_wsr_eps6,
454 xt_iclass_xsr_eps6, xt_iclass_rsr_eps7, xt_iclass_wsr_eps7,
455 xt_iclass_xsr_eps7, xt_iclass_rsr_vecbase, xt_iclass_wsr_vecbase,
456 xt_iclass_xsr_vecbase, xt_iclass_mul16, xt_iclass_wsr_mmid,
457 xt_iclass_icache_lock, xt_iclass_dcache_lock, xt_iclass_rsr_cpenable,
458 xt_iclass_wsr_cpenable, xt_iclass_xsr_cpenable, xt_iclass_clamp,
459 xt_iclass_minmax, xt_iclass_sx, xt_iclass_l32ai, xt_iclass_s32ri,
460 xt_iclass_s32c1i, xt_iclass_rsr_scompare1, xt_iclass_wsr_scompare1,
461 xt_iclass_xsr_scompare1, xt_iclass_div, and xt_iclass_mul32, along
462 with corresponding argument and state argument arrays. Change
463 number of state arguments for xt_iclass_rfi. Add arguments for
464 xt_iclass_rfdo.
465 (enum xtensa_iclass_id): Add entries for new iclasses.
466 (opcodes): Add entries for RUR_THREADPTR, WUR_THREADPTR, WSR_176,
467 RSR_EPC5, WSR_EPC5, XSR_EPC5, RSR_EXCSAVE5, WSR_EXCSAVE5, XSR_EXCSAVE5,
468 RSR_EPC6, WSR_EPC6, XSR_EPC6, RSR_EXCSAVE6, WSR_EXCSAVE6, XSR_EXCSAVE6,
469 RSR_EPC7, WSR_EPC7, XSR_EPC7, RSR_EXCSAVE7, WSR_EXCSAVE7, XSR_EXCSAVE7,
470 RSR_EPS5, WSR_EPS5, XSR_EPS5, RSR_EPS6, WSR_EPS6, XSR_EPS6, RSR_EPS7,
471 WSR_EPS7, XSR_EPS7, RSR_VECBASE, WSR_VECBASE, XSR_VECBASE, MUL16U,
472 MUL16S, WSR_MMID, IPFL, IHU, IIU, DPFL, DHU, DIU, RSR_CPENABLE,
473 WSR_CPENABLE, XSR_CPENABLE, CLAMPS, MIN, MAX, MINU, MAXU, SEXT, L32AI,
474 S32RI, S32C1I, RSR_SCOMPARE1, WSR_SCOMPARE1, XSR_SCOMPARE1, QUOU, QUOS,
475 REMU, REMS, and MULL opcodes, along with the corresponding functions
476 to encode them.
477 (enum xtensa_opcode_id): Add entries for new opcodes.
478 (Slot_inst_decode): Handle new opcodes.
479 (Slot_inst_get_field_fns, Slot_inst_set_field_fns): Add entries for
480 xt_wbr15_imm and xt_wbr18_imm fields.
481 (Slot_inst16a_get_field_fns, Slot_inst16a_set_field_fns): Likewise.
482 (Slot_inst16b_get_field_fns, Slot_inst16b_set_field_fns): Likewise.
483 (xtensa_modules): Update number of fields, operands, iclasses and
484 opcodes.
485
486 2008-11-19 Nix <nix@esperi.org.uk>
487
488 * elf.c (swap_out_syms) [USE_STT_COMMON]: Fix syntax error.
489
490 2008-11-19 Nick Clifton <nickc@redhat.com>
491
492 PR 7027
493 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Treat WPLT30 relocs
494 against local symbols in 64-bit binaries as if they were WDISP30
495 relocs.
496 (_bfd_sparc_elf_relocate_section): Likewise.
497
498 2008-11-18 Catherine Moore <clm@codesourcery.com>
499
500 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge
501 half-precision attributes.
502 (elf32_arm_copy_one_eabi_other_attribute): New.
503 (elf32_arm_copy_other_attribute_list): New.
504
505 2008-11-18 Nick Clifton <nickc@redhat.com>
506
507 * dwarf2.c (read_section): Fix formatting.
508 (read_n_bytes): Remove unhelpful comment.
509 (read_indirect_string): Pass symbol table to read_section in case
510 the .debug_str section needs relocating.
511
512 PR 7037
513 * elf32-cr16.c (cr16_elf_howto_table): Zero the src_mask field of
514 the reloc descriptions.
515
516 2008-11-14 Eric B. Weddington <eric.weddington@atmel.com>
517
518 PR 7022
519 * elf32-avr.c (bfd_elf_avr_final_write_processing):
520 Add missing break statements.
521
522 2008-11-14 Bob Wilson <bob.wilson@acm.org>
523
524 * xtensa-modules.c (xtensa_state_id): New enum, replacing STATE macros.
525 (xtensa_field_id, xtensa_regfile_id, xtensa_operand_id)
526 (xtensa_iclass_id, xtensa_opcode_id): New enums.
527 Replace hardcoded constants throughout this file with enum values.
528
529 2008-11-14 Nathan Sidwell <nathan@codesourcery.com>
530
531 * elf.c (assign_file_positions_for_load_sections): Use header_size
532 to avoid moving the load address of file headers.
533 (assign_file_positions_for_load_sections): Set header_size for
534 segments containing the file header.
535
536 2008-11-14 Tristan Gingold <gingold@adacore.com>
537
538 * configure.com: Handle bfd_default_target_size, BFD_HOST_LONG_LONG,
539 BFD_HOST_64BIT_LONG_LONG, BFD_HOSTPTR_T, bfd_file_ptr.
540 Generate bfdver.h.
541 * vms-hdr.c (_bfd_vms_write_hdr): Use strdup/free instead of alloca.
542 * hosts/alphavms.h: Defines macros to bypass i18n.
543 * makefile.vms (OBJS): Update file list.
544 (DEFS): Remove VMS_DEBUG, const, add DEBUGDIR.
545 (CFLAGS): Update flags.
546 * bfdio.c (real_fopen): Add code specific to VMS: extract attributes
547 from modes.
548
549 2008-11-13 Joel Brobecker <brobecker@adacore.com>
550
551 * configure.in: Deactivate large-file support on native 32bit
552 sparc-solaris unless the user explicitly requested it.
553 * configure: Regenerate.
554
555 2008-11-13 Hans-Peter Nilsson <hp@axis.com>
556
557 PR ld/7028
558 * elf.c (assign_file_positions_for_load_sections): Allocate phrds
559 with bfd_zalloc2 instead of bfd_alloc2. For the amount, use
560 the possibly-preset header-size, not the computed one.
561
562 2008-11-13 Alan Modra <amodra@bigpond.net.au>
563
564 PR 7023
565 * elf.c (bfd_section_from_shdr <SHT_SYMTAB>): Fail on invalid sh_info.
566
567 2008-11-11 Alan Modra <amodra@bigpond.net.au>
568
569 * elf.c (assign_file_positions_for_non_load_sections): Consolidate
570 PT_GNU_RELRO handling.
571
572 2008-11-11 Alan Modra <amodra@bigpond.net.au>
573
574 PR 7012
575 * dwarf2.c (find_line): Don't keep stale pointers into realloc'd
576 memory. Return on errors. Fix memory leak.
577 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_str_buffer.
578
579 2008-11-10 Andreas Schwab <schwab@suse.de>
580
581 PR 7011
582 * elf.c (assign_file_positions_for_non_load_sections): Handle
583 PT_GNU_RELRO specially.
584
585 2008-11-06 Joel Sherrill <joel.sherrill@oarcorp.com>
586
587 * config.bfd: Add m32c-*-rtems* and m32r-*-rtems*.
588
589 2008-11-06 Tom Tromey <tromey@redhat.com>
590
591 * configure, config.in: Rebuild.
592 * configure.in: Check for fileno.
593 * bfdio.c (close_on_exec): New function.
594 (real_fopen): Use it.
595 (FD_CLOEXEC): New define.
596
597 2008-11-06 Tristan Gingold <gingold@adacore.com>
598
599 * mach-o.h (BFD_MACH_O_NO_SECT): Add; reorders the macros.
600 (BFD_MACH_O_SYM_NTYPE, BFD_MACH_O_SYM_NSECT,
601 BFD_MACH_O_SYM_NDESC): New macros.
602 (bfd_mach_o_i386_thread_flavour): Define according to the latest
603 definition from system header.
604 (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_RPATH,
605 BFD_MACH_O_LC_CODE_SIGNATURE.
606 (BFD_MACH_O_SECTION_TYPE_MASK, BFD_MACH_O_SECTION_ATTRIBUTES_MASK,
607 BFD_MACH_O_SECTION_ATTRIBUTES_SYS, BFD_MACH_O_SECTION_ATTRIBUTES_USR,
608 BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC,
609 BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG,
610 BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): Add.
611 (bfd_mach_o_segment_command): Add room for a nul terminator in
612 segname field.
613 (BFD_MACH_O_PROT_READ, BFD_MACH_O_PROT_WRITE,
614 BFD_MACH_O_PROT_EXECUTE): Add.
615 (INDIRECT_SYMBOL_LOCAL): Renames to BFD_MACH_O_INDIRECT_SYMBOL_LOCAL.
616 (INDIRECT_SYMBOL_ABS): Renames to BFD_MACH_O_INDIRECT_SYMBOL_ABS.
617 (bfd_mach_o_uuid_command): Add the structure.
618 (bfd_mach_o_load_command): Add uuid field.
619 (bfd_get_mach_o_data): New macro.
620 * mach-o.c (bfd_mach_o_bfd_print_private_bfd_data): New function which
621 replaces the macro.
622 (SECTION_TYPE, SECTION_ATTRIBUTES, SECTION_ATTRIBUTES_USR,
623 S_ATTR_PURE_INSTRUCTIONS, SECTION_ATTRIBUTES_SYS,
624 S_ATTR_SOME_INSTRUCTIONS, S_ATTR_EXT_RELOC, S_ATTR_LOC_RELOC): Renamed
625 and moved to mach-o.h.
626 (N_STAB, N_TYPE, N_EXT, N_UNDF, N_ABS, N_TEXT, N_DATA, N_BSS,
627 N_SECT, N_INDR): Removed as they duplicated macros in mach-o.h.
628 (bfd_mach_o_print_symbol): Print much more details.
629 (bfd_mach_o_make_bfd_section): Add prot argument, use canonical
630 dwarf name for dwarf sections. Precisely set section flags.
631 (bfd_mach_o_scan_read_section_32): Add prot argument.
632 (bfd_mach_o_scan_read_section_64): Ditto.
633 (bfd_mach_o_scan_read_section): Ditto.
634 (bfd_mach_o_scan_read_symtab_symbol): Set section for debugging
635 stabs, set BSF_GLOBAL and LOCAL flags correctly. Fix section
636 for N_SECT symbols.
637 (bfd_mach_o_i386_flavour_string): Reindent and adjust for new
638 names.
639 (bfd_mach_o_scan_read_symtab): Set HAS_SYMS flags on bfd if there
640 are symbols.
641 (bfd_mach_o_scan_read_uuid): New function.
642 (bfd_mach_o_scan_read_segment): Add a trailing nul. Segments
643 flags are now simply HAS_CONTENTS. Pass protection to
644 bfd_mach_o_scan_read_section.
645 (bfd_mach_o_scan_read_command): Decode UUID command.
646 (bfd_mach_o_flatten_sections): Add comments. Fix flavour names.
647 (bfd_mach_o_scan): Set flags according to file type.
648 (mach_o_fat_archentry): Remove abfd field.
649 (bfd_mach_o_archive_p): Remove initialization of abfd field.
650 (bfd_mach_o_openr_next_archived_file): Find previous archive
651 by position and not by bfd (as former bfds may have been freed).
652 Give architecture name to archived file.
653 * mach-o-target.c (TARGET_NAME): Use generic archive for non fat
654 targets.
655
656 2008-10-30 Jay Krell <jay.krell@cornell.edu>
657
658 * cache.c (cache_bread): Cast void * pointer before performing
659 arithmetic on it.
660
661 2008-10-20 Alan Modra <amodra@bigpond.net.au>
662
663 * elf64-ppc.c (ppc64_elf_process_dot_syms): Renamed from
664 ppc64_elf_check_directives.
665 * elf32-sh-symbian.c (sh_symbian_process_directives): Combine..
666 (sh_symbian_check_directives): ..this
667 (bfd_elf32_sh_symbian_process_directives) ..and this function.
668
669 2008-10-20 Alan Modra <amodra@bigpond.net.au>
670
671 * elflink.c (bfd_elf_final_link): Move code reading relocs to..
672 * elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params.
673 * elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs
674 params.
675
676 2008-10-20 Alan Modra <amodra@bigpond.net.au>
677
678 * elflink.c (bfd_elf_final_link): Use d_ptr rather than d_val
679 where Elf_Internal_Dyn holds an address.
680
681 2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
682
683 * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge
684 Tag_GNU_Power_ABI_Struct_Return.
685
686 2008-10-09 Kai Tietz <kai.tietz@onevision.com>
687
688 * cofflink.c (_bfd_coff_generic_relocate_section): Dump bfd_vma
689 sized addresses instead of long sized.
690
691 2008-10-09 Alan Modra <amodra@bigpond.net.au>
692
693 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't attempt to
694 read plt relocs if no dynamic syms.
695
696 2008-10-08 Nick Clifton <nickc@redhat.com>
697
698 * configure.in (ALL_LINGUAS): Add "id".
699 * configure: Regenerate.
700 * po/id.po: New Indonesian translation.
701
702 2008-10-08 Alan Modra <amodra@bigpond.net.au>
703
704 * elf.c (assign_file_positions_for_load_sections): When checking
705 a segment for contents, don't assume that a non-TLS nobits section
706 must only be followed by nobits sections.
707
708 2008-10-04 Hans-Peter Nilsson <hp@axis.com>
709
710 * elf32-cris.c (TLSHOWTO32, TLSHOWTO16): New macros.
711 (cris_elf_howto_table): Add entries for R_CRIS_32_GOT_GD,
712 R_CRIS_16_GOT_GD, R_CRIS_32_GD, R_CRIS_DTP, R_CRIS_32_DTPREL,
713 R_CRIS_16_DTPREL, R_CRIS_DTPMOD, R_CRIS_32_GOT_TPREL,
714 R_CRIS_16_GOT_TPREL, R_CRIS_32_TPREL, R_CRIS_16_TPREL.
715 (cris_reloc_map): Similarly.
716 * reloc.c (bfd_reloc_code_type): Add entries for
717 BFD_RELOC_CRIS_32_GOT_GD, BFD_RELOC_CRIS_16_GOT_GD,
718 BFD_RELOC_CRIS_32_GD, BFD_RELOC_CRIS_DTP,
719 BFD_RELOC_CRIS_32_DTPREL, BFD_RELOC_CRIS_16_DTPREL,
720 BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_GOT_TPREL,
721 BFD_RELOC_CRIS_16_GOT_TPREL, BFD_RELOC_CRIS_32_TPREL,
722 BFD_RELOC_CRIS_16_TPREL.
723 * libbfd.h, bfd-in2.h: Regenerate.
724
725 2008-10-03 Alan Modra <amodra@bigpond.net.au>
726
727 PR 6931
728 * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when
729 the signature symbol is global.
730 * elflink.c (elf_link_input_bfd): Ensure group signature symbol
731 is output when ld -r. Set group sh_info when local.
732 * linker.c (default_indirect_link_order): Handle group sections
733 specially.
734
735 2008-09-30 Wesley W. Terpstra <wesley@terpstra.ca>
736 Nick Clifton <nickc@redhat.com>
737
738 * coffgen.c (coff_write_symbols): Check to see if a symbol's flags
739 do not match it class and if necessary update the class.
740 (null_error_handler): New function. Suppresses the generation of
741 bfd error messages.
742 * coff64-rs6000.c (bfd_xcoff_backend_data): Update comment.
743
744 2008-09-30 Alan Modra <amodra@bigpond.net.au>
745
746 * Makefile.am: Run "make dep-am".
747 * Makefile.in: Regenerate.
748
749 2008-09-30 Alan Modra <amodra@bigpond.net.au>
750
751 * elflink.c (elf_link_add_object_symbols): Don't ignore returned
752 value of check_directives.
753
754 2008-09-29 Peter O'Gorman <pogma@thewrittenword.com>
755 Steve Ellcey <sje@cup.hp.com>
756
757 * configure: Regenerate for new libtool.
758 * aclocal.m4: Ditto.
759 * Makefile.in: Ditto.
760 * doc/Makefile.in: Ditto.
761
762 2008-09-29 Alan Modra <amodra@bigpond.net.au>
763
764 PR 6789
765 * elf.c (assign_file_positions_for_load_sections): Call
766 _bfd_elf_map_sections_to_segments, not elf_modify_segment_map.
767 (get_program_header_size): Protect against NULL info.
768 (_bfd_elf_map_sections_to_segments): Likewise.
769 * elf32-spu.c (spu_elf_additional_program_headers): Likewise.
770
771 2008-09-29 Nick Clifton <nickc@redhat.com>
772
773 * po/vi.po: Updated Vietnamese translation.
774
775 2008-09-28 Alan Modra <amodra@bigpond.net.au>
776
777 * elf.c (_bfd_elf_init_private_section_data): Tweak union copy.
778 (bfd_section_from_shdr): Don't change SHT_GROUP section name.
779 * elflink.c (section_signature): New function.
780 (_bfd_elf_section_already_linked): Use it.
781
782 2008-09-19 Alan Modra <amodra@bigpond.net.au>
783
784 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Handle vxworks
785 _GLOBAL_OFFSET_TABLE_ in .got.plt section. Add BFD_ASSERTs.
786
787 2008-09-17 Bob Wilson <bob.wilson@acm.org>
788
789 * elf32-xtensa.c (elf_xtensa_check_relocs): Check for negative
790 refcount.
791
792 2008-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
793
794 PR 6893 - Do not consider FDEs for discarded sections as invalid.
795 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): New REQUIRE_CLEARED_RELOCS.
796 Consider FDEs with cleared relocations as valid and ignorable.
797
798 2008-09-16 H.J. Lu <hongjiu.lu@intel.com>
799
800 PR ld/6877
801 * elflink.c (_bfd_elf_merge_symbol): Allow a common symbol to
802 override the function in a shared library.
803
804 2008-09-16 Alan Modra <amodra@bigpond.net.au>
805
806 PR 6844
807 * elf32-ppc.c (SYM_VAL): Define. Use throughout to find symbol vma.
808 (ppc_elf_relocate_section): Correct GOT offset calculation.
809 (ppc_elf_finish_dynamic_symbol): Use PPC_HA and PPC_LO.
810 (ppc_elf_finish_dynamic_sections): Likewise. Error if
811 htab->elf.hgot symbol is not defined in htab->got section.
812
813 2008-09-16 Alan Modra <amodra@bigpond.net.au>
814
815 PR 6888
816 * elf32-ppc.c (ppc_elf_relocate_section): Handle NULL symbol section
817 on R_PPC_TOC16, R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, R_PPC_EMB_SDA21,
818 R_PPC_EMB_RELSDA, R_PPC_SECTOFF* relocs.
819
820 2008-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
821
822 Fix loading large elf64 binaries on 32bit hosts.
823 * configure.in: Call AC_SYS_LARGEFILE.
824 * config.in: Regenerate.
825 * configure: Regenerate.
826
827 2008-09-08 Tom Tromey <tromey@redhat.com>
828
829 * elfxx-mips.c (mips16_stub_symndx) <sec>: Mark argument as
830 unused.
831
832 2008-09-08 H.J. Lu <hongjiu.lu@intel.com>
833 Daniel Jacobowitz <dan@codesourcery.com>
834
835 PR ld/3191
836 * dwarf2.c (struct adjusted_section): Renamed from struct
837 loadable_section.
838 (struct dwarf2_debug): Adjust for renaming. Add version field.
839 (read_attribute_value): Correctly handle DW_FORM_ref_addr for
840 DWARF3.
841 (find_abstract_instance_name): Pass a pointer to
842 attribute instead of offset. For DW_FORM_ref_addr, get the
843 entry at the offset from the .debug_info section.
844 (scan_unit_for_symbols): Update.
845 (parse_comp_unit): Allow DWARF3. Save the version.
846 (unset_sections): Update for renaming.
847 (place_sections): Likewise. Set new VMAs for DWARF sections
848 also.
849
850 2008-09-08 Tristan Gingold <gingold@adacore.com>
851
852 * configure.in: Update version to 2.19.50
853 * configure: Regenerated.
854
855 2008-09-05 Daniel Jacobowitz <dan@codesourcery.com>
856
857 * dwarf2.c: Change leading whitespace to tabs.
858
859 2008-09-05 Tristan Gingold <gingold@adacore.com>
860
861 Add MacOSX 64 bits support.
862 * mach-o.h (bfd_mach_o_ppc_thread_flavour): Add
863 BFD_MACH_O_PPC_THREAD_STATE_64.
864 (bfd_mach_o_i386_thread_flavour): Add BFD_MACH_O_x86_THREAD_STATE64,
865 BFD_MACH_O_x86_FLOAT_STATE64, BFD_MACH_O_x86_EXCEPTION_STATE64,
866 BFD_MACH_O_x86_THREAD_STATE, BFD_MACH_O_x86_FLOAT_STATE,
867 BFD_MACH_O_x86_EXCEPTION_STATE.
868 (bfd_mach_o_load_command_type): Add
869 BFD_MACH_O_LC_SEGMENT_64, BFD_MACH_O_LC_ROUTINES_64,
870 BFD_MACH_O_LC_UUID.
871 (BFD_MACH_O_CPU_IS64BIT): Added.
872 (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_POWERPC_64,
873 BFD_MACH_O_CPU_TYPE_X86_64.
874 (bfd_mach_o_header): Add version field.
875 (bfd_mach_o_section) Add reserved3 field.
876 (bfd_mach_o_segment_command): Add initprot and maxprot fields.
877
878 * mach-o.c (N_TEXT, N_DATA, N_BSS): Added.
879 (bfd_mach_o_version): New function.
880 (bfd_mach_o_valid): Handle 64bits cpus.
881 (bfd_mach_o_write_header): handler 64bits headers.
882 (bfd_mach_o_scan_write_section_32, bfd_mach_o_scan_write_section_64):
883 New functions (from bfd_mach_o_scan_write_section) to handle both
884 flavors.
885 (bfd_mach_o_scan_write_segment): Parameter wide added to support
886 both flavors.
887 (bfd_mach_o_write_contents): Support both flavors.
888 (bfd_mach_o_read_header): Ditto.
889 (bfd_mach_o_scan_read_section_32, bfd_mach_o_scan_read_section_64):
890 New functions (from bfd_mach_o_scan_read_section) to support both
891 flavors.
892 (bfd_mach_o_scan_read_symtab_symbol): Support both flavors.
893 (bfd_mach_o_scan_read_symtab): Ditto.
894 (bfd_mach_o_scan_read_segment): Parameter wide added to support
895 both flavors.
896 (bfd_mach_o_scan_read_segment_32, bfd_mach_o_scan_read_segment_64):
897 New functions to call bfd_mach_o_scan_read_segment.
898 (bfd_mach_o_flatten_sections): Support both flavors.
899 (bfd_mach_o_scan_start_address): Ditto.
900 (bfd_mach_o_scan): Ditto.
901 (bfd_mach_o_lookup_section): Ditto.
902
903 2008-08-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
904
905 * elf-hppa.h (elf_hppa_reloc_final_type): Handle R_PARISC_GPREL64,
906 R_PARISC_SEGREL32 and R_PARISC_SEGREL64.
907 * som.c (som_fixup_formats): Add R_DATA_GPREL fixup.
908 (som_hppa_howto_table): Likewise.
909 (hppa_som_gen_reloc_type): In case R_HPPA_GOTOFF, detect R_DATA_GPREL
910 final type.
911 (som_write_fixups): Handle R_DATA_GPREL.
912
913 2008-08-26 Nick Clifton <nickc@redhat.com>
914
915 * elf32-arm.c: Fix up comment describing Thumb to ARM interworking
916 stub.
917
918 2008-08-25 Christophe Lyon <christophe.lyon@st.com>
919
920 * elf32-arm.c (arm_thumb_arm_v4t_short_branch_stub): Define.
921 (elf32_arm_stub_type): Add arm_thumb_arm_v4t_stub_short_branch.
922 (arm_type_of_stub): Handle armv4t short branches. Update
923 prototype.
924 (arm_stub_is_thumb): Handle arm_thumb_arm_v4t_stub_short_branch.
925 (arm_build_one_stub): Likewise.
926 (arm_size_one_stub): Likewise.
927 (elf32_arm_size_stubs): Use new arm_type_of_stub prototype.
928 (arm_map_one_stub): Handle arm_thumb_arm_v4t_stub_short_branch.
929
930 2008-08-24 Andreas Schwab <schwab@suse.de>
931
932 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Do proper
933 extension when calculating difference of offsets.
934
935 2008-08-24 Alan Modra <amodra@bigpond.net.au>
936
937 * configure.in: Update a number of obsolete autoconf macros.
938 * aclocal.m4: Regenerate.
939
940 2008-08-23 Andreas Schwab <schwab@suse.de>
941
942 * opncls.c (find_separate_debug_file): Use the canonical
943 absolute name of the bfd object for finding the debug file in
944 the global debugfile directory.
945
946 2008-08-22 Jakub Jelinek <jakub@redhat.com>
947
948 Fix PR ld/3290 regression for cross-files DW_FORM_ref_addr relocations.
949 * elflink.c (elf_link_add_object_symbols): Make debug symbols local
950 now only for non-RELOCATABLE targets.
951
952 2008-08-20 Bob Wilson <bob.wilson@acm.org>
953
954 * elf-bfd.h (elf_object_id): Add XTENSA_ELF_TDATA.
955 * elf32-xtensa.c (elf_howto_table): Add TLS relocations.
956 (elf_xtensa_reloc_type_lookup): Likewise.
957 (TCB_SIZE): Define.
958 (elf_xtensa_link_hash_entry): New.
959 (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE, GOT_TLS_ANY): Define.
960 (elf_xtensa_hash_entry): Define.
961 (elf_xtensa_obj_tdata): New.
962 (elf_xtensa_tdata): Define.
963 (elf_xtensa_local_got_tls_type): Define.
964 (elf_xtensa_local_tlsfunc_refcounts): Define.
965 (is_xtensa_elf): Define.
966 (elf_xtensa_mkobject): New.
967 (elf_xtensa_link_hash_table): Add tlsbase field.
968 (elf_xtensa_link_hash_newfunc): New.
969 (elf_xtensa_link_hash_table_create): Use elf_xtensa_link_hash_newfunc.
970 Create an entry for "_TLS_MODULE_BASE_" and save it in tlsbase field.
971 (elf_xtensa_copy_indirect_symbol): New.
972 (elf_xtensa_check_relocs): Rewrite to handle TLS relocations.
973 (elf_xtensa_gc_sweep_hook): Likewise.
974 (elf_xtensa_allocate_dynrelocs): Optimize away GOT entries for
975 TLSDESC_FN relocations when an IE reference is seen.
976 (elf_xtensa_allocate_local_got_size): Likewise.
977 (elf_xtensa_always_size_sections): New.
978 (dtpoff_base, tpoff): New.
979 (elf_xtensa_do_reloc): Handle TLS relocations.
980 (replace_tls_insn): New.
981 (IS_XTENSA_TLS_RELOC): Define.
982 (elf_xtensa_relocate_section): Handle TLS relocations.
983 (get_indirect_call_dest_reg): New.
984 (bfd_elf32_mkobject): Define.
985 (elf_backend_always_size_sections): New.
986 (elf_backend_copy_indirect_symbol): New.
987 * reloc.c (BFD_RELOC_XTENSA_TLSDESC_FN, BFD_RELOC_XTENSA_TLSDESC_ARG)
988 (BFD_RELOC_XTENSA_TLS_DTPOFF, BFD_RELOC_XTENSA_TLS_TPOFF)
989 (BFD_RELOC_XTENSA_TLS_FUNC, BFD_RELOC_XTENSA_TLS_ARG)
990 (BFD_RELOC_XTENSA_TLS_CALL): New.
991 * bfd-in2.h: Regenerate.
992 * libbfd.h: Regenerate.
993
994 2008-08-18 Richard Sandiford <rdsandiford@googlemail.com>
995
996 * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Copy MIPS16
997 stub information.
998
999 2008-08-17 Nick Clifton <nickc@redhat.com>
1000
1001 * elf32-arm.c: Tidy up the code.
1002 (bfd_elf32_arm_allocate_interworking_sections): Move common code
1003 into...
1004 (arm_allocate_glue_section_space): ... New function.
1005 (bfd_elf32_arm_add_glue_sections_to_bfd): Move common code
1006 into...
1007 (arm_make_glue_section): ... New function.
1008
1009 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Handle the situation
1010 where the sym_hashes are not available.
1011
1012 2008-08-17 Alan Modra <amodra@bigpond.net.au>
1013
1014 * bfd.c (struct _bfd): Correct outsymbols comment.
1015 * bfd-in2.h: Regenerate.
1016 * linker.c (bfd_generic_link_read_symbols): Renamed from..
1017 (generic_link_read_symbols): ..this, and made global.
1018
1019 2008-08-15 Alan Modra <amodra@bigpond.net.au>
1020
1021 PR 6526
1022 * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS.
1023 * Makefile.in: Regenerate.
1024 * aclocal.m4: Regenerate.
1025 * config.in: Regenerate.
1026 * configure: Regenerate.
1027
1028 2008-08-14 Jaka Močnik <jaka@xlab.si>
1029
1030 * coffgen.c (coff_find_nearest_line): Correct cached line index.
1031
1032 2008-08-12 Alan Modra <amodra@bigpond.net.au>
1033
1034 * elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs when
1035 !dynamic_sections_created. Don't make symbols with got
1036 references dynamic if !dynamic_sections_created.
1037 * elf64-ppc.c (allocate_dynrelocs): Likewise. Alloc dynamic
1038 relocs on undefined symbols.
1039 (ppc64_elf_relocate_section): Allow dynamic relocs on
1040 undefined symbols.
1041
1042 2008-08-11 Alan Modra <amodra@bigpond.net.au>
1043
1044 * elf64-ppc.c (toc_adjusting_stub_needed): Any call via the plt
1045 needs r2 valid, not just those to external syms.
1046
1047 2008-08-09 Pedro Alves <pedro@codesourcery.com>
1048
1049 * archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat
1050 st_mtime to long before comparison.
1051
1052 2008-08-08 Anatoly Sokolov <aesok@post.ru>
1053
1054 * archures.c (bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35,
1055 bfd_mach_avr51): New.
1056 * bfd-in2.h: Regenerate.
1057 * cpu-avr.c (arch_info_struct): Add avr25, avr31, avr35, and avr51
1058 architectures. Change comments to match architecture comments in GCC.
1059 (compatible): Add test for new AVR architectures.
1060 * elf32-avr.c (bfd_elf_avr_final_write_processing): Recognize
1061 bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35 and bfd_mach_avr51.
1062 (elf32_avr_object_p): Recognize E_AVR_MACH_AVR25, E_AVR_MACH_AVR31,
1063 E_AVR_MACH_AVR35 and E_AVR_MACH_AVR51.
1064
1065
1066 2008-08-08 Richard Sandiford <rdsandiford@googlemail.com>
1067 Daniel Jacobowitz <dan@codesourcery.com>
1068 Catherine Moore <clm@codesourcery.com>
1069 Mark Shinwell <shinwell@codesourcery.com>
1070 Maxim Kuvyrkov <maxim@codesourcery.com>
1071
1072 * elf32-mips.c (mips_vxworks_copy_howto_rela): Replace with...
1073 (elf_mips_copy_howto): ...this howto. Clear the size fields.
1074 (mips_vxworks_jump_slot_howto_rela): Replace with...
1075 (elf_mips_jump_slot_howto): ...this howto.
1076 (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
1077 and BFD_RELOC_MIPS_JUMP_SLOT.
1078 (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
1079 "R_MIPS_JUMP_SLOT".
1080 (mips_elf32_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT.
1081 (elf_backend_plt_readonly): Define.
1082 (elf_backend_plt_sym_val): Define for non-VxWorks targets.
1083 (mips_vxworks_bfd_reloc_type_lookup): Delete.
1084 (mips_vxworks_bfd_reloc_name_lookup): Likewise.
1085 (mips_vxworks_rtype_to_howto): Likewise.
1086 (elf_backend_want_dynbss): Don't define for VxWorks.
1087 (elf_backend_plt_readonly): Likewise.
1088 (bfd_elf32_bfd_reloc_type_lookup): Likewise.
1089 (bfd_elf32_bfd_reloc_name_lookup): Likewise.
1090 (elf_backend_mips_rtype_to_howto): Likewise.
1091 (elf_backend_adjust_dynamic_symbol): Likewise.
1092 (elf_backend_got_symbol_offset): Don't define.
1093 * elfn32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New.
1094 (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
1095 and BFD_RELOC_MIPS_JUMP_SLOT.
1096 (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
1097 "R_MIPS_JUMP_SLOT".
1098 (mips_elf32_n32_rtype_to_howto): Handle R_MIPS_COPY and
1099 R_MIPS_JUMP_SLOT.
1100 (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly)
1101 (elf_backend_plt_sym_val): Define.
1102 * elf64-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New.
1103 (bfd_elf64_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
1104 and BFD_RELOC_MIPS_JUMP_SLOT.
1105 (bfd_elf64_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
1106 "R_MIPS_JUMP_SLOT".
1107 (mips_elf64_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT.
1108 (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly)
1109 (elf_backend_plt_sym_val): Define.
1110 * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Delete.
1111 (_bfd_mips_elf_use_plts_and_copy_relocs, _bfd_mips_elf_init_stubs)
1112 (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): Declare.
1113 * elfxx-mips.c (mips_elf_la25_stub): New structure.
1114 (LA25_LUI, LA25_J, LA25_ADDIU): New macros.
1115 (mips_elf_link_hash_entry): Add "la25_stubs", "has_static_relocs"
1116 and "has_nonpic_branches" fields. Remove "is_relocation_target" and
1117 "is_branch_target".
1118 (mips_elf_link_hash_table): Add blank lines. Add
1119 "use_plts_and_copy_relocs", "reserved_gotno", "strampoline",
1120 "la25_stubs" and "add_stub_section" fields.
1121 (mips_htab_traverse_info): New structure.
1122 (PIC_OBJECT_P, MIPS_ELF_LOAD_WORD): New macros.
1123 (MIPS_RESERVED_GOTNO): Delete.
1124 (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry)
1125 (mips_n64_exec_plt0_entry, mips_exec_plt_entry): New tables.
1126 (mips_elf_link_hash_newfunc): Update after the changes to
1127 mips_elf_link_hash_entry.
1128 (mips_elf_check_mips16_stubs): Replace the DATA parameter with
1129 an INFO parameter. Don't look through warnings symbols here;
1130 do it in mips_elf_check_symbols instead.
1131 (mips_elf_create_stub_symbol): New function.
1132 (mips_elf_la25_stub_hash, mips_elf_la25_stub_eq): New functions.
1133 (_bfd_mips_elf_init_stubs, mips_elf_local_pic_function_p): Likewise.
1134 (mips_elf_add_la25_intro, mips_elf_add_la25_trampoline): Likewise.
1135 (mips_elf_add_la25_stub, mips_elf_check_symbols): New functions.
1136 (mips_elf_gotplt_index): Check for VxWorks.
1137 (mips_elf_output_dynamic_relocation): Take the relocation index
1138 as an extra parameter. Do not increment reloc_count here.
1139 (mips_elf_initialize_tls_slots): Update the calls to
1140 mips_elf_output_dynamic_relocation accordingly.
1141 (mips_elf_multi_got): Use htab->reserved_gotno instead of
1142 MIPS_RESERVED_GOTNO.
1143 (mips_elf_create_got_section): Don't allocate reserved GOT
1144 entries here. Unconditionally create .got.plt, but don't
1145 set its alignment here.
1146 (mips_elf_relocation_needs_la25_stub): New function.
1147 (mips_elf_calculate_relocation): Redirect branches and jumps to
1148 a non-PIC stub if one exists. Check !h->has_static_relocs instead
1149 of !htab->is_vxworks when deciding whether to create dynamic
1150 relocations for R_MIPS_32, R_MIPS_REL32 and R_MIPS_64.
1151 (_bfd_mips_elf_create_dynamic_sections): Unconditionally call
1152 _bfd_elf_create_dynamic_sections. Unconditionally set up
1153 htab->splt and htab->sdynbss. Set htab->srelplt to ".rel.plt"
1154 if !htab->is_vxworks. Add non-VxWorks values of
1155 htab->plt_header_size and htab->plt_entry_size.
1156 (_bfd_mips_elf_check_relocs): Set pointer_equality_needed for
1157 non-branch static relocations. Set has_nonpic_branches when an la25
1158 stub might be required. Set can_make_dynamic_p to TRUE if R_MIPS_32,
1159 R_MIPS_REL32 and R_MIPS_64 relocations can be made dynamic,
1160 rather than duplicating the condition. Do not make them dynamic
1161 for read-only sections in non-PIC executable objects.
1162 Do not protect this code with dynobj == NULL || htab->sgot == NULL;
1163 handle each group of cases separately. Add a default case that
1164 sets has_static_relocs for non-GOT relocations that cannot be
1165 made dynamic. Don't set is_relocation_target and is_branch_target.
1166 Reject non-PIC static relocations in shared objects.
1167 (_bfd_mips_vxworks_adjust_dynamic_symbol): Fold into...
1168 (_bfd_mips_elf_adjust_dynamic_symbol): ...here, using
1169 htab->use_plts_and_copy_relocs instead of htab->is_vxworks
1170 to select PLT and copy-reloc handling. Set the alignment of
1171 .plt and .got.plt when allocating the first entry. Generalize
1172 code to handle REL as well as RELA sections and 64-bit as well as
1173 32-bit GOT entries. Complain if we find a static-only reloc
1174 against an externally-defined symbol and if we cannot create
1175 dynamic relocations for it. Allocate copy relocs using
1176 mips_elf_allocate_dynamic_relocations on non-VxWorks targets.
1177 Set possibly_dynamic_relocs to 0 when using PLTs or copy relocs.
1178 Skip reserved .got.plt entries.
1179 (_bfd_mips_elf_always_size_sections): Use mips_elf_check_symbols
1180 instead of mips_elf_check_mips16_stubs to process each symbol.
1181 Do the traversal for relocatable objects too.
1182 (mips_elf_lay_out_got): Use htab->reserved_gotno instead of
1183 MIPS_RESERVED_GOTNO.
1184 (_bfd_mips_elf_size_dynamic_sections): Exclude sdynbss if it
1185 is empty. Extend the DT_PLTREL, DT_JMPREL and DT_PLTRELSZ handling
1186 to non-VxWorks targets. Only add DT_REL{,A}, DT_REL{,A}SZ and
1187 DT_REL{,A}ENT if .rel.dyn is nonempty. Create a symbol for the
1188 PLT. Allocate a nop at the end of the PLT. Allocate DT_MIPS_PLTGOT.
1189 (mips_elf_create_la25_stub_info): New function.
1190 (_bfd_mips_elf_finish_dynamic_symbol): Write out PLT entries
1191 and copy relocs where necessary. Check pointer_equality_needed.
1192 (mips_finish_exec_plt): New function.
1193 (_bfd_mips_elf_finish_dynamic_sections): Always set DT_PLTGOT
1194 to the beginning of htab->sgot. Use htab->reserved_gotno instead
1195 of MIPS_RESERVED_GOTNO. Assert htab->use_plts_and_copy_relocs
1196 instead of htab->is_vxworks for DT_PLTREL, DT_PLTRELSZ and DT_JMPREL.
1197 Set DT_PLTREL to DT_REL instead of DT_RELA on non-VxWorks targets.
1198 Use mips_finish_exec_plt to create non-VxWorks PLT headers. Set
1199 DT_MIPS_PLTGOT.
1200 (_bfd_mips_elf_copy_indirect_symbol): Copy has_static_relocs
1201 from the indirect symbol to the direct symbol. Also copy
1202 has_nonpic_branches for indirect symbols.
1203 (_bfd_mips_elf_get_target_dtag): Handle DT_MIPS_PLTGOT and
1204 DT_MIPS_RWPLT.
1205 (_bfd_mips_elf_link_hash_table_create): Initialize the new
1206 mips_elf_link_hash_table fields.
1207 (_bfd_mips_vxworks_link_hash_table_create): Set
1208 use_plts_and_copy_relocs to TRUE. Use TRUE rather than 1
1209 when setting is_vxworks.
1210 (_bfd_mips_elf_use_plts_and_copy_relocs): New function.
1211 (_bfd_mips_elf_final_link): Call mips_elf_create_la25_stub for
1212 each la25_stub.
1213 (_bfd_mips_elf_merge_private_bfd_data): Treat dynamic objects
1214 as PIC. Generalize message about linking PIC and non-PIC.
1215 (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): New
1216 functions.
1217 * reloc.c: Update comment near BFD_RELOC_MIPS_JUMP_SLOT.
1218 * bfd-in2.h: Regenerated.
1219
1220 2008-08-08 Alan Modra <amodra@bigpond.net.au>
1221
1222 * elf.c (bfd_elf_get_elf_syms): Don't leak memory on error.
1223 * elflink.c (_bfd_elf_link_read_relocs): bfd_release on error.
1224 (elf_link_add_object_symbols): Don't leak memory on error.
1225 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1226 (elf_fixup_link_order): Free sections.
1227
1228 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1229
1230 * elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field.
1231 * elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro.
1232 (elfNN_bed): Use it.
1233 * elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p
1234 instead of default_use_rela_p to choose between ".rel.plt" and
1235 ".rela.plt".
1236 * elflink.c (_bfd_elf_create_dynamic_sections): Use
1237 rela_plts_and_copies_p instead of default_use_rela_p to choose
1238 between ".rel.plt" and ".rela.plt", and between ".rel.bss" and
1239 ".rela.bss".
1240
1241 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1242
1243 * elf-bfd.h (MIPS_ELF_TDATA): New elf_object_id.
1244 * elf32-mips.c (bfd_elf32_mkobject): Define.
1245 * elf64-mips.c (bfd_elf64_mkobject): Likewise.
1246 * elfn32-mips.c (bfd_elf32_mkobject): Likewise.
1247 * elfxx-mips.h (_bfd_mips_elf_mkobject): Declare.
1248 * elfxx-mips.c (is_mips_elf): New macro.
1249 (_bfd_mips_elf_mkobject): New function.
1250 (_bfd_mips_elf_final_link): Use is_mips_elf.
1251 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1252
1253 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1254
1255 * elfxx-mips.c (mips_elf_record_relocs): Defer allocation of a
1256 global GOT entry when deferring allocation of dynamic relocations.
1257 (allocate_dynrelocs): When allocating deferred dynamic relocations,
1258 also do the deferred allocation of a GOT entry.
1259
1260 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1261
1262 * elfxx-mips.c (mips_got_info): Add a "reloc_only_gotno" field.
1263 (mips_elf_got_section): Delete.
1264 (mips_elf_sort_hash_table): Use g->reloc_only_gotno to decide
1265 how many reloc-only entries there are.
1266 (mips_elf_count_got_symbols): Adjust g->reloc_only_gotno as
1267 well as g->global_gotno.
1268 (mips_elf_make_got_per_bfd): Initialize reloc_only_gotno.
1269 (mips_elf_multi_got): Likewise. Use gg->reloc_only_gotno
1270 rather than gg->assigned_gotno to store the number of
1271 reloc-only GOT entries.
1272 (mips_elf_create_got_section): Remove the MAYBE_EXCLUDE parameter.
1273 Initialize reloc_only_gotno.
1274 (mips_elf_calculate_relocation): Check htab->got_info instead of
1275 dynobj when deciding whether to call mips_elf_adjust_gp,
1276 (_bfd_mips_elf_create_dynamic_sections): Adjust the call
1277 to mips_elf_create_got_section.
1278 (mips_elf_record_relocs): Likewise. Remove redundant
1279 "dynobj == NULL" code. Do not use mips_elf_create_got_section
1280 or mips_elf_record_global_got_symbol for R_MIPS_32, R_MIPS_REL32
1281 and R_MIPS_64; limit global_got_area to GGA_RELOC_ONLY instead.
1282 (_bfd_mips_elf_finish_dynamic_symbol): Use htab->sgot instead
1283 of mips_elf_got_section.
1284 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1285 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1286 Move the initial assignment of G to the block that uses it;
1287 it is used for an unrelated purpose later.
1288
1289 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1290
1291 * elfxx-mips.c (count_section_dynsyms): Move before the new first use.
1292 (mips_elf_sort_hash_table): Take the output bfd as a parameter.
1293 Remove the MAX_LOCAL parameter. Exit early if there are no
1294 dynamic symbols, if there is no dynobj, or if there is no
1295 GOT section. Use count_section_dynsyms instead of MAX_LOCAL.
1296 Assert == rather than <= when checking hsd.max_unref_got_dynindx.
1297 Also assert that g->global_gotno is right.
1298 (mips_elf_count_forced_local_got_symbols): Rename to...
1299 (mips_elf_count_got_symbols): ...and count global GOT entries too.
1300 Set the global_got_area of a forced-local GGA_RELOC_ONLY symbol
1301 to GGA_NONE.
1302 (mips_elf_multi_got): Don't sort the symbol table.
1303 (mips_elf_lay_out_got): Likewise. Use mips_elf_count_got_symbols
1304 to count the number of global GOT entries.
1305 (_bfd_mips_elf_final_link): Unconditionally call
1306 mips_elf_sort_hash_table.
1307
1308 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1309
1310 * elfxx-mips.c (GGA_NORMAL, GGA_RELOC_ONLY, GGA_NONE): New macros.
1311 (mips_elf_link_hash_entry): Add a "global_got_area" field.
1312 (mips_elf_link_hash_newfunc): Initialize it.
1313 (mips_elf_sort_hash_table_f): Use h->global_got_area instead of
1314 h->root.got.offset. Do not handle forced_local symbols specially.
1315 (mips_elf_record_global_got_symbol): Set h->global_got_area
1316 instead of h->root.got.offset.
1317 (mips_elf_recreate_got): Assert that h->global_got_area == GGA_NONE
1318 for indirect and warning symbols.
1319 (mips_elf_count_forced_local_got_symbols): Change the argument
1320 from a "elf_link_hash_entry" to "mips_elf_link_hash_entry".
1321 Use and set h->global_got_area instead of h->root.got.offset.
1322 Set it to GGA_NONE for all forced-local symbols.
1323 (mips_elf_set_global_got_offset): Set h->global_got_area
1324 instead of h->root.got.offset. Use g->global_got_area instead
1325 of a combination of dynindx, forced_local and tls_type.
1326 (mips_elf_multi_got): Remove disabled code. Pass GGA_* values to
1327 mips_elf_set_global_got_offset.
1328 (mips_elf_lay_out_got): Use mips_elf_link_hash_traverse instead
1329 of elf_link_hash_traverse.
1330 (_bfd_mips_elf_copy_indirect_symbol): Copy the indirect symbol's
1331 global_got_area to the direct symbol if the latter's value is higher.
1332 Set the indirect symbol's area to GGA_NONE.
1333
1334 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1335
1336 * elf32-mips.c (elf_backend_hide_symbol): Delete.
1337 * elfn32-mips.c (elf_backend_hide_symbol): Likewise.
1338 * elf64-mips.c (elf_backend_hide_symbol): Likewise.
1339 * elfxx-mips.h (elf_backend_hide_symbol): Likewise.
1340 * elfxx-mips.c (mips_elf_link_hash_entry): Remove "forced_local"
1341 and add "needs_lazy_stub".
1342 (mips_elf_link_hash_newfunc): Update accordingly.
1343 (mips_elf_link_hash_table): Remove "computed_got_sizes" and
1344 add "lazy_stub_count".
1345 (_bfd_mips_elf_link_hash_table_create): Update accordingly.
1346 (mips_elf_output_extsym): Use hd->needs_lazy_stub to detect
1347 cases where a lazy stub is being used.
1348 (mips_elf_sort_hash_table_f): Use h->root.forced_local instead
1349 of h->forced_local.
1350 (mips_elf_record_global_got_symbol): Use _bfd_elf_link_hash_hide_symbol
1351 instead of _bfd_mips_elf_hide_symbol. Do not increment local_gotno
1352 here.
1353 (mips_elf_allocate_dynamic_relocations): Move before new first use.
1354 (mips_elf_check_recreate_got, mips_elf_recreate_got): New functions.
1355 (mips_elf_resolve_final_got_entries): Move earlier in file. Make at
1356 most two passes over the hash table. Use mips_elf_check_recreate_got
1357 to see if there are any indirect or warning entries and
1358 mips_elf_recreate_got to create a new GOT without them.
1359 Return a boolean success value.
1360 (mips_elf_count_forced_local_got_entries): New function.
1361 (mips_elf_make_got_per_bfd): Check h->root.forced_local instead of
1362 h->forced_local.
1363 (mips_elf_set_global_got_offset): Likewise.
1364 (mips_elf_set_no_stub): Replace with...
1365 (mips_elf_forbid_lazy_stubs): ...this new function.
1366 (mips_elf_resolve_final_got_entry): Delete.
1367 (mips_elf_multi_got): Fix formatting. Use mips_elf_forbid_lazy_stubs
1368 instead of mips_elf_set_no_stub. Move the code that sets
1369 global offsets and allocates dynamic relocations from the main
1370 _bfd_mips_elf_size_dynamic_sections loop to here.
1371 (_bfd_mips_elf_adjust_dynamic_symbol): Do not allocate room in
1372 .MIPS.stubs here; just set hmips->needs_lazy_stub and increment
1373 htab->lazy_stub_count.
1374 (_bfd_mips_elf_always_size_sections): Move the stub-estimation
1375 code to mips_elf_estimate_stub_size and the GOT-sizing code to
1376 mips_elf_lay_out_got. Do not call these functions here.
1377 (mips_elf_estimate_stub_size): New function, split
1378 out from _bfd_mips_elf_always_size_sections. Call
1379 mips_elf_resolve_final_got_entries earlier. Count the number
1380 of forced-local entries. Do not add stub sizes to loadable_size;
1381 after this patch, the stub sizes are already included in the main
1382 estimate. Allocate dynamic relocations here rather than in the
1383 main _bfd_mips_elf_size_dynamic_sections loop.
1384 (mips_elf_estimate_stub_size): New function, split out from
1385 _bfd_mips_elf_always_size_sections.
1386 (mips_elf_allocate_lazy_stub): New function.
1387 (mips_elf_lay_out_lazy_stubs): Likewise.
1388 (_bfd_mips_elf_size_dynamic_sections): Call mips_elf_estimate_stub_size,
1389 mips_elf_lay_out_got and mips_elf_lay_out_lazy_stubs. Do not handle
1390 the allocation of sreldyn specially.
1391 (_bfd_mips_elf_hide_symbol): Delete.
1392
1393 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1394
1395 * elfxx-mips.c (allocate_dynrelocs): Ignore indirect and warning
1396 symbols.
1397
1398 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1399
1400 * elfxx-mips.c (mips_elf_link_hash_entry): Move bfd_boolean
1401 fields to the end of the structure and make them single-bit
1402 bitfields.
1403 (mips_elf_link_hash_newfunc): Make the initialization statements
1404 follow the new field order.
1405
1406 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1407
1408 * elfxx-mips.c (_mips_elf_section_data): Remove the "u.got_info" field.
1409 (mips_elf_link_hash_table): Add "sgot" and "got_info" fields.
1410 (_bfd_mips_elf_link_hash_table_create): Initialize them.
1411 (mips_elf_got_section): Always apply the !maybe_excluded behavior.
1412 (mips_elf_got_info): Delete.
1413 (mips_elf_initialize_tls_slots): Remove the DYNOBJ local variable.
1414 Adjust the call to mips_elf_got_section.
1415 (mips_elf_local_got_index): Don't call mips_elf_got_info.
1416 Update the call to mips_elf_create_local_got_entry.
1417 Use htab->got_info.
1418 (mips_elf_global_got_index): Don't call mips_elf_got_info;
1419 use htab->got_info and htab->sgot instead.
1420 (mips_elf_got_page): Don't call mips_elf_got_info. Update the
1421 call to mips_elf_create_local_got_entry.
1422 (mips_elf_got16_entry): Likewise.
1423 (mips_elf_got_offset_from_index): Replace with DYNOBJ parameter
1424 with an INFO parameter. Don't call mips_elf_got_info; use htab->sgot
1425 and htab->got_info instead.
1426 (mips_elf_create_local_got_entry): Remove the GG and SGOT parameters.
1427 Use htab->sgot and htab->got_info.
1428 (mips_elf_sort_hash_table): Remove the DYNOBJ local variable.
1429 Don't call mips_elf_got_info; use htab->got_info instead.
1430 (mips_elf_record_global_got_symbol): Turn G from a paramter to
1431 a local variable and read it from htab->got_info.
1432 (mips_elf_record_local_got_symbol): Replace the G parameter with
1433 an INFO parameter. Make G a local variable and read it from
1434 htab->got_info instead.
1435 (mips_elf_record_got_page_entry): Likewise.
1436 (mips_elf_multi_got): Remove the G parameter and make it a local
1437 variable instead. Read it from htab->got_info.
1438 (mips_elf_create_got_section): Cache the GOT section in htab->sgot.
1439 Store the GOT information in htab->got_info.
1440 (mips_elf_calculate_relocation): Don't call mips_elf_got_section
1441 and mips_elf_got_info; use htab->sgot and htab->got_info instead.
1442 Adjust the calls to mips_elf_got_offset_from_index and
1443 mips_elf_adjust_gp.
1444 (_bfd_mips_elf_check_relocs): Remove the G and SGOT local variables.
1445 Adjust the calls to mips_elf_record_local_got_symbol,
1446 mips_elf_record_global_got_symbol and mips_elf_record_got_page_entry.
1447 Use htab->sgot.
1448 (_bfd_mips_elf_always_size_sections): Remove the DYNOBJ local variable.
1449 Don't call mips_elf_got_info; use htab->sgot and htab->got_info instead.
1450 Update the call to mips_elf_multi_got.
1451 (_bfd_mips_elf_size_dynamic_sections): Don't call mips_elf_got_info;
1452 use htab->got_info instead.
1453 (_bfd_mips_elf_finish_dynamic_symbol): Update the call to
1454 mips_elf_got_section. Get the got_info from the hash table
1455 rather than the GOT section.
1456 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1457 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1458 (_bfd_mips_elf_hide_symbol): Don't call mips_elf_got_section;
1459 get the got_info from the hash table instead. Remove the GOT
1460 local variable.
1461 (_bfd_mips_elf_final_link): Likewise. Also remove the DYNOBJ
1462 local variable.
1463
1464 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1465
1466 * elfxx-mips.c (mips_elf_link_hash_table): Add an "sstubs" field.
1467 (_bfd_mips_elf_create_dynamic_sections): Use it to cache the stubs
1468 section. Don't check whether the section already exists.
1469 (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->sstubs.
1470 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1471 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1472 (_bfd_mips_elf_size_dynamic_sections): Likewise. Don't add the
1473 dummy stub to an empty section.
1474 (_bfd_mips_elf_link_hash_table_create): Initialize the "sstubs" field.
1475
1476 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1477
1478 * reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare.
1479 * libbfd.h, bfd-in2.h: Regenerate.
1480 * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
1481 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
1482 (mips16_reloc_map): Add mappings.
1483 * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved
1484 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
1485 (mips16_elf64_howto_table_rela): Likewise.
1486 (mips16_reloc_map): Add mappings.
1487 * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
1488 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
1489 (elf_mips16_howto_table_rela): Likewise.
1490 (mips16_reloc_map): Add mappings.
1491 * elfxx-mips.c (mips_elf_create_shadow_symbol): New function.
1492 (section_allows_mips16_refs_p): Likewise.
1493 (mips16_stub_symndx): Likewise.
1494 (mips_elf_check_mips16_stubs): Treat the data argument as a
1495 bfd_link_info. Mark every dynamic symbol as needing MIPS16 stubs
1496 and create a "shadow" symbol for the original MIPS16 definition.
1497 (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p)
1498 (lo16_reloc_p, mips16_call_reloc_p): New functions.
1499 (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize
1500 relocation checks.
1501 (_bfd_mips16_elf_reloc_shuffle): Likewise.
1502 (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16.
1503 (mips_elf_got16_entry): Add comment.
1504 (mips_elf_calculate_relocation): Use hi16_reloc_p,
1505 lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p
1506 to generalize relocation checks. Use section_allows_mips16_refs_p
1507 instead of mips16_stub_section_p. Handle R_MIPS16_CALL16 and
1508 R_MIPS16_GOT16, allowing the former to refer directly to a
1509 MIPS16 function if its stub is not needed.
1510 (mips16_stub_section_p): Delete.
1511 (_bfd_mips_elf_symbol_processing): Convert odd-valued function
1512 symbols into even MIPS16 symbols.
1513 (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize
1514 a relocation check.
1515 (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end"
1516 earlier in the function. Use mips16_stub_symndx to identify
1517 the target function. Avoid out-of-bounds accesses when the
1518 stub has no relocations; report an error instead. Use
1519 section_allows_mips16_refs_p instead of mips16_stub_section_p.
1520 Use mips16_call_reloc_p and got16_reloc_p to generalize relocation
1521 checks. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. Don't create
1522 dynamic relocations for absolute references to __gnu_local_gp.
1523 (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as
1524 the argument to mips_elf_check_mips16_stubs. Generalize comment.
1525 (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p
1526 to generalize relocation checks.
1527 (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function
1528 symbol has a non-MIPS16 stub, redirect the symbol to the stub.
1529 Fix an overly long line. Don't give dynamic symbols type STO_MIPS16.
1530 (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and
1531 R_MIPS16_GOT16.
1532
1533 2008-08-06 Alan Modra <amodra@bigpond.net.au>
1534
1535 * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend.
1536 (ppc_elf_relocate_section <R_PPC_RELAX32_PLT>): Don't bother here.
1537
1538 2008-08-05 Alan Modra <amodra@bigpond.net.au>
1539 Jaka Močnik <jaka@xlab.si>
1540
1541 * coffcode.h (coff_slurp_line_table): bfd_alloc lineno_cache first
1542 so that we don't inadvertently free it. Use bfd_alloc for sort
1543 arrays, and memcpy sorted line table.
1544
1545 2008-08-04 Alan Modra <amodra@bigpond.net.au>
1546
1547 * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
1548 if --fixed-space request is too large.
1549
1550 2008-08-04 Alan Modra <amodra@bigpond.net.au>
1551
1552 * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Set LC_ALL=C.
1553 * Makefile.in: Regenerate.
1554 * po/SRC-POTFILES.in: Regenerate.
1555
1556 2008-08-02 Alan Modra <amodra@bigpond.net.au>
1557
1558 * elf32-spu.c (mark_overlay_section): Move code calculating
1559 max_overlay_size to correct block.
1560 (spu_elf_auto_overlay): Don't use %x in einfo error message.
1561
1562 2008-08-01 Alan Modra <amodra@bigpond.net.au>
1563 Jan Kratochvil <jan.kratochvil@redhat.com>
1564
1565 * elfcore.h (elf_core_file_p): Ensure we have a backend match
1566 with the correct arch size before rejecting the generic fallback.
1567 * elfcode.h (elf_object_p): Likewise. Ensure arch size matches
1568 before accepting a target.
1569
1570 2008-08-01 Alan Modra <amodra@bigpond.net.au>
1571
1572 PR 6774
1573 * elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
1574 include file or program headers.
1575
1576 2008-07-30 Alan Modra <amodra@bigpond.net.au>
1577
1578 * coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c,
1579 elf32-iq2000.c, elf32-m32c.c, elf32-mep.c, elf32-mt.c,
1580 elf32-sh-symbian.c, elf64-hppa.c, mach-o.c, peXXigen.c, pef.c,
1581 ppcboot.c, vms-misc.c, xsym.c: Silence gcc warnings.
1582
1583 2008-07-28 Daniel Jacobowitz <dan@codesourcery.com>
1584
1585 * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating
1586 relocations for undefined weak symbols with non-default visibility.
1587 (_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for
1588 global symbols in shared libraries.
1589 (allocate_dynrelocs): New function.
1590 (_bfd_mips_elf_adjust_dynamic_symbol): Do not handle
1591 possibly_dynamic_relocs here.
1592 (_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs.
1593
1594 2008-07-28 Alexandre Oliva <aoliva@redhat.com>
1595
1596 * elf32-i386.c (struct elf_i386_link_hash_table): Added field
1597 tls_module_base.
1598 (elf_i386_link_hash_table_create): Initialize it.
1599 (elf_i386_always_size_sections): Set it.
1600 (set_tls_module_base): New.
1601 (elf_i386_relocate_sections): Call it.
1602 * elf64-x86-64.c (struct elf64_x86_64_link_hash_table): Added
1603 field tls_module_base.
1604 (elf64_x86_64_link_hash_table_create): Initialize it.
1605 (elf64_x86_64_always_size_sections): Set it.
1606 (set_tls_module_base): New.
1607 (elf64_x86_64_relocate_sections): Call it.
1608 Reported by Cary Coutant <ccoutant@google.com>
1609
1610 2008-07-28 Ineiev <ineiev@yahoo.co.uk>
1611
1612 * elf32-arm.c (arm_map_one_stub): Declare variables at beginning
1613 of block.
1614 * elf32-avr.c (get_local_syms): Likewise.
1615
1616 2008-07-28 Alan Modra <amodra@bigpond.net.au>
1617
1618 PR 6769
1619 * bfd-in.h (BFD_VMA_FMT): Define.
1620 (printf_vma, sprintf_vma): Use the above.
1621 (_bfd_int64_low, _bfd_int64_high): Delete.
1622 * bfd-in2.h: Regenerate.
1623
1624 2008-07-27 Alan Modra <amodra@bigpond.net.au>
1625
1626 * elf.c (_bfd_elf_make_section_from_shdr): Ignore return from
1627 elf_parse_notes. Use bfd_malloc_and_get_section.
1628 (elf_parse_notes): Validate note namesz and descsz.
1629
1630 2008-07-26 Michael Eager <eager@eagercon.com>
1631
1632 * elf32-ppc.c (ppc_elf_merge_obj_attributes): Check compatibility
1633 between single-float, double-float, and soft-float.
1634
1635 2008-07-24 Daniel Jacobowitz <dan@codesourcery.com>
1636
1637 * elf32-mips.c (elf_backend_write_section): Define.
1638
1639 2008-07-24 Nick Clifton <nickc@redhat.com>
1640
1641 * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one
1642 error assigning sections to segments.
1643
1644 2008-07-22 Nick Clifton <nickc@redhat.com>
1645
1646 * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in
1647 adjoining pages to be included in the same segment.
1648
1649 2008-07-22 Simon Baldwin <simonb@google.com>
1650
1651 * elflink.c (elf_link_output_extsym): Set st_size to zero for
1652 symbols from dynamic libraries.
1653
1654 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
1655
1656 PR ld/4424
1657 * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible
1658 to check if 2 inputs are compatible.
1659
1660 2008-07-21 Sterling Augustine <sterling@tensilica.com>
1661
1662 * elf.c (assign_file_positions_for_load_sections): Print vma in
1663 error message about overlapping section vmas.
1664
1665 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
1666
1667 PR ld/6747
1668 * elf32-frv.c (elf32_frv_relocate_section): Revert the change
1669 for PR ld/6446 checked in by accident on May 21, 2008.
1670
1671 2008-07-21 Nick Clifton <nickc@redhat.com>
1672
1673 * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non
1674 COFF_WITH_PE based SH ports.
1675 * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype.
1676 * arm-wince-pe.c (bfd_pe_print_pdata): Use
1677 _bfd_pe_print_ce_compressed_pdata.
1678 (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move
1679 to...
1680 * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to
1681 _bfd_XX_print_ce_compressed_pdata.
1682
1683 2008-07-21 Alan Modra <amodra@bigpond.net.au>
1684
1685 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
1686 unwanted zero terminators.
1687
1688 2008-07-21 Alan Modra <amodra@bigpond.net.au>
1689
1690 * elf32-spu.c (spu_elf_relocate_section): Expand
1691 RELOC_FOR_GLOBAL_SYMBOL. Don't warn about undefined symbols for
1692 R_SPU_PPU32 and R_SPU_PPU64 relocations.
1693
1694 2008-07-21 Luis Machado <luisgpm@br.ibm.com>
1695
1696 * elf-bfd.h: Declare elfcore_write_ppc_vsx.
1697 * elf.c (elfcore_grok_ppc_vsx): New function.
1698 (elfcore_write_ppc_vsx): New function
1699 (elfcore_grok_note): Handle VSX notes.
1700 (elfcore_write_register_note): Handle VSX notes.
1701
1702 2008-07-18 Joseph Myers <joseph@codesourcery.com>
1703
1704 * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
1705 * bfd-in2.h: Regenerate.
1706 * elf32-arm.c (struct elf_arm_obj_tdata): Add field
1707 no_wchar_size_warning.
1708 (bfd_elf32_arm_set_target_relocs): Add new parameter
1709 no_wchar_warn.
1710 (elf32_arm_merge_eabi_attributes): Give a warning, not an error,
1711 for conflicting wchar_t attributes. Do not warn if
1712 --no-wchar-size-warning. Make diagnostic text more specific.
1713
1714 2008-07-18 H.J. Lu <hongjiu.lu@intel.com>
1715
1716 PR ld/6748
1717 * elf32-arm.c (elf32_arm_link_hash_table_create): Initialize
1718 new fields added for ARM long call support.
1719
1720 2008-07-18 Danny Backx <dannybackx@users.sourceforge.net>
1721
1722 * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
1723 print compressed pdata structure as described on MSDN. This only
1724 applies to a limited set of architectures (ARM, SH4).
1725 (slurp_symtab, my_symbol_for_address): Define static helper
1726 functions for pe_print_compressed_pdata.
1727 * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
1728 (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
1729 * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
1730 bfd_coff_backend_data, call the function if non-null.
1731 * pei-mcore.c: Add target dependent initialisation for
1732 bfd_coff_backend_data.
1733 * coff-sh.c: Likewise.
1734 * coff64-rs6000.c: Likewise.
1735 * coff-rs6000.c: Likewise.
1736 * libcoff-in.h: Likewise.
1737 * cf-i386lynx.c: Likewise.
1738 * coff-alpha.c: Likewise.
1739 * coff-apollo.c: Likewise.
1740 * coff-arm.c: Likewise.
1741 * coff-aux.c: Likewise.
1742 * coff-h8300.c: Likewise.
1743 * coff-h8500.c: Likewise.
1744 * coff-i386.c: Likewise.
1745 * coff-i860.c: Likewise.
1746 * coff-i960.c: Likewise.
1747 * coff-ia64.c: Likewise.
1748 * coff-m68k.c: Likewise.
1749 * coff-m88k.c: Likewise.
1750 * coff-maxq.c: Likewise.
1751 * coff-mips.c: Likewise.
1752 * coff-or32.c: Likewise.
1753 * coff-sparc.c: Likewise.
1754 * coff-tic30.c: Likewise.
1755 * coff-tic4x.c: Likewise.
1756 * coff-tic54x.c: Likewise.
1757 * coff-tic80.c: Likewise.
1758 * coff-w65.c: Likewise.
1759 * coff-we32k.c: Likewise.
1760 * coff-x86_64.c: Likewise.
1761 * coff-z80.c: Likewise.
1762 * coff-z8k.c: Likewise.
1763 * pe-mcore.c: Likewise.
1764 * pe-mips.c: Likewise.
1765 * pe-ppc.c: Likewise.
1766 * peXXigen.c: Likewise.
1767 * pei-ppc.c: Likewise.
1768 * libcoff.h: Regenerate.
1769
1770 2008-07-16 Bernd Schmidt <bernd.schmidt@analog.com>
1771
1772 * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
1773 bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook,
1774 ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE,
1775 struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code
1776 separate from non-FD-PIC.
1777
1778 2008-07-14 DJ Delorie <dj@redhat.com>
1779
1780 * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow
1781 checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16
1782 relocs.
1783 (mn10300_elf_relax_section): Correct jump offset check when target
1784 is in a different section.
1785
1786 2008-07-15 Jie Zhang <jie.zhang@analog.com>
1787
1788 * elf32-bfin.c (elf32_bfin_special_sections[]): New.
1789 (elf_backend_special_sections): Define.
1790
1791 2008-07-13 Craig Silverstein <csilvers@google.com>
1792
1793 PR binutils/6743
1794 * dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory.
1795 (find_line): Use info_ptr_memory instead of sec_info_ptr.
1796 (_bfd_dwarf2_cleanup_debug_info): Likewise.
1797
1798 2008-07-12 Jie Zhang <jie.zhang@analog.com>
1799
1800 Revert
1801 2008-07-12 Jie Zhang <jie.zhang@analog.com>
1802 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
1803 executable sections into the same segment with other
1804 read only sections if --sep-code.
1805 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
1806 (elf32_bfin_data_in_l1): New variable.
1807 (elf32_bfin_final_write_processing): New.
1808 (elf32_bfin_special_sections[]): New.
1809 (elf_backend_final_write_processing): Define.
1810 (elf_backend_special_sections): Define.
1811
1812 2008-07-12 Jie Zhang <jie.zhang@analog.com>
1813
1814 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
1815 executable sections into the same segment with other
1816 read only sections if --sep-code.
1817 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
1818 (elf32_bfin_data_in_l1): New variable.
1819 (elf32_bfin_final_write_processing): New.
1820 (elf32_bfin_special_sections[]): New.
1821 (elf_backend_final_write_processing): Define.
1822 (elf_backend_special_sections): Define.
1823
1824 2008-07-11 Andreas Schwab <schwab@suse.de>
1825
1826 * dwarf2.c (read_section): Take pointer to bfd_size_type instead
1827 of unsigned long as last parameter.
1828 (struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size,
1829 dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of
1830 unsigned long.
1831
1832 2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
1833
1834 * elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0
1835 for all relocation types. Allow any type of relocation to refer to
1836 __gnu_local_gp.
1837
1838 2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
1839
1840 * elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16.
1841 (mips_elf_calculate_relocation): Likewise.
1842 (_bfd_mips_elf_add_symbol_hook): Likewise.
1843 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1844 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1845
1846 2008-07-10 Andreas Schwab <schwab@suse.de>
1847
1848 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Add missing
1849 paren.
1850
1851 2008-07-09 Craig Silverstein <csilvers@google.com>
1852
1853 * Makefile.am (BFD32_LIBS): Add compress.lo.
1854 (BFD32_LIBS_CFILES): Add compress.c.
1855 (BFD_H_FILES): Likewise.
1856 * Makefile.in: Regenerate.
1857 * bfd-in2.h: Regenerate.
1858 * config.in: Add HAVE_ZLIB_H
1859 * configure.in: Add test for libz and zlib.h
1860 * configure: Regenerate.
1861 * dwarf2.c (read_section): New function.
1862 (read_indirect_string): Call new function read_section.
1863 (read_abbrevs): Likewise.
1864 (decode_line_info): Likewise.
1865 (read_debug_ranges): Likewise.
1866 (find_line): Call new function read_section when just one
1867 .zdebug_info section is found, otherwise read and compress
1868 multiple sections.
1869 (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
1870 * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
1871 (special_sections_z): New struct.
1872 (special_sections): Refer to special_sections_z.
1873 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
1874 sections named .zdebug_*.
1875 (_bfd_mips_elf_fake_sections): Likewise.
1876 * compress.c: New file.
1877 (bfd_uncompress_section_contents): New function.
1878
1879 2008-07-07 Christophe Lyon <christophe.lyon@st.com>
1880
1881 * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in
1882 the presence of a PLT.
1883
1884 2008-07-07 Alan Modra <amodra@bigpond.net.au>
1885
1886 * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
1887
1888 2008-07-02 Alan Modra <amodra@bigpond.net.au>
1889
1890 * elf32-ppc.c (is_pic_glink_stub): New function.
1891 (ppc_elf_get_synthetic_symtab): Don't generate symbols when
1892 multiple shared/pie stubs per plt entry.
1893
1894 2008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
1895
1896 * elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
1897 bed->s->int_rels_per_ext_rel.
1898
1899 2008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
1900
1901 * syms.c (BSF_SYNTHETIC): New flag.
1902 * elf.c (_bfd_elf_get_synthetic_symtab): Set it.
1903 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
1904 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
1905 * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
1906 for synthetic symbols.
1907 * bfd-in2.h: Regenerate.
1908
1909 2008-06-30 Daniel Jacobowitz <dan@codesourcery.com>
1910
1911 * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
1912 Expand comments.
1913 (arm_map_one_stub): Use | 1 when setting the low bit.
1914
1915 2008-06-29 Andreas Schwab <schwab@suse.de>
1916
1917 * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
1918 addend on _GLOBAL_OFFSET_TABLE_.
1919
1920 2008-06-24 Daniel Jacobowitz <dan@codesourcery.com>
1921
1922 * elf32-arm.c (STUB_ENTRY_NAME): Define.
1923 (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
1924 (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
1925 R_ARM_ABS32.
1926 (struct elf32_arm_stub_hash_entry): Add output_name.
1927 (arm_build_one_stub): Move offsets into the offset argument
1928 of _bfd_final_link_relocate. Correct offset for
1929 arm_thumb_arm_v4t_stub_long_branch.
1930 (elf32_arm_size_stubs): Set stub_entry->output_name.
1931 (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
1932 Update all callers.
1933 (elf32_arm_output_stub_sym): New.
1934 (arm_map_one_stub): Correct formatting. Use elf32_arm_output_stub_sym.
1935
1936 2008-06-20 Alan Modra <amodra@bigpond.net.au>
1937
1938 * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
1939 non-branch insns.
1940
1941 2008-06-20 Alan Modra <amodra@bigpond.net.au>
1942
1943 * elf32-spu.c (build_stub): Allow wraparound on stub branches.
1944 (allocate_spuear_stubs, build_spuear_stubs): Return value from
1945 count_stub/build_stub.
1946 (spu_elf_build_stubs): Correct location of stub reloc error message.
1947
1948 2008-06-18 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
1949
1950 * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
1951
1952 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1953
1954 * configure: Regenerate.
1955
1956 2008-06-17 Alan Modra <amodra@bigpond.net.au>
1957
1958 * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
1959 (spu_elf_check_vma): Add extra_stack_space param, copy to htab.
1960 (spu_elf_auto_overlay): Use it.
1961 (RECURSE_UNMARK): Define as 0.
1962 (unmark_overlay_section): Heed RECURSE_UNMARK.
1963 * elf32-spu.h (spu_elf_check_vma): Update prototype.
1964
1965 2008-06-12 DJ Delorie <dj@redhat.com>
1966
1967 * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.
1968
1969 2008-06-09 Paul Brook <paul@codesourcery.com>
1970
1971 bfd/
1972 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
1973 libraries.
1974
1975 2008-06-09 Christophe Lyon <christophe.lyon@st.com>
1976
1977 * elf32-arm.c (arm_stub_is_thumb): Define.
1978 (elf32_arm_final_link_relocate): Handle near mode switching stubs.
1979
1980 2008-06-07 Alan Modra <amodra@bigpond.net.au>
1981
1982 * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
1983 to stack calculation.
1984
1985 2008-06-06 Paul Brook <paul@codesourcery.com>
1986
1987 bfd/
1988 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
1989
1990 2008-06-06 Alan Modra <amodra@bigpond.net.au>
1991
1992 * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
1993 file names be unique. Specify archive:path in overlay script.
1994
1995 2008-06-05 Alan Modra <amodra@bigpond.net.au>
1996
1997 PR ld/6590
1998 * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
1999
2000 2008-06-04 Alan Modra <amodra@bigpond.net.au>
2001
2002 * elf.c (ignore_section_sym): Don't test section sym value here.
2003 (elf_map_symbols): Instead check zero value here as was done prior
2004 to 2006-05-26 change.
2005
2006 2008-06-04 Nick Clifton <nickc@redhat.com>
2007
2008 PR ld/6019
2009 * elf32-avr.c (elf32_avr_relax_section): Handle the case where
2010 there are no local symbols.
2011
2012 2008-06-04 Alan Modra <amodra@bigpond.net.au>
2013
2014 * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
2015 (process_stubs): Likewise.
2016 (discover_functions): Don't used cached symbols.
2017 (maybe_insert_function): Correct condition under which function
2018 array is realloc'd.
2019 (mark_functions_via_relocs): Delete unused variable.
2020
2021 2008-05-30 Frediano Ziglio <frediano.ziglio@vodafone.com>
2022 Nick Clifton <nickc@redhat.com>
2023
2024 PR ld/6511
2025 * elf64-hppa.c (allocate_global_data_opd): Default to using the
2026 dynamic symbol table for local function names in shared libraries.
2027
2028 2008-05-29 Jan Kratochvil <jan.kratochvil@redhat.com>
2029
2030 * elf.c (assign_file_positions_for_load_sections): Adjust pre-section
2031 gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
2032
2033 2008-05-28 Alan Modra <amodra@bigpond.net.au>
2034
2035 * elf32-spu.c (spu_elf_object_p): New function.
2036 (elf_backend_object_p): Define.
2037 (build_stub): Correct second word of 8 byte overlay stubs.
2038 (spu_elf_relocate_section): Formatting.
2039
2040 2008-05-24 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
2041
2042 * elf.c (elfcore_write_register_note): New function.
2043 * elf-bfd.h (elfcore_write_register_note): New prototype.
2044
2045 2008-05-22 Christophe Lyon <christophe.lyon@st.com>
2046
2047 * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
2048 (elf32_arm_stub_add_mapping_symbol): Remove.
2049 (elf32_arm_add_stub): Don't generate mapping symbols. Change
2050 prototype.
2051 (elf32_arm_size_stubs): Use new elf32_arm_add_stub
2052 prototype. Don't generate thumb to arm glue for calls.
2053 (arm_map_one_stub): Define.
2054 (elf32_arm_output_arch_local_syms): Generate mapping symbols for
2055 long calls stubs.
2056
2057 2008-05-21 Nick Clifton <nickc@redhat.com>
2058
2059 * elf32-arm.c (group_sections): Reformat comments.
2060
2061 PR ld/6446
2062 * elf32-frv.c (elf32_frv_relocate_section): Set EF_FRV_PIC by
2063 default (for FDPIC). Clear it if any inter-segment relocations
2064 are found.
2065
2066 * elf64-hppa.c (elf64_hppa_finalize_opd): Check NULL return
2067 from elf_link_hash_lookup.
2068
2069 2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
2070
2071 Add multi-GOT support for m68k.
2072 * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
2073 glist): New fields.
2074 (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
2075 struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
2076 struct elf_m68k_multi_got): New data structures.
2077 (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
2078 allow_multigot_p, multi_got_): New fields.
2079 (elf_m68k_multi_got): New macro.
2080 (elf_m68k_link_hash_newfunc): Initialize new fields of
2081 struct elf_m68k_link_hash_entry.
2082 (elf_m68k_link_hash_table_create): Initialize new fields of
2083 struct elf_m68k_link_hash_table.
2084 (elf_m68k_link_hash_table_free): New static function implementing hook.
2085 (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
2086 static functions for struct elf_m68k_got.
2087 (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
2088 elf_m68k_got_entry_eq): New static functions for
2089 struct elf_m68k_got_entry.
2090 (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
2091 ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
2092 (enum elf_m68k_get_entry_howto): New enum.
2093 (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
2094 elf_m68k_remove_got_entry_type): New static functions for
2095 struct elf_m68k_got_entry.
2096 (elf_m68k_add_entry_to_got): New static function.
2097 (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
2098 elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
2099 functions for struct elf_m68k_bfd2got_entry.
2100 (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
2101 elf_m68k_can_merge_gots): New traversal.
2102 (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
2103 elf_m68k_merge_gots): Ditto.
2104 (struct elf_m68k_finalize_got_offsets_arg,
2105 elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
2106 (struct elf_m68k_partition_multi_got_arg,
2107 elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
2108 elf_m68k_partition_multi_got): Ditto.
2109 (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
2110 functions.
2111 (elf_m68k_copy_indirect_symbol): New static function implementing
2112 a hook.
2113 (elf_m68k_check_relocs): Update to add entries to multi-GOT.
2114 (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
2115 (elf_m68k_always_size_sections): Assign BFDs to GOTs.
2116 (elf_m68k_relocate_section): Update to properly handle GOT relocations.
2117 (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
2118 of a global symbol.
2119 (bfd_elf_m68k_set_target_options): New function.
2120 (bfd_elf32_bfd_link_hash_table_free): Define hook.
2121 (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
2122 to skip generic calculation of GOT offsets.
2123 (elf_backend_copy_indirect_symbol): Define hook.
2124 * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
2125 * bfd-in2.h: Regenerate.
2126
2127 2008-05-21 André Johansen <andrejoh@gmail.com>
2128
2129 PR 868
2130 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
2131 for filenames in function tables and variable tables.
2132
2133 2008-05-19 Alan Modra <amodra@bigpond.net.au>
2134
2135 PR 2995, PR 6473
2136 * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
2137 vma when all p_paddr fields are zero and there is more than
2138 one PT_LOAD header.
2139
2140 2008-05-15 Christophe Lyon <christophe.lyon@st.com>
2141
2142 Add long call support for ARM.
2143 * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
2144 (THM2_MAX_BWD_BRANCH_OFFSET): Define.
2145 (ARM_MAX_FWD_BRANCH_OFFSET): Define.
2146 (ARM_MAX_BWD_BRANCH_OFFSET): Define.
2147 (THM_MAX_FWD_BRANCH_OFFSET): Define.
2148 (THM_MAX_BWD_BRANCH_OFFSET): Define.
2149 (arm_long_branch_stub): Define.
2150 (arm_pic_long_branch_stub): Define.
2151 (arm_thumb_v4t_long_branch_stub): Define.
2152 (arm_thumb_thumb_long_branch_stub): Define.
2153 (arm_thumb_arm_v4t_long_branch_stub): Define.
2154 (STUB_SUFFIX): Define.
2155 (elf32_arm_stub_type): Define.
2156 (elf32_arm_stub_hash_entry): Define.
2157 (elf32_arm_link_hash_entry): Add stub_cache field.
2158 (arm_stub_hash_lookup): Define.
2159 (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
2160 add_stub_section, layout_sections_again, stub_group, bfd_count,
2161 top_index, input_list fields.
2162 (elf32_arm_link_hash_newfunc): Init new field.
2163 (stub_hash_newfunc): New function.
2164 (elf32_arm_link_hash_table_create): Init stub_hash_table.
2165 (elf32_arm_hash_table_free): New function.
2166 (arm_type_of_stub): New function.
2167 (elf32_arm_stub_name): New function.
2168 (elf32_arm_get_stub_entry): New function.
2169 (elf32_arm_stub_add_mapping_symbol): New function.
2170 (elf32_arm_add_stub): New function.
2171 (arm_build_one_stub): New function.
2172 (arm_size_one_stub): New function.
2173 (elf32_arm_setup_section_lists): New function.
2174 (elf32_arm_next_input_section): New function.
2175 (group_sections): New function.
2176 (elf32_arm_size_stubs): New function.
2177 (elf32_arm_build_stubs): New function.
2178 (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
2179 (bfd_elf32_arm_process_before_allocation): No longer handle
2180 R_ARM_CALL and R_ARM_THM_CALL.
2181 (using_thumb_only): New function.
2182 (elf32_arm_final_link_relocate): Redirect calls to stub if range
2183 exceeds encoding capabilities.
2184 (bfd_elf32_bfd_link_hash_table_free): Define.
2185 * bfd-in.h (R_ARM_max): Fix value to 130.
2186 (elf32_arm_setup_section_lists): Protype.
2187 (elf32_arm_next_input_section): Protype.
2188 (elf32_arm_size_stubs): Protype.
2189 (elf32_arm_build_stubs): Protype.
2190 * bfd-in2.h: Regenerate.
2191
2192 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
2193
2194 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
2195 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
2196
2197 2008-05-14 Alan Modra <amodra@bigpond.net.au>
2198
2199 * Makefile.am: Run "make dep-am".
2200 * Makefile.in: Regenerate.
2201
2202 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
2203 Alan Modra <amodra@bigpond.net.au>
2204
2205 * elf32-ppc.c (section_covers_vma): New function.
2206 (ppc_elf_get_synthetic_symtab): New function.
2207 (bfd_elf32_get_synthetic_symtab): Define.
2208 * elf64-ppc.c (section_covers_vma): New function.
2209 (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
2210 table entries, and __glink_PLTresolve on resolver stub.
2211 (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
2212
2213 2008-05-12 Alan Modra <amodra@bigpond.net.au>
2214
2215 PR 6443
2216 * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
2217 (must_be_dyn_reloc): New function.
2218 (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
2219 in pies.
2220 (ppc_elf_tls_optimize): Optimise pies.
2221 (ppc_elf_relocate_section): Use a section symbol rather than no
2222 symbol if possible for LD->IE TLS sequence, but don't error if
2223 we must use no symbol.
2224 * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
2225 (must_be_dyn_reloc): Likewise.
2226 (ppc64_elf_check_relocs): Likewise.
2227 (ppc64_elf_tls_optimize): Likewise.
2228 (ppc64_elf_relocate_section): Likewise.
2229
2230 2008-05-12 Alan Modra <amodra@bigpond.net.au>
2231
2232 * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.
2233
2234 2008-05-10 Paul Pluzhnikov <ppluzhnikov@google.com>
2235
2236 * elfcore.h (elf_core_file_p): Warn about core truncation.
2237
2238 2008-05-07 Bob Wilson <bob.wilson@acm.org>
2239
2240 * elf32-xtensa.c (xtensa_property_section_name): New.
2241 (xtensa_make_property_section): New.
2242 (xtensa_get_property_section): Make static. Do not create a new
2243 section if it does not exist.
2244
2245 2008-05-08 Alan Modra <amodra@bigpond.net.au>
2246
2247 * elf32-spu.c (spu_elf_special_sections): Add "._ea".
2248 (spu_elf_relocate_section): Handle relocations against symbols
2249 defined in ._ea specially.
2250
2251 2008-05-03 Daniel Jacobowitz <dan@codesourcery.com>
2252
2253 * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
2254 ARRAY_SIZE.
2255 (elf32_arm_symbian_plt_sym_val): New.
2256 (elf_backend_plt_sym_val): Define.
2257
2258 2008-05-03 Alan Modra <amodra@bigpond.net.au>
2259
2260 PR 2995, PR 6473
2261 * elf.c (rewrite_elf_program_header): Rather than clearing
2262 p_paddr_valid at end, don't set it in the first place. Delete
2263 comment no longer relevant. When not p_paddr_valid, don't set
2264 paddr from vaddr, and don't set p_vaddr_offset.
2265
2266 2008-05-01 Cary Coutant <ccoutant@google.com>
2267
2268 * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
2269 corrupt string table.
2270
2271 2008-05-01 Joel Brobecker <brobecker@adacore.com>
2272
2273 * cache.c (cache_bread_1): Renames cache_bread.
2274 (cache_bread): New function.
2275
2276 2008-05-01 Alan Modra <amodra@bigpond.net.au>
2277
2278 PR 2995, PR 6473
2279 * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
2280 (assign_file_positions_for_load_sections): Combine nested "if".
2281 (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
2282 when all header p_paddr fields are zero.
2283
2284 2008-04-30 Edmar Wienskoski <edmar@freescale.com>
2285
2286 * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry.
2287
2288 2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
2289
2290 * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
2291 (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
2292 even if they are not loaded.
2293 * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
2294 first.
2295
2296 2008-04-25 Jay Foad <jay.foad@gmail.com>
2297
2298 * reloc16.c (bfd_coff_reloc16_get_value): Add support for
2299 undefined weak symbols.
2300
2301 2008-04-25 Nick Clifton <nickc@redhat.com>
2302
2303 * po/vi.po: Updated Vietnamese translation.
2304
2305 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
2306
2307 * aclocal.m4: Regenerate.
2308 * configure: Regenerate.
2309
2310 2008-04-21 Cary Coutant <ccoutant@google.com>
2311
2312 * archive.c (_bfd_write_archive_contents): Fix incorrect use of
2313 ARFMAG.
2314
2315 2008-04-21 Nathan Sidwell <nathan@codesourcery.com>
2316
2317 * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
2318 set the value of undefined symbols in shared objects.
2319 (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
2320 undefined symbols unless pointer equality is needed.
2321
2322 2008-04-18 Dennis Roberts <dennis.roberts@sunquestinfo.com>
2323
2324 * aix5ppc-core.c: Define macros for the default architecture and
2325 machine for matching core files.
2326 (xcoff64_core_p): Set the architecture and machine to the default
2327 values defined in the macros mentioned above.
2328 * rs6000-core.c: Define macros to determine whether or not the
2329 core file header uses the core_dumpxx header format.
2330 (rs6000coff_core_p): Don't match core files that use the
2331 core_dumpxx header format.
2332
2333 2008-04-16 Pedro Alves <pedro@codesourcery.com>
2334
2335 * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add.
2336
2337 2008-04-16 David S. Miller <davem@davemloft.net>
2338
2339 * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
2340 BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2341 BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
2342 * libbfd.h: Regnerate.
2343 * bfd-in2.h: Regenerate.
2344 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
2345 GOTDATA relocations.
2346 (sparc_reloc_map): Likewise.
2347 (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
2348 R_SPARC_GOT*.
2349 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2350 (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
2351 R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
2352 R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
2353 Simply ignore R_SPARC_GOTDATA_OP relocations.
2354
2355 2008-04-14 Aurelien Jarno <aurelien@aurel32.net>
2356
2357 * configure.in: Link with the PIC version of libiberty on
2358 Linux/MIPS hosts.
2359 * configure: Regenerate.
2360
2361 2008-04-14 Edmar Wienskoski <edmar@freescale.com>
2362
2363 * archures.c: Add bfd_mach_ppc_e500mc.
2364 * bfd-in2.h: Regenerate.
2365
2366 2008-04-08 Alan Modra <amodra@bigpond.net.au>
2367
2368 * elf32-spu.c (spu_elf_build_stubs): Correct error message.
2369 (mark_functions_via_relocs): Remove premature init of symtab_hdr.
2370 (collect_overlays): Commment typo fix.
2371
2372 2008-04-08 Kees Cook <kees@canonical.com>
2373
2374 * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
2375 in EXEC_P bfds.
2376
2377 2008-04-08 Alan Modra <amodra@bigpond.net.au>
2378
2379 * elf32-spu.c: Include libiberty.h.
2380 (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
2381 non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
2382 spu_elf_relink, auto_overlay fields.
2383 (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
2384 (needs_ovl_stub): Flip test so that call to non-function warning
2385 is emitted during relocate_section rather than earlier.
2386 (spu_elf_check_vma): Stash --auto-overlay parameters, and clear
2387 auto_overlay if no section exceeds local store.
2388 (struct call_info): Add count, max_depth, is_pasted fields.
2389 (struct function_info): Add rodata, last_caller, call_count,
2390 depth, new visit flags.
2391 (insert_callee): Increment call count.
2392 (copy_callee): New function.
2393 (mark_functions_via_relocs): Investigate all reloc types to count
2394 possible function pointer stubs for --auto-overlay. Track
2395 last_caller and increment function call_count.
2396 (pasted_function): Insert a "call" into call info for pasted section.
2397 (remove_cycles): Track max depth of calls. Don't emit call graph
2398 pruning warning for --auto-overlay.
2399 (build_call_tree): Don't transfer_calls for --auto-overlay.
2400 Adjust remove_cycles call.
2401 (sort_calls, sort_lib, sort_bfds): New functions.
2402 (struct _mos_param, struct _uos_param, struct _cl_param): New.
2403 (mark_overlay_section, unmark_overlay_section): New functions.
2404 (collect_lib_sectios, auto_ovl_lib_functions): New functions.
2405 (collect_overlays, find_pasted_call): New functions.
2406 (sum_stack): Deal with is_pasted "calls". Exit before printing
2407 when --auto-overlay.
2408 (spu_elf_auto_overlay): New function.
2409 (spu_elf_final_link): Call spu_elf_auto_overlay.
2410 * elf32-spu.h (spu_elf_check_vma): Update prototype.
2411
2412 2008-04-07 Alan Modra <amodra@bigpond.net.au>
2413
2414 * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
2415 is defined in overlay section before creating a stub.
2416 (build_spuear_stubs): Likewise.
2417 (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
2418
2419 2008-04-02 Alan Modra <amodra@bigpond.net.au>
2420
2421 * elf32-spu.c (insert_callee): Reorder call list so most recent
2422 call is always first.
2423 (interesting_section): Move.
2424 (mark_functions_via_relocs): Fold interesting_section and
2425 reloc_count tests in callers to here. Simplify output section
2426 owner test.
2427 (discover_functions): Set "gaps" when no symbols and some
2428 "interesting_section". Run pasted_function loop for no symbol
2429 bfds.
2430 (for_each_node, transfer_calls): New functions.
2431 (mark_non_root): Adjust to suit for_each_node.
2432 (call_graph_traverse): Likewise. Fix memory leak. Rename to..
2433 (remove_cycles): ..this.
2434 (build_call_tree): Use for_each_node and transfer_calls.
2435 (struct _sum_stack_param): New.
2436 (sum_stack): Adjust to suit for_each_node. Return error on
2437 malloc failure. Move code to print root node cumulative stack from..
2438 (spu_elf_stack_analysis): ..here. Use for_each_node.
2439
2440 2008-03-31 Cary Coutant <ccoutant@google.com>
2441
2442 PR 6006
2443 * archive.c (_bfd_slurp_extended_name_table): Change
2444 ARFMAG[0] to ARFMAG[1].
2445 (_bfd_construct_extended_name_table): Likewise.
2446
2447 2008-03-31 Daniel Jacobowitz <dan@codesourcery.com>
2448
2449 * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
2450 (_bfd_mips_elf_check_relocs): Update comments. Always call
2451 mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
2452
2453 2008-03-27 Cary Coutant <ccoutant@google.com>
2454
2455 Add support for thin archives.
2456 * archive.c (_bfd_find_nested_archive): New function.
2457 (get_extended_arelt_filename): Add origin parameter.
2458 (_bfd_generic_read_ar_hdr_mag): Deal with extended name
2459 combined with a file offset.
2460 (append_relative_path): New function.
2461 (_bfd_get_elt_at_filepos): Deal with external members and
2462 nested archives.
2463 (bfd_generic_openr_next_archived_file): Thin archives.
2464 (bfd_generic_archive_p): Recognize new magic string.
2465 (adjust_relative_path): New function.
2466 (_bfd_construct_extended_name_table): Construct extended
2467 names for thin archive members.
2468 (_bfd_write_archive_contents): Emit new magic string, skip
2469 copying files for thin archives.
2470 * bfd-in.h (bfd_is_thin_archive): New macro.
2471 * bfd.c (struct bfd): New fields for thin archives.
2472 * libbfd-in.h (struct areltdata): New field for thin archives.
2473 * opncls.c (bfd_close): Delete BFDs for nested archives.
2474
2475 2008-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
2476
2477 * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
2478 _bfd_final_link_relocate that also handles R_pcrel24 relocs.
2479 (bfinfdpic_relocate_section, bfin_relocate_section): Use it.
2480
2481 2008-03-25 Nathan Sidwell <nathan@codesourcery.com>
2482
2483 * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
2484 in vxworks tls_vars sections.
2485 (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
2486 * elf32-i386.c (allocate_dynrelocs,
2487 elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
2488 * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
2489 ppc_elf_relocate_section): Likewise.
2490 * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
2491 sh_elf_relocate_section): Likewise.
2492 * elfxx-sparc.c (allocate_dynrelocs,
2493 _bfd_sparc_elf_size_dynamic_sections,
2494 _bfd_sparc_elf_relocate_section): Likewise.
2495
2496 2008-03-21 Adam Nemet <anemet@caviumnetworks.com>
2497
2498 * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
2499 print the values from the dynamic section.
2500
2501 2008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
2502
2503 * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
2504 (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
2505
2506 2008-03-20 Alan Modra <amodra@bigpond.net.au>
2507
2508 * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
2509 (spu_elf_find_overlays, spu_elf_size_stubs): Likewise
2510 (process_stubs, discover_functions, build_call_tree): Likewise.
2511 (spu_elf_stack_analysis): Likewise.
2512 (spu_elf_check_vma): Likewise. Move.
2513 (struct call_info): Make "is_tail" a bitfield.
2514 (insert_callee): Clear fun->start and set fun->is_func if we find
2515 a non-tail call.
2516 * elf32-spu.h (spu_elf_create_sections): Update prototype.
2517 (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
2518
2519 2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2520
2521 * aclocal.m4: Regenerate.
2522 * configure: Likewise.
2523 * Makefile.in: Likewise.
2524
2525 2008-03-16 H.J. Lu <hongjiu.lu@intel.com>
2526
2527 PR ld/5789
2528 PR ld/5943
2529 * elf32-i386.c (elf_i386_relocate_section): Issue an error
2530 for R_386_GOTOFF relocaton against undefined hidden/internal
2531 symbols when building a shared object.
2532
2533 * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
2534 error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
2535 relocaton against undefined hidden/internal symbols when
2536 building a shared object.
2537 (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
2538 is referenced locally, but isn't defined in a regular file.
2539
2540 2008-03-15 H.J. Lu <hongjiu.lu@intel.com>
2541
2542 * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO,
2543 HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED,
2544 BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY,
2545 HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ...
2546 * bfd.c: Here.
2547
2548 * bfd.c (bfd): Change cacheable, target_defaulted, opened_once,
2549 mtime_set, no_export, output_has_begun and has_armap to bit
2550 field.
2551
2552 * bfd-in2.h: Regenerated.
2553
2554 2008-03-14 Daniel Jacobowitz <dan@codesourcery.com>
2555
2556 * cache.c (close_one): Remove mtime hack.
2557
2558 2008-03-14 H.J. Lu <hongjiu.lu@intel.com>
2559
2560 PR ld/5913
2561 * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT.
2562 (elfNN_ia64_dtprel_base): Likewise.
2563 (elfNN_ia64_relocate_section): Go to missing_tls_sec if
2564 tls_sec is NULL before calling elfNN_ia64_tprel_base or
2565 elfNN_ia64_dtprel_base. Report unsupported TLS relocations.
2566
2567 2008-03-14 Alan Modra <amodra@bigpond.net.au>
2568
2569 * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move
2570 common code to..
2571 (maybe_needs_stub): ..here, a new function that also omits stubs
2572 for .eh_frame, and..
2573 (needs_ovl_stub): ..here. Create stubs for labels in code section
2574 referenced by switch jump table.
2575 (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return.
2576 (enum _insn_type): Delete.
2577 (enum _stub_type): New.
2578 (count_stub, build_stub): Adjust.
2579 (allocate_spuear_stubs, build_spuear_stubs): Adjust.
2580
2581 2008-03-13 Alan Modra <amodra@bigpond.net.au>
2582
2583 * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast.
2584 (_bfd_elf_assign_file_position_for_section): Simplify align.
2585 (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough
2586 for sh_addralign.
2587 (elf_fake_sections, swap_out_syms): Likewise.
2588 * elflink.c (bfd_elf_final_link): Likewise.
2589
2590 2008-03-13 Alan Modra <amodra@bigpond.net.au>
2591
2592 * Makefile.am: Run "make dep-am".
2593 * Makefile.in: Regenerate.
2594 * po/SRC-POTFILES.in: Regenerate.
2595
2596 2008-03-12 Bernd Schmidt <bernd.schmidt@analog.com>
2597
2598 From Jie Zhang <jie.zhang@analog.com>
2599 * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4,
2600 gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo,
2601 gotoff, call and sym not bitfields.
2602 (bfinfdpic_gc_sweep_hook): New function; update the relocation
2603 information for the relocations of the section being removed.
2604 (bfinfdpic_check_relocs): Accumulate the number of relocations
2605 which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4,
2606 fdgoffhilo, gotoff, call and sym fields.
2607 (elf_backend_gc_sweep_hook): Redefine for FD-PIC.
2608
2609 2008-03-12 Alan Modra <amodra@bigpond.net.au>
2610
2611 PR 5900
2612 * elf-bfd.h: Include elf/internal.h after elf/external.h.
2613 * elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
2614 (elf_swap_symbol_out): Adjust SHN_XINDEX test.
2615 (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
2616 seen in external structs.
2617 (valid_section_index_p): Delete.
2618 (elf_object_p): Don't increment section numbers over reserved range.
2619 Simplify test for valid sh_link, sh_info and e_shstrndx fields.
2620 (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
2621 seen in external structs. Don't increment section numbers over
2622 reserved range.
2623 * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
2624 (bfd_section_from_shdr): Likewise.
2625 (group_signature): Range check before accessing elf_elfsections.
2626 (_bfd_elf_setup_sections): Likewise.
2627 (bfd_section_from_shdr): Likewise.
2628 (bfd_section_from_shdr): Don't increment section number over
2629 reserved sections.
2630 (assign_file_positions_for_non_load_sections): Likewise.
2631 (assign_file_positions_except_relocs): Likewise.
2632 (_bfd_elf_write_object_contents): Likewise.
2633 (assign_section_numbers): Likewise. Adjust for changed SHN_*.
2634 (prep_headers): Delete unused variable.
2635 * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
2636 for changed SHN_* values.
2637 (check_dynsym, elf_link_input_bfd): Likewise.
2638 (bfd_elf_final_link): Likewise. Don't skip over reserved section
2639 range.
2640 (elf_fixup_link_order): Check that sh_link field is valid.
2641 * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
2642 * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
2643 accesssing elf_elfsections.
2644 * elf32-avr.c (elf32_avr_size_stubs): Likewise.
2645 * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
2646 * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
2647 * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
2648 SHN_* defines. Test for SHN_BAD return from
2649 _bfd_elf_section_from_bfd_section
2650
2651 2008-03-12 Alan Modra <amodra@bigpond.net.au>
2652
2653 * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
2654 * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int,
2655 SHN_BAD on error.
2656 (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from
2657 _bfd_elf_section_from_bfd_section, not -1.
2658 (swap_out_syms): Likewise.
2659 * elflink.c (elf_link_add_object_symbols): Likewise.
2660 (bfd_elf_get_bfd_needed_list): Likewise.
2661 (bfd_elf_match_symbols_in_sections): Likewise.
2662 (elf_link_add_object_symbols): Don't bother testing for symbols
2663 using normal sections before calling bfd_section_from_elf_index.
2664 (elf_link_input_bfd, bfd_elf_final_link): Likewise.
2665 (bfd_elf_reloc_symbol_deleted_p): Likewise.
2666 * elfcode.h (elf_slurp_symbol_table): Likewise.
2667 * elf32-spu.c (get_sym_h): Likewise.
2668 * elf32-xtensa.c (get_elf_r_symndx_section): Likewise.
2669 * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto.
2670 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
2671
2672 2008-03-11 Alan Modra <amodra@bigpond.net.au>
2673
2674 * elf32-spu.c (spu_elf_relocate_section): Test identical conditions
2675 to those in process_stubs for overlay symbols.
2676
2677 2008-03-09 Paul Brook <paul@codesourcery.com>
2678
2679 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
2680 Tag_VFP_arch values.
2681
2682 2008-03-08 Paul Brook <paul@codesourcery.com>
2683
2684 * elf32-arm.c (insert_thumb_branch): Rewrite.
2685 (elf32_thumb_to_arm_stub): Use new insert_thumb_branch.
2686
2687 2008-03-07 Paul Brook <paul@codesourcery.com>
2688
2689 * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and
2690 MOVT relocations.
2691 (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign
2692 extension.
2693 (elf32_arm_relocate_section): Handle MOVW and MOVT
2694 relocations. Improve safety check for other weird relocations.
2695 (elf32_arm_check_relocs): Only set h->needs_plt for branch/call
2696 relocations.
2697
2698 2008-03-03 Bob Wilson <bob.wilson@acm.org>
2699
2700 * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
2701 only compute its value once.
2702
2703 2008-03-03 Alan Modra <amodra@bigpond.net.au>
2704
2705 * elf32-spu.c (struct got_entry): Add "addend" field.
2706 (count_stub, build_stub): Use a new stub if relocation addend
2707 differs from existing stubs for this symbol.
2708 (process_stubs): Deal with addends.
2709 (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise.
2710
2711 2008-03-02 H.J. Lu <hongjiu.lu@intel.com>
2712
2713 PR ld/5789
2714 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true
2715 for hidden and local symbols.
2716
2717 2008-03-03 Alan Modra <amodra@bigpond.net.au>
2718
2719 * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
2720 undefined symbols with internal or hidden visibility.
2721 (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL
2722 rather than SYMBOL_REFERENCES_LOCAL on branches. Don't
2723 return immediately on dynamic reloc error.
2724
2725 2008-03-01 Alan Modra <amodra@bigpond.net.au>
2726
2727 * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
2728 if emitrelocations.
2729 (get_relocs): New function, split out from..
2730 (ppc_build_one_stub): ..here. Add relocs on plt_branch stubs if
2731 emitrelocations. Remove indx temp.
2732 (ppc_size_one_stub): Count new stub relocs.
2733 (ppc64_elf_size_stubs): Count new glink reloc.
2734 (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations.
2735 (ppc64_elf_finish_dynamic_sections): Output glink relocs.
2736 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic
2737 glink code.
2738
2739 2008-02-28 Alan Modra <amodra@bigpond.net.au>
2740
2741 * elf32-spu.c (mark_functions_via_relocs): Don't assume that
2742 the "->start" pointer reaches to function origin, so that we
2743 can handle functions split over more than two sections.
2744 (build_call_tree): Likewise.
2745 (pasted_function): Don't attempt to set fun->start back to the
2746 function origin, just go back one section.
2747
2748 2008-02-27 Catherine Moore <clm@codesourcery.com>
2749
2750 * elf.c ( _bfd_elf_print_private_bfd_data): Call
2751 elf_backend_get_target_dtag if defined.
2752 * elf32-mips.c (elf_backend_get_target_dtag): Define.
2753 * elf64-mips.c: Likewise.
2754 * elfn32-mips.c: Likewise.
2755 * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
2756 * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
2757 * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
2758 * elfxx-target.h (elf_backend_get_target_dtag): Add default.
2759 (elf_backend_data): Add elf_backend_get_target_dtag.
2760
2761 2008-02-26 Alan Modra <amodra@bigpond.net.au>
2762
2763 * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed
2764 for R_PPC_REL32 syms. Don't set non_got_ref on branch reloc syms,
2765 and assume branch relocs are not dynamic when non-shared.
2766 (readonly_dynrelocs): New function, split out from..
2767 (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs.
2768 (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries,
2769 clear non_got_ref..
2770 (allocate_dynrelocs): ..and don't set u.def for undefined weak.
2771 Do allow dynamic relocs on undefined symbols.
2772 (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
2773 (ppc_elf_relocate_section): Mirror dynamic reloc changes in
2774 check_relocs.
2775 (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak
2776 plt symbols needing pointer_equality_needed.
2777
2778 2008-02-23 Alan Modra <amodra@bigpond.net.au>
2779
2780 * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
2781
2782 2008-02-23 Alan Modra <amodra@bigpond.net.au>
2783
2784 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy
2785 pointer_equality_needed.
2786 (ppc_elf_check_relocs): Split out non-branch relocs from others
2787 that might emit dynamic relocs. Set pointer_equality_needed
2788 for their symbols. Don't set non_got_ref on branch reloc symbols.
2789 (ppc_elf_hash_symbol): New function.
2790 (elf_backend_hash_symbol): Define.
2791 (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed.
2792 Error if pointer_equality_needed on weak plt symbol.
2793
2794 2008-02-22 H.J. Lu <hongjiu.lu@intel.com>
2795
2796 PR ld/5788
2797 * elflink.c (elf_create_symbuf): Correct buffer size and
2798 position.
2799
2800 2008-02-22 Nick Clifton <nickc@redhat.com>
2801
2802 PR 868
2803 * dwarf2.c: Revert previous patch. All of the allocate memory is
2804 on an obstack which will be freed at some other time.
2805
2806 2008-02-20 Nick Clifton <nickc@redhat.com>
2807
2808 PR 868
2809 * libbfd.c (bfd_realloc_or_free): New function. Performs like
2810 bfd_realloc, but if the (re)allocation fails, the pointer is
2811 freed.
2812 * libbfd-in.h: Prototype.
2813 * libbfd.h: Regenerate.
2814 * bfdio.c (bfd_bwrite): Use the new function.
2815 (bfd_seek): Likewise.
2816 * bfdwin.c:(bfd_get_file_window): Likewise.
2817 * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
2818 * elf32-ppc.c (ppc_elf_relax_section): Likewise.
2819 * elf32-xtensa.c (vsprintf_msg): Likewise.
2820 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2821 * stabs.c (_bfd_link_seciton_stabs): Likewise.
2822 * vms-misc.c (_bfd_vms_get_record): Likewise.
2823 * vms-tir.c (check_section): Likewise.
2824 * vms.c (vms_new_section_hook): Likewise.
2825 * elf32-arm.c (elf32_arm_section_map_add): Check that the
2826 allocation of sec_data->map succeeded before using it.
2827 * elflink.c (elf_link_output_sym): Do not overwrite finfo->
2828 symshndxbuf until it is known that the reallocation succeeded.
2829
2830 2008-02-20 Diogo de Carvalho Kraemer <diogo@kraemer.eng.br>
2831 Nick Clifton <nickc@redhat.com>
2832
2833 PR 868
2834 * dwarf2.c (read_abbrevs): Free the abbreviation table if we run
2835 out of memory.
2836 (decode_line_info): Free the line_info_table before returning a
2837 failure result.
2838 (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
2839 Free the line table. Free the function table. Free the variable
2840 table.
2841
2842 2008-02-17 Mark Kettenis <kettenis@gnu.org>
2843
2844 * elf.c (swap_out_syms): Avoid preprocessing directive within
2845 macro arg.
2846
2847 2008-02-17 Jan Kratochvil <jan.kratochvil@redhat.com>
2848
2849 * elf.c (assign_file_positions_for_load_sections): Set the type of
2850 PT_NOTE sections to SHT_NOTE.
2851
2852 2008-02-17 Ulrich Weigand <uweigand@de.ibm.com>
2853
2854 * simple.c (bfd_simple_get_relocated_section_contents): Set
2855 link_info.output_bfd.
2856
2857 2008-02-16 Nathan Sidwell <nathan@codesourcery.com>
2858
2859 * dwarf2.c (find_line): Don't trust debug information after an
2860 unparseable compilation unit.
2861
2862 2008-02-15 Alan Modra <amodra@bigpond.net.au>
2863
2864 PR 5765
2865 * section.c (SEC_LINK_DUPLICATES): Correct. Renumber following flags.
2866 * bfd-in2.h: Regenerate.
2867
2868 2008-02-15 Alan Modra <amodra@bigpond.net.au>
2869
2870 * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA.
2871 * elf.c (bfd_elf_allocate_object): Don't check for already allocated
2872 tdata.
2873 * elf32-hppa.c (elf32_hppa_mkobject): New function.
2874 (bfd_elf32_mkobject): Define.
2875 * elf32-ppc.c (is_ppc_elf_target): Delete. Replace all uses with..
2876 (is_ppc_elf): ..this new macro.
2877 * elf64-ppc.c (is_ppc64_elf_target): Delete. Replace all uses with..
2878 (is_ppc64_elf): ..this new macro.
2879
2880 2008-02-15 Alan Modra <amodra@bigpond.net.au>
2881
2882 * elflink.c: Replace all accesses to hash->creator field with
2883 output_bfd->xvec.
2884 * cofflink.c: Likewise.
2885 * coff-h8300.c: Likewise.
2886 * ecoff.c: Likewise.
2887 * elf32-m68hc1x.c: Likewise.
2888 * elf32-ppc.c: Likewise.
2889 * elf64-alpha.c: Likewise.
2890 * elf64-ppc.c: Likewise.
2891 * elf64-sparc.c: Likewise.
2892 * elfxx-mips.c: Likewise.
2893 * i386linux.c: Likewise.
2894 * m68klinux.c: Likewise.
2895 * sparclinux.c: Likewise.
2896 * sunos.c: Likewise.
2897 * xcofflink.c: Likewise.
2898 * linker.c: Likewise.
2899 (_bfd_link_hash_table_init): Don't store creator.
2900
2901 2008-02-14 Peter Jones <pjones@redhat.com>
2902
2903 * efi-rtdrv-ia32.c: New file.
2904 * efi-bsdrv-ia32.c: New file.
2905 * efi-rtdrv-ia64.c: New file.
2906 * efi-bsdrv-ia64.c: New file.
2907 * efi-rtdrv-x86_64.c: New file.
2908 * efi-bsdrv-x86_64.c: New file.
2909 * peicode.h (pe_bfd_object_p): Add support for boot service and
2910 runtime service drivers.
2911 * libpei.h: Add macros for EFI formats, and rename the efi application
2912 format macros to disambiguate.
2913 * targets.c: Add bfd_target _vec externs.
2914 (_bfd_tar): Add EFI _vec entries.
2915 * config.bfd: Add EFI vectors into the selection routines.
2916 * configure.in: add EFI _vec entries.
2917 * configure: Regenerate.
2918 * Makefile.am: Add EFI files.
2919 * Makefile.in: Regenerate.
2920
2921 2008-02-14 Nathan Sidwell <nathan@codesourcery.com>
2922
2923 * dwarf1.c (struct dwarf1_debug): Add syms member.
2924 (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory.
2925 (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate
2926 section contents, check for out of memory.
2927
2928 * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte.
2929 (parse_die): Change data pointers to bfd_byte.
2930 (parse_line_table, parse_functions_in_unit): Likewise.
2931
2932 2008-02-14 Alan Modra <amodra@bigpond.net.au>
2933
2934 * elflink.c (compute_bucket_count): Warning fixes.
2935
2936 2008-02-12 DJ Delorie <dj@redhat.com>
2937
2938 * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of
2939 relocation pointing to local symbol in merged section.
2940
2941 * elf32-iq2000.c (iq2000_elf_relocate_offset16): New.
2942 (iq2000_elf_relocate_section): Call it.
2943
2944 2008-02-12 Nick Clifton <nickc@redhat.com>
2945
2946 PR ld/5692
2947 * elf-bfd.h (enum elf_object_id): New enum, used to identify
2948 target specific extensions to the elf_obj_tdata structure.
2949 (struct elf_obj_tdata): New field 'object_id'.
2950 (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
2951 macros for accessing fields in the elf_obj_tdata structure.
2952 (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
2953 (bfd_elf_allocate_object): New function.
2954 * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
2955 and implement by calling bfd_elf_allocate_object.
2956 (bfd_elf_allocate_object): New function: Allocates an
2957 elf_obj_tdata structure, possibly with a target specific
2958 extension.
2959 * elfxx-target.h (bfd_elfNN_mkobject): Use
2960 bfd_elf_make_generic_object as the default value.
2961 * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
2962 for consistency with other, similar structures.
2963 (is_arm_elf): New macro. Checks a BFD to make sure that is an ARM
2964 ELF bfd.
2965 (elf32_arm_mkobject): Call bfd_elf_allocate_object.
2966 (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
2967 the bfd being processed.
2968 (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2969 (bfd_elf32_arm_set_target_relocs): Likewise.
2970 (bfd_elf32_arm_final_link_relocate): Likewise.
2971 (bfd_elf32_arm_copy_private_bfd_data): Likewise.
2972 (bfd_elf32_arm_merge_eabi_attributes): Likewise.
2973 (bfd_elf32_arm_merge_private_bfd_data): Likewise.
2974 (bfd_elf32_arm_check_relocs): Likewise.
2975 (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
2976 (bfd_elf32_arm_size_dynamic_sections): Likewise.
2977 (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
2978 (bfd_elf32_arm_init_maps): Likewise.
2979 (bfd_elf32_arm_final_link_relocate): Likewise.
2980 (bfd_elf32_arm_relocate_section): Likewise.
2981 (bfd_elf32_arm_gc_sweep_hook): Likewise.
2982 (bfd_elf32_arm_check_relocs): Likewise.
2983 (bfd_elf32_arm_size_dynamic_sections): Likewise.
2984 * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
2985 (is_i386_elf): New macro. Checks a BFD to make sure that is an x86
2986 ELF bfd.
2987 (elf_i386_check_relocs): Use is_i386_elf macro to check the bfd
2988 being processed.
2989 (elf_i386_size_dynamic_sections): Likewise.
2990 (elf_i386_relocate_section): Likewise.
2991 (elf_i386_check_relocs): Use elf_symtab_hdr.
2992 (elf_i386_gc_sweep_hook): Likewise.
2993 (elf_i386_size_dynamic_sections): Likewise.
2994 (elf_i386_relocate_section): Likewise.
2995 * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
2996 (elf_create_pointer_linker_section): Use is_ppc_elf_target to
2997 verify that the bfd before accessing target specific fields.
2998 (ppc_elf_check_relocs): Likewise.
2999 (elf_finish_pointer_linker_section): Likewise.
3000 (elf_create_pointer_linker_section): Use elf_symtab_hdr.
3001 (ppc_elf_check_relocs): Likewise.
3002 (ppc_elf_gc_sweep_hook): Likewise.
3003 (ppc_elf_tls_optimize): Likewise.
3004 (ppc_elf_size_dynamic_sections): Likewise.
3005 (ppc_elf_relax_section): Likewise.
3006 (ppc_elf_relocate_section): Likewise.
3007 * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
3008 reminding programmers to keep this structure in sync with the one
3009 defined in elf64-s390.c.
3010 (elf_s390_mkobject): Call bfd_elf_allocate_object.
3011 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
3012 ELF bfd.
3013 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
3014 being processed.
3015 (elf_s390_size_dynamic_sections): Likewise.
3016 (elf_s390_relocate_section): Likewise.
3017 (elf_s390_check_relocs): Use elf_symtab_hdr.
3018 (elf_s390_gc_sweep_hook): Likewise.
3019 (elf_s390_size_dynamic_sections): Likewise.
3020 (elf_s390_relocate_section): Likewise.
3021 * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
3022 (is_sh_elf): New macro. Checks a BFD to make sure that is an SH
3023 ELF bfd.
3024 (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
3025 bfd being processed.
3026 (sh_elf_relocate_section): Likewise.
3027 (sh_elf_check_relocs): Likewise.
3028 (sh_elf_copy_private_data): Likewise.
3029 (sh_elf_relax_section): Use elf_symtab_hdr.
3030 (sh_elf_size_dynamic_sections): Likewise.
3031 (sh_elf_relocate_section): Likewise.
3032 (sh_elf_get_relocated_section_contents): Likewise.
3033 (sh_elf_gc_sweep_hook): Likewise.
3034 (sh_elf_check_relocs): Likewise.
3035 * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
3036 (is_alpha_elf): New macro. Checks a BFD to make sure that is an
3037 Alpha ELF bfd.
3038 (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
3039 the bfd being processed.
3040 (elf64_alpha_create_dynamic_section): Likewise.
3041 (elf64_alpha_check_relocs): Likewise.
3042 (elf64_alpha_size_got_sections): Likewise.
3043 (elf64_alpha_relax_section): Likewise.
3044 (elf64_alpha_relocate_section): Likewise.
3045 (elf64_alpha_final_link): Likewise.
3046 (elf64_alpha_check_relocs): Use elf_symtab_hdr.
3047 (elf64_alpha_relax_section): Likewise.
3048 (elf64_alpha_relocate_section_r): Likewise.
3049 (elf64_alpha_relocate_section): Likewise.
3050 * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
3051 (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
3052 being processed.
3053 (opd_entry_value): Likewise.
3054 (allocate_dynrelocs): Likewise.
3055 (ppc64_elf_relocate_section): Likewise.
3056 (ppc64_elf_check_relocs): Use elf_symtab_hdr.
3057 (opd_entry_value): Likewise.
3058 (ppc64_elf_gc_sweep_hook): Likewise.
3059 (get_sym_h): Likewise.
3060 (ppc64_elf_edit_opd): Likewise.
3061 (ppc64_elf_tls_optimize): Likewise.
3062 (ppc64_elf_edit_toc): Likewise.
3063 (ppc64_elf_size_dynamic_sections): Likewise.
3064 (toc_adjusting_stub_needed): Likewise.
3065 (ppc64_elf_size_stubs): Likewise.
3066 (ppc64_elf_relocate_section): Likewise.
3067 * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
3068 reminding programmers to keep this structure in sync with the one
3069 defined in elf32-s390.c.
3070 (elf_s390_mkobject): Call bfd_elf_allocate_object.
3071 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
3072 ELF bfd.
3073 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
3074 being processed.
3075 (elf_s390_size_dynamic_sections): Likewise.
3076 (elf_s390_relocate_section): Likewise.
3077 (elf_s390_check_relocs): Use elf_symtab_hdr.
3078 (elf_s390_gc_sweep_hook): Likewise.
3079 (elf_s390_size_dynamic_sections): Likewise.
3080 (elf_s390_relocate_section): Likewise.
3081 * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
3082 (is_x86_64_elf): New macro. Checks a BFD to make sure that is an
3083 x86_64 ELF bfd.
3084 (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
3085 being processed.
3086 (elf64_x86_64_size_dynamic_sections): Likewise.
3087 (elf64_x86_64_relocate_section): Likewise.
3088 (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
3089 (elf64_x86_64_gc_sweep_hook): Likewise.
3090 (elf64_x86_64_size_dynamic_sections): Likewise.
3091 (elf64_x86_64_relocate_section): Likewise.
3092 * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
3093 (is_sparc_elf): New macro. Checks a BFD to make sure that is a Sparc
3094 ELF bfd.
3095 (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
3096 bfd being processed.
3097 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
3098 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
3099 (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
3100 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
3101 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
3102 (_bfd_sparc_elf_relocate_section): Likewise.
3103
3104 2008-02-12 Alan Modra <amodra@bigpond.net.au>
3105
3106 PR 5303, 5755
3107 * arange-set.c: Delete.
3108 * arange-set.h: Delete.
3109 * dwarf2.c: Revert 2007-09-21 changes.
3110 * Makefile.am: Likewise.
3111 * Makefile.in: Regenerate.
3112 * po/SRC-POTFILES.in: Regenerate.
3113
3114 2008-02-11 Bernd Schmidt <bernd.schmidt@analog.com>
3115
3116 * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
3117 if necessary.
3118 (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
3119 mismatches are detected.
3120
3121 * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
3122 emit invalid relocs or rofixup entries for deleted .eh_frame entries.
3123
3124 2008-02-11 Daniel Jacobowitz <dan@codesourcery.com>
3125
3126 * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
3127 was reached.
3128 * srec.c (srec_scan): Calculate the checksum. Complain on mismatch.
3129
3130 2008-02-07 Alan Modra <amodra@bigpond.net.au>
3131
3132 * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
3133 of _ovly_buf_table size.
3134 (spu_elf_build_stubs): Use low bit of .size as "present" bit.
3135 Adjust initialisations relating to _ovly_buf_table.
3136
3137 2008-02-04 Bob Wilson <bob.wilson@acm.org>
3138
3139 * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
3140 relocation, do not continue processing it. Ignore R_XTENSA_ASM_EXPAND
3141 relocations against dynamic symbols.
3142 (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
3143 .xt.lit section.
3144
3145 2008-02-04 Kai Tietz <kai.tietz@onevision.com>
3146 H.J. Lu <hongjiu.lu@intel.com>
3147
3148 PR 5715
3149 * warning.m4: Enable -Wno-format by default when using gcc on
3150 mingw.
3151 * configure: Regenerated.
3152
3153 2008-02-04 Adam Nemet <anemet@caviumnetworks.com>
3154
3155 * archures.c: Update copyright.
3156 (bfd_mach_mips_octeon): New macro.
3157 * bfd-in2.h: Regenerate.
3158 * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
3159 (mips_set_isa_flags): Likewise.
3160 (mips_mach_extensions): Add Octeon.
3161 * cpu-mips.c: Update copyright.
3162 (I_mipsocteon): New enum constant.
3163 (arch_info_struct): Add Octeon.
3164
3165 2008-02-04 Alan Modra <amodra@bigpond.net.au>
3166
3167 * elf32-spu.c (spu_elf_relocate_section): Correct return type.
3168 Return error status on unexpected relocation errors.
3169
3170 2008-02-04 Alan Modra <amodra@bigpond.net.au>
3171
3172 PR ld/5692
3173 * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31. Instead abort
3174 on non-ELF input.
3175 * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
3176 processing on non-ELF input.
3177
3178 2008-01-31 Marc Gauthier <marc@tensilica.com>
3179
3180 * config.bfd (xtensa*-*-*): Recognize processor variants.
3181
3182 2008-01-31 Nick Clifton <nickc@redhat.com>
3183
3184 PR ld/5692
3185 * elf.c (bfd_elf_get_elf_syms): Check the return value of
3186 get_elf_backend_data.
3187
3188 2008-01-28 Fabian Groffen <grobian@gentoo.org>
3189
3190 * config.bfd (x86_64-*-solaris2): Add support for this target.
3191
3192 2008-01-28 Alan Modra <amodra@bigpond.net.au>
3193
3194 Rewrite SPU overlay handling code. Put overlay calls stubs in the
3195 overlays where possible. Use a faster call stub, or optionally at
3196 compile time, a more compact stub. Double size of _ovly_buf_table
3197 so that low bit of _ovly_table.buf can be used as a "present" bit.
3198 Reserve an extra _ovly_table entry for index zero.
3199 * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
3200 add new ones.
3201 (struct got_entry): New.
3202 (struct spu_stub_hash_entry): Delete.
3203 (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
3204 (spu_elf_link_hash_table_create): Adjust for struct changes.
3205 (spu_stub_name): Delete.
3206 (spu_elf_find_overlays): Don't track sections from overlay regions.
3207 Instead set ovl_buf number in spu elf section data. Error if
3208 overlays in one region don't start at the same address. Adjust
3209 for struct _spu_elf_section_data changes.
3210 (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
3211 (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
3212 (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
3213 (enum _insn_type): New.
3214 (count_stub, build_stub): New functions.
3215 (allocate_spuear_stubs): Use count_stub.
3216 (build_spuear_stubs): Use build_stub.
3217 (populate_stubs, sort_stubs): Delete.
3218 (process_stubs): New function.
3219 (write_one_stub): Delete.
3220 (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
3221 (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
3222 (maybe_insert_function, check_function_ranges): Likewise.
3223 (find_function, pasted_function, build_call_tree): Likewise.
3224 (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
3225 (spu_elf_modify_program_headers): Likewise.
3226 (interesting_section): Detect stub sections differently. Delete
3227 htab param, adjust all callers.
3228 (spu_elf_relocate_section): Rewrite stub handling.
3229 (spu_elf_output_symbol_hook): Likewise.
3230 (bfd_elf32_bfd_link_hash_table_free): Delete.
3231 * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
3232 output-only fields into a union. Add ovl_buf.
3233 (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
3234
3235 2008-01-25 DJ Delorie <dj@redhat.com>
3236
3237 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
3238
3239 2008-01-25 Kai Tietz <kai.tietz@onevision.com>
3240
3241 * bfd-in.h: Add mingw I64 support.
3242 * bfd-in2.h: Regenerated.
3243 * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
3244
3245 2008-01-21 Alan Modra <amodra@bigpond.net.au>
3246
3247 PR 4453
3248 * format.c (bfd_check_format_matches): Don't accept archives as
3249 fully matching unless they have a map.
3250
3251 2008-01-21 Alan Modra <amodra@bigpond.net.au>
3252
3253 * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
3254
3255 2008-01-21 Alan Modra <amodra@bigpond.net.au>
3256
3257 * ecoff.c (_bfd_ecoff_archive_p): Delete.
3258 * libecoff.h (_bfd_ecoff_archive_p): Delete.
3259 * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
3260 * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
3261 (ecoff_biglittle_vec): Likewise.
3262
3263 2008-01-19 Alan Modra <amodra@bigpond.net.au>
3264
3265 PR 5646
3266 * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
3267 non-NULL before dereferencing.
3268
3269 2008-01-15 Alan Modra <amodra@bigpond.net.au>
3270
3271 PR 5604
3272 * elf-bfd.h (struct elf_backend_data): Add gc_keep. Remove param
3273 names from others.
3274 (_bfd_elf_gc_keep): Declare.
3275 * elfxx-target.h (elf_backend_gc_keep): Define.
3276 (elfNN_bed): Init new field.
3277 * elflink.c (_bfd_elf_gc_keep): New function.
3278 (bfd_elf_gc_sections): Call gc_keep.
3279 * elf64-ppc.c (elf_backend_gc_keep): Define.
3280 (struct _ppc64_elf_section_data): Move .opd related fields to
3281 a struct so they don't occupy the same storage. Adjust accesses
3282 throughout file.
3283 (ppc64_elf_gc_keep): New function, split out from..
3284 (ppc64_elf_gc_mark_hook): ..here. Don't call _bfd_elf_gc_mark
3285 to mark .opd section, just set gc_mark.
3286 (ppc64_elf_edit_opd): Remove no_opd_opt parm. Don't set opd->adjust
3287 unless we are changing .opd. Test non-NULL opd->adjust at all
3288 accesses throughout file.
3289 * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
3290
3291 2008-01-15 Alan Modra <amodra@bigpond.net.au>
3292
3293 * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
3294 * bfd-in2.h: Regenerate.
3295
3296 2008-01-11 Tristan Gingold <gingold@adacore.com>
3297 Eric Botcazou <ebotcazou@adacore.com>
3298
3299 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
3300 relocatable.
3301 * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
3302 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
3303 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
3304 * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
3305 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
3306 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
3307 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
3308 * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
3309 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
3310 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
3311 * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
3312 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
3313 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
3314 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
3315 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
3316 * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
3317 or executable output with relocations.
3318
3319 2008-01-09 Nick Clifton <nickc@redhat.com>
3320
3321 PR gas/5552
3322 * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
3323 to FALSE for all relocs.
3324
3325 2008-01-09 Richard Sandiford <rsandifo@nildram.co.uk>
3326
3327 PR ld/5526
3328 * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
3329 fields. Rename u.cie.u.merged to u.cie.u.merged_with.
3330 (eh_frame_sec_info): Add a cies field.
3331 (eh_frame_hdr_info): Add a merge_cies field.
3332 * elf-eh-frame.c (cie): Add a reloc_index member to the personality
3333 union.
3334 (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
3335 of hdr_info->cies.
3336 (_bfd_elf_parse_eh_frame): Remove tmp_cie. Ccreate an array of
3337 cie structures in all cases and use it instead of extended_cies.
3338 If merging, store the cie array in sec_info->cies and point each
3339 CIE's eh_fde_cie at the associated element. Do not try to
3340 calculate the value of the personality routine here; record the
3341 offset of the relocation instead. Do not merge CIEs here.
3342 (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
3343 (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
3344 (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
3345 (find_merged_cie): New function.
3346 (_bfd_elf_gc_mark_fdes): Use it. Free sec_info->cies.
3347
3348 2008-01-07 Nick Clifton <nickc@redhat.com>
3349
3350 PR binutils/5535
3351 * vms.c (vms_close_and_cleanup): Check for the presence of a
3352 vms_private_data_struct before examining any of its fields.
3353
3354 2008-01-07 H.J. Lu <hongjiu.lu@intel.com>
3355
3356 PR ld/5522
3357 * elflink.c (elf_link_input_bfd): Don't write out a section if
3358 its output section is marked with SEC_NEVER_LOAD.
3359
3360 For older changes see ChangeLog-2007
3361 \f
3362 Local Variables:
3363 mode: change-log
3364 left-margin: 8
3365 fill-column: 74
3366 version-control: never
3367 End: