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