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