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