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