Also track weak references
[binutils-gdb.git] / bfd / ChangeLog
1 2013-02-16 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR ld/15149
4 * elflink.c (elf_link_add_object_symbols): Also track weak
5 references.
6
7 2013-02-15 H.J. Lu <hongjiu.lu@intel.com>
8
9 PR binutils/15151
10 * archive.c (_bfd_find_nested_archive): Don't allow a nested
11 archive pointing to itself.
12 (_bfd_get_elt_at_filepos): Revert the last 2 changes.
13
14 2013-02-15 Nick Clifton <nickc@redhat.com>
15
16 PR binutils/15140
17 * archive.c (_bfd_get_elt_at_filepos): Prevent an infinite loop
18 accessing a corrupt nested archive.
19
20 2013-02-13 Richard Sandiford <rdsandiford@googlemail.com>
21
22 * elfxx-mips.c (mips_got_page_ref): New structure.
23 (mips_got_page_entry): Use a section rather than a (bfd, symndx)
24 pair to represent the anchor point.
25 (mips_got_info): Add a got_page_refs field.
26 (mips_elf_link_hash_table): Add a sym_cache field.
27 (mips_got_page_ref_hash, mips_got_page_ref_eq): New functions.
28 (mips_got_page_entry_hash, mips_got_page_entry_eq): Update for
29 new anchor representation.
30 (mips_elf_create_got_info): Create got_page_refs rather than
31 got_page_entries.
32 (mips_elf_record_got_page_ref): New function.
33 (mips_elf_pages_for_range): Move further down file.
34 (mips_elf_record_got_page_entry): Likewise. Take a got as argument.
35 Use a section rather than a (bfd, symndx) pair to represent the
36 anchor point.
37 (mips_elf_resolve_got_page_ref): New function.
38 (mips_elf_resolve_final_got_entries): Use it to populate
39 got_page_entries.
40 (_bfd_mips_elf_check_relocs): Call mips_elf_record_got_page_ref
41 rather than mips_elf_record_got_page_entry. Only nullify h
42 afterwards.
43 (mips_elf_lay_out_got): Call mips_elf_resolve_final_got_entries
44 earlier.
45
46 2013-02-12 Richard Sandiford <rdsandiford@googlemail.com>
47
48 * elfxx-mips.c (mips_elf_lay_out_got): Count VxWorks GOT relocs
49 in g->relocs.
50
51 2013-02-12 Alan Modra <amodra@gmail.com>
52
53 * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Provide
54 suitable definition when using generic linker hash table.
55
56 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
57
58 * elfxx-mips.c (mips_elf_count_got_entries): Delete.
59 (mips_elf_check_recreate_got, mips_elf_recreate_got): Take a
60 mips_elf_traverse_got_arg. Count GOT entries.
61 (mips_elf_resolve_final_got_entries): Take the bfd_link_info
62 as argument. Update after above changes.
63 (mips_elf_merge_got, mips_elf_lay_out_got): Don't call
64 mips_elf_count_got_entries. Update the calls to
65 mips_elf_resolve_final_got_entries.
66
67 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
68
69 * elfxx-mips.c (mips_got_tls_type): New enum.
70 (mips_got_entry): Add tls_initialized.
71 (mips_elf_got_entry_hash, mips_elf_got_entry_eq, mips_tls_got_relocs)
72 (mips_elf_count_got_entry, mips_elf_initialize_tls_index): Remove
73 GOT_TLS_TYPE masks.
74 (mips_elf_reloc_tls_type, mips_tls_got_entries)
75 (mips_elf_record_global_got_symbol, mips_elf_initialize_tls_index)
76 (_bfd_mips_elf_finish_dynamic_symbol): Use GOT_TLS_NONE rather
77 than GOT_NORMAL.
78 (mips_elf_initialize_tls_slots): Replace got_offset and tls_type_p
79 arguments with a GOT entry. Remove GOT_TLS_TYPE masks. Use
80 tls_initialized rather than GOT_TLS_DONE.
81 (mips_tls_got_index): Delete.
82 (mips_elf_local_got_index, mips_elf_global_got_index): Use
83 mips_elf_initialize_tls_slots rather than mips_tls_got_index.
84 (mips_elf_record_got_entry): Initialize tls_initialized.
85
86 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
87
88 * elfxx-mips.c (mips_got_entry): Remove tls_ldm_offset.
89 (mips_elf_link_hash_entry): Remove tls_ie_type, tls_gd_type,
90 tls_ie_got_offset and tls_gd_got_offset.
91 (mips_elf_link_hash_newfunc): Remove initialization.
92 (mips_elf_create_got_info): Likewise.
93 (mips_elf_count_local_got_entries, mips_elf_count_global_tls_entries)
94 (mips_tls_single_got_index): Delete.
95 (mips_elf_local_got_index): Always use the GOT entry to track
96 GOT indices.
97 (mips_elf_global_got_index): Likewise.
98 (mips_elf_create_local_got_entry): Assert that TLS entries have
99 already been allocated.
100 (mips_elf_record_global_got_symbol): Don't initialize
101 tls_ie_type or tls_gd_type.
102 (mips_elf_count_got_symbols): Only count reloc-only GOT entries here.
103 (mips_elf_initialize_tls_index): Allocate a GOT index for every TLS
104 entry.
105 (mips_elf_lay_out_got): Use mips_elf_count_got_entries to count
106 the GOT entries.
107 (_bfd_mips_elf_finish_dynamic_symbol): Assert that TLS GOT offsets
108 have been allocated.
109 (_bfd_mips_elf_copy_indirect_symbol): Remove handling of
110 tls_ie_type and tls_gd_type.
111
112 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
113
114 * elfxx-mips.c (mips_elf_create_local_got_entry): Tidy. Avoid
115 aliasing violation. Check for htab allocation failures.
116
117 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
118
119 * elfxx-mips.c (mips_elf_primary_global_got_index): New function,
120 split out from...
121 (mips_elf_global_got_index): ...here. Reorder arguments so that
122 the output bfd and info come first.
123 (mips_elf_calculate_relocation): Update the call to
124 mips_elf_global_got_index accordingly.
125 (_bfd_mips_elf_finish_dynamic_symbol): Use
126 mips_elf_primary_global_got_index rather than
127 mips_elf_global_got_index.
128 (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
129
130 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
131
132 * elfxx-mips.c (mips_got_entry): Update comments.
133 (mips_elf_multi_got_entry_eq): Rename to...
134 (mips_elf_got_entry_eq): ...this, deleting the old definition.
135 (mips_elf_create_got_info): Remove master_got_p argument.
136 Always use mips_elf_got_entry_eq.
137 (mips_elf_bfd_got, mips_elf_multi_got, mips_elf_create_got_section):
138 Update calls accordingly.
139
140 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
141
142 * elfxx-mips.c (mips_got_info): Remove bfd2got.
143 (mips_elf_bfd2got_hash): Delete.
144 (mips_elf_got_per_bfd_arg): Remove bfd2got.
145 (mips_elf_replace_bfd_got, mips_elf_count_got_entries): New functions.
146 (mips_elf_global_got_index, mips_elf_create_local_got_entry): Use
147 g->next to test for the multigot case. Use mips_elf_bfd_got rather
148 than mips_elf_got_for_ibfd.
149 (mips_elf_bfd2got_entry_hash, mips_elf_bfd2got_entry_eq)
150 (mips_elf_got_for_ibfd, mips_elf_get_got_for_bfd): Delete.
151 (mips_elf_make_got_per_bfd): Replace with...
152 (mips_elf_add_got_entry): ...this new function.
153 (mips_elf_make_got_pages_per_bfd): Replace with...
154 (mips_elf_add_got_page_entry): ...this new function.
155 (mips_elf_merge_got_with): Replace bfd2got argument with separate
156 bfd and GOT arguments. Use mips_elf_add_got_entry and
157 mips_elf_add_got_page_entry instead of mips_elf_make_got_per_bfd
158 and mips_elf_make_got_pages_per_bfd. Use mips_elf_replace_bfd_got
159 to set the BFD's GOT and free the old table.
160 (mips_elf_merge_got): Replace bfd2got argument with separate
161 bfd and GOT arguments. Apply mips_elf_resolve_final_got_entries.
162 Use mips_elf_count_got_entries to count the number of entries in
163 each GOT. Update the calls to mips_elf_merge_got_with.
164 (mips_elf_adjust_gp): Use g->next to test for the multigot case.
165 Use mips_elf_bfd_got rather than mips_elf_got_for_ibfd.
166 (mips_elf_multi_got): Don't create the bfd2got hash table.
167 Replace hash table traversal with a walk over the input bfds,
168 updating the call to mips_elf_merge_got. Use mips_elf_replace_bfd_got
169 to set the output bfd's GOT.
170 (mips_elf_lay_out_got): Rename "sub" to "ibfd". Record that all
171 bfds use the master GOT in the single-GOT case.
172 (_bfd_mips_elf_finish_dynamic_sections): Use mips_elf_bfd_got
173 rather than mips_elf_got_for_ibfd.
174
175 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
176
177 * elfxx-mips.c (mips_elf_obj_tdata): Add a got field.
178 (mips_elf_bfd_got, mips_elf_record_got_entry): New functions.
179 (mips_elf_record_global_got_symbol): Update the hash entry before
180 adding the mips_got_entry. Use mips_elf_record_got_entry to do
181 the latter.
182 (mips_elf_record_local_got_symbol): Use mips_elf_record_got_entry.
183 (mips_elf_record_got_page_entry): Record the entry in both the
184 master and bfd GOTs.
185
186 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
187
188 * elfxx-mips.c (mips_elf_recreate_got): Don't change the entry;
189 create another one if necessary.
190 (mips_elf_set_gotidx): New function.
191 (mips_elf_set_global_gotidx): Use it.
192 (mips_elf_initialize_tls_index): Likewise. Take a
193 mips_elf_traverse_got_arg as argument.
194 (mips_elf_lay_out_got): Update use of mips_elf_initialize_tls_index.
195 (mips_elf_multi_got): Likewise. Cope with error returns from
196 mips_elf_set_global_gotidx.
197
198 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
199
200 * elfxx-mips.c (mips_got_info): Add relocs field.
201 (mips_elf_set_global_got_offset_arg, mips_elf_count_tls_arg): Replace
202 with...
203 (mips_elf_traverse_got_arg): ...this new structure.
204 (mips_elf_count_local_tls_relocs): Delete.
205 (mips_elf_count_global_tls_relocs): Likewise.
206 (mips_elf_count_got_entry): New function.
207 (mips_elf_count_local_got_entries): Likewise.
208 (mips_elf_count_global_tls_entries): Take a mips_elf_traverse_got_arg
209 rather than a mips_elf_count_tls_arg. Count both relocs and entries.
210 (mips_elf_record_local_got_symbol): Don't count got entries here.
211 (mips_elf_make_got_per_bfd): Use mips_elf_count_got_entry.
212 (mips_elf_set_global_got_offset): Split into...
213 (mips_elf_set_global_got_area, mips_elf_set_global_gotidx): ...these
214 new functions. Take a mips_elf_traverse_got_arg rather than a
215 mips_elf_set_global_got_offset_arg. Don't count TLS relocs here.
216 Use g->relocs to record the number of relocs needed for global GOT
217 entries.
218 (mips_elf_multi_got): Use mips_elf_traverse_got_arg rather than
219 mips_elf_set_global_got_offset_arg. Use the relocs field to count
220 relocations. Update for above function split.
221 (mips_elf_lay_out_got): Use mips_elf_count_local_got_entries
222 to count both the number of GOT entries and the number of TLS
223 relocs required by local entries. Likewise
224 mips_elf_count_global_tls_entries and global entries.
225 Remove uses of mips_elf_count_local_tls_relocs and
226 mips_elf_count_global_tls_relocs.
227
228 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
229
230 * elfxx-mips.c (mips_got_entry): Update comment above tls_type entry
231 to say that each structure represents only one type of TLS reference.
232 (GOT_TLS_TYPE): New define.
233 (mips_elf_link_hash_entry): Temporarily split tls_type and
234 tls_got_offset into two variables each.
235 (mips_elf_link_hash_newfunc): Update accordingly.
236 (mips_elf_got_entry_eq, mips_elf_got_entry_hash)
237 (mips_elf_multi_got_entry_eq): Require the tls_type to be the same.
238 (mips_elf_reloc_tls_type, mips_tls_got_entries): New functions.
239 (mips_tls_got_relocs): Use a switch statement.
240 (mips_elf_count_global_tls_entries): Handle the new hash entry fields.
241 (mips_elf_initialize_tls_slots): Use a switch statement. Avoid
242 local "offset" variable.
243 (mips_tls_got_index): Remove r_type argument and assert. Remove
244 code that handled entries with two TLS types; always use the
245 original got_index instead.
246 (mips_tls_single_got_index): New function.
247 (mips_elf_local_got_index): Use entry->tls_type to check for
248 TLS entries. Use mips_tls_single_got_index. Update call to
249 mips_tls_got_index.
250 (mips_elf_global_got_index): Use mips_elf_reloc_tls_type.
251 Use p->tls_type to check for TLS entries. Update call to
252 mips_tls_got_index. Use mips_tls_single_got_index.
253 (mips_elf_create_local_got_entry): Use mips_elf_reloc_tls_type.
254 Use entry.tls_type to check for TLS entries.
255 (mips_elf_record_global_got_symbol): Replace tls_flag argument
256 with r_type argument. Use mips_elf_reloc_tls_type.
257 Set up the new hash entry fields.
258 (mips_elf_record_local_got_symbol): Replace tls_flag argument
259 with r_type argument. Use mips_elf_reloc_tls_type and
260 mips_tls_got_entries. Remove code that handled entries
261 with multiple TLS types.
262 (mips_elf_make_got_per_bfd): Use mips_tls_got_entries.
263 (mips_elf_initialize_tls_index): Handle new hash entry fields.
264 Use equality rather than masks when checking for specific TLS types.
265 Use mips_tls_got_entries. Remove code that handled entries
266 with multiple TLS types.
267 (mips_elf_calculate_relocation): Use TLS_RELOC_P instead of
268 testing the hash table entry.
269 (_bfd_mips_elf_check_relocs): Update calls to
270 mips_elf_record_global_got_symbol and mips_elf_record_local_got_symbol.
271 (_bfd_mips_elf_finish_dynamic_symbol): Don't check h->type.
272 (_bfd_mips_elf_copy_indirect_symbol): Handle new hash entry fields.
273
274 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
275
276 * elfxx-mips.c (mips_elf_multi_got_entry_hash): Rename to...
277 (mips_elf_got_entry_hash): ...this, deleting the old version.
278 (mips_elf_create_got_info): Use mips_elf_got_entry_hash for
279 both types of GOT.
280
281 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
282
283 * elfxx-mips.c (mips_elf_create_got_info): New function.
284 (mips_elf_get_got_for_bfd, mips_elf_multi_got): Use it.
285 (mips_elf_create_got_section): Likewise.
286
287 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
288
289 * elfxx-mips.c (mips_elf_record_local_got_symbol): Always set
290 gotidx to -1.
291
292 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
293
294 * elfxx-mips.c (mips_elf_multi_got): Simplify size calculation.
295
296 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
297
298 * elfxx-mips.c (mips_got_info): Move global_gotsym to...
299 (mips_elf_link_hash_table): ...here. Update rest of file accordingly.
300
301 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
302
303 * elfxx-mips.c (mips_elf_count_global_tls_entries)
304 (mips_elf_count_global_tls_relocs): Don't count indirect or
305 warning symbols.
306 (mips_elf_multi_got, mips_elf_lay_out_got): Assert that the right
307 number of TLS entries were allocated.
308
309 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
310
311 * elfxx-mips.c (mips_elf_sort_hash_table_f): Remove asserts.
312
313 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
314
315 * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count
316 if there are TLS relocations.
317
318 2013-02-11 Richard Sandiford <rdsandiford@googlemail.com>
319
320 * elfxx-mips.c (mips_elf_recreate_got): Remove free.
321 (mips_elf_resolve_final_got_entries): Remove bogus comment.
322
323 2013-02-11 Alan Modra <amodra@gmail.com>
324
325 * elfcode.h (elf_checksum_contents): Free contents.
326 * elf-bfd.h (_bfd_elf_link_hash_table_free): Declare.
327 * elflink.c (_bfd_elf_link_hash_table_free): New function.
328 (elf_final_link_free): New function, extracted from..
329 (bfd_elf_final_link): ..here. Always call
330 _bfd_elf_write_section_eh_frame_hdr.
331 * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Default to
332 _bfd_elf_link_hash_table_free.
333 * libbfd-in.h (_bfd_merge_sections_free): Declare.
334 * libbfd.h: Regenerate.
335 * merge.c (_bfd_merge_sections_free): New function.
336 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Free
337 hdr_info->array.
338 * elf-m10300.c (elf32_mn10300_link_hash_table_free): Call
339 _bfd_elf_link_hash_table_free.
340 * elf32-arm.c (elf32_arm_link_hash_table_free): Likewise.
341 * elf32-avr.c (elf32_avr_link_hash_table_free): Likewise.
342 * elf32-hppa.c (elf32_hppa_link_hash_table_free): Likewise.
343 * elf32-i386.c (elf_i386_link_hash_table_free): Likewise.
344 * elf32-m68hc1x.c (m68hc11_elf_hash_table_free): Likewise.
345 * elf32-m68k.c (elf_m68k_link_hash_table_free): Likewise.
346 * elf32-metag.c (elf_metag_link_hash_table_free): Likewise.
347 * elf32-xgate.c (xgate_elf_bfd_link_hash_table_free): Likewise.
348 * elf64-aarch64.c (elf64_aarch64_link_hash_table_free): Likewise.
349 * elf64-ia64-vms.c (elf64_ia64_hash_table_free): Likewise.
350 * elf64-ppc.c (ppc64_elf_link_hash_table_free): Likewise.
351 * elf64-x86-64.c (elf_x86_64_link_hash_table_free): Likewise.
352 * elfnn-ia64.c (elfNN_ia64_hash_table_free): Likewise.
353 * elf32-cr16.c (elf32_cr16_link_hash_table_free): Delete.
354 (bfd_elf32_bfd_link_hash_table_free): Don't define.
355 * elf32-tic6x.c (elf32_tic6x_link_hash_table_free): Delete.
356 (bfd_elf32_bfd_link_hash_table_free): Dont' define.
357
358 2013-02-10 Alan Modra <amodra@gmail.com>
359
360 * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_zmalloc.
361 * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
362 * m68klinux.c (linux_link_hash_table_create): Likewise.
363 * sparclinux.c (linux_link_hash_table_create): Likewise.
364 * sunos.c (sunos_link_hash_table_create): Likewise.
365 * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
366 * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
367 * elf32-arm.c (elf32_arm_link_hash_table_create): Likewise.
368 * elf32-avr.c (elf32_avr_link_hash_table_create): Likewise.
369 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
370 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
371 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
372 * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
373 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
374 * elf32-m32r.c (m32r_elf_link_hash_table_create): Likewise.
375 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create): Likewise.
376 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
377 * elf32-metag.c (elf_metag_link_hash_table_create): Likewise.
378 * elf32-nios2.c (nios2_elf32_link_hash_table_create): Likewise.
379 * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
380 * elf32-score.c (elf32_score_link_hash_table_create): Likewise.
381 * elf32-spu.c (spu_elf_link_hash_table_create): Likewise.
382 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create): Likewise.
383 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
384 * elf32-xgate.c (xgate_elf_bfd_link_hash_table_create): Likewise.
385 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Likewise.
386 * elf64-aarch64.c (elf64_aarch64_link_hash_table_create): Likewise.
387 * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
388 * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
389 * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Likewise.
390 * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
391 * elflink.c (_bfd_elf_link_hash_table_create): Likewise.
392 (_bfd_elf_link_hash_table_init): Assume zero fill table on entry.
393
394 2013-02-10 Alan Modra <amodra@gmail.com>
395
396 * i386linux.c (linux_link_hash_table_create): Allocate table
397 with bfd_zmalloc, not bfd_alloc.
398 * pdp11.c (link_hash_table_create): Allocate table with
399 bfd_malloc, not bfd_alloc.
400 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create): Allocate table
401 with bfd_zmalloc, not bfd_zalloc.
402 (bfin_link_hash_table_create): Likewise.
403 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
404 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
405
406 2013-02-10 Alan Modra <amodra@gmail.com>
407
408 PR ld/15113
409 * elf32-sh.c (sh_elf_link_hash_table_create): Use bfd_zmalloc.
410
411 2013-02-08 Markos Chandras <markos.chandras@imgtec.com>
412
413 * elf32-metag.c: Use bfd_get_linker_section to get SEC_LINKER_CREATED
414 sections.
415 (elf_metag_adjust_dynamic_symbol): Don't error on zero size dynbss
416 symbol.
417
418 2013-02-08 Yufeng Zhang <yufeng.zhang@arm.com>
419
420 * elf64-aarch64.c (elf64_aarch64_grok_prstatus): Change 'size' from
421 288 to 272.
422
423 2013-02-08 Alan Modra <amodra@gmail.com>
424
425 PR binutils/15106
426 * elf-bfd.h (struct elf_obj_tdata): Add elf_find_function_cache.
427 * elf.c (elf_find_function): Revert last change. Use new
428 tdata field rather than static vars for cache.
429
430 2013-02-07 H.J. Lu <hongjiu.lu@intel.com>
431
432 PR ld/15107
433 * elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if
434 symbol is defined in regular object.
435
436 2013-02-07 Roberto Agostino Vitillo <ra.vitillo@gmail.com>
437
438 PR binutils/15106
439 * elf.c (elf_find_function): Don't cache if symbols change.
440
441 2013-02-07 Alan Modra <amodra@gmail.com>
442
443 PR binutils/14873
444 * elf-attrs.c (_bfd_elf_copy_obj_attributes): Don't attempt to
445 copy attributes from or to non-ELF.
446
447 2013-02-06 H.J. Lu <hongjiu.lu@intel.com>
448
449 * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't clear pc_count
450 for non-zero TLS symbol.
451 (elf_i386_relocate_section): Don't resolve size relocation against
452 non-zero TLS symbol.
453 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Don't clear
454 pc_count for non-zero TLS symbol.
455 (elf_x86_64_relocate_section): Don't resolve size relocation
456 against non-zero TLS symbol.
457
458 2013-02-06 Sandra Loosemore <sandra@codesourcery.com>
459 Andrew Jenner <andrew@codesourcery.com>
460
461 Based on patches from Altera Corporation.
462
463 * Makefile.am (ALL_MACHINES): Add cpu-nios2.lo.
464 (ALL_MACHINES_CFILES): Add cpu-nios2.c.
465 (BFD_BACKENDS): Add elf32-nios2.lo.
466 (BFD32_BACKENDS_CFILES): Add elf32-nios2.c.
467 * Makefile.in: Regenerated.
468 * configure.in: Add entries for bfd_elf32_bignios2_vec and
469 bfd_elf32_littlenios2_vec.
470 * configure: Regenerated.
471 * config.bfd: Add cases for nios2.
472 * archures.c (enum bfd_architecture): Add bfd_arch_nios2.
473 (bfd_mach_nios2): Define.
474 (bfd_nios2_arch): Declare.
475 (bfd_archures_list): Add bfd_nios2_arch.
476 * targets.c (bfd_elf32_bignios2_vec): Declare.
477 (bfd_elf32_littlenios2_vec): Declare.
478 (_bfd_target_vector): Add entries for bfd_elf32_bignios2_vec and
479 bfd_elf32_littlenios2_vec.
480 * elf-bfd.h (enum elf_target_id): Add NIOS2_ELF_DATA.
481 * reloc.c (enum bfd_reloc_code_real): Add Nios II relocations.
482 * bfd-in2.h: Regenerated.
483 * libbfd.h: Regenerated.
484 * cpu-nios2.c: New file.
485 * elf32-nios2.c: New file.
486
487 2013-02-06 Alan Modra <amodra@gmail.com>
488
489 * elf32-arm.c (elf32_arm_final_link_relocate): Only test for
490 stubs in stub_bfd.
491
492 2013-02-06 Alan Modra <amodra@gmail.com>
493
494 * Makefile.am (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
495 * Makefile.in: Regenerate.
496
497 2013-02-04 Sergio Durigan Junior <sergiodj@redhat.com>
498 Pedro Alves <palves@redhat.com>
499
500 * Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
501 * elf-bfd.h (elf_internal_linux_prpsinfo): New structure
502 declaration.
503 (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64)
504 (elfcore_write_ppc32_linux_prpsinfo32): New declarations.
505 * elf-linux-psinfo.h: New file.
506 * elf.c: Include elf-linux-psinfo.h.
507 (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64):
508 New functions.
509 * elf32-ppc.c: Include `elf-linux-psinfo.h'.
510 (elf_external_ppc_linux_prpsinfo32): New structure declaration.
511 (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro.
512 (elfcore_write_ppc_linux_prpsinfo32): New function.
513
514 2013-02-04 Tristan Gingold <gingold@adacore.com>
515
516 * mach-o.c (bfd_mach_o_scan_start_address): Do not fail if no
517 start address.
518
519 2013-02-04 Alan Modra <amodra@gmail.com>
520
521 * Makefile.am (BFD64_BACKENDS): Remove elf-nacl.lo.
522 (BFD64_BACKENDS_CFILES): Remove elf-nacl.c.
523 * Makefile.in: Regenerate.
524 * po/SRC-POTFILES.in: Regenerate.
525
526 2013-02-04 Alan Modra <amodra@gmail.com>
527
528 * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Delete.
529 * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Delete.
530
531 2013-02-01 Alan Modra <amodra@gmail.com>
532
533 * elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
534 clears def_regular.
535
536 2013-01-31 Tristan Gingold <gingold@adacore.com>
537
538 * mach-o.c (bfd_mach_o_scan): Call bfd_mach_o_flatten_sections
539 earlier. Fix status checking of bfd_mach_o_scan_start_address.
540 (bfd_mach_o_scan_start_address): Handle LC_MAIN.
541
542 2013-01-31 Alan Modra <amodra@gmail.com>
543 David S. Miller <davem@davemloft.net>
544
545 PR ld/15056
546 * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Handle implicit
547 references to __tls_get_addr.
548 * elf32-tilpro.c (tilepro_elf_gc_mark_hook): Likewise. Correct
549 vtinherit and vtentry reloc handling too.
550 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): As for tilepro.
551
552 2013-01-31 Alan Modra <amodra@gmail.com>
553
554 * elf64-ppc.c (ppc_stub_name): Trim off trailing "+0".
555
556 2013-01-31 Alan Modra <amodra@gmail.com>
557
558 * elf64-ppc.c (build_plt_stub): Correct plt stub branch to glink.
559
560 2013-01-28 Alan Modra <amodra@gmail.com>
561
562 * elf64-ppc.c: Use %T to print symbols names and remove redundant
563 "relocation" in error messages throughout file.
564 (ppc64_elf_relocate_section): Remove sibling call error message,
565 replace with "call lacks nop". Specially report errors for
566 branches to function entry points via OPD lookup and branches
567 to stubs. Remove NULL symbol handling now done by %T.
568
569 2013-01-28 Alan Modra <amodra@gmail.com>
570
571 * archive.c (bfd_generic_archive_p): Return target and keep
572 ardata on partial matches.
573 * format.c (bfd_check_format_matches): Adjust for above
574 change. Remove bfd_error_file_ambiguously_recognized dead
575 code.
576
577 2013-01-26 Alan Modra <amodra@gmail.com>
578
579 * bfd.c (struct bfd_preserve, bfd_preserve_save, bfd_preserve_restore,
580 bfd_preserve_finish): Move to..
581 * format.c: ..here, splitting out..
582 (bfd_reinit): ..this. New function.
583 (bfd_check_format_matches): Use bfd_preserve_save/restore to
584 keep bfd state for a match.
585 * elfcode.h (elf_object_p): Don't use bfd_preserve_save/restore.
586 * elfcore.h (elf_core_file_p): Likewise.
587 * mach-o.c (bfd_mach_o_header_p): Likewise.
588 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
589 * xsym.c (bfd_sym_object_p): Likewise.
590 * mmo.c (mmo_scan): Clear abfd->symcount.
591 * opncls.c (_bfd_new_bfd): Use a smaller section hash table.
592 * section.c (bfd_section_list_clear): Clear section_htab.count.
593 * bfd-in2.h: Regenerate.
594
595 2013-01-25 Michael Schewe <michael.schewe@gmx.net>
596
597 * elf32-h8300.c (elf32_h8_relax_section): When checking for a
598 second reloc, make sure that the reloc potentially exists first.
599
600 2013-01-24 Nick Clifton <nickc@redhat.com>
601
602 * archures.c: Add bfd_mach_v850e3v5.
603 * bfd-in2.h: Regenerate.
604 * cpu-v850.c: Add entries for v850e2v5 and v850e3v5.
605 * cpu-v850_rh850.c: Likewise.
606 * elf32-v850.c: Add support for v850e3v5 architecture.
607
608 2013-01-23 Markos Chandras <markos.chandras@imgtec.com>
609
610 * elf32-metag.c: Error on HIADDR16/LOADDR16 in shared link.
611
612 2013-01-23 Leif Ekblad <leif@rdos.net>
613
614 * config.bfd (x86_64-*-rdos*): Remove targ_selvecs.
615
616 2013-01-18 H.J. Lu <hongjiu.lu@intel.com>
617
618 * elf32-i386.c (elf_i386_allocate_dynrelocs): Clear pc_count for
619 non-zero TLS symbol.
620 (elf_i386_relocate_section): Resolve size relocation against
621 non-zero TLS symbol.
622 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Clear pc_count
623 for non-zero TLS symbol.
624 (elf_x86_64_relocate_section): Resolve size relocation against
625 non-zero TLS symbol.
626
627 2013-01-18 Mike Frysinger <vapier@gentoo.org>
628
629 * elflink.c (bfd_elf_size_dynamic_sections): Only add DT_RPATH
630 when new_dtags is false. Only add DT_RUNPATH when new_dtags is
631 true.
632
633 2013-01-17 H.J. Lu <hongjiu.lu@intel.com>
634
635 * elf32-i386.c (elf_i386_check_relocs): Count size relocation as
636 PC-relative relocation.
637 * elf64-x86-64.c (elf_x86_64_check_relocs): Count size relocation
638 as PC-relative relocation.
639
640 2013-01-16 H.J. Lu <hongjiu.lu@intel.com>
641
642 * elf32-i386.c (elf_i386_check_relocs): Update R_386_SIZE32
643 check.
644 (elf_i386_relocate_section): Don't check TLS for R_386_SIZE32.
645
646 * elf64-x86-64.c (elf_x86_64_check_relocs): Update R_X86_64_SIZE32
647 and R_X86_64_SIZE64 check.
648 (elf_x86_64_relocate_section): Don't check TLS for R_X86_64_SIZE32
649 nor R_X86_64_SIZE64.
650
651 2013-01-16 H.J. Lu <hongjiu.lu@intel.com>
652
653 * bfd-in2.h: Regenerated.
654 * libbfd.h: Likewise.
655
656 * elf32-i386.c (elf_howto_table): Fill R_386_SIZE32 entry.
657 (elf_i386_reloc_type_lookup): Support BFD_RELOC_SIZE32.
658 (elf_i386_check_relocs): Handle R_386_SIZE32.
659 (elf_i386_gc_sweep_hook): Likewise.
660 (elf_i386_relocate_section): Likewise.
661
662 * elf64-x86-64.c (x86_64_elf_howto_table): Fill R_X86_64_SIZE32
663 and R_X86_64_SIZE64 entries.
664 (x86_64_reloc_map): Add BFD_RELOC_SIZE32 and BFD_RELOC_SIZE64,
665 (elf_x86_64_rtype_to_howto): Handle R_X86_64_SIZE32 for x32.
666 (elf_x86_64_reloc_name_lookup): Likewise.
667 (elf_x86_64_check_relocs): Handle R_X86_64_SIZE32 and
668 R_X86_64_SIZE64.
669 (elf_x86_64_gc_sweep_hook): Likewise.
670 (elf_x86_64_relocate_section): Likewise.
671
672 * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SIZE32 and
673 BFD_RELOC_SIZE64.
674
675 2013-01-15 H.J. Lu <hongjiu.lu@intel.com>
676
677 * elf64-x86-64.c (R_X86_64_standard): Replace R_X86_64_IRELATIVE
678 with R_X86_64_RELATIVE64.
679
680 2013-01-15 Nick Clifton <nickc@redhat.com>
681
682 * elf32-msp430.c: Fix spelling typo.
683
684 2013-01-15 Alan Modra <amodra@gmail.com>
685
686 * elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
687 plt-thread-safe.
688
689 2013-01-14 Alan Modra <amodra@gmail.com>
690
691 PR binutils/14813
692 * bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06.
693 (memory_bclose): Likewise. Return 0 on success.
694 * cache.c (cache_bclose): Likewise.
695 * opncls.c (opncls_bclose, bfd_close): Likewise.
696 * vms-lib.c (vms_lib_bclose): Likewise.
697 * libbfd.h: Regenerate.
698
699 2013-01-13 Alan Modra <amodra@gmail.com>
700
701 * elf-bfd.h (struct elf_link_hash_entry): Delete dynamic_weak.
702 Add ref_dynamic_nonweak.
703 * elflink.c (_bfd_elf_mark_dynamic_def_weak): Delete.
704 (_bfd_elf_merge_symbol): Don't call above function. Move
705 setting of ref_dynamic_nonweak and dynamic_def earlier. Don't
706 clear dynamic_def.
707 (elf_link_add_object_symbols): Delete redundant "override" test.
708 Don't set dynamic_def here.
709 (elf_link_output_extsym): Update.
710
711 2013-01-12 H.J. Lu <hongjiu.lu@intel.com>
712
713 * elf32-i386.c (elf_i386_check_relocs): Set bfd errror for
714 normal and TLS symbol access.
715 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
716
717 2013-01-12 Alan Modra <amodra@gmail.com>
718
719 * elf-bfd.h (_bfd_elf_strtab_refcount): Declare.
720 * elf-strtab.c (_bfd_elf_strtab_refcount): New function.
721 * elflink.c (elf_add_dt_needed_tag): Use _bfd_elf_strtab_refcount.
722
723 2013-01-12 Alan Modra <amodra@gmail.com>
724
725 PR ld/12549
726 * elf-bfd.h (_bfd_elf_strtab_clear_refs): Declare.
727 (_bfd_elf_strtab_clear_all_refs): Define.
728 * elf-strtab.c (_bfd_elf_strtab_clear_refs): New function.
729 (_bfd_elf_strtab_clear_all_refs): Delete.
730 * elflink.c (elf_link_add_object_symbols): Clear out added
731 strtab refs. Correct handling of warning common symbols.
732
733 2013-01-10 H.J. Lu <hongjiu.lu@intel.com>
734
735 * aout0.c: Remove trailing white spaces.
736 * archive.c: Likewise.
737 * archures.c: Likewise.
738 * bfd-in.h: Likewise.
739 * bfd-in2.h: Likewise.
740 * coff-alpha.c: Likewise.
741 * coff-i860.c: Likewise.
742 * coff-mips.c: Likewise.
743 * coff-ppc.c: Likewise.
744 * coff-tic80.c: Likewise.
745 * coff-x86_64.c: Likewise.
746 * coff-z80.c: Likewise.
747 * coffcode.h: Likewise.
748 * coffgen.c: Likewise.
749 * cofflink.c: Likewise.
750 * compress.c: Likewise.
751 * corefile.c: Likewise.
752 * cpu-arm.c: Likewise.
753 * cpu-avr.c: Likewise.
754 * cpu-bfin.c: Likewise.
755 * cpu-cr16.c: Likewise.
756 * cpu-cr16c.c: Likewise.
757 * cpu-crx.c: Likewise.
758 * cpu-h8300.c: Likewise.
759 * cpu-i386.c: Likewise.
760 * cpu-lm32.c: Likewise.
761 * cpu-m68k.c: Likewise.
762 * cpu-moxie.c: Likewise.
763 * cpu-msp430.c: Likewise.
764 * cpu-sh.c: Likewise.
765 * cpu-xc16x.c: Likewise.
766 * dwarf2.c: Likewise.
767 * ecofflink.c: Likewise.
768 * ecoffswap.h: Likewise.
769 * elf-ifunc.c: Likewise.
770 * elf-m10300.c: Likewise.
771 * elf-vxworks.c: Likewise.
772 * elf32-avr.c: Likewise.
773 * elf32-avr.h: Likewise.
774 * elf32-cr16.c: Likewise.
775 * elf32-cr16c.c: Likewise.
776 * elf32-cris.c: Likewise.
777 * elf32-crx.c: Likewise.
778 * elf32-frv.c: Likewise.
779 * elf32-hppa.c: Likewise.
780 * elf32-i860.c: Likewise.
781 * elf32-ip2k.c: Likewise.
782 * elf32-iq2000.c: Likewise.
783 * elf32-m32c.c: Likewise.
784 * elf32-m68hc1x.c: Likewise.
785 * elf32-msp430.c: Likewise.
786 * elf32-mt.c: Likewise.
787 * elf32-ppc.c: Likewise.
788 * elf32-rl78.c: Likewise.
789 * elf32-s390.c: Likewise.
790 * elf32-score.h: Likewise.
791 * elf32-sh-symbian.c: Likewise.
792 * elf32-sh.c: Likewise.
793 * elf32-spu.c: Likewise.
794 * elf32-tic6x.c: Likewise.
795 * elf32-v850.c: Likewise.
796 * elf32-xc16x.c: Likewise.
797 * elf32-xtensa.c: Likewise.
798 * elf64-alpha.c: Likewise.
799 * elf64-hppa.c: Likewise.
800 * elf64-ppc.c: Likewise.
801 * elf64-s390.c: Likewise.
802 * elfcore.h: Likewise.
803 * elflink.c: Likewise.
804 * elfxx-mips.c: Likewise.
805 * elfxx-sparc.c: Likewise.
806 * elfxx-tilegx.c: Likewise.
807 * ieee.c: Likewise.
808 * libcoff.h: Likewise.
809 * libpei.h: Likewise.
810 * libxcoff.h: Likewise.
811 * linker.c: Likewise.
812 * mach-o-i386.c: Likewise.
813 * mach-o-target.c: Likewise.
814 * mach-o.c: Likewise.
815 * mach-o.h: Likewise.
816 * mmo.c: Likewise.
817 * opncls.c: Likewise.
818 * pdp11.c: Likewise.
819 * pe-x86_64.c: Likewise.
820 * peXXigen.c: Likewise.
821 * pef-traceback.h: Likewise.
822 * pei-x86_64.c: Likewise.
823 * peicode.h: Likewise.
824 * plugin.c: Likewise.
825 * reloc.c: Likewise.
826 * riscix.c: Likewise.
827 * section.c: Likewise.
828 * som.c: Likewise.
829 * syms.c: Likewise.
830 * tekhex.c: Likewise.
831 * ticoff.h: Likewise.
832 * vaxbsd.c: Likewise.
833 * xcofflink.c: Likewise.
834 * xtensa-isa.c: Likewise.
835
836 2013-01-10 Will Newton <will.newton@imgtec.com>
837
838 * Makefile.am: Add Meta.
839 * Makefile.in: Regenerate.
840 * archures.c (bfd_mach_metag): New.
841 * bfd-in2.h: Regenerate.
842 * config.bfd: Add Meta.
843 * configure: Regenerate.
844 * configure.in: Add Meta.
845 * cpu-metag.c: New file.
846 * elf-bfd.h: Add Meta.
847 * elf32-metag.c: New file.
848 * elf32-metag.h: New file.
849 * libbfd.h: Regenerate.
850 * reloc.c: Add Meta relocations.
851 * targets.c: Add Meta.
852
853 2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com>
854
855 * elf-bfd.h (elfcore_write_aarch_tls): Add prototype.
856 (elfcore_write_aarch_hw_break): Likewise.
857 (elfcore_write_aarch_hw_watch): Likewise.
858 * elf.c (elfcore_grok_aarch_tls): New function.
859 (elfcore_grok_aarch_hw_break): Likewise.
860 (elfcore_grok_aarch_hw_watch): Likewise.
861 (elfcore_grok_note): Call the new functions to handle the
862 corresponding notes.
863 (elfcore_write_aarch_tls): New function.
864 (elfcore_write_aarch_hw_break): Likewise.
865 (elfcore_write_aarch_hw_watch): Likewise.
866 (elfcore_write_register_note): Call the new functions to handle the
867 corresponding pseudo sections.
868
869 2013-01-07 Tom Tromey <tromey@redhat.com>
870
871 * section.c (_bfd_std_section): Rename from std_section.
872 (bfd_com_section_ptr, bfd_und_section_ptr, bfd_abs_section_ptr)
873 (STD_SECTION): Update.
874 * bfd-in2.h: Rebuild.
875
876 2013-01-04 Juergen Urban <JuergenUrban@gmx.de>
877
878 * archures.c (bfd_mach_mips5900): Define.
879 * bfd-in2.h: Regenerate.
880 * config.bfd: Add mips64-ps2-elf and mips-ps2-elf targets.
881 * cpu-mips.c: Add support for MIPS r5900.
882 * elfxx-mips.c: Add support for MIPS r5900 (extension of r4000).
883
884 2013-01-03 Nickolai Zeldovich <nickolai@csail.mit.edu>
885 Nick Clifton <nickc@redhat.com>
886
887 * elflink.c (get_value): Prevent the use of an undefined shift
888 operation. Add sanity checks.
889
890 2013-01-02 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
891
892 * config.bfd (cr16*-*-uclinux*): New target support.
893
894
895 For older changes see ChangeLog-2012
896 \f
897 Copyright (C) 2013 Free Software Foundation, Inc.
898
899 Copying and distribution of this file, with or without modification,
900 are permitted in any medium without royalty provided the copyright
901 notice and this notice are preserved.
902
903 Local Variables:
904 mode: change-log
905 left-margin: 8
906 fill-column: 74
907 version-control: never
908 End: