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