bfd/
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
2
3 * reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare.
4 * libbfd.h, bfd-in2.h: Regenerate.
5 * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
6 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
7 (mips16_reloc_map): Add mappings.
8 * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved
9 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
10 (mips16_elf64_howto_table_rela): Likewise.
11 (mips16_reloc_map): Add mappings.
12 * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
13 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
14 (elf_mips16_howto_table_rela): Likewise.
15 (mips16_reloc_map): Add mappings.
16 * elfxx-mips.c (mips_elf_create_shadow_symbol): New function.
17 (section_allows_mips16_refs_p): Likewise.
18 (mips16_stub_symndx): Likewise.
19 (mips_elf_check_mips16_stubs): Treat the data argument as a
20 bfd_link_info. Mark every dynamic symbol as needing MIPS16 stubs
21 and create a "shadow" symbol for the original MIPS16 definition.
22 (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p)
23 (lo16_reloc_p, mips16_call_reloc_p): New functions.
24 (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize
25 relocation checks.
26 (_bfd_mips16_elf_reloc_shuffle): Likewise.
27 (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16.
28 (mips_elf_got16_entry): Add comment.
29 (mips_elf_calculate_relocation): Use hi16_reloc_p,
30 lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p
31 to generalize relocation checks. Use section_allows_mips16_refs_p
32 instead of mips16_stub_section_p. Handle R_MIPS16_CALL16 and
33 R_MIPS16_GOT16, allowing the former to refer directly to a
34 MIPS16 function if its stub is not needed.
35 (mips16_stub_section_p): Delete.
36 (_bfd_mips_elf_symbol_processing): Convert odd-valued function
37 symbols into even MIPS16 symbols.
38 (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize
39 a relocation check.
40 (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end"
41 earlier in the function. Use mips16_stub_symndx to identify
42 the target function. Avoid out-of-bounds accesses when the
43 stub has no relocations; report an error instead. Use
44 section_allows_mips16_refs_p instead of mips16_stub_section_p.
45 Use mips16_call_reloc_p and got16_reloc_p to generalize relocation
46 checks. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. Don't create
47 dynamic relocations for absolute references to __gnu_local_gp.
48 (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as
49 the argument to mips_elf_check_mips16_stubs. Generalize comment.
50 (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p
51 to generalize relocation checks.
52 (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function
53 symbol has a non-MIPS16 stub, redirect the symbol to the stub.
54 Fix an overly long line. Don't give dynamic symbols type STO_MIPS16.
55 (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and
56 R_MIPS16_GOT16.
57
58 2008-08-06 Alan Modra <amodra@bigpond.net.au>
59
60 * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend.
61 (ppc_elf_relocate_section <R_PPC_RELAX32_PLT>): Don't bother here.
62
63 2008-08-05 Alan Modra <amodra@bigpond.net.au>
64 Jaka Močnik <jaka@xlab.si>
65
66 * coffcode.h (coff_slurp_line_table): bfd_alloc lineno_cache first
67 so that we don't inadvertently free it. Use bfd_alloc for sort
68 arrays, and memcpy sorted line table.
69
70 2008-08-04 Alan Modra <amodra@bigpond.net.au>
71
72 * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
73 if --fixed-space request is too large.
74
75 2008-08-04 Alan Modra <amodra@bigpond.net.au>
76
77 * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Set LC_ALL=C.
78 * Makefile.in: Regenerate.
79 * po/SRC-POTFILES.in: Regenerate.
80
81 2008-08-02 Alan Modra <amodra@bigpond.net.au>
82
83 * elf32-spu.c (mark_overlay_section): Move code calculating
84 max_overlay_size to correct block.
85 (spu_elf_auto_overlay): Don't use %x in einfo error message.
86
87 2008-08-01 Alan Modra <amodra@bigpond.net.au>
88 Jan Kratochvil <jan.kratochvil@redhat.com>
89
90 * elfcore.h (elf_core_file_p): Ensure we have a backend match
91 with the correct arch size before rejecting the generic fallback.
92 * elfcode.h (elf_object_p): Likewise. Ensure arch size matches
93 before accepting a target.
94
95 2008-08-01 Alan Modra <amodra@bigpond.net.au>
96
97 PR 6774
98 * elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
99 include file or program headers.
100
101 2008-07-30 Alan Modra <amodra@bigpond.net.au>
102
103 * coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c,
104 elf32-iq2000.c, elf32-m32c.c, elf32-mep.c, elf32-mt.c,
105 elf32-sh-symbian.c, elf64-hppa.c, mach-o.c, peXXigen.c, pef.c,
106 ppcboot.c, vms-misc.c, xsym.c: Silence gcc warnings.
107
108 2008-07-28 Daniel Jacobowitz <dan@codesourcery.com>
109
110 * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating
111 relocations for undefined weak symbols with non-default visibility.
112 (_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for
113 global symbols in shared libraries.
114 (allocate_dynrelocs): New function.
115 (_bfd_mips_elf_adjust_dynamic_symbol): Do not handle
116 possibly_dynamic_relocs here.
117 (_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs.
118
119 2008-07-28 Alexandre Oliva <aoliva@redhat.com>
120
121 * elf32-i386.c (struct elf_i386_link_hash_table): Added field
122 tls_module_base.
123 (elf_i386_link_hash_table_create): Initialize it.
124 (elf_i386_always_size_sections): Set it.
125 (set_tls_module_base): New.
126 (elf_i386_relocate_sections): Call it.
127 * elf64-x86-64.c (struct elf64_x86_64_link_hash_table): Added
128 field tls_module_base.
129 (elf64_x86_64_link_hash_table_create): Initialize it.
130 (elf64_x86_64_always_size_sections): Set it.
131 (set_tls_module_base): New.
132 (elf64_x86_64_relocate_sections): Call it.
133 Reported by Cary Coutant <ccoutant@google.com>
134
135 2008-07-28 Ineiev <ineiev@yahoo.co.uk>
136
137 * elf32-arm.c (arm_map_one_stub): Declare variables at beginning
138 of block.
139 * elf32-avr.c (get_local_syms): Likewise.
140
141 2008-07-28 Alan Modra <amodra@bigpond.net.au>
142
143 PR 6769
144 * bfd-in.h (BFD_VMA_FMT): Define.
145 (printf_vma, sprintf_vma): Use the above.
146 (_bfd_int64_low, _bfd_int64_high): Delete.
147 * bfd-in2.h: Regenerate.
148
149 2008-07-27 Alan Modra <amodra@bigpond.net.au>
150
151 * elf.c (_bfd_elf_make_section_from_shdr): Ignore return from
152 elf_parse_notes. Use bfd_malloc_and_get_section.
153 (elf_parse_notes): Validate note namesz and descsz.
154
155 2008-07-26 Michael Eager <eager@eagercon.com>
156
157 * elf32-ppc.c (ppc_elf_merge_obj_attributes): Check compatibility
158 between single-float, double-float, and soft-float.
159
160 2008-07-24 Daniel Jacobowitz <dan@codesourcery.com>
161
162 * elf32-mips.c (elf_backend_write_section): Define.
163
164 2008-07-24 Nick Clifton <nickc@redhat.com>
165
166 * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one
167 error assigning sections to segments.
168
169 2008-07-22 Nick Clifton <nickc@redhat.com>
170
171 * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in
172 adjoining pages to be included in the same segment.
173
174 2008-07-22 Simon Baldwin <simonb@google.com>
175
176 * elflink.c (elf_link_output_extsym): Set st_size to zero for
177 symbols from dynamic libraries.
178
179 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
180
181 PR ld/4424
182 * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible
183 to check if 2 inputs are compatible.
184
185 2008-07-21 Sterling Augustine <sterling@tensilica.com>
186
187 * elf.c (assign_file_positions_for_load_sections): Print vma in
188 error message about overlapping section vmas.
189
190 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
191
192 PR ld/6747
193 * elf32-frv.c (elf32_frv_relocate_section): Revert the change
194 for PR ld/6446 checked in by accident on May 21, 2008.
195
196 2008-07-21 Nick Clifton <nickc@redhat.com>
197
198 * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non
199 COFF_WITH_PE based SH ports.
200 * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype.
201 * arm-wince-pe.c (bfd_pe_print_pdata): Use
202 _bfd_pe_print_ce_compressed_pdata.
203 (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move
204 to...
205 * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to
206 _bfd_XX_print_ce_compressed_pdata.
207
208 2008-07-21 Alan Modra <amodra@bigpond.net.au>
209
210 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
211 unwanted zero terminators.
212
213 2008-07-21 Alan Modra <amodra@bigpond.net.au>
214
215 * elf32-spu.c (spu_elf_relocate_section): Expand
216 RELOC_FOR_GLOBAL_SYMBOL. Don't warn about undefined symbols for
217 R_SPU_PPU32 and R_SPU_PPU64 relocations.
218
219 2008-07-21 Luis Machado <luisgpm@br.ibm.com>
220
221 * elf-bfd.h: Declare elfcore_write_ppc_vsx.
222 * elf.c (elfcore_grok_ppc_vsx): New function.
223 (elfcore_write_ppc_vsx): New function
224 (elfcore_grok_note): Handle VSX notes.
225 (elfcore_write_register_note): Handle VSX notes.
226
227 2008-07-18 Joseph Myers <joseph@codesourcery.com>
228
229 * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
230 * bfd-in2.h: Regenerate.
231 * elf32-arm.c (struct elf_arm_obj_tdata): Add field
232 no_wchar_size_warning.
233 (bfd_elf32_arm_set_target_relocs): Add new parameter
234 no_wchar_warn.
235 (elf32_arm_merge_eabi_attributes): Give a warning, not an error,
236 for conflicting wchar_t attributes. Do not warn if
237 --no-wchar-size-warning. Make diagnostic text more specific.
238
239 2008-07-18 H.J. Lu <hongjiu.lu@intel.com>
240
241 PR ld/6748
242 * elf32-arm.c (elf32_arm_link_hash_table_create): Initialize
243 new fields added for ARM long call support.
244
245 2008-07-18 Danny Backx <dannybackx@users.sourceforge.net>
246
247 * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
248 print compressed pdata structure as described on MSDN. This only
249 applies to a limited set of architectures (ARM, SH4).
250 (slurp_symtab, my_symbol_for_address): Define static helper
251 functions for pe_print_compressed_pdata.
252 * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
253 (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
254 * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
255 bfd_coff_backend_data, call the function if non-null.
256 * pei-mcore.c: Add target dependent initialisation for
257 bfd_coff_backend_data.
258 * coff-sh.c: Likewise.
259 * coff64-rs6000.c: Likewise.
260 * coff-rs6000.c: Likewise.
261 * libcoff-in.h: Likewise.
262 * cf-i386lynx.c: Likewise.
263 * coff-alpha.c: Likewise.
264 * coff-apollo.c: Likewise.
265 * coff-arm.c: Likewise.
266 * coff-aux.c: Likewise.
267 * coff-h8300.c: Likewise.
268 * coff-h8500.c: Likewise.
269 * coff-i386.c: Likewise.
270 * coff-i860.c: Likewise.
271 * coff-i960.c: Likewise.
272 * coff-ia64.c: Likewise.
273 * coff-m68k.c: Likewise.
274 * coff-m88k.c: Likewise.
275 * coff-maxq.c: Likewise.
276 * coff-mips.c: Likewise.
277 * coff-or32.c: Likewise.
278 * coff-sparc.c: Likewise.
279 * coff-tic30.c: Likewise.
280 * coff-tic4x.c: Likewise.
281 * coff-tic54x.c: Likewise.
282 * coff-tic80.c: Likewise.
283 * coff-w65.c: Likewise.
284 * coff-we32k.c: Likewise.
285 * coff-x86_64.c: Likewise.
286 * coff-z80.c: Likewise.
287 * coff-z8k.c: Likewise.
288 * pe-mcore.c: Likewise.
289 * pe-mips.c: Likewise.
290 * pe-ppc.c: Likewise.
291 * peXXigen.c: Likewise.
292 * pei-ppc.c: Likewise.
293 * libcoff.h: Regenerate.
294
295 2008-07-16 Bernd Schmidt <bernd.schmidt@analog.com>
296
297 * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
298 bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook,
299 ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE,
300 struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code
301 separate from non-FD-PIC.
302
303 2008-07-14 DJ Delorie <dj@redhat.com>
304
305 * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow
306 checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16
307 relocs.
308 (mn10300_elf_relax_section): Correct jump offset check when target
309 is in a different section.
310
311 2008-07-15 Jie Zhang <jie.zhang@analog.com>
312
313 * elf32-bfin.c (elf32_bfin_special_sections[]): New.
314 (elf_backend_special_sections): Define.
315
316 2008-07-13 Craig Silverstein <csilvers@google.com>
317
318 PR binutils/6743
319 * dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory.
320 (find_line): Use info_ptr_memory instead of sec_info_ptr.
321 (_bfd_dwarf2_cleanup_debug_info): Likewise.
322
323 2008-07-12 Jie Zhang <jie.zhang@analog.com>
324
325 Revert
326 2008-07-12 Jie Zhang <jie.zhang@analog.com>
327 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
328 executable sections into the same segment with other
329 read only sections if --sep-code.
330 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
331 (elf32_bfin_data_in_l1): New variable.
332 (elf32_bfin_final_write_processing): New.
333 (elf32_bfin_special_sections[]): New.
334 (elf_backend_final_write_processing): Define.
335 (elf_backend_special_sections): Define.
336
337 2008-07-12 Jie Zhang <jie.zhang@analog.com>
338
339 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
340 executable sections into the same segment with other
341 read only sections if --sep-code.
342 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
343 (elf32_bfin_data_in_l1): New variable.
344 (elf32_bfin_final_write_processing): New.
345 (elf32_bfin_special_sections[]): New.
346 (elf_backend_final_write_processing): Define.
347 (elf_backend_special_sections): Define.
348
349 2008-07-11 Andreas Schwab <schwab@suse.de>
350
351 * dwarf2.c (read_section): Take pointer to bfd_size_type instead
352 of unsigned long as last parameter.
353 (struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size,
354 dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of
355 unsigned long.
356
357 2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
358
359 * elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0
360 for all relocation types. Allow any type of relocation to refer to
361 __gnu_local_gp.
362
363 2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
364
365 * elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16.
366 (mips_elf_calculate_relocation): Likewise.
367 (_bfd_mips_elf_add_symbol_hook): Likewise.
368 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
369 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
370
371 2008-07-10 Andreas Schwab <schwab@suse.de>
372
373 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Add missing
374 paren.
375
376 2008-07-09 Craig Silverstein <csilvers@google.com>
377
378 * Makefile.am (BFD32_LIBS): Add compress.lo.
379 (BFD32_LIBS_CFILES): Add compress.c.
380 (BFD_H_FILES): Likewise.
381 * Makefile.in: Regenerate.
382 * bfd-in2.h: Regenerate.
383 * config.in: Add HAVE_ZLIB_H
384 * configure.in: Add test for libz and zlib.h
385 * configure: Regenerate.
386 * dwarf2.c (read_section): New function.
387 (read_indirect_string): Call new function read_section.
388 (read_abbrevs): Likewise.
389 (decode_line_info): Likewise.
390 (read_debug_ranges): Likewise.
391 (find_line): Call new function read_section when just one
392 .zdebug_info section is found, otherwise read and compress
393 multiple sections.
394 (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
395 * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
396 (special_sections_z): New struct.
397 (special_sections): Refer to special_sections_z.
398 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
399 sections named .zdebug_*.
400 (_bfd_mips_elf_fake_sections): Likewise.
401 * compress.c: New file.
402 (bfd_uncompress_section_contents): New function.
403
404 2008-07-07 Christophe Lyon <christophe.lyon@st.com>
405
406 * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in
407 the presence of a PLT.
408
409 2008-07-07 Alan Modra <amodra@bigpond.net.au>
410
411 * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
412
413 2008-07-02 Alan Modra <amodra@bigpond.net.au>
414
415 * elf32-ppc.c (is_pic_glink_stub): New function.
416 (ppc_elf_get_synthetic_symtab): Don't generate symbols when
417 multiple shared/pie stubs per plt entry.
418
419 2008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
420
421 * elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
422 bed->s->int_rels_per_ext_rel.
423
424 2008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
425
426 * syms.c (BSF_SYNTHETIC): New flag.
427 * elf.c (_bfd_elf_get_synthetic_symtab): Set it.
428 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
429 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
430 * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
431 for synthetic symbols.
432 * bfd-in2.h: Regenerate.
433
434 2008-06-30 Daniel Jacobowitz <dan@codesourcery.com>
435
436 * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
437 Expand comments.
438 (arm_map_one_stub): Use | 1 when setting the low bit.
439
440 2008-06-29 Andreas Schwab <schwab@suse.de>
441
442 * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
443 addend on _GLOBAL_OFFSET_TABLE_.
444
445 2008-06-24 Daniel Jacobowitz <dan@codesourcery.com>
446
447 * elf32-arm.c (STUB_ENTRY_NAME): Define.
448 (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
449 (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
450 R_ARM_ABS32.
451 (struct elf32_arm_stub_hash_entry): Add output_name.
452 (arm_build_one_stub): Move offsets into the offset argument
453 of _bfd_final_link_relocate. Correct offset for
454 arm_thumb_arm_v4t_stub_long_branch.
455 (elf32_arm_size_stubs): Set stub_entry->output_name.
456 (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
457 Update all callers.
458 (elf32_arm_output_stub_sym): New.
459 (arm_map_one_stub): Correct formatting. Use elf32_arm_output_stub_sym.
460
461 2008-06-20 Alan Modra <amodra@bigpond.net.au>
462
463 * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
464 non-branch insns.
465
466 2008-06-20 Alan Modra <amodra@bigpond.net.au>
467
468 * elf32-spu.c (build_stub): Allow wraparound on stub branches.
469 (allocate_spuear_stubs, build_spuear_stubs): Return value from
470 count_stub/build_stub.
471 (spu_elf_build_stubs): Correct location of stub reloc error message.
472
473 2008-06-18 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
474
475 * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
476
477 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
478
479 * configure: Regenerate.
480
481 2008-06-17 Alan Modra <amodra@bigpond.net.au>
482
483 * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
484 (spu_elf_check_vma): Add extra_stack_space param, copy to htab.
485 (spu_elf_auto_overlay): Use it.
486 (RECURSE_UNMARK): Define as 0.
487 (unmark_overlay_section): Heed RECURSE_UNMARK.
488 * elf32-spu.h (spu_elf_check_vma): Update prototype.
489
490 2008-06-12 DJ Delorie <dj@redhat.com>
491
492 * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.
493
494 2008-06-09 Paul Brook <paul@codesourcery.com>
495
496 bfd/
497 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
498 libraries.
499
500 2008-06-09 Christophe Lyon <christophe.lyon@st.com>
501
502 * elf32-arm.c (arm_stub_is_thumb): Define.
503 (elf32_arm_final_link_relocate): Handle near mode switching stubs.
504
505 2008-06-07 Alan Modra <amodra@bigpond.net.au>
506
507 * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
508 to stack calculation.
509
510 2008-06-06 Paul Brook <paul@codesourcery.com>
511
512 bfd/
513 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
514
515 2008-06-06 Alan Modra <amodra@bigpond.net.au>
516
517 * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
518 file names be unique. Specify archive:path in overlay script.
519
520 2008-06-05 Alan Modra <amodra@bigpond.net.au>
521
522 PR ld/6590
523 * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
524
525 2008-06-04 Alan Modra <amodra@bigpond.net.au>
526
527 * elf.c (ignore_section_sym): Don't test section sym value here.
528 (elf_map_symbols): Instead check zero value here as was done prior
529 to 2006-05-26 change.
530
531 2008-06-04 Nick Clifton <nickc@redhat.com>
532
533 PR ld/6019
534 * elf32-avr.c (elf32_avr_relax_section): Handle the case where
535 there are no local symbols.
536
537 2008-06-04 Alan Modra <amodra@bigpond.net.au>
538
539 * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
540 (process_stubs): Likewise.
541 (discover_functions): Don't used cached symbols.
542 (maybe_insert_function): Correct condition under which function
543 array is realloc'd.
544 (mark_functions_via_relocs): Delete unused variable.
545
546 2008-05-30 Frediano Ziglio <frediano.ziglio@vodafone.com>
547 Nick Clifton <nickc@redhat.com>
548
549 PR ld/6511
550 * elf64-hppa.c (allocate_global_data_opd): Default to using the
551 dynamic symbol table for local function names in shared libraries.
552
553 2008-05-29 Jan Kratochvil <jan.kratochvil@redhat.com>
554
555 * elf.c (assign_file_positions_for_load_sections): Adjust pre-section
556 gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
557
558 2008-05-28 Alan Modra <amodra@bigpond.net.au>
559
560 * elf32-spu.c (spu_elf_object_p): New function.
561 (elf_backend_object_p): Define.
562 (build_stub): Correct second word of 8 byte overlay stubs.
563 (spu_elf_relocate_section): Formatting.
564
565 2008-05-24 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
566
567 * elf.c (elfcore_write_register_note): New function.
568 * elf-bfd.h (elfcore_write_register_note): New prototype.
569
570 2008-05-22 Christophe Lyon <christophe.lyon@st.com>
571
572 * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
573 (elf32_arm_stub_add_mapping_symbol): Remove.
574 (elf32_arm_add_stub): Don't generate mapping symbols. Change
575 prototype.
576 (elf32_arm_size_stubs): Use new elf32_arm_add_stub
577 prototype. Don't generate thumb to arm glue for calls.
578 (arm_map_one_stub): Define.
579 (elf32_arm_output_arch_local_syms): Generate mapping symbols for
580 long calls stubs.
581
582 2008-05-21 Nick Clifton <nickc@redhat.com>
583
584 * elf32-arm.c (group_sections): Reformat comments.
585
586 PR ld/6446
587 * elf32-frv.c (elf32_frv_relocate_section): Set EF_FRV_PIC by
588 default (for FDPIC). Clear it if any inter-segment relocations
589 are found.
590
591 * elf64-hppa.c (elf64_hppa_finalize_opd): Check NULL return
592 from elf_link_hash_lookup.
593
594 2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
595
596 Add multi-GOT support for m68k.
597 * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
598 glist): New fields.
599 (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
600 struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
601 struct elf_m68k_multi_got): New data structures.
602 (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
603 allow_multigot_p, multi_got_): New fields.
604 (elf_m68k_multi_got): New macro.
605 (elf_m68k_link_hash_newfunc): Initialize new fields of
606 struct elf_m68k_link_hash_entry.
607 (elf_m68k_link_hash_table_create): Initialize new fields of
608 struct elf_m68k_link_hash_table.
609 (elf_m68k_link_hash_table_free): New static function implementing hook.
610 (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
611 static functions for struct elf_m68k_got.
612 (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
613 elf_m68k_got_entry_eq): New static functions for
614 struct elf_m68k_got_entry.
615 (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
616 ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
617 (enum elf_m68k_get_entry_howto): New enum.
618 (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
619 elf_m68k_remove_got_entry_type): New static functions for
620 struct elf_m68k_got_entry.
621 (elf_m68k_add_entry_to_got): New static function.
622 (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
623 elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
624 functions for struct elf_m68k_bfd2got_entry.
625 (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
626 elf_m68k_can_merge_gots): New traversal.
627 (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
628 elf_m68k_merge_gots): Ditto.
629 (struct elf_m68k_finalize_got_offsets_arg,
630 elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
631 (struct elf_m68k_partition_multi_got_arg,
632 elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
633 elf_m68k_partition_multi_got): Ditto.
634 (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
635 functions.
636 (elf_m68k_copy_indirect_symbol): New static function implementing
637 a hook.
638 (elf_m68k_check_relocs): Update to add entries to multi-GOT.
639 (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
640 (elf_m68k_always_size_sections): Assign BFDs to GOTs.
641 (elf_m68k_relocate_section): Update to properly handle GOT relocations.
642 (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
643 of a global symbol.
644 (bfd_elf_m68k_set_target_options): New function.
645 (bfd_elf32_bfd_link_hash_table_free): Define hook.
646 (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
647 to skip generic calculation of GOT offsets.
648 (elf_backend_copy_indirect_symbol): Define hook.
649 * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
650 * bfd-in2.h: Regenerate.
651
652 2008-05-21 André Johansen <andrejoh@gmail.com>
653
654 PR 868
655 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
656 for filenames in function tables and variable tables.
657
658 2008-05-19 Alan Modra <amodra@bigpond.net.au>
659
660 PR 2995, PR 6473
661 * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
662 vma when all p_paddr fields are zero and there is more than
663 one PT_LOAD header.
664
665 2008-05-15 Christophe Lyon <christophe.lyon@st.com>
666
667 Add long call support for ARM.
668 * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
669 (THM2_MAX_BWD_BRANCH_OFFSET): Define.
670 (ARM_MAX_FWD_BRANCH_OFFSET): Define.
671 (ARM_MAX_BWD_BRANCH_OFFSET): Define.
672 (THM_MAX_FWD_BRANCH_OFFSET): Define.
673 (THM_MAX_BWD_BRANCH_OFFSET): Define.
674 (arm_long_branch_stub): Define.
675 (arm_pic_long_branch_stub): Define.
676 (arm_thumb_v4t_long_branch_stub): Define.
677 (arm_thumb_thumb_long_branch_stub): Define.
678 (arm_thumb_arm_v4t_long_branch_stub): Define.
679 (STUB_SUFFIX): Define.
680 (elf32_arm_stub_type): Define.
681 (elf32_arm_stub_hash_entry): Define.
682 (elf32_arm_link_hash_entry): Add stub_cache field.
683 (arm_stub_hash_lookup): Define.
684 (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
685 add_stub_section, layout_sections_again, stub_group, bfd_count,
686 top_index, input_list fields.
687 (elf32_arm_link_hash_newfunc): Init new field.
688 (stub_hash_newfunc): New function.
689 (elf32_arm_link_hash_table_create): Init stub_hash_table.
690 (elf32_arm_hash_table_free): New function.
691 (arm_type_of_stub): New function.
692 (elf32_arm_stub_name): New function.
693 (elf32_arm_get_stub_entry): New function.
694 (elf32_arm_stub_add_mapping_symbol): New function.
695 (elf32_arm_add_stub): New function.
696 (arm_build_one_stub): New function.
697 (arm_size_one_stub): New function.
698 (elf32_arm_setup_section_lists): New function.
699 (elf32_arm_next_input_section): New function.
700 (group_sections): New function.
701 (elf32_arm_size_stubs): New function.
702 (elf32_arm_build_stubs): New function.
703 (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
704 (bfd_elf32_arm_process_before_allocation): No longer handle
705 R_ARM_CALL and R_ARM_THM_CALL.
706 (using_thumb_only): New function.
707 (elf32_arm_final_link_relocate): Redirect calls to stub if range
708 exceeds encoding capabilities.
709 (bfd_elf32_bfd_link_hash_table_free): Define.
710 * bfd-in.h (R_ARM_max): Fix value to 130.
711 (elf32_arm_setup_section_lists): Protype.
712 (elf32_arm_next_input_section): Protype.
713 (elf32_arm_size_stubs): Protype.
714 (elf32_arm_build_stubs): Protype.
715 * bfd-in2.h: Regenerate.
716
717 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
718
719 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
720 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
721
722 2008-05-14 Alan Modra <amodra@bigpond.net.au>
723
724 * Makefile.am: Run "make dep-am".
725 * Makefile.in: Regenerate.
726
727 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
728 Alan Modra <amodra@bigpond.net.au>
729
730 * elf32-ppc.c (section_covers_vma): New function.
731 (ppc_elf_get_synthetic_symtab): New function.
732 (bfd_elf32_get_synthetic_symtab): Define.
733 * elf64-ppc.c (section_covers_vma): New function.
734 (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
735 table entries, and __glink_PLTresolve on resolver stub.
736 (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
737
738 2008-05-12 Alan Modra <amodra@bigpond.net.au>
739
740 PR 6443
741 * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
742 (must_be_dyn_reloc): New function.
743 (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
744 in pies.
745 (ppc_elf_tls_optimize): Optimise pies.
746 (ppc_elf_relocate_section): Use a section symbol rather than no
747 symbol if possible for LD->IE TLS sequence, but don't error if
748 we must use no symbol.
749 * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
750 (must_be_dyn_reloc): Likewise.
751 (ppc64_elf_check_relocs): Likewise.
752 (ppc64_elf_tls_optimize): Likewise.
753 (ppc64_elf_relocate_section): Likewise.
754
755 2008-05-12 Alan Modra <amodra@bigpond.net.au>
756
757 * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.
758
759 2008-05-10 Paul Pluzhnikov <ppluzhnikov@google.com>
760
761 * elfcore.h (elf_core_file_p): Warn about core truncation.
762
763 2008-05-07 Bob Wilson <bob.wilson@acm.org>
764
765 * elf32-xtensa.c (xtensa_property_section_name): New.
766 (xtensa_make_property_section): New.
767 (xtensa_get_property_section): Make static. Do not create a new
768 section if it does not exist.
769
770 2008-05-08 Alan Modra <amodra@bigpond.net.au>
771
772 * elf32-spu.c (spu_elf_special_sections): Add "._ea".
773 (spu_elf_relocate_section): Handle relocations against symbols
774 defined in ._ea specially.
775
776 2008-05-03 Daniel Jacobowitz <dan@codesourcery.com>
777
778 * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
779 ARRAY_SIZE.
780 (elf32_arm_symbian_plt_sym_val): New.
781 (elf_backend_plt_sym_val): Define.
782
783 2008-05-03 Alan Modra <amodra@bigpond.net.au>
784
785 PR 2995, PR 6473
786 * elf.c (rewrite_elf_program_header): Rather than clearing
787 p_paddr_valid at end, don't set it in the first place. Delete
788 comment no longer relevant. When not p_paddr_valid, don't set
789 paddr from vaddr, and don't set p_vaddr_offset.
790
791 2008-05-01 Cary Coutant <ccoutant@google.com>
792
793 * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
794 corrupt string table.
795
796 2008-05-01 Joel Brobecker <brobecker@adacore.com>
797
798 * cache.c (cache_bread_1): Renames cache_bread.
799 (cache_bread): New function.
800
801 2008-05-01 Alan Modra <amodra@bigpond.net.au>
802
803 PR 2995, PR 6473
804 * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
805 (assign_file_positions_for_load_sections): Combine nested "if".
806 (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
807 when all header p_paddr fields are zero.
808
809 2008-04-30 Edmar Wienskoski <edmar@freescale.com>
810
811 * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry.
812
813 2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
814
815 * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
816 (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
817 even if they are not loaded.
818 * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
819 first.
820
821 2008-04-25 Jay Foad <jay.foad@gmail.com>
822
823 * reloc16.c (bfd_coff_reloc16_get_value): Add support for
824 undefined weak symbols.
825
826 2008-04-25 Nick Clifton <nickc@redhat.com>
827
828 * po/vi.po: Updated Vietnamese translation.
829
830 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
831
832 * aclocal.m4: Regenerate.
833 * configure: Regenerate.
834
835 2008-04-21 Cary Coutant <ccoutant@google.com>
836
837 * archive.c (_bfd_write_archive_contents): Fix incorrect use of
838 ARFMAG.
839
840 2008-04-21 Nathan Sidwell <nathan@codesourcery.com>
841
842 * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
843 set the value of undefined symbols in shared objects.
844 (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
845 undefined symbols unless pointer equality is needed.
846
847 2008-04-18 Dennis Roberts <dennis.roberts@sunquestinfo.com>
848
849 * aix5ppc-core.c: Define macros for the default architecture and
850 machine for matching core files.
851 (xcoff64_core_p): Set the architecture and machine to the default
852 values defined in the macros mentioned above.
853 * rs6000-core.c: Define macros to determine whether or not the
854 core file header uses the core_dumpxx header format.
855 (rs6000coff_core_p): Don't match core files that use the
856 core_dumpxx header format.
857
858 2008-04-16 Pedro Alves <pedro@codesourcery.com>
859
860 * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add.
861
862 2008-04-16 David S. Miller <davem@davemloft.net>
863
864 * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
865 BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
866 BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
867 * libbfd.h: Regnerate.
868 * bfd-in2.h: Regenerate.
869 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
870 GOTDATA relocations.
871 (sparc_reloc_map): Likewise.
872 (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
873 R_SPARC_GOT*.
874 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
875 (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
876 R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
877 R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
878 Simply ignore R_SPARC_GOTDATA_OP relocations.
879
880 2008-04-14 Aurelien Jarno <aurelien@aurel32.net>
881
882 * configure.in: Link with the PIC version of libiberty on
883 Linux/MIPS hosts.
884 * configure: Regenerate.
885
886 2008-04-14 Edmar Wienskoski <edmar@freescale.com>
887
888 * archures.c: Add bfd_mach_ppc_e500mc.
889 * bfd-in2.h: Regenerate.
890
891 2008-04-08 Alan Modra <amodra@bigpond.net.au>
892
893 * elf32-spu.c (spu_elf_build_stubs): Correct error message.
894 (mark_functions_via_relocs): Remove premature init of symtab_hdr.
895 (collect_overlays): Commment typo fix.
896
897 2008-04-08 Kees Cook <kees@canonical.com>
898
899 * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
900 in EXEC_P bfds.
901
902 2008-04-08 Alan Modra <amodra@bigpond.net.au>
903
904 * elf32-spu.c: Include libiberty.h.
905 (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
906 non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
907 spu_elf_relink, auto_overlay fields.
908 (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
909 (needs_ovl_stub): Flip test so that call to non-function warning
910 is emitted during relocate_section rather than earlier.
911 (spu_elf_check_vma): Stash --auto-overlay parameters, and clear
912 auto_overlay if no section exceeds local store.
913 (struct call_info): Add count, max_depth, is_pasted fields.
914 (struct function_info): Add rodata, last_caller, call_count,
915 depth, new visit flags.
916 (insert_callee): Increment call count.
917 (copy_callee): New function.
918 (mark_functions_via_relocs): Investigate all reloc types to count
919 possible function pointer stubs for --auto-overlay. Track
920 last_caller and increment function call_count.
921 (pasted_function): Insert a "call" into call info for pasted section.
922 (remove_cycles): Track max depth of calls. Don't emit call graph
923 pruning warning for --auto-overlay.
924 (build_call_tree): Don't transfer_calls for --auto-overlay.
925 Adjust remove_cycles call.
926 (sort_calls, sort_lib, sort_bfds): New functions.
927 (struct _mos_param, struct _uos_param, struct _cl_param): New.
928 (mark_overlay_section, unmark_overlay_section): New functions.
929 (collect_lib_sectios, auto_ovl_lib_functions): New functions.
930 (collect_overlays, find_pasted_call): New functions.
931 (sum_stack): Deal with is_pasted "calls". Exit before printing
932 when --auto-overlay.
933 (spu_elf_auto_overlay): New function.
934 (spu_elf_final_link): Call spu_elf_auto_overlay.
935 * elf32-spu.h (spu_elf_check_vma): Update prototype.
936
937 2008-04-07 Alan Modra <amodra@bigpond.net.au>
938
939 * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
940 is defined in overlay section before creating a stub.
941 (build_spuear_stubs): Likewise.
942 (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
943
944 2008-04-02 Alan Modra <amodra@bigpond.net.au>
945
946 * elf32-spu.c (insert_callee): Reorder call list so most recent
947 call is always first.
948 (interesting_section): Move.
949 (mark_functions_via_relocs): Fold interesting_section and
950 reloc_count tests in callers to here. Simplify output section
951 owner test.
952 (discover_functions): Set "gaps" when no symbols and some
953 "interesting_section". Run pasted_function loop for no symbol
954 bfds.
955 (for_each_node, transfer_calls): New functions.
956 (mark_non_root): Adjust to suit for_each_node.
957 (call_graph_traverse): Likewise. Fix memory leak. Rename to..
958 (remove_cycles): ..this.
959 (build_call_tree): Use for_each_node and transfer_calls.
960 (struct _sum_stack_param): New.
961 (sum_stack): Adjust to suit for_each_node. Return error on
962 malloc failure. Move code to print root node cumulative stack from..
963 (spu_elf_stack_analysis): ..here. Use for_each_node.
964
965 2008-03-31 Cary Coutant <ccoutant@google.com>
966
967 PR 6006
968 * archive.c (_bfd_slurp_extended_name_table): Change
969 ARFMAG[0] to ARFMAG[1].
970 (_bfd_construct_extended_name_table): Likewise.
971
972 2008-03-31 Daniel Jacobowitz <dan@codesourcery.com>
973
974 * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
975 (_bfd_mips_elf_check_relocs): Update comments. Always call
976 mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
977
978 2008-03-27 Cary Coutant <ccoutant@google.com>
979
980 Add support for thin archives.
981 * archive.c (_bfd_find_nested_archive): New function.
982 (get_extended_arelt_filename): Add origin parameter.
983 (_bfd_generic_read_ar_hdr_mag): Deal with extended name
984 combined with a file offset.
985 (append_relative_path): New function.
986 (_bfd_get_elt_at_filepos): Deal with external members and
987 nested archives.
988 (bfd_generic_openr_next_archived_file): Thin archives.
989 (bfd_generic_archive_p): Recognize new magic string.
990 (adjust_relative_path): New function.
991 (_bfd_construct_extended_name_table): Construct extended
992 names for thin archive members.
993 (_bfd_write_archive_contents): Emit new magic string, skip
994 copying files for thin archives.
995 * bfd-in.h (bfd_is_thin_archive): New macro.
996 * bfd.c (struct bfd): New fields for thin archives.
997 * libbfd-in.h (struct areltdata): New field for thin archives.
998 * opncls.c (bfd_close): Delete BFDs for nested archives.
999
1000 2008-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
1001
1002 * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
1003 _bfd_final_link_relocate that also handles R_pcrel24 relocs.
1004 (bfinfdpic_relocate_section, bfin_relocate_section): Use it.
1005
1006 2008-03-25 Nathan Sidwell <nathan@codesourcery.com>
1007
1008 * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
1009 in vxworks tls_vars sections.
1010 (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
1011 * elf32-i386.c (allocate_dynrelocs,
1012 elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
1013 * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
1014 ppc_elf_relocate_section): Likewise.
1015 * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
1016 sh_elf_relocate_section): Likewise.
1017 * elfxx-sparc.c (allocate_dynrelocs,
1018 _bfd_sparc_elf_size_dynamic_sections,
1019 _bfd_sparc_elf_relocate_section): Likewise.
1020
1021 2008-03-21 Adam Nemet <anemet@caviumnetworks.com>
1022
1023 * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
1024 print the values from the dynamic section.
1025
1026 2008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
1027
1028 * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
1029 (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
1030
1031 2008-03-20 Alan Modra <amodra@bigpond.net.au>
1032
1033 * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
1034 (spu_elf_find_overlays, spu_elf_size_stubs): Likewise
1035 (process_stubs, discover_functions, build_call_tree): Likewise.
1036 (spu_elf_stack_analysis): Likewise.
1037 (spu_elf_check_vma): Likewise. Move.
1038 (struct call_info): Make "is_tail" a bitfield.
1039 (insert_callee): Clear fun->start and set fun->is_func if we find
1040 a non-tail call.
1041 * elf32-spu.h (spu_elf_create_sections): Update prototype.
1042 (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
1043
1044 2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1045
1046 * aclocal.m4: Regenerate.
1047 * configure: Likewise.
1048 * Makefile.in: Likewise.
1049
1050 2008-03-16 H.J. Lu <hongjiu.lu@intel.com>
1051
1052 PR ld/5789
1053 PR ld/5943
1054 * elf32-i386.c (elf_i386_relocate_section): Issue an error
1055 for R_386_GOTOFF relocaton against undefined hidden/internal
1056 symbols when building a shared object.
1057
1058 * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
1059 error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
1060 relocaton against undefined hidden/internal symbols when
1061 building a shared object.
1062 (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
1063 is referenced locally, but isn't defined in a regular file.
1064
1065 2008-03-15 H.J. Lu <hongjiu.lu@intel.com>
1066
1067 * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO,
1068 HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED,
1069 BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY,
1070 HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ...
1071 * bfd.c: Here.
1072
1073 * bfd.c (bfd): Change cacheable, target_defaulted, opened_once,
1074 mtime_set, no_export, output_has_begun and has_armap to bit
1075 field.
1076
1077 * bfd-in2.h: Regenerated.
1078
1079 2008-03-14 Daniel Jacobowitz <dan@codesourcery.com>
1080
1081 * cache.c (close_one): Remove mtime hack.
1082
1083 2008-03-14 H.J. Lu <hongjiu.lu@intel.com>
1084
1085 PR ld/5913
1086 * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT.
1087 (elfNN_ia64_dtprel_base): Likewise.
1088 (elfNN_ia64_relocate_section): Go to missing_tls_sec if
1089 tls_sec is NULL before calling elfNN_ia64_tprel_base or
1090 elfNN_ia64_dtprel_base. Report unsupported TLS relocations.
1091
1092 2008-03-14 Alan Modra <amodra@bigpond.net.au>
1093
1094 * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move
1095 common code to..
1096 (maybe_needs_stub): ..here, a new function that also omits stubs
1097 for .eh_frame, and..
1098 (needs_ovl_stub): ..here. Create stubs for labels in code section
1099 referenced by switch jump table.
1100 (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return.
1101 (enum _insn_type): Delete.
1102 (enum _stub_type): New.
1103 (count_stub, build_stub): Adjust.
1104 (allocate_spuear_stubs, build_spuear_stubs): Adjust.
1105
1106 2008-03-13 Alan Modra <amodra@bigpond.net.au>
1107
1108 * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast.
1109 (_bfd_elf_assign_file_position_for_section): Simplify align.
1110 (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough
1111 for sh_addralign.
1112 (elf_fake_sections, swap_out_syms): Likewise.
1113 * elflink.c (bfd_elf_final_link): Likewise.
1114
1115 2008-03-13 Alan Modra <amodra@bigpond.net.au>
1116
1117 * Makefile.am: Run "make dep-am".
1118 * Makefile.in: Regenerate.
1119 * po/SRC-POTFILES.in: Regenerate.
1120
1121 2008-03-12 Bernd Schmidt <bernd.schmidt@analog.com>
1122
1123 From Jie Zhang <jie.zhang@analog.com>
1124 * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4,
1125 gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo,
1126 gotoff, call and sym not bitfields.
1127 (bfinfdpic_gc_sweep_hook): New function; update the relocation
1128 information for the relocations of the section being removed.
1129 (bfinfdpic_check_relocs): Accumulate the number of relocations
1130 which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4,
1131 fdgoffhilo, gotoff, call and sym fields.
1132 (elf_backend_gc_sweep_hook): Redefine for FD-PIC.
1133
1134 2008-03-12 Alan Modra <amodra@bigpond.net.au>
1135
1136 PR 5900
1137 * elf-bfd.h: Include elf/internal.h after elf/external.h.
1138 * elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
1139 (elf_swap_symbol_out): Adjust SHN_XINDEX test.
1140 (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
1141 seen in external structs.
1142 (valid_section_index_p): Delete.
1143 (elf_object_p): Don't increment section numbers over reserved range.
1144 Simplify test for valid sh_link, sh_info and e_shstrndx fields.
1145 (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
1146 seen in external structs. Don't increment section numbers over
1147 reserved range.
1148 * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
1149 (bfd_section_from_shdr): Likewise.
1150 (group_signature): Range check before accessing elf_elfsections.
1151 (_bfd_elf_setup_sections): Likewise.
1152 (bfd_section_from_shdr): Likewise.
1153 (bfd_section_from_shdr): Don't increment section number over
1154 reserved sections.
1155 (assign_file_positions_for_non_load_sections): Likewise.
1156 (assign_file_positions_except_relocs): Likewise.
1157 (_bfd_elf_write_object_contents): Likewise.
1158 (assign_section_numbers): Likewise. Adjust for changed SHN_*.
1159 (prep_headers): Delete unused variable.
1160 * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
1161 for changed SHN_* values.
1162 (check_dynsym, elf_link_input_bfd): Likewise.
1163 (bfd_elf_final_link): Likewise. Don't skip over reserved section
1164 range.
1165 (elf_fixup_link_order): Check that sh_link field is valid.
1166 * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
1167 * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
1168 accesssing elf_elfsections.
1169 * elf32-avr.c (elf32_avr_size_stubs): Likewise.
1170 * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
1171 * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
1172 * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
1173 SHN_* defines. Test for SHN_BAD return from
1174 _bfd_elf_section_from_bfd_section
1175
1176 2008-03-12 Alan Modra <amodra@bigpond.net.au>
1177
1178 * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
1179 * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int,
1180 SHN_BAD on error.
1181 (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from
1182 _bfd_elf_section_from_bfd_section, not -1.
1183 (swap_out_syms): Likewise.
1184 * elflink.c (elf_link_add_object_symbols): Likewise.
1185 (bfd_elf_get_bfd_needed_list): Likewise.
1186 (bfd_elf_match_symbols_in_sections): Likewise.
1187 (elf_link_add_object_symbols): Don't bother testing for symbols
1188 using normal sections before calling bfd_section_from_elf_index.
1189 (elf_link_input_bfd, bfd_elf_final_link): Likewise.
1190 (bfd_elf_reloc_symbol_deleted_p): Likewise.
1191 * elfcode.h (elf_slurp_symbol_table): Likewise.
1192 * elf32-spu.c (get_sym_h): Likewise.
1193 * elf32-xtensa.c (get_elf_r_symndx_section): Likewise.
1194 * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto.
1195 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
1196
1197 2008-03-11 Alan Modra <amodra@bigpond.net.au>
1198
1199 * elf32-spu.c (spu_elf_relocate_section): Test identical conditions
1200 to those in process_stubs for overlay symbols.
1201
1202 2008-03-09 Paul Brook <paul@codesourcery.com>
1203
1204 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
1205 Tag_VFP_arch values.
1206
1207 2008-03-08 Paul Brook <paul@codesourcery.com>
1208
1209 * elf32-arm.c (insert_thumb_branch): Rewrite.
1210 (elf32_thumb_to_arm_stub): Use new insert_thumb_branch.
1211
1212 2008-03-07 Paul Brook <paul@codesourcery.com>
1213
1214 * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and
1215 MOVT relocations.
1216 (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign
1217 extension.
1218 (elf32_arm_relocate_section): Handle MOVW and MOVT
1219 relocations. Improve safety check for other weird relocations.
1220 (elf32_arm_check_relocs): Only set h->needs_plt for branch/call
1221 relocations.
1222
1223 2008-03-03 Bob Wilson <bob.wilson@acm.org>
1224
1225 * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
1226 only compute its value once.
1227
1228 2008-03-03 Alan Modra <amodra@bigpond.net.au>
1229
1230 * elf32-spu.c (struct got_entry): Add "addend" field.
1231 (count_stub, build_stub): Use a new stub if relocation addend
1232 differs from existing stubs for this symbol.
1233 (process_stubs): Deal with addends.
1234 (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise.
1235
1236 2008-03-02 H.J. Lu <hongjiu.lu@intel.com>
1237
1238 PR ld/5789
1239 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true
1240 for hidden and local symbols.
1241
1242 2008-03-03 Alan Modra <amodra@bigpond.net.au>
1243
1244 * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
1245 undefined symbols with internal or hidden visibility.
1246 (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL
1247 rather than SYMBOL_REFERENCES_LOCAL on branches. Don't
1248 return immediately on dynamic reloc error.
1249
1250 2008-03-01 Alan Modra <amodra@bigpond.net.au>
1251
1252 * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
1253 if emitrelocations.
1254 (get_relocs): New function, split out from..
1255 (ppc_build_one_stub): ..here. Add relocs on plt_branch stubs if
1256 emitrelocations. Remove indx temp.
1257 (ppc_size_one_stub): Count new stub relocs.
1258 (ppc64_elf_size_stubs): Count new glink reloc.
1259 (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations.
1260 (ppc64_elf_finish_dynamic_sections): Output glink relocs.
1261 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic
1262 glink code.
1263
1264 2008-02-28 Alan Modra <amodra@bigpond.net.au>
1265
1266 * elf32-spu.c (mark_functions_via_relocs): Don't assume that
1267 the "->start" pointer reaches to function origin, so that we
1268 can handle functions split over more than two sections.
1269 (build_call_tree): Likewise.
1270 (pasted_function): Don't attempt to set fun->start back to the
1271 function origin, just go back one section.
1272
1273 2008-02-27 Catherine Moore <clm@codesourcery.com>
1274
1275 * elf.c ( _bfd_elf_print_private_bfd_data): Call
1276 elf_backend_get_target_dtag if defined.
1277 * elf32-mips.c (elf_backend_get_target_dtag): Define.
1278 * elf64-mips.c: Likewise.
1279 * elfn32-mips.c: Likewise.
1280 * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
1281 * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
1282 * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
1283 * elfxx-target.h (elf_backend_get_target_dtag): Add default.
1284 (elf_backend_data): Add elf_backend_get_target_dtag.
1285
1286 2008-02-26 Alan Modra <amodra@bigpond.net.au>
1287
1288 * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed
1289 for R_PPC_REL32 syms. Don't set non_got_ref on branch reloc syms,
1290 and assume branch relocs are not dynamic when non-shared.
1291 (readonly_dynrelocs): New function, split out from..
1292 (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs.
1293 (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries,
1294 clear non_got_ref..
1295 (allocate_dynrelocs): ..and don't set u.def for undefined weak.
1296 Do allow dynamic relocs on undefined symbols.
1297 (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
1298 (ppc_elf_relocate_section): Mirror dynamic reloc changes in
1299 check_relocs.
1300 (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak
1301 plt symbols needing pointer_equality_needed.
1302
1303 2008-02-23 Alan Modra <amodra@bigpond.net.au>
1304
1305 * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
1306
1307 2008-02-23 Alan Modra <amodra@bigpond.net.au>
1308
1309 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy
1310 pointer_equality_needed.
1311 (ppc_elf_check_relocs): Split out non-branch relocs from others
1312 that might emit dynamic relocs. Set pointer_equality_needed
1313 for their symbols. Don't set non_got_ref on branch reloc symbols.
1314 (ppc_elf_hash_symbol): New function.
1315 (elf_backend_hash_symbol): Define.
1316 (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed.
1317 Error if pointer_equality_needed on weak plt symbol.
1318
1319 2008-02-22 H.J. Lu <hongjiu.lu@intel.com>
1320
1321 PR ld/5788
1322 * elflink.c (elf_create_symbuf): Correct buffer size and
1323 position.
1324
1325 2008-02-22 Nick Clifton <nickc@redhat.com>
1326
1327 PR 868
1328 * dwarf2.c: Revert previous patch. All of the allocate memory is
1329 on an obstack which will be freed at some other time.
1330
1331 2008-02-20 Nick Clifton <nickc@redhat.com>
1332
1333 PR 868
1334 * libbfd.c (bfd_realloc_or_free): New function. Performs like
1335 bfd_realloc, but if the (re)allocation fails, the pointer is
1336 freed.
1337 * libbfd-in.h: Prototype.
1338 * libbfd.h: Regenerate.
1339 * bfdio.c (bfd_bwrite): Use the new function.
1340 (bfd_seek): Likewise.
1341 * bfdwin.c:(bfd_get_file_window): Likewise.
1342 * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
1343 * elf32-ppc.c (ppc_elf_relax_section): Likewise.
1344 * elf32-xtensa.c (vsprintf_msg): Likewise.
1345 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1346 * stabs.c (_bfd_link_seciton_stabs): Likewise.
1347 * vms-misc.c (_bfd_vms_get_record): Likewise.
1348 * vms-tir.c (check_section): Likewise.
1349 * vms.c (vms_new_section_hook): Likewise.
1350 * elf32-arm.c (elf32_arm_section_map_add): Check that the
1351 allocation of sec_data->map succeeded before using it.
1352 * elflink.c (elf_link_output_sym): Do not overwrite finfo->
1353 symshndxbuf until it is known that the reallocation succeeded.
1354
1355 2008-02-20 Diogo de Carvalho Kraemer <diogo@kraemer.eng.br>
1356 Nick Clifton <nickc@redhat.com>
1357
1358 PR 868
1359 * dwarf2.c (read_abbrevs): Free the abbreviation table if we run
1360 out of memory.
1361 (decode_line_info): Free the line_info_table before returning a
1362 failure result.
1363 (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
1364 Free the line table. Free the function table. Free the variable
1365 table.
1366
1367 2008-02-17 Mark Kettenis <kettenis@gnu.org>
1368
1369 * elf.c (swap_out_syms): Avoid preprocessing directive within
1370 macro arg.
1371
1372 2008-02-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1373
1374 * elf.c (assign_file_positions_for_load_sections): Set the type of
1375 PT_NOTE sections to SHT_NOTE.
1376
1377 2008-02-17 Ulrich Weigand <uweigand@de.ibm.com>
1378
1379 * simple.c (bfd_simple_get_relocated_section_contents): Set
1380 link_info.output_bfd.
1381
1382 2008-02-16 Nathan Sidwell <nathan@codesourcery.com>
1383
1384 * dwarf2.c (find_line): Don't trust debug information after an
1385 unparseable compilation unit.
1386
1387 2008-02-15 Alan Modra <amodra@bigpond.net.au>
1388
1389 PR 5765
1390 * section.c (SEC_LINK_DUPLICATES): Correct. Renumber following flags.
1391 * bfd-in2.h: Regenerate.
1392
1393 2008-02-15 Alan Modra <amodra@bigpond.net.au>
1394
1395 * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA.
1396 * elf.c (bfd_elf_allocate_object): Don't check for already allocated
1397 tdata.
1398 * elf32-hppa.c (elf32_hppa_mkobject): New function.
1399 (bfd_elf32_mkobject): Define.
1400 * elf32-ppc.c (is_ppc_elf_target): Delete. Replace all uses with..
1401 (is_ppc_elf): ..this new macro.
1402 * elf64-ppc.c (is_ppc64_elf_target): Delete. Replace all uses with..
1403 (is_ppc64_elf): ..this new macro.
1404
1405 2008-02-15 Alan Modra <amodra@bigpond.net.au>
1406
1407 * elflink.c: Replace all accesses to hash->creator field with
1408 output_bfd->xvec.
1409 * cofflink.c: Likewise.
1410 * coff-h8300.c: Likewise.
1411 * ecoff.c: Likewise.
1412 * elf32-m68hc1x.c: Likewise.
1413 * elf32-ppc.c: Likewise.
1414 * elf64-alpha.c: Likewise.
1415 * elf64-ppc.c: Likewise.
1416 * elf64-sparc.c: Likewise.
1417 * elfxx-mips.c: Likewise.
1418 * i386linux.c: Likewise.
1419 * m68klinux.c: Likewise.
1420 * sparclinux.c: Likewise.
1421 * sunos.c: Likewise.
1422 * xcofflink.c: Likewise.
1423 * linker.c: Likewise.
1424 (_bfd_link_hash_table_init): Don't store creator.
1425
1426 2008-02-14 Peter Jones <pjones@redhat.com>
1427
1428 * efi-rtdrv-ia32.c: New file.
1429 * efi-bsdrv-ia32.c: New file.
1430 * efi-rtdrv-ia64.c: New file.
1431 * efi-bsdrv-ia64.c: New file.
1432 * efi-rtdrv-x86_64.c: New file.
1433 * efi-bsdrv-x86_64.c: New file.
1434 * peicode.h (pe_bfd_object_p): Add support for boot service and
1435 runtime service drivers.
1436 * libpei.h: Add macros for EFI formats, and rename the efi application
1437 format macros to disambiguate.
1438 * targets.c: Add bfd_target _vec externs.
1439 (_bfd_tar): Add EFI _vec entries.
1440 * config.bfd: Add EFI vectors into the selection routines.
1441 * configure.in: add EFI _vec entries.
1442 * configure: Regenerate.
1443 * Makefile.am: Add EFI files.
1444 * Makefile.in: Regenerate.
1445
1446 2008-02-14 Nathan Sidwell <nathan@codesourcery.com>
1447
1448 * dwarf1.c (struct dwarf1_debug): Add syms member.
1449 (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory.
1450 (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate
1451 section contents, check for out of memory.
1452
1453 * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte.
1454 (parse_die): Change data pointers to bfd_byte.
1455 (parse_line_table, parse_functions_in_unit): Likewise.
1456
1457 2008-02-14 Alan Modra <amodra@bigpond.net.au>
1458
1459 * elflink.c (compute_bucket_count): Warning fixes.
1460
1461 2008-02-12 DJ Delorie <dj@redhat.com>
1462
1463 * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of
1464 relocation pointing to local symbol in merged section.
1465
1466 * elf32-iq2000.c (iq2000_elf_relocate_offset16): New.
1467 (iq2000_elf_relocate_section): Call it.
1468
1469 2008-02-12 Nick Clifton <nickc@redhat.com>
1470
1471 PR ld/5692
1472 * elf-bfd.h (enum elf_object_id): New enum, used to identify
1473 target specific extensions to the elf_obj_tdata structure.
1474 (struct elf_obj_tdata): New field 'object_id'.
1475 (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
1476 macros for accessing fields in the elf_obj_tdata structure.
1477 (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
1478 (bfd_elf_allocate_object): New function.
1479 * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
1480 and implement by calling bfd_elf_allocate_object.
1481 (bfd_elf_allocate_object): New function: Allocates an
1482 elf_obj_tdata structure, possibly with a target specific
1483 extension.
1484 * elfxx-target.h (bfd_elfNN_mkobject): Use
1485 bfd_elf_make_generic_object as the default value.
1486 * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
1487 for consistency with other, similar structures.
1488 (is_arm_elf): New macro. Checks a BFD to make sure that is an ARM
1489 ELF bfd.
1490 (elf32_arm_mkobject): Call bfd_elf_allocate_object.
1491 (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
1492 the bfd being processed.
1493 (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1494 (bfd_elf32_arm_set_target_relocs): Likewise.
1495 (bfd_elf32_arm_final_link_relocate): Likewise.
1496 (bfd_elf32_arm_copy_private_bfd_data): Likewise.
1497 (bfd_elf32_arm_merge_eabi_attributes): Likewise.
1498 (bfd_elf32_arm_merge_private_bfd_data): Likewise.
1499 (bfd_elf32_arm_check_relocs): Likewise.
1500 (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
1501 (bfd_elf32_arm_size_dynamic_sections): Likewise.
1502 (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
1503 (bfd_elf32_arm_init_maps): Likewise.
1504 (bfd_elf32_arm_final_link_relocate): Likewise.
1505 (bfd_elf32_arm_relocate_section): Likewise.
1506 (bfd_elf32_arm_gc_sweep_hook): Likewise.
1507 (bfd_elf32_arm_check_relocs): Likewise.
1508 (bfd_elf32_arm_size_dynamic_sections): Likewise.
1509 * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
1510 (is_i386_elf): New macro. Checks a BFD to make sure that is an x86
1511 ELF bfd.
1512 (elf_i386_check_relocs): Use is_i386_elf macro to check the bfd
1513 being processed.
1514 (elf_i386_size_dynamic_sections): Likewise.
1515 (elf_i386_relocate_section): Likewise.
1516 (elf_i386_check_relocs): Use elf_symtab_hdr.
1517 (elf_i386_gc_sweep_hook): Likewise.
1518 (elf_i386_size_dynamic_sections): Likewise.
1519 (elf_i386_relocate_section): Likewise.
1520 * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
1521 (elf_create_pointer_linker_section): Use is_ppc_elf_target to
1522 verify that the bfd before accessing target specific fields.
1523 (ppc_elf_check_relocs): Likewise.
1524 (elf_finish_pointer_linker_section): Likewise.
1525 (elf_create_pointer_linker_section): Use elf_symtab_hdr.
1526 (ppc_elf_check_relocs): Likewise.
1527 (ppc_elf_gc_sweep_hook): Likewise.
1528 (ppc_elf_tls_optimize): Likewise.
1529 (ppc_elf_size_dynamic_sections): Likewise.
1530 (ppc_elf_relax_section): Likewise.
1531 (ppc_elf_relocate_section): Likewise.
1532 * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
1533 reminding programmers to keep this structure in sync with the one
1534 defined in elf64-s390.c.
1535 (elf_s390_mkobject): Call bfd_elf_allocate_object.
1536 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
1537 ELF bfd.
1538 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
1539 being processed.
1540 (elf_s390_size_dynamic_sections): Likewise.
1541 (elf_s390_relocate_section): Likewise.
1542 (elf_s390_check_relocs): Use elf_symtab_hdr.
1543 (elf_s390_gc_sweep_hook): Likewise.
1544 (elf_s390_size_dynamic_sections): Likewise.
1545 (elf_s390_relocate_section): Likewise.
1546 * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
1547 (is_sh_elf): New macro. Checks a BFD to make sure that is an SH
1548 ELF bfd.
1549 (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
1550 bfd being processed.
1551 (sh_elf_relocate_section): Likewise.
1552 (sh_elf_check_relocs): Likewise.
1553 (sh_elf_copy_private_data): Likewise.
1554 (sh_elf_relax_section): Use elf_symtab_hdr.
1555 (sh_elf_size_dynamic_sections): Likewise.
1556 (sh_elf_relocate_section): Likewise.
1557 (sh_elf_get_relocated_section_contents): Likewise.
1558 (sh_elf_gc_sweep_hook): Likewise.
1559 (sh_elf_check_relocs): Likewise.
1560 * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
1561 (is_alpha_elf): New macro. Checks a BFD to make sure that is an
1562 Alpha ELF bfd.
1563 (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
1564 the bfd being processed.
1565 (elf64_alpha_create_dynamic_section): Likewise.
1566 (elf64_alpha_check_relocs): Likewise.
1567 (elf64_alpha_size_got_sections): Likewise.
1568 (elf64_alpha_relax_section): Likewise.
1569 (elf64_alpha_relocate_section): Likewise.
1570 (elf64_alpha_final_link): Likewise.
1571 (elf64_alpha_check_relocs): Use elf_symtab_hdr.
1572 (elf64_alpha_relax_section): Likewise.
1573 (elf64_alpha_relocate_section_r): Likewise.
1574 (elf64_alpha_relocate_section): Likewise.
1575 * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
1576 (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
1577 being processed.
1578 (opd_entry_value): Likewise.
1579 (allocate_dynrelocs): Likewise.
1580 (ppc64_elf_relocate_section): Likewise.
1581 (ppc64_elf_check_relocs): Use elf_symtab_hdr.
1582 (opd_entry_value): Likewise.
1583 (ppc64_elf_gc_sweep_hook): Likewise.
1584 (get_sym_h): Likewise.
1585 (ppc64_elf_edit_opd): Likewise.
1586 (ppc64_elf_tls_optimize): Likewise.
1587 (ppc64_elf_edit_toc): Likewise.
1588 (ppc64_elf_size_dynamic_sections): Likewise.
1589 (toc_adjusting_stub_needed): Likewise.
1590 (ppc64_elf_size_stubs): Likewise.
1591 (ppc64_elf_relocate_section): Likewise.
1592 * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
1593 reminding programmers to keep this structure in sync with the one
1594 defined in elf32-s390.c.
1595 (elf_s390_mkobject): Call bfd_elf_allocate_object.
1596 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
1597 ELF bfd.
1598 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
1599 being processed.
1600 (elf_s390_size_dynamic_sections): Likewise.
1601 (elf_s390_relocate_section): Likewise.
1602 (elf_s390_check_relocs): Use elf_symtab_hdr.
1603 (elf_s390_gc_sweep_hook): Likewise.
1604 (elf_s390_size_dynamic_sections): Likewise.
1605 (elf_s390_relocate_section): Likewise.
1606 * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
1607 (is_x86_64_elf): New macro. Checks a BFD to make sure that is an
1608 x86_64 ELF bfd.
1609 (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
1610 being processed.
1611 (elf64_x86_64_size_dynamic_sections): Likewise.
1612 (elf64_x86_64_relocate_section): Likewise.
1613 (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
1614 (elf64_x86_64_gc_sweep_hook): Likewise.
1615 (elf64_x86_64_size_dynamic_sections): Likewise.
1616 (elf64_x86_64_relocate_section): Likewise.
1617 * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
1618 (is_sparc_elf): New macro. Checks a BFD to make sure that is a Sparc
1619 ELF bfd.
1620 (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
1621 bfd being processed.
1622 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1623 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1624 (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
1625 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1626 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1627 (_bfd_sparc_elf_relocate_section): Likewise.
1628
1629 2008-02-12 Alan Modra <amodra@bigpond.net.au>
1630
1631 PR 5303, 5755
1632 * arange-set.c: Delete.
1633 * arange-set.h: Delete.
1634 * dwarf2.c: Revert 2007-09-21 changes.
1635 * Makefile.am: Likewise.
1636 * Makefile.in: Regenerate.
1637 * po/SRC-POTFILES.in: Regenerate.
1638
1639 2008-02-11 Bernd Schmidt <bernd.schmidt@analog.com>
1640
1641 * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
1642 if necessary.
1643 (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
1644 mismatches are detected.
1645
1646 * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
1647 emit invalid relocs or rofixup entries for deleted .eh_frame entries.
1648
1649 2008-02-11 Daniel Jacobowitz <dan@codesourcery.com>
1650
1651 * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
1652 was reached.
1653 * srec.c (srec_scan): Calculate the checksum. Complain on mismatch.
1654
1655 2008-02-07 Alan Modra <amodra@bigpond.net.au>
1656
1657 * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
1658 of _ovly_buf_table size.
1659 (spu_elf_build_stubs): Use low bit of .size as "present" bit.
1660 Adjust initialisations relating to _ovly_buf_table.
1661
1662 2008-02-04 Bob Wilson <bob.wilson@acm.org>
1663
1664 * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
1665 relocation, do not continue processing it. Ignore R_XTENSA_ASM_EXPAND
1666 relocations against dynamic symbols.
1667 (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
1668 .xt.lit section.
1669
1670 2008-02-04 Kai Tietz <kai.tietz@onevision.com>
1671 H.J. Lu <hongjiu.lu@intel.com>
1672
1673 PR 5715
1674 * warning.m4: Enable -Wno-format by default when using gcc on
1675 mingw.
1676 * configure: Regenerated.
1677
1678 2008-02-04 Adam Nemet <anemet@caviumnetworks.com>
1679
1680 * archures.c: Update copyright.
1681 (bfd_mach_mips_octeon): New macro.
1682 * bfd-in2.h: Regenerate.
1683 * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
1684 (mips_set_isa_flags): Likewise.
1685 (mips_mach_extensions): Add Octeon.
1686 * cpu-mips.c: Update copyright.
1687 (I_mipsocteon): New enum constant.
1688 (arch_info_struct): Add Octeon.
1689
1690 2008-02-04 Alan Modra <amodra@bigpond.net.au>
1691
1692 * elf32-spu.c (spu_elf_relocate_section): Correct return type.
1693 Return error status on unexpected relocation errors.
1694
1695 2008-02-04 Alan Modra <amodra@bigpond.net.au>
1696
1697 PR ld/5692
1698 * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31. Instead abort
1699 on non-ELF input.
1700 * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
1701 processing on non-ELF input.
1702
1703 2008-01-31 Marc Gauthier <marc@tensilica.com>
1704
1705 * config.bfd (xtensa*-*-*): Recognize processor variants.
1706
1707 2008-01-31 Nick Clifton <nickc@redhat.com>
1708
1709 PR ld/5692
1710 * elf.c (bfd_elf_get_elf_syms): Check the return value of
1711 get_elf_backend_data.
1712
1713 2008-01-28 Fabian Groffen <grobian@gentoo.org>
1714
1715 * config.bfd (x86_64-*-solaris2): Add support for this target.
1716
1717 2008-01-28 Alan Modra <amodra@bigpond.net.au>
1718
1719 Rewrite SPU overlay handling code. Put overlay calls stubs in the
1720 overlays where possible. Use a faster call stub, or optionally at
1721 compile time, a more compact stub. Double size of _ovly_buf_table
1722 so that low bit of _ovly_table.buf can be used as a "present" bit.
1723 Reserve an extra _ovly_table entry for index zero.
1724 * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
1725 add new ones.
1726 (struct got_entry): New.
1727 (struct spu_stub_hash_entry): Delete.
1728 (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
1729 (spu_elf_link_hash_table_create): Adjust for struct changes.
1730 (spu_stub_name): Delete.
1731 (spu_elf_find_overlays): Don't track sections from overlay regions.
1732 Instead set ovl_buf number in spu elf section data. Error if
1733 overlays in one region don't start at the same address. Adjust
1734 for struct _spu_elf_section_data changes.
1735 (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
1736 (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
1737 (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
1738 (enum _insn_type): New.
1739 (count_stub, build_stub): New functions.
1740 (allocate_spuear_stubs): Use count_stub.
1741 (build_spuear_stubs): Use build_stub.
1742 (populate_stubs, sort_stubs): Delete.
1743 (process_stubs): New function.
1744 (write_one_stub): Delete.
1745 (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
1746 (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
1747 (maybe_insert_function, check_function_ranges): Likewise.
1748 (find_function, pasted_function, build_call_tree): Likewise.
1749 (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
1750 (spu_elf_modify_program_headers): Likewise.
1751 (interesting_section): Detect stub sections differently. Delete
1752 htab param, adjust all callers.
1753 (spu_elf_relocate_section): Rewrite stub handling.
1754 (spu_elf_output_symbol_hook): Likewise.
1755 (bfd_elf32_bfd_link_hash_table_free): Delete.
1756 * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
1757 output-only fields into a union. Add ovl_buf.
1758 (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
1759
1760 2008-01-25 DJ Delorie <dj@redhat.com>
1761
1762 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
1763
1764 2008-01-25 Kai Tietz <kai.tietz@onevision.com>
1765
1766 * bfd-in.h: Add mingw I64 support.
1767 * bfd-in2.h: Regenerated.
1768 * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
1769
1770 2008-01-21 Alan Modra <amodra@bigpond.net.au>
1771
1772 PR 4453
1773 * format.c (bfd_check_format_matches): Don't accept archives as
1774 fully matching unless they have a map.
1775
1776 2008-01-21 Alan Modra <amodra@bigpond.net.au>
1777
1778 * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
1779
1780 2008-01-21 Alan Modra <amodra@bigpond.net.au>
1781
1782 * ecoff.c (_bfd_ecoff_archive_p): Delete.
1783 * libecoff.h (_bfd_ecoff_archive_p): Delete.
1784 * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
1785 * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
1786 (ecoff_biglittle_vec): Likewise.
1787
1788 2008-01-19 Alan Modra <amodra@bigpond.net.au>
1789
1790 PR 5646
1791 * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
1792 non-NULL before dereferencing.
1793
1794 2008-01-15 Alan Modra <amodra@bigpond.net.au>
1795
1796 PR 5604
1797 * elf-bfd.h (struct elf_backend_data): Add gc_keep. Remove param
1798 names from others.
1799 (_bfd_elf_gc_keep): Declare.
1800 * elfxx-target.h (elf_backend_gc_keep): Define.
1801 (elfNN_bed): Init new field.
1802 * elflink.c (_bfd_elf_gc_keep): New function.
1803 (bfd_elf_gc_sections): Call gc_keep.
1804 * elf64-ppc.c (elf_backend_gc_keep): Define.
1805 (struct _ppc64_elf_section_data): Move .opd related fields to
1806 a struct so they don't occupy the same storage. Adjust accesses
1807 throughout file.
1808 (ppc64_elf_gc_keep): New function, split out from..
1809 (ppc64_elf_gc_mark_hook): ..here. Don't call _bfd_elf_gc_mark
1810 to mark .opd section, just set gc_mark.
1811 (ppc64_elf_edit_opd): Remove no_opd_opt parm. Don't set opd->adjust
1812 unless we are changing .opd. Test non-NULL opd->adjust at all
1813 accesses throughout file.
1814 * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
1815
1816 2008-01-15 Alan Modra <amodra@bigpond.net.au>
1817
1818 * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
1819 * bfd-in2.h: Regenerate.
1820
1821 2008-01-11 Tristan Gingold <gingold@adacore.com>
1822 Eric Botcazou <ebotcazou@adacore.com>
1823
1824 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
1825 relocatable.
1826 * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
1827 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
1828 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
1829 * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
1830 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
1831 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
1832 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
1833 * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
1834 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
1835 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
1836 * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
1837 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
1838 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
1839 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
1840 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1841 * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
1842 or executable output with relocations.
1843
1844 2008-01-09 Nick Clifton <nickc@redhat.com>
1845
1846 PR gas/5552
1847 * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
1848 to FALSE for all relocs.
1849
1850 2008-01-09 Richard Sandiford <rsandifo@nildram.co.uk>
1851
1852 PR ld/5526
1853 * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
1854 fields. Rename u.cie.u.merged to u.cie.u.merged_with.
1855 (eh_frame_sec_info): Add a cies field.
1856 (eh_frame_hdr_info): Add a merge_cies field.
1857 * elf-eh-frame.c (cie): Add a reloc_index member to the personality
1858 union.
1859 (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
1860 of hdr_info->cies.
1861 (_bfd_elf_parse_eh_frame): Remove tmp_cie. Ccreate an array of
1862 cie structures in all cases and use it instead of extended_cies.
1863 If merging, store the cie array in sec_info->cies and point each
1864 CIE's eh_fde_cie at the associated element. Do not try to
1865 calculate the value of the personality routine here; record the
1866 offset of the relocation instead. Do not merge CIEs here.
1867 (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
1868 (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
1869 (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
1870 (find_merged_cie): New function.
1871 (_bfd_elf_gc_mark_fdes): Use it. Free sec_info->cies.
1872
1873 2008-01-07 Nick Clifton <nickc@redhat.com>
1874
1875 PR binutils/5535
1876 * vms.c (vms_close_and_cleanup): Check for the presence of a
1877 vms_private_data_struct before examining any of its fields.
1878
1879 2008-01-07 H.J. Lu <hongjiu.lu@intel.com>
1880
1881 PR ld/5522
1882 * elflink.c (elf_link_input_bfd): Don't write out a section if
1883 its output section is marked with SEC_NEVER_LOAD.
1884
1885 For older changes see ChangeLog-2007
1886 \f
1887 Local Variables:
1888 mode: change-log
1889 left-margin: 8
1890 fill-column: 74
1891 version-control: never
1892 End:
This page took 0.069165 seconds and 5 git commands to generate.