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