bf4cad152edfe66593a5651c34eda58d31225a9a
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2008-08-08 Alan Modra <amodra@bigpond.net.au>
2
3 * elf.c (bfd_elf_get_elf_syms): Don't leak memory on error.
4 * elflink.c (_bfd_elf_link_read_relocs): bfd_release on error.
5 (elf_link_add_object_symbols): Don't leak memory on error.
6 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
7 (elf_fixup_link_order): Free sections.
8
9 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
10
11 * elf-bfd.h (elf_backend_data): Add a "rela_plts_and_copies_p" field.
12 * elfxx-target.h (elf_backend_rela_plts_and_copies_p): New macro.
13 (elfNN_bed): Use it.
14 * elf.c (_bfd_elf_get_synthetic_symtab): Use rela_plts_and_copies_p
15 instead of default_use_rela_p to choose between ".rel.plt" and
16 ".rela.plt".
17 * elflink.c (_bfd_elf_create_dynamic_sections): Use
18 rela_plts_and_copies_p instead of default_use_rela_p to choose
19 between ".rel.plt" and ".rela.plt", and between ".rel.bss" and
20 ".rela.bss".
21
22 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
23
24 * elf-bfd.h (MIPS_ELF_TDATA): New elf_object_id.
25 * elf32-mips.c (bfd_elf32_mkobject): Define.
26 * elf64-mips.c (bfd_elf64_mkobject): Likewise.
27 * elfn32-mips.c (bfd_elf32_mkobject): Likewise.
28 * elfxx-mips.h (_bfd_mips_elf_mkobject): Declare.
29 * elfxx-mips.c (is_mips_elf): New macro.
30 (_bfd_mips_elf_mkobject): New function.
31 (_bfd_mips_elf_final_link): Use is_mips_elf.
32 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
33
34 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
35
36 * elfxx-mips.c (mips_elf_record_relocs): Defer allocation of a
37 global GOT entry when deferring allocation of dynamic relocations.
38 (allocate_dynrelocs): When allocating deferred dynamic relocations,
39 also do the deferred allocation of a GOT entry.
40
41 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
42
43 * elfxx-mips.c (mips_got_info): Add a "reloc_only_gotno" field.
44 (mips_elf_got_section): Delete.
45 (mips_elf_sort_hash_table): Use g->reloc_only_gotno to decide
46 how many reloc-only entries there are.
47 (mips_elf_count_got_symbols): Adjust g->reloc_only_gotno as
48 well as g->global_gotno.
49 (mips_elf_make_got_per_bfd): Initialize reloc_only_gotno.
50 (mips_elf_multi_got): Likewise. Use gg->reloc_only_gotno
51 rather than gg->assigned_gotno to store the number of
52 reloc-only GOT entries.
53 (mips_elf_create_got_section): Remove the MAYBE_EXCLUDE parameter.
54 Initialize reloc_only_gotno.
55 (mips_elf_calculate_relocation): Check htab->got_info instead of
56 dynobj when deciding whether to call mips_elf_adjust_gp,
57 (_bfd_mips_elf_create_dynamic_sections): Adjust the call
58 to mips_elf_create_got_section.
59 (mips_elf_record_relocs): Likewise. Remove redundant
60 "dynobj == NULL" code. Do not use mips_elf_create_got_section
61 or mips_elf_record_global_got_symbol for R_MIPS_32, R_MIPS_REL32
62 and R_MIPS_64; limit global_got_area to GGA_RELOC_ONLY instead.
63 (_bfd_mips_elf_finish_dynamic_symbol): Use htab->sgot instead
64 of mips_elf_got_section.
65 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
66 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
67 Move the initial assignment of G to the block that uses it;
68 it is used for an unrelated purpose later.
69
70 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
71
72 * elfxx-mips.c (count_section_dynsyms): Move before the new first use.
73 (mips_elf_sort_hash_table): Take the output bfd as a parameter.
74 Remove the MAX_LOCAL parameter. Exit early if there are no
75 dynamic symbols, if there is no dynobj, or if there is no
76 GOT section. Use count_section_dynsyms instead of MAX_LOCAL.
77 Assert == rather than <= when checking hsd.max_unref_got_dynindx.
78 Also assert that g->global_gotno is right.
79 (mips_elf_count_forced_local_got_symbols): Rename to...
80 (mips_elf_count_got_symbols): ...and count global GOT entries too.
81 Set the global_got_area of a forced-local GGA_RELOC_ONLY symbol
82 to GGA_NONE.
83 (mips_elf_multi_got): Don't sort the symbol table.
84 (mips_elf_lay_out_got): Likewise. Use mips_elf_count_got_symbols
85 to count the number of global GOT entries.
86 (_bfd_mips_elf_final_link): Unconditionally call
87 mips_elf_sort_hash_table.
88
89 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
90
91 * elfxx-mips.c (GGA_NORMAL, GGA_RELOC_ONLY, GGA_NONE): New macros.
92 (mips_elf_link_hash_entry): Add a "global_got_area" field.
93 (mips_elf_link_hash_newfunc): Initialize it.
94 (mips_elf_sort_hash_table_f): Use h->global_got_area instead of
95 h->root.got.offset. Do not handle forced_local symbols specially.
96 (mips_elf_record_global_got_symbol): Set h->global_got_area
97 instead of h->root.got.offset.
98 (mips_elf_recreate_got): Assert that h->global_got_area == GGA_NONE
99 for indirect and warning symbols.
100 (mips_elf_count_forced_local_got_symbols): Change the argument
101 from a "elf_link_hash_entry" to "mips_elf_link_hash_entry".
102 Use and set h->global_got_area instead of h->root.got.offset.
103 Set it to GGA_NONE for all forced-local symbols.
104 (mips_elf_set_global_got_offset): Set h->global_got_area
105 instead of h->root.got.offset. Use g->global_got_area instead
106 of a combination of dynindx, forced_local and tls_type.
107 (mips_elf_multi_got): Remove disabled code. Pass GGA_* values to
108 mips_elf_set_global_got_offset.
109 (mips_elf_lay_out_got): Use mips_elf_link_hash_traverse instead
110 of elf_link_hash_traverse.
111 (_bfd_mips_elf_copy_indirect_symbol): Copy the indirect symbol's
112 global_got_area to the direct symbol if the latter's value is higher.
113 Set the indirect symbol's area to GGA_NONE.
114
115 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
116
117 * elf32-mips.c (elf_backend_hide_symbol): Delete.
118 * elfn32-mips.c (elf_backend_hide_symbol): Likewise.
119 * elf64-mips.c (elf_backend_hide_symbol): Likewise.
120 * elfxx-mips.h (elf_backend_hide_symbol): Likewise.
121 * elfxx-mips.c (mips_elf_link_hash_entry): Remove "forced_local"
122 and add "needs_lazy_stub".
123 (mips_elf_link_hash_newfunc): Update accordingly.
124 (mips_elf_link_hash_table): Remove "computed_got_sizes" and
125 add "lazy_stub_count".
126 (_bfd_mips_elf_link_hash_table_create): Update accordingly.
127 (mips_elf_output_extsym): Use hd->needs_lazy_stub to detect
128 cases where a lazy stub is being used.
129 (mips_elf_sort_hash_table_f): Use h->root.forced_local instead
130 of h->forced_local.
131 (mips_elf_record_global_got_symbol): Use _bfd_elf_link_hash_hide_symbol
132 instead of _bfd_mips_elf_hide_symbol. Do not increment local_gotno
133 here.
134 (mips_elf_allocate_dynamic_relocations): Move before new first use.
135 (mips_elf_check_recreate_got, mips_elf_recreate_got): New functions.
136 (mips_elf_resolve_final_got_entries): Move earlier in file. Make at
137 most two passes over the hash table. Use mips_elf_check_recreate_got
138 to see if there are any indirect or warning entries and
139 mips_elf_recreate_got to create a new GOT without them.
140 Return a boolean success value.
141 (mips_elf_count_forced_local_got_entries): New function.
142 (mips_elf_make_got_per_bfd): Check h->root.forced_local instead of
143 h->forced_local.
144 (mips_elf_set_global_got_offset): Likewise.
145 (mips_elf_set_no_stub): Replace with...
146 (mips_elf_forbid_lazy_stubs): ...this new function.
147 (mips_elf_resolve_final_got_entry): Delete.
148 (mips_elf_multi_got): Fix formatting. Use mips_elf_forbid_lazy_stubs
149 instead of mips_elf_set_no_stub. Move the code that sets
150 global offsets and allocates dynamic relocations from the main
151 _bfd_mips_elf_size_dynamic_sections loop to here.
152 (_bfd_mips_elf_adjust_dynamic_symbol): Do not allocate room in
153 .MIPS.stubs here; just set hmips->needs_lazy_stub and increment
154 htab->lazy_stub_count.
155 (_bfd_mips_elf_always_size_sections): Move the stub-estimation
156 code to mips_elf_estimate_stub_size and the GOT-sizing code to
157 mips_elf_lay_out_got. Do not call these functions here.
158 (mips_elf_estimate_stub_size): New function, split
159 out from _bfd_mips_elf_always_size_sections. Call
160 mips_elf_resolve_final_got_entries earlier. Count the number
161 of forced-local entries. Do not add stub sizes to loadable_size;
162 after this patch, the stub sizes are already included in the main
163 estimate. Allocate dynamic relocations here rather than in the
164 main _bfd_mips_elf_size_dynamic_sections loop.
165 (mips_elf_estimate_stub_size): New function, split out from
166 _bfd_mips_elf_always_size_sections.
167 (mips_elf_allocate_lazy_stub): New function.
168 (mips_elf_lay_out_lazy_stubs): Likewise.
169 (_bfd_mips_elf_size_dynamic_sections): Call mips_elf_estimate_stub_size,
170 mips_elf_lay_out_got and mips_elf_lay_out_lazy_stubs. Do not handle
171 the allocation of sreldyn specially.
172 (_bfd_mips_elf_hide_symbol): Delete.
173
174 2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
175
176 * elfxx-mips.c (allocate_dynrelocs): Ignore indirect and warning
177 symbols.
178
179 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
180
181 * elfxx-mips.c (mips_elf_link_hash_entry): Move bfd_boolean
182 fields to the end of the structure and make them single-bit
183 bitfields.
184 (mips_elf_link_hash_newfunc): Make the initialization statements
185 follow the new field order.
186
187 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
188
189 * elfxx-mips.c (_mips_elf_section_data): Remove the "u.got_info" field.
190 (mips_elf_link_hash_table): Add "sgot" and "got_info" fields.
191 (_bfd_mips_elf_link_hash_table_create): Initialize them.
192 (mips_elf_got_section): Always apply the !maybe_excluded behavior.
193 (mips_elf_got_info): Delete.
194 (mips_elf_initialize_tls_slots): Remove the DYNOBJ local variable.
195 Adjust the call to mips_elf_got_section.
196 (mips_elf_local_got_index): Don't call mips_elf_got_info.
197 Update the call to mips_elf_create_local_got_entry.
198 Use htab->got_info.
199 (mips_elf_global_got_index): Don't call mips_elf_got_info;
200 use htab->got_info and htab->sgot instead.
201 (mips_elf_got_page): Don't call mips_elf_got_info. Update the
202 call to mips_elf_create_local_got_entry.
203 (mips_elf_got16_entry): Likewise.
204 (mips_elf_got_offset_from_index): Replace with DYNOBJ parameter
205 with an INFO parameter. Don't call mips_elf_got_info; use htab->sgot
206 and htab->got_info instead.
207 (mips_elf_create_local_got_entry): Remove the GG and SGOT parameters.
208 Use htab->sgot and htab->got_info.
209 (mips_elf_sort_hash_table): Remove the DYNOBJ local variable.
210 Don't call mips_elf_got_info; use htab->got_info instead.
211 (mips_elf_record_global_got_symbol): Turn G from a paramter to
212 a local variable and read it from htab->got_info.
213 (mips_elf_record_local_got_symbol): Replace the G parameter with
214 an INFO parameter. Make G a local variable and read it from
215 htab->got_info instead.
216 (mips_elf_record_got_page_entry): Likewise.
217 (mips_elf_multi_got): Remove the G parameter and make it a local
218 variable instead. Read it from htab->got_info.
219 (mips_elf_create_got_section): Cache the GOT section in htab->sgot.
220 Store the GOT information in htab->got_info.
221 (mips_elf_calculate_relocation): Don't call mips_elf_got_section
222 and mips_elf_got_info; use htab->sgot and htab->got_info instead.
223 Adjust the calls to mips_elf_got_offset_from_index and
224 mips_elf_adjust_gp.
225 (_bfd_mips_elf_check_relocs): Remove the G and SGOT local variables.
226 Adjust the calls to mips_elf_record_local_got_symbol,
227 mips_elf_record_global_got_symbol and mips_elf_record_got_page_entry.
228 Use htab->sgot.
229 (_bfd_mips_elf_always_size_sections): Remove the DYNOBJ local variable.
230 Don't call mips_elf_got_info; use htab->sgot and htab->got_info instead.
231 Update the call to mips_elf_multi_got.
232 (_bfd_mips_elf_size_dynamic_sections): Don't call mips_elf_got_info;
233 use htab->got_info instead.
234 (_bfd_mips_elf_finish_dynamic_symbol): Update the call to
235 mips_elf_got_section. Get the got_info from the hash table
236 rather than the GOT section.
237 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
238 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
239 (_bfd_mips_elf_hide_symbol): Don't call mips_elf_got_section;
240 get the got_info from the hash table instead. Remove the GOT
241 local variable.
242 (_bfd_mips_elf_final_link): Likewise. Also remove the DYNOBJ
243 local variable.
244
245 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
246
247 * elfxx-mips.c (mips_elf_link_hash_table): Add an "sstubs" field.
248 (_bfd_mips_elf_create_dynamic_sections): Use it to cache the stubs
249 section. Don't check whether the section already exists.
250 (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->sstubs.
251 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
252 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
253 (_bfd_mips_elf_size_dynamic_sections): Likewise. Don't add the
254 dummy stub to an empty section.
255 (_bfd_mips_elf_link_hash_table_create): Initialize the "sstubs" field.
256
257 2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
258
259 * reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare.
260 * libbfd.h, bfd-in2.h: Regenerate.
261 * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
262 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
263 (mips16_reloc_map): Add mappings.
264 * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved
265 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
266 (mips16_elf64_howto_table_rela): Likewise.
267 (mips16_reloc_map): Add mappings.
268 * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved
269 R_MIPS16_GOT16 and R_MIPS16_CALL16 entries.
270 (elf_mips16_howto_table_rela): Likewise.
271 (mips16_reloc_map): Add mappings.
272 * elfxx-mips.c (mips_elf_create_shadow_symbol): New function.
273 (section_allows_mips16_refs_p): Likewise.
274 (mips16_stub_symndx): Likewise.
275 (mips_elf_check_mips16_stubs): Treat the data argument as a
276 bfd_link_info. Mark every dynamic symbol as needing MIPS16 stubs
277 and create a "shadow" symbol for the original MIPS16 definition.
278 (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p)
279 (lo16_reloc_p, mips16_call_reloc_p): New functions.
280 (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize
281 relocation checks.
282 (_bfd_mips16_elf_reloc_shuffle): Likewise.
283 (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16.
284 (mips_elf_got16_entry): Add comment.
285 (mips_elf_calculate_relocation): Use hi16_reloc_p,
286 lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p
287 to generalize relocation checks. Use section_allows_mips16_refs_p
288 instead of mips16_stub_section_p. Handle R_MIPS16_CALL16 and
289 R_MIPS16_GOT16, allowing the former to refer directly to a
290 MIPS16 function if its stub is not needed.
291 (mips16_stub_section_p): Delete.
292 (_bfd_mips_elf_symbol_processing): Convert odd-valued function
293 symbols into even MIPS16 symbols.
294 (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize
295 a relocation check.
296 (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end"
297 earlier in the function. Use mips16_stub_symndx to identify
298 the target function. Avoid out-of-bounds accesses when the
299 stub has no relocations; report an error instead. Use
300 section_allows_mips16_refs_p instead of mips16_stub_section_p.
301 Use mips16_call_reloc_p and got16_reloc_p to generalize relocation
302 checks. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. Don't create
303 dynamic relocations for absolute references to __gnu_local_gp.
304 (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as
305 the argument to mips_elf_check_mips16_stubs. Generalize comment.
306 (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p
307 to generalize relocation checks.
308 (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function
309 symbol has a non-MIPS16 stub, redirect the symbol to the stub.
310 Fix an overly long line. Don't give dynamic symbols type STO_MIPS16.
311 (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and
312 R_MIPS16_GOT16.
313
314 2008-08-06 Alan Modra <amodra@bigpond.net.au>
315
316 * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend.
317 (ppc_elf_relocate_section <R_PPC_RELAX32_PLT>): Don't bother here.
318
319 2008-08-05 Alan Modra <amodra@bigpond.net.au>
320 Jaka Močnik <jaka@xlab.si>
321
322 * coffcode.h (coff_slurp_line_table): bfd_alloc lineno_cache first
323 so that we don't inadvertently free it. Use bfd_alloc for sort
324 arrays, and memcpy sorted line table.
325
326 2008-08-04 Alan Modra <amodra@bigpond.net.au>
327
328 * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
329 if --fixed-space request is too large.
330
331 2008-08-04 Alan Modra <amodra@bigpond.net.au>
332
333 * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Set LC_ALL=C.
334 * Makefile.in: Regenerate.
335 * po/SRC-POTFILES.in: Regenerate.
336
337 2008-08-02 Alan Modra <amodra@bigpond.net.au>
338
339 * elf32-spu.c (mark_overlay_section): Move code calculating
340 max_overlay_size to correct block.
341 (spu_elf_auto_overlay): Don't use %x in einfo error message.
342
343 2008-08-01 Alan Modra <amodra@bigpond.net.au>
344 Jan Kratochvil <jan.kratochvil@redhat.com>
345
346 * elfcore.h (elf_core_file_p): Ensure we have a backend match
347 with the correct arch size before rejecting the generic fallback.
348 * elfcode.h (elf_object_p): Likewise. Ensure arch size matches
349 before accepting a target.
350
351 2008-08-01 Alan Modra <amodra@bigpond.net.au>
352
353 PR 6774
354 * elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
355 include file or program headers.
356
357 2008-07-30 Alan Modra <amodra@bigpond.net.au>
358
359 * coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c,
360 elf32-iq2000.c, elf32-m32c.c, elf32-mep.c, elf32-mt.c,
361 elf32-sh-symbian.c, elf64-hppa.c, mach-o.c, peXXigen.c, pef.c,
362 ppcboot.c, vms-misc.c, xsym.c: Silence gcc warnings.
363
364 2008-07-28 Daniel Jacobowitz <dan@codesourcery.com>
365
366 * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating
367 relocations for undefined weak symbols with non-default visibility.
368 (_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for
369 global symbols in shared libraries.
370 (allocate_dynrelocs): New function.
371 (_bfd_mips_elf_adjust_dynamic_symbol): Do not handle
372 possibly_dynamic_relocs here.
373 (_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs.
374
375 2008-07-28 Alexandre Oliva <aoliva@redhat.com>
376
377 * elf32-i386.c (struct elf_i386_link_hash_table): Added field
378 tls_module_base.
379 (elf_i386_link_hash_table_create): Initialize it.
380 (elf_i386_always_size_sections): Set it.
381 (set_tls_module_base): New.
382 (elf_i386_relocate_sections): Call it.
383 * elf64-x86-64.c (struct elf64_x86_64_link_hash_table): Added
384 field tls_module_base.
385 (elf64_x86_64_link_hash_table_create): Initialize it.
386 (elf64_x86_64_always_size_sections): Set it.
387 (set_tls_module_base): New.
388 (elf64_x86_64_relocate_sections): Call it.
389 Reported by Cary Coutant <ccoutant@google.com>
390
391 2008-07-28 Ineiev <ineiev@yahoo.co.uk>
392
393 * elf32-arm.c (arm_map_one_stub): Declare variables at beginning
394 of block.
395 * elf32-avr.c (get_local_syms): Likewise.
396
397 2008-07-28 Alan Modra <amodra@bigpond.net.au>
398
399 PR 6769
400 * bfd-in.h (BFD_VMA_FMT): Define.
401 (printf_vma, sprintf_vma): Use the above.
402 (_bfd_int64_low, _bfd_int64_high): Delete.
403 * bfd-in2.h: Regenerate.
404
405 2008-07-27 Alan Modra <amodra@bigpond.net.au>
406
407 * elf.c (_bfd_elf_make_section_from_shdr): Ignore return from
408 elf_parse_notes. Use bfd_malloc_and_get_section.
409 (elf_parse_notes): Validate note namesz and descsz.
410
411 2008-07-26 Michael Eager <eager@eagercon.com>
412
413 * elf32-ppc.c (ppc_elf_merge_obj_attributes): Check compatibility
414 between single-float, double-float, and soft-float.
415
416 2008-07-24 Daniel Jacobowitz <dan@codesourcery.com>
417
418 * elf32-mips.c (elf_backend_write_section): Define.
419
420 2008-07-24 Nick Clifton <nickc@redhat.com>
421
422 * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one
423 error assigning sections to segments.
424
425 2008-07-22 Nick Clifton <nickc@redhat.com>
426
427 * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in
428 adjoining pages to be included in the same segment.
429
430 2008-07-22 Simon Baldwin <simonb@google.com>
431
432 * elflink.c (elf_link_output_extsym): Set st_size to zero for
433 symbols from dynamic libraries.
434
435 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
436
437 PR ld/4424
438 * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible
439 to check if 2 inputs are compatible.
440
441 2008-07-21 Sterling Augustine <sterling@tensilica.com>
442
443 * elf.c (assign_file_positions_for_load_sections): Print vma in
444 error message about overlapping section vmas.
445
446 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
447
448 PR ld/6747
449 * elf32-frv.c (elf32_frv_relocate_section): Revert the change
450 for PR ld/6446 checked in by accident on May 21, 2008.
451
452 2008-07-21 Nick Clifton <nickc@redhat.com>
453
454 * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non
455 COFF_WITH_PE based SH ports.
456 * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype.
457 * arm-wince-pe.c (bfd_pe_print_pdata): Use
458 _bfd_pe_print_ce_compressed_pdata.
459 (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move
460 to...
461 * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to
462 _bfd_XX_print_ce_compressed_pdata.
463
464 2008-07-21 Alan Modra <amodra@bigpond.net.au>
465
466 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
467 unwanted zero terminators.
468
469 2008-07-21 Alan Modra <amodra@bigpond.net.au>
470
471 * elf32-spu.c (spu_elf_relocate_section): Expand
472 RELOC_FOR_GLOBAL_SYMBOL. Don't warn about undefined symbols for
473 R_SPU_PPU32 and R_SPU_PPU64 relocations.
474
475 2008-07-21 Luis Machado <luisgpm@br.ibm.com>
476
477 * elf-bfd.h: Declare elfcore_write_ppc_vsx.
478 * elf.c (elfcore_grok_ppc_vsx): New function.
479 (elfcore_write_ppc_vsx): New function
480 (elfcore_grok_note): Handle VSX notes.
481 (elfcore_write_register_note): Handle VSX notes.
482
483 2008-07-18 Joseph Myers <joseph@codesourcery.com>
484
485 * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
486 * bfd-in2.h: Regenerate.
487 * elf32-arm.c (struct elf_arm_obj_tdata): Add field
488 no_wchar_size_warning.
489 (bfd_elf32_arm_set_target_relocs): Add new parameter
490 no_wchar_warn.
491 (elf32_arm_merge_eabi_attributes): Give a warning, not an error,
492 for conflicting wchar_t attributes. Do not warn if
493 --no-wchar-size-warning. Make diagnostic text more specific.
494
495 2008-07-18 H.J. Lu <hongjiu.lu@intel.com>
496
497 PR ld/6748
498 * elf32-arm.c (elf32_arm_link_hash_table_create): Initialize
499 new fields added for ARM long call support.
500
501 2008-07-18 Danny Backx <dannybackx@users.sourceforge.net>
502
503 * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
504 print compressed pdata structure as described on MSDN. This only
505 applies to a limited set of architectures (ARM, SH4).
506 (slurp_symtab, my_symbol_for_address): Define static helper
507 functions for pe_print_compressed_pdata.
508 * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
509 (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
510 * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
511 bfd_coff_backend_data, call the function if non-null.
512 * pei-mcore.c: Add target dependent initialisation for
513 bfd_coff_backend_data.
514 * coff-sh.c: Likewise.
515 * coff64-rs6000.c: Likewise.
516 * coff-rs6000.c: Likewise.
517 * libcoff-in.h: Likewise.
518 * cf-i386lynx.c: Likewise.
519 * coff-alpha.c: Likewise.
520 * coff-apollo.c: Likewise.
521 * coff-arm.c: Likewise.
522 * coff-aux.c: Likewise.
523 * coff-h8300.c: Likewise.
524 * coff-h8500.c: Likewise.
525 * coff-i386.c: Likewise.
526 * coff-i860.c: Likewise.
527 * coff-i960.c: Likewise.
528 * coff-ia64.c: Likewise.
529 * coff-m68k.c: Likewise.
530 * coff-m88k.c: Likewise.
531 * coff-maxq.c: Likewise.
532 * coff-mips.c: Likewise.
533 * coff-or32.c: Likewise.
534 * coff-sparc.c: Likewise.
535 * coff-tic30.c: Likewise.
536 * coff-tic4x.c: Likewise.
537 * coff-tic54x.c: Likewise.
538 * coff-tic80.c: Likewise.
539 * coff-w65.c: Likewise.
540 * coff-we32k.c: Likewise.
541 * coff-x86_64.c: Likewise.
542 * coff-z80.c: Likewise.
543 * coff-z8k.c: Likewise.
544 * pe-mcore.c: Likewise.
545 * pe-mips.c: Likewise.
546 * pe-ppc.c: Likewise.
547 * peXXigen.c: Likewise.
548 * pei-ppc.c: Likewise.
549 * libcoff.h: Regenerate.
550
551 2008-07-16 Bernd Schmidt <bernd.schmidt@analog.com>
552
553 * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
554 bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook,
555 ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE,
556 struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code
557 separate from non-FD-PIC.
558
559 2008-07-14 DJ Delorie <dj@redhat.com>
560
561 * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow
562 checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16
563 relocs.
564 (mn10300_elf_relax_section): Correct jump offset check when target
565 is in a different section.
566
567 2008-07-15 Jie Zhang <jie.zhang@analog.com>
568
569 * elf32-bfin.c (elf32_bfin_special_sections[]): New.
570 (elf_backend_special_sections): Define.
571
572 2008-07-13 Craig Silverstein <csilvers@google.com>
573
574 PR binutils/6743
575 * dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory.
576 (find_line): Use info_ptr_memory instead of sec_info_ptr.
577 (_bfd_dwarf2_cleanup_debug_info): Likewise.
578
579 2008-07-12 Jie Zhang <jie.zhang@analog.com>
580
581 Revert
582 2008-07-12 Jie Zhang <jie.zhang@analog.com>
583 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
584 executable sections into the same segment with other
585 read only sections if --sep-code.
586 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
587 (elf32_bfin_data_in_l1): New variable.
588 (elf32_bfin_final_write_processing): New.
589 (elf32_bfin_special_sections[]): New.
590 (elf_backend_final_write_processing): Define.
591 (elf_backend_special_sections): Define.
592
593 2008-07-12 Jie Zhang <jie.zhang@analog.com>
594
595 * elf.c (_bfd_elf_map_sections_to_segments): Don't put
596 executable sections into the same segment with other
597 read only sections if --sep-code.
598 * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
599 (elf32_bfin_data_in_l1): New variable.
600 (elf32_bfin_final_write_processing): New.
601 (elf32_bfin_special_sections[]): New.
602 (elf_backend_final_write_processing): Define.
603 (elf_backend_special_sections): Define.
604
605 2008-07-11 Andreas Schwab <schwab@suse.de>
606
607 * dwarf2.c (read_section): Take pointer to bfd_size_type instead
608 of unsigned long as last parameter.
609 (struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size,
610 dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of
611 unsigned long.
612
613 2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
614
615 * elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0
616 for all relocation types. Allow any type of relocation to refer to
617 __gnu_local_gp.
618
619 2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
620
621 * elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16.
622 (mips_elf_calculate_relocation): Likewise.
623 (_bfd_mips_elf_add_symbol_hook): Likewise.
624 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
625 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
626
627 2008-07-10 Andreas Schwab <schwab@suse.de>
628
629 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Add missing
630 paren.
631
632 2008-07-09 Craig Silverstein <csilvers@google.com>
633
634 * Makefile.am (BFD32_LIBS): Add compress.lo.
635 (BFD32_LIBS_CFILES): Add compress.c.
636 (BFD_H_FILES): Likewise.
637 * Makefile.in: Regenerate.
638 * bfd-in2.h: Regenerate.
639 * config.in: Add HAVE_ZLIB_H
640 * configure.in: Add test for libz and zlib.h
641 * configure: Regenerate.
642 * dwarf2.c (read_section): New function.
643 (read_indirect_string): Call new function read_section.
644 (read_abbrevs): Likewise.
645 (decode_line_info): Likewise.
646 (read_debug_ranges): Likewise.
647 (find_line): Call new function read_section when just one
648 .zdebug_info section is found, otherwise read and compress
649 multiple sections.
650 (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
651 * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
652 (special_sections_z): New struct.
653 (special_sections): Refer to special_sections_z.
654 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
655 sections named .zdebug_*.
656 (_bfd_mips_elf_fake_sections): Likewise.
657 * compress.c: New file.
658 (bfd_uncompress_section_contents): New function.
659
660 2008-07-07 Christophe Lyon <christophe.lyon@st.com>
661
662 * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in
663 the presence of a PLT.
664
665 2008-07-07 Alan Modra <amodra@bigpond.net.au>
666
667 * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
668
669 2008-07-02 Alan Modra <amodra@bigpond.net.au>
670
671 * elf32-ppc.c (is_pic_glink_stub): New function.
672 (ppc_elf_get_synthetic_symtab): Don't generate symbols when
673 multiple shared/pie stubs per plt entry.
674
675 2008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
676
677 * elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
678 bed->s->int_rels_per_ext_rel.
679
680 2008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
681
682 * syms.c (BSF_SYNTHETIC): New flag.
683 * elf.c (_bfd_elf_get_synthetic_symtab): Set it.
684 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
685 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
686 * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
687 for synthetic symbols.
688 * bfd-in2.h: Regenerate.
689
690 2008-06-30 Daniel Jacobowitz <dan@codesourcery.com>
691
692 * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
693 Expand comments.
694 (arm_map_one_stub): Use | 1 when setting the low bit.
695
696 2008-06-29 Andreas Schwab <schwab@suse.de>
697
698 * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
699 addend on _GLOBAL_OFFSET_TABLE_.
700
701 2008-06-24 Daniel Jacobowitz <dan@codesourcery.com>
702
703 * elf32-arm.c (STUB_ENTRY_NAME): Define.
704 (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
705 (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
706 R_ARM_ABS32.
707 (struct elf32_arm_stub_hash_entry): Add output_name.
708 (arm_build_one_stub): Move offsets into the offset argument
709 of _bfd_final_link_relocate. Correct offset for
710 arm_thumb_arm_v4t_stub_long_branch.
711 (elf32_arm_size_stubs): Set stub_entry->output_name.
712 (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
713 Update all callers.
714 (elf32_arm_output_stub_sym): New.
715 (arm_map_one_stub): Correct formatting. Use elf32_arm_output_stub_sym.
716
717 2008-06-20 Alan Modra <amodra@bigpond.net.au>
718
719 * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
720 non-branch insns.
721
722 2008-06-20 Alan Modra <amodra@bigpond.net.au>
723
724 * elf32-spu.c (build_stub): Allow wraparound on stub branches.
725 (allocate_spuear_stubs, build_spuear_stubs): Return value from
726 count_stub/build_stub.
727 (spu_elf_build_stubs): Correct location of stub reloc error message.
728
729 2008-06-18 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
730
731 * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
732
733 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
734
735 * configure: Regenerate.
736
737 2008-06-17 Alan Modra <amodra@bigpond.net.au>
738
739 * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
740 (spu_elf_check_vma): Add extra_stack_space param, copy to htab.
741 (spu_elf_auto_overlay): Use it.
742 (RECURSE_UNMARK): Define as 0.
743 (unmark_overlay_section): Heed RECURSE_UNMARK.
744 * elf32-spu.h (spu_elf_check_vma): Update prototype.
745
746 2008-06-12 DJ Delorie <dj@redhat.com>
747
748 * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.
749
750 2008-06-09 Paul Brook <paul@codesourcery.com>
751
752 bfd/
753 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
754 libraries.
755
756 2008-06-09 Christophe Lyon <christophe.lyon@st.com>
757
758 * elf32-arm.c (arm_stub_is_thumb): Define.
759 (elf32_arm_final_link_relocate): Handle near mode switching stubs.
760
761 2008-06-07 Alan Modra <amodra@bigpond.net.au>
762
763 * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
764 to stack calculation.
765
766 2008-06-06 Paul Brook <paul@codesourcery.com>
767
768 bfd/
769 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
770
771 2008-06-06 Alan Modra <amodra@bigpond.net.au>
772
773 * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
774 file names be unique. Specify archive:path in overlay script.
775
776 2008-06-05 Alan Modra <amodra@bigpond.net.au>
777
778 PR ld/6590
779 * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
780
781 2008-06-04 Alan Modra <amodra@bigpond.net.au>
782
783 * elf.c (ignore_section_sym): Don't test section sym value here.
784 (elf_map_symbols): Instead check zero value here as was done prior
785 to 2006-05-26 change.
786
787 2008-06-04 Nick Clifton <nickc@redhat.com>
788
789 PR ld/6019
790 * elf32-avr.c (elf32_avr_relax_section): Handle the case where
791 there are no local symbols.
792
793 2008-06-04 Alan Modra <amodra@bigpond.net.au>
794
795 * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
796 (process_stubs): Likewise.
797 (discover_functions): Don't used cached symbols.
798 (maybe_insert_function): Correct condition under which function
799 array is realloc'd.
800 (mark_functions_via_relocs): Delete unused variable.
801
802 2008-05-30 Frediano Ziglio <frediano.ziglio@vodafone.com>
803 Nick Clifton <nickc@redhat.com>
804
805 PR ld/6511
806 * elf64-hppa.c (allocate_global_data_opd): Default to using the
807 dynamic symbol table for local function names in shared libraries.
808
809 2008-05-29 Jan Kratochvil <jan.kratochvil@redhat.com>
810
811 * elf.c (assign_file_positions_for_load_sections): Adjust pre-section
812 gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
813
814 2008-05-28 Alan Modra <amodra@bigpond.net.au>
815
816 * elf32-spu.c (spu_elf_object_p): New function.
817 (elf_backend_object_p): Define.
818 (build_stub): Correct second word of 8 byte overlay stubs.
819 (spu_elf_relocate_section): Formatting.
820
821 2008-05-24 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
822
823 * elf.c (elfcore_write_register_note): New function.
824 * elf-bfd.h (elfcore_write_register_note): New prototype.
825
826 2008-05-22 Christophe Lyon <christophe.lyon@st.com>
827
828 * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
829 (elf32_arm_stub_add_mapping_symbol): Remove.
830 (elf32_arm_add_stub): Don't generate mapping symbols. Change
831 prototype.
832 (elf32_arm_size_stubs): Use new elf32_arm_add_stub
833 prototype. Don't generate thumb to arm glue for calls.
834 (arm_map_one_stub): Define.
835 (elf32_arm_output_arch_local_syms): Generate mapping symbols for
836 long calls stubs.
837
838 2008-05-21 Nick Clifton <nickc@redhat.com>
839
840 * elf32-arm.c (group_sections): Reformat comments.
841
842 PR ld/6446
843 * elf32-frv.c (elf32_frv_relocate_section): Set EF_FRV_PIC by
844 default (for FDPIC). Clear it if any inter-segment relocations
845 are found.
846
847 * elf64-hppa.c (elf64_hppa_finalize_opd): Check NULL return
848 from elf_link_hash_lookup.
849
850 2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
851
852 Add multi-GOT support for m68k.
853 * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
854 glist): New fields.
855 (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
856 struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
857 struct elf_m68k_multi_got): New data structures.
858 (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
859 allow_multigot_p, multi_got_): New fields.
860 (elf_m68k_multi_got): New macro.
861 (elf_m68k_link_hash_newfunc): Initialize new fields of
862 struct elf_m68k_link_hash_entry.
863 (elf_m68k_link_hash_table_create): Initialize new fields of
864 struct elf_m68k_link_hash_table.
865 (elf_m68k_link_hash_table_free): New static function implementing hook.
866 (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
867 static functions for struct elf_m68k_got.
868 (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
869 elf_m68k_got_entry_eq): New static functions for
870 struct elf_m68k_got_entry.
871 (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
872 ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
873 (enum elf_m68k_get_entry_howto): New enum.
874 (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
875 elf_m68k_remove_got_entry_type): New static functions for
876 struct elf_m68k_got_entry.
877 (elf_m68k_add_entry_to_got): New static function.
878 (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
879 elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
880 functions for struct elf_m68k_bfd2got_entry.
881 (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
882 elf_m68k_can_merge_gots): New traversal.
883 (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
884 elf_m68k_merge_gots): Ditto.
885 (struct elf_m68k_finalize_got_offsets_arg,
886 elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
887 (struct elf_m68k_partition_multi_got_arg,
888 elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
889 elf_m68k_partition_multi_got): Ditto.
890 (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
891 functions.
892 (elf_m68k_copy_indirect_symbol): New static function implementing
893 a hook.
894 (elf_m68k_check_relocs): Update to add entries to multi-GOT.
895 (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
896 (elf_m68k_always_size_sections): Assign BFDs to GOTs.
897 (elf_m68k_relocate_section): Update to properly handle GOT relocations.
898 (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
899 of a global symbol.
900 (bfd_elf_m68k_set_target_options): New function.
901 (bfd_elf32_bfd_link_hash_table_free): Define hook.
902 (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
903 to skip generic calculation of GOT offsets.
904 (elf_backend_copy_indirect_symbol): Define hook.
905 * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
906 * bfd-in2.h: Regenerate.
907
908 2008-05-21 André Johansen <andrejoh@gmail.com>
909
910 PR 868
911 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
912 for filenames in function tables and variable tables.
913
914 2008-05-19 Alan Modra <amodra@bigpond.net.au>
915
916 PR 2995, PR 6473
917 * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
918 vma when all p_paddr fields are zero and there is more than
919 one PT_LOAD header.
920
921 2008-05-15 Christophe Lyon <christophe.lyon@st.com>
922
923 Add long call support for ARM.
924 * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
925 (THM2_MAX_BWD_BRANCH_OFFSET): Define.
926 (ARM_MAX_FWD_BRANCH_OFFSET): Define.
927 (ARM_MAX_BWD_BRANCH_OFFSET): Define.
928 (THM_MAX_FWD_BRANCH_OFFSET): Define.
929 (THM_MAX_BWD_BRANCH_OFFSET): Define.
930 (arm_long_branch_stub): Define.
931 (arm_pic_long_branch_stub): Define.
932 (arm_thumb_v4t_long_branch_stub): Define.
933 (arm_thumb_thumb_long_branch_stub): Define.
934 (arm_thumb_arm_v4t_long_branch_stub): Define.
935 (STUB_SUFFIX): Define.
936 (elf32_arm_stub_type): Define.
937 (elf32_arm_stub_hash_entry): Define.
938 (elf32_arm_link_hash_entry): Add stub_cache field.
939 (arm_stub_hash_lookup): Define.
940 (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
941 add_stub_section, layout_sections_again, stub_group, bfd_count,
942 top_index, input_list fields.
943 (elf32_arm_link_hash_newfunc): Init new field.
944 (stub_hash_newfunc): New function.
945 (elf32_arm_link_hash_table_create): Init stub_hash_table.
946 (elf32_arm_hash_table_free): New function.
947 (arm_type_of_stub): New function.
948 (elf32_arm_stub_name): New function.
949 (elf32_arm_get_stub_entry): New function.
950 (elf32_arm_stub_add_mapping_symbol): New function.
951 (elf32_arm_add_stub): New function.
952 (arm_build_one_stub): New function.
953 (arm_size_one_stub): New function.
954 (elf32_arm_setup_section_lists): New function.
955 (elf32_arm_next_input_section): New function.
956 (group_sections): New function.
957 (elf32_arm_size_stubs): New function.
958 (elf32_arm_build_stubs): New function.
959 (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
960 (bfd_elf32_arm_process_before_allocation): No longer handle
961 R_ARM_CALL and R_ARM_THM_CALL.
962 (using_thumb_only): New function.
963 (elf32_arm_final_link_relocate): Redirect calls to stub if range
964 exceeds encoding capabilities.
965 (bfd_elf32_bfd_link_hash_table_free): Define.
966 * bfd-in.h (R_ARM_max): Fix value to 130.
967 (elf32_arm_setup_section_lists): Protype.
968 (elf32_arm_next_input_section): Protype.
969 (elf32_arm_size_stubs): Protype.
970 (elf32_arm_build_stubs): Protype.
971 * bfd-in2.h: Regenerate.
972
973 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
974
975 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
976 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
977
978 2008-05-14 Alan Modra <amodra@bigpond.net.au>
979
980 * Makefile.am: Run "make dep-am".
981 * Makefile.in: Regenerate.
982
983 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
984 Alan Modra <amodra@bigpond.net.au>
985
986 * elf32-ppc.c (section_covers_vma): New function.
987 (ppc_elf_get_synthetic_symtab): New function.
988 (bfd_elf32_get_synthetic_symtab): Define.
989 * elf64-ppc.c (section_covers_vma): New function.
990 (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
991 table entries, and __glink_PLTresolve on resolver stub.
992 (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
993
994 2008-05-12 Alan Modra <amodra@bigpond.net.au>
995
996 PR 6443
997 * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
998 (must_be_dyn_reloc): New function.
999 (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
1000 in pies.
1001 (ppc_elf_tls_optimize): Optimise pies.
1002 (ppc_elf_relocate_section): Use a section symbol rather than no
1003 symbol if possible for LD->IE TLS sequence, but don't error if
1004 we must use no symbol.
1005 * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
1006 (must_be_dyn_reloc): Likewise.
1007 (ppc64_elf_check_relocs): Likewise.
1008 (ppc64_elf_tls_optimize): Likewise.
1009 (ppc64_elf_relocate_section): Likewise.
1010
1011 2008-05-12 Alan Modra <amodra@bigpond.net.au>
1012
1013 * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.
1014
1015 2008-05-10 Paul Pluzhnikov <ppluzhnikov@google.com>
1016
1017 * elfcore.h (elf_core_file_p): Warn about core truncation.
1018
1019 2008-05-07 Bob Wilson <bob.wilson@acm.org>
1020
1021 * elf32-xtensa.c (xtensa_property_section_name): New.
1022 (xtensa_make_property_section): New.
1023 (xtensa_get_property_section): Make static. Do not create a new
1024 section if it does not exist.
1025
1026 2008-05-08 Alan Modra <amodra@bigpond.net.au>
1027
1028 * elf32-spu.c (spu_elf_special_sections): Add "._ea".
1029 (spu_elf_relocate_section): Handle relocations against symbols
1030 defined in ._ea specially.
1031
1032 2008-05-03 Daniel Jacobowitz <dan@codesourcery.com>
1033
1034 * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
1035 ARRAY_SIZE.
1036 (elf32_arm_symbian_plt_sym_val): New.
1037 (elf_backend_plt_sym_val): Define.
1038
1039 2008-05-03 Alan Modra <amodra@bigpond.net.au>
1040
1041 PR 2995, PR 6473
1042 * elf.c (rewrite_elf_program_header): Rather than clearing
1043 p_paddr_valid at end, don't set it in the first place. Delete
1044 comment no longer relevant. When not p_paddr_valid, don't set
1045 paddr from vaddr, and don't set p_vaddr_offset.
1046
1047 2008-05-01 Cary Coutant <ccoutant@google.com>
1048
1049 * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
1050 corrupt string table.
1051
1052 2008-05-01 Joel Brobecker <brobecker@adacore.com>
1053
1054 * cache.c (cache_bread_1): Renames cache_bread.
1055 (cache_bread): New function.
1056
1057 2008-05-01 Alan Modra <amodra@bigpond.net.au>
1058
1059 PR 2995, PR 6473
1060 * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
1061 (assign_file_positions_for_load_sections): Combine nested "if".
1062 (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
1063 when all header p_paddr fields are zero.
1064
1065 2008-04-30 Edmar Wienskoski <edmar@freescale.com>
1066
1067 * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry.
1068
1069 2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
1070
1071 * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
1072 (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
1073 even if they are not loaded.
1074 * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
1075 first.
1076
1077 2008-04-25 Jay Foad <jay.foad@gmail.com>
1078
1079 * reloc16.c (bfd_coff_reloc16_get_value): Add support for
1080 undefined weak symbols.
1081
1082 2008-04-25 Nick Clifton <nickc@redhat.com>
1083
1084 * po/vi.po: Updated Vietnamese translation.
1085
1086 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
1087
1088 * aclocal.m4: Regenerate.
1089 * configure: Regenerate.
1090
1091 2008-04-21 Cary Coutant <ccoutant@google.com>
1092
1093 * archive.c (_bfd_write_archive_contents): Fix incorrect use of
1094 ARFMAG.
1095
1096 2008-04-21 Nathan Sidwell <nathan@codesourcery.com>
1097
1098 * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
1099 set the value of undefined symbols in shared objects.
1100 (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
1101 undefined symbols unless pointer equality is needed.
1102
1103 2008-04-18 Dennis Roberts <dennis.roberts@sunquestinfo.com>
1104
1105 * aix5ppc-core.c: Define macros for the default architecture and
1106 machine for matching core files.
1107 (xcoff64_core_p): Set the architecture and machine to the default
1108 values defined in the macros mentioned above.
1109 * rs6000-core.c: Define macros to determine whether or not the
1110 core file header uses the core_dumpxx header format.
1111 (rs6000coff_core_p): Don't match core files that use the
1112 core_dumpxx header format.
1113
1114 2008-04-16 Pedro Alves <pedro@codesourcery.com>
1115
1116 * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add.
1117
1118 2008-04-16 David S. Miller <davem@davemloft.net>
1119
1120 * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
1121 BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
1122 BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
1123 * libbfd.h: Regnerate.
1124 * bfd-in2.h: Regenerate.
1125 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
1126 GOTDATA relocations.
1127 (sparc_reloc_map): Likewise.
1128 (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
1129 R_SPARC_GOT*.
1130 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1131 (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
1132 R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
1133 R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
1134 Simply ignore R_SPARC_GOTDATA_OP relocations.
1135
1136 2008-04-14 Aurelien Jarno <aurelien@aurel32.net>
1137
1138 * configure.in: Link with the PIC version of libiberty on
1139 Linux/MIPS hosts.
1140 * configure: Regenerate.
1141
1142 2008-04-14 Edmar Wienskoski <edmar@freescale.com>
1143
1144 * archures.c: Add bfd_mach_ppc_e500mc.
1145 * bfd-in2.h: Regenerate.
1146
1147 2008-04-08 Alan Modra <amodra@bigpond.net.au>
1148
1149 * elf32-spu.c (spu_elf_build_stubs): Correct error message.
1150 (mark_functions_via_relocs): Remove premature init of symtab_hdr.
1151 (collect_overlays): Commment typo fix.
1152
1153 2008-04-08 Kees Cook <kees@canonical.com>
1154
1155 * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
1156 in EXEC_P bfds.
1157
1158 2008-04-08 Alan Modra <amodra@bigpond.net.au>
1159
1160 * elf32-spu.c: Include libiberty.h.
1161 (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
1162 non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
1163 spu_elf_relink, auto_overlay fields.
1164 (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
1165 (needs_ovl_stub): Flip test so that call to non-function warning
1166 is emitted during relocate_section rather than earlier.
1167 (spu_elf_check_vma): Stash --auto-overlay parameters, and clear
1168 auto_overlay if no section exceeds local store.
1169 (struct call_info): Add count, max_depth, is_pasted fields.
1170 (struct function_info): Add rodata, last_caller, call_count,
1171 depth, new visit flags.
1172 (insert_callee): Increment call count.
1173 (copy_callee): New function.
1174 (mark_functions_via_relocs): Investigate all reloc types to count
1175 possible function pointer stubs for --auto-overlay. Track
1176 last_caller and increment function call_count.
1177 (pasted_function): Insert a "call" into call info for pasted section.
1178 (remove_cycles): Track max depth of calls. Don't emit call graph
1179 pruning warning for --auto-overlay.
1180 (build_call_tree): Don't transfer_calls for --auto-overlay.
1181 Adjust remove_cycles call.
1182 (sort_calls, sort_lib, sort_bfds): New functions.
1183 (struct _mos_param, struct _uos_param, struct _cl_param): New.
1184 (mark_overlay_section, unmark_overlay_section): New functions.
1185 (collect_lib_sectios, auto_ovl_lib_functions): New functions.
1186 (collect_overlays, find_pasted_call): New functions.
1187 (sum_stack): Deal with is_pasted "calls". Exit before printing
1188 when --auto-overlay.
1189 (spu_elf_auto_overlay): New function.
1190 (spu_elf_final_link): Call spu_elf_auto_overlay.
1191 * elf32-spu.h (spu_elf_check_vma): Update prototype.
1192
1193 2008-04-07 Alan Modra <amodra@bigpond.net.au>
1194
1195 * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
1196 is defined in overlay section before creating a stub.
1197 (build_spuear_stubs): Likewise.
1198 (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
1199
1200 2008-04-02 Alan Modra <amodra@bigpond.net.au>
1201
1202 * elf32-spu.c (insert_callee): Reorder call list so most recent
1203 call is always first.
1204 (interesting_section): Move.
1205 (mark_functions_via_relocs): Fold interesting_section and
1206 reloc_count tests in callers to here. Simplify output section
1207 owner test.
1208 (discover_functions): Set "gaps" when no symbols and some
1209 "interesting_section". Run pasted_function loop for no symbol
1210 bfds.
1211 (for_each_node, transfer_calls): New functions.
1212 (mark_non_root): Adjust to suit for_each_node.
1213 (call_graph_traverse): Likewise. Fix memory leak. Rename to..
1214 (remove_cycles): ..this.
1215 (build_call_tree): Use for_each_node and transfer_calls.
1216 (struct _sum_stack_param): New.
1217 (sum_stack): Adjust to suit for_each_node. Return error on
1218 malloc failure. Move code to print root node cumulative stack from..
1219 (spu_elf_stack_analysis): ..here. Use for_each_node.
1220
1221 2008-03-31 Cary Coutant <ccoutant@google.com>
1222
1223 PR 6006
1224 * archive.c (_bfd_slurp_extended_name_table): Change
1225 ARFMAG[0] to ARFMAG[1].
1226 (_bfd_construct_extended_name_table): Likewise.
1227
1228 2008-03-31 Daniel Jacobowitz <dan@codesourcery.com>
1229
1230 * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
1231 (_bfd_mips_elf_check_relocs): Update comments. Always call
1232 mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
1233
1234 2008-03-27 Cary Coutant <ccoutant@google.com>
1235
1236 Add support for thin archives.
1237 * archive.c (_bfd_find_nested_archive): New function.
1238 (get_extended_arelt_filename): Add origin parameter.
1239 (_bfd_generic_read_ar_hdr_mag): Deal with extended name
1240 combined with a file offset.
1241 (append_relative_path): New function.
1242 (_bfd_get_elt_at_filepos): Deal with external members and
1243 nested archives.
1244 (bfd_generic_openr_next_archived_file): Thin archives.
1245 (bfd_generic_archive_p): Recognize new magic string.
1246 (adjust_relative_path): New function.
1247 (_bfd_construct_extended_name_table): Construct extended
1248 names for thin archive members.
1249 (_bfd_write_archive_contents): Emit new magic string, skip
1250 copying files for thin archives.
1251 * bfd-in.h (bfd_is_thin_archive): New macro.
1252 * bfd.c (struct bfd): New fields for thin archives.
1253 * libbfd-in.h (struct areltdata): New field for thin archives.
1254 * opncls.c (bfd_close): Delete BFDs for nested archives.
1255
1256 2008-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
1257
1258 * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
1259 _bfd_final_link_relocate that also handles R_pcrel24 relocs.
1260 (bfinfdpic_relocate_section, bfin_relocate_section): Use it.
1261
1262 2008-03-25 Nathan Sidwell <nathan@codesourcery.com>
1263
1264 * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
1265 in vxworks tls_vars sections.
1266 (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
1267 * elf32-i386.c (allocate_dynrelocs,
1268 elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
1269 * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
1270 ppc_elf_relocate_section): Likewise.
1271 * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
1272 sh_elf_relocate_section): Likewise.
1273 * elfxx-sparc.c (allocate_dynrelocs,
1274 _bfd_sparc_elf_size_dynamic_sections,
1275 _bfd_sparc_elf_relocate_section): Likewise.
1276
1277 2008-03-21 Adam Nemet <anemet@caviumnetworks.com>
1278
1279 * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
1280 print the values from the dynamic section.
1281
1282 2008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
1283
1284 * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
1285 (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
1286
1287 2008-03-20 Alan Modra <amodra@bigpond.net.au>
1288
1289 * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
1290 (spu_elf_find_overlays, spu_elf_size_stubs): Likewise
1291 (process_stubs, discover_functions, build_call_tree): Likewise.
1292 (spu_elf_stack_analysis): Likewise.
1293 (spu_elf_check_vma): Likewise. Move.
1294 (struct call_info): Make "is_tail" a bitfield.
1295 (insert_callee): Clear fun->start and set fun->is_func if we find
1296 a non-tail call.
1297 * elf32-spu.h (spu_elf_create_sections): Update prototype.
1298 (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
1299
1300 2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1301
1302 * aclocal.m4: Regenerate.
1303 * configure: Likewise.
1304 * Makefile.in: Likewise.
1305
1306 2008-03-16 H.J. Lu <hongjiu.lu@intel.com>
1307
1308 PR ld/5789
1309 PR ld/5943
1310 * elf32-i386.c (elf_i386_relocate_section): Issue an error
1311 for R_386_GOTOFF relocaton against undefined hidden/internal
1312 symbols when building a shared object.
1313
1314 * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
1315 error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
1316 relocaton against undefined hidden/internal symbols when
1317 building a shared object.
1318 (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
1319 is referenced locally, but isn't defined in a regular file.
1320
1321 2008-03-15 H.J. Lu <hongjiu.lu@intel.com>
1322
1323 * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO,
1324 HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED,
1325 BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY,
1326 HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ...
1327 * bfd.c: Here.
1328
1329 * bfd.c (bfd): Change cacheable, target_defaulted, opened_once,
1330 mtime_set, no_export, output_has_begun and has_armap to bit
1331 field.
1332
1333 * bfd-in2.h: Regenerated.
1334
1335 2008-03-14 Daniel Jacobowitz <dan@codesourcery.com>
1336
1337 * cache.c (close_one): Remove mtime hack.
1338
1339 2008-03-14 H.J. Lu <hongjiu.lu@intel.com>
1340
1341 PR ld/5913
1342 * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT.
1343 (elfNN_ia64_dtprel_base): Likewise.
1344 (elfNN_ia64_relocate_section): Go to missing_tls_sec if
1345 tls_sec is NULL before calling elfNN_ia64_tprel_base or
1346 elfNN_ia64_dtprel_base. Report unsupported TLS relocations.
1347
1348 2008-03-14 Alan Modra <amodra@bigpond.net.au>
1349
1350 * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move
1351 common code to..
1352 (maybe_needs_stub): ..here, a new function that also omits stubs
1353 for .eh_frame, and..
1354 (needs_ovl_stub): ..here. Create stubs for labels in code section
1355 referenced by switch jump table.
1356 (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return.
1357 (enum _insn_type): Delete.
1358 (enum _stub_type): New.
1359 (count_stub, build_stub): Adjust.
1360 (allocate_spuear_stubs, build_spuear_stubs): Adjust.
1361
1362 2008-03-13 Alan Modra <amodra@bigpond.net.au>
1363
1364 * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast.
1365 (_bfd_elf_assign_file_position_for_section): Simplify align.
1366 (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough
1367 for sh_addralign.
1368 (elf_fake_sections, swap_out_syms): Likewise.
1369 * elflink.c (bfd_elf_final_link): Likewise.
1370
1371 2008-03-13 Alan Modra <amodra@bigpond.net.au>
1372
1373 * Makefile.am: Run "make dep-am".
1374 * Makefile.in: Regenerate.
1375 * po/SRC-POTFILES.in: Regenerate.
1376
1377 2008-03-12 Bernd Schmidt <bernd.schmidt@analog.com>
1378
1379 From Jie Zhang <jie.zhang@analog.com>
1380 * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4,
1381 gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo,
1382 gotoff, call and sym not bitfields.
1383 (bfinfdpic_gc_sweep_hook): New function; update the relocation
1384 information for the relocations of the section being removed.
1385 (bfinfdpic_check_relocs): Accumulate the number of relocations
1386 which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4,
1387 fdgoffhilo, gotoff, call and sym fields.
1388 (elf_backend_gc_sweep_hook): Redefine for FD-PIC.
1389
1390 2008-03-12 Alan Modra <amodra@bigpond.net.au>
1391
1392 PR 5900
1393 * elf-bfd.h: Include elf/internal.h after elf/external.h.
1394 * elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
1395 (elf_swap_symbol_out): Adjust SHN_XINDEX test.
1396 (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
1397 seen in external structs.
1398 (valid_section_index_p): Delete.
1399 (elf_object_p): Don't increment section numbers over reserved range.
1400 Simplify test for valid sh_link, sh_info and e_shstrndx fields.
1401 (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
1402 seen in external structs. Don't increment section numbers over
1403 reserved range.
1404 * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
1405 (bfd_section_from_shdr): Likewise.
1406 (group_signature): Range check before accessing elf_elfsections.
1407 (_bfd_elf_setup_sections): Likewise.
1408 (bfd_section_from_shdr): Likewise.
1409 (bfd_section_from_shdr): Don't increment section number over
1410 reserved sections.
1411 (assign_file_positions_for_non_load_sections): Likewise.
1412 (assign_file_positions_except_relocs): Likewise.
1413 (_bfd_elf_write_object_contents): Likewise.
1414 (assign_section_numbers): Likewise. Adjust for changed SHN_*.
1415 (prep_headers): Delete unused variable.
1416 * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
1417 for changed SHN_* values.
1418 (check_dynsym, elf_link_input_bfd): Likewise.
1419 (bfd_elf_final_link): Likewise. Don't skip over reserved section
1420 range.
1421 (elf_fixup_link_order): Check that sh_link field is valid.
1422 * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
1423 * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
1424 accesssing elf_elfsections.
1425 * elf32-avr.c (elf32_avr_size_stubs): Likewise.
1426 * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
1427 * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
1428 * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
1429 SHN_* defines. Test for SHN_BAD return from
1430 _bfd_elf_section_from_bfd_section
1431
1432 2008-03-12 Alan Modra <amodra@bigpond.net.au>
1433
1434 * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
1435 * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int,
1436 SHN_BAD on error.
1437 (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from
1438 _bfd_elf_section_from_bfd_section, not -1.
1439 (swap_out_syms): Likewise.
1440 * elflink.c (elf_link_add_object_symbols): Likewise.
1441 (bfd_elf_get_bfd_needed_list): Likewise.
1442 (bfd_elf_match_symbols_in_sections): Likewise.
1443 (elf_link_add_object_symbols): Don't bother testing for symbols
1444 using normal sections before calling bfd_section_from_elf_index.
1445 (elf_link_input_bfd, bfd_elf_final_link): Likewise.
1446 (bfd_elf_reloc_symbol_deleted_p): Likewise.
1447 * elfcode.h (elf_slurp_symbol_table): Likewise.
1448 * elf32-spu.c (get_sym_h): Likewise.
1449 * elf32-xtensa.c (get_elf_r_symndx_section): Likewise.
1450 * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto.
1451 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
1452
1453 2008-03-11 Alan Modra <amodra@bigpond.net.au>
1454
1455 * elf32-spu.c (spu_elf_relocate_section): Test identical conditions
1456 to those in process_stubs for overlay symbols.
1457
1458 2008-03-09 Paul Brook <paul@codesourcery.com>
1459
1460 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
1461 Tag_VFP_arch values.
1462
1463 2008-03-08 Paul Brook <paul@codesourcery.com>
1464
1465 * elf32-arm.c (insert_thumb_branch): Rewrite.
1466 (elf32_thumb_to_arm_stub): Use new insert_thumb_branch.
1467
1468 2008-03-07 Paul Brook <paul@codesourcery.com>
1469
1470 * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and
1471 MOVT relocations.
1472 (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign
1473 extension.
1474 (elf32_arm_relocate_section): Handle MOVW and MOVT
1475 relocations. Improve safety check for other weird relocations.
1476 (elf32_arm_check_relocs): Only set h->needs_plt for branch/call
1477 relocations.
1478
1479 2008-03-03 Bob Wilson <bob.wilson@acm.org>
1480
1481 * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
1482 only compute its value once.
1483
1484 2008-03-03 Alan Modra <amodra@bigpond.net.au>
1485
1486 * elf32-spu.c (struct got_entry): Add "addend" field.
1487 (count_stub, build_stub): Use a new stub if relocation addend
1488 differs from existing stubs for this symbol.
1489 (process_stubs): Deal with addends.
1490 (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise.
1491
1492 2008-03-02 H.J. Lu <hongjiu.lu@intel.com>
1493
1494 PR ld/5789
1495 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true
1496 for hidden and local symbols.
1497
1498 2008-03-03 Alan Modra <amodra@bigpond.net.au>
1499
1500 * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
1501 undefined symbols with internal or hidden visibility.
1502 (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL
1503 rather than SYMBOL_REFERENCES_LOCAL on branches. Don't
1504 return immediately on dynamic reloc error.
1505
1506 2008-03-01 Alan Modra <amodra@bigpond.net.au>
1507
1508 * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
1509 if emitrelocations.
1510 (get_relocs): New function, split out from..
1511 (ppc_build_one_stub): ..here. Add relocs on plt_branch stubs if
1512 emitrelocations. Remove indx temp.
1513 (ppc_size_one_stub): Count new stub relocs.
1514 (ppc64_elf_size_stubs): Count new glink reloc.
1515 (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations.
1516 (ppc64_elf_finish_dynamic_sections): Output glink relocs.
1517 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic
1518 glink code.
1519
1520 2008-02-28 Alan Modra <amodra@bigpond.net.au>
1521
1522 * elf32-spu.c (mark_functions_via_relocs): Don't assume that
1523 the "->start" pointer reaches to function origin, so that we
1524 can handle functions split over more than two sections.
1525 (build_call_tree): Likewise.
1526 (pasted_function): Don't attempt to set fun->start back to the
1527 function origin, just go back one section.
1528
1529 2008-02-27 Catherine Moore <clm@codesourcery.com>
1530
1531 * elf.c ( _bfd_elf_print_private_bfd_data): Call
1532 elf_backend_get_target_dtag if defined.
1533 * elf32-mips.c (elf_backend_get_target_dtag): Define.
1534 * elf64-mips.c: Likewise.
1535 * elfn32-mips.c: Likewise.
1536 * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
1537 * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
1538 * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
1539 * elfxx-target.h (elf_backend_get_target_dtag): Add default.
1540 (elf_backend_data): Add elf_backend_get_target_dtag.
1541
1542 2008-02-26 Alan Modra <amodra@bigpond.net.au>
1543
1544 * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed
1545 for R_PPC_REL32 syms. Don't set non_got_ref on branch reloc syms,
1546 and assume branch relocs are not dynamic when non-shared.
1547 (readonly_dynrelocs): New function, split out from..
1548 (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs.
1549 (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries,
1550 clear non_got_ref..
1551 (allocate_dynrelocs): ..and don't set u.def for undefined weak.
1552 Do allow dynamic relocs on undefined symbols.
1553 (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
1554 (ppc_elf_relocate_section): Mirror dynamic reloc changes in
1555 check_relocs.
1556 (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak
1557 plt symbols needing pointer_equality_needed.
1558
1559 2008-02-23 Alan Modra <amodra@bigpond.net.au>
1560
1561 * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
1562
1563 2008-02-23 Alan Modra <amodra@bigpond.net.au>
1564
1565 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy
1566 pointer_equality_needed.
1567 (ppc_elf_check_relocs): Split out non-branch relocs from others
1568 that might emit dynamic relocs. Set pointer_equality_needed
1569 for their symbols. Don't set non_got_ref on branch reloc symbols.
1570 (ppc_elf_hash_symbol): New function.
1571 (elf_backend_hash_symbol): Define.
1572 (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed.
1573 Error if pointer_equality_needed on weak plt symbol.
1574
1575 2008-02-22 H.J. Lu <hongjiu.lu@intel.com>
1576
1577 PR ld/5788
1578 * elflink.c (elf_create_symbuf): Correct buffer size and
1579 position.
1580
1581 2008-02-22 Nick Clifton <nickc@redhat.com>
1582
1583 PR 868
1584 * dwarf2.c: Revert previous patch. All of the allocate memory is
1585 on an obstack which will be freed at some other time.
1586
1587 2008-02-20 Nick Clifton <nickc@redhat.com>
1588
1589 PR 868
1590 * libbfd.c (bfd_realloc_or_free): New function. Performs like
1591 bfd_realloc, but if the (re)allocation fails, the pointer is
1592 freed.
1593 * libbfd-in.h: Prototype.
1594 * libbfd.h: Regenerate.
1595 * bfdio.c (bfd_bwrite): Use the new function.
1596 (bfd_seek): Likewise.
1597 * bfdwin.c:(bfd_get_file_window): Likewise.
1598 * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
1599 * elf32-ppc.c (ppc_elf_relax_section): Likewise.
1600 * elf32-xtensa.c (vsprintf_msg): Likewise.
1601 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1602 * stabs.c (_bfd_link_seciton_stabs): Likewise.
1603 * vms-misc.c (_bfd_vms_get_record): Likewise.
1604 * vms-tir.c (check_section): Likewise.
1605 * vms.c (vms_new_section_hook): Likewise.
1606 * elf32-arm.c (elf32_arm_section_map_add): Check that the
1607 allocation of sec_data->map succeeded before using it.
1608 * elflink.c (elf_link_output_sym): Do not overwrite finfo->
1609 symshndxbuf until it is known that the reallocation succeeded.
1610
1611 2008-02-20 Diogo de Carvalho Kraemer <diogo@kraemer.eng.br>
1612 Nick Clifton <nickc@redhat.com>
1613
1614 PR 868
1615 * dwarf2.c (read_abbrevs): Free the abbreviation table if we run
1616 out of memory.
1617 (decode_line_info): Free the line_info_table before returning a
1618 failure result.
1619 (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
1620 Free the line table. Free the function table. Free the variable
1621 table.
1622
1623 2008-02-17 Mark Kettenis <kettenis@gnu.org>
1624
1625 * elf.c (swap_out_syms): Avoid preprocessing directive within
1626 macro arg.
1627
1628 2008-02-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1629
1630 * elf.c (assign_file_positions_for_load_sections): Set the type of
1631 PT_NOTE sections to SHT_NOTE.
1632
1633 2008-02-17 Ulrich Weigand <uweigand@de.ibm.com>
1634
1635 * simple.c (bfd_simple_get_relocated_section_contents): Set
1636 link_info.output_bfd.
1637
1638 2008-02-16 Nathan Sidwell <nathan@codesourcery.com>
1639
1640 * dwarf2.c (find_line): Don't trust debug information after an
1641 unparseable compilation unit.
1642
1643 2008-02-15 Alan Modra <amodra@bigpond.net.au>
1644
1645 PR 5765
1646 * section.c (SEC_LINK_DUPLICATES): Correct. Renumber following flags.
1647 * bfd-in2.h: Regenerate.
1648
1649 2008-02-15 Alan Modra <amodra@bigpond.net.au>
1650
1651 * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA.
1652 * elf.c (bfd_elf_allocate_object): Don't check for already allocated
1653 tdata.
1654 * elf32-hppa.c (elf32_hppa_mkobject): New function.
1655 (bfd_elf32_mkobject): Define.
1656 * elf32-ppc.c (is_ppc_elf_target): Delete. Replace all uses with..
1657 (is_ppc_elf): ..this new macro.
1658 * elf64-ppc.c (is_ppc64_elf_target): Delete. Replace all uses with..
1659 (is_ppc64_elf): ..this new macro.
1660
1661 2008-02-15 Alan Modra <amodra@bigpond.net.au>
1662
1663 * elflink.c: Replace all accesses to hash->creator field with
1664 output_bfd->xvec.
1665 * cofflink.c: Likewise.
1666 * coff-h8300.c: Likewise.
1667 * ecoff.c: Likewise.
1668 * elf32-m68hc1x.c: Likewise.
1669 * elf32-ppc.c: Likewise.
1670 * elf64-alpha.c: Likewise.
1671 * elf64-ppc.c: Likewise.
1672 * elf64-sparc.c: Likewise.
1673 * elfxx-mips.c: Likewise.
1674 * i386linux.c: Likewise.
1675 * m68klinux.c: Likewise.
1676 * sparclinux.c: Likewise.
1677 * sunos.c: Likewise.
1678 * xcofflink.c: Likewise.
1679 * linker.c: Likewise.
1680 (_bfd_link_hash_table_init): Don't store creator.
1681
1682 2008-02-14 Peter Jones <pjones@redhat.com>
1683
1684 * efi-rtdrv-ia32.c: New file.
1685 * efi-bsdrv-ia32.c: New file.
1686 * efi-rtdrv-ia64.c: New file.
1687 * efi-bsdrv-ia64.c: New file.
1688 * efi-rtdrv-x86_64.c: New file.
1689 * efi-bsdrv-x86_64.c: New file.
1690 * peicode.h (pe_bfd_object_p): Add support for boot service and
1691 runtime service drivers.
1692 * libpei.h: Add macros for EFI formats, and rename the efi application
1693 format macros to disambiguate.
1694 * targets.c: Add bfd_target _vec externs.
1695 (_bfd_tar): Add EFI _vec entries.
1696 * config.bfd: Add EFI vectors into the selection routines.
1697 * configure.in: add EFI _vec entries.
1698 * configure: Regenerate.
1699 * Makefile.am: Add EFI files.
1700 * Makefile.in: Regenerate.
1701
1702 2008-02-14 Nathan Sidwell <nathan@codesourcery.com>
1703
1704 * dwarf1.c (struct dwarf1_debug): Add syms member.
1705 (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory.
1706 (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate
1707 section contents, check for out of memory.
1708
1709 * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte.
1710 (parse_die): Change data pointers to bfd_byte.
1711 (parse_line_table, parse_functions_in_unit): Likewise.
1712
1713 2008-02-14 Alan Modra <amodra@bigpond.net.au>
1714
1715 * elflink.c (compute_bucket_count): Warning fixes.
1716
1717 2008-02-12 DJ Delorie <dj@redhat.com>
1718
1719 * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of
1720 relocation pointing to local symbol in merged section.
1721
1722 * elf32-iq2000.c (iq2000_elf_relocate_offset16): New.
1723 (iq2000_elf_relocate_section): Call it.
1724
1725 2008-02-12 Nick Clifton <nickc@redhat.com>
1726
1727 PR ld/5692
1728 * elf-bfd.h (enum elf_object_id): New enum, used to identify
1729 target specific extensions to the elf_obj_tdata structure.
1730 (struct elf_obj_tdata): New field 'object_id'.
1731 (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
1732 macros for accessing fields in the elf_obj_tdata structure.
1733 (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
1734 (bfd_elf_allocate_object): New function.
1735 * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
1736 and implement by calling bfd_elf_allocate_object.
1737 (bfd_elf_allocate_object): New function: Allocates an
1738 elf_obj_tdata structure, possibly with a target specific
1739 extension.
1740 * elfxx-target.h (bfd_elfNN_mkobject): Use
1741 bfd_elf_make_generic_object as the default value.
1742 * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
1743 for consistency with other, similar structures.
1744 (is_arm_elf): New macro. Checks a BFD to make sure that is an ARM
1745 ELF bfd.
1746 (elf32_arm_mkobject): Call bfd_elf_allocate_object.
1747 (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
1748 the bfd being processed.
1749 (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1750 (bfd_elf32_arm_set_target_relocs): Likewise.
1751 (bfd_elf32_arm_final_link_relocate): Likewise.
1752 (bfd_elf32_arm_copy_private_bfd_data): Likewise.
1753 (bfd_elf32_arm_merge_eabi_attributes): Likewise.
1754 (bfd_elf32_arm_merge_private_bfd_data): Likewise.
1755 (bfd_elf32_arm_check_relocs): Likewise.
1756 (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
1757 (bfd_elf32_arm_size_dynamic_sections): Likewise.
1758 (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
1759 (bfd_elf32_arm_init_maps): Likewise.
1760 (bfd_elf32_arm_final_link_relocate): Likewise.
1761 (bfd_elf32_arm_relocate_section): Likewise.
1762 (bfd_elf32_arm_gc_sweep_hook): Likewise.
1763 (bfd_elf32_arm_check_relocs): Likewise.
1764 (bfd_elf32_arm_size_dynamic_sections): Likewise.
1765 * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
1766 (is_i386_elf): New macro. Checks a BFD to make sure that is an x86
1767 ELF bfd.
1768 (elf_i386_check_relocs): Use is_i386_elf macro to check the bfd
1769 being processed.
1770 (elf_i386_size_dynamic_sections): Likewise.
1771 (elf_i386_relocate_section): Likewise.
1772 (elf_i386_check_relocs): Use elf_symtab_hdr.
1773 (elf_i386_gc_sweep_hook): Likewise.
1774 (elf_i386_size_dynamic_sections): Likewise.
1775 (elf_i386_relocate_section): Likewise.
1776 * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
1777 (elf_create_pointer_linker_section): Use is_ppc_elf_target to
1778 verify that the bfd before accessing target specific fields.
1779 (ppc_elf_check_relocs): Likewise.
1780 (elf_finish_pointer_linker_section): Likewise.
1781 (elf_create_pointer_linker_section): Use elf_symtab_hdr.
1782 (ppc_elf_check_relocs): Likewise.
1783 (ppc_elf_gc_sweep_hook): Likewise.
1784 (ppc_elf_tls_optimize): Likewise.
1785 (ppc_elf_size_dynamic_sections): Likewise.
1786 (ppc_elf_relax_section): Likewise.
1787 (ppc_elf_relocate_section): Likewise.
1788 * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
1789 reminding programmers to keep this structure in sync with the one
1790 defined in elf64-s390.c.
1791 (elf_s390_mkobject): Call bfd_elf_allocate_object.
1792 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
1793 ELF bfd.
1794 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
1795 being processed.
1796 (elf_s390_size_dynamic_sections): Likewise.
1797 (elf_s390_relocate_section): Likewise.
1798 (elf_s390_check_relocs): Use elf_symtab_hdr.
1799 (elf_s390_gc_sweep_hook): Likewise.
1800 (elf_s390_size_dynamic_sections): Likewise.
1801 (elf_s390_relocate_section): Likewise.
1802 * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
1803 (is_sh_elf): New macro. Checks a BFD to make sure that is an SH
1804 ELF bfd.
1805 (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
1806 bfd being processed.
1807 (sh_elf_relocate_section): Likewise.
1808 (sh_elf_check_relocs): Likewise.
1809 (sh_elf_copy_private_data): Likewise.
1810 (sh_elf_relax_section): Use elf_symtab_hdr.
1811 (sh_elf_size_dynamic_sections): Likewise.
1812 (sh_elf_relocate_section): Likewise.
1813 (sh_elf_get_relocated_section_contents): Likewise.
1814 (sh_elf_gc_sweep_hook): Likewise.
1815 (sh_elf_check_relocs): Likewise.
1816 * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
1817 (is_alpha_elf): New macro. Checks a BFD to make sure that is an
1818 Alpha ELF bfd.
1819 (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
1820 the bfd being processed.
1821 (elf64_alpha_create_dynamic_section): Likewise.
1822 (elf64_alpha_check_relocs): Likewise.
1823 (elf64_alpha_size_got_sections): Likewise.
1824 (elf64_alpha_relax_section): Likewise.
1825 (elf64_alpha_relocate_section): Likewise.
1826 (elf64_alpha_final_link): Likewise.
1827 (elf64_alpha_check_relocs): Use elf_symtab_hdr.
1828 (elf64_alpha_relax_section): Likewise.
1829 (elf64_alpha_relocate_section_r): Likewise.
1830 (elf64_alpha_relocate_section): Likewise.
1831 * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
1832 (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
1833 being processed.
1834 (opd_entry_value): Likewise.
1835 (allocate_dynrelocs): Likewise.
1836 (ppc64_elf_relocate_section): Likewise.
1837 (ppc64_elf_check_relocs): Use elf_symtab_hdr.
1838 (opd_entry_value): Likewise.
1839 (ppc64_elf_gc_sweep_hook): Likewise.
1840 (get_sym_h): Likewise.
1841 (ppc64_elf_edit_opd): Likewise.
1842 (ppc64_elf_tls_optimize): Likewise.
1843 (ppc64_elf_edit_toc): Likewise.
1844 (ppc64_elf_size_dynamic_sections): Likewise.
1845 (toc_adjusting_stub_needed): Likewise.
1846 (ppc64_elf_size_stubs): Likewise.
1847 (ppc64_elf_relocate_section): Likewise.
1848 * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
1849 reminding programmers to keep this structure in sync with the one
1850 defined in elf32-s390.c.
1851 (elf_s390_mkobject): Call bfd_elf_allocate_object.
1852 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
1853 ELF bfd.
1854 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
1855 being processed.
1856 (elf_s390_size_dynamic_sections): Likewise.
1857 (elf_s390_relocate_section): Likewise.
1858 (elf_s390_check_relocs): Use elf_symtab_hdr.
1859 (elf_s390_gc_sweep_hook): Likewise.
1860 (elf_s390_size_dynamic_sections): Likewise.
1861 (elf_s390_relocate_section): Likewise.
1862 * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
1863 (is_x86_64_elf): New macro. Checks a BFD to make sure that is an
1864 x86_64 ELF bfd.
1865 (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
1866 being processed.
1867 (elf64_x86_64_size_dynamic_sections): Likewise.
1868 (elf64_x86_64_relocate_section): Likewise.
1869 (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
1870 (elf64_x86_64_gc_sweep_hook): Likewise.
1871 (elf64_x86_64_size_dynamic_sections): Likewise.
1872 (elf64_x86_64_relocate_section): Likewise.
1873 * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
1874 (is_sparc_elf): New macro. Checks a BFD to make sure that is a Sparc
1875 ELF bfd.
1876 (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
1877 bfd being processed.
1878 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1879 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1880 (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
1881 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1882 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1883 (_bfd_sparc_elf_relocate_section): Likewise.
1884
1885 2008-02-12 Alan Modra <amodra@bigpond.net.au>
1886
1887 PR 5303, 5755
1888 * arange-set.c: Delete.
1889 * arange-set.h: Delete.
1890 * dwarf2.c: Revert 2007-09-21 changes.
1891 * Makefile.am: Likewise.
1892 * Makefile.in: Regenerate.
1893 * po/SRC-POTFILES.in: Regenerate.
1894
1895 2008-02-11 Bernd Schmidt <bernd.schmidt@analog.com>
1896
1897 * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
1898 if necessary.
1899 (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
1900 mismatches are detected.
1901
1902 * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
1903 emit invalid relocs or rofixup entries for deleted .eh_frame entries.
1904
1905 2008-02-11 Daniel Jacobowitz <dan@codesourcery.com>
1906
1907 * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
1908 was reached.
1909 * srec.c (srec_scan): Calculate the checksum. Complain on mismatch.
1910
1911 2008-02-07 Alan Modra <amodra@bigpond.net.au>
1912
1913 * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
1914 of _ovly_buf_table size.
1915 (spu_elf_build_stubs): Use low bit of .size as "present" bit.
1916 Adjust initialisations relating to _ovly_buf_table.
1917
1918 2008-02-04 Bob Wilson <bob.wilson@acm.org>
1919
1920 * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
1921 relocation, do not continue processing it. Ignore R_XTENSA_ASM_EXPAND
1922 relocations against dynamic symbols.
1923 (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
1924 .xt.lit section.
1925
1926 2008-02-04 Kai Tietz <kai.tietz@onevision.com>
1927 H.J. Lu <hongjiu.lu@intel.com>
1928
1929 PR 5715
1930 * warning.m4: Enable -Wno-format by default when using gcc on
1931 mingw.
1932 * configure: Regenerated.
1933
1934 2008-02-04 Adam Nemet <anemet@caviumnetworks.com>
1935
1936 * archures.c: Update copyright.
1937 (bfd_mach_mips_octeon): New macro.
1938 * bfd-in2.h: Regenerate.
1939 * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
1940 (mips_set_isa_flags): Likewise.
1941 (mips_mach_extensions): Add Octeon.
1942 * cpu-mips.c: Update copyright.
1943 (I_mipsocteon): New enum constant.
1944 (arch_info_struct): Add Octeon.
1945
1946 2008-02-04 Alan Modra <amodra@bigpond.net.au>
1947
1948 * elf32-spu.c (spu_elf_relocate_section): Correct return type.
1949 Return error status on unexpected relocation errors.
1950
1951 2008-02-04 Alan Modra <amodra@bigpond.net.au>
1952
1953 PR ld/5692
1954 * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31. Instead abort
1955 on non-ELF input.
1956 * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
1957 processing on non-ELF input.
1958
1959 2008-01-31 Marc Gauthier <marc@tensilica.com>
1960
1961 * config.bfd (xtensa*-*-*): Recognize processor variants.
1962
1963 2008-01-31 Nick Clifton <nickc@redhat.com>
1964
1965 PR ld/5692
1966 * elf.c (bfd_elf_get_elf_syms): Check the return value of
1967 get_elf_backend_data.
1968
1969 2008-01-28 Fabian Groffen <grobian@gentoo.org>
1970
1971 * config.bfd (x86_64-*-solaris2): Add support for this target.
1972
1973 2008-01-28 Alan Modra <amodra@bigpond.net.au>
1974
1975 Rewrite SPU overlay handling code. Put overlay calls stubs in the
1976 overlays where possible. Use a faster call stub, or optionally at
1977 compile time, a more compact stub. Double size of _ovly_buf_table
1978 so that low bit of _ovly_table.buf can be used as a "present" bit.
1979 Reserve an extra _ovly_table entry for index zero.
1980 * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
1981 add new ones.
1982 (struct got_entry): New.
1983 (struct spu_stub_hash_entry): Delete.
1984 (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
1985 (spu_elf_link_hash_table_create): Adjust for struct changes.
1986 (spu_stub_name): Delete.
1987 (spu_elf_find_overlays): Don't track sections from overlay regions.
1988 Instead set ovl_buf number in spu elf section data. Error if
1989 overlays in one region don't start at the same address. Adjust
1990 for struct _spu_elf_section_data changes.
1991 (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
1992 (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
1993 (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
1994 (enum _insn_type): New.
1995 (count_stub, build_stub): New functions.
1996 (allocate_spuear_stubs): Use count_stub.
1997 (build_spuear_stubs): Use build_stub.
1998 (populate_stubs, sort_stubs): Delete.
1999 (process_stubs): New function.
2000 (write_one_stub): Delete.
2001 (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
2002 (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
2003 (maybe_insert_function, check_function_ranges): Likewise.
2004 (find_function, pasted_function, build_call_tree): Likewise.
2005 (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
2006 (spu_elf_modify_program_headers): Likewise.
2007 (interesting_section): Detect stub sections differently. Delete
2008 htab param, adjust all callers.
2009 (spu_elf_relocate_section): Rewrite stub handling.
2010 (spu_elf_output_symbol_hook): Likewise.
2011 (bfd_elf32_bfd_link_hash_table_free): Delete.
2012 * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
2013 output-only fields into a union. Add ovl_buf.
2014 (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
2015
2016 2008-01-25 DJ Delorie <dj@redhat.com>
2017
2018 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
2019
2020 2008-01-25 Kai Tietz <kai.tietz@onevision.com>
2021
2022 * bfd-in.h: Add mingw I64 support.
2023 * bfd-in2.h: Regenerated.
2024 * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
2025
2026 2008-01-21 Alan Modra <amodra@bigpond.net.au>
2027
2028 PR 4453
2029 * format.c (bfd_check_format_matches): Don't accept archives as
2030 fully matching unless they have a map.
2031
2032 2008-01-21 Alan Modra <amodra@bigpond.net.au>
2033
2034 * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
2035
2036 2008-01-21 Alan Modra <amodra@bigpond.net.au>
2037
2038 * ecoff.c (_bfd_ecoff_archive_p): Delete.
2039 * libecoff.h (_bfd_ecoff_archive_p): Delete.
2040 * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
2041 * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
2042 (ecoff_biglittle_vec): Likewise.
2043
2044 2008-01-19 Alan Modra <amodra@bigpond.net.au>
2045
2046 PR 5646
2047 * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
2048 non-NULL before dereferencing.
2049
2050 2008-01-15 Alan Modra <amodra@bigpond.net.au>
2051
2052 PR 5604
2053 * elf-bfd.h (struct elf_backend_data): Add gc_keep. Remove param
2054 names from others.
2055 (_bfd_elf_gc_keep): Declare.
2056 * elfxx-target.h (elf_backend_gc_keep): Define.
2057 (elfNN_bed): Init new field.
2058 * elflink.c (_bfd_elf_gc_keep): New function.
2059 (bfd_elf_gc_sections): Call gc_keep.
2060 * elf64-ppc.c (elf_backend_gc_keep): Define.
2061 (struct _ppc64_elf_section_data): Move .opd related fields to
2062 a struct so they don't occupy the same storage. Adjust accesses
2063 throughout file.
2064 (ppc64_elf_gc_keep): New function, split out from..
2065 (ppc64_elf_gc_mark_hook): ..here. Don't call _bfd_elf_gc_mark
2066 to mark .opd section, just set gc_mark.
2067 (ppc64_elf_edit_opd): Remove no_opd_opt parm. Don't set opd->adjust
2068 unless we are changing .opd. Test non-NULL opd->adjust at all
2069 accesses throughout file.
2070 * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
2071
2072 2008-01-15 Alan Modra <amodra@bigpond.net.au>
2073
2074 * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
2075 * bfd-in2.h: Regenerate.
2076
2077 2008-01-11 Tristan Gingold <gingold@adacore.com>
2078 Eric Botcazou <ebotcazou@adacore.com>
2079
2080 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
2081 relocatable.
2082 * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
2083 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
2084 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
2085 * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
2086 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
2087 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
2088 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
2089 * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
2090 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
2091 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
2092 * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
2093 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
2094 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
2095 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
2096 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
2097 * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
2098 or executable output with relocations.
2099
2100 2008-01-09 Nick Clifton <nickc@redhat.com>
2101
2102 PR gas/5552
2103 * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
2104 to FALSE for all relocs.
2105
2106 2008-01-09 Richard Sandiford <rsandifo@nildram.co.uk>
2107
2108 PR ld/5526
2109 * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
2110 fields. Rename u.cie.u.merged to u.cie.u.merged_with.
2111 (eh_frame_sec_info): Add a cies field.
2112 (eh_frame_hdr_info): Add a merge_cies field.
2113 * elf-eh-frame.c (cie): Add a reloc_index member to the personality
2114 union.
2115 (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
2116 of hdr_info->cies.
2117 (_bfd_elf_parse_eh_frame): Remove tmp_cie. Ccreate an array of
2118 cie structures in all cases and use it instead of extended_cies.
2119 If merging, store the cie array in sec_info->cies and point each
2120 CIE's eh_fde_cie at the associated element. Do not try to
2121 calculate the value of the personality routine here; record the
2122 offset of the relocation instead. Do not merge CIEs here.
2123 (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
2124 (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
2125 (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
2126 (find_merged_cie): New function.
2127 (_bfd_elf_gc_mark_fdes): Use it. Free sec_info->cies.
2128
2129 2008-01-07 Nick Clifton <nickc@redhat.com>
2130
2131 PR binutils/5535
2132 * vms.c (vms_close_and_cleanup): Check for the presence of a
2133 vms_private_data_struct before examining any of its fields.
2134
2135 2008-01-07 H.J. Lu <hongjiu.lu@intel.com>
2136
2137 PR ld/5522
2138 * elflink.c (elf_link_input_bfd): Don't write out a section if
2139 its output section is marked with SEC_NEVER_LOAD.
2140
2141 For older changes see ChangeLog-2007
2142 \f
2143 Local Variables:
2144 mode: change-log
2145 left-margin: 8
2146 fill-column: 74
2147 version-control: never
2148 End:
This page took 0.075094 seconds and 4 git commands to generate.