* ld-cris/hidedsofns2468, ld-cris/libdso-12b.d,
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
df131623
AM
12008-12-11 Alan Modra <amodra@bigpond.net.au>
2
3 PR 7041
4 * elf64-ppc.c (func_desc_adjust): Correct logic making fake function
5 descriptors. Similarly correct making function descriptors dynamic.
6
a3a219a9
AM
72008-12-10 Alan Modra <amodra@bigpond.net.au>
8
9 * elf32-spu.h (struct spu_elf_params): Add num_regions.
10 * elf32-spu.c (spu_elf_auto_overlay): Handle multiple overlay regions.
11
64615358
AM
122008-12-10 Alan Modra <amodra@bigpond.net.au>
13
14 * elf32-spu.g (struct spu_elf_params, enum _ovly_flavour): New.
15 (spu_elf_setup): Declare.
16 (spu_elf_create_sections, spu_elf_size_stubs): Update prototype.
17 (spu_elf_build_stubs, spu_elf_check_vma): Likewise.
18 * elf32-spu.c (struct spu_link_hash_table): Add "params". Remove
19 various other fields now in "params". Adjust code throughout.
20 (struct call_info, struct function_info): Move earlier in file.
21 (struct spu_elf_stack_info): Likewise.
22 (spu_elf_setup): New function.
23 (spu_elf_create_sections): Remove args other than "info".
24 (spu_elf_size_stubs, spu_elf_build_stubs, spu_elf_check_vma): Likewise.
25 (maybe_needs_stubs): Remove "output_bfd" arg. Adjust all calls.
26 (interesting_section): Similarly with "obfd" arg.
27 (needs_ovl_stub): Adjust output_section test.
28 (allocate_spuear_stubs): Likewise.
29 (OVL_STUB_SIZE): Don't define.
30 (ovl_stub_size): New function, use in place of OVL_STUB_SIZE.
31 (build_stub): Test params->ovly_flavour rather than OVL_STUB_SIZE.
32 (spu_elf_auto_overlay): Remove args other than "info". Make use
33 of size returned from spu_elf_load_ovl_mgr.
34 (spu_elf_stack_analysis): Remove args other than "info".
35 (spu_elf_relocate_section): Tidy setting of "ea".
36
667f3338
AM
372008-12-10 Alan Modra <amodra@bigpond.net.au>
38
39 * elf32-spu.c (find_function_stack_adjust): Don't limit number
40 of insns scanned. Correct sp tests. Handle "fsmbi" and "andbi".
41 (mark_detached_root): New function.
42 (build_call_tree): Call it.
43 (sort_calls): Don't do void* arithmetic.
b0c41709
AM
44 (define_ovtab_symbol): Don't abort on symbols defined in linker scripts.
45 (discover_functions): Consider STT_SECTION symbols too.
46 (collect_lib_sections): Don't cut short call tree traversal
47 when function size is too large.
667f3338 48
f904699a
TT
492008-12-09 Tom Tromey <tromey@redhat.com>
50
51 * pef.c (bfd_pef_parse_traceback_table): Add parens to placate gcc
52 4.4.
53
3e22044a
TG
542008-12-09 Tristan Gingold <gingold@adacore.com>
55
56 * cpu-avr.c (compatible): Makes avr-6 compatible only with itself.
57
440e9cd2
AK
582008-12-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
59
60 * elf64-s390.c (elf_s390_check_relocs): Initialize
61 htab->elf.dynobj if necessary.
62
e7c33416
NC
632008-12-03 Nick Clifton <nickc@redhat.com>
64
65 * syms.c (struct bfd_symbol): Add new flag BSF_INDIRECT_FUNCTION.
66 Remove redundant flag BFD_FORT_COMM_DEFAULT_VALUE. Renumber flags
67 to remove gaps.
68 (bfd_print_symbol_vandf): Return 'i' for BSF_INDIRECT_FUNCTION.
69 (bfd_decode_symclass): Likewise.
70 * elf.c (swap_out_syms): Translate BSF_INDIRECT_FUNCTION into
71 STT_IFUNC.
72 (elf_find_function): Treat STT_IFUNC in the same way as STT_FUNC.
73 (_bfd_elf_is_function_type): Likewise.
74 * elf32-arm.c (arm_elf_find_function): Likewise.
75 (elf32_arm_adjust_dynamic_symbol): Likewise.
76 (elf32_arm_swap_symbol_in): Likewise.
77 (elf32_arm_additional_program_headers): Likewise.
78 * elf32-i386.c (is_indirect_symbol): New function.
79 (elf_i386_check_relocs): Also generate dynamic relocs for
80 relocations against STT_IFUNC symbols.
81 (allocate_dynrelocs): Likewise.
82 (elf_i386_relocate_section): Likewise.
83 * elf64-x86-64.c (is_indirect_symbol): New function.
84 (elf64_x86_64_check_relocs): Also generate dynamic relocs for
85 relocations against STT_IFUNC symbols.
86 (allocate_dynrelocs): Likewise.
87 (elf64_x86_64_relocate_section): Likewise.
88 * elfcode.h (elf_slurp_symbol_table): Translate STT_IFUNC into
89 BSF_INDIRECT_FUNCTION.
90 * elflink.c (_bfd_elf_adjust_dynamic_reloc_section): Add support
91 for STT_IFUNC symbols.
92 (get_ifunc_reloc_section_name): New function.
93 (_bfd_elf_make_ifunc_reloc_section): New function.
94 * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs field.
95 * bfd-in2.h: Regenerate.
96
f96fc22a
TG
972008-12-02 Tristan Gingold <gingold@adacore.com>
98
99 * config.bfd: Add x86_64-*-darwin*
100
72f10fad
DA
1012008-11-28 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
102
103 * hpux-core.c: Don't include sys/file.h.
104
3aa3176b
TS
1052008-11-28 Joshua Kinard <kumba@gentoo.org>
106
107 * aoutx.h (NAME): Add case statements for bfd_mach_mips14000,
108 bfd_mach_mips16000.
109 * archures.c (bfd_architecture): Add .#defines for bfd_mach_mips14000,
110 bfd_mach_mips16000.
111 * bfd-in2.h: Regenerate.
112 * cpu-mips.c: Add enums I_mips14000, I_mips16000.
113 (arch_info_struct): Add refs to R14000, R16000.
114 * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips14000,
115 bfd_mach_mips16000.
116 (mips_mach_extensions): Map R14000, R16000 to R10000.
117
99706f30
SR
1182008-11-27 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
119
120 * Add PIC support for CR16 target.
121 * elf32-cr16.c (R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and
122 R_CR16_GLOB_DAT): New macros
123 (cr16_elf_howto_table): Add entries for for R_CR16_GOT_REGREL20,
124 R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
125 (cr16_reloc_map): Ditto
126 (_bfd_cr16_elf_create_got_section): New function to create GOT section.
127 (_bfd_cr16_elf_create_dynamic_sections): New function to create dynamic
128 section.
129 (_bfd_cr16_elf_adjust_dynamic_symbol): New function to adjust symbol
130 defined by dynamic object.
131 (_bfd_cr16_elf_size_dynamic_sections): New function to find the size of
132 dynamic sections.
133 (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
134 symbols.
135 (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
136 sections.
137 (bfd_cr16_elf32_create_embedded_relocs): New function to create
138 embedded relocs in .emreloc section in memory for .data.rel section.
139 (_bfd_cr16_elf_reloc_type_class): New function for classify reloc types.
140 (cr16_elf_check_relocs): New function for checking reloc types in first
141 phase.
142 (cr16_elf_final_link_relocate): Update for handling the new reloc types
143 R_CR16_GOT_REGREL20 and R_CR16_GOTC_REGREL20.
144 (elf32_cr16_relax_section): Update relax implementation.
145 * reloc.c (bfd_reloc_code_type): Add entries for R_CR16_GOT_REGREL20,
146 R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
147 * bfd-in.h (bfd_boolean bfd_cr16_elf32_create_embedded_relocs): Declared
148 * libbfd.h, bfd-in2.h: Regenerate.
149
ae5a3597
AM
1502008-11-26 Alan Modra <amodra@bigpond.net.au>
151
152 PR 7047
153 * configure.in: Bump version.
154 * configure: Regenerate.
155 * elflink.c (_bfd_elf_link_assign_sym_version): Continue matching
156 against version nodes when a global match is a wildcard. Similarly
157 continue matching on local wildcard matches, rather than only
158 continuing for "*". Have any global wildcard match override a
159 local wildcard match. Correct logic hiding unversioned symbol.
160 (bfd_elf_size_dynamic_sections): Update for changes to struct
161 bfd_elf_version_expr.
162
85f77068
JB
1632008-11-25 Joel Brobecker <brobecker@adacore.com>
164
165 * configure.in: Deactivate large-file support on native x86-solaris
166 as well unless the user explicitly requested it.
167 * configure: Regenerate.
168
19540007
JM
1692008-11-25 Joseph Myers <joseph@codesourcery.com>
170
171 * elf32-arm.c (elf32_arm_final_link_relocate): Do not turn
172 branches to undefine weak symbols into branches to the next
173 instruction if creating PLT entries for those symbols.
174
83bac4b0
NC
1752008-11-25 Nick Clifton <nickc@redhat.com>
176
177 * elflink.c (is_reloc_section): New function. Returns true if the
178 given name matches the name of the reloc-containing section
179 associated with the given section.
180 (get_dynamic_reloc_section_name): New function. Computes the name
181 of the section that contains the dynamic relocs associated with
182 the given section.
183 (_bfd_elf_get_dynamic_reloc_section): New function. Returns a
184 pointer to the section containing the dynamic relocs associated
185 with the given section.
186 (_bfd_elf_make_dynamic_reloc_section): New function. Creates a
187 section to contain the dynamic relocs associated with a given
188 section.
189 * elf-bfd.h: Prototype the new functions.
190 * elf-m10300.c (mn10300_elf_check_relocs): Use new functions.
191 (mn10300_elf_final_link_relocs): Likewise.
192 * elf32-arm.c (reloc_section_p): Delete - replaced by new
193 functions.
194 (elf32_arm_final_link_relocate): Use new functions.
195 (elf32_arm_check_relocs): Likewise.
196 * elf32-cris.c (cris_elf_relocate_section): Likewise.
197 (elf_cris_check_relocs): Likewise.
198 * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
199 * elf32-i370.c (i370_elf_check_relocs): Likewise.
200 (i370_elf_relocate_section): Likewise.
201 * elf32-i386.c (elf_i386_check_relocs): Likewise.
202 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
203 (m32r_elf_check_relocs): Likewise.
204 * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
205 * elf32_ppc.c (ppc_elf_check_relocs): Likewise.
206 (ppc_elf_relocate_section): Likewise.
207 * elf32-s390.c (elf_s390_check_relocs): Likewise.
208 * elf32-sh.c (sh_elf_relocate_section): Likewise.
209 (sh_elf_check_relocs): Likewise.
210 * elf32-vax.c (elf_vax_check_relocs): Likewise.
211 (elf_vax_relocate_section): Likewise.
212 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
213 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
214 * elf64-s390.c (elf_s390_check_relocs): Likewise.
215 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
216 * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
217 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
218 * elf32-bfin.c (bfin_check_relocs): Remove redundant local
219 variable 'sreloc'.
220 (bfin_relocate_section): Likewise.
221 * elf32-v850.c (v850_elf_check_relocs): Likewise.
222
100382c7
HPN
2232008-11-23 Hans-Peter Nilsson <hp@axis.com>
224
225 Implement TLS for CRIS.
226 * elf32-cris.c: Include limits.h.
227 (TLSHOWTO16): Redefine in terms of and move contents to...
228 (TLSHOWTO16X): New macro.
229 (TLSHOWTO16S, LGOT_REG_NDX, LGOT_DTP_NDX, LGOT_ALLOC_NELTS_FOR)
230 (elf_cris_hash_entry): New macros.
231 (cris_elf_howto_table): Make R_CRIS_16_DTPREL,
232 R_CRIS_16_GOT_TPREL, R_CRIS_16_TPREL check overflow for signed,
233 not unsigned values.
234 (cris_info_to_howto_rela): Make r_type a enum elf_cris_reloc_type,
235 not unsigned int.
236 (struct elf_cris_link_hash_entry): New members reg_got_refcount,
237 tprel_refcount, and dtp_refcount.
238 (struct elf_cris_link_hash_table): New member dtpmod_refcount.
239 (elf_cris_link_hash_newfunc): Initialize new members.
240 (elf_cris_link_hash_table_create): Similar.
241 (cris_final_link_relocate, elf_cris_reloc_type_class): Use a
242 temporary variable when testing the relocation type.
243 (cris_elf_gc_mark_hook): Ditto. Add default case where needed.
244 (cris_elf_gc_sweep_hook): Ditto. Handle reference-counting for
245 the new assembly-generated relocs. Rewrite refcount handling to
246 set temporary variables to pointers to reloc-specific variables
247 and entry size and common code for the update.
248 (additional_relocation_error_msg_count): New variable.
249 (cris_elf_relocate_section): Use a function-local variable srelgot
250 for the .rela.got section instead of looking it up for every need.
251 Make r_type a enum elf_cris_reloc_type, not int. Actually set
252 symname for non-local symbols. Handle new assembly-generated
253 relocs. For overflow, emit additional messages for the new 16-bit
254 relocs as well as R_CRIS_16_GOTPLT and R_CRIS_16_GOT.
255 (elf_cris_finish_dynamic_symbol): Use elf_cris_finish_dynamic_symbol
256 instead of plain casts. Check new hash entry member
257 reg_got_refcount when checking whether to emit a GOT entry.
258 (elf_cris_finish_dynamic_sections): Update head comment to warn
259 about emitting relocs here. Use a temporary variable when testing
260 the relocation type.
261 (elf_cris_discard_excess_program_dynamics)
262 (elf_cris_adjust_gotplt_to_got): Handle reference counting change
263 regarding h->reg_got_refcount.
264 (cris_elf_check_relocs): Rewrite refcount handling to set
265 temporary variables and entry size and common code for the update
266 for local symbols. Use new macro elf_cris_hash_entry. Adjust
267 allocation for change in reference counting of GOT entries for
268 local symbols.
269 (elf_cris_size_dynamic_sections): Adjust calculated size of
270 .got.plt and .rela.got if we need a GOT entry for a
271 R_CRIS_DTPMOD relocation.
272 (elf_cris_got_elt_size): New function.
273 (elf_backend_got_elt_size): Define.
274
1fa3cd83
SA
2752008-11-21 Sterling Augustine <sterling@tensilica.com>
276
277 * xtensa-isa.c (xtensa_state_is_shared_or): New function.
278
10455f89
HPN
2792008-11-21 Hans-Peter Nilsson <hp@axis.com>
280
281 * elf-bfd.h (struct elf_backend_data): New member got_elt_size.
282 (_bfd_elf_default_got_elt_size): Declare.
283 * elflink.c (struct alloc_got_off_arg): Replace member got_elt_size
284 by new member info.
285 (elf_gc_allocate_got_offsets): Adjust for calling bed->got_elt_size
286 to get the element size instead of using a gofarg entry.
287 (bfd_elf_gc_common_finalize_got_offsets): Similar.
288 (_bfd_elf_default_got_elt_size): New function.
289 * elfxx-target.h: New macro elf_backend_got_elt_size.
290 (elfNN_bed): Use it.
291
78bc95e3
TG
2922008-11-20 Tristan Gingold <gingold@adacore.com>
293
294 * bfdwin.c: Fix comment.
295
6aa341c7
TG
2962008-11-20 Tristan Gingold <gingold@adacore.com>
297
298 * bfd.c (is32bit): Use architecture information for non-ELF
299 targets.
300
d6e14abc
AM
3012008-11-20 Alan Modra <amodra@bigpond.net.au>
302
303 * elf32-ppc.c (allocate_dynrelocs): Always use tlsld_got for
304 TLS_LD even when symbol is used with other TLS reloc types.
305 (ppc_elf_relocate_section): Bypass symbol checks when using tlsld_got.
306 Leave addend zero on LD DTPMOD dynamic reloc.
307
33430bd0
BW
3082008-11-19 Bob Wilson <bob.wilson@acm.org>
309
310 * xtensa-modules.c (sysregs): Add MMID, VECBASE, EPC5, EPC6, EPC7,
311 EXCSAVE5, EXCSAVE6, EXCSAVE7, EPS5, EPS6, EPS7, CPENABLE,
312 SCOMPARE1, and THREADPTR registers.
313 (NUM_SYSREGS, MAX_USER_REG): Update.
314 (states): Change width of INTERRUPT, WindowBase, WindowStart, and
315 INTENABLE. Add VECBASE, EPC5, EPC6, EPC7, EXCSAVE5, EXCSAVE6,
316 EXCSAVE7, EPS6, EPS6, EPS7, THREADPTR, CPENABLE, and SCOMPARE1 states.
317 (NUM_STATES): Update.
318 (enum xtensa_state_id): Add entries for new states.
319 (enum xtensa_field_id): Add entries for xt_wbr15_imm and xt_wbr18_imm
320 fields, along with functions to extract and set them.
321 (regfiles): Change number of AR registers to 32.
322 (Operand_ar0_encode, Operand_ar4_encode, Operand_ar8_encode,
323 Operand_ar12_encode, Operand_ars_entry_encode): Update register mask.
324 (operands): Add entries for tp7, xt_wbr15_label, xt_wbr18_label,
325 xt_wbr15_imm, and xt_wbr18_imm operands, along with functions to
326 encode and decode them.
327 (enum xtensa_operand_id): Add entries for new operands.
328 (Iclass_xt_iclass_rfi_stateArgs): Add EPC5, EPC6, EPC7, EPS5, EPS6, and
329 EPC7 states.
330 (Iclass_xt_iclass_rfdo_stateArgs): Replace EPC4 and EPS4 by EPC6 and
331 EPS6, respectively.
332 (iclasses): Add entries for rur_threadptr, wur_threadptr,
333 xt_iclass_wsr_176, xt_iclass_rsr_epc5, xt_iclass_wsr_epc5,
334 xt_iclass_xsr_epc5, xt_iclass_rsr_excsave5, xt_iclass_wsr_excsave5,
335 xt_iclass_xsr_excsave5, xt_iclass_rsr_epc6, xt_iclass_wsr_epc6,
336 xt_iclass_xsr_epc6, xt_iclass_rsr_excsave6, xt_iclass_wsr_excsave6,
337 xt_iclass_xsr_excsave6, xt_iclass_rsr_epc7, xt_iclass_wsr_epc7,
338 xt_iclass_xsr_epc7, xt_iclass_rsr_excsave7, xt_iclass_wsr_excsave7,
339 xt_iclass_xsr_excsave7, xt_iclass_rsr_eps5, xt_iclass_wsr_eps5,
340 xt_iclass_xsr_eps5, xt_iclass_rsr_eps6, xt_iclass_wsr_eps6,
341 xt_iclass_xsr_eps6, xt_iclass_rsr_eps7, xt_iclass_wsr_eps7,
342 xt_iclass_xsr_eps7, xt_iclass_rsr_vecbase, xt_iclass_wsr_vecbase,
343 xt_iclass_xsr_vecbase, xt_iclass_mul16, xt_iclass_wsr_mmid,
344 xt_iclass_icache_lock, xt_iclass_dcache_lock, xt_iclass_rsr_cpenable,
345 xt_iclass_wsr_cpenable, xt_iclass_xsr_cpenable, xt_iclass_clamp,
346 xt_iclass_minmax, xt_iclass_sx, xt_iclass_l32ai, xt_iclass_s32ri,
347 xt_iclass_s32c1i, xt_iclass_rsr_scompare1, xt_iclass_wsr_scompare1,
348 xt_iclass_xsr_scompare1, xt_iclass_div, and xt_iclass_mul32, along
349 with corresponding argument and state argument arrays. Change
350 number of state arguments for xt_iclass_rfi. Add arguments for
351 xt_iclass_rfdo.
352 (enum xtensa_iclass_id): Add entries for new iclasses.
353 (opcodes): Add entries for RUR_THREADPTR, WUR_THREADPTR, WSR_176,
354 RSR_EPC5, WSR_EPC5, XSR_EPC5, RSR_EXCSAVE5, WSR_EXCSAVE5, XSR_EXCSAVE5,
355 RSR_EPC6, WSR_EPC6, XSR_EPC6, RSR_EXCSAVE6, WSR_EXCSAVE6, XSR_EXCSAVE6,
356 RSR_EPC7, WSR_EPC7, XSR_EPC7, RSR_EXCSAVE7, WSR_EXCSAVE7, XSR_EXCSAVE7,
357 RSR_EPS5, WSR_EPS5, XSR_EPS5, RSR_EPS6, WSR_EPS6, XSR_EPS6, RSR_EPS7,
358 WSR_EPS7, XSR_EPS7, RSR_VECBASE, WSR_VECBASE, XSR_VECBASE, MUL16U,
359 MUL16S, WSR_MMID, IPFL, IHU, IIU, DPFL, DHU, DIU, RSR_CPENABLE,
360 WSR_CPENABLE, XSR_CPENABLE, CLAMPS, MIN, MAX, MINU, MAXU, SEXT, L32AI,
361 S32RI, S32C1I, RSR_SCOMPARE1, WSR_SCOMPARE1, XSR_SCOMPARE1, QUOU, QUOS,
362 REMU, REMS, and MULL opcodes, along with the corresponding functions
363 to encode them.
364 (enum xtensa_opcode_id): Add entries for new opcodes.
365 (Slot_inst_decode): Handle new opcodes.
366 (Slot_inst_get_field_fns, Slot_inst_set_field_fns): Add entries for
367 xt_wbr15_imm and xt_wbr18_imm fields.
368 (Slot_inst16a_get_field_fns, Slot_inst16a_set_field_fns): Likewise.
369 (Slot_inst16b_get_field_fns, Slot_inst16b_set_field_fns): Likewise.
370 (xtensa_modules): Update number of fields, operands, iclasses and
371 opcodes.
372
c91e322a
NC
3732008-11-19 Nix <nix@esperi.org.uk>
374
375 * elf.c (swap_out_syms) [USE_STT_COMMON]: Fix syntax error.
376
af1fb11f
NC
3772008-11-19 Nick Clifton <nickc@redhat.com>
378
379 PR 7027
380 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Treat WPLT30 relocs
381 against local symbols in 64-bit binaries as if they were WDISP30
382 relocs.
383 (_bfd_sparc_elf_relocate_section): Likewise.
384
8e79c3df
CM
3852008-11-18 Catherine Moore <clm@codesourcery.com>
386
387 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge
388 half-precision attributes.
389 (elf32_arm_copy_one_eabi_other_attribute): New.
390 (elf32_arm_copy_other_attribute_list): New.
391
dc80fd5c
NC
3922008-11-18 Nick Clifton <nickc@redhat.com>
393
394 * dwarf2.c (read_section): Fix formatting.
395 (read_n_bytes): Remove unhelpful comment.
396 (read_indirect_string): Pass symbol table to read_section in case
397 the .debug_str section needs relocating.
398
399 PR 7037
400 * elf32-cr16.c (cr16_elf_howto_table): Zero the src_mask field of
401 the reloc descriptions.
402
28b02751
EW
4032008-11-14 Eric B. Weddington <eric.weddington@atmel.com>
404
405 PR 7022
406 * elf32-avr.c (bfd_elf_avr_final_write_processing):
407 Add missing break statements.
408
af4bed4b
BW
4092008-11-14 Bob Wilson <bob.wilson@acm.org>
410
411 * xtensa-modules.c (xtensa_state_id): New enum, replacing STATE macros.
412 (xtensa_field_id, xtensa_regfile_id, xtensa_operand_id)
413 (xtensa_iclass_id, xtensa_opcode_id): New enums.
414 Replace hardcoded constants throughout this file with enum values.
415
2b0bc088
NC
4162008-11-14 Nathan Sidwell <nathan@codesourcery.com>
417
418 * elf.c (assign_file_positions_for_load_sections): Use header_size
419 to avoid moving the load address of file headers.
420 (assign_file_positions_for_load_sections): Set header_size for
421 segments containing the file header.
422
d387240a
TG
4232008-11-14 Tristan Gingold <gingold@adacore.com>
424
425 * configure.com: Handle bfd_default_target_size, BFD_HOST_LONG_LONG,
426 BFD_HOST_64BIT_LONG_LONG, BFD_HOSTPTR_T, bfd_file_ptr.
427 Generate bfdver.h.
428 * vms-hdr.c (_bfd_vms_write_hdr): Use strdup/free instead of alloca.
429 * hosts/alphavms.h: Defines macros to bypass i18n.
430 * makefile.vms (OBJS): Update file list.
431 (DEFS): Remove VMS_DEBUG, const, add DEBUGDIR.
432 (CFLAGS): Update flags.
433 * bfdio.c (real_fopen): Add code specific to VMS: extract attributes
434 from modes.
435
08c13eba
JB
4362008-11-13 Joel Brobecker <brobecker@adacore.com>
437
438 * configure.in: Deactivate large-file support on native 32bit
439 sparc-solaris unless the user explicitly requested it.
440 * configure: Regenerate.
441
57268894
HPN
4422008-11-13 Hans-Peter Nilsson <hp@axis.com>
443
444 PR ld/7028
445 * elf.c (assign_file_positions_for_load_sections): Allocate phrds
446 with bfd_zalloc2 instead of bfd_alloc2. For the amount, use
447 the possibly-preset header-size, not the computed one.
448
3337c1e5
AM
4492008-11-13 Alan Modra <amodra@bigpond.net.au>
450
451 PR 7023
452 * elf.c (bfd_section_from_shdr <SHT_SYMTAB>): Fail on invalid sh_info.
453
b84a33b5
AM
4542008-11-11 Alan Modra <amodra@bigpond.net.au>
455
456 * elf.c (assign_file_positions_for_non_load_sections): Consolidate
457 PT_GNU_RELRO handling.
458
5d0900eb
AM
4592008-11-11 Alan Modra <amodra@bigpond.net.au>
460
461 PR 7012
462 * dwarf2.c (find_line): Don't keep stale pointers into realloc'd
463 memory. Return on errors. Fix memory leak.
464 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_str_buffer.
465
129af99f
AS
4662008-11-10 Andreas Schwab <schwab@suse.de>
467
468 PR 7011
469 * elf.c (assign_file_positions_for_non_load_sections): Handle
470 PT_GNU_RELRO specially.
471
8a2a2dbb
NC
4722008-11-06 Joel Sherrill <joel.sherrill@oarcorp.com>
473
474 * config.bfd: Add m32c-*-rtems* and m32r-*-rtems*.
475
428b207a
TT
4762008-11-06 Tom Tromey <tromey@redhat.com>
477
478 * configure, config.in: Rebuild.
479 * configure.in: Check for fileno.
480 * bfdio.c (close_on_exec): New function.
481 (real_fopen): Use it.
482 (FD_CLOEXEC): New define.
483
15e1c58a
TG
4842008-11-06 Tristan Gingold <gingold@adacore.com>
485
486 * mach-o.h (BFD_MACH_O_NO_SECT): Add; reorders the macros.
487 (BFD_MACH_O_SYM_NTYPE, BFD_MACH_O_SYM_NSECT,
488 BFD_MACH_O_SYM_NDESC): New macros.
489 (bfd_mach_o_i386_thread_flavour): Define according to the latest
490 definition from system header.
491 (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_RPATH,
492 BFD_MACH_O_LC_CODE_SIGNATURE.
493 (BFD_MACH_O_SECTION_TYPE_MASK, BFD_MACH_O_SECTION_ATTRIBUTES_MASK,
494 BFD_MACH_O_SECTION_ATTRIBUTES_SYS, BFD_MACH_O_SECTION_ATTRIBUTES_USR,
495 BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC,
496 BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG,
497 BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): Add.
498 (bfd_mach_o_segment_command): Add room for a nul terminator in
499 segname field.
500 (BFD_MACH_O_PROT_READ, BFD_MACH_O_PROT_WRITE,
501 BFD_MACH_O_PROT_EXECUTE): Add.
502 (INDIRECT_SYMBOL_LOCAL): Renames to BFD_MACH_O_INDIRECT_SYMBOL_LOCAL.
503 (INDIRECT_SYMBOL_ABS): Renames to BFD_MACH_O_INDIRECT_SYMBOL_ABS.
504 (bfd_mach_o_uuid_command): Add the structure.
505 (bfd_mach_o_load_command): Add uuid field.
506 (bfd_get_mach_o_data): New macro.
507 * mach-o.c (bfd_mach_o_bfd_print_private_bfd_data): New function which
508 replaces the macro.
509 (SECTION_TYPE, SECTION_ATTRIBUTES, SECTION_ATTRIBUTES_USR,
510 S_ATTR_PURE_INSTRUCTIONS, SECTION_ATTRIBUTES_SYS,
511 S_ATTR_SOME_INSTRUCTIONS, S_ATTR_EXT_RELOC, S_ATTR_LOC_RELOC): Renamed
512 and moved to mach-o.h.
513 (N_STAB, N_TYPE, N_EXT, N_UNDF, N_ABS, N_TEXT, N_DATA, N_BSS,
514 N_SECT, N_INDR): Removed as they duplicated macros in mach-o.h.
515 (bfd_mach_o_print_symbol): Print much more details.
516 (bfd_mach_o_make_bfd_section): Add prot argument, use canonical
517 dwarf name for dwarf sections. Precisely set section flags.
518 (bfd_mach_o_scan_read_section_32): Add prot argument.
519 (bfd_mach_o_scan_read_section_64): Ditto.
520 (bfd_mach_o_scan_read_section): Ditto.
521 (bfd_mach_o_scan_read_symtab_symbol): Set section for debugging
522 stabs, set BSF_GLOBAL and LOCAL flags correctly. Fix section
523 for N_SECT symbols.
524 (bfd_mach_o_i386_flavour_string): Reindent and adjust for new
525 names.
526 (bfd_mach_o_scan_read_symtab): Set HAS_SYMS flags on bfd if there
527 are symbols.
528 (bfd_mach_o_scan_read_uuid): New function.
529 (bfd_mach_o_scan_read_segment): Add a trailing nul. Segments
530 flags are now simply HAS_CONTENTS. Pass protection to
531 bfd_mach_o_scan_read_section.
532 (bfd_mach_o_scan_read_command): Decode UUID command.
533 (bfd_mach_o_flatten_sections): Add comments. Fix flavour names.
534 (bfd_mach_o_scan): Set flags according to file type.
535 (mach_o_fat_archentry): Remove abfd field.
536 (bfd_mach_o_archive_p): Remove initialization of abfd field.
537 (bfd_mach_o_openr_next_archived_file): Find previous archive
538 by position and not by bfd (as former bfds may have been freed).
539 Give architecture name to archived file.
540 * mach-o-target.c (TARGET_NAME): Use generic archive for non fat
541 targets.
542
cb5220a0
NC
5432008-10-30 Jay Krell <jay.krell@cornell.edu>
544
545 * cache.c (cache_bread): Cast void * pointer before performing
546 arithmetic on it.
547
7d9616d7
AM
5482008-10-20 Alan Modra <amodra@bigpond.net.au>
549
550 * elf64-ppc.c (ppc64_elf_process_dot_syms): Renamed from
551 ppc64_elf_check_directives.
552 * elf32-sh-symbian.c (sh_symbian_process_directives): Combine..
553 (sh_symbian_check_directives): ..this
554 (bfd_elf32_sh_symbian_process_directives) ..and this function.
555
58217f29
AM
5562008-10-20 Alan Modra <amodra@bigpond.net.au>
557
558 * elflink.c (bfd_elf_final_link): Move code reading relocs to..
559 * elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params.
560 * elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs
561 params.
562
bef26483
AM
5632008-10-20 Alan Modra <amodra@bigpond.net.au>
564
565 * elflink.c (bfd_elf_final_link): Use d_ptr rather than d_val
566 where Elf_Internal_Dyn holds an address.
567
f82e0623
NF
5682008-10-10 Nathan Froyd <froydnj@codesourcery.com>
569
570 * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge
571 Tag_GNU_Power_ABI_Struct_Return.
572
d078078d
KT
5732008-10-09 Kai Tietz <kai.tietz@onevision.com>
574
58217f29
AM
575 * cofflink.c (_bfd_coff_generic_relocate_section): Dump bfd_vma
576 sized addresses instead of long sized.
d078078d 577
066ee829
AM
5782008-10-09 Alan Modra <amodra@bigpond.net.au>
579
580 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't attempt to
581 read plt relocs if no dynamic syms.
582
8cc9115f
NC
5832008-10-08 Nick Clifton <nickc@redhat.com>
584
585 * configure.in (ALL_LINGUAS): Add "id".
586 * configure: Regenerate.
587 * po/id.po: New Indonesian translation.
588
aea274d3
AM
5892008-10-08 Alan Modra <amodra@bigpond.net.au>
590
591 * elf.c (assign_file_positions_for_load_sections): When checking
592 a segment for contents, don't assume that a non-TLS nobits section
593 must only be followed by nobits sections.
594
3926fc54
HPN
5952008-10-04 Hans-Peter Nilsson <hp@axis.com>
596
597 * elf32-cris.c (TLSHOWTO32, TLSHOWTO16): New macros.
598 (cris_elf_howto_table): Add entries for R_CRIS_32_GOT_GD,
599 R_CRIS_16_GOT_GD, R_CRIS_32_GD, R_CRIS_DTP, R_CRIS_32_DTPREL,
600 R_CRIS_16_DTPREL, R_CRIS_DTPMOD, R_CRIS_32_GOT_TPREL,
601 R_CRIS_16_GOT_TPREL, R_CRIS_32_TPREL, R_CRIS_16_TPREL.
602 (cris_reloc_map): Similarly.
603 * reloc.c (bfd_reloc_code_type): Add entries for
604 BFD_RELOC_CRIS_32_GOT_GD, BFD_RELOC_CRIS_16_GOT_GD,
605 BFD_RELOC_CRIS_32_GD, BFD_RELOC_CRIS_DTP,
606 BFD_RELOC_CRIS_32_DTPREL, BFD_RELOC_CRIS_16_DTPREL,
607 BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_GOT_TPREL,
608 BFD_RELOC_CRIS_16_GOT_TPREL, BFD_RELOC_CRIS_32_TPREL,
609 BFD_RELOC_CRIS_16_TPREL.
610 * libbfd.h, bfd-in2.h: Regenerate.
611
bcacc0f5
AM
6122008-10-03 Alan Modra <amodra@bigpond.net.au>
613
e932ca37 614 PR 6931
bcacc0f5
AM
615 * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when
616 the signature symbol is global.
617 * elflink.c (elf_link_input_bfd): Ensure group signature symbol
618 is output when ld -r. Set group sh_info when local.
619 * linker.c (default_indirect_link_order): Handle group sections
620 specially.
621
e144674a
NC
6222008-09-30 Wesley W. Terpstra <wesley@terpstra.ca>
623 Nick Clifton <nickc@redhat.com>
624
625 * coffgen.c (coff_write_symbols): Check to see if a symbol's flags
626 do not match it class and if necessary update the class.
627 (null_error_handler): New function. Suppresses the generation of
628 bfd error messages.
629 * coff64-rs6000.c (bfd_xcoff_backend_data): Update comment.
630
782e11fd
AM
6312008-09-30 Alan Modra <amodra@bigpond.net.au>
632
633 * Makefile.am: Run "make dep-am".
634 * Makefile.in: Regenerate.
635
33177bb1
AM
6362008-09-30 Alan Modra <amodra@bigpond.net.au>
637
638 * elflink.c (elf_link_add_object_symbols): Don't ignore returned
639 value of check_directives.
640
718a6fd8
SE
6412008-09-29 Peter O'Gorman <pogma@thewrittenword.com>
642 Steve Ellcey <sje@cup.hp.com>
643
644 * configure: Regenerate for new libtool.
645 * aclocal.m4: Ditto.
646 * Makefile.in: Ditto.
647 * doc/Makefile.in: Ditto.
648
ceae84aa
AM
6492008-09-29 Alan Modra <amodra@bigpond.net.au>
650
651 PR 6789
652 * elf.c (assign_file_positions_for_load_sections): Call
653 _bfd_elf_map_sections_to_segments, not elf_modify_segment_map.
654 (get_program_header_size): Protect against NULL info.
655 (_bfd_elf_map_sections_to_segments): Likewise.
656 * elf32-spu.c (spu_elf_additional_program_headers): Likewise.
657
afac680a
NC
6582008-09-29 Nick Clifton <nickc@redhat.com>
659
660 * po/vi.po: Updated Vietnamese translation.
661
9659de1c
AM
6622008-09-28 Alan Modra <amodra@bigpond.net.au>
663
664 * elf.c (_bfd_elf_init_private_section_data): Tweak union copy.
665 (bfd_section_from_shdr): Don't change SHT_GROUP section name.
666 * elflink.c (section_signature): New function.
667 (_bfd_elf_section_already_linked): Use it.
668
e79f5955
AM
6692008-09-19 Alan Modra <amodra@bigpond.net.au>
670
671 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Handle vxworks
672 _GLOBAL_OFFSET_TABLE_ in .got.plt section. Add BFD_ASSERTs.
673
b45329f9
BW
6742008-09-17 Bob Wilson <bob.wilson@acm.org>
675
ceae84aa
AM
676 * elf32-xtensa.c (elf_xtensa_check_relocs): Check for negative
677 refcount.
b45329f9 678
2a7b2e88
JK
6792008-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
680
681 PR 6893 - Do not consider FDEs for discarded sections as invalid.
682 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): New REQUIRE_CLEARED_RELOCS.
683 Consider FDEs with cleared relocations as valid and ignorable.
684
0a36a439
L
6852008-09-16 H.J. Lu <hongjiu.lu@intel.com>
686
687 PR ld/6877
688 * elflink.c (_bfd_elf_merge_symbol): Allow a common symbol to
689 override the function in a shared library.
690
e87d4038
AM
6912008-09-16 Alan Modra <amodra@bigpond.net.au>
692
693 PR 6844
694 * elf32-ppc.c (SYM_VAL): Define. Use throughout to find symbol vma.
695 (ppc_elf_relocate_section): Correct GOT offset calculation.
696 (ppc_elf_finish_dynamic_symbol): Use PPC_HA and PPC_LO.
697 (ppc_elf_finish_dynamic_sections): Likewise. Error if
698 htab->elf.hgot symbol is not defined in htab->got section.
699
3b4f3a11
AM
7002008-09-16 Alan Modra <amodra@bigpond.net.au>
701
702 PR 6888
703 * elf32-ppc.c (ppc_elf_relocate_section): Handle NULL symbol section
704 on R_PPC_TOC16, R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, R_PPC_EMB_SDA21,
705 R_PPC_EMB_RELSDA, R_PPC_SECTOFF* relocs.
706
d053aef8
JK
7072008-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
708
709 Fix loading large elf64 binaries on 32bit hosts.
710 * configure.in: Call AC_SYS_LARGEFILE.
711 * config.in: Regenerate.
712 * configure: Regenerate.
713
502e814e
TT
7142008-09-08 Tom Tromey <tromey@redhat.com>
715
716 * elfxx-mips.c (mips16_stub_symndx) <sec>: Mark argument as
717 unused.
718
5609a71e
DJ
7192008-09-08 H.J. Lu <hongjiu.lu@intel.com>
720 Daniel Jacobowitz <dan@codesourcery.com>
721
722 PR ld/3191
723 * dwarf2.c (struct adjusted_section): Renamed from struct
724 loadable_section.
725 (struct dwarf2_debug): Adjust for renaming. Add version field.
726 (read_attribute_value): Correctly handle DW_FORM_ref_addr for
727 DWARF3.
728 (find_abstract_instance_name): Pass a pointer to
729 attribute instead of offset. For DW_FORM_ref_addr, get the
730 entry at the offset from the .debug_info section.
731 (scan_unit_for_symbols): Update.
732 (parse_comp_unit): Allow DWARF3. Save the version.
733 (unset_sections): Update for renaming.
734 (place_sections): Likewise. Set new VMAs for DWARF sections
735 also.
736
96497422
TG
7372008-09-08 Tristan Gingold <gingold@adacore.com>
738
739 * configure.in: Update version to 2.19.50
740 * configure: Regenerated.
741
2d47a72c
DJ
7422008-09-05 Daniel Jacobowitz <dan@codesourcery.com>
743
744 * dwarf2.c: Change leading whitespace to tabs.
745
1e8a024a
TG
7462008-09-05 Tristan Gingold <gingold@adacore.com>
747
748 Add MacOSX 64 bits support.
749 * mach-o.h (bfd_mach_o_ppc_thread_flavour): Add
750 BFD_MACH_O_PPC_THREAD_STATE_64.
751 (bfd_mach_o_i386_thread_flavour): Add BFD_MACH_O_x86_THREAD_STATE64,
752 BFD_MACH_O_x86_FLOAT_STATE64, BFD_MACH_O_x86_EXCEPTION_STATE64,
753 BFD_MACH_O_x86_THREAD_STATE, BFD_MACH_O_x86_FLOAT_STATE,
754 BFD_MACH_O_x86_EXCEPTION_STATE.
755 (bfd_mach_o_load_command_type): Add
756 BFD_MACH_O_LC_SEGMENT_64, BFD_MACH_O_LC_ROUTINES_64,
58217f29 757 BFD_MACH_O_LC_UUID.
1e8a024a
TG
758 (BFD_MACH_O_CPU_IS64BIT): Added.
759 (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_POWERPC_64,
760 BFD_MACH_O_CPU_TYPE_X86_64.
761 (bfd_mach_o_header): Add version field.
762 (bfd_mach_o_section) Add reserved3 field.
763 (bfd_mach_o_segment_command): Add initprot and maxprot fields.
764
765 * mach-o.c (N_TEXT, N_DATA, N_BSS): Added.
766 (bfd_mach_o_version): New function.
767 (bfd_mach_o_valid): Handle 64bits cpus.
768 (bfd_mach_o_write_header): handler 64bits headers.
769 (bfd_mach_o_scan_write_section_32, bfd_mach_o_scan_write_section_64):
770 New functions (from bfd_mach_o_scan_write_section) to handle both
771 flavors.
772 (bfd_mach_o_scan_write_segment): Parameter wide added to support
773 both flavors.
774 (bfd_mach_o_write_contents): Support both flavors.
775 (bfd_mach_o_read_header): Ditto.
776 (bfd_mach_o_scan_read_section_32, bfd_mach_o_scan_read_section_64):
777 New functions (from bfd_mach_o_scan_read_section) to support both
778 flavors.
779 (bfd_mach_o_scan_read_symtab_symbol): Support both flavors.
780 (bfd_mach_o_scan_read_symtab): Ditto.
781 (bfd_mach_o_scan_read_segment): Parameter wide added to support
782 both flavors.
783 (bfd_mach_o_scan_read_segment_32, bfd_mach_o_scan_read_segment_64):
784 New functions to call bfd_mach_o_scan_read_segment.
785 (bfd_mach_o_flatten_sections): Support both flavors.
786 (bfd_mach_o_scan_start_address): Ditto.
787 (bfd_mach_o_scan): Ditto.
788 (bfd_mach_o_lookup_section): Ditto.
58217f29 789
6bba1048
DA
7902008-08-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
791
792 * elf-hppa.h (elf_hppa_reloc_final_type): Handle R_PARISC_GPREL64,
793 R_PARISC_SEGREL32 and R_PARISC_SEGREL64.
794 * som.c (som_fixup_formats): Add R_DATA_GPREL fixup.
795 (som_hppa_howto_table): Likewise.
796 (hppa_som_gen_reloc_type): In case R_HPPA_GOTOFF, detect R_DATA_GPREL
797 final type.
798 (som_write_fixups): Handle R_DATA_GPREL.
799
fcef9eb7
NC
8002008-08-26 Nick Clifton <nickc@redhat.com>
801
802 * elf32-arm.c: Fix up comment describing Thumb to ARM interworking
803 stub.
804
c820be07
NC
8052008-08-25 Christophe Lyon <christophe.lyon@st.com>
806
807 * elf32-arm.c (arm_thumb_arm_v4t_short_branch_stub): Define.
808 (elf32_arm_stub_type): Add arm_thumb_arm_v4t_stub_short_branch.
809 (arm_type_of_stub): Handle armv4t short branches. Update
810 prototype.
811 (arm_stub_is_thumb): Handle arm_thumb_arm_v4t_stub_short_branch.
812 (arm_build_one_stub): Likewise.
813 (arm_size_one_stub): Likewise.
814 (elf32_arm_size_stubs): Use new arm_type_of_stub prototype.
815 (arm_map_one_stub): Handle arm_thumb_arm_v4t_stub_short_branch.
816
9c47c4c1
AS
8172008-08-24 Andreas Schwab <schwab@suse.de>
818
819 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Do proper
820 extension when calculating difference of offsets.
821
da594c4a
AM
8222008-08-24 Alan Modra <amodra@bigpond.net.au>
823
824 * configure.in: Update a number of obsolete autoconf macros.
825 * aclocal.m4: Regenerate.
826
91910cdd
AS
8272008-08-23 Andreas Schwab <schwab@suse.de>
828
829 * opncls.c (find_separate_debug_file): Use the canonical
830 absolute name of the bfd object for finding the debug file in
831 the global debugfile directory.
832
b2064611
JK
8332008-08-22 Jakub Jelinek <jakub@redhat.com>
834
835 Fix PR ld/3290 regression for cross-files DW_FORM_ref_addr relocations.
836 * elflink.c (elf_link_add_object_symbols): Make debug symbols local
837 now only for non-RELOCATABLE targets.
838
28dbbc02
BW
8392008-08-20 Bob Wilson <bob.wilson@acm.org>
840
841 * elf-bfd.h (elf_object_id): Add XTENSA_ELF_TDATA.
842 * elf32-xtensa.c (elf_howto_table): Add TLS relocations.
843 (elf_xtensa_reloc_type_lookup): Likewise.
844 (TCB_SIZE): Define.
845 (elf_xtensa_link_hash_entry): New.
846 (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE, GOT_TLS_ANY): Define.
847 (elf_xtensa_hash_entry): Define.
848 (elf_xtensa_obj_tdata): New.
849 (elf_xtensa_tdata): Define.
850 (elf_xtensa_local_got_tls_type): Define.
851 (elf_xtensa_local_tlsfunc_refcounts): Define.
852 (is_xtensa_elf): Define.
853 (elf_xtensa_mkobject): New.
854 (elf_xtensa_link_hash_table): Add tlsbase field.
855 (elf_xtensa_link_hash_newfunc): New.
856 (elf_xtensa_link_hash_table_create): Use elf_xtensa_link_hash_newfunc.
857 Create an entry for "_TLS_MODULE_BASE_" and save it in tlsbase field.
858 (elf_xtensa_copy_indirect_symbol): New.
859 (elf_xtensa_check_relocs): Rewrite to handle TLS relocations.
860 (elf_xtensa_gc_sweep_hook): Likewise.
861 (elf_xtensa_allocate_dynrelocs): Optimize away GOT entries for
862 TLSDESC_FN relocations when an IE reference is seen.
863 (elf_xtensa_allocate_local_got_size): Likewise.
864 (elf_xtensa_always_size_sections): New.
865 (dtpoff_base, tpoff): New.
866 (elf_xtensa_do_reloc): Handle TLS relocations.
867 (replace_tls_insn): New.
868 (IS_XTENSA_TLS_RELOC): Define.
869 (elf_xtensa_relocate_section): Handle TLS relocations.
870 (get_indirect_call_dest_reg): New.
871 (bfd_elf32_mkobject): Define.
872 (elf_backend_always_size_sections): New.
873 (elf_backend_copy_indirect_symbol): New.
874 * reloc.c (BFD_RELOC_XTENSA_TLSDESC_FN, BFD_RELOC_XTENSA_TLSDESC_ARG)
875 (BFD_RELOC_XTENSA_TLS_DTPOFF, BFD_RELOC_XTENSA_TLS_TPOFF)
876 (BFD_RELOC_XTENSA_TLS_FUNC, BFD_RELOC_XTENSA_TLS_ARG)
877 (BFD_RELOC_XTENSA_TLS_CALL): New.
878 * bfd-in2.h: Regenerate.
879 * libbfd.h: Regenerate.
880
61b0a4af
RS
8812008-08-18 Richard Sandiford <rdsandiford@googlemail.com>
882
883 * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Copy MIPS16
884 stub information.
885
3e08fb72
NC
8862008-08-17 Nick Clifton <nickc@redhat.com>
887
8029a119
NC
888 * elf32-arm.c: Tidy up the code.
889 (bfd_elf32_arm_allocate_interworking_sections): Move common code
890 into...
891 (arm_allocate_glue_section_space): ... New function.
892 (bfd_elf32_arm_add_glue_sections_to_bfd): Move common code
893 into...
894 (arm_make_glue_section): ... New function.
895
3e08fb72
NC
896 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Handle the situation
897 where the sym_hashes are not available.
898
5c1d2f5f
AM
8992008-08-17 Alan Modra <amodra@bigpond.net.au>
900
901 * bfd.c (struct _bfd): Correct outsymbols comment.
902 * bfd-in2.h: Regenerate.
903 * linker.c (bfd_generic_link_read_symbols): Renamed from..
904 (generic_link_read_symbols): ..this, and made global.
905
7357c5b6
AM
9062008-08-15 Alan Modra <amodra@bigpond.net.au>
907
908 PR 6526
909 * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS.
910 * Makefile.in: Regenerate.
911 * aclocal.m4: Regenerate.
912 * config.in: Regenerate.
913 * configure: Regenerate.
914
70df0c05
AM
9152008-08-14 Jaka Močnik <jaka@xlab.si>
916
917 * coffgen.c (coff_find_nearest_line): Correct cached line index.
918
b099ab9f
AM
9192008-08-12 Alan Modra <amodra@bigpond.net.au>
920
921 * elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs when
922 !dynamic_sections_created. Don't make symbols with got
923 references dynamic if !dynamic_sections_created.
924 * elf64-ppc.c (allocate_dynrelocs): Likewise. Alloc dynamic
925 relocs on undefined symbols.
926 (ppc64_elf_relocate_section): Allow dynamic relocs on
927 undefined symbols.
928
90aecf7a
AM
9292008-08-11 Alan Modra <amodra@bigpond.net.au>
930
931 * elf64-ppc.c (toc_adjusting_stub_needed): Any call via the plt
932 needs r2 valid, not just those to external syms.
933
ae38509c
PA
9342008-08-09 Pedro Alves <pedro@codesourcery.com>
935
936 * archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat
937 st_mtime to long before comparison.
938
7b21ac3f
EW
9392008-08-08 Anatoly Sokolov <aesok@post.ru>
940
941 * archures.c (bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35,
942 bfd_mach_avr51): New.
943 * bfd-in2.h: Regenerate.
944 * cpu-avr.c (arch_info_struct): Add avr25, avr31, avr35, and avr51
945 architectures. Change comments to match architecture comments in GCC.
946 (compatible): Add test for new AVR architectures.
947 * elf32-avr.c (bfd_elf_avr_final_write_processing): Recognize
948 bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35 and bfd_mach_avr51.
949 (elf32_avr_object_p): Recognize E_AVR_MACH_AVR25, E_AVR_MACH_AVR31,
950 E_AVR_MACH_AVR35 and E_AVR_MACH_AVR51.
951
952
861fb55a
DJ
9532008-08-08 Richard Sandiford <rdsandiford@googlemail.com>
954 Daniel Jacobowitz <dan@codesourcery.com>
955 Catherine Moore <clm@codesourcery.com>
956 Mark Shinwell <shinwell@codesourcery.com>
957 Maxim Kuvyrkov <maxim@codesourcery.com>
958
959 * elf32-mips.c (mips_vxworks_copy_howto_rela): Replace with...
960 (elf_mips_copy_howto): ...this howto. Clear the size fields.
961 (mips_vxworks_jump_slot_howto_rela): Replace with...
962 (elf_mips_jump_slot_howto): ...this howto.
963 (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
964 and BFD_RELOC_MIPS_JUMP_SLOT.
965 (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
966 "R_MIPS_JUMP_SLOT".
967 (mips_elf32_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT.
968 (elf_backend_plt_readonly): Define.
969 (elf_backend_plt_sym_val): Define for non-VxWorks targets.
970 (mips_vxworks_bfd_reloc_type_lookup): Delete.
971 (mips_vxworks_bfd_reloc_name_lookup): Likewise.
972 (mips_vxworks_rtype_to_howto): Likewise.
973 (elf_backend_want_dynbss): Don't define for VxWorks.
974 (elf_backend_plt_readonly): Likewise.
975 (bfd_elf32_bfd_reloc_type_lookup): Likewise.
976 (bfd_elf32_bfd_reloc_name_lookup): Likewise.
977 (elf_backend_mips_rtype_to_howto): Likewise.
978 (elf_backend_adjust_dynamic_symbol): Likewise.
979 (elf_backend_got_symbol_offset): Don't define.
980 * elfn32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New.
981 (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
982 and BFD_RELOC_MIPS_JUMP_SLOT.
983 (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
984 "R_MIPS_JUMP_SLOT".
985 (mips_elf32_n32_rtype_to_howto): Handle R_MIPS_COPY and
986 R_MIPS_JUMP_SLOT.
987 (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly)
988 (elf_backend_plt_sym_val): Define.
989 * elf64-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New.
990 (bfd_elf64_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
991 and BFD_RELOC_MIPS_JUMP_SLOT.
992 (bfd_elf64_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and
993 "R_MIPS_JUMP_SLOT".
994 (mips_elf64_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT.
995 (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly)
996 (elf_backend_plt_sym_val): Define.
997 * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Delete.
998 (_bfd_mips_elf_use_plts_and_copy_relocs, _bfd_mips_elf_init_stubs)
999 (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): Declare.
1000 * elfxx-mips.c (mips_elf_la25_stub): New structure.
1001 (LA25_LUI, LA25_J, LA25_ADDIU): New macros.
1002 (mips_elf_link_hash_entry): Add "la25_stubs", "has_static_relocs"
1003 and "has_nonpic_branches" fields. Remove "is_relocation_target" and
1004 "is_branch_target".
1005 (mips_elf_link_hash_table): Add blank lines. Add
1006 "use_plts_and_copy_relocs", "reserved_gotno", "strampoline",
1007 "la25_stubs" and "add_stub_section" fields.
1008 (mips_htab_traverse_info): New structure.
1009 (PIC_OBJECT_P, MIPS_ELF_LOAD_WORD): New macros.
1010 (MIPS_RESERVED_GOTNO): Delete.
1011 (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry)
1012 (mips_n64_exec_plt0_entry, mips_exec_plt_entry): New tables.
1013 (mips_elf_link_hash_newfunc): Update after the changes to
1014 mips_elf_link_hash_entry.
1015 (mips_elf_check_mips16_stubs): Replace the DATA parameter with
1016 an INFO parameter. Don't look through warnings symbols here;
1017 do it in mips_elf_check_symbols instead.
1018 (mips_elf_create_stub_symbol): New function.
1019 (mips_elf_la25_stub_hash, mips_elf_la25_stub_eq): New functions.
1020 (_bfd_mips_elf_init_stubs, mips_elf_local_pic_function_p): Likewise.
1021 (mips_elf_add_la25_intro, mips_elf_add_la25_trampoline): Likewise.
1022 (mips_elf_add_la25_stub, mips_elf_check_symbols): New functions.
1023 (mips_elf_gotplt_index): Check for VxWorks.
1024 (mips_elf_output_dynamic_relocation): Take the relocation index
1025 as an extra parameter. Do not increment reloc_count here.
1026 (mips_elf_initialize_tls_slots): Update the calls to
1027 mips_elf_output_dynamic_relocation accordingly.
1028 (mips_elf_multi_got): Use htab->reserved_gotno instead of
1029 MIPS_RESERVED_GOTNO.
1030 (mips_elf_create_got_section): Don't allocate reserved GOT
1031 entries here. Unconditionally create .got.plt, but don't
1032 set its alignment here.
1033 (mips_elf_relocation_needs_la25_stub): New function.
1034 (mips_elf_calculate_relocation): Redirect branches and jumps to
1035 a non-PIC stub if one exists. Check !h->has_static_relocs instead
1036 of !htab->is_vxworks when deciding whether to create dynamic
1037 relocations for R_MIPS_32, R_MIPS_REL32 and R_MIPS_64.
1038 (_bfd_mips_elf_create_dynamic_sections): Unconditionally call
1039 _bfd_elf_create_dynamic_sections. Unconditionally set up
1040 htab->splt and htab->sdynbss. Set htab->srelplt to ".rel.plt"
1041 if !htab->is_vxworks. Add non-VxWorks values of
1042 htab->plt_header_size and htab->plt_entry_size.
1043 (_bfd_mips_elf_check_relocs): Set pointer_equality_needed for
1044 non-branch static relocations. Set has_nonpic_branches when an la25
1045 stub might be required. Set can_make_dynamic_p to TRUE if R_MIPS_32,
1046 R_MIPS_REL32 and R_MIPS_64 relocations can be made dynamic,
1047 rather than duplicating the condition. Do not make them dynamic
1048 for read-only sections in non-PIC executable objects.
1049 Do not protect this code with dynobj == NULL || htab->sgot == NULL;
1050 handle each group of cases separately. Add a default case that
1051 sets has_static_relocs for non-GOT relocations that cannot be
1052 made dynamic. Don't set is_relocation_target and is_branch_target.
1053 Reject non-PIC static relocations in shared objects.
1054 (_bfd_mips_vxworks_adjust_dynamic_symbol): Fold into...
1055 (_bfd_mips_elf_adjust_dynamic_symbol): ...here, using
1056 htab->use_plts_and_copy_relocs instead of htab->is_vxworks
1057 to select PLT and copy-reloc handling. Set the alignment of
1058 .plt and .got.plt when allocating the first entry. Generalize
1059 code to handle REL as well as RELA sections and 64-bit as well as
1060 32-bit GOT entries. Complain if we find a static-only reloc
1061 against an externally-defined symbol and if we cannot create
1062 dynamic relocations for it. Allocate copy relocs using
1063 mips_elf_allocate_dynamic_relocations on non-VxWorks targets.
1064 Set possibly_dynamic_relocs to 0 when using PLTs or copy relocs.
1065 Skip reserved .got.plt entries.
1066 (_bfd_mips_elf_always_size_sections): Use mips_elf_check_symbols
1067 instead of mips_elf_check_mips16_stubs to process each symbol.
1068 Do the traversal for relocatable objects too.
1069 (mips_elf_lay_out_got): Use htab->reserved_gotno instead of
1070 MIPS_RESERVED_GOTNO.
1071 (_bfd_mips_elf_size_dynamic_sections): Exclude sdynbss if it
1072 is empty. Extend the DT_PLTREL, DT_JMPREL and DT_PLTRELSZ handling
1073 to non-VxWorks targets. Only add DT_REL{,A}, DT_REL{,A}SZ and
1074 DT_REL{,A}ENT if .rel.dyn is nonempty. Create a symbol for the
1075 PLT. Allocate a nop at the end of the PLT. Allocate DT_MIPS_PLTGOT.
1076 (mips_elf_create_la25_stub_info): New function.
1077 (_bfd_mips_elf_finish_dynamic_symbol): Write out PLT entries
1078 and copy relocs where necessary. Check pointer_equality_needed.
1079 (mips_finish_exec_plt): New function.
1080 (_bfd_mips_elf_finish_dynamic_sections): Always set DT_PLTGOT
1081 to the beginning of htab->sgot. Use htab->reserved_gotno instead
1082 of MIPS_RESERVED_GOTNO. Assert htab->use_plts_and_copy_relocs
1083 instead of htab->is_vxworks for DT_PLTREL, DT_PLTRELSZ and DT_JMPREL.
1084 Set DT_PLTREL to DT_REL instead of DT_RELA on non-VxWorks targets.
1085 Use mips_finish_exec_plt to create non-VxWorks PLT headers. Set
1086 DT_MIPS_PLTGOT.
1087 (_bfd_mips_elf_copy_indirect_symbol): Copy has_static_relocs
1088 from the indirect symbol to the direct symbol. Also copy
1089 has_nonpic_branches for indirect symbols.
1090 (_bfd_mips_elf_get_target_dtag): Handle DT_MIPS_PLTGOT and
1091 DT_MIPS_RWPLT.
1092 (_bfd_mips_elf_link_hash_table_create): Initialize the new
1093 mips_elf_link_hash_table fields.
1094 (_bfd_mips_vxworks_link_hash_table_create): Set
1095 use_plts_and_copy_relocs to TRUE. Use TRUE rather than 1
1096 when setting is_vxworks.
1097 (_bfd_mips_elf_use_plts_and_copy_relocs): New function.
1098 (_bfd_mips_elf_final_link): Call mips_elf_create_la25_stub for
1099 each la25_stub.
1100 (_bfd_mips_elf_merge_private_bfd_data): Treat dynamic objects
1101 as PIC. Generalize message about linking PIC and non-PIC.
1102 (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): New
1103 functions.
1104 * reloc.c: Update comment near BFD_RELOC_MIPS_JUMP_SLOT.
1105 * bfd-in2.h: Regenerated.
1106
4dd07732
AM
11072008-08-08 Alan Modra <amodra@bigpond.net.au>
1108
1109 * elf.c (bfd_elf_get_elf_syms): Don't leak memory on error.
1110 * elflink.c (_bfd_elf_link_read_relocs): bfd_release on error.
1111 (elf_link_add_object_symbols): Don't leak memory on error.
1112 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1113 (elf_fixup_link_order): Free sections.
1114
d35fd659
RS
11152008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1116
1117 * elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field.
1118 * elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro.
1119 (elfNN_bed): Use it.
1120 * elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p
1121 instead of default_use_rela_p to choose between ".rel.plt" and
1122 ".rela.plt".
1123 * elflink.c (_bfd_elf_create_dynamic_sections): Use
1124 rela_plts_and_copies_p instead of default_use_rela_p to choose
1125 between ".rel.plt" and ".rela.plt", and between ".rel.bss" and
1126 ".rela.bss".
1127
d5eaccd7
RS
11282008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1129
1130 * elf-bfd.h (MIPS_ELF_TDATA): New elf_object_id.
1131 * elf32-mips.c (bfd_elf32_mkobject): Define.
1132 * elf64-mips.c (bfd_elf64_mkobject): Likewise.
1133 * elfn32-mips.c (bfd_elf32_mkobject): Likewise.
1134 * elfxx-mips.h (_bfd_mips_elf_mkobject): Declare.
1135 * elfxx-mips.c (is_mips_elf): New macro.
1136 (_bfd_mips_elf_mkobject): New function.
1137 (_bfd_mips_elf_final_link): Use is_mips_elf.
1138 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1139
aff469fa
RS
11402008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1141
1142 * elfxx-mips.c (mips_elf_record_relocs): Defer allocation of a
1143 global GOT entry when deferring allocation of dynamic relocations.
1144 (allocate_dynrelocs): When allocating deferred dynamic relocations,
1145 also do the deferred allocation of a GOT entry.
1146
23cc69b6
RS
11472008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1148
1149 * elfxx-mips.c (mips_got_info): Add a "reloc_only_gotno" field.
1150 (mips_elf_got_section): Delete.
1151 (mips_elf_sort_hash_table): Use g->reloc_only_gotno to decide
1152 how many reloc-only entries there are.
1153 (mips_elf_count_got_symbols): Adjust g->reloc_only_gotno as
1154 well as g->global_gotno.
1155 (mips_elf_make_got_per_bfd): Initialize reloc_only_gotno.
1156 (mips_elf_multi_got): Likewise. Use gg->reloc_only_gotno
1157 rather than gg->assigned_gotno to store the number of
1158 reloc-only GOT entries.
1159 (mips_elf_create_got_section): Remove the MAYBE_EXCLUDE parameter.
1160 Initialize reloc_only_gotno.
1161 (mips_elf_calculate_relocation): Check htab->got_info instead of
1162 dynobj when deciding whether to call mips_elf_adjust_gp,
1163 (_bfd_mips_elf_create_dynamic_sections): Adjust the call
1164 to mips_elf_create_got_section.
1165 (mips_elf_record_relocs): Likewise. Remove redundant
1166 "dynobj == NULL" code. Do not use mips_elf_create_got_section
1167 or mips_elf_record_global_got_symbol for R_MIPS_32, R_MIPS_REL32
1168 and R_MIPS_64; limit global_got_area to GGA_RELOC_ONLY instead.
1169 (_bfd_mips_elf_finish_dynamic_symbol): Use htab->sgot instead
1170 of mips_elf_got_section.
1171 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1172 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1173 Move the initial assignment of G to the block that uses it;
1174 it is used for an unrelated purpose later.
1175
d4596a51
RS
11762008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1177
1178 * elfxx-mips.c (count_section_dynsyms): Move before the new first use.
1179 (mips_elf_sort_hash_table): Take the output bfd as a parameter.
1180 Remove the MAX_LOCAL parameter. Exit early if there are no
1181 dynamic symbols, if there is no dynobj, or if there is no
1182 GOT section. Use count_section_dynsyms instead of MAX_LOCAL.
1183 Assert == rather than <= when checking hsd.max_unref_got_dynindx.
1184 Also assert that g->global_gotno is right.
1185 (mips_elf_count_forced_local_got_symbols): Rename to...
1186 (mips_elf_count_got_symbols): ...and count global GOT entries too.
1187 Set the global_got_area of a forced-local GGA_RELOC_ONLY symbol
1188 to GGA_NONE.
1189 (mips_elf_multi_got): Don't sort the symbol table.
1190 (mips_elf_lay_out_got): Likewise. Use mips_elf_count_got_symbols
1191 to count the number of global GOT entries.
1192 (_bfd_mips_elf_final_link): Unconditionally call
1193 mips_elf_sort_hash_table.
1194
634835ae
RS
11952008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1196
1197 * elfxx-mips.c (GGA_NORMAL, GGA_RELOC_ONLY, GGA_NONE): New macros.
1198 (mips_elf_link_hash_entry): Add a "global_got_area" field.
1199 (mips_elf_link_hash_newfunc): Initialize it.
1200 (mips_elf_sort_hash_table_f): Use h->global_got_area instead of
1201 h->root.got.offset. Do not handle forced_local symbols specially.
1202 (mips_elf_record_global_got_symbol): Set h->global_got_area
1203 instead of h->root.got.offset.
1204 (mips_elf_recreate_got): Assert that h->global_got_area == GGA_NONE
1205 for indirect and warning symbols.
1206 (mips_elf_count_forced_local_got_symbols): Change the argument
1207 from a "elf_link_hash_entry" to "mips_elf_link_hash_entry".
1208 Use and set h->global_got_area instead of h->root.got.offset.
1209 Set it to GGA_NONE for all forced-local symbols.
1210 (mips_elf_set_global_got_offset): Set h->global_got_area
1211 instead of h->root.got.offset. Use g->global_got_area instead
1212 of a combination of dynindx, forced_local and tls_type.
1213 (mips_elf_multi_got): Remove disabled code. Pass GGA_* values to
1214 mips_elf_set_global_got_offset.
1215 (mips_elf_lay_out_got): Use mips_elf_link_hash_traverse instead
1216 of elf_link_hash_traverse.
1217 (_bfd_mips_elf_copy_indirect_symbol): Copy the indirect symbol's
1218 global_got_area to the direct symbol if the latter's value is higher.
1219 Set the indirect symbol's area to GGA_NONE.
1220
33bb52fb
RS
12212008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1222
1223 * elf32-mips.c (elf_backend_hide_symbol): Delete.
1224 * elfn32-mips.c (elf_backend_hide_symbol): Likewise.
1225 * elf64-mips.c (elf_backend_hide_symbol): Likewise.
1226 * elfxx-mips.h (elf_backend_hide_symbol): Likewise.
1227 * elfxx-mips.c (mips_elf_link_hash_entry): Remove "forced_local"
1228 and add "needs_lazy_stub".
1229 (mips_elf_link_hash_newfunc): Update accordingly.
1230 (mips_elf_link_hash_table): Remove "computed_got_sizes" and
1231 add "lazy_stub_count".
1232 (_bfd_mips_elf_link_hash_table_create): Update accordingly.
1233 (mips_elf_output_extsym): Use hd->needs_lazy_stub to detect
1234 cases where a lazy stub is being used.
1235 (mips_elf_sort_hash_table_f): Use h->root.forced_local instead
1236 of h->forced_local.
1237 (mips_elf_record_global_got_symbol): Use _bfd_elf_link_hash_hide_symbol
1238 instead of _bfd_mips_elf_hide_symbol. Do not increment local_gotno
1239 here.
1240 (mips_elf_allocate_dynamic_relocations): Move before new first use.
1241 (mips_elf_check_recreate_got, mips_elf_recreate_got): New functions.
1242 (mips_elf_resolve_final_got_entries): Move earlier in file. Make at
1243 most two passes over the hash table. Use mips_elf_check_recreate_got
1244 to see if there are any indirect or warning entries and
1245 mips_elf_recreate_got to create a new GOT without them.
1246 Return a boolean success value.
1247 (mips_elf_count_forced_local_got_entries): New function.
1248 (mips_elf_make_got_per_bfd): Check h->root.forced_local instead of
1249 h->forced_local.
1250 (mips_elf_set_global_got_offset): Likewise.
1251 (mips_elf_set_no_stub): Replace with...
1252 (mips_elf_forbid_lazy_stubs): ...this new function.
1253 (mips_elf_resolve_final_got_entry): Delete.
1254 (mips_elf_multi_got): Fix formatting. Use mips_elf_forbid_lazy_stubs
1255 instead of mips_elf_set_no_stub. Move the code that sets
1256 global offsets and allocates dynamic relocations from the main
1257 _bfd_mips_elf_size_dynamic_sections loop to here.
1258 (_bfd_mips_elf_adjust_dynamic_symbol): Do not allocate room in
1259 .MIPS.stubs here; just set hmips->needs_lazy_stub and increment
1260 htab->lazy_stub_count.
1261 (_bfd_mips_elf_always_size_sections): Move the stub-estimation
1262 code to mips_elf_estimate_stub_size and the GOT-sizing code to
1263 mips_elf_lay_out_got. Do not call these functions here.
1264 (mips_elf_estimate_stub_size): New function, split
1265 out from _bfd_mips_elf_always_size_sections. Call
1266 mips_elf_resolve_final_got_entries earlier. Count the number
1267 of forced-local entries. Do not add stub sizes to loadable_size;
1268 after this patch, the stub sizes are already included in the main
1269 estimate. Allocate dynamic relocations here rather than in the
1270 main _bfd_mips_elf_size_dynamic_sections loop.
1271 (mips_elf_estimate_stub_size): New function, split out from
1272 _bfd_mips_elf_always_size_sections.
1273 (mips_elf_allocate_lazy_stub): New function.
1274 (mips_elf_lay_out_lazy_stubs): Likewise.
1275 (_bfd_mips_elf_size_dynamic_sections): Call mips_elf_estimate_stub_size,
1276 mips_elf_lay_out_got and mips_elf_lay_out_lazy_stubs. Do not handle
1277 the allocation of sreldyn specially.
1278 (_bfd_mips_elf_hide_symbol): Delete.
1279
63897e2c
RS
12802008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
1281
1282 * elfxx-mips.c (allocate_dynrelocs): Ignore indirect and warning
1283 symbols.
1284
71782a75
RS
12852008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1286
1287 * elfxx-mips.c (mips_elf_link_hash_entry): Move bfd_boolean
1288 fields to the end of the structure and make them single-bit
1289 bitfields.
1290 (mips_elf_link_hash_newfunc): Make the initialization statements
1291 follow the new field order.
1292
a8028dd0
RS
12932008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1294
1295 * elfxx-mips.c (_mips_elf_section_data): Remove the "u.got_info" field.
1296 (mips_elf_link_hash_table): Add "sgot" and "got_info" fields.
1297 (_bfd_mips_elf_link_hash_table_create): Initialize them.
1298 (mips_elf_got_section): Always apply the !maybe_excluded behavior.
1299 (mips_elf_got_info): Delete.
1300 (mips_elf_initialize_tls_slots): Remove the DYNOBJ local variable.
1301 Adjust the call to mips_elf_got_section.
1302 (mips_elf_local_got_index): Don't call mips_elf_got_info.
1303 Update the call to mips_elf_create_local_got_entry.
1304 Use htab->got_info.
1305 (mips_elf_global_got_index): Don't call mips_elf_got_info;
1306 use htab->got_info and htab->sgot instead.
1307 (mips_elf_got_page): Don't call mips_elf_got_info. Update the
1308 call to mips_elf_create_local_got_entry.
1309 (mips_elf_got16_entry): Likewise.
1310 (mips_elf_got_offset_from_index): Replace with DYNOBJ parameter
1311 with an INFO parameter. Don't call mips_elf_got_info; use htab->sgot
1312 and htab->got_info instead.
1313 (mips_elf_create_local_got_entry): Remove the GG and SGOT parameters.
1314 Use htab->sgot and htab->got_info.
1315 (mips_elf_sort_hash_table): Remove the DYNOBJ local variable.
1316 Don't call mips_elf_got_info; use htab->got_info instead.
1317 (mips_elf_record_global_got_symbol): Turn G from a paramter to
1318 a local variable and read it from htab->got_info.
1319 (mips_elf_record_local_got_symbol): Replace the G parameter with
1320 an INFO parameter. Make G a local variable and read it from
1321 htab->got_info instead.
1322 (mips_elf_record_got_page_entry): Likewise.
1323 (mips_elf_multi_got): Remove the G parameter and make it a local
1324 variable instead. Read it from htab->got_info.
1325 (mips_elf_create_got_section): Cache the GOT section in htab->sgot.
1326 Store the GOT information in htab->got_info.
1327 (mips_elf_calculate_relocation): Don't call mips_elf_got_section
1328 and mips_elf_got_info; use htab->sgot and htab->got_info instead.
1329 Adjust the calls to mips_elf_got_offset_from_index and
1330 mips_elf_adjust_gp.
1331 (_bfd_mips_elf_check_relocs): Remove the G and SGOT local variables.
1332 Adjust the calls to mips_elf_record_local_got_symbol,
1333 mips_elf_record_global_got_symbol and mips_elf_record_got_page_entry.
1334 Use htab->sgot.
1335 (_bfd_mips_elf_always_size_sections): Remove the DYNOBJ local variable.
1336 Don't call mips_elf_got_info; use htab->sgot and htab->got_info instead.
1337 Update the call to mips_elf_multi_got.
1338 (_bfd_mips_elf_size_dynamic_sections): Don't call mips_elf_got_info;
1339 use htab->got_info instead.
1340 (_bfd_mips_elf_finish_dynamic_symbol): Update the call to
1341 mips_elf_got_section. Get the got_info from the hash table
1342 rather than the GOT section.
1343 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1344 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1345 (_bfd_mips_elf_hide_symbol): Don't call mips_elf_got_section;
1346 get the got_info from the hash table instead. Remove the GOT
1347 local variable.
1348 (_bfd_mips_elf_final_link): Likewise. Also remove the DYNOBJ
1349 local variable.
1350
4e41d0d7
RS
13512008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1352
1353 * elfxx-mips.c (mips_elf_link_hash_table): Add an "sstubs" field.
1354 (_bfd_mips_elf_create_dynamic_sections): Use it to cache the stubs
1355 section. Don't check whether the section already exists.
1356 (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->sstubs.
1357 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1358 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1359 (_bfd_mips_elf_size_dynamic_sections): Likewise. Don't add the
1360 dummy stub to an empty section.
1361 (_bfd_mips_elf_link_hash_table_create): Initialize the "sstubs" field.
1362
738e5348
RS
13632008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
1364
1365 * reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare.
1366 * libbfd.h, bfd-in2.h: Regenerate.
1367 * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
1368 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
1369 (mips16_reloc_map): Add mappings.
1370 * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved
1371 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
1372 (mips16_elf64_howto_table_rela): Likewise.
1373 (mips16_reloc_map): Add mappings.
1374 * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
1375 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
1376 (elf_mips16_howto_table_rela): Likewise.
1377 (mips16_reloc_map): Add mappings.
1378 * elfxx-mips.c (mips_elf_create_shadow_symbol): New function.
1379 (section_allows_mips16_refs_p): Likewise.
1380 (mips16_stub_symndx): Likewise.
1381 (mips_elf_check_mips16_stubs): Treat the data argument as a
1382 bfd_link_info. Mark every dynamic symbol as needing MIPS16 stubs
1383 and create a "shadow" symbol for the original MIPS16 definition.
1384 (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p)
1385 (lo16_reloc_p, mips16_call_reloc_p): New functions.
1386 (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize
1387 relocation checks.
1388 (_bfd_mips16_elf_reloc_shuffle): Likewise.
1389 (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16.
1390 (mips_elf_got16_entry): Add comment.
1391 (mips_elf_calculate_relocation): Use hi16_reloc_p,
1392 lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p
1393 to generalize relocation checks. Use section_allows_mips16_refs_p
1394 instead of mips16_stub_section_p. Handle R_MIPS16_CALL16 and
1395 R_MIPS16_GOT16, allowing the former to refer directly to a
1396 MIPS16 function if its stub is not needed.
1397 (mips16_stub_section_p): Delete.
1398 (_bfd_mips_elf_symbol_processing): Convert odd-valued function
1399 symbols into even MIPS16 symbols.
1400 (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize
1401 a relocation check.
1402 (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end"
1403 earlier in the function. Use mips16_stub_symndx to identify
1404 the target function. Avoid out-of-bounds accesses when the
1405 stub has no relocations; report an error instead. Use
1406 section_allows_mips16_refs_p instead of mips16_stub_section_p.
1407 Use mips16_call_reloc_p and got16_reloc_p to generalize relocation
1408 checks. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. Don't create
1409 dynamic relocations for absolute references to __gnu_local_gp.
1410 (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as
1411 the argument to mips_elf_check_mips16_stubs. Generalize comment.
1412 (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p
1413 to generalize relocation checks.
1414 (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function
1415 symbol has a non-MIPS16 stub, redirect the symbol to the stub.
1416 Fix an overly long line. Don't give dynamic symbols type STO_MIPS16.
1417 (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and
1418 R_MIPS16_GOT16.
1419
e7d92e2e
AM
14202008-08-06 Alan Modra <amodra@bigpond.net.au>
1421
1422 * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend.
1423 (ppc_elf_relocate_section <R_PPC_RELAX32_PLT>): Don't bother here.
1424
46f2f11d
AM
14252008-08-05 Alan Modra <amodra@bigpond.net.au>
1426 Jaka Močnik <jaka@xlab.si>
1427
1428 * coffcode.h (coff_slurp_line_table): bfd_alloc lineno_cache first
1429 so that we don't inadvertently free it. Use bfd_alloc for sort
1430 arrays, and memcpy sorted line table.
1431
e5e6a5ff
AM
14322008-08-04 Alan Modra <amodra@bigpond.net.au>
1433
1434 * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
1435 if --fixed-space request is too large.
1436
323ee3f4
AM
14372008-08-04 Alan Modra <amodra@bigpond.net.au>
1438
1439 * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Set LC_ALL=C.
1440 * Makefile.in: Regenerate.
1441 * po/SRC-POTFILES.in: Regenerate.
1442
4f0d75be
AM
14432008-08-02 Alan Modra <amodra@bigpond.net.au>
1444
1445 * elf32-spu.c (mark_overlay_section): Move code calculating
1446 max_overlay_size to correct block.
1447 (spu_elf_auto_overlay): Don't use %x in einfo error message.
1448
11a7ae4f
AM
14492008-08-01 Alan Modra <amodra@bigpond.net.au>
1450 Jan Kratochvil <jan.kratochvil@redhat.com>
1451
1452 * elfcore.h (elf_core_file_p): Ensure we have a backend match
1453 with the correct arch size before rejecting the generic fallback.
1454 * elfcode.h (elf_object_p): Likewise. Ensure arch size matches
1455 before accepting a target.
1456
010c8431
AM
14572008-08-01 Alan Modra <amodra@bigpond.net.au>
1458
d3ae097c 1459 PR 6774
010c8431
AM
1460 * elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
1461 include file or program headers.
1462
0af1713e
AM
14632008-07-30 Alan Modra <amodra@bigpond.net.au>
1464
1465 * coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c,
1466 elf32-iq2000.c, elf32-m32c.c, elf32-mep.c, elf32-mt.c,
1467 elf32-sh-symbian.c, elf64-hppa.c, mach-o.c, peXXigen.c, pef.c,
1468 ppcboot.c, vms-misc.c, xsym.c: Silence gcc warnings.
1469
9a59ad6b
DJ
14702008-07-28 Daniel Jacobowitz <dan@codesourcery.com>
1471
1472 * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating
1473 relocations for undefined weak symbols with non-default visibility.
1474 (_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for
1475 global symbols in shared libraries.
1476 (allocate_dynrelocs): New function.
1477 (_bfd_mips_elf_adjust_dynamic_symbol): Do not handle
1478 possibly_dynamic_relocs here.
1479 (_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs.
1480
9f03412a
AO
14812008-07-28 Alexandre Oliva <aoliva@redhat.com>
1482
1483 * elf32-i386.c (struct elf_i386_link_hash_table): Added field
1484 tls_module_base.
1485 (elf_i386_link_hash_table_create): Initialize it.
1486 (elf_i386_always_size_sections): Set it.
1487 (set_tls_module_base): New.
1488 (elf_i386_relocate_sections): Call it.
1489 * elf64-x86-64.c (struct elf64_x86_64_link_hash_table): Added
1490 field tls_module_base.
1491 (elf64_x86_64_link_hash_table_create): Initialize it.
1492 (elf64_x86_64_always_size_sections): Set it.
1493 (set_tls_module_base): New.
1494 (elf64_x86_64_relocate_sections): Call it.
1495 Reported by Cary Coutant <ccoutant@google.com>
1496
9a008db3
AM
14972008-07-28 Ineiev <ineiev@yahoo.co.uk>
1498
1499 * elf32-arm.c (arm_map_one_stub): Declare variables at beginning
1500 of block.
1501 * elf32-avr.c (get_local_syms): Likewise.
1502
14a91970
AM
15032008-07-28 Alan Modra <amodra@bigpond.net.au>
1504
1505 PR 6769
1506 * bfd-in.h (BFD_VMA_FMT): Define.
1507 (printf_vma, sprintf_vma): Use the above.
1508 (_bfd_int64_low, _bfd_int64_high): Delete.
1509 * bfd-in2.h: Regenerate.
1510
baea7ef1
AM
15112008-07-27 Alan Modra <amodra@bigpond.net.au>
1512
1513 * elf.c (_bfd_elf_make_section_from_shdr): Ignore return from
1514 elf_parse_notes. Use bfd_malloc_and_get_section.
1515 (elf_parse_notes): Validate note namesz and descsz.
1516
3c7b9897
AM
15172008-07-26 Michael Eager <eager@eagercon.com>
1518
1519 * elf32-ppc.c (ppc_elf_merge_obj_attributes): Check compatibility
1520 between single-float, double-float, and soft-float.
1521
20163277
DJ
15222008-07-24 Daniel Jacobowitz <dan@codesourcery.com>
1523
1524 * elf32-mips.c (elf_backend_write_section): Define.
1525
4ff73856
NC
15262008-07-24 Nick Clifton <nickc@redhat.com>
1527
1528 * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one
1529 error assigning sections to segments.
1530
39948a60
NC
15312008-07-22 Nick Clifton <nickc@redhat.com>
1532
1533 * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in
1534 adjoining pages to be included in the same segment.
1535
bda987c2
CD
15362008-07-22 Simon Baldwin <simonb@google.com>
1537
1538 * elflink.c (elf_link_output_extsym): Set st_size to zero for
1539 symbols from dynamic libraries.
1540
88ba32a0
L
15412008-07-21 H.J. Lu <hongjiu.lu@intel.com>
1542
1543 PR ld/4424
1544 * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible
1545 to check if 2 inputs are compatible.
1546
37c43c55
NC
15472008-07-21 Sterling Augustine <sterling@tensilica.com>
1548
1549 * elf.c (assign_file_positions_for_load_sections): Print vma in
1550 error message about overlapping section vmas.
1551
50403a1f
L
15522008-07-21 H.J. Lu <hongjiu.lu@intel.com>
1553
1554 PR ld/6747
1555 * elf32-frv.c (elf32_frv_relocate_section): Revert the change
1556 for PR ld/6446 checked in by accident on May 21, 2008.
1557
799c00e0
NC
15582008-07-21 Nick Clifton <nickc@redhat.com>
1559
1560 * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non
1561 COFF_WITH_PE based SH ports.
1562 * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype.
1563 * arm-wince-pe.c (bfd_pe_print_pdata): Use
1564 _bfd_pe_print_ce_compressed_pdata.
1565 (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move
1566 to...
1567 * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to
1568 _bfd_XX_print_ce_compressed_pdata.
1569
f60e73e9
AM
15702008-07-21 Alan Modra <amodra@bigpond.net.au>
1571
1572 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
1573 unwanted zero terminators.
1574
dc1859a6
AM
15752008-07-21 Alan Modra <amodra@bigpond.net.au>
1576
1577 * elf32-spu.c (spu_elf_relocate_section): Expand
1578 RELOC_FOR_GLOBAL_SYMBOL. Don't warn about undefined symbols for
1579 R_SPU_PPU32 and R_SPU_PPU64 relocations.
1580
89eeb0bc
LM
15812008-07-21 Luis Machado <luisgpm@br.ibm.com>
1582
1583 * elf-bfd.h: Declare elfcore_write_ppc_vsx.
1584 * elf.c (elfcore_grok_ppc_vsx): New function.
1585 (elfcore_write_ppc_vsx): New function
1586 (elfcore_grok_note): Handle VSX notes.
1587 (elfcore_write_register_note): Handle VSX notes.
1588
a9dc9481
JM
15892008-07-18 Joseph Myers <joseph@codesourcery.com>
1590
1591 * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
1592 * bfd-in2.h: Regenerate.
1593 * elf32-arm.c (struct elf_arm_obj_tdata): Add field
1594 no_wchar_size_warning.
1595 (bfd_elf32_arm_set_target_relocs): Add new parameter
1596 no_wchar_warn.
1597 (elf32_arm_merge_eabi_attributes): Give a warning, not an error,
1598 for conflicting wchar_t attributes. Do not warn if
1599 --no-wchar-size-warning. Make diagnostic text more specific.
1600
6cee0a6f
L
16012008-07-18 H.J. Lu <hongjiu.lu@intel.com>
1602
1603 PR ld/6748
1604 * elf32-arm.c (elf32_arm_link_hash_table_create): Initialize
1605 new fields added for ARM long call support.
1606
2b5c217d
NC
16072008-07-18 Danny Backx <dannybackx@users.sourceforge.net>
1608
1609 * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
1610 print compressed pdata structure as described on MSDN. This only
1611 applies to a limited set of architectures (ARM, SH4).
1612 (slurp_symtab, my_symbol_for_address): Define static helper
1613 functions for pe_print_compressed_pdata.
1614 * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
1615 (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
1616 * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
1617 bfd_coff_backend_data, call the function if non-null.
1618 * pei-mcore.c: Add target dependent initialisation for
1619 bfd_coff_backend_data.
1620 * coff-sh.c: Likewise.
1621 * coff64-rs6000.c: Likewise.
1622 * coff-rs6000.c: Likewise.
1623 * libcoff-in.h: Likewise.
1624 * cf-i386lynx.c: Likewise.
1625 * coff-alpha.c: Likewise.
1626 * coff-apollo.c: Likewise.
1627 * coff-arm.c: Likewise.
1628 * coff-aux.c: Likewise.
1629 * coff-h8300.c: Likewise.
1630 * coff-h8500.c: Likewise.
1631 * coff-i386.c: Likewise.
1632 * coff-i860.c: Likewise.
1633 * coff-i960.c: Likewise.
1634 * coff-ia64.c: Likewise.
1635 * coff-m68k.c: Likewise.
1636 * coff-m88k.c: Likewise.
1637 * coff-maxq.c: Likewise.
1638 * coff-mips.c: Likewise.
1639 * coff-or32.c: Likewise.
1640 * coff-sparc.c: Likewise.
1641 * coff-tic30.c: Likewise.
1642 * coff-tic4x.c: Likewise.
1643 * coff-tic54x.c: Likewise.
1644 * coff-tic80.c: Likewise.
1645 * coff-w65.c: Likewise.
1646 * coff-we32k.c: Likewise.
1647 * coff-x86_64.c: Likewise.
1648 * coff-z80.c: Likewise.
1649 * coff-z8k.c: Likewise.
1650 * pe-mcore.c: Likewise.
1651 * pe-mips.c: Likewise.
1652 * pe-ppc.c: Likewise.
1653 * peXXigen.c: Likewise.
dc1859a6 1654 * pei-ppc.c: Likewise.
2b5c217d
NC
1655 * libcoff.h: Regenerate.
1656
c96a8570
BS
16572008-07-16 Bernd Schmidt <bernd.schmidt@analog.com>
1658
1659 * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
1660 bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook,
1661 ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE,
1662 struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code
1663 separate from non-FD-PIC.
1664
605d18d4
DD
16652008-07-14 DJ Delorie <dj@redhat.com>
1666
1667 * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow
1668 checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16
1669 relocs.
1670 (mn10300_elf_relax_section): Correct jump offset check when target
1671 is in a different section.
1672
b0a0b978
JZ
16732008-07-15 Jie Zhang <jie.zhang@analog.com>
1674
1675 * elf32-bfin.c (elf32_bfin_special_sections[]): New.
1676 (elf_backend_special_sections): Define.
1677
aaf30c25
CS
16782008-07-13 Craig Silverstein <csilvers@google.com>
1679
08b78292 1680 PR binutils/6743
aaf30c25
CS
1681 * dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory.
1682 (find_line): Use info_ptr_memory instead of sec_info_ptr.
1683 (_bfd_dwarf2_cleanup_debug_info): Likewise.
1684
1bac266e
JZ
16852008-07-12 Jie Zhang <jie.zhang@analog.com>
1686
1687 Revert
1688 2008-07-12 Jie Zhang <jie.zhang@analog.com>
1689 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
1690 executable sections into the same segment with other
1691 read only sections if --sep-code.
1692 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
1693 (elf32_bfin_data_in_l1): New variable.
1694 (elf32_bfin_final_write_processing): New.
1695 (elf32_bfin_special_sections[]): New.
1696 (elf_backend_final_write_processing): Define.
1697 (elf_backend_special_sections): Define.
1698
8c684578
JZ
16992008-07-12 Jie Zhang <jie.zhang@analog.com>
1700
1701 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
1702 executable sections into the same segment with other
1703 read only sections if --sep-code.
1704 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
1705 (elf32_bfin_data_in_l1): New variable.
1706 (elf32_bfin_final_write_processing): New.
1707 (elf32_bfin_special_sections[]): New.
1708 (elf_backend_final_write_processing): Define.
1709 (elf_backend_special_sections): Define.
1710
3076cd1f
AS
17112008-07-11 Andreas Schwab <schwab@suse.de>
1712
1713 * dwarf2.c (read_section): Take pointer to bfd_size_type instead
1714 of unsigned long as last parameter.
1715 (struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size,
1716 dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of
1717 unsigned long.
1718
0a61c8c2
RS
17192008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
1720
1721 * elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0
1722 for all relocation types. Allow any type of relocation to refer to
1723 __gnu_local_gp.
1724
30c09090
RS
17252008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
1726
1727 * elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16.
1728 (mips_elf_calculate_relocation): Likewise.
1729 (_bfd_mips_elf_add_symbol_hook): Likewise.
1730 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1731 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1732
355d10dc
AS
17332008-07-10 Andreas Schwab <schwab@suse.de>
1734
1735 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Add missing
1736 paren.
1737
1b315056
CS
17382008-07-09 Craig Silverstein <csilvers@google.com>
1739
1740 * Makefile.am (BFD32_LIBS): Add compress.lo.
1741 (BFD32_LIBS_CFILES): Add compress.c.
1742 (BFD_H_FILES): Likewise.
1743 * Makefile.in: Regenerate.
1744 * bfd-in2.h: Regenerate.
1745 * config.in: Add HAVE_ZLIB_H
1746 * configure.in: Add test for libz and zlib.h
1747 * configure: Regenerate.
1748 * dwarf2.c (read_section): New function.
1749 (read_indirect_string): Call new function read_section.
1750 (read_abbrevs): Likewise.
1751 (decode_line_info): Likewise.
1752 (read_debug_ranges): Likewise.
1753 (find_line): Call new function read_section when just one
1754 .zdebug_info section is found, otherwise read and compress
1755 multiple sections.
1756 (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
1757 * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
1758 (special_sections_z): New struct.
1759 (special_sections): Refer to special_sections_z.
1760 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
1761 sections named .zdebug_*.
1762 (_bfd_mips_elf_fake_sections): Likewise.
1763 * compress.c: New file.
1764 (bfd_uncompress_section_contents): New function.
dc1859a6 1765
329dcd78
NC
17662008-07-07 Christophe Lyon <christophe.lyon@st.com>
1767
1768 * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in
1769 the presence of a PLT.
1770
c29aae59
AM
17712008-07-07 Alan Modra <amodra@bigpond.net.au>
1772
1773 * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
1774
7382d32a
AM
17752008-07-02 Alan Modra <amodra@bigpond.net.au>
1776
1777 * elf32-ppc.c (is_pic_glink_stub): New function.
1778 (ppc_elf_get_synthetic_symtab): Don't generate symbols when
1779 multiple shared/pie stubs per plt entry.
1780
cb53bf42
RS
17812008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
1782
1783 * elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
1784 bed->s->int_rels_per_ext_rel.
1785
6ba2a415
RS
17862008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
1787
1788 * syms.c (BSF_SYNTHETIC): New flag.
1789 * elf.c (_bfd_elf_get_synthetic_symtab): Set it.
1790 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
1791 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
1792 * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
1793 for synthetic symbols.
1794 * bfd-in2.h: Regenerate.
1795
3dccd7b7
DJ
17962008-06-30 Daniel Jacobowitz <dan@codesourcery.com>
1797
1798 * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
1799 Expand comments.
1800 (arm_map_one_stub): Use | 1 when setting the low bit.
1801
f57718b4
AS
18022008-06-29 Andreas Schwab <schwab@suse.de>
1803
1804 * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
1805 addend on _GLOBAL_OFFSET_TABLE_.
1806
7413f23f
DJ
18072008-06-24 Daniel Jacobowitz <dan@codesourcery.com>
1808
1809 * elf32-arm.c (STUB_ENTRY_NAME): Define.
1810 (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
1811 (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
1812 R_ARM_ABS32.
1813 (struct elf32_arm_stub_hash_entry): Add output_name.
1814 (arm_build_one_stub): Move offsets into the offset argument
1815 of _bfd_final_link_relocate. Correct offset for
1816 arm_thumb_arm_v4t_stub_long_branch.
1817 (elf32_arm_size_stubs): Set stub_entry->output_name.
1818 (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
1819 Update all callers.
1820 (elf32_arm_output_stub_sym): New.
1821 (arm_map_one_stub): Correct formatting. Use elf32_arm_output_stub_sym.
1822
7c39fb20
AM
18232008-06-20 Alan Modra <amodra@bigpond.net.au>
1824
1825 * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
1826 non-branch insns.
1827
f3c29e8a
AM
18282008-06-20 Alan Modra <amodra@bigpond.net.au>
1829
1830 * elf32-spu.c (build_stub): Allow wraparound on stub branches.
1831 (allocate_spuear_stubs, build_spuear_stubs): Return value from
1832 count_stub/build_stub.
1833 (spu_elf_build_stubs): Correct location of stub reloc error message.
1834
de73c611
SR
18352008-06-18 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
1836
dc1859a6 1837 * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
de73c611 1838
7a283e07
RW
18392008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1840
1841 * configure: Regenerate.
1842
99302af9
AM
18432008-06-17 Alan Modra <amodra@bigpond.net.au>
1844
1845 * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
1846 (spu_elf_check_vma): Add extra_stack_space param, copy to htab.
1847 (spu_elf_auto_overlay): Use it.
1848 (RECURSE_UNMARK): Define as 0.
1849 (unmark_overlay_section): Heed RECURSE_UNMARK.
1850 * elf32-spu.h (spu_elf_check_vma): Update prototype.
1851
ff7eeb89
DD
18522008-06-12 DJ Delorie <dj@redhat.com>
1853
1854 * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.
1855
c13bb2ea
PB
18562008-06-09 Paul Brook <paul@codesourcery.com>
1857
1858 bfd/
1859 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
1860 libraries.
1861
f4ac8484
DJ
18622008-06-09 Christophe Lyon <christophe.lyon@st.com>
1863
1864 * elf32-arm.c (arm_stub_is_thumb): Define.
1865 (elf32_arm_final_link_relocate): Handle near mode switching stubs.
1866
6a267715
AM
18672008-06-07 Alan Modra <amodra@bigpond.net.au>
1868
1869 * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
1870 to stack calculation.
1871
23684067
PB
18722008-06-06 Paul Brook <paul@codesourcery.com>
1873
1874 bfd/
1875 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
1876
97407faf
AM
18772008-06-06 Alan Modra <amodra@bigpond.net.au>
1878
1879 * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
1880 file names be unique. Specify archive:path in overlay script.
1881
7cfbafbc
AM
18822008-06-05 Alan Modra <amodra@bigpond.net.au>
1883
1884 PR ld/6590
1885 * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
1886
0f0a5e58
AM
18872008-06-04 Alan Modra <amodra@bigpond.net.au>
1888
1889 * elf.c (ignore_section_sym): Don't test section sym value here.
1890 (elf_map_symbols): Instead check zero value here as was done prior
1891 to 2006-05-26 change.
1892
696b7ad2
NC
18932008-06-04 Nick Clifton <nickc@redhat.com>
1894
1895 PR ld/6019
1896 * elf32-avr.c (elf32_avr_relax_section): Handle the case where
1897 there are no local symbols.
1898
1f27ab8d
AM
18992008-06-04 Alan Modra <amodra@bigpond.net.au>
1900
1901 * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
1902 (process_stubs): Likewise.
1903 (discover_functions): Don't used cached symbols.
1904 (maybe_insert_function): Correct condition under which function
1905 array is realloc'd.
1906 (mark_functions_via_relocs): Delete unused variable.
1907
adfef0bd
NC
19082008-05-30 Frediano Ziglio <frediano.ziglio@vodafone.com>
1909 Nick Clifton <nickc@redhat.com>
1910
1911 PR ld/6511
1912 * elf64-hppa.c (allocate_global_data_opd): Default to using the
1913 dynamic symbol table for local function names in shared libraries.
1914
11701589
JK
19152008-05-29 Jan Kratochvil <jan.kratochvil@redhat.com>
1916
1917 * elf.c (assign_file_positions_for_load_sections): Adjust pre-section
1918 gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
1919
124b52c6
AM
19202008-05-28 Alan Modra <amodra@bigpond.net.au>
1921
1922 * elf32-spu.c (spu_elf_object_p): New function.
1923 (elf_backend_object_p): Define.
1924 (build_stub): Correct second word of 8 byte overlay stubs.
1925 (spu_elf_relocate_section): Formatting.
1926
bb864ac1
CES
19272008-05-24 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
1928
1929 * elf.c (elfcore_write_register_note): New function.
1930 * elf-bfd.h (elfcore_write_register_note): New prototype.
1931
da5938a2
NC
19322008-05-22 Christophe Lyon <christophe.lyon@st.com>
1933
1934 * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
1935 (elf32_arm_stub_add_mapping_symbol): Remove.
1936 (elf32_arm_add_stub): Don't generate mapping symbols. Change
1937 prototype.
1938 (elf32_arm_size_stubs): Use new elf32_arm_add_stub
1939 prototype. Don't generate thumb to arm glue for calls.
1940 (arm_map_one_stub): Define.
1941 (elf32_arm_output_arch_local_syms): Generate mapping symbols for
1942 long calls stubs.
dc1859a6 1943
c2f950c8
L
19442008-05-21 Nick Clifton <nickc@redhat.com>
1945
1946 * elf32-arm.c (group_sections): Reformat comments.
1947
1948 PR ld/6446
1949 * elf32-frv.c (elf32_frv_relocate_section): Set EF_FRV_PIC by
1950 default (for FDPIC). Clear it if any inter-segment relocations
1951 are found.
1952
1953 * elf64-hppa.c (elf64_hppa_finalize_opd): Check NULL return
1954 from elf_link_hash_lookup.
1955
7fb9f789 19562008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
dc1859a6 1957
7fb9f789
NC
1958 Add multi-GOT support for m68k.
1959 * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
1960 glist): New fields.
1961 (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
1962 struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
1963 struct elf_m68k_multi_got): New data structures.
1964 (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
1965 allow_multigot_p, multi_got_): New fields.
1966 (elf_m68k_multi_got): New macro.
1967 (elf_m68k_link_hash_newfunc): Initialize new fields of
1968 struct elf_m68k_link_hash_entry.
1969 (elf_m68k_link_hash_table_create): Initialize new fields of
1970 struct elf_m68k_link_hash_table.
1971 (elf_m68k_link_hash_table_free): New static function implementing hook.
1972 (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
dc1859a6 1973 static functions for struct elf_m68k_got.
7fb9f789
NC
1974 (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
1975 elf_m68k_got_entry_eq): New static functions for
1976 struct elf_m68k_got_entry.
1977 (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
1978 ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
1979 (enum elf_m68k_get_entry_howto): New enum.
1980 (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
1981 elf_m68k_remove_got_entry_type): New static functions for
1982 struct elf_m68k_got_entry.
1983 (elf_m68k_add_entry_to_got): New static function.
1984 (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
1985 elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
1986 functions for struct elf_m68k_bfd2got_entry.
1987 (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
1988 elf_m68k_can_merge_gots): New traversal.
1989 (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
1990 elf_m68k_merge_gots): Ditto.
1991 (struct elf_m68k_finalize_got_offsets_arg,
1992 elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
1993 (struct elf_m68k_partition_multi_got_arg,
1994 elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
1995 elf_m68k_partition_multi_got): Ditto.
1996 (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
1997 functions.
1998 (elf_m68k_copy_indirect_symbol): New static function implementing
1999 a hook.
2000 (elf_m68k_check_relocs): Update to add entries to multi-GOT.
2001 (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
2002 (elf_m68k_always_size_sections): Assign BFDs to GOTs.
2003 (elf_m68k_relocate_section): Update to properly handle GOT relocations.
2004 (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
2005 of a global symbol.
2006 (bfd_elf_m68k_set_target_options): New function.
2007 (bfd_elf32_bfd_link_hash_table_free): Define hook.
2008 (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
2009 to skip generic calculation of GOT offsets.
2010 (elf_backend_copy_indirect_symbol): Define hook.
2011 * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
2012 * bfd-in2.h: Regenerate.
2013
46f2f11d 20142008-05-21 André Johansen <andrejoh@gmail.com>
90b5b1a5
NC
2015
2016 PR 868
2017 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
2018 for filenames in function tables and variable tables.
2019
6ffd7900
AM
20202008-05-19 Alan Modra <amodra@bigpond.net.au>
2021
2022 PR 2995, PR 6473
2023 * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
2024 vma when all p_paddr fields are zero and there is more than
2025 one PT_LOAD header.
2026
906e58ca
NC
20272008-05-15 Christophe Lyon <christophe.lyon@st.com>
2028
2029 Add long call support for ARM.
2030 * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
2031 (THM2_MAX_BWD_BRANCH_OFFSET): Define.
2032 (ARM_MAX_FWD_BRANCH_OFFSET): Define.
2033 (ARM_MAX_BWD_BRANCH_OFFSET): Define.
2034 (THM_MAX_FWD_BRANCH_OFFSET): Define.
2035 (THM_MAX_BWD_BRANCH_OFFSET): Define.
2036 (arm_long_branch_stub): Define.
2037 (arm_pic_long_branch_stub): Define.
2038 (arm_thumb_v4t_long_branch_stub): Define.
2039 (arm_thumb_thumb_long_branch_stub): Define.
2040 (arm_thumb_arm_v4t_long_branch_stub): Define.
2041 (STUB_SUFFIX): Define.
2042 (elf32_arm_stub_type): Define.
2043 (elf32_arm_stub_hash_entry): Define.
2044 (elf32_arm_link_hash_entry): Add stub_cache field.
2045 (arm_stub_hash_lookup): Define.
2046 (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
2047 add_stub_section, layout_sections_again, stub_group, bfd_count,
2048 top_index, input_list fields.
2049 (elf32_arm_link_hash_newfunc): Init new field.
2050 (stub_hash_newfunc): New function.
2051 (elf32_arm_link_hash_table_create): Init stub_hash_table.
2052 (elf32_arm_hash_table_free): New function.
2053 (arm_type_of_stub): New function.
2054 (elf32_arm_stub_name): New function.
2055 (elf32_arm_get_stub_entry): New function.
2056 (elf32_arm_stub_add_mapping_symbol): New function.
2057 (elf32_arm_add_stub): New function.
2058 (arm_build_one_stub): New function.
2059 (arm_size_one_stub): New function.
2060 (elf32_arm_setup_section_lists): New function.
2061 (elf32_arm_next_input_section): New function.
2062 (group_sections): New function.
2063 (elf32_arm_size_stubs): New function.
2064 (elf32_arm_build_stubs): New function.
2065 (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
2066 (bfd_elf32_arm_process_before_allocation): No longer handle
2067 R_ARM_CALL and R_ARM_THM_CALL.
2068 (using_thumb_only): New function.
2069 (elf32_arm_final_link_relocate): Redirect calls to stub if range
2070 exceeds encoding capabilities.
2071 (bfd_elf32_bfd_link_hash_table_free): Define.
2072 * bfd-in.h (R_ARM_max): Fix value to 130.
2073 (elf32_arm_setup_section_lists): Protype.
2074 (elf32_arm_next_input_section): Protype.
2075 (elf32_arm_size_stubs): Protype.
2076 (elf32_arm_build_stubs): Protype.
2077 * bfd-in2.h: Regenerate.
2078
86a4952b
UW
20792008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
2080
2081 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
2082 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
2083
8944f3c2
AM
20842008-05-14 Alan Modra <amodra@bigpond.net.au>
2085
2086 * Makefile.am: Run "make dep-am".
2087 * Makefile.in: Regenerate.
2088
468392fb
AM
20892008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
2090 Alan Modra <amodra@bigpond.net.au>
2091
2092 * elf32-ppc.c (section_covers_vma): New function.
2093 (ppc_elf_get_synthetic_symtab): New function.
2094 (bfd_elf32_get_synthetic_symtab): Define.
2095 * elf64-ppc.c (section_covers_vma): New function.
2096 (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
2097 table entries, and __glink_PLTresolve on resolver stub.
2098 (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
2099
1d483afe
AM
21002008-05-12 Alan Modra <amodra@bigpond.net.au>
2101
2102 PR 6443
2103 * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
2104 (must_be_dyn_reloc): New function.
2105 (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
2106 in pies.
2107 (ppc_elf_tls_optimize): Optimise pies.
2108 (ppc_elf_relocate_section): Use a section symbol rather than no
2109 symbol if possible for LD->IE TLS sequence, but don't error if
2110 we must use no symbol.
2111 * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
2112 (must_be_dyn_reloc): Likewise.
2113 (ppc64_elf_check_relocs): Likewise.
2114 (ppc64_elf_tls_optimize): Likewise.
2115 (ppc64_elf_relocate_section): Likewise.
2116
cc5ca406
AM
21172008-05-12 Alan Modra <amodra@bigpond.net.au>
2118
2119 * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.
2120
536d0ff4
AM
21212008-05-10 Paul Pluzhnikov <ppluzhnikov@google.com>
2122
2123 * elfcore.h (elf_core_file_p): Warn about core truncation.
2124
51c8ebc1
BW
21252008-05-07 Bob Wilson <bob.wilson@acm.org>
2126
2127 * elf32-xtensa.c (xtensa_property_section_name): New.
2128 (xtensa_make_property_section): New.
2129 (xtensa_get_property_section): Make static. Do not create a new
2130 section if it does not exist.
2131
8374f9d4
AM
21322008-05-08 Alan Modra <amodra@bigpond.net.au>
2133
2134 * elf32-spu.c (spu_elf_special_sections): Add "._ea".
2135 (spu_elf_relocate_section): Handle relocations against symbols
2136 defined in ._ea specially.
2137
95720a86
DJ
21382008-05-03 Daniel Jacobowitz <dan@codesourcery.com>
2139
2140 * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
2141 ARRAY_SIZE.
2142 (elf32_arm_symbian_plt_sym_val): New.
2143 (elf_backend_plt_sym_val): Define.
2144
5c44b38e
AM
21452008-05-03 Alan Modra <amodra@bigpond.net.au>
2146
2147 PR 2995, PR 6473
2148 * elf.c (rewrite_elf_program_header): Rather than clearing
2149 p_paddr_valid at end, don't set it in the first place. Delete
2150 comment no longer relevant. When not p_paddr_valid, don't set
2151 paddr from vaddr, and don't set p_vaddr_offset.
2152
3471d59d
CC
21532008-05-01 Cary Coutant <ccoutant@google.com>
2154
2155 * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
2156 corrupt string table.
2157
f12a02c0
JB
21582008-05-01 Joel Brobecker <brobecker@adacore.com>
2159
2160 * cache.c (cache_bread_1): Renames cache_bread.
2161 (cache_bread): New function.
2162
88967714
AM
21632008-05-01 Alan Modra <amodra@bigpond.net.au>
2164
2165 PR 2995, PR 6473
2166 * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
2167 (assign_file_positions_for_load_sections): Combine nested "if".
2168 (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
2169 when all header p_paddr fields are zero.
2170
9239aded
AM
21712008-04-30 Edmar Wienskoski <edmar@freescale.com>
2172
2173 * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry.
2174
266b05cf
DJ
21752008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
2176
2177 * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
2178 (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
2179 even if they are not loaded.
2180 * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
2181 first.
2182
fc2db3b8
NC
21832008-04-25 Jay Foad <jay.foad@gmail.com>
2184
2185 * reloc16.c (bfd_coff_reloc16_get_value): Add support for
2186 undefined weak symbols.
2187
ddeca468
NC
21882008-04-25 Nick Clifton <nickc@redhat.com>
2189
2190 * po/vi.po: Updated Vietnamese translation.
2191
6194aaab
L
21922008-04-23 Paolo Bonzini <bonzini@gnu.org>
2193
2194 * aclocal.m4: Regenerate.
2195 * configure: Regenerate.
2196
38d6ea5b
CC
21972008-04-21 Cary Coutant <ccoutant@google.com>
2198
2199 * archive.c (_bfd_write_archive_contents): Fix incorrect use of
2200 ARFMAG.
2201
131eb6b7
NS
22022008-04-21 Nathan Sidwell <nathan@codesourcery.com>
2203
2204 * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
2205 set the value of undefined symbols in shared objects.
2206 (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
2207 undefined symbols unless pointer equality is needed.
2208
e0c88096
NC
22092008-04-18 Dennis Roberts <dennis.roberts@sunquestinfo.com>
2210
2211 * aix5ppc-core.c: Define macros for the default architecture and
2212 machine for matching core files.
2213 (xcoff64_core_p): Set the architecture and machine to the default
2214 values defined in the macros mentioned above.
2215 * rs6000-core.c: Define macros to determine whether or not the
2216 core file header uses the core_dumpxx header format.
2217 (rs6000coff_core_p): Don't match core files that use the
2218 core_dumpxx header format.
2219
18c1668c
PA
22202008-04-16 Pedro Alves <pedro@codesourcery.com>
2221
2222 * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add.
2223
739f7f82
DM
22242008-04-16 David S. Miller <davem@davemloft.net>
2225
2226 * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
2227 BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
2228 BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
2229 * libbfd.h: Regnerate.
2230 * bfd-in2.h: Regenerate.
2231 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
2232 GOTDATA relocations.
2233 (sparc_reloc_map): Likewise.
2234 (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
2235 R_SPARC_GOT*.
2236 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2237 (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
2238 R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
2239 R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
2240 Simply ignore R_SPARC_GOTDATA_OP relocations.
2241
c5cb8442
TS
22422008-04-14 Aurelien Jarno <aurelien@aurel32.net>
2243
2244 * configure.in: Link with the PIC version of libiberty on
2245 Linux/MIPS hosts.
2246 * configure: Regenerate.
2247
19a6653c
AM
22482008-04-14 Edmar Wienskoski <edmar@freescale.com>
2249
2250 * archures.c: Add bfd_mach_ppc_e500mc.
2251 * bfd-in2.h: Regenerate.
2252
2ec9638b
AM
22532008-04-08 Alan Modra <amodra@bigpond.net.au>
2254
2255 * elf32-spu.c (spu_elf_build_stubs): Correct error message.
2256 (mark_functions_via_relocs): Remove premature init of symtab_hdr.
2257 (collect_overlays): Commment typo fix.
2258
a94b9d2d
AM
22592008-04-08 Kees Cook <kees@canonical.com>
2260
2261 * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
2262 in EXEC_P bfds.
2263
9dcc4794
AM
22642008-04-08 Alan Modra <amodra@bigpond.net.au>
2265
2266 * elf32-spu.c: Include libiberty.h.
2267 (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
2268 non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
2269 spu_elf_relink, auto_overlay fields.
2270 (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
2271 (needs_ovl_stub): Flip test so that call to non-function warning
2272 is emitted during relocate_section rather than earlier.
2273 (spu_elf_check_vma): Stash --auto-overlay parameters, and clear
2274 auto_overlay if no section exceeds local store.
2275 (struct call_info): Add count, max_depth, is_pasted fields.
2276 (struct function_info): Add rodata, last_caller, call_count,
2277 depth, new visit flags.
2278 (insert_callee): Increment call count.
2279 (copy_callee): New function.
2280 (mark_functions_via_relocs): Investigate all reloc types to count
2281 possible function pointer stubs for --auto-overlay. Track
2282 last_caller and increment function call_count.
2283 (pasted_function): Insert a "call" into call info for pasted section.
2284 (remove_cycles): Track max depth of calls. Don't emit call graph
2285 pruning warning for --auto-overlay.
2286 (build_call_tree): Don't transfer_calls for --auto-overlay.
2287 Adjust remove_cycles call.
2288 (sort_calls, sort_lib, sort_bfds): New functions.
2289 (struct _mos_param, struct _uos_param, struct _cl_param): New.
2290 (mark_overlay_section, unmark_overlay_section): New functions.
2291 (collect_lib_sectios, auto_ovl_lib_functions): New functions.
2292 (collect_overlays, find_pasted_call): New functions.
2293 (sum_stack): Deal with is_pasted "calls". Exit before printing
2294 when --auto-overlay.
2295 (spu_elf_auto_overlay): New function.
2296 (spu_elf_final_link): Call spu_elf_auto_overlay.
2297 * elf32-spu.h (spu_elf_check_vma): Update prototype.
2298
380814a6
AM
22992008-04-07 Alan Modra <amodra@bigpond.net.au>
2300
2301 * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
2302 is defined in overlay section before creating a stub.
2303 (build_spuear_stubs): Likewise.
2304 (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
2305
055ed83b
AM
23062008-04-02 Alan Modra <amodra@bigpond.net.au>
2307
2308 * elf32-spu.c (insert_callee): Reorder call list so most recent
2309 call is always first.
2310 (interesting_section): Move.
2311 (mark_functions_via_relocs): Fold interesting_section and
2312 reloc_count tests in callers to here. Simplify output section
2313 owner test.
2314 (discover_functions): Set "gaps" when no symbols and some
2315 "interesting_section". Run pasted_function loop for no symbol
2316 bfds.
2317 (for_each_node, transfer_calls): New functions.
2318 (mark_non_root): Adjust to suit for_each_node.
2319 (call_graph_traverse): Likewise. Fix memory leak. Rename to..
2320 (remove_cycles): ..this.
2321 (build_call_tree): Use for_each_node and transfer_calls.
2322 (struct _sum_stack_param): New.
2323 (sum_stack): Adjust to suit for_each_node. Return error on
2324 malloc failure. Move code to print root node cumulative stack from..
2325 (spu_elf_stack_analysis): ..here. Use for_each_node.
2326
89a58aeb
AM
23272008-03-31 Cary Coutant <ccoutant@google.com>
2328
2329 PR 6006
2330 * archive.c (_bfd_slurp_extended_name_table): Change
2331 ARFMAG[0] to ARFMAG[1].
2332 (_bfd_construct_extended_name_table): Likewise.
2333
3a3b6725
DJ
23342008-03-31 Daniel Jacobowitz <dan@codesourcery.com>
2335
2336 * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
2337 (_bfd_mips_elf_check_relocs): Update comments. Always call
2338 mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
2339
23402008-03-27 Cary Coutant <ccoutant@google.com>
a8da6403 2341
89a58aeb 2342 Add support for thin archives.
a8da6403
NC
2343 * archive.c (_bfd_find_nested_archive): New function.
2344 (get_extended_arelt_filename): Add origin parameter.
2345 (_bfd_generic_read_ar_hdr_mag): Deal with extended name
2346 combined with a file offset.
2347 (append_relative_path): New function.
2348 (_bfd_get_elt_at_filepos): Deal with external members and
2349 nested archives.
2350 (bfd_generic_openr_next_archived_file): Thin archives.
2351 (bfd_generic_archive_p): Recognize new magic string.
2352 (adjust_relative_path): New function.
2353 (_bfd_construct_extended_name_table): Construct extended
2354 names for thin archive members.
2355 (_bfd_write_archive_contents): Emit new magic string, skip
2356 copying files for thin archives.
2357 * bfd-in.h (bfd_is_thin_archive): New macro.
2358 * bfd.c (struct bfd): New fields for thin archives.
2359 * libbfd-in.h (struct areltdata): New field for thin archives.
2360 * opncls.c (bfd_close): Delete BFDs for nested archives.
2361
c35e54f4
BS
23622008-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
2363
2364 * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
2365 _bfd_final_link_relocate that also handles R_pcrel24 relocs.
2366 (bfinfdpic_relocate_section, bfin_relocate_section): Use it.
2367
3348747a
NS
23682008-03-25 Nathan Sidwell <nathan@codesourcery.com>
2369
2370 * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
2371 in vxworks tls_vars sections.
2372 (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
2373 * elf32-i386.c (allocate_dynrelocs,
2374 elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
2375 * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
2376 ppc_elf_relocate_section): Likewise.
2377 * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
2378 sh_elf_relocate_section): Likewise.
2379 * elfxx-sparc.c (allocate_dynrelocs,
2380 _bfd_sparc_elf_size_dynamic_sections,
2381 _bfd_sparc_elf_relocate_section): Likewise.
2382
a1f3c56e
AN
23832008-03-21 Adam Nemet <anemet@caviumnetworks.com>
2384
2385 * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
2386 print the values from the dynamic section.
2387
51e38d68
RS
23882008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
2389
2390 * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
2391 (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
2392
c65be8d7
AM
23932008-03-20 Alan Modra <amodra@bigpond.net.au>
2394
2395 * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
2396 (spu_elf_find_overlays, spu_elf_size_stubs): Likewise
2397 (process_stubs, discover_functions, build_call_tree): Likewise.
2398 (spu_elf_stack_analysis): Likewise.
2399 (spu_elf_check_vma): Likewise. Move.
2400 (struct call_info): Make "is_tail" a bitfield.
2401 (insert_callee): Clear fun->start and set fun->is_func if we find
2402 a non-tail call.
2403 * elf32-spu.h (spu_elf_create_sections): Update prototype.
2404 (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
2405
58c85be7
RW
24062008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2407
2408 * aclocal.m4: Regenerate.
2409 * configure: Likewise.
2410 * Makefile.in: Likewise.
2411
41bed6dd
L
24122008-03-16 H.J. Lu <hongjiu.lu@intel.com>
2413
2414 PR ld/5789
2415 PR ld/5943
2416 * elf32-i386.c (elf_i386_relocate_section): Issue an error
2417 for R_386_GOTOFF relocaton against undefined hidden/internal
2418 symbols when building a shared object.
2419
2420 * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
2421 error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
2422 relocaton against undefined hidden/internal symbols when
2423 building a shared object.
2424 (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
2425 is referenced locally, but isn't defined in a regular file.
2426
6ad2759d
L
24272008-03-15 H.J. Lu <hongjiu.lu@intel.com>
2428
2429 * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO,
2430 HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED,
2431 BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY,
2432 HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ...
2433 * bfd.c: Here.
2434
2435 * bfd.c (bfd): Change cacheable, target_defaulted, opened_once,
2436 mtime_set, no_export, output_has_begun and has_armap to bit
2437 field.
2438
2439 * bfd-in2.h: Regenerated.
2440
c04ea773
DJ
24412008-03-14 Daniel Jacobowitz <dan@codesourcery.com>
2442
2443 * cache.c (close_one): Remove mtime hack.
2444
0f2830ff
L
24452008-03-14 H.J. Lu <hongjiu.lu@intel.com>
2446
2447 PR ld/5913
2448 * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT.
2449 (elfNN_ia64_dtprel_base): Likewise.
2450 (elfNN_ia64_relocate_section): Go to missing_tls_sec if
2451 tls_sec is NULL before calling elfNN_ia64_tprel_base or
2452 elfNN_ia64_dtprel_base. Report unsupported TLS relocations.
2453
fdba2fcd
AM
24542008-03-14 Alan Modra <amodra@bigpond.net.au>
2455
2456 * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move
2457 common code to..
2458 (maybe_needs_stub): ..here, a new function that also omits stubs
2459 for .eh_frame, and..
2460 (needs_ovl_stub): ..here. Create stubs for labels in code section
2461 referenced by switch jump table.
2462 (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return.
2463 (enum _insn_type): Delete.
2464 (enum _stub_type): New.
2465 (count_stub, build_stub): Adjust.
2466 (allocate_spuear_stubs, build_spuear_stubs): Adjust.
2467
72de5009
AM
24682008-03-13 Alan Modra <amodra@bigpond.net.au>
2469
2470 * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast.
2471 (_bfd_elf_assign_file_position_for_section): Simplify align.
2472 (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough
2473 for sh_addralign.
2474 (elf_fake_sections, swap_out_syms): Likewise.
2475 * elflink.c (bfd_elf_final_link): Likewise.
2476
50e7d84b
AM
24772008-03-13 Alan Modra <amodra@bigpond.net.au>
2478
2479 * Makefile.am: Run "make dep-am".
2480 * Makefile.in: Regenerate.
2481 * po/SRC-POTFILES.in: Regenerate.
2482
2774f1a6
BS
24832008-03-12 Bernd Schmidt <bernd.schmidt@analog.com>
2484
2485 From Jie Zhang <jie.zhang@analog.com>
2486 * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4,
2487 gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo,
2488 gotoff, call and sym not bitfields.
2489 (bfinfdpic_gc_sweep_hook): New function; update the relocation
2490 information for the relocations of the section being removed.
2491 (bfinfdpic_check_relocs): Accumulate the number of relocations
2492 which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4,
2493 fdgoffhilo, gotoff, call and sym fields.
2494 (elf_backend_gc_sweep_hook): Redefine for FD-PIC.
2495
4fbb74a6
AM
24962008-03-12 Alan Modra <amodra@bigpond.net.au>
2497
2498 PR 5900
2499 * elf-bfd.h: Include elf/internal.h after elf/external.h.
2500 * elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
2501 (elf_swap_symbol_out): Adjust SHN_XINDEX test.
2502 (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
2503 seen in external structs.
2504 (valid_section_index_p): Delete.
2505 (elf_object_p): Don't increment section numbers over reserved range.
2506 Simplify test for valid sh_link, sh_info and e_shstrndx fields.
2507 (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
2508 seen in external structs. Don't increment section numbers over
2509 reserved range.
2510 * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
2511 (bfd_section_from_shdr): Likewise.
2512 (group_signature): Range check before accessing elf_elfsections.
2513 (_bfd_elf_setup_sections): Likewise.
2514 (bfd_section_from_shdr): Likewise.
2515 (bfd_section_from_shdr): Don't increment section number over
2516 reserved sections.
2517 (assign_file_positions_for_non_load_sections): Likewise.
2518 (assign_file_positions_except_relocs): Likewise.
2519 (_bfd_elf_write_object_contents): Likewise.
2520 (assign_section_numbers): Likewise. Adjust for changed SHN_*.
2521 (prep_headers): Delete unused variable.
2522 * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
2523 for changed SHN_* values.
2524 (check_dynsym, elf_link_input_bfd): Likewise.
2525 (bfd_elf_final_link): Likewise. Don't skip over reserved section
2526 range.
2527 (elf_fixup_link_order): Check that sh_link field is valid.
2528 * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
2529 * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
2530 accesssing elf_elfsections.
2531 * elf32-avr.c (elf32_avr_size_stubs): Likewise.
2532 * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
2533 * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
2534 * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
2535 SHN_* defines. Test for SHN_BAD return from
2536 _bfd_elf_section_from_bfd_section
2537
cb33740c
AM
25382008-03-12 Alan Modra <amodra@bigpond.net.au>
2539
2540 * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
2541 * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int,
2542 SHN_BAD on error.
2543 (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from
2544 _bfd_elf_section_from_bfd_section, not -1.
2545 (swap_out_syms): Likewise.
2546 * elflink.c (elf_link_add_object_symbols): Likewise.
2547 (bfd_elf_get_bfd_needed_list): Likewise.
2548 (bfd_elf_match_symbols_in_sections): Likewise.
2549 (elf_link_add_object_symbols): Don't bother testing for symbols
2550 using normal sections before calling bfd_section_from_elf_index.
2551 (elf_link_input_bfd, bfd_elf_final_link): Likewise.
2552 (bfd_elf_reloc_symbol_deleted_p): Likewise.
2553 * elfcode.h (elf_slurp_symbol_table): Likewise.
2554 * elf32-spu.c (get_sym_h): Likewise.
2555 * elf32-xtensa.c (get_elf_r_symndx_section): Likewise.
2556 * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto.
2557 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
2558
5f5fb9ec
AM
25592008-03-11 Alan Modra <amodra@bigpond.net.au>
2560
2561 * elf32-spu.c (spu_elf_relocate_section): Test identical conditions
2562 to those in process_stubs for overlay symbols.
2563
b1cc4aeb
PB
25642008-03-09 Paul Brook <paul@codesourcery.com>
2565
2566 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
2567 Tag_VFP_arch values.
2568
12a0a0fd
PB
25692008-03-08 Paul Brook <paul@codesourcery.com>
2570
2571 * elf32-arm.c (insert_thumb_branch): Rewrite.
2572 (elf32_thumb_to_arm_stub): Use new insert_thumb_branch.
2573
39623e12
PB
25742008-03-07 Paul Brook <paul@codesourcery.com>
2575
2576 * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and
2577 MOVT relocations.
2578 (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign
2579 extension.
2580 (elf32_arm_relocate_section): Handle MOVW and MOVT
2581 relocations. Improve safety check for other weird relocations.
2582 (elf32_arm_check_relocs): Only set h->needs_plt for branch/call
2583 relocations.
2584
77cba8a3 25852008-03-03 Bob Wilson <bob.wilson@acm.org>
50e7d84b 2586
77cba8a3
BW
2587 * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
2588 only compute its value once.
50e7d84b 2589
4a628337
AM
25902008-03-03 Alan Modra <amodra@bigpond.net.au>
2591
2592 * elf32-spu.c (struct got_entry): Add "addend" field.
2593 (count_stub, build_stub): Use a new stub if relocation addend
2594 differs from existing stubs for this symbol.
2595 (process_stubs): Deal with addends.
2596 (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise.
2597
d95edcac
L
25982008-03-02 H.J. Lu <hongjiu.lu@intel.com>
2599
2600 PR ld/5789
2601 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true
2602 for hidden and local symbols.
2603
89200bf8
AM
26042008-03-03 Alan Modra <amodra@bigpond.net.au>
2605
2606 * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
2607 undefined symbols with internal or hidden visibility.
2608 (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL
2609 rather than SYMBOL_REFERENCES_LOCAL on branches. Don't
2610 return immediately on dynamic reloc error.
2611
176a0d42
AM
26122008-03-01 Alan Modra <amodra@bigpond.net.au>
2613
2614 * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
2615 if emitrelocations.
2616 (get_relocs): New function, split out from..
2617 (ppc_build_one_stub): ..here. Add relocs on plt_branch stubs if
2618 emitrelocations. Remove indx temp.
2619 (ppc_size_one_stub): Count new stub relocs.
2620 (ppc64_elf_size_stubs): Count new glink reloc.
2621 (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations.
2622 (ppc64_elf_finish_dynamic_sections): Output glink relocs.
2623 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic
2624 glink code.
2625
911f096e
AM
26262008-02-28 Alan Modra <amodra@bigpond.net.au>
2627
2628 * elf32-spu.c (mark_functions_via_relocs): Don't assume that
2629 the "->start" pointer reaches to function origin, so that we
2630 can handle functions split over more than two sections.
2631 (build_call_tree): Likewise.
2632 (pasted_function): Don't attempt to set fun->start back to the
2633 function origin, just go back one section.
2634
ad9563d6
CM
26352008-02-27 Catherine Moore <clm@codesourcery.com>
2636
2637 * elf.c ( _bfd_elf_print_private_bfd_data): Call
2638 elf_backend_get_target_dtag if defined.
2639 * elf32-mips.c (elf_backend_get_target_dtag): Define.
2640 * elf64-mips.c: Likewise.
2641 * elfn32-mips.c: Likewise.
2642 * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
2643 * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
2644 * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
2645 * elfxx-target.h (elf_backend_get_target_dtag): Add default.
911f096e 2646 (elf_backend_data): Add elf_backend_get_target_dtag.
ad9563d6 2647
625af618
AM
26482008-02-26 Alan Modra <amodra@bigpond.net.au>
2649
2650 * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed
2651 for R_PPC_REL32 syms. Don't set non_got_ref on branch reloc syms,
2652 and assume branch relocs are not dynamic when non-shared.
2653 (readonly_dynrelocs): New function, split out from..
2654 (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs.
2655 (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries,
2656 clear non_got_ref..
2657 (allocate_dynrelocs): ..and don't set u.def for undefined weak.
2658 Do allow dynamic relocs on undefined symbols.
2659 (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
2660 (ppc_elf_relocate_section): Mirror dynamic reloc changes in
2661 check_relocs.
2662 (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak
2663 plt symbols needing pointer_equality_needed.
2664
1cd81501
AM
26652008-02-23 Alan Modra <amodra@bigpond.net.au>
2666
2667 * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
2668
0eb4a168
AM
26692008-02-23 Alan Modra <amodra@bigpond.net.au>
2670
2671 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy
2672 pointer_equality_needed.
2673 (ppc_elf_check_relocs): Split out non-branch relocs from others
2674 that might emit dynamic relocs. Set pointer_equality_needed
2675 for their symbols. Don't set non_got_ref on branch reloc symbols.
2676 (ppc_elf_hash_symbol): New function.
2677 (elf_backend_hash_symbol): Define.
2678 (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed.
2679 Error if pointer_equality_needed on weak plt symbol.
2680
3ae181ee
L
26812008-02-22 H.J. Lu <hongjiu.lu@intel.com>
2682
2683 PR ld/5788
2684 * elflink.c (elf_create_symbuf): Correct buffer size and
2685 position.
2686
34b5e0b2
NC
26872008-02-22 Nick Clifton <nickc@redhat.com>
2688
2689 PR 868
3ae181ee 2690 * dwarf2.c: Revert previous patch. All of the allocate memory is
34b5e0b2 2691 on an obstack which will be freed at some other time.
0eb4a168 2692
515ef31d
NC
26932008-02-20 Nick Clifton <nickc@redhat.com>
2694
2695 PR 868
2696 * libbfd.c (bfd_realloc_or_free): New function. Performs like
2697 bfd_realloc, but if the (re)allocation fails, the pointer is
2698 freed.
2699 * libbfd-in.h: Prototype.
2700 * libbfd.h: Regenerate.
2701 * bfdio.c (bfd_bwrite): Use the new function.
2702 (bfd_seek): Likewise.
2703 * bfdwin.c:(bfd_get_file_window): Likewise.
2704 * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
2705 * elf32-ppc.c (ppc_elf_relax_section): Likewise.
2706 * elf32-xtensa.c (vsprintf_msg): Likewise.
2707 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2708 * stabs.c (_bfd_link_seciton_stabs): Likewise.
2709 * vms-misc.c (_bfd_vms_get_record): Likewise.
2710 * vms-tir.c (check_section): Likewise.
2711 * vms.c (vms_new_section_hook): Likewise.
2712 * elf32-arm.c (elf32_arm_section_map_add): Check that the
2713 allocation of sec_data->map succeeded before using it.
2714 * elflink.c (elf_link_output_sym): Do not overwrite finfo->
2715 symshndxbuf until it is known that the reallocation succeeded.
2716
b42bf1e0
NC
27172008-02-20 Diogo de Carvalho Kraemer <diogo@kraemer.eng.br>
2718 Nick Clifton <nickc@redhat.com>
2719
2720 PR 868
2721 * dwarf2.c (read_abbrevs): Free the abbreviation table if we run
2722 out of memory.
2723 (decode_line_info): Free the line_info_table before returning a
2724 failure result.
2725 (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
2726 Free the line table. Free the function table. Free the variable
2727 table.
2728
0a40daed
MK
27292008-02-17 Mark Kettenis <kettenis@gnu.org>
2730
2731 * elf.c (swap_out_syms): Avoid preprocessing directive within
2732 macro arg.
2733
3f001e84
JK
27342008-02-17 Jan Kratochvil <jan.kratochvil@redhat.com>
2735
2736 * elf.c (assign_file_positions_for_load_sections): Set the type of
2737 PT_NOTE sections to SHT_NOTE.
2738
37da76e8
AM
27392008-02-17 Ulrich Weigand <uweigand@de.ibm.com>
2740
2741 * simple.c (bfd_simple_get_relocated_section_contents): Set
2742 link_info.output_bfd.
2743
d74e4b29
NS
27442008-02-16 Nathan Sidwell <nathan@codesourcery.com>
2745
2746 * dwarf2.c (find_line): Don't trust debug information after an
2747 unparseable compilation unit.
2748
f856272b
AM
27492008-02-15 Alan Modra <amodra@bigpond.net.au>
2750
2751 PR 5765
2752 * section.c (SEC_LINK_DUPLICATES): Correct. Renumber following flags.
2753 * bfd-in2.h: Regenerate.
2754
0c8d6e5c
AM
27552008-02-15 Alan Modra <amodra@bigpond.net.au>
2756
2757 * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA.
2758 * elf.c (bfd_elf_allocate_object): Don't check for already allocated
2759 tdata.
2760 * elf32-hppa.c (elf32_hppa_mkobject): New function.
2761 (bfd_elf32_mkobject): Define.
2762 * elf32-ppc.c (is_ppc_elf_target): Delete. Replace all uses with..
2763 (is_ppc_elf): ..this new macro.
2764 * elf64-ppc.c (is_ppc64_elf_target): Delete. Replace all uses with..
2765 (is_ppc64_elf): ..this new macro.
2766
f13a99db
AM
27672008-02-15 Alan Modra <amodra@bigpond.net.au>
2768
2769 * elflink.c: Replace all accesses to hash->creator field with
2770 output_bfd->xvec.
2771 * cofflink.c: Likewise.
2772 * coff-h8300.c: Likewise.
2773 * ecoff.c: Likewise.
2774 * elf32-m68hc1x.c: Likewise.
2775 * elf32-ppc.c: Likewise.
2776 * elf64-alpha.c: Likewise.
2777 * elf64-ppc.c: Likewise.
2778 * elf64-sparc.c: Likewise.
2779 * elfxx-mips.c: Likewise.
2780 * i386linux.c: Likewise.
2781 * m68klinux.c: Likewise.
2782 * sparclinux.c: Likewise.
2783 * sunos.c: Likewise.
2784 * xcofflink.c: Likewise.
2785 * linker.c: Likewise.
2786 (_bfd_link_hash_table_init): Don't store creator.
2787
e81819a5
NC
27882008-02-14 Peter Jones <pjones@redhat.com>
2789
2790 * efi-rtdrv-ia32.c: New file.
2791 * efi-bsdrv-ia32.c: New file.
2792 * efi-rtdrv-ia64.c: New file.
2793 * efi-bsdrv-ia64.c: New file.
2794 * efi-rtdrv-x86_64.c: New file.
2795 * efi-bsdrv-x86_64.c: New file.
2796 * peicode.h (pe_bfd_object_p): Add support for boot service and
2797 runtime service drivers.
2798 * libpei.h: Add macros for EFI formats, and rename the efi application
2799 format macros to disambiguate.
2800 * targets.c: Add bfd_target _vec externs.
2801 (_bfd_tar): Add EFI _vec entries.
2802 * config.bfd: Add EFI vectors into the selection routines.
2803 * configure.in: add EFI _vec entries.
2804 * configure: Regenerate.
2805 * Makefile.am: Add EFI files.
2806 * Makefile.in: Regenerate.
2807
ab1579fd
NS
28082008-02-14 Nathan Sidwell <nathan@codesourcery.com>
2809
2810 * dwarf1.c (struct dwarf1_debug): Add syms member.
2811 (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory.
2812 (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate
2813 section contents, check for out of memory.
2814
2815 * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte.
2816 (parse_die): Change data pointers to bfd_byte.
2817 (parse_line_table, parse_functions_in_unit): Likewise.
2818
d40f3da9
AM
28192008-02-14 Alan Modra <amodra@bigpond.net.au>
2820
2821 * elflink.c (compute_bucket_count): Warning fixes.
2822
f15557e4
DD
28232008-02-12 DJ Delorie <dj@redhat.com>
2824
2825 * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of
2826 relocation pointing to local symbol in merged section.
2827
2828 * elf32-iq2000.c (iq2000_elf_relocate_offset16): New.
2829 (iq2000_elf_relocate_section): Call it.
2830
0ffa91dd
NC
28312008-02-12 Nick Clifton <nickc@redhat.com>
2832
2833 PR ld/5692
2834 * elf-bfd.h (enum elf_object_id): New enum, used to identify
2835 target specific extensions to the elf_obj_tdata structure.
2836 (struct elf_obj_tdata): New field 'object_id'.
2837 (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
2838 macros for accessing fields in the elf_obj_tdata structure.
2839 (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
2840 (bfd_elf_allocate_object): New function.
2841 * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
2842 and implement by calling bfd_elf_allocate_object.
2843 (bfd_elf_allocate_object): New function: Allocates an
2844 elf_obj_tdata structure, possibly with a target specific
2845 extension.
2846 * elfxx-target.h (bfd_elfNN_mkobject): Use
2847 bfd_elf_make_generic_object as the default value.
2848 * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
2849 for consistency with other, similar structures.
2850 (is_arm_elf): New macro. Checks a BFD to make sure that is an ARM
2851 ELF bfd.
2852 (elf32_arm_mkobject): Call bfd_elf_allocate_object.
2853 (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
2854 the bfd being processed.
2855 (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2856 (bfd_elf32_arm_set_target_relocs): Likewise.
2857 (bfd_elf32_arm_final_link_relocate): Likewise.
2858 (bfd_elf32_arm_copy_private_bfd_data): Likewise.
2859 (bfd_elf32_arm_merge_eabi_attributes): Likewise.
2860 (bfd_elf32_arm_merge_private_bfd_data): Likewise.
2861 (bfd_elf32_arm_check_relocs): Likewise.
2862 (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
2863 (bfd_elf32_arm_size_dynamic_sections): Likewise.
2864 (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
2865 (bfd_elf32_arm_init_maps): Likewise.
2866 (bfd_elf32_arm_final_link_relocate): Likewise.
2867 (bfd_elf32_arm_relocate_section): Likewise.
2868 (bfd_elf32_arm_gc_sweep_hook): Likewise.
2869 (bfd_elf32_arm_check_relocs): Likewise.
2870 (bfd_elf32_arm_size_dynamic_sections): Likewise.
2871 * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
2872 (is_i386_elf): New macro. Checks a BFD to make sure that is an x86
2873 ELF bfd.
2874 (elf_i386_check_relocs): Use is_i386_elf macro to check the bfd
2875 being processed.
2876 (elf_i386_size_dynamic_sections): Likewise.
2877 (elf_i386_relocate_section): Likewise.
2878 (elf_i386_check_relocs): Use elf_symtab_hdr.
2879 (elf_i386_gc_sweep_hook): Likewise.
2880 (elf_i386_size_dynamic_sections): Likewise.
2881 (elf_i386_relocate_section): Likewise.
2882 * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
2883 (elf_create_pointer_linker_section): Use is_ppc_elf_target to
2884 verify that the bfd before accessing target specific fields.
2885 (ppc_elf_check_relocs): Likewise.
2886 (elf_finish_pointer_linker_section): Likewise.
2887 (elf_create_pointer_linker_section): Use elf_symtab_hdr.
2888 (ppc_elf_check_relocs): Likewise.
2889 (ppc_elf_gc_sweep_hook): Likewise.
2890 (ppc_elf_tls_optimize): Likewise.
2891 (ppc_elf_size_dynamic_sections): Likewise.
2892 (ppc_elf_relax_section): Likewise.
2893 (ppc_elf_relocate_section): Likewise.
2894 * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
2895 reminding programmers to keep this structure in sync with the one
2896 defined in elf64-s390.c.
2897 (elf_s390_mkobject): Call bfd_elf_allocate_object.
2898 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
2899 ELF bfd.
2900 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
2901 being processed.
2902 (elf_s390_size_dynamic_sections): Likewise.
2903 (elf_s390_relocate_section): Likewise.
2904 (elf_s390_check_relocs): Use elf_symtab_hdr.
2905 (elf_s390_gc_sweep_hook): Likewise.
2906 (elf_s390_size_dynamic_sections): Likewise.
0eb4a168 2907 (elf_s390_relocate_section): Likewise.
0ffa91dd
NC
2908 * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
2909 (is_sh_elf): New macro. Checks a BFD to make sure that is an SH
2910 ELF bfd.
2911 (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
2912 bfd being processed.
2913 (sh_elf_relocate_section): Likewise.
2914 (sh_elf_check_relocs): Likewise.
2915 (sh_elf_copy_private_data): Likewise.
2916 (sh_elf_relax_section): Use elf_symtab_hdr.
2917 (sh_elf_size_dynamic_sections): Likewise.
2918 (sh_elf_relocate_section): Likewise.
2919 (sh_elf_get_relocated_section_contents): Likewise.
2920 (sh_elf_gc_sweep_hook): Likewise.
2921 (sh_elf_check_relocs): Likewise.
2922 * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
2923 (is_alpha_elf): New macro. Checks a BFD to make sure that is an
2924 Alpha ELF bfd.
2925 (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
2926 the bfd being processed.
2927 (elf64_alpha_create_dynamic_section): Likewise.
2928 (elf64_alpha_check_relocs): Likewise.
2929 (elf64_alpha_size_got_sections): Likewise.
2930 (elf64_alpha_relax_section): Likewise.
2931 (elf64_alpha_relocate_section): Likewise.
2932 (elf64_alpha_final_link): Likewise.
2933 (elf64_alpha_check_relocs): Use elf_symtab_hdr.
2934 (elf64_alpha_relax_section): Likewise.
2935 (elf64_alpha_relocate_section_r): Likewise.
2936 (elf64_alpha_relocate_section): Likewise.
2937 * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
2938 (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
2939 being processed.
2940 (opd_entry_value): Likewise.
2941 (allocate_dynrelocs): Likewise.
2942 (ppc64_elf_relocate_section): Likewise.
2943 (ppc64_elf_check_relocs): Use elf_symtab_hdr.
2944 (opd_entry_value): Likewise.
2945 (ppc64_elf_gc_sweep_hook): Likewise.
2946 (get_sym_h): Likewise.
2947 (ppc64_elf_edit_opd): Likewise.
2948 (ppc64_elf_tls_optimize): Likewise.
2949 (ppc64_elf_edit_toc): Likewise.
2950 (ppc64_elf_size_dynamic_sections): Likewise.
2951 (toc_adjusting_stub_needed): Likewise.
2952 (ppc64_elf_size_stubs): Likewise.
2953 (ppc64_elf_relocate_section): Likewise.
2954 * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
2955 reminding programmers to keep this structure in sync with the one
2956 defined in elf32-s390.c.
2957 (elf_s390_mkobject): Call bfd_elf_allocate_object.
2958 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
2959 ELF bfd.
2960 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
2961 being processed.
2962 (elf_s390_size_dynamic_sections): Likewise.
0eb4a168 2963 (elf_s390_relocate_section): Likewise.
0ffa91dd
NC
2964 (elf_s390_check_relocs): Use elf_symtab_hdr.
2965 (elf_s390_gc_sweep_hook): Likewise.
2966 (elf_s390_size_dynamic_sections): Likewise.
2967 (elf_s390_relocate_section): Likewise.
2968 * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
2969 (is_x86_64_elf): New macro. Checks a BFD to make sure that is an
2970 x86_64 ELF bfd.
2971 (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
2972 being processed.
2973 (elf64_x86_64_size_dynamic_sections): Likewise.
2974 (elf64_x86_64_relocate_section): Likewise.
2975 (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
2976 (elf64_x86_64_gc_sweep_hook): Likewise.
2977 (elf64_x86_64_size_dynamic_sections): Likewise.
2978 (elf64_x86_64_relocate_section): Likewise.
2979 * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
2980 (is_sparc_elf): New macro. Checks a BFD to make sure that is a Sparc
2981 ELF bfd.
2982 (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
2983 bfd being processed.
2984 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2985 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
2986 (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
2987 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2988 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
0eb4a168 2989 (_bfd_sparc_elf_relocate_section): Likewise.
0ffa91dd 2990
be4291f1
AM
29912008-02-12 Alan Modra <amodra@bigpond.net.au>
2992
2993 PR 5303, 5755
2994 * arange-set.c: Delete.
2995 * arange-set.h: Delete.
2996 * dwarf2.c: Revert 2007-09-21 changes.
2997 * Makefile.am: Likewise.
2998 * Makefile.in: Regenerate.
2999 * po/SRC-POTFILES.in: Regenerate.
3000
7a84e3da
BS
30012008-02-11 Bernd Schmidt <bernd.schmidt@analog.com>
3002
3003 * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
3004 if necessary.
3005 (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
3006 mismatches are detected.
3007
ca889129
BS
3008 * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
3009 emit invalid relocs or rofixup entries for deleted .eh_frame entries.
3010
662ed161
DJ
30112008-02-11 Daniel Jacobowitz <dan@codesourcery.com>
3012
3013 * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
3014 was reached.
3015 * srec.c (srec_scan): Calculate the checksum. Complain on mismatch.
3016
2e444bea
AM
30172008-02-07 Alan Modra <amodra@bigpond.net.au>
3018
3019 * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
3020 of _ovly_buf_table size.
3021 (spu_elf_build_stubs): Use low bit of .size as "present" bit.
3022 Adjust initialisations relating to _ovly_buf_table.
3023
d9ab3f29 30242008-02-04 Bob Wilson <bob.wilson@acm.org>
0eb4a168 3025
d9ab3f29
BW
3026 * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
3027 relocation, do not continue processing it. Ignore R_XTENSA_ASM_EXPAND
3028 relocations against dynamic symbols.
3029 (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
3030 .xt.lit section.
0eb4a168 3031
bb8541b9
L
30322008-02-04 Kai Tietz <kai.tietz@onevision.com>
3033 H.J. Lu <hongjiu.lu@intel.com>
3034
3035 PR 5715
3036 * warning.m4: Enable -Wno-format by default when using gcc on
3037 mingw.
3038 * configure: Regenerated.
3039
6f179bd0
AN
30402008-02-04 Adam Nemet <anemet@caviumnetworks.com>
3041
3042 * archures.c: Update copyright.
3043 (bfd_mach_mips_octeon): New macro.
3044 * bfd-in2.h: Regenerate.
3045 * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
3046 (mips_set_isa_flags): Likewise.
3047 (mips_mach_extensions): Add Octeon.
3048 * cpu-mips.c: Update copyright.
3049 (I_mipsocteon): New enum constant.
3050 (arch_info_struct): Add Octeon.
3051
d16c7321
AM
30522008-02-04 Alan Modra <amodra@bigpond.net.au>
3053
3054 * elf32-spu.c (spu_elf_relocate_section): Correct return type.
3055 Return error status on unexpected relocation errors.
3056
e44a2c9c
AM
30572008-02-04 Alan Modra <amodra@bigpond.net.au>
3058
3059 PR ld/5692
3060 * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31. Instead abort
3061 on non-ELF input.
3062 * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
3063 processing on non-ELF input.
3064
f8a52b59
BW
30652008-01-31 Marc Gauthier <marc@tensilica.com>
3066
3067 * config.bfd (xtensa*-*-*): Recognize processor variants.
3068
b7c368d0
NC
30692008-01-31 Nick Clifton <nickc@redhat.com>
3070
3071 PR ld/5692
3072 * elf.c (bfd_elf_get_elf_syms): Check the return value of
3073 get_elf_backend_data.
3074
00b2bfc1
NC
30752008-01-28 Fabian Groffen <grobian@gentoo.org>
3076
3077 * config.bfd (x86_64-*-solaris2): Add support for this target.
3078
47f6dab9
AM
30792008-01-28 Alan Modra <amodra@bigpond.net.au>
3080
3081 Rewrite SPU overlay handling code. Put overlay calls stubs in the
3082 overlays where possible. Use a faster call stub, or optionally at
3083 compile time, a more compact stub. Double size of _ovly_buf_table
3084 so that low bit of _ovly_table.buf can be used as a "present" bit.
3085 Reserve an extra _ovly_table entry for index zero.
3086 * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
3087 add new ones.
3088 (struct got_entry): New.
3089 (struct spu_stub_hash_entry): Delete.
3090 (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
3091 (spu_elf_link_hash_table_create): Adjust for struct changes.
3092 (spu_stub_name): Delete.
3093 (spu_elf_find_overlays): Don't track sections from overlay regions.
3094 Instead set ovl_buf number in spu elf section data. Error if
3095 overlays in one region don't start at the same address. Adjust
3096 for struct _spu_elf_section_data changes.
3097 (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
3098 (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
3099 (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
3100 (enum _insn_type): New.
3101 (count_stub, build_stub): New functions.
3102 (allocate_spuear_stubs): Use count_stub.
3103 (build_spuear_stubs): Use build_stub.
3104 (populate_stubs, sort_stubs): Delete.
3105 (process_stubs): New function.
3106 (write_one_stub): Delete.
3107 (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
3108 (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
3109 (maybe_insert_function, check_function_ranges): Likewise.
3110 (find_function, pasted_function, build_call_tree): Likewise.
3111 (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
3112 (spu_elf_modify_program_headers): Likewise.
3113 (interesting_section): Detect stub sections differently. Delete
3114 htab param, adjust all callers.
3115 (spu_elf_relocate_section): Rewrite stub handling.
3116 (spu_elf_output_symbol_hook): Likewise.
3117 (bfd_elf32_bfd_link_hash_table_free): Delete.
3118 * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
3119 output-only fields into a union. Add ovl_buf.
3120 (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
3121
c006d697
DD
31222008-01-25 DJ Delorie <dj@redhat.com>
3123
3124 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
3125
6e3d6dc1
NC
31262008-01-25 Kai Tietz <kai.tietz@onevision.com>
3127
3128 * bfd-in.h: Add mingw I64 support.
3129 * bfd-in2.h: Regenerated.
3130 * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
3131
fbb3bb98
AM
31322008-01-21 Alan Modra <amodra@bigpond.net.au>
3133
3134 PR 4453
3135 * format.c (bfd_check_format_matches): Don't accept archives as
3136 fully matching unless they have a map.
3137
297d8443
AM
31382008-01-21 Alan Modra <amodra@bigpond.net.au>
3139
3140 * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
3141
66cd82b5
AM
31422008-01-21 Alan Modra <amodra@bigpond.net.au>
3143
3144 * ecoff.c (_bfd_ecoff_archive_p): Delete.
3145 * libecoff.h (_bfd_ecoff_archive_p): Delete.
3146 * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
3147 * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
3148 (ecoff_biglittle_vec): Likewise.
3149
85f7a9cb
AM
31502008-01-19 Alan Modra <amodra@bigpond.net.au>
3151
3152 PR 5646
3153 * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
3154 non-NULL before dereferencing.
3155
74f0fb50
AM
31562008-01-15 Alan Modra <amodra@bigpond.net.au>
3157
3158 PR 5604
3159 * elf-bfd.h (struct elf_backend_data): Add gc_keep. Remove param
3160 names from others.
3161 (_bfd_elf_gc_keep): Declare.
3162 * elfxx-target.h (elf_backend_gc_keep): Define.
3163 (elfNN_bed): Init new field.
3164 * elflink.c (_bfd_elf_gc_keep): New function.
3165 (bfd_elf_gc_sections): Call gc_keep.
3166 * elf64-ppc.c (elf_backend_gc_keep): Define.
3167 (struct _ppc64_elf_section_data): Move .opd related fields to
3168 a struct so they don't occupy the same storage. Adjust accesses
3169 throughout file.
3170 (ppc64_elf_gc_keep): New function, split out from..
3171 (ppc64_elf_gc_mark_hook): ..here. Don't call _bfd_elf_gc_mark
3172 to mark .opd section, just set gc_mark.
3173 (ppc64_elf_edit_opd): Remove no_opd_opt parm. Don't set opd->adjust
3174 unless we are changing .opd. Test non-NULL opd->adjust at all
3175 accesses throughout file.
3176 * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
3177
787daa7a
AM
31782008-01-15 Alan Modra <amodra@bigpond.net.au>
3179
3180 * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
3181 * bfd-in2.h: Regenerate.
3182
7dda2462
TG
31832008-01-11 Tristan Gingold <gingold@adacore.com>
3184 Eric Botcazou <ebotcazou@adacore.com>
3185
3186 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
3187 relocatable.
3188 * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
3189 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
3190 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
3191 * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
3192 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
3193 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
3194 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
3195 * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
3196 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
3197 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
3198 * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
3199 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
3200 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
3201 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
3202 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
3203 * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
3204 or executable output with relocations.
3205
d2e2e649
NC
32062008-01-09 Nick Clifton <nickc@redhat.com>
3207
3208 PR gas/5552
3209 * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
3210 to FALSE for all relocs.
3211
184d07da
RS
32122008-01-09 Richard Sandiford <rsandifo@nildram.co.uk>
3213
3214 PR ld/5526
3215 * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
3216 fields. Rename u.cie.u.merged to u.cie.u.merged_with.
3217 (eh_frame_sec_info): Add a cies field.
3218 (eh_frame_hdr_info): Add a merge_cies field.
3219 * elf-eh-frame.c (cie): Add a reloc_index member to the personality
3220 union.
3221 (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
3222 of hdr_info->cies.
3223 (_bfd_elf_parse_eh_frame): Remove tmp_cie. Ccreate an array of
3224 cie structures in all cases and use it instead of extended_cies.
3225 If merging, store the cie array in sec_info->cies and point each
3226 CIE's eh_fde_cie at the associated element. Do not try to
3227 calculate the value of the personality routine here; record the
3228 offset of the relocation instead. Do not merge CIEs here.
3229 (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
3230 (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
3231 (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
3232 (find_merged_cie): New function.
3233 (_bfd_elf_gc_mark_fdes): Use it. Free sec_info->cies.
3234
780b2360
NC
32352008-01-07 Nick Clifton <nickc@redhat.com>
3236
3237 PR binutils/5535
3238 * vms.c (vms_close_and_cleanup): Check for the presence of a
3239 vms_private_data_struct before examining any of its fields.
3240
ace79388
L
32412008-01-07 H.J. Lu <hongjiu.lu@intel.com>
3242
3243 PR ld/5522
3244 * elflink.c (elf_link_input_bfd): Don't write out a section if
3245 its output section is marked with SEC_NEVER_LOAD.
3246
6c7ac64e 3247For older changes see ChangeLog-2007
56882138
AM
3248\f
3249Local Variables:
3250mode: change-log
3251left-margin: 8
3252fill-column: 74
3253version-control: never
3254End:
This page took 0.853525 seconds and 4 git commands to generate.