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