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