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