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