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