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