]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - bfd/ChangeLog
bfd/
[thirdparty/binutils-gdb.git] / bfd / ChangeLog
1 2006-09-07 H.J. Lu <hongjiu.lu@intel.com>
2
3 * elf-bfd.h (elf_link_hash_entry): Add a dynamic field.
4 (bfd_elf_link_mark_dynamic_symbol): New.
5 (SYMBOLIC_BIND): New.
6
7 * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic
8 with SYMBOLIC_BIND (info, h).
9 (elf_i386_relocate_section): Likewise.
10 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
11 (elf64_x86_64_relocate_section): Likewise.
12 * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise.
13
14 * elflink.c (bfd_elf_link_mark_dynamic_symbol): New.
15 (bfd_elf_record_link_assignment): Call
16 bfd_elf_link_mark_dynamic_symbol on new entry.
17 (_bfd_elf_merge_symbol): Likewise.
18 (_bfd_elf_export_symbol): Return if the symbol isn't exported.
19 (_bfd_elf_fix_symbol_flags): Replace info->symbolic with
20 SYMBOLIC_BIND (info, h).
21 (_bfd_elf_dynamic_symbol_p): Likewise.
22 (_bfd_elf_symbol_refs_local_p): Likewise.
23 (bfd_elf_size_dynamic_sections): Updated.
24
25 2006-09-05 Bibo Mao <bibo.mao@intel.com>
26
27 PR binutils/3171
28 * coffcode.h (coff_write_object_contents): Set the optional
29 header magic number to PE32PMAGIC instead of ZMAGIC for ia64.
30
31 2006-09-04 Mark Shinwell <shinwell@codesourcery.com>
32
33 * elf32-arm.c (elf32_arm_howto_table_1): Adjust entries for
34 R_ARM_THM_ALU_PREL_11_0 and R_ARM_THM_PC12 relocations.
35 (elf32_arm_final_link_relocate): Handle R_ARM_THM_ALU_PREL_11_0
36 and R_ARM_THM_PC12 relocations.
37
38 2006-08-24 Bob Wilson <bob.wilson@acm.org>
39
40 * elf32-xtensa.c (xtensa_get_property_section_name): Delete.
41 (xtensa_get_property_section): New.
42 (xtensa_read_table_entries): Use xtensa_get_property_section.
43 (relax_property_section, xtensa_get_property_predef_flags): Handle
44 group name suffixes in property section names.
45 (match_section_group): New.
46
47 2006-08-23 Frediano Ziglio <Frediano.Ziglio@vodafone.com>
48
49 * archive.c (hpux_uid_gid_encode): Fix thinko decrementing "cnt"
50 variable.
51
52 2006-08-22 Daniel Jacobowitz <dan@codesourcery.com>
53
54 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Only copy
55 plt_thumb_refcount from indirect symbols.
56
57 2006-08-22 Alan Modra <amodra@bigpond.net.au>
58
59 * elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA
60 reloc handling.
61 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
62
63 2006-08-21 Mark Shinwell <shinwell@codesourcery.com>
64
65 * elf32-arm.c (elf32_arm_link_hash_table): Correct typo in
66 comment for target1_is_rel.
67
68 2006-08-21 Pedro Alves <pedro_alves@portugalmail.pt>
69
70 * Makefile.am: Add rules to build pe-arm-wince.lo
71 and pei-arm-wince.lo objects.
72 * Makefile.in: Regenerate.
73 * pe-arm-wince.c: New file.
74 * pei-arm-wince.c: New file.
75 * pei-arm.c: Remove ARM_WINCE block.
76 * pe-arm.c: Remove ARM_WINCE block. Rename
77 bfd_arm_pe_allocate_interworking_sections,
78 bfd_arm_pe_get_bfd_for_interworking, and
79 bfd_arm_pe_process_before_allocation to
80 bfd_armpe_allocate_interworking_sections,
81 bfd_armpe_get_bfd_for_interworking, and
82 bfd_armpe_process_before_allocation. Move them before
83 including bfd.h.
84 * bfd.c: ARM wince bfd format names were renamed. Adjust.
85 * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up
86 with unexpected/conflicting relocs.
87 * targets.c: The arm-wince-pe target got its own new vector.
88 Adjust.
89 * config.bfd: Likewise.
90 * configure.in: Likewise.
91 * configure: Regenerate.
92
93 2006-08-18 Paul Brook <paul@codesourcery.com>
94
95 * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue.
96 (elf32_arm_link_hash_newfunc): Initialize export_glue.
97 (record_arm_to_thumb_glue): Return stub symbol.
98 (elf32_arm_create_thumb_stub): New function.
99 (elf32_arm_to_thumb_stub): Use it.
100 (elf32_arm_to_thumb_export_stub): New function.
101 (elf32_arm_begin_write_processing): New function.
102 (allocate_dynrelocs): Allocate Arm stubs.
103 (elf_backend_begin_write_processing): Define.
104 (elf32_arm_symbian_begin_write_processing): Remove ATTRIBUTE_UNUSED.
105 Call elf32_arm_begin_write_processing.
106
107 2006-08-17 Alan Modra <amodra@bigpond.net.au>
108
109 * elf64-ppc.c (create_linkage_sections): Align .glink to 8 bytes.
110 (ppc64_elf_build_stubs): Use new lazy linking stub.
111
112 2006-08-17 Alan Modra <amodra@bigpond.net.au>
113
114 * elf64-ppc.c (ppc64_elf_size_stubs): Ignore non-code sections.
115
116 2006-08-16 H.J. Lu <hongjiu.lu@intel.com>
117
118 PR ld/3015
119 * elf.c (get_program_header_size): Add a PT_GNU_RELRO segment
120 only if there is a PT_DYNAMIC segment.
121 (_bfd_elf_map_sections_to_segments): Likewise.
122 (assign_file_positions_for_load_sections): Set PT_GNU_RELRO
123 segment alignment to 1.
124
125 2006-08-15 Thiemo Seufer <ths@mips.com>
126 Nigel Stephens <nigel@mips.com>
127
128 * elf32-mips.c, elf64-mips.c, elfn32-mips.c
129 (elf_backend_merge_symbol_attribute): Define.
130 * elflink.c (elf_link_add_object_symbols): Merge only the ELF
131 visibility flags.
132 * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function.
133
134 2006-08-15 Thiemo Seufer <ths@mips.com>
135 Nigel Stephens <nigel@mips.com>
136 David Ung <davidu@mips.com>
137
138 * config.bfd: Add configurations for mips*el-sde-elf* and
139 mips*-sde-elf*.
140
141 2006-08-14 DJ Delorie <dj@redhat.com>
142
143 * elf-m10300.c (elf32_mn10300_link_hash_entry): Add value.
144 (elf32_mn10300_count_hash_table_entries): New.
145 (elf32_mn10300_list_hash_table_entries): New.
146 (sort_by_value): New.
147 (mn10300_elf_relax_section): Don't skip data sections; restrict
148 code-specific tests to code-specific areas so that potential
149 indirect calls can be detected. Check for multiple local symbols
150 at the same address and merge their flags.
151 (elf32_mn10300_link_hash_newfunc): Initialize value.
152
153 2006-08-14 Thiemo Seufer <ths@mips.com>
154
155 * elfxx-mips.c (_bfd_mips_elf_symbol_processing,
156 _bfd_mips_elf_add_symbol_hook): Don't try to place small common TLS
157 symbols in .scommon.
158
159 2006-08-11 Thiemo Seufer <ths@mips.com>
160
161 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Set
162 sh_entsize only when sgot was already initialized.
163
164 2006-08-08 DJ Delorie <dj@redhat.com>
165
166 * elf32-sh.c (sh_elf_relax_section): Allow for branches across
167 non-moving .align directives. Preserve any DIR32 offset when
168 converting bsr's to jsr's.
169
170 2006-08-08 Alan Modra <amodra@bigpond.net.au>
171
172 * elf64-ppc.c (ppc64_elf_build_stubs): Clear relbrlt reloc_count
173 after stubs have been built.
174
175 2006-08-07 Nick Clifton <nickc@redhat.com>
176
177 * elf32-sh.c (vxworks_object_p): Only check for vxworks target
178 vectors if they are going to be created.
179
180 2006-08-07 Nick Clifton <nickc@redhat.com>
181
182 * configure.in (bfd_elf32_shnbsd_vec): Fix typo.
183 * configure: Regenerate.
184
185 2006-08-07 Nick Clifton <nickc@redhat.com>
186
187 * coff-arm.c (coff_arm_rtype_to_howto): Only check for ARM_SECREL
188 relocation types if the target is ARM_WINCE.
189
190 2006-08-05 Pedro Alves <pedro_alves@portugalmail.pt>
191
192 * bfd.c (bfd_get_sign_extend_vma): Add cases for pe-arm-little
193 and pei-arm-little.
194 * coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle
195 ARM_SECREL.
196 (coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to
197 ARM_SECREL.
198 * pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
199 * pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in
200 pe-arm.c.
201 [COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
202
203 2006-08-04 Marcelo Tosatti <marcelo@kvack.org>
204
205 * elflink.c (elf_gc_sweep): If info.print_gc_sections is true,
206 list removed sections to stderr.
207
208 2006-08-04 Richard Sandiford <richard@codesourcery.com>
209 Kazu Hirata <kazu@codesourcery.com>
210 Phil Edwards <phil@codesourcery.com>
211 Nathan Sidwell <nathan@codesourcery.com>
212
213 * config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and
214 bfd_elf32_shlvxworks_vec.
215 * configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo.
216 (bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise.
217 (bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise.
218 (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise.
219 (bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise.
220 (bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise.
221 (bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise.
222 (bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas.
223 * configure: Regenerate.
224 * Makefile.am: Regenerate dependencies.
225 * Makefile.in: Regenerate.
226 * elf-vxworks.c (elf_vxworks_gott_symbol_p): New function.
227 (elf_vxworks_add_symbol_hook): Use it.
228 (elf_vxworks_link_output_symbol_hook): Likewise. Use the hash
229 table entry to check for weak undefined symbols and to obtain
230 the original bfd.
231 (elf_vxworks_emit_relocs): Use target_index instead of this_idx.
232 * elf32-sh-relocs.h: New file, split from elf32-sh.c.
233 (R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field,
234 SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the
235 special_function field.
236 (R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too.
237 (R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise.
238 (R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise.
239 (R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise.
240 (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise.
241 (R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise.
242 (SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file.
243 * elf32-sh.c: Include elf32-vxworks.h.
244 (MINUS_ONE): Define.
245 (sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32
246 set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set
247 to sh_elf_reloc.
248 (sh_vxworks_howto_table): New variable. Include elf32-sh-relocs.h
249 with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and
250 SH_ELF_RELOC set to bfd_elf_generic_reloc.
251 (vxworks_object_p, get_howto_table): New functions.
252 (sh_elf_reloc_type_lookup): Fix typo. Use get_howto_table.
253 (sh_elf_info_to_howto): Use get_howto_table.
254 (sh_elf_relax_section): Honor the partial_inplace field of the
255 R_SH_DIR32 howto.
256 (sh_elf_relax_delete_bytes): Likewise.
257 (elf_sh_plt_info): New structure.
258 (PLT_ENTRY_SIZE): Replace both definitions with...
259 (ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for
260 INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
261 (elf_sh_plt0_entry_be): Update sizes of both definitions accordingly.
262 (elf_sh_plt0_entry_le): Likewise.
263 (elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise.
264 (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise.
265 (elf_sh_plts): New structure, with separate definitions for
266 INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
267 (elf_sh_plt0_entry): Delete both definitions.
268 (elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise.
269 (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise.
270 (elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise.
271 (elf_sh_plt_reloc_offset): Likewise.
272 (movi_shori_putval): Delete in favor of...
273 (install_plt_field): ...this new function, with separate definitions
274 for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
275 (get_plt_info): New function, with separate definitions
276 for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
277 (elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete.
278 (VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros.
279 (vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants.
280 (vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise.
281 (vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise.
282 (get_plt_index, get_plt_offset): New functions.
283 (elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields.
284 (sh_elf_link_hash_table_create): Initialize them.
285 (sh_elf_create_dynamic_sections): Call
286 elf_vxworks_create_dynamic_sections for VxWorks.
287 (allocate_dynrelocs): Use htab->plt_info to get the size of PLT
288 entries. Allocate relocation entries in .rela.plt.unloaded if
289 generating a VxWorks executable.
290 (sh_elf_always_size_sections): New function.
291 (sh_elf_size_dynamic_sections): Extend .rela.plt handling to
292 .rela.plt.unloaded.
293 (sh_elf_relocate_section): Use get_howto_table. Honor
294 partial_inplace when calculating the addend for dynamic
295 relocations. Use get_plt_index.
296 (sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field
297 and htab->plt_info. Fill in the bra .plt offset for VxWorks
298 executables. Populate .rela.plt.unloaded. Do not make
299 _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
300 (sh_elf_finish_dynamic_sections): Use install_plt_field and
301 htab->plt_info. Handle cases where there is no special PLT header.
302 Populate the first relocation in .rela.plt.unloaded and fix up
303 the remaining entries.
304 (sh_elf_plt_sym_val): Use get_plt_info.
305 (elf_backend_always_size_sections): Define.
306 (TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks.
307 (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
308 (elf32_bed, elf_backend_want_plt_sym): Likewise.
309 (elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise.
310 (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise.
311 (elf_backend_add_symbol_hook): Likewise.
312 (elf_backend_link_output_symbol_hook): Likewise.
313 (elf_backend_emit_relocs): Likewise.
314 (elf_backend_final_write_processing): Likewise.
315 (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise.
316 * targets.c (bfd_elf32_shlvxworks_vec): Declare.
317 (bfd_elf32_shvxworks_vec): Likewise.
318 (_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and
319 bfd_elf32_shvxworks_vec.
320
321 2006-08-02 Mark Kettenis <kettenis@gnu.org>
322
323 * configure.in (arm-*-openbsd*): Set COREFILE to netbsd-core.lo.
324 * configure: Regenerate.
325
326 2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz>
327
328 PR binutils/2983
329 * elf64-x86-64.c: Add FreeBSD support.
330 (elf64_x86_64_fbsd_post_process_headers): New function.
331 * targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec.
332 * config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec
333 to the targ_selvecs.
334 * configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec.
335 * configure: Regenerate.
336
337 2006-07-26 Andreas Schwab <schwab@suse.de>
338
339 * elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set.
340
341 2006-07-26 Alan Modra <amodra@bigpond.net.au>
342
343 * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments.
344 * elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete.
345 (define elf_backend_modify_segment_map): Don't define.
346
347 2006-07-25 Thiemo Seufer <ths@networkno.de>
348
349 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Allow
350 linking of objects for compatible machine types.
351
352 2006-07-25 Thiemo Seufer <ths@networkno.de>
353
354 * elfxx-mips.c (mips_elf_next_relocation): Tighten check to test
355 also for same symbol.
356
357 2006-07-25 Thiemo Seufer <ths@mips.com>
358
359 * elfxx-mips.c (mips_elf_calculate_relocation): Remove magic constant.
360
361 2006-07-24 Michael Wetherell <mike.wetherell@ntlworld.com>
362
363 * elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific
364 sections only if the SHF_OS_NONCONFORMING flag is present.
365
366 2006-07-24 Nick Clifton <nickc@redhat.com>
367
368 PR ld/2729
369 * peXXigen.c (_bfd_XXi_final_link_postscript): Check for the
370 existance of output sections before putting their entries into the
371 DataDictionary.
372
373 2006-07-20 Thiemo Seufer <ths@mips.com>
374
375 * elf32-mips.c (mips16_jump_reloc): Remove function.
376 (elf_mips16_howto_table_rel): Use _bfd_mips_elf_generic_reloc
377 instead of mips16_jump_reloc.
378 * elf64_mips.c, wlfn32-mips.c (mips16_jump_reloc): Remove function.
379 (elf_mips16_howto_table_rel, elf_mips16_howto_table_rela): Use
380 _bfd_mips_elf_generic_reloc instead of mips16_jump_reloc.
381
382 2006-07-19 Alan Modra <amodra@bigpond.net.au>
383
384 * bfd-in.h (enum notice_asneeded_action): Define.
385 * bfd-in2.h: Regenerate.
386 * elflink.c (elf_link_add_object_symbols): Call linker "notice"
387 function with NULL name for as-needed handling.
388
389 2006-07-18 Paul Brook <paul@codesourcery.com>
390
391 * bfd-in2.h: Regenerate.
392 * libbfd.h: Regenerate.
393 * reloc.c: Add BFD_RELOC_ARM_T32_ADD_IMM.
394
395 2006-07-18 Nick Clifton <nickc@redhat.com>
396
397 * elfxx-mips.c (_bfd_mips_elf_common_definition): New function.
398 Consider SHN_MIPS_ACOMMON and SHN_MIPS_SCOMMON as being common
399 sections.
400 * elfxx-mips.h (_bfd_mips_elf_common_definition): Prototype.
401
402 2006-07-14 Jakub Jelinek <jakub@redhat.com>
403
404 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Fix cinfo.shift2 value.
405
406 2006-07-14 Mark Kettenis <kettenis@gnu.org>
407
408 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Move declarations
409 to the start of a block.
410
411 2006-07-13 Nick Clifton <nickc@redhat.com>
412
413 * coff-sh.c (_bfd_sh_align_load_span): Catch sh_insn_info()
414 returning a NULL value.
415
416 2006-07-12 H.J. Lu <hongjiu.lu@intel.com>
417
418 PR ld/2884
419 * elflink.c (_bfd_elf_merge_symbol): Copy the symbol info from
420 the old versioned dynamic definition to the new one with
421 non-default visibility. Hide the symbol if it is hidden or
422 internal.
423
424 2006-07-12 Matthew R. Dempsky <mrd@alkemio.org>
425
426 * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.
427
428 2006-07-10 Jakub Jelinek <jakub@redhat.com>
429
430 * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH.
431 (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers):
432 Handle SHT_GNU_HASH.
433 (special_sections_g): Include .gnu.hash section.
434 (bfd_elf_gnu_hash): New function.
435 * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes.
436 (struct elf_backend_data): Add elf_hash_symbol method.
437 * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash
438 only if info->emit_hash, create .gnu.hash section if
439 info->emit_gnu_hash.
440 (struct collect_gnu_hash_codes): New type.
441 (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms,
442 _bfd_elf_hash_symbol): New functions.
443 (compute_bucket_count): Don't compute HASHCODES array, instead add
444 that and NSYMS as arguments. Use bed->s->sizeof_hash_entry
445 instead of bed->s->arch_size / 8. Fix .hash size estimation.
446 When not optimizing, use the number of hashed symbols rather than
447 dynsymcount.
448 (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash,
449 and ADD DT_GNU_HASH if info->emit_gnu_hash.
450 (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash,
451 adjust compute_bucket_count caller. Create and populate .gnu.hash
452 section if info->emit_gnu_hash.
453 (elf_link_output_extsym): Only populate .hash section if
454 finfo->hash_sec != NULL.
455 (bfd_elf_final_link): Adjust assertion. Handle DT_GNU_HASH.
456 * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined.
457 (elfNN_bed): Add elf_backend_hash_symbol.
458 * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function.
459 (elf_backend_hash_symbol): Define.
460 * elf32-i386.c (elf_i386_hash_symbol): New function.
461 (elf_backend_hash_symbol): Define.
462
463 2006-07-05 Nick Clifton <nickc@redhat.com>
464
465 PR ld/2659
466 * cofflink.c (_bfd_coff_link_input_bfd): Fix selection of aux
467 entry when multiple definitions of a symbol are encountered.
468
469 2006-06-30 H.J. Lu <hongjiu.lu@intel.com>
470
471 * elf32-i386.c (elf_i386_relocate_section): Use xchg %ax,%ax
472 instead of 2 nops.
473 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
474 (elf64_x86_64_plt0_entry): Use nopl 0(%rax) instead of 4 nops.
475
476 2006-06-29 Jakub Jelinek <jakub@redhat.com>
477
478 PR ld/2513
479 * elf32-i386.c (GOT_TLS_MASK, GOT_TLS_IE_IE, GOT_TLS_IE_GD,
480 GOT_TLS_IE_MASK, elf_i386_check_relocs, allocate_dynrelocs): Revert
481 2006-04-08 changes.
482 (elf_i386_relocate_section): Likewise. For GD->IE transition
483 change subl into addl whenever tls_type is GOT_TLS_IE_POS.
484
485 2006-06-23 Alan Modra <amodra@bigpond.net.au>
486
487 PR ld/2754
488 * elf.c (bfd_elf_mkobject): Don't alloc if already done. Set
489 program_header_size to -1.
490 (_bfd_elf_map_sections_to_segments): Adjust program_header_size check.
491 (assign_file_positions_for_load_sections ): Likewise.
492 (_bfd_elf_sizeof_headers): Use saved program_header_size if
493 available.
494 * elf32-arm.c (elf32_arm_mkobject): Call bfd_elf_mkobject, don't
495 alloc if already done.
496 * elf32-i386.c (elf_i386_mkobject): Likewise.
497 * elf32-ppc.c (ppc_elf_mkobject): Likewise.
498 * elf32-s390.c (elf_s390_mkobject): Likewise.
499 * elf32-sh.c (sh_elf_mkobject): Likewise.
500 * elf64-alpha.c (elf64_alpha_mkobject): Likewise.
501 * elf64-ppc.c (ppc64_elf_mkobject): Likewise.
502 * elf64-s390.c (elf_s390_mkobject): Likewise.
503 * elf64-x86-64.c (elf64_x86_64_mkobject): Likewise.
504 * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Likewise.
505
506 2006-06-20 Jakub Jelinek <jakub@redhat.com>
507
508 * elflink.c (elf_link_add_object_symbols): Don't create .tcommon
509 section for relocatable link.
510
511 2006-06-21 Alan Modra <amodra@bigpond.net.au>
512
513 * elf-bfd.h (struct elf_backend_data): Add
514 elf_backend_modify_program_headers.
515 * elfxx-target.h (elf_backend_modify_program_headers): Define.
516 (elfNN_bed): Init new field.
517 * elf.c (elf_modify_segment_map): Remove comment.
518 (assign_file_positions_for_load_sections): Only call
519 elf_modify_segment_map for objcopy/strip.
520 (assign_file_positions_except_relocs): Call
521 elf_backend_modify_program_headers.
522 * elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make
523 .stack section.
524 (elf32_frvfdpic_modify_segment_map): Delete.
525 (elf32_frvfdpic_modify_program_headers): New.
526 (elf_backend_modify_segment_map): Don't define.
527 (elf_backend_modify_program_headers): Define.
528 * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make
529 .stack section.
530 (elf32_bfinfdpic_modify_segment_map): Delete.
531 (elf32_bfinfdpic_modify_program_headers): New.
532 (elf_backend_modify_segment_map): Don't define.
533 (elf_backend_modify_program_headers): Define.
534 * elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function.
535 Split out from..
536 (elfNN_ia64_modify_segment_map): ..here.
537 (elf_backend_modify_program_headers): Define.
538
539 2006-06-20 Jakub Jelinek <jakub@redhat.com>
540
541 * bfd.c (bfd_record_phdr): Clear p_align and p_align_valid fields.
542 * elf.c (_bfd_elf_link_hash_table_init): Clear hplt field.
543
544 2006-06-20 Alan Modra <amodra@bigpond.net.au>
545
546 * elf-bfd.h: Formatting.
547 (_bfd_elf_map_sections_to_segments): Declare.
548 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't
549 clear program_header_size.
550 * elf.c (get_program_header_size): Move. Don't use or set saved
551 program_header_size here.
552 (elf_modify_segment_map): New function. Split out from..
553 (assign_file_positions_for_load_sections): ..here. Assert
554 header size is correct. Remove dead code.
555 (_bfd_elf_map_sections_to_segments): Rename from
556 map_sections_to_segments. Make global. Use get_program_header_size
557 when we need estimate of header size. Call elf_modify_segment_map.
558 Set program_header_size.
559 (print_segment_map): Delete.
560 (_bfd_elf_sizeof_headers): If segment_map available, get the
561 actual size.
562 * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe
563 for calling more than once.
564 * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise.
565 * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise.
566 * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise.
567 * elf32-i370.c (elf_backend_add_symbol_hook): Delete.
568 (elf_backend_additional_program_headers): Delete.
569 (elf_backend_modify_segment_map): Delete.
570 * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C.
571 * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise.
572 * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties.
573
574 2006-06-19 Vladimir Prus <vladimir@codesourcery.com>
575
576 * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low
577 bit for undefined symbols.
578
579 2006-06-19 Alan Modra <amodra@bigpond.net.au>
580
581 * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer
582 parameter.
583 (_bfd_elf_sizeof_headers): Replace bfd_boolean param with
584 bfd_link_info pointer.
585 * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise.
586 * bfd.c (bfd_sizeof_headers): Tweak param name.
587 * aout-adobe.c (aout_adobe_sizeof_headers): Adjust.
588 * aoutx.h (NAME (aout, sizeof_headers)): Adjust.
589 * binary.c (binary_sizeof_headers): Adjust.
590 * bout.c (b_out_sizeof_headers): Adjust.
591 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust.
592 * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust.
593 * coffgen.c (coff_sizeof_headers): Adjust.
594 * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust.
595 (ecoff_compute_section_file_positions): Adjust.
596 (_bfd_ecoff_write_object_contents): Adjust.
597 * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust.
598 * elf32-arm.c (elf32_arm_additional_program_headers): Adjust.
599 * elf32-i370.c (elf_backend_additional_program_headers): Adjust.
600 * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust.
601 * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust.
602 * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust.
603 * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust.
604 * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust.
605 * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust.
606 * i386msdos.c: Convert to ISO C.
607 (msdos_sizeof_headers): Adjust.
608 * i386os9k.c: Convert to ISO C.
609 (os9k_sizeof_headers): Adjust.
610 * ieee.c (ieee_sizeof_headers): Adjust.
611 * ihex.c (ihex_sizeof_headers): Adjust.
612 * libaout.h (NAME (aout, sizeof_headers)): Adjust.
613 * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust.
614 * libcoff-in.h (coff_sizeof_headers): Adjust.
615 * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust.
616 * mach-o.c (bfd_mach_o_sizeof_headers): Adjust.
617 * mmo.c (mmo_sizeof_headers): Adjust.
618 * oasys.c (oasys_sizeof_headers): Adjust.
619 * pdp11.c (NAME (aout, sizeof_headers)): Adjust.
620 * pef.c (bfd_pef_sizeof_headers): Adjust.
621 * ppcboot.c (ppcboot_sizeof_headers): Adjust.
622 * som.c (som_sizeof_headers): Adjust.
623 * srec.c (srec_sizeof_headers): Adjust.
624 * tekhex.c (tekhex_sizeof_headers): Adjust.
625 * versados.c (versados_sizeof_headers): Adjust.
626 * vms.c (vms_sizeof_headers): Adjust.
627 * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust.
628 * xsym.c (bfd_sym_sizeof_headers): Adjust.
629 * xsym.h (bfd_sym_sizeof_headers): Adjust.
630 * bfd-in2.h: Regenerate.
631 * libbfd.h: Regenerate.
632 * libcoff.h: Regenerate.
633
634 2006-06-15 Mark Shinwell <shinwell@codesourcery.com>
635
636 * bfd-in2.h: Regenerate.
637 * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0,
638 R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2,
639 R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0,
640 R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0,
641 R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC,
642 R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1,
643 R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1,
644 R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1,
645 R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1,
646 R_ARM_LDC_SB_G2): New relocation types.
647 (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and
648 adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1
649 and friends.
650 (elf32_arm_howto_table_3): Delete; contents merged into
651 elf32_arm_howto_table_2.
652 (elf32_arm_howto_from_type): Adjust correspondingly.
653 (elf32_arm_reloc_map): Extend with the above relocations.
654 (calculate_group_reloc_mask): New function.
655 (identify_add_or_sub): New function.
656 (elf32_arm_final_link_relocate): Support for the above
657 relocations.
658 * reloc.c: Add enumeration entries for BFD_RELOC_ARM_...
659 codes to correspond to the above relocations.
660
661 2006-06-14 Richard Sandiford <richard@codesourcery.com>
662
663 * elf32-m68k.c (elf_m68k_plt_info): New structure.
664 (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends.
665 (elf_m68k_plt_entry): Likewise.
666 (elf_m68k_plt_info): New table.
667 (CFV4E_PLT_ENTRY_SIZE): Rename to...
668 (ISAB_PLT_ENTRY_SIZE): ...this.
669 (CFV4E_FLAG): Delete.
670 (elf_cfv4e_plt0_entry): Rename to...
671 (elf_isab_plt0_entry): ...this. Adjust comments. Use (-6,%pc,%d0)
672 for the second instruction too.
673 (elf_cfv4e_plt_entry): Rename to...
674 (elf_isab_plt_entry): ...this. Adjust comments and use (-6,%pc,%d0).
675 (elf_isab_plt_info): New table.
676 (CPU32_FLAG): Delete.
677 (PLT_CPU32_ENTRY_SIZE): Rename to...
678 (CPU32_PLT_ENTRY_SIZE): ...this.
679 (elf_cpu32_plt0_entry): Update bounds accordingly. Add R_68K_PC32-
680 style in-place addends.
681 (elf_cpu32_plt_entry): Likewise.
682 (elf_cpu32_plt_info): New table.
683 (elf_m68k_link_hash_table): Add a plt_info field.
684 (elf_m68k_link_hash_table_create): Initialize it.
685 (elf_m68k_get_plt_info): New function.
686 (elf_m68k_always_size_sections): Likewise.
687 (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field.
688 (elf_m68k_install_pc32): New function.
689 (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and
690 elf_m68k_install_pc32.
691 (elf_m68k_finish_dynamic_sections): Likewise.
692 (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info.
693 (elf_backend_always_size_sections): Define.
694
695 2006-06-14 Alan Modra <amodra@bigpond.net.au>
696
697 * elflink.c (elf_link_add_object_symbols): Save and restore
698 struct bfd_hash_table table, size and count fields for
699 as-needed libs.
700
701 2006-06-12 Thiemo Seufer <ths@mips.com>
702
703 * elf32-mips.c: Expand comment about ABI-mandated pagesize values.
704 (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): define in a more obvious way.
705 * elf64-mips.c, elfn32-mips.c (ELF_MAXPAGESIZE): Fix value for IRIX6.
706 Delete old comments.
707 (ELF_COMMONPAGESIZE): Define in a more obvious way.
708
709 2006-06-12 Nick Clifton <nickc@redhat.com>
710
711 PR binutils/2735
712 * elflink.c (elf_link_add_object_symbols): Fix the warning message
713 about mismatched alignments to allow for the case where the common
714 alignment has been deduced from the section alignment.
715 * bfd.c (_bfd_default_error_handler): Update comment to explain
716 why bfd and asection varargs are out of order. Explicitly catch
717 and abort on NULL bfd and asection arguments.
718
719 2006-06-11 Richard Sandiford <richard@codesourcery.com>
720 Thiemo Seufer <ths@mips.com>
721
722 * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size.
723 (STUB_ORI): New macro.
724 (STUB_LI16U): Fix formatting.
725 (MIPS_FUNCTION_STUB_SIZE): Delete.
726 (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise.
727 (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro.
728 (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
729 (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size
730 instead of MIPS_FUNCTION_STUB_SIZE.
731 (count_section_dynsyms): New function, split out from
732 _bfd_mips_elf_final_link.
733 (_bfd_mips_elf_always_size_sections): Get a worst-case estimate
734 of the number of dynamic symbols needed and use it to set up
735 function_stub_size. Use function_stub_size rather than
736 MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section.
737 Use 16-byte stubs for 0x10000 dynamic symbols.
738 (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size
739 instead of MIPS_FUNCTION_STUB_SIZE. Fix formatting.
740 (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Change the
741 size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to
742 MIPS_FUNCTION_STUB_BIG_SIZE. Tweak the check for unhandled dynindxes.
743 Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20.
744 Use STUB_ORI rather than STUB_LI16U for big stubs.
745 (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size.
746 (_bfd_mips_elf_final_link): Use count_section_dynsyms.
747
748 2006-06-09 David Ung <davidu@mips.com>
749
750 * bfd/elfxx-mips.c (mips_elf_calculate_relocation): Fix mode for stub
751 calling relocations.
752
753 2006-06-08 David Daney <ddaney@avtrex.com>
754
755 * elfxx-mips.c (STUB_LI16): Removed.
756 (STUB_LUI): New macro.
757 (STUB_LI16U): Ditto.
758 (STUB_LI16S): Ditto.
759 (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter.
760 (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to
761 MIPS_FUNCTION_STUB_SIZE.
762 (_bfd_mips_elf_always_size_sections): Ditto.
763 (_bfd_mips_elf_size_dynamic_sections): Ditto.
764 (_bfd_mips_elf_finish_dynamic_sections): Ditto.
765 (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation
766 to allow larger symbol table indexes.
767
768 2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
769
770 * po/Make-in (pdf, ps): New dummy targets.
771
772 2006-06-06 Alan Modra <amodra@bigpond.net.au>
773
774 * hash.c (bfd_hash_lookup): Correct stray line.
775
776 * elf.c (_bfd_elf_init_private_section_data): Comment typo.
777 (elfcore_grok_nto_status): Use long instead of pid_t.
778 (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise.
779
780 2006-06-05 Daniel Jacobowitz <dan@codesourcery.com>
781
782 * po/Make-in (top_builddir): Define.
783
784 2006-06-05 Alan Modra <amodra@bigpond.net.au>
785
786 * Makefile.am: Run "make dep-am".
787 * Makefile.in: Regenerate.
788 * config.in: Regenerate.
789
790 2006-06-02 Alan Modra <amodra@bigpond.net.au>
791 H.J. Lu <hongjiu.lu@intel.com>
792
793 PR ld/2723
794 * elflink.c (bfd_elf_final_link): Don't output section symbols
795 for special ELF sections.
796
797 2006-06-01 Alan Modra <amodra@bigpond.net.au>
798
799 * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags
800 instead of bfd_make_section*.
801 * aix386-core.c: Likewise.
802 * aix5ppc-core.c: Likewise.
803 * aout-adobe.c: Likewise.
804 * aoutf1.h: Likewise.
805 * binary.c: Likewise.
806 * cisco-core.c: Likewise.
807 * coff-arm.c: Likewise.
808 * coff-h8300.c: Likewise.
809 * elf.c: Likewise.
810 * elf32-bfin.c: Likewise.
811 * elf32-m32c.c: Likewise.
812 * hppabsd-core.c: Likewise.
813 * hpux-core.c: Likewise.
814 * i386linux.c: Likewise.
815 * ieee.c: Likewise.
816 * ihex.c: Likewise.
817 * irix-core.c: Likewise.
818 * lynx-core.c: Likewise.
819 * m68klinux.c: Likewise.
820 * mach-o.c: Likewise.
821 * netbsd-core.c: Likewise.
822 * nlmcode.h: Likewise.
823 * opncls.c: Likewise.
824 * osf-core.c: Likewise.
825 * peXXigen.c: Likewise.
826 * ppcboot.c: Likewise.
827 * ptrace-core.c: Likewise.
828 * rs6000-core.c: Likewise.
829 * sco5-core.c: Likewise.
830 * sparclinux.c: Likewise.
831 * srec.c: Likewise.
832 * sunos.c: Likewise.
833 * trad-core.c: Likewise.
834 * xcofflink.c: Likewise.
835 * xsym.c: Likewise.
836
837 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
838
839 * Makefile.am (INCLUDES): Use @INCINTL@.
840 * acinclude.m4: Include new gettext macros.
841 * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS.
842 Manually substitute POFILES and GMOFILES.
843 * Makefile.in, aclocal.m4, configure, doc/Makefile.in: Regenerated.
844
845 2006-05-30 H.J. Lu <hongjiu.lu@intel.com>
846
847 * bfd.c (bfd_emul_get_maxpagesize): New.
848 (bfd_elf_set_pagesize): Likewise.
849 (bfd_emul_set_maxpagesize): Likewise.
850 (bfd_emul_get_commonpagesize): Likewise.
851 (bfd_emul_set_commonpagesize): Likewise.
852 * bfd-in2.h: Regenerated.
853
854 * elf-bfd.h (elf_backend_data): Add commonpagesize.
855 (xvec_get_elf_backend_data): New.
856 (get_elf_backend_data): Use xvec_get_elf_backend_data.
857
858 * elf32-arm.c (elf32_arm_vxworks_bed): Remove const.
859 * elfxx-target.h (elfNN_bed): Likewise.
860
861 * elf32-arm.c (ELF_COMMONPAGESIZE): Defined.
862 * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise.
863 * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise.
864 * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise.
865 * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise.
866 * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise.
867 * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise.
868 * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
869 * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise.
870 * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise.
871 * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise.
872 * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise.
873
874 * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined.
875 (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE.
876
877 * targets.c (bfd_find_target): Support NULL abfd.
878
879 2006-05-30 Nick Clifton <nickc@redhat.com>
880
881 * po/es.po: Updated Spanish translation.
882
883 2006-05-27 Alan Modra <amodra@bigpond.net.au>
884 H.J. Lu <hongjiu.lu@intel.com>
885
886 * elf.c (assign_file_positions_for_load_sections): Retrieve
887 maxpagesize from m->p_align if it is valid. Set p_vaddr,
888 p_paddr and p_align earlier. Revert 2006-05-19 change to p_align.
889 (copy_elf_program_header): Copy p_align. Set p_align_valid.
890
891 2006-05-26 H.J. Lu <hongjiu.lu@intel.com>
892
893 * elf64-x86-64.c (ELF_MINPAGESIZE): Changed to 0x1000.
894
895 2006-05-25 H.J. Lu <hongjiu.lu@intel.com>
896
897 * elf64-x86-64.c (ELF_MINPAGESIZE): Set to 0x100000.
898
899 2006-05-25 H.J. Lu <hongjiu.lu@intel.com>
900
901 * elf64-x86-64.c (ELF_MAXPAGESIZE): Updated to 0x200000.
902
903 2006-05-26 Alan Modra <amodra@bigpond.net.au>
904
905 * elf.c (sym_is_global): Return a bfd_boolean.
906 (ignore_section_sym): New function.
907 (elf_map_symbols): Use ignore_section_sym to discard some syms.
908 (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to
909 bfd before using elf_section_syms.
910
911 2006-05-25 H.J. Lu <hongjiu.lu@intel.com>
912
913 * config.bfd: (sh-*-linux*): Treat as 64bit target.
914 (sh*l*-*-netbsdelf*): Likewise.
915 (sh-*-netbsdelf*): Likewise.
916 (shl*-*-elf*): Likewise.
917 (sh[1234]l*-*-elf*): Likewise.
918 (sh3el*-*-elf*): Likewise.
919 (shl*-*-kaos*): Likewise.
920 (sh-*-elf*): Likewise.
921 (sh[1234]*-elf*): Likewise.
922 (sh-*-rtems*): Likewise.
923 (sh-*-kaos*): Likewise.
924
925 2006-05-24 H.J. Lu <hongjiu.lu@intel.com>
926
927 PR ld/1485
928 * config.bfd: Set want64 to true if 64bit bfd is used.
929 (sh-*-linux*): Use targ64_selvecs for 64bit targets.
930 (sh*l*-*-netbsdelf*): Likewise.
931 (sh-*-netbsdelf*): Likewise.
932 (shl*-*-elf*): Likewise.
933 (sh[1234]l*-*-elf*): Likewise.
934 (sh3el*-*-elf*): Likewise.
935 (shl*-*-kaos*): Likewise.
936 (sh-*-elf*): Likewise.
937 (sh[1234]*-elf*): Likewise.
938 (sh-*-rtems*): Likewise.
939 (sh-*-kaos*): Likewise.
940
941 2006-05-24 Paul Brook <paul@codesourcery.com>
942
943 * elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms
944 * elf32-arm.c (output_arch_syminfo): Define.
945 (elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map,
946 elf32_arm_output_arch_local_syms): New functions.
947 (elf_backend_output_arch_local_syms): Define.
948 * elflink.c (bfd_elf_final_link): Call
949 elf_backend_output_arch_local_syms.
950 * elfxx-target.h (elf_backend_output_arch_local_syms): Provide default
951 definition.
952 (elfNN_bed): Add elf_backend_output_arch_local_syms.
953
954 2006-05-24 Paul Brook <paul@codesourcery.com>
955
956 * elf32-arm.c (put_arm_insn, put_thumb_insn): New functions.
957 (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
958 elf32_arm_finish_dynamic_symbol): Use them.
959
960 2006-05-24 Carlos O'Donell <carlos@systemhalted.org>
961 Randolph Chung <tausq@debian.org>
962
963 * elf-hppa.h (reloc_hppa_howto_table): Check bitfield for
964 TPREL21L/TPREL14R relocations. Handle LTOFF_TP14R relocations.
965 Add handling for TLS relocations.
966 (elf_hpp_reloc_final_type): Handle TLS relocs.
967 * elf32-hppa.c: Add authors for cleanup and TLS support.
968 (hppa_elf_local_got_tls_type, hh_name, eh_name): Define.
969 (elf32_hppa_link_hash_entry): Add tls_type.
970 (elf32_hppa_link_hash_table): Add tld_ldm_got.
971 (hppa_link_has_newfunc): Set tls_type.
972 (elf32_hppa_link_hash_table_create): Set tls_ldm_got refcount.
973 (hppa_stub_name): Use hh_name macro.
974 (elf32_hppa_copy_indirect_symbol): Copy TLS information.
975 (elf32_hppa_check_relocs): Call elf32_hppa_optimized_tls_reloc.
976 Handle TLS relocs.
977 (elf32_hppa_gc_sweep_hook): Likewise.
978 (allocate_dynrelocs): Handle TLS relocs.
979 (elf32_hppa_size_dynamic_sections): Count space required by TLS
980 relocs. Use hh_name macro.
981 (dtpoff_base): New function.
982 (tpoff): Likewise.
983 (elf32_hppa_optimized_tls_reloc): Likewise.
984 (final_link_relocate): Handle TLS relocs.
985 (elf32_hppa_relocate_section): Handle TLS relocs. Use eh_name
986 and hh_name macros.
987 (elf32_hppa_finish_dynamic_symbol): Setup TLS got entries. Use
988 hh_name and eh_name macros.
989 (elf32_hppa_reloc_type_clas): Handle TLS relocs.
990
991 2006-05-24 Bjoern Haase <bjoern.m.haase@web.de>
992
993 * archures.c: Add bfd_mach_avr6.
994 * cpu-avr.c: Likewise.
995 * reloc.c (BFD_RELOC_AVR_LO8_LDI_GS, BFD_RELOC_AVR_HI8_LDI_GS):
996 New relocations.
997 * libbfd.h: Regenerate.
998 * bfd-in2.h:Regenerate.
999 * elf32-avr.h: New file. Protoypes for functions accessed from ld.
1000 * elf32-avr.c: Add elf32-avr.h to include list.
1001 (elf32_avr_stub_hash_entry): New function.
1002 (elf32_avr_link_hash_table): New struct.
1003 (avr_link_hash_table): Likewise.
1004 (avr_stub_hash_entry): Likewise.
1005 (avr_stub_hash_lookup): New function.
1006 (stub_hash_newfunc): New function.
1007 (elf32_avr_link_hash_table_create): New function.
1008 (elf32_avr_link_hash_table_free): New function.
1009 (avr_get_stub_addr): New function.
1010 (debug_relax, debug_stubs): Add new global variables controlling
1011 debugging printout to stdout.
1012 (avr_pc_wrap_around): Change the type to bfd_vma.
1013 (avr_replace_call_ret_sequences): Add a new variable controling
1014 linkrelax optimizations.
1015 (avr_stub_is_required_for_16_bit_reloc): New function.
1016 (avr_final_link_relocate):
1017 Add linker hash table to parameter list. Use stub addr. if necessary.
1018 (elf32_avr_relocate_section):
1019 Add linker hashtable to parameter list of avr_final_link_relocate.
1020 (bfd_elf_avr_final_write_processing): Add support for bfd_mach_avr6.
1021 (elf32_avr_object_p): Add support for E_AVR_MACH_AVR6.
1022 (elf32_avr_relax_delete_bytes):
1023 Iterate over all sections of a bfd when adjusting relocs addends.
1024 (elf32_avr_relax_section):
1025 Evaluate avr_replace_call_ret_sequences and recalculate the size of
1026 stub section.
1027 (avr_stub_name): New function.
1028 (avr_get_stub_entry): New function.
1029 (avr_add_stub): New function.
1030 (avr_build_one_stub): New function.
1031 (avr_size_one_stub): New function.
1032 (elf32_avr_setup_params): New function.
1033 (elf32_avr_setup_section_lists): New function.
1034 (get_local_syms): New function.
1035 (elf32_avr_size_stubs): New function.
1036 (bfd_elf32_bfd_link_hash_table_create): New function.
1037 (bfd_elf32_bfd_link_hash_table_free): New function.
1038
1039 2006-05-23 H.J. Lu <hongjiu.lu@intel.com>
1040
1041 PR ld/2655
1042 PR ld/2657
1043 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly
1044 update CIE/FDE length. Don't pad to the section alignment.
1045
1046 2006-05-23 Jie Zhang <jie.zhang@analog.com>
1047
1048 * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for
1049 deteted entries in .eh_frame section.
1050
1051 2006-05-23 Jie Zhang <jie.zhang@analog.com>
1052
1053 * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_
1054 instead of _GLOBAL_OFFSET_TABLE_.
1055 (bfin_relocate_section): Ditto.
1056 (_bfin_create_got_section): Ditto.
1057 (elf32_bfinfdpic_create_dynamic_sections): Use
1058 __PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_.
1059 (bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC.
1060
1061 2006-05-23 Alan Modra <amodra@bigpond.net.au>
1062
1063 * elf64-ppc.c (compare_symbols): Prefer strong dynamic global
1064 function syms over other syms.
1065
1066 2006-05-22 Daniel Jacobowitz <dan@codesourcery.com>
1067
1068 * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL
1069 check.
1070 (bfd_elf_final_link): Add a late DT_TEXTREL check.
1071 * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define.
1072 (mips_elf_create_dynamic_relocation): Set DF_TEXTREL.
1073 (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION.
1074 Use MIPS_ELF_READONLY_SECTION.
1075 (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after
1076 creating DT_TEXTREL.
1077 (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers
1078 if no text relocations were generated.
1079
1080 2006-05-19 H.J. Lu <hongjiu.lu@intel.com>
1081
1082 * elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment.
1083
1084 2006-05-19 Alan Modra <amodra@bigpond.net.au>
1085
1086 * elf.c (elf_fake_sections): Formatting.
1087 (assign_file_positions_for_load_sections): Only add SEC_ALLOC
1088 sections to p_memsz. Remove hack for PT_NOTE sections. Allow
1089 section alignment to increase p_align for PT_LOAD.
1090 (assign_file_positions_for_non_load_sections): Remove ARM BPABI
1091 hack for PT_DYNAMIC. Instead, set p_filesz for all segments
1092 other than PT_LOAD, and PT_NOTE in core.
1093
1094 2006-05-17 Alan Modra <amodra@bigpond.net.au>
1095
1096 * elf.c (assign_file_positions_for_segments): Split into..
1097 (assign_file_positions_for_load_sections): ..this, and..
1098 (assign_file_positions_for_non_load_sections): ..this new function,..
1099 (assign_file_positions_except_relocs): ..writing program headers here.
1100
1101 2006-05-17 Alan Modra <amodra@bigpond.net.au>
1102
1103 * elflink.c (elf_gc_sweep): Don't specially keep non-alloc,
1104 non-load sections if they have relocs.
1105
1106 2006-05-15 Paul Brook <paul@codesourcery.com>
1107
1108 * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ...
1109 (bfd_is_arm_special_symbol_name): ... to this. Add type argument.
1110 Check symbol name is of specified type.
1111 * elf32-arm.c (elf32_arm_is_target_special_symbol,
1112 arm_elf_find_function, elf32_arm_output_symbol_hook): Use
1113 bfd_is_arm_special_symbol_name.
1114 * bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP,
1115 BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER,
1116 BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define.
1117 (bfd_is_arm_mapping_symbol_name): Remove prototype.
1118 (bfd_is_arm_special_symbol_name): Add prototype.
1119 * bfd-in2.h: Regenerate.
1120
1121 2006-05-15 David Heine <dlheine@tensilica.com>
1122 Bob Wilson <bob.wilson@acm.org>
1123
1124 * elf32-xtensa.c (check_loop_aligned): Fix reversed check for
1125 undefined opcode. Clean up assertions.
1126 (narrow_instruction, widen_instruction): Remove "do_it" parameters.
1127 Factor most of the code into separate functions....
1128 (can_narrow_instruction, can_widen_instruction): New.
1129 (prev_instr_is_a_loop): New.
1130 (compute_ebb_proposed_actions): Combine error handling code for
1131 decode errors. Replace call to insn_decode_len with inline code.
1132 Use can_narrow_instruction and can_widen_instruction. Handle errors
1133 from call to xtensa_opcode_is_loop.
1134 (relax_section): Adjust calls to narrow_instruction and
1135 widen_instruction.
1136
1137 2006-05-15 Alan Modra <amodra@bigpond.net.au>
1138
1139 PR 2658
1140 * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
1141 -shared link.
1142
1143 2006-05-11 Michael Matz <matz@suse.de>
1144
1145 * elflink.c (match_group_member): Correctly iterate group
1146 members.
1147
1148 2006-05-11 Paul Brook <paul@codesourcery.com>
1149
1150 * elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs.
1151 (elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs.
1152 (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
1153 * reloc.c: Ditto.
1154 * bfd-in2.h: Regenerate.
1155 * libbfd.h: Regenerate.
1156 * libcoff.h: Regenerate.
1157
1158 2006-05-11 Mike Bland <mbland@google.com>
1159
1160 * elf.c (_bfd_elf_init_private_section_data): Don't change
1161 section type if already set.
1162
1163 2006-05-10 Nick Clifton <nickc@redhat.com>
1164
1165 PR ld/2607
1166 * elfcode.h (valid_section_index_p): New function: Checks for a
1167 valid section index. Allows indicies in the range SHN_LOPROC to
1168 SHN_HIOS.
1169 (elf_object_p): Use valid_section_index_p.
1170
1171 2006-05-11 Pedro Alves <pedro_alves@portugalmail.pt>
1172
1173 * coff-arm.c (ARM_26D, ARM_32, ARM_RVA_32, ARM_SECTION,
1174 ARM_SECREL): Mark WinCE versions of these relocs as partial
1175 inplace.
1176 (coff_arm_relocate_section): Adjust addend for WinCE.
1177
1178 2006-05-10 Alan Modra <amodra@bigpond.net.au>
1179
1180 PR 2342
1181 * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16.
1182
1183 2006-05-09 Nick Clifton <nickc@redhat.com>
1184
1185 * coffcode.h (coff_write_relocs): Produce an error message if a an
1186 out-of-range symbol index is detected in a reloc.
1187
1188 2006-05-09 Ben Elliston <bje@au.ibm.com>
1189
1190 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused
1191 local variable `dynobj'.
1192
1193 2006-05-05 Bjoern Haase <bjoern.m.haase@web.de>
1194
1195 * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all
1196 of the bfd's sections for the reloc-addend adjustments.
1197
1198 2006-05-05 Martin Schwidefsky <schwidefsky@de.ibm.com>
1199
1200 * elf32-s390.c (invalid_tls_insn): Call bfd_set_error.
1201 (elf_s390_relocate_section): Add code to do the GD->LE and
1202 LD->LE TLS linker optimizations if a brasl instruction is used
1203 for the __tls_get_offset function call.
1204 * elf64-s390.c (invalid_tls_insn): Call bfd_set_error.
1205
1206 2006-05-05 Alan Modra <amodra@bigpond.net.au>
1207
1208 * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize
1209 R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in
1210 the .toc and referenced by a TLS code sequence.
1211 (ppc64_elf_edit_toc): Cater for the unlikely situation that
1212 .toc is the first section in a file.
1213
1214 2006-05-04 Andreas Schwab <schwab@suse.de>
1215
1216 * aoutf1.h (struct external_sparc_core): Declare c_regs as struct
1217 regs instead of an array of int.
1218 (struct external_solaris_bcp_core): Likewise.
1219 (swapcore_sun3): Use offsetof instead of computing the offset
1220 manually.
1221 (swapcore_sparc): Likewise. Simplify reference to c_regs.
1222 (swapcore_solaris_bcp): Likewise.
1223
1224 2006-05-04 Daniel Jacobowitz <dan@codesourcery.com>
1225
1226 * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling
1227 for missing GOTs.
1228
1229 2006-05-04 Daniel Jacobowitz <dan@codesourcery.com>
1230
1231 * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more
1232 mapping symbols.
1233
1234 2006-05-04 Ben Elliston <bje@au.ibm.com>
1235
1236 * coff-or32.c (bfd_section_from_shdr): Remove unused local
1237 variable `ptr'.
1238 * cofflink.c (process_embedded_commands): Remove unused local
1239 variables `had_read' and `had_shared'.
1240 * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local
1241 variable `fdr_adr'.
1242 * ihex.c (ihex_read_section): Remove unused local variable `addr'.
1243
1244 2006-05-03 Alan Modra <amodra@bigpond.net.au>
1245
1246 * libbfd-in.h (_bfd_generic_new_section_hook): Declare.
1247 * section.c (bfd_abs_symbol, bfd_com_symbol): Delete.
1248 (bfd_und_symbol, bfd_ind_symbol): Delete.
1249 (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to
1250 &SEC.symbol.
1251 (STD_SECTION): Adjust.
1252 (_bfd_generic_new_section_hook): New function, extracted from..
1253 (bfd_section_init): ..here.
1254 (bfd_make_section_old_way): Call new_section_hook for abs, com,
1255 und and ind sections.
1256 * elf.c (_bfd_elf_large_com_section): Adjust.
1257 * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook.
1258 * pdp11.c (new_section_hook): Likewise.
1259 * coffcode.h (coff_new_section_hook): Likewise.
1260 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1261 * elf.c (_bfd_elf_new_section_hook): Likewise.
1262 * vms.c (vms_new_section_hook): Likwise.
1263 * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't
1264 already set.
1265 * elf32-sh64.c (sh64_elf_new_section_hook): Likewise.
1266 * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise.
1267 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1268 * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise.
1269 * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise.
1270 * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise.
1271 * ieee.c (ieee_new_section_hook): Likewise. Call
1272 _bfd_generic_new_section_hook too.
1273 * mmo.c (mmo_new_section_hook): Likewise.
1274 * oasys.c (oasys_new_section_hook): Likewise.
1275 * som.c (som_new_section_hook): Likewise.
1276 * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol.
1277 * bfd-in2.h: Regenerate.
1278 * libbfd.h: Regenerate.
1279
1280 2006-05-03 Alan Modra <amodra@bigpond.net.au>
1281
1282 * hash.c (DEFAULT_SIZE): Revert last change.
1283 (higher_prime_number): Correct test for no larger prime. Don't
1284 abort on error, instead return 0. Depopulate primes[].
1285 (bfd_hash_lookup): If we overflow size, refuse to grow table.
1286
1287 2006-05-02 Paul Brook <paul@codesourcery.com>
1288
1289 * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit
1290 for R_ARM_REL32.
1291
1292 2006-05-02 Ben Elliston <bje@au.ibm.com>
1293
1294 * archive.c (bfd_generic_archive_p): Remove unused local variable
1295 `fail'.
1296 * dwarf2.c (decode_line_info): Remove unused local variable
1297 `basic_block'.
1298 * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused
1299 local variable `s'.
1300 * tekhex.c (tekhex_write_object_contents): Remove unused local
1301 variable `bytes_written'.
1302 * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
1303 variable `r_addend'.
1304 * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
1305 * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
1306 (_bfd_ns32k_relocate_contents): Remove break after return.
1307 * elf.c (bfd_section_from_shdr): Remove breaks after returns.
1308
1309 2006-05-02 Nick Clifton <nickc@redhat.com>
1310
1311 * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG
1312 in order to avoid conflicts with the global DEBUG define.
1313
1314 2006-05-02 Alan Modra <amodra@bigpond.net.au>
1315
1316 * dwarf2.c: Formatting.
1317 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
1318 output section check.
1319 * elf32-i370.c: Warning fixes inside #ifdef DEBUG.
1320 * elf32-m32c.c: Similarly.
1321 * elf32-ppc.c: Similarly.
1322 * elf32-v850.c: Similarly.
1323 * nlm32-sparc.c: Similarly.
1324 * elfcode.h: Similarly.
1325 (elf_symbol_flags): Delete.
1326 * elflink.c (elf_link_input_bfd): Comment typo.
1327
1328 2006-05-01 DJ Delorie <dj@redhat.com>
1329
1330 * bfd-in.h (bfd_hash_table): Add count field.
1331 * bfd-in2.h: Regenerate.
1332 * hash.c (higher_prime_number): New.
1333 (bfd_hash_table_inint_n): Init count field.
1334 (bfd_hash_lookup): Grow table as needed.
1335
1336 2006-04-27 Kaz Kojima <kkojima@rr.iij4u.or.jp>
1337
1338 PR binutils/2584
1339 * tekhex.c (getvalue): Change return type to bfd_boolean and
1340 add the new parameter. Return false if the unexpected character
1341 is found.
1342 (getsym): Likewise.
1343 (first_phase): Change return type to bfd_boolean and return
1344 false if the unexpected character is found. Replace abort
1345 with returning false.
1346 (pass_over): Change return type to bfd_boolean and the type of
1347 the second argument to bfd_boolean (*) (bfd *, int, char *).
1348 Return false if FUNC returns false.
1349 (tekhex_object_p): Return NULL if pass_over fails.
1350
1351 2006-04-27 Alan Modra <amodra@bigpond.net.au>
1352
1353 * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix.
1354
1355 2006-04-26 H.J. Lu <hongjiu.lu@intel.com>
1356
1357 PR binutils/2593
1358 * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type
1359 and flags if its BFD flags have been set.
1360 (_bfd_elf_init_private_section_data): Don't copy the output ELF
1361 section type from input if it has been set to something
1362 different.
1363
1364 2006-04-25 H.J. Lu <hongjiu.lu@intel.com>
1365
1366 PR binutils/2467
1367 * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd)
1368 is NULL first.
1369
1370 * elf32-arm.c (elf32_arm_close_and_cleanup): Check if
1371 abfd->sections is NULL.
1372 (elf32_arm_bfd_free_cached_info): New.
1373 (bfd_elf32_bfd_free_cached_info): Defined.
1374
1375 * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it
1376 to _bfd_free_cached_info.
1377
1378 * libbfd-in.h (_bfd_free_cached_info): New.
1379 * libbfd: Regenerated.
1380
1381 * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL.
1382 (_bfd_free_cached_info): New.
1383
1384 2006-04-21 Alan Modra <amodra@bigpond.net.au>
1385
1386 * elf.c (assign_file_positions_except_relocs): Move code setting
1387 file position of non-loaded sections..
1388 (assign_file_positions_for_segments): ..to here.
1389
1390 2006-04-20 H.J. Lu <hongjiu.lu@intel.com>
1391
1392 PR ld/2537
1393 * elf.c (bfd_section_from_shdr): Allow sections reserved for
1394 applications. Issue an error on sections we don't know how
1395 to handle.
1396
1397 2006-04-19 Alan Modra <amodra@bigpond.net.au>
1398
1399 * Makefile.am: Run "make dep-am".
1400 * Makefile.in: Regenerate.
1401
1402 2006-04-19 Alan Modra <amodra@bigpond.net.au>
1403
1404 * warning.m4 (--enable-werror): Format help message.
1405 (--enable-build-warnings): Likewise.
1406 * configure: Regenerate.
1407
1408 2006-04-18 Nick Clifton <nickc@redhat.com>
1409
1410 PR 2257
1411 * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx
1412 fields to still be handled as ELF files.
1413
1414 2006-04-16 Daniel Jacobowitz <dan@codesourcery.com>
1415
1416 * po/SRC-POTFILES.in: Regenerated.
1417
1418 2006-04-16 Daniel Jacobowitz <dan@codesourcery.com>
1419
1420 * configure.in: Update version to 2.17.50.
1421 * configure: Regenerated.
1422
1423 2006-04-14 David Heine <dlheine@tensilica.com>
1424
1425 * elf32-xtensa.c (build_reloc_opcodes): New.
1426 (compute_text_actions): Use it to decode opcodes outside inner loop.
1427 (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if
1428 it is set, use it to get the opcodes for relocations.
1429 (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit.
1430
1431 2006-04-08 H.J. Lu <hongjiu.lu@intel.com>
1432
1433 PR ld/2513
1434 * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type.
1435 (GOT_TLS_IE_IE): Likewise.
1436 (GOT_TLS_IE_GD): Likewise.
1437 (GOT_TLS_IE_MASK): Likewise.
1438 (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD
1439 and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE
1440 respectively.
1441 (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD
1442 are set, treat tls_type as GOT_TLS_IE_BOTH.
1443 (elf_i386_relocate_section): Likewise.
1444
1445 2006-04-07 Randolph Chung <tausq@debian.org>
1446
1447 * elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
1448 (elf64_hppa_grok_psinfo): Likewise.
1449 (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
1450
1451 2006-04-06 DJ Delorie <dj@redhat.com>
1452
1453 * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
1454 each plt entry we create.
1455
1456 2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
1457
1458 * po/Make-in: Add install-html target.
1459 * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir
1460 htmldir. Add install-html and install-html-recursive targets.
1461 * Makefile.in: Regenerate.
1462 * configure.in: AC_SUBST for datarootdir, docdir and htmldir.
1463 * configure: Regenerate.
1464
1465 2006-04-06 H.J. Lu <hongjiu.lu@intel.com>
1466
1467 * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes
1468 with the skip_relax_pass_0 and skip_relax_pass_1 bits in the
1469 section structure.
1470
1471 2006-04-05 Bernd Schmidt <bernd.schmidt@analog.com>
1472
1473 * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to
1474 eliminate warnings.
1475
1476 2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
1477 James E Wilson <wilson@specifixinc.com>
1478
1479 PR ld/2442
1480 * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next.
1481 (elfNN_ia64_local_hash_entry): Add count, sorted_count and
1482 size.
1483 (elfNN_ia64_link_hash_entry): Likewise.
1484 (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count
1485 and size.
1486 (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info
1487 processing.
1488 (elfNN_ia64_hash_hide_symbol): Likewise.
1489 (elfNN_ia64_global_dyn_sym_thunk): Likewise.
1490 (elfNN_ia64_local_dyn_sym_thunk): Likewise.
1491 (elfNN_ia64_global_dyn_info_free): New function.
1492 (elfNN_ia64_local_dyn_info_free): Likewise.
1493 (elfNN_ia64_hash_table_free): Free local and global
1494 elfNN_ia64_dyn_sym_info.
1495 (addend_compare): New function.
1496 (sort_dyn_sym_info): Likewise.
1497 (get_dyn_sym_info): Updated to use binary search for addend.
1498 (elfNN_ia64_check_relocs): Scan relocations to create dynamic
1499 relocation arrays first.
1500
1501 2006-04-05 Bernd Schmidt <bernd.schmidt@analog.com>
1502
1503 * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp
1504 symbol.
1505
1506 2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
1507
1508 PR ld/2411
1509 * elflink.c (check_dynsym): New.
1510 (elf_link_output_extsym): Use it.
1511 (bfd_elf_final_link): Likewise.
1512
1513 2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
1514
1515 PR ld/2404
1516 * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
1517 symbol from the dynamic definition with the default version if
1518 its type and the type of existing regular definition mismatch.
1519
1520 2006-04-05 Richard Sandiford <richard@codesourcery.com>
1521 Daniel Jacobowitz <dan@codesourcery.com>
1522
1523 * config.bfd (sparc-*-vxworks*): New stanza.
1524 * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza.
1525 (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo.
1526 * configure: Regenerate.
1527 * elf32-sparc.c: Include elf-vxworks.h.
1528 (elf32_sparc_vxworks_link_hash_table_create: New.
1529 (elf32_sparc_vxworks_final_write_processing): New.
1530 (TARGET_BIG_SYM): Override for VxWorks.
1531 (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise.
1532 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1533 (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise.
1534 (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise.
1535 (elf_backend_link_output_symbol_hook): Likewise.
1536 (elf_backend_emit_relocs): Likewise.
1537 (elf_backend_final_write_processing, elf32_bed): Likewise.
1538 * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h.
1539 (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New.
1540 (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New.
1541 (_bfd_sparc_elf_link_hash_table_create): Don't initialize
1542 build_plt_entry here.
1543 (create_got_section): Initialize sgotplt for VxWorks.
1544 (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry,
1545 plt_header_size and plt_entry_size, with new VxWorks-specific settings.
1546 Call elf_vxworks_create_dynamic_sections for VxWorks.
1547 (allocate_dynrelocs): Use plt_header_size and plt_entry_size.
1548 Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks.
1549 (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt
1550 for VxWorks. Check for the .got.plt section.
1551 (sparc_vxworks_build_plt_entry): New function.
1552 (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs.
1553 Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_
1554 absolute on VxWorks.
1555 (sparc32_finish_dyn): Add special handling for DT_RELASZ
1556 and DT_PLTGOT on VxWorks.
1557 (sparc_vxworks_finish_exec_plt): New.
1558 (sparc_vxworks_finish_shared_plt): New.
1559 (_bfd_sparc_elf_finish_dynamic_sections): Call them.
1560 Use plt_header_size and plt_entry_size.
1561 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks,
1562 srelplt2, sgotplt, plt_header_size and plt_entry_size fields.
1563 * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h.
1564 (elf32-sparc.lo): Likewise.
1565 * Makefile.in: Regenerate.
1566 * targets.c (bfd_elf32_sparc_vxworks_vec): Declare.
1567 (_bfd_target_vector): Add a pointer to it.
1568
1569 2006-03-30 Ben Elliston <bje@au.ibm.com>
1570
1571 PR ld/2267
1572 * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
1573 special section number that exceeds the number of ELF sections
1574 (eg. SHN_MIPS_SCOMMON).
1575
1576 2006-03-27 Richard Sandiford <richard@codesourcery.com>
1577
1578 * elfxx-mips.c (mips_got_entry): Add more commentary.
1579 (mips_elf_local_got_index): Use the hash table entry to record
1580 the GOT index of forced-local symbols.
1581 (mips_elf_initialize_tls_index): Rearrange code. Store the index
1582 in either the hash table entry or the mips_got_entry, not both.
1583 Add more commentary.
1584 (mips_elf_multi_got): Make sure the g->next is nonnull when calling
1585 mips_elf_initialize_tls_index.
1586
1587 2006-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
1588
1589 * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
1590 RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty,
1591 reloc_stack_push, reloc_stack_pop, reloc_stack_operate,
1592 bfin_areloc_howto_table): Delete. All
1593 uses deleted as well.
1594 (bfin_reloc_map): Delete all stack relocs.
1595 (bfin_info_to_howto, bfin_bfd_reloc_type_lookup,
1596 bfin_reloc_type_lookup): Don't support them.
1597 (bfin_relocate_section): Don't try to handle them.
1598
1599 * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec.
1600 * configure.in: Likewise.
1601 * configure: Regenerate.
1602 * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h".
1603 (BFIN_RELOC_MAX): Now 0x21.
1604 (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs.
1605 (bfd_elf32_bfinfdpic_vec): Declare.
1606 (IS_FDPIC): New macro.
1607 (struct bfinfdpic_elf_link_hash_table): New struct.
1608 (bfinfdpic_hash_table, bfinfdpic_got_section,
1609 bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section,
1610 bfinfdpic_plt_setion, bfinfdpic_pltrel_section,
1611 bfinfdpic_relocs_info, bfinfdpic_got_initial_offset,
1612 bfinfdpic_plt_initial_offset): Accessor macros for it.
1613 (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros.
1614 (struct bfinfdpic_relocs_info): New struct.
1615 (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES,
1616 BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC,
1617 DEFAULT_STACK_SIZE): New macros.
1618 (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash,
1619 bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find,
1620 bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local,
1621 bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc,
1622 _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment,
1623 _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section,
1624 bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook,
1625 _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section,
1626 elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry,
1627 _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry,
1628 _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries,
1629 _bfinfdpic_resolve_final_relocs_info,
1630 elf32_bfinfdpic_size_dynamic_sections,
1631 elf32_bfinfdpic_always_size_sections,
1632 elf32_bfinfdpic_modify_segment_map,
1633 _bfinfdpic_count_got_plt_entries,
1634 elf32_bfinfdpic_finish_dynamic_sections,
1635 elf32_bfinfdpic_adjust_dynamic_symbol,
1636 elf32_bfinfdpic_finish_dynamic_symbol,
1637 elf32_bfinfdpic_elf_use_relative_eh_frame,
1638 elf32_bfinfdpic_elf_encode_eh_address,
1639 elf32_bfin_object_p, bfin_elf_copy_private_bfd_data,
1640 elf32_bfinfdpic_copy_private_bfd_data,
1641 (struct _bfinfdpic_dynamic_got_info,
1642 struct _bfinfdpic_dynamic_got_plt_info): New structs.
1643 (elf32_bfin_print_private_bfd_data): Print PIC flags.
1644 (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC.
1645 (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed,
1646 elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create,
1647 elf_backend_always_size_sectinos, elf_backend_modify_segment_map,
1648 bfd_elf32_bfd_copy_private_bfd_data,
1649 elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
1650 elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol,
1651 elf_backend_finish_dynamic_sections, elf_backend_relocate_section,
1652 elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs,
1653 elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p,
1654 elf_backend_may_use_rela_p, elf_backend_default_use_rela_p,
1655 elf_backend_omit_section_dynsym): Redefine these macros and include
1656 "elf32-target.h" again to create the elf32-bfinfdpic target.
1657 * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI,
1658 BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC,
1659 BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI,
1660 BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE,
1661 BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
1662 BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI,
1663 BFD_RELOC_BFIN_GOTOFFLO): New.
1664 * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target.
1665 (_bfd_target_vector): Add it.
1666 * bfd-in2.h: Regenerate.
1667 * libbfd.h: Regenerate.
1668
1669 2006-03-25 Richard Sandiford <richard@codesourcery.com>
1670
1671 * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as
1672 incompatible. Likewise MAC and EMAC code.
1673 * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use
1674 bfd_get_compatible to set the new bfd architecture. Rely on it
1675 to detect incompatibilities.
1676
1677 2006-03-23 Michael Matz <matz@suse.de>
1678
1679 * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64,
1680 BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64,
1681 BFD_RELOC_X86_64_PLTOFF64.
1682 * bfd-in2.h: Regenerated.
1683 * libbfd.h: Regenerated.
1684 * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment.
1685 Add howtos for above relocs.
1686 (x86_64_reloc_map): Add mappings for new relocs.
1687 (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64,
1688 R_X86_64_GOTPLT64 need a got entry. R_X86_64_GOTPLT64 also a PLT
1689 entry. R_X86_64_GOTPC64 needs a .got section. R_X86_64_PLTOFF64
1690 needs a PLT entry.
1691 (elf64_x86_64_gc_sweep_hook): Reflect changes from
1692 elf64_x86_64_check_relocs for the new relocs.
1693 (elf64_x86_64_relocate_section): Handle new relocs.
1694
1695 2006-03-22 Bob Wilson <bob.wilson@acm.org>
1696
1697 * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that
1698 rel->r_addend is zero.
1699
1700 2006-03-22 Richard Sandiford <richard@codesourcery.com>
1701
1702 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type
1703 of "loc".
1704
1705 2006-03-22 Richard Sandiford <richard@codesourcery.com>
1706 Daniel Jacobowitz <dan@codesourcery.com>
1707 Phil Edwards <phil@codesourcery.com>
1708 Zack Weinberg <zack@codesourcery.com>
1709 Mark Mitchell <mark@codesourcery.com>
1710 Nathan Sidwell <nathan@codesourcery.com>
1711
1712 * bfd-in2.h: Regenerate.
1713 * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas.
1714 * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza.
1715 (bfd_elf32_littlemips_vxworks_vec): Likewise.
1716 (bfd_elf32_bigmips_vec): Add elf-vxworks.lo.
1717 (bfd_elf32_littlemips_vec): Likewise.
1718 (bfd_elf32_nbigmips_vec): Likewise.
1719 (bfd_elf32_nlittlemips_vec): Likewise.
1720 (bfd_elf32_ntradbigmips_vec): Likewise.
1721 (bfd_elf32_ntradlittlemips_vec): Likewise.
1722 (bfd_elf32_tradbigmips_vec): Likewise.
1723 (bfd_elf32_tradlittlemips_vec): Likewise.
1724 (bfd_elf64_bigmips_vec): Likewise.
1725 (bfd_elf64_littlemips_vec): Likewise.
1726 (bfd_elf64_tradbigmips_vec): Likewise.
1727 (bfd_elf64_tradlittlemips_vec): Likewise.
1728 * elf32-mips.c: Include elf-vxworks.h.
1729 (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto
1730 instead of calling mips_elf32_rtype_to_howto directly.
1731 (mips_vxworks_copy_howto_rela): New reloc howto.
1732 (mips_vxworks_jump_slot_howto_rela): Likewise.
1733 (mips_vxworks_bfd_reloc_type_lookup): New function.
1734 (mips_vxworks_rtype_to_howto): Likewise.
1735 (mips_vxworks_final_write_processing): Likewise.
1736 (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks.
1737 (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise.
1738 (elf_backend_want_got_plt): Likewise.
1739 (elf_backend_want_plt_sym): Likewise.
1740 (elf_backend_got_symbol_offset): Likewise.
1741 (elf_backend_want_dynbss): Likewise.
1742 (elf_backend_may_use_rel_p): Likewise.
1743 (elf_backend_may_use_rela_p): Likewise.
1744 (elf_backend_default_use_rela_p): Likewise.
1745 (elf_backend_got_header_size: Likewise.
1746 (elf_backend_plt_readonly): Likewise.
1747 (bfd_elf32_bfd_reloc_type_lookup): Likewise.
1748 (elf_backend_mips_rtype_to_howto): Likewise.
1749 (elf_backend_adjust_dynamic_symbol): Likewise.
1750 (elf_backend_finish_dynamic_symbol): Likewise.
1751 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1752 (elf_backend_add_symbol_hook): Likewise.
1753 (elf_backend_link_output_symbol_hook): Likewise.
1754 (elf_backend_emit_relocs): Likewise.
1755 (elf_backend_final_write_processing: Likewise.
1756 (elf_backend_additional_program_headers): Likewise.
1757 (elf_backend_modify_segment_map): Likewise.
1758 (elf_backend_symbol_processing): Likewise.
1759 * elfxx-mips.c: Include elf-vxworks.h.
1760 (mips_elf_link_hash_entry): Add is_relocation_target and
1761 is_branch_target fields.
1762 (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt,
1763 srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields.
1764 (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros.
1765 (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument.
1766 Return 3 for VxWorks.
1767 (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a
1768 mips_elf_link_hash_table. Return 0 for VxWorks.
1769 (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a
1770 mips_elf_link_hash_table. Update the call to ELF_MIPS_GP_OFFSET.
1771 (mips_vxworks_exec_plt0_entry): New variable.
1772 (mips_vxworks_exec_plt_entry): Likewise.
1773 (mips_vxworks_shared_plt0_entry): Likewise.
1774 (mips_vxworks_shared_plt_entry): Likewise.
1775 (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields.
1776 (mips_elf_rel_dyn_section): Change the bfd argument to a
1777 mips_elf_link_hash_table. Use MIPS_ELF_REL_DYN_NAME to get
1778 the name of the section.
1779 (mips_elf_initialize_tls_slots): Update the call to
1780 mips_elf_rel_dyn_section.
1781 (mips_elf_gotplt_index): New function.
1782 (mips_elf_local_got_index): Add an input_section argument.
1783 Update the call to mips_elf_create_local_got_entry.
1784 (mips_elf_got_page): Likewise.
1785 (mips_elf_got16_entry): Likewise.
1786 (mips_elf_create_local_got_entry): Add bfd_link_info and input_section
1787 arguments. Create dynamic relocations for each entry on VxWorks.
1788 (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE.
1789 (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE
1790 and MIPS_RESERVED_GOTNO.
1791 (mips_elf_create_got_section): Update the uses of
1792 MIPS_ELF_GOT_MAX_SIZE. Create .got.plt on VxWorks.
1793 (is_gott_symbol): New function.
1794 (mips_elf_calculate_relocation): Use a dynobj local variable.
1795 Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and
1796 mips_elf_got_page_entry. Set G to the .got.plt entry when calculating
1797 VxWorks R_MIPS_CALL* relocations. Calculate and use G for all GOT
1798 relocations on VxWorks. Add dynamic relocations for references
1799 to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Don't
1800 create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64
1801 in VxWorks executables.
1802 (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument.
1803 Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry.
1804 Don't allocate a null entry on VxWorks.
1805 (mips_elf_create_dynamic_relocation): Update the call to
1806 mips_elf_rel_dyn_section. Use absolute rather than relative
1807 relocations for VxWorks, and make them RELA rather than REL.
1808 (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic
1809 read-only on VxWorks. Update the call to mips_elf_rel_dyn_section.
1810 Create the .plt, .rela.plt, .dynbss and .rela.bss sections on
1811 VxWorks. Likewise create the _PROCEDURE_LINKAGE_TABLE symbol.
1812 Call elf_vxworks_create_dynamic_sections for VxWorks and
1813 initialize the plt_header_size and plt_entry_size fields.
1814 (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be
1815 used in VxWorks executables. Don't allocate dynamic relocations
1816 for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables.
1817 Set is_relocation_target for each symbol referenced by a relocation.
1818 Allocate .rela.dyn entries for relocations against the special
1819 VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Create GOT
1820 entries for all VxWorks R_MIPS_GOT16 relocations. Don't allocate
1821 a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*,
1822 R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations. Update the calls
1823 to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations.
1824 Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26
1825 relocations. Don't set no_fn_stub on VxWorks.
1826 (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to
1827 mips_elf_allocate_dynamic_relocations.
1828 (_bfd_mips_vxworks_adjust_dynamic_symbol): New function.
1829 (_bfd_mips_elf_always_size_sections): Do not allocate GOT page
1830 entries for VxWorks, and do not create multiple GOTs.
1831 (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME.
1832 Handle .got specially for VxWorks. Update the uses of
1833 MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations.
1834 Check for sgotplt and splt. Allocate the .rel(a).dyn contents last,
1835 once its final size is known. Set DF_TEXTREL for VxWorks. Add
1836 DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL
1837 tags on VxWorks. Do not add the MIPS-specific tags for VxWorks.
1838 (_bfd_mips_vxworks_finish_dynamic_symbol): New function.
1839 (mips_vxworks_finish_exec_plt): Likewise.
1840 (mips_vxworks_finish_shared_plt): Likewise.
1841 (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call
1842 to mips_elf_rel_dyn_section. Use a VxWorks-specific value of
1843 DT_PLTGOT. Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL,
1844 DT_PLTRELSZ and DT_JMPREL. Update the uses of MIPS_RESERVED_GOTNO
1845 and mips_elf_rel_dyn_section. Use a different GOT header for
1846 VxWorks. Don't sort .rela.dyn on VxWorks. Finish the PLT on VxWorks.
1847 (_bfd_mips_elf_link_hash_table_create): Initialize the new
1848 mips_elf_link_hash_table fields.
1849 (_bfd_mips_vxworks_link_hash_table_create): New function.
1850 (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_
1851 on VxWorks. Update the call to ELF_MIPS_GP_OFFSET.
1852 * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare.
1853 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1854 (_bfd_mips_vxworks_link_hash_table_create): Likewise.
1855 * libbfd.h: Regenerate.
1856 * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h.
1857 (elf32-mips.lo): Likewise.
1858 * Makefile.in: Regenerate.
1859 * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare.
1860 * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare.
1861 (bfd_elf32_littlemips_vxworks_vec): Likewise.
1862 (_bfd_target_vector): Add entries for them.
1863
1864 2006-03-19 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1865
1866 * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
1867 section from SHF_PARISC_WEAKORDER to SHF_HP_TLS.
1868 (elf_backend_special_sections): Remove #undef.
1869
1870 2006-03-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1871
1872 * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry
1873 for undefined weak symbols.
1874
1875 2006-03-17 Daniel Jacobowitz <dan@codesourcery.com>
1876
1877 PR ld/2462
1878 * elflink.c (bfd_elf_final_link): Remove
1879 bed->elf_backend_emit_relocs from emit_relocs.
1880
1881 2006-03-17 Alexandre Oliva <aoliva@redhat.com>
1882
1883 * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
1884 first relocation to the second when relaxing TLS GD to LE;
1885 zero it out when relaxing to IE.
1886
1887 2006-03-17 Alan Modra <amodra@bigpond.net.au>
1888
1889 PR 2434
1890 * elflink.c (elf_link_add_object_symbols): Save and restore
1891 warning sym's linked sym.
1892
1893 2006-03-16 Alan Modra <amodra@bigpond.net.au>
1894
1895 PR 2434
1896 * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete.
1897 (elf_link_add_object_symbols): Delete unnecessary locals. Rename
1898 hash_table -> htab. Formatting. Save entire symbol table
1899 before loading as-needed syms, and restore afterwards if lib not
1900 needed. Use bfd_hash_allocate rather than bfd_alloc for sym
1901 name. Free some buffers earlier.
1902 * bfd-in.h (struct bfd_hash_table): Add entsize.
1903 (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype.
1904 * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise
1905 * hash.c (bfd_hash_table_init_n): Add entsize param, save to
1906 hash table.
1907 (bfd_hash_table_init): Add param, adjust calls.
1908 * aoutx.h: Adjust all hash_table_init functions and calls.
1909 * bfd.c: Likewise.
1910 * coff-arm.c: Likewise.
1911 * coff-h8300.c: Likewise.
1912 * coff-ppc.c: Likewise.
1913 * cofflink.c: Likewise.
1914 * ecoff.c: Likewise.
1915 * ecofflink.c: Likewise.
1916 * elf-m10300.c: Likewise.
1917 * elf-strtab.c: Likewise.
1918 * elf.c: Likewise.
1919 * elf32-arm.c: Likewise.
1920 * elf32-bfin.c: Likewise.
1921 * elf32-cris.c: Likewise.
1922 * elf32-frv.c: Likewise.
1923 * elf32-hppa.c: Likewise.
1924 * elf32-i386.c: Likewise.
1925 * elf32-m32r.c: Likewise.
1926 * elf32-m68hc1x.c: Likewise.
1927 * elf32-m68k.c: Likewise.
1928 * elf32-ppc.c: Likewise.
1929 * elf32-s390.c: Likewise.
1930 * elf32-sh.c: Likewise.
1931 * elf32-vax.c: Likewise.
1932 * elf64-alpha.c: Likewise.
1933 * elf64-hppa.c: Likewise.
1934 * elf64-ppc.c: Likewise.
1935 * elf64-s390.c: Likewise.
1936 * elf64-sh64.c: Likewise.
1937 * elf64-x86-64.c: Likewise.
1938 * elfxx-ia64.c: Likewise.
1939 * elfxx-mips.c: Likewise.
1940 * elfxx-sparc.c: Likewise.
1941 * i386linux.c: Likewise.
1942 * libaout.h: Likewise.
1943 * libbfd-in.h: Likewise.
1944 * libcoff-in.h: Likewise.
1945 * linker.c: Likewise.
1946 * m68klinux.c: Likewise.
1947 * merge.c: Likewise.
1948 * opncls.c: Likewise.
1949 * pdp11.c: Likewise.
1950 * sparclinux.c: Likewise.
1951 * stabs.c: Likewise.
1952 * sunos.c: Likewise.
1953 * vms.c: Likewise.
1954 * xcofflink.c: Likewise.
1955 * section.c (struct section_hash_entry): Move to..
1956 * libbfd-in.h: ..here.
1957 * Makefile.am: Run "make dep-am"
1958 * Makefile.in: Regenerate.
1959 * bfd-in2.h: Regenerate.
1960 * libbfd.h: Regenerate.
1961 * libcoff.h: Regenerate.
1962
1963 2006-03-16 Alan Modra <amodra@bigpond.net.au>
1964
1965 * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs
1966 against __GLOBAL_OFFSET_TABLE__ need never be dynamic. Tweak
1967 last change to REL32 relocs so that they are counted as
1968 possibly dynamic as per REL24 and REL14.
1969
1970 2006-03-16 Alan Modra <amodra@bigpond.net.au>
1971
1972 * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24
1973 checks from REL32.
1974
1975 2006-03-15 Ben Elliston <bje@au.ibm.com>
1976
1977 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all
1978 in_list elements, not just the first.
1979
1980 2006-03-14 Richard Sandiford <richard@codesourcery.com>
1981
1982 * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split
1983 out from...
1984 (_bfd_mips_elf_relocate_section): ...here. Use it to adjust r_addend
1985 for final links too.
1986
1987 2006-03-13 Richard Sandiford <richard@codesourcery.com>
1988
1989 * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot.
1990
1991 2006-03-11 H.J. Lu <hongjiu.lu@intel.com>
1992
1993 PR ld/2443
1994 * dwarf2.c (concat_filename): Don't issue an error if file is 0.
1995
1996 2006-03-10 Paul Brook <paul@codesourcery.com>
1997
1998 * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5.
1999 (elf32_arm_print_private_bfd_data): Ditto.
2000
2001 2006-03-09 Paul Brook <paul@codesourcery.com>
2002
2003 * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
2004 mapping symbols.
2005
2006 2006-03-09 Khem Raj <khem@mvista.com>
2007
2008 * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned
2009 char type.
2010
2011 2006-03-08 H.J. Lu <hongjiu.lu@intel.com>
2012
2013 * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp.
2014
2015 2006-03-07 Richard Sandiford <richard@codesourcery.com>
2016 Daniel Jacobowitz <dan@codesourcery.com>
2017 Zack Weinberg <zack@codesourcery.com>
2018 Nathan Sidwell <nathan@codesourcery.com>
2019 Paul Brook <paul@codesourcery.com>
2020 Ricardo Anguiano <anguiano@codesourcery.com>
2021 Phil Edwards <phil@codesourcery.com>
2022
2023 * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo.
2024 (bfd_elf32_bigarm_symbian_vec): Likewise.
2025 (bfd_elf32_bigarm_vxworks_vec): Likewise.
2026 (bfd_elf32_littlearm_vec): Likewise.
2027 (bfd_elf32_littlearm_symbian_vec): Likewise.
2028 (bfd_elf32_littlearm_vxworks_vec): Likewise.
2029 * configure: Regenerate.
2030 * elf32-arm.c: Include libiberty.h and elf-vxworks.h.
2031 (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros.
2032 (elf32_arm_vxworks_bed): Add forward declaration.
2033 (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12.
2034 (elf32_arm_vxworks_exec_plt0_entry): New table.
2035 (elf32_arm_vxworks_exec_plt_entry): Likewise.
2036 (elf32_arm_vxworks_shared_plt_entry): Likewise.
2037 (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields.
2038 (reloc_section_p): New function.
2039 (create_got_section): Use RELOC_SECTION.
2040 (elf32_arm_create_dynamic_sections): Likewise. Call
2041 elf_vxworks_create_dynamic_sections for VxWorks targets.
2042 Choose between the two possible values of plt_header_size
2043 and plt_entry_size.
2044 (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2.
2045 (elf32_arm_abs12_reloc): New function.
2046 (elf32_arm_final_link_relocate): Call it. Allow the creation of
2047 dynamic R_ARM_ABS12 relocs on VxWorks. Use reloc_section_p,
2048 RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION. Initialize the
2049 r_addend fields of relocs. On rela targets, skip any code that
2050 adjusts in-place addends. When using _bfd_link_final_relocate
2051 to perform a final relocation, pass rel->r_addend as the addend
2052 argument.
2053 (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks
2054 object, ignore flags that are not standard on VxWorks.
2055 (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12
2056 relocs on VxWorks. Use reloc_section_p.
2057 (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE.
2058 (allocate_dynrelocs): Use RELOC_SIZE. Account for the size of
2059 .rela.plt.unloaded relocs on VxWorks targets.
2060 (elf32_arm_size_dynamic_sections): Use RELOC_SIZE. Check for
2061 .rela.plt.unloaded as well as .rel(a).plt. Add DT_RELA* tags
2062 instead of DT_REL* tags on RELA targets.
2063 (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE
2064 and SWAP_RELOC_OUT. Initialize r_addend fields. Handle VxWorks
2065 PLT entries. Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
2066 (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE
2067 and SWAP_RELOC_OUT. Initialize r_addend fields. Handle DT_RELASZ
2068 like DT_RELSZ. Handle the VxWorks form of initial PLT entry.
2069 Correct the .rela.plt.unreloaded symbol indexes.
2070 (elf32_arm_output_symbol_hook): Call the VxWorks version of this
2071 hook on VxWorks targets.
2072 (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true.
2073 Minor formatting tweak.
2074 (elf32_arm_vxworks_final_write_processing): New function.
2075 (elf_backend_add_symbol_hook): Override for VxWorks and reset
2076 for Symbian.
2077 (elf_backend_final_write_processing): Likewise.
2078 (elf_backend_emit_relocs): Likewise.
2079 (elf_backend_want_plt_sym): Likewise.
2080 (ELF_MAXPAGESIZE): Likewise.
2081 (elf_backend_may_use_rel_p): Minor formatting tweak.
2082 (elf_backend_may_use_rela_p): Likewise.
2083 (elf_backend_default_use_rela_p): Likewise.
2084 (elf_backend_rela_normal): Likewise.
2085 * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h.
2086
2087 2006-03-06 Nathan Sidwell <nathan@codesourcery.com>
2088
2089 * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp):
2090 New. Adjust other variants.
2091 (bfd_default_scan): Update.
2092 * bfd-in2.h: Rebuilt.
2093 * cpu-m68k.c: Adjust.
2094 (bfd_m68k_compatible): New. Use it for architectures.
2095 * elf32-m68k.c (elf32_m68k_object_p): Adjust.
2096 (elf32_m68k_merge_private_bfd_data): Adjust. Correct isa-a/b
2097 mismatch.
2098 (elf32_m68k_print_private_bfd_data): Adjust.
2099 * ieee.c (ieee_write_processor): Adjust.
2100
2101 2006-03-06 Alan Modra <amodra@bigpond.net.au>
2102
2103 * dwarf2.c: Formatting.
2104 (add_line_info): Remove outer loop.
2105
2106 2006-03-05 H.J. Lu <hongjiu.lu@intel.com>
2107 Alan Modra <amodra@bigpond.net.au>
2108
2109 PR binutils/2338
2110 * dwarf2.c (loadable_section): New struct.
2111 (dwarf2_debug): Add loadable_section_count and
2112 loadable_sections.
2113 (new_line_sorts_after): New.
2114 (add_line_info): Use new_line_sorts_after to compare line
2115 addresses.
2116 (check_function_name): Removed.
2117 (unset_sections): New.
2118 (place_sections): New.
2119 (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
2120 and unset_sections on relocatable files.
2121 (_bfd_dwarf2_find_line): Likewise.
2122
2123 2006-03-03 Nick Clifton <nickc@redhat.com>
2124
2125 * cpu-avr.c: Update to ISO-C90 formatting.
2126 * elf32-avr.c: Likewise.
2127
2128 2006-03-03 Bjoern Haase <bjoern.m.haase@web.de>
2129
2130 * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI
2131 and R_AVR_MS8_LDI
2132 (bfd_elf_avr_final_write_processing): Set
2133 EF_AVR_LINKRELAX_PREPARED in e_flags field.
2134 (elf32_avr_relax_section): New function.
2135 (elf32_avr_relax_delete_bytes): New function.
2136 (elf32_avr_get_relocated_section_contents): New function.
2137 (avr_pc_wrap_around): New function.
2138 (avr_relative_distance_considering_wrap_around): New function.
2139 (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI.
2140 * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG
2141 * libbfd.h: Regenerate.
2142 * bfd-in2.h: Regenerate.
2143
2144 2006-03-02 DJ Delorie <dj@redhat.com>
2145
2146 * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol
2147 calculations.
2148
2149 2006-03-02 Richard Sandiford <richard@codesourcery.com>
2150
2151 * elf32-ppc.c (is_ppc_elf_target): Return true if the target is
2152 bfd_elf32_powerpc_vxworks_vec.
2153
2154 2006-03-02 Nick Clifton <nickc@redhat.com>
2155
2156 * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'.
2157
2158 2006-03-02 Richard Sandiford <richard@codesourcery.com>
2159
2160 * elf32-i386.c (elf_i386_create_dynamic_sections): Use
2161 elf_vxworks_create_dynamic_sections.
2162 (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT
2163 symbol handling.
2164 * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use
2165 elf_vxworks_create_dynamic_sections.
2166 (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT
2167 symbol handling.
2168 * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function.
2169 * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare.
2170
2171 2006-03-02 Richard Sandiford <richard@codesourcery.com>
2172
2173 * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
2174 (elf_backend_link_output_symbol_hook): Use
2175 elf_vxworks_link_output_symbol_hook instead.
2176 * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
2177 (elf_backend_link_output_symbol_hook): Use
2178 elf_vxworks_link_output_symbol_hook instead.
2179 * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the
2180 same interface as elf_backend_link_output_symbol_hook.
2181 * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update
2182 prototype accordingly.
2183
2184 2006-03-02 Richard Sandiford <richard@codesourcery.com>
2185
2186 * elf32-ppc.c (ppc_elf_plt_type): New enumeration.
2187 (ppc_elf_link_hash_table): Replace old_got and new_got with
2188 plt_type and can_use_new_plt.
2189 (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS,
2190 SEC_LOAD and SEC_READONLY to the VxWorks .plt flags.
2191 (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt.
2192 Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt.
2193 (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to
2194 either plt_type == PLT_OLD or plt_type == PLT_NEW. Assert that
2195 this function should not be called for VxWorks targets.
2196 (ppc_elf_tls_setup): Use plt_type instead of old_got.
2197 (allocate_got): Likewise. Rearrange so that max_before_header
2198 is only used for PLT_OLD and PLT_NEW.
2199 (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks.
2200 (ppc_elf_size_dynamic_sections): Likewise.
2201 (ppc_elf_relax_section): Likewise.
2202 (ppc_elf_relocate_section): Likewise.
2203 (ppc_elf_finish_dynamic_symbol): Likewise.
2204 (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type.
2205
2206 2006-02-28 Richard Sandiford <richard@codesourcery.com>
2207
2208 * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index.
2209 (elf_i386_link_hash_table_create): Initialize it.
2210 (elf_i386_compute_jump_table_size): Use it instead of
2211 srelplt->reloc_count.
2212 (allocate_dynrelocs): Likewise.
2213 (elf_i386_size_dynamic_sections): Likewise.
2214 (elf_i386_relocate_section): Likewise.
2215
2216 2006-02-27 Jakub Jelinek <jakub@redhat.com>
2217
2218 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag.
2219 (_bfd_elf_write_section_eh_frame): Likewise.
2220
2221 2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
2222
2223 * po/Make-in: Add html target.
2224
2225 2006-02-27 Richard Sandiford <richard@codesourcery.com>
2226
2227 * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the
2228 cached hgot entry to check for _GLOBAL_OFFSET_TABLE_.
2229 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise.
2230 * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise.
2231 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2232 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2233 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2234 * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
2235 * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise.
2236 * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise.
2237 * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise.
2238 * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise.
2239 * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise.
2240 * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise.
2241 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
2242 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise. Also use
2243 the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_.
2244 * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise.
2245 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2246 * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise.
2247 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2248
2249 2006-02-25 Richard Sandiford <richard@codesourcery.com>
2250
2251 * elf-bfd.h (elf_link_hash_table): Add hplt field.
2252 * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it.
2253 * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
2254 * elf32-frv.c (_frv_create_got_section): Likewise.
2255 * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
2256 * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
2257 * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
2258 * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
2259 * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt.
2260 (elf_i386_link_hash_table_create): Don't initialize them.
2261 (elf_i386_size_dynamic_sections): Use the generic ELF hplt and
2262 hgot fields.
2263 (elf_i386_finish_dynamic_symbol): Likewise.
2264 * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt.
2265 (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields.
2266 (ppc_elf_finish_dynamic_symbol): Likewise.
2267
2268 2006-02-24 DJ Delorie <dj@redhat.com>
2269
2270 * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs.
2271 (m32c_elf_relocate_section): Don't relocate them.
2272 (compare_reloc): New.
2273 (relax_reloc): Remove.
2274 (m32c_offset_for_reloc): New.
2275 (m16c_addr_encodings): New.
2276 (m16c_jmpaddr_encodings): New.
2277 (m32c_addr_encodings): New.
2278 (m32c_elf_relax_section): Relax jumps and address displacements.
2279 (m32c_elf_relax_delete_bytes): Adjust for internal syms. Fix up
2280 short jumps.
2281
2282 * reloc.c: Add m32c relax relocs.
2283 * libbfd.h: Regenerate.
2284 * bfd-in2.h: Regenerate.
2285
2286 2006-02-24 H.J. Lu <hongjiu.lu@intel.com>
2287
2288 PR ld/2218
2289 * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol.
2290 (_bfd_elf_link_hash_fixup_symbol): New.
2291
2292 * elflink.c (_bfd_elf_link_hash_fixup_symbol): New.
2293 (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if
2294 it isn't NULL.
2295
2296 * elfxx-ia64.c (elf_backend_fixup_symbol): Defined.
2297
2298 * elfxx-target.h (elf_backend_fixup_symbol): New.
2299 (elfNN_bed): Initialize elf_backend_fixup_symbol.
2300
2301 2006-02-23 H.J. Lu <hongjiu.lu@intel.com>
2302
2303 * cpu-ia64-opc.c (ins_immu5b): New.
2304 (ext_immu5b): Likewise.
2305 (elf64_ia64_operands): Add IMMU5b.
2306
2307 2006-02-21 Alan Modra <amodra@bigpond.net.au>
2308
2309 PR ld/2218
2310 * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie
2311 is dynamic.
2312 * elf32-hppa.c (allocate_dynrelocs): Likewise.
2313 * elf32-i386.c (allocate_dynrelocs): Likewise.
2314 * elf32-s390.c (allocate_dynrelocs): Likewise.
2315 * elf32-sh.c (allocate_dynrelocs): Likewise.
2316 * elf64-s390.c (allocate_dynrelocs): Likewise.
2317 * elf64-x86-64.c (allocate_dynrelocs): Likewise.
2318 * elf32-m32r.c (allocate_dynrelocs): Likewise. Discard relocs
2319 on undef weak with non-default visibility too.
2320 * elfxx-sparc.c (allocate_dynrelocs): Ditto.
2321
2322 2006-02-21 Alan Modra <amodra@bigpond.net.au>
2323
2324 * bfd.c: (_bfd_default_error_handler): Don't call abort on
2325 error, instead call _exit.
2326 (_bfd_abort): Call _exit not xexit.
2327
2328 2006-02-17 Kevin Buettner <kevinb@redhat.com>
2329
2330 * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo):
2331 New functions.
2332 * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
2333
2334 2006-02-17 Shrirang Khisti <shrirangk@kpitcummins.com>
2335 Anil Paranjape <anilp1@kpitcummins.com>
2336 Shilin Shakti <shilins@kpitcummins.com>
2337
2338 * Makefile.am: Add xc16x related entry
2339 * Makefile.in: Regenerate
2340 * archures.c: Add bfd_xc16x_arch
2341 * bfd-in2.h: Regenerate
2342 * config.bfd: Add xc16x-*-elf
2343 * configure.in: Add bfd_elf32_xc16x_vec
2344 * configure: Regenerate.
2345 * targets.c: Added xc16x related information
2346 * cpu-xc16x.c: New file
2347 * reloc.c: Add new relocations specific to xc16x:
2348 BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG,
2349 BFD_RELOC_XC16X_SOF
2350 * elf32-xc16x.c: New file.
2351
2352 2006-02-17 Alan Modra <amodra@bigpond.net.au>
2353
2354 * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling.
2355 * elf64-ppc.c (allocate_dynrelocs): Likewise.
2356
2357 2006-02-17 Alan Modra <amodra@bigpond.net.au>
2358
2359 PR ld/2218
2360 * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is
2361 dynamic.
2362 (ppc64_elf_relocate_section): Check output reloc section size.
2363 * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test.
2364
2365 2006-02-16 H.J. Lu <hongjiu.lu@intel.com>
2366
2367 PR ld/2322
2368 * elf.c (get_segment_type): New function.
2369 (_bfd_elf_print_private_bfd_data): Use it.
2370 (print_segment_map): New function.
2371 (assign_file_positions_for_segments): Call print_segment_map
2372 when there are not enough room for program headers.
2373
2374 2006-02-16 Nick Hudson <nick.hudson@dsl.pipex.com>
2375
2376 * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use
2377 traditional MIPS ELF targets.
2378
2379 2006-02-15 H.J. Lu <hongjiu.lu@intel.com>
2380
2381 PR binutils/2338
2382 * dwarf2.c (check_function_name): New function.
2383 (_bfd_dwarf2_find_nearest_line): Use check_function_name to
2384 check if function is correct.
2385
2386 2006-02-16 Alan Modra <amodra@bigpond.net.au>
2387
2388 * elflink.c (_bfd_elf_default_action_discarded): Return 0 for
2389 debug sections.
2390 (elf_link_input_bfd): Adjust comments.
2391
2392 2006-02-10 H.J. Lu <hongjiu.lu@intel.com>
2393
2394 * elf.c (copy_private_bfd_data): Minor update.
2395
2396 2006-02-10 H.J. Lu <hongjiu.lu@intel.com>
2397
2398 PR binutils/2258
2399 * elf.c (copy_private_bfd_data): Renamed to ...
2400 (rewrite_elf_program_header): This.
2401 (copy_elf_program_header): New function.
2402 (copy_private_bfd_data): Likewise.
2403
2404 2006-02-07 Nathan Sidwell <nathan@codesourcery.com>
2405
2406 * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e,
2407 bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x,
2408 bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249,
2409 bfd_mach_mcf547x, bfd_mach_mcf548x): Remove.
2410 (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div,
2411 bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac,
2412 bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
2413 bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp,
2414 bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac,
2415 bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac,
2416 bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac,
2417 bfd_mach_mcf_isa_b_usp_float_emac): New.
2418 (bfd_default_scan): Update coldfire mapping.
2419 * bfd-in.h (bfd_m68k_mach_to_features,
2420 bfd_m68k_features_to_mach): Declare.
2421 * bfd-in2.h: Rebuilt.
2422 * cpu-m68k.c (arch_info_struct): Add new coldfire machines,
2423 adjust legacy names.
2424 (m68k_arch_features): New.
2425 (bfd_m68k_mach_to_features,
2426 bfd_m68k_features_to_mach): Define.
2427 * elf32-m68k.c (elf32_m68k_object_p): New.
2428 (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags.
2429 (elf32_m68k_print_private_bfd_data): Print the CF EF flags.
2430 (elf_backend_object_p): Define.
2431 * ieee.c (ieee_write_processor): Update coldfire machines.
2432 * libbfd.h: Rebuilt.
2433
2434 2006-02-06 Steve Ellcey <sje@cup.hp.com>
2435
2436 * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS
2437 if SHF_TLS is set.
2438
2439 2006-02-05 Arnold Metselaar <arnold.metselaar@planet.nl>
2440
2441 * coff-z80.c (r_imm24): New howto.
2442 (rtype2howto): New case R_IMM24.
2443 (coff_z80_reloc_type_lookup): New case BFD_RELOC_24.
2444 (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24.
2445
2446 2006-02-04 Richard Sandiford <richard@codesourcery.com>
2447
2448 * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol
2449 has already been assigned a GOT index, copy that index to the
2450 current hash table entry.
2451
2452 2006-02-01 Eric Botcazou <ebotcazou@libertysurf.fr>
2453
2454 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
2455 for call-to-undefweak reloc overflow.
2456
2457 2006-01-31 Eric Botcazou <ebotcazou@libertysurf.fr>
2458
2459 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
2460 for 32-bit relocs overflow.
2461
2462 2006-01-27 Paul Brook <paul@codesourcery.com>
2463
2464 * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb
2465 objects.
2466
2467 2006-01-18 Alexandre Oliva <aoliva@redhat.com>
2468
2469 Introduce TLS descriptors for i386 and x86_64.
2470 * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC,
2471 BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC,
2472 BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New.
2473 * libbfd.h, bfd-in2.h: Rebuilt.
2474 * elf32-i386.c (elf_howto_table): New relocations.
2475 (R_386_tls): Adjust.
2476 (elf_i386_reloc_type_lookup): Map new relocations.
2477 (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
2478 (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
2479 (struct elf_i386_link_hash_entry): Add tlsdesc_got field.
2480 (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field.
2481 (elf_i386_local_tlsdesc_gotent): New macro.
2482 (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size.
2483 (elf_i386_compute_jump_table_size): New macro.
2484 (link_hash_newfunc): Initialize tlsdesc_got.
2485 (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size.
2486 (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and
2487 R_386_TLS_DESC_CALL.
2488 (elf_i386_check_relocs): Likewise. Allocate space for
2489 local_tlsdesc_gotent.
2490 (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and
2491 R_386_TLS_DESC_CALL.
2492 (allocate_dynrelocs): Count function PLT relocations. Reserve
2493 space for TLS descriptors and relocations.
2494 (elf_i386_size_dynamic_sections): Reserve space for TLS
2495 descriptors and relocations. Set up sgotplt_jump_table_size.
2496 Don't zero reloc_count in srelplt.
2497 (elf_i386_always_size_sections): New. Set up _TLS_MODULE_BASE_.
2498 (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and
2499 R_386_TLS_DESC_CALL.
2500 (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
2501 (elf_backend_always_size_sections): Define.
2502 * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC,
2503 R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL.
2504 (R_X86_64_standard): Adjust.
2505 (x86_64_reloc_map): Map new relocs.
2506 (elf64_x86_64_rtype_to_howto): New, split out of...
2507 (elf64_x86_64_info_to_howto): ... this function, and...
2508 (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val.
2509 (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
2510 (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
2511 (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field.
2512 (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field.
2513 (elf64_x86_64_local_tlsdesc_gotent): New macro.
2514 (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt,
2515 tlsdesc_got and sgotplt_jump_table_size fields.
2516 (elf64_x86_64_compute_jump_table_size): New macro.
2517 (link_hash_newfunc): Initialize tlsdesc_got.
2518 (elf64_x86_64_link_hash_table_create): Initialize new fields.
2519 (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and
2520 R_X86_64_TLSDESC_CALL.
2521 (elf64_x86_64_check_relocs): Likewise. Allocate space for
2522 local_tlsdesc_gotent.
2523 (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and
2524 R_X86_64_TLSDESC_CALL.
2525 (allocate_dynrelocs): Count function PLT relocations. Reserve
2526 space for TLS descriptors and relocations.
2527 (elf64_x86_64_size_dynamic_sections): Reserve space for TLS
2528 descriptors and relocations. Set up sgotplt_jump_table_size,
2529 tlsdesc_plt and tlsdesc_got. Make room for them. Don't zero
2530 reloc_count in srelplt. Add dynamic entries for DT_TLSDESC_PLT
2531 and DT_TLSDESC_GOT.
2532 (elf64_x86_64_always_size_sections): New. Set up
2533 _TLS_MODULE_BASE_.
2534 (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and
2535 R_386_TLS_DESC_CALL.
2536 (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
2537 (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and
2538 DT_TLSDESC_GOT. Set up TLS descriptor lazy resolver PLT entry.
2539 (elf_backend_always_size_sections): Define.
2540
2541 2006-01-17 H.J. Lu <hongjiu.lu@intel.com>
2542
2543 PR binutils/2096
2544 * dwarf2.c (comp_unit_contains_address): Update comment.
2545 (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of
2546 lma. Return TRUE only if both comp_unit_contains_address and
2547 comp_unit_find_nearest_line return TRUE.
2548 (_bfd_dwarf2_find_line): Use section's vma, instead of lma.
2549
2550 2006-01-18 Alan Modra <amodra@bigpond.net.au>
2551
2552 * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref.
2553 (bfd_elf_gc_mark_dynamic_ref_symbol): Declare.
2554 * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from
2555 elf_gc_mark_dynamic_ref_symbol. Make global.
2556 (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref.
2557 * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define.
2558 (elfNN_bed): Init new field.
2559 * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define.
2560 (ppc64_elf_gc_mark_dynamic_ref): New function.
2561
2562 2006-01-17 Alan Modra <amodra@bigpond.net.au>
2563
2564 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop.
2565
2566 2006-01-17 Nick Clifton <nickc@redhat.com>
2567
2568 PR binutils/2159
2569 * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused
2570 parameters.
2571
2572 2006-01-11 Nick Clifton <nickc@redhat.com>
2573
2574 * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry
2575 into the newly (re)allocated map array.
2576
2577 2006-01-09 Alexis Wilke <alexis_wilke@yahoo.com>
2578
2579 * peXXigen.c (tbl): Add comma after "HIGH3ADJ".
2580
2581 2006-01-01 Jakub Jelinek <jakub@redhat.com>
2582
2583 * elf64-ppc.c (ppc64_elf_action_discarded): Return 0
2584 for .toc1 section.
2585
2586 For older changes see ChangeLog-2005
2587 \f
2588 Local Variables:
2589 mode: change-log
2590 left-margin: 8
2591 fill-column: 74
2592 version-control: never
2593 End: