OSDN Git Service

daily update
[pf3gnuchains/pf3gnuchains4x.git] / bfd / ChangeLog
1 2011-12-07  Alan Modra  <amodra@gmail.com>
2
3         PR ld/12772
4         * elflink.c (elf_gc_sweep_symbol): Discard unmarked symbols
5         defined in shared libraries.
6
7 2011-12-07  Tristan Gingold  <gingold@adacore.com>
8
9         * mach-o.c (bfd_mach_o_canonicalize_symtab): Fix indentation.
10         Adjust the condition.
11         (bfd_mach_o_read_symtab_symbol): Now returns a bfd_boolean.
12         Adjust return statements.
13         (bfd_mach_o_read_symtab_strtab): Likewise.
14         (bfd_mach_o_read_symtab_symbols): Likewise.
15         (bfd_mach_o_scan_start_address): Likewise.  Make it static.
16         (bfd_mach_o_scan): Likewise.
17         (bfd_mach_o_read_dysymtab_symbol): Remove unused function.
18         (bfd_mach_o_header_p): Adjust call.
19         (bfd_mach_o_cpu_name): Make it const.
20         (bfd_mach_o_filetype_name): Likewise.
21         (bfd_mach_o_header_flags_name): Likewise.
22         (bfd_mach_o_section_type_name): Likewise.
23         (bfd_mach_o_section_attribute_name): Likewise.
24         (bfd_mach_o_load_command_name): Likewise.
25         (bfd_mach_o_get_section_type_from_name): Add a const qualifier
26         after above change.
27         (bfd_mach_o_get_section_attribute_from_name): Likewise.
28         * mach-o.h (bfd_mach_o_read_dysymtab_symbol)
29         (bfd_mach_o_scan_start_address, bfd_mach_o_scan): Remove.
30
31 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
32
33         * elf-bfd.h (elfcore_write_s390_last_break): Add prototype.
34         (elfcore_write_s390_system_call): Likewise.
35         * elf.c (elfcore_write_s390_last_break): New function.
36         (elfcore_write_s390_system_call): Likewise.
37         (elfcore_write_register_note): Call them.
38         (elfcore_grok_s390_last_break): New function.
39         (elfcore_grok_s390_system_call): Likewise.
40         (elfcore_grok_note): Call them.
41
42 2011-12-05  Tristan Gingold  <gingold@adacore.com>
43
44         * mach-o.c (bfd_mach_o_read_symtab_symbol): Accept indirect symbols.
45
46 2011-12-05  Tristan Gingold  <gingold@adacore.com>
47
48         * mach-o.c (bfd_mach_o_write_contents): Handle LC_LOAD_UPWARD_DYLIB.
49         (bfd_mach_o_read_dylib): Likewise.
50         (bfd_mach_o_read_command): Likewise.
51         (bfd_mach_o_bfd_print_private_bfd_data): Likewise.
52
53 2011-12-05  Tristan Gingold  <gingold@adacore.com>
54
55         * mach-o.c (bfd_mach_o_read_command): Add the bfd in the error
56         message.
57         (bfd_mach_o_openr_next_archived_file): Use arch name as member name.
58         (bfd_mach_o_fat_extract): Ditto.
59
60 2011-12-03  Alan Modra  <amodra@gmail.com>
61
62         PR ld/13468
63         * elflink.c (bfd_elf_final_link): Don't segfault when checking
64         for DT_TEXTREL and .dynamic does not exist.
65
66 2011-12-03  Alan Modra  <amodra@gmail.com>
67
68         PR ld/13470
69         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
70         change in 2011-07-01 commit.  Comment.
71         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
72
73 2011-12-01  Mikael Pettersson  <mikpe@it.uu.se>
74
75         * elf32-m68k.c (elf_m68k_check_relocs) <R_68K_8, R68K_16, R_68K_32>: For
76         non-SEC_ALLOC sections break before GOT and PLT accounting.
77
78 2011-12-01  Hans-Peter Nilsson  <hp@axis.com>
79
80         * elf32-cris.c (cris_elf_check_relocs) <plt accounting for
81         R_CRIS_8, R_CRIS_16, and R_CRIS_32>: Move early break for
82         non-SEC_ALLOC sections before GOT and PLT accounting.
83
84 2011-11-29  Andrew Pinski  <apinski@cavium.com>
85
86         * archures.c (bfd_mach_mips_octeonp): New macro.
87         * bfd-in2.h: Regenerate.
88         * bfd/cpu-mips.c (I_mipsocteonp): New enum value.
89         (arch_info_struct): Add bfd_mach_mips_octeonp.
90         * elfxx-mips.c (mips_set_isa_flags): Add bfd_mach_mips_octeonp.
91         (mips_mach_extensions): Add bfd_mach_mips_octeonp.
92
93 2011-11-23  Tristan Gingold  <gingold@adacore.com>
94
95         * vms-lib.c (get_idxlen): Add comments.  Fix type in sizeof.
96         (vms_write_index): Add comments.
97
98 2011-11-22  DJ Delorie  <dj@redhat.com>
99
100         * elf32-rx.c (rx_elf_object_p): Add more checks for "scanning" to
101         avoid using the special non-swapping target when not explicitly
102         requested.
103
104 2011-11-22  Daniel Calcoen  <Daniel.Calcoen@cern.ch>
105
106         * elf32-rx.c (rx_elf_object_p): Correct typo: lma->vma.
107
108 2011-11-22  Tristan Gingold  <gingold@adacore.com>
109
110         * mach-o.c (bfd_mach_o_print_symbol): Display COM for common
111         symbols.  Print section name in brackets.
112
113 2011-11-21  Andreas Tobler  <andreast@fgznet.ch>
114
115         * config.bfd: Add vectors for powerpc and powerpc64-freebsd.
116         * configure.in (TDEFINES): Add rules for powerpc*-freebsd.
117         * configure: Regenerate.
118         * elf32-ppc.c: Add powerpc-freebsd definitions.
119         * elf64-ppc.c: Add powerpc64-freebsd definitions.
120         * targets.c: Add bits for powerpc and powerpc64-freebsd.
121
122 2011-11-17  Philipp Thomas  <philipp@thogro.org>
123
124         * elf32-arm.c (elf32_thumb_to_arm_stub): Sync message so that it
125         needs to be translated only once.
126
127 2011-11-16  Maciej W. Rozycki  <macro@codesourcery.com>
128
129         * elf64-mips.c (mips_elf64_howto_table_rela): Set src_mask to
130         zero throughout.
131         (mips16_elf64_howto_table_rela): Likewise.
132         (micromips_elf64_howto_table_rela): Likewise.
133         * elfn32-mips.c (elf_mips_howto_table_rela): Likewise.
134         (elf_mips16_howto_table_rela): Likewise.
135         (elf_micromips_howto_table_rela): Likewise.
136
137 2011-11-15  Alan Modra  <amodra@gmail.com>
138             Andreas Tobler  <andreast@fgznet.ch>
139
140         * elflink.c (_bfd_elf_create_got_section): Replace
141         bfd_make_section_with_flags with bfd_make_section_anyway_with_flags.
142         (_bfd_elf_link_create_dynamic_sections): Likewise.
143         * elf32-ppc.c (ppc_elf_create_glink): Likewise.
144         (ppc_elf_create_dynamic_sections): Likewise.
145
146 2011-11-14  Maxim Kuvyrkov  <maxim@codesourcery.com>
147
148         * elfxx-mips.c (mips_n64_exec_plt0_entry): Use 64-bit move.
149
150 2011-11-08  Nick Clifton  <nickc@redhat.com>
151
152         * elf-m10300.c (mn10300_elf_relax_section): Fix check for an
153         immediate move into an address register.
154
155 2011-11-09  Alan Modra  <amodra@gmail.com>
156
157         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark syms in
158         executables when export_dynamic.
159
160 2011-11-08  Alan Modra  <amodra@gmail.com>
161
162         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename
163         ha_relocs_not_using_r2 to unexpected_toc_insn.
164         (ok_lo_toc_insn): New function.
165         (ppc64_elf_edit_toc): Check insn on lo toc reloc.  Emit warning.
166         (ppc64_elf_relocate_section): Don't check insn on lo toc reloc here.
167         Handle addic on lo toc reloc.
168
169 2011-11-06  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
170
171         PR ld/13387
172         * elf32-hppa.c (elf32_hppa_hide_symbol): Make STT_GNU_IFUNC symbol
173         go through PLT.  Reset plt field with init_plt_offset.
174         (elf32_hppa_adjust_dynamic_symbol): Ensure that a PLT slot is
175         allocated for symbols referenced by a plabel.
176
177 2011-11-02  DJ Delorie  <dj@redhat.com>
178
179         * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Delete unused
180         variable.
181
182 2011-11-02  Jan Beulich  <jbeulich@suse.com>
183
184         * coffgen.c (coff_write_alien_symbol): Make public. Add 'struct
185         internal_syment *' parameter. Extend 'dummy' to an array with two
186         elements. Set n_numaux early. Handle BSF_FILE.
187         (coff_write_symbols): Pass NULL as new third argument to
188         coff_write_alien_symbol().
189         * cofflink.c (_bfd_coff_final_link): Don't use COFF-specific
190         obj_raw_syment_count() on non-COFF input BFD. Insert local symbols
191         from non-COFF input BFDs.
192         * libcoff-in.h (coff_write_alien_symbol): Declare.
193         * libcoff.h (coff_write_alien_symbol): Re-generate.
194
195 2011-11-01  DJ Delorie  <dj@redhat.com>
196
197         * Makefile.am (ALL_MACHINES): Add cpu-rl78.lo.
198         (ALL_MACHINES_CFILES): Add cpu-rl78.c.
199         (BFD32_BACKENDS): Add elf32-rl78.lo.
200         (BFD32_BACKENDS_CFILES): Add elf32-rl78.c.
201         (Makefile.in): Regenerate.
202         * archures.c (bfd_architecture): Define bfd_arch_rl78.
203         (bfd_archures_list): Add bfd_rl78_arch.
204         * config.bfd: Add rl78-*-elf.
205         * configure.in: Add bfd_elf32_rl78_vec.
206         * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_RL78_* relocations.
207         * targets.c (bfd_target_vector): Add bfd_elf32_rl78_vec.
208         * Makefile.in: Regenerate.
209         * bfd-in2.h: Regenerate.
210         * configure: Regenerate.
211         * libbfd.h: Regenerate.
212         * cpu-rl78.c: New file.
213         * elf32-rl78.c: New file.
214
215 2011-10-26  Nick Clifton  <nickc@redhat.com>
216
217         PR ld/13049
218         * elf64-ppc.c (STUB_SUFFIX): Revert previous delta.
219         * elf32-hppa.c (STUB_SUFFIX): Likewise.
220
221 2011-10-25  Joern Rennecke  <joern.rennecke@embecosm.com>
222
223         * Makefile.am (ALL_MACHINES): Add cpu-epiphany.lo.
224         (ALL_MACHINES_CFILES): Add cpu-epiphany.c.
225         (BFD32_BACKENDS): Add elf32-epiphany.lo.
226         (BFD32_BACKENDS_CFILES): Add elf32-epiphany.c.
227         * archures.c (bfd_arch_epiphany): Add.
228         (bfd_mach_epiphany16, bfd_mach_epiphany32): Define.
229         (bfd_epiphany_arch): Declare.
230         (bfd_archures_list): Add &bfd_epiphany_arch.
231         * config.bfd (epiphany-*-elf): New target case.
232         * configure.in (bfd_elf32_epiphany_vec): New target vector case.
233         * reloc.c (BFD_RELOC_EPIPHANY_SIMM8): New relocation.
234         (BFD_RELOC_EPIPHANY_SIMM24, BFD_RELOC_EPIPHANY_HIGH): Likewise.
235         (BFD_RELOC_EPIPHANY_LOW, BFD_RELOC_EPIPHANY_SIMM11): Likewise.
236         (BFD_RELOC_EPIPHANY_IMM11, BFD_RELOC_EPIPHANY_IMM8): Likewise.
237         * targets.c (bfd_elf32_epiphany_vec): Declare.
238         (_bfd_target_vector): Add bfd_elf32_epiphany_vec.
239         * Makefile.in: Regenerate.
240         * bfd-in2.h: Regenerate.
241         * configure: Regenerate.
242         * libbfd.h: Regenerate.
243         * po/SRC-POTFILES.in: Regenerate.
244         * po/bfd.pot: Regenerate.
245         * cpu-epiphany.c: New file.
246         * elf32-epiphany.c: New file.
247
248 2011-10-24  Maciej W. Rozycki  <macro@codesourcery.com>
249
250         * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Remove
251         assertions.
252
253 2011-10-24  Eugeniy Meshcheryakov  <eugen@debian.org>
254
255         PR ld/13273
256         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Do not warn about
257         identical TAG_PCS_config attributes.
258
259 2011-10-24  Nick Clifton  <nickc@redhat.com>
260
261         * po/ja.po: Updated Japanese translation.
262
263 2011-10-24  Pau Garcia i Quiles  <pgquiles@elpauer.org>
264
265         PR binutils/13292
266         * bfd-in.h: Include <sys/stat.h> rather than forward defining
267         struct stat.
268         * bfd-in2.h: Regenerate.
269
270 2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>
271
272         PR ld/13302
273         * elf32-i386.c (elf_i386_relocate_section): Replace
274         R_386_IRELATIVE with R_386_RELATIVE.
275
276         * elf64-x86-64.c (elf_x86_64_relocate_section): Replace
277         R_X86_64_IRELATIVE with R_X86_64_RELATIVE.
278
279 2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>.
280
281         * elf32-i386.c (elf_i386_relocate_section): Fix a typo in
282         comments.
283         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
284
285 2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>
286
287         PR ld/13302
288         * elf32-i386.c (elf_i386_link_hash_table): Add next_jump_slot_index
289         and next_irelative_index.
290         (elf_i386_link_hash_table_create): Initialize next_jump_slot_index
291         and next_irelative_index.
292         (elf_i386_allocate_dynrelocs): Increment reloc_count instead of
293         next_tls_desc_index.
294         (elf_i386_size_dynamic_sections): Set next_tls_desc_index and
295         next_irelative_index from reloc_count.
296         (elf_i386_finish_dynamic_symbol): Put R_386_IRELATIVE after
297         R_386_JUMP_SLOT.
298
299         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
300         next_jump_slot_index and next_irelative_index.
301         (elf_x86_64_link_hash_table_create): Initialize
302         next_jump_slot_index and next_irelative_index.
303         (elf_x86_64_size_dynamic_sections): Set next_irelative_index
304         from reloc_count.
305         (elf_x86_64_finish_dynamic_symbol): Put R_X86_64_IRELATIVE after
306         R_X86_64_JUMP_SLOT.
307
308 2011-10-20  Nick Clifton  <nickc@redhat.com>
309
310         PR ld/13049
311         * elf32-arm.c (STUB_SUFFIX): Avoid collision with user namespace
312         symbol names.
313         * elf64-ppc.c (STUB_SUFFIX): Likewise.
314         * elf32-hppa.c (STUB_SUFFIX): Likewise.
315
316 2011-10-20  Alan Modra  <amodra@gmail.com>
317
318         * elf32-i386.c (i386_opcode16): Delete.
319         (elf_i386_check_tls_transition): Use memcmp to compare contents.
320         * elf64-x86-64.c (x86_64_opcode16, x86_64_opcode32): Delete.
321         (elf_x86_64_check_tls_transition): Use memcmp to compare contents.
322
323 2011-10-19  Alan Modra  <amodra@gmail.com>
324
325         PR ld/13177
326         * elflink.c (_bfd_elf_gc_mark_rsec): Set symbol "mark".
327         (elf_gc_sweep_symbol): Don't test plt/got refcounts, instead test
328         "mark".  Hide undefweak too.  Clear def_regular and ref_regular.
329         * elf-m10300.c (mn10300_elf_relocate_section): Ignore unresolved
330         reloc errors from garbage-collected code.
331         * elf32-arm.c (elf32_arm_relocate_section): Likewise.
332         * elf32-bfin.c (bfin_relocate_section): Likewise.
333         (bfinfdpic_relocate_section): Likewise.
334         * elf32-cris.c (cris_elf_relocate_section): Likewise.
335         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
336         * elf32-i386.c (elf_i386_relocate_section): Likewise.
337         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
338         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
339         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
340         * elf32-s390.c (elf_s390_relocate_section): Likewise.
341         * elf32-sh.c (sh_elf_relocate_section): Likewise.
342         * elf32-spu.c (spu_elf_relocate_section): Likewise.
343         * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
344         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
345         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
346         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
347         * elf64-s390.c (elf_s390_relocate_section): Likewise.
348         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
349         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
350         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
351         * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
352
353 2011-10-19  Alan Modra  <amodra@gmail.com>
354
355         PR ld/13311
356         * elflink.c (elf_link_output_extsym): Correct test for warning when
357         forced local executable syms are referenced from shared libraries.
358
359 2011-10-19  Alan Modra  <amodra@gmail.com>
360
361         PR ld/13254
362         * elflink.c (bfd_elf_final_link): Emit error_textrel error.
363
364 2011-10-18  David S. Miller  <davem@davemloft.net>
365
366         PR binutils/13301
367         * elfxx-sparc.c (sparc_elf_find_reloc_at_ofs): New function.
368         (_bfd_sparc_elf_relocate_section): Always move the __tls_get_addr
369         call delay slot instruction forward 4 bytes when performing
370         relaxation.
371
372 2011-10-17  Alan Modra  <amodra@gmail.com>
373
374         PR ld/12975
375         PR ld/13195
376         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Apply 2011-09-15
377         and 2011-09-29 bfd_elf_gc_mark_dynamic_ref_symbol changes here too.
378
379 2011-10-14  Hans-Peter Nilsson  <hp@axis.com>
380
381         * elf32-cris.c (cris_elf_gc_sweep_hook) <R_CRIS_16_GOTPLT>
382         <R_CRIS_32_GOTPLT>: Fix missing update of gotplt refcount for
383         global symbols.
384         <R_CRIS_8, R_CRIS_16, R_CRIS_32>: New cases for similar missing
385         updates of the plt refcount.
386         (elf_cris_adjust_gotplt_to_got): Assert integrity of the gotplt
387         refcount in relation to the plt refcount.
388
389 2011-10-13  Richard Sandiford  <richard.sandiford@linaro.org>
390
391         * elf32-arm.c (elf32_arm_final_link_relocate): Mark PLT calls via
392         stubs as resolved.
393
394 2011-10-11  Alan Modra  <amodra@gmail.com>
395
396         PR binutils/13278
397         * archive.c (bfd_generic_archive_p): Only check first element
398         when target_defaulted.
399         (_bfd_construct_extended_name_table): Use ar_maxnamelen.
400         (_bfd_archive_bsd44_construct_extended_name_table): Likewise.
401
402 2011-10-11  Alan Modra  <amodra@gmail.com>
403
404         PR binutils/13257
405         * archive.c (_bfd_find_nested_archive, _bfd_get_elt_at_filepos): Open
406         thin archive element using container target if not defaulted.
407
408 2011-10-10  Nick Clifton  <nickc@redhat.com>
409
410         * po/es.po: Updated Spanish translation.
411         * po/fi.po: Updated Finnish translation.
412         * po/fr.po: Updated French translation.
413         * po/ru.po: Updated Russian translation.
414
415 2011-10-10  Alan Modra  <amodra@gmail.com>
416
417         * elf64-ppc.c (ppc64_elf_howto_table): Add R_PPC64_TOCSAVE entry.
418         (struct ppc_link_hash_table): Add tocsave_htab.
419         (struct tocsave_entry): New.
420         (tocsave_htab_hash, tocsave_htab_eq, tocsave_find): New functions.
421         (ppc64_elf_link_hash_table_create): Create tocsave_htab..
422         (ppc64_elf_link_hash_table_free): ..and delete it.
423         (build_plt_stub): Always put STD_R2_40R1 first.
424         (ppc64_elf_size_stubs): Check for R_PPC64_TOCSAVE following reloc
425         on plt call.  If present add prologue nop location to tocsave_htab.
426         (ppc64_elf_relocate_section): Convert prologue nop to std.  Skip
427         first insn of plt call stub when R_PPC64_TOCSAVE present.
428
429 2011-10-08  H.J. Lu  <hongjiu.lu@intel.com>
430
431         PR ld/13250
432         * elflink.c (elf_link_add_object_symbols): Preserve the maximum
433         alignment and size for common symbols.
434
435 2011-10-08  Alan Modra  <amodra@gmail.com>
436
437         PR ld/13229
438         PR ld/13244
439         * elflink.c (elf_link_add_object_symbols): Don't make IR symbols
440         dynamic.
441
442 2011-10-08  Alan Modra  <amodra@gmail.com>
443
444         PR ld/13229
445         * elflink.c (elf_link_output_extsym): Strip defined plugin symbols
446         even when strip_discarded is false.
447
448 2011-10-05  Kai Tietz  <ktietz@redhat.com>
449
450         * coffgen.c (coff_write_alien_symbol): Don't write
451         symbol for discarded sections, if strip_discarded isn't
452         explicit set to false.
453         (coff_write_native_symbol): Likewise.
454
455 2011-10-05  DJ Delorie  <dj@redhat.com>
456             Nick Clifton  <nickc@redhat.com>
457
458         * elf32-rx.c: Add support for PID mode.
459         (rx_elf_relocate_section): Add checks for unsafe PID relocations.
460         Include addend in R_RX_SYM relocations.
461
462 2011-09-30  Tristan Gingold  <gingold@adacore.com>
463
464         * dwarf2.c (struct dwarf2_debug): Add field debug_sections.
465         (read_section): Add sec argument. Adjust the code to get section
466         names from it.
467         (read_indirect_string): Adjust call to read_section.
468         (read_abbrevs): Ditto.
469         (decode_line_info): Ditto.
470         (read_debug_ranges): Ditto.
471         (DWARF2_DEBUG_INFO, DWARF2_COMPRESSED_DEBUG_INFO): Remove.
472         (find_debug_info): Add debug_sections parameter.  Use it instead
473         the above macros.
474         (place_sections): Get section names from stash.
475         (find_line): Add debug_sections argument.  Initialize
476         debug_sections field of stash from it.
477         Adjust calls to find_debug_info.
478         (_bfd_dwarf2_find_nearest_line): Add debug_sections argument.
479         Adjust call to find_line.
480         (_bfd_dwarf2_find_line): Adjust call to find_line.
481         * libcoff-in.h (struct dwarf_debug_section): New declaration.
482         (coff_find_nearest_line_with_names): Likewise.
483         * libcoff.h: Regenerate.
484         * libbfd-in.h (struct dwarf_debug_section): Move declaration.
485         (dwarf_debug_sections): Likewise.
486         (_bfd_dwarf2_find_nearest_line): Add debug_sections argument.
487         * libbfd.h: Regenerate.
488         * elf.c (_bfd_elf_find_nearest_line): Adjust call to
489         _bfd_dwarf2_find_nearest_line.
490         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Ditto.
491         * elf64-alpha.c (elf64_alpha_find_nearest_line): Ditto.
492         * elf32-arm.c (elf32_arm_find_nearest_line): Ditto.
493         * coffgen.c (coff_find_nearest_line_with_names): New function.
494         (coff_find_nearest_line): Calls coff_find_nearest_line_with_names.
495         * coff-rs6000.c (xcoff_debug_sections): New constant.
496         (xcoff_find_nearest_line): New function.
497         (rs6000coff_vec): Use xcoff_find_nearest_line.
498         (pmac_xcoff_vec): Ditto.
499
500 2011-09-30  Alan Modra  <amodra@gmail.com>
501
502         PR ld/13235
503         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add ha_relocs_not_using_r2.
504         (ppc64_elf_edit_toc): Check HA relocs.
505         (ha_reloc_match): Delete function.
506         (ppc64_elf_relocate_section): Remove delayed HA nop optimization.
507         Instead do it and low part optimization based on
508         ha_relocs_not_using_r2.
509
510 2011-09-29  Alan Modra  <amodra@gmail.com>
511
512         PR ld/13233
513         * elflink.c (_bfd_elf_gc_mark_extra_sections): Mark single member
514         debug and special section groups.
515
516 2011-09-29  H.J. Lu  <hongjiu.lu@intel.com>
517
518         PR ld/13195
519         * elflink.c (_bfd_elf_merge_symbol): Don't set dynamic_def when
520         clearing def_dynamic.
521         (elf_link_add_object_symbols): Likewise.  Set dynamic_def when
522         setting def_dynamic.
523         (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is
524         versioned.
525
526 2011-09-27  Kai Tietz  <ktietz@redhat.com>
527
528         * coffcode.h (sec_to_styp_flags): Handle
529         SEC_LINK_DUPLICATES_SAME_CONTENTS, and
530         SEC_LINK_DUPLICATES_SAME_SIZE.
531
532 2011-09-22  Tristan Gingold  <gingold@adacore.com>
533
534         * configure.in: Bump version to 2.22.51
535         * configure: Regenerate.
536
537 2011-09-21  David S. Miller  <davem@davemloft.net>
538
539         * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): New.
540         * elfxx-sparc.h: Declare it.
541         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Call it.
542         * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
543
544 2011-09-21  Tristan Gingold  <gingold@adacore.com>
545
546         * mach-o.c (bfd_mach_o_convert_section_name_to_bfd): Add comment.
547         Deals with size limited strings.
548         (bfd_mach_o_build_commands): Initialize more fields.
549
550 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>
551
552         PR ld/13177
553         * elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT
554         nor GOT references.
555
556 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>
557
558         PR ld/12975
559         * bfd-in.h (bfd_elf_size_dynamic_sections): Remove pointer
560         to struct bfd_elf_version_tree.
561
562         * elflink.c (elf_info_failed): Remove verdefs.
563         (_bfd_elf_export_symbol): Updated.
564         _bfd_elf_link_assign_sym_version): Likewise.
565         (bfd_elf_size_dynamic_sections): Remove pointer to struct
566         bfd_elf_version_tree.  Updated.
567         (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is hidden
568         by linker script.
569
570         * linker.c (bfd_hide_sym_by_version): New.
571
572         * bfd-in2.h: Regenerated.
573
574 2011-09-12  H.J. Lu  <hongjiu.lu@intel.com>
575
576         PR ld/13178
577         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Use .got.plt
578         if there are no GOT relocations.
579
580 2011-09-09  Kai Tietz  <ktietz@redhat.com>
581
582         * peicode.h (pe_ILF_build_a_bfd): Don't remove leading underscore
583         for targets without symbol_leading_char.
584
585 2011-09-08  Bernd Jendrissek  <bernd.jendrissek@gmail.com>
586
587         * bfdwin.c (bfd_get_file_window): Fix memory leak.
588
589 2011-09-07  Alan Modra  <amodra@gmail.com>
590
591         PR ld/13131
592         * bfd/elf64-ppc.c (adjust_toc_syms): Ensure ppc64_elf_howto_table
593         is initialized.
594
595 2011-09-06  Alan Modra  <amodra@gmail.com>
596
597         PR ld/13131
598         * elf64-ppc.c (adjust_toc_syms): Delete redundant code.
599         (ppc64_elf_edit_toc): Fix style nit.  Report some details
600         on linker failure due to reference in debug or non-alloc
601         sections to optimized away toc entry, and don't abort.
602
603 2011-09-01  Christophe Lyon  <christophe.lyon@st.com>
604
605         * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip excluded
606         sections.
607
608 2011-08-26  Nick Clifton  <nickc@redhat.com>
609
610         * po/es.po: Updated Spanish translation.
611
612 2011-08-19  Alan Modra  <amodra@gmail.com>
613
614         * elf64-ppc.c (ppc64_elf_edit_toc): Ignore can_optimize bit if
615         we haven't seen expected -mcmodel=medium/large code relocs.
616
617 2011-08-18  Tristan Gingold  <gingold@adacore.com>
618
619         * mach-o.c (bfd_mach_o_read_segment): Initialize list.
620
621 2011-08-17  Tristan Gingold  <gingold@adacore.com>
622
623         * mach-o.c (bfd_mach_o_write_section_32): Fix typo.
624
625 2011-08-17  Alan Modra  <amodra@gmail.com>
626
627         PR ld/12762
628         * bfd-in.h (struct bfd_section_already_linked): Forward declare.
629         (_bfd_handle_already_linked): Declare.
630         * coff-alpha.c (_bfd_ecoff_section_already_linked): Define as
631         _bfd_coff_section_already_linked.
632         * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise.
633         * coffcode.h (coff_section_already_linked): Likewise.
634         * cofflink.c (coff_link_add_symbols): Revert 2011-07-09 changes.
635         * elf-bfd.h: Likewise.
636         * libbfd-in.h: Likewise.
637         * targets.c: Likewise.
638         * linker.c (bfd_section_already_linked): Likewise.
639         (bfd_section_already_linked_table_lookup): Likewise.
640         (bfd_section_already_linked_table_insert): Likewise.
641         (_bfd_generic_section_already_linked): Likewise.  Call
642         _bfd_handle_already_linked.
643         (_bfd_handle_already_linked): New function, split out from..
644         * elflink.c (_bfd_elf_section_already_linked): ..here.  Revert
645         2011-07-09 changes.  Avoid unnecessary strcmp when matching
646         already_linked_list entries.  Match plugin linkonce section.
647         (section_signature): Delete.
648         * coffgen.c (_bfd_coff_section_already_linked): New function.
649         * libcoff-in.h (_bfd_coff_section_already_linked): Declare.
650         * libbfd.h: Regenerate.
651         * libcoff.h: Regenerate.
652         * bfd-in2.h: Regenerate.
653
654 2011-08-14  Alan Modra  <amodra@gmail.com>
655
656         * elf32-ppc.c (ppc_elf_select_plt_layout): Force bss-plt when
657         shared and call to _mcount will go via plt.
658
659 2011-08-14  Alan Modra  <amodra@gmail.com>
660
661         * elf64-ppc.c: Prefix all einfo error strings with "%P: ".
662         * elf32-ppc.c: Likewise.
663         (ppc_elf_select_plt_layout): Use einfo rather than info to report
664         forced bss-plt.
665
666 2011-08-12  H.J. Lu  <hongjiu.lu@intel.com>
667
668         PR ld/13082
669         * elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_RELATIVE64.
670         (elf_x86_64_relocate_section): Treat R_X86_64_64 like R_X86_64_32
671         and zero-extend it to 64bit if addend is zero for x32.  Generate
672         R_X86_64_RELATIVE64 for x32.
673
674 2011-08-09  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
675
676         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
677         * bfd-in2.h (bfd_elf32_arm_set_target_relocs): Likewise.
678         * elf32-arm.c (elf32_arm_link_hash_table): New field.
679         (elf232_arm_link_hash_table_create): Initialise new field.
680         (check_use_blx): Change test depending on fix_arm1176.
681         (bfd_elf32_arm_set_target_relocs): Set fix_arm1176 from
682         command line options.
683
684 2011-08-08  Tristan Gingold  <gingold@adacore.com>
685
686         * mach-o.c (struct mach_o_segment_name_xlat): Add comments.
687         (segsec_names_xlat): Reorder elements.
688         (bfd_mach_o_read_section_32): Fix typo.
689         (bfd_mach_o_read_section_64): Fix typo.
690
691 2011-08-08  Tristan Gingold  <gingold@adacore.com>
692
693         * mach-o.h (BFD_MACH_O_SEGNAME_SIZE): New macro.
694         (BFD_MACH_O_SECTNAME_SIZE): Ditto.
695         (bfd_mach_o_section): Use them.  Add next field.
696         (bfd_mach_o_segment_command): Replace sections array by
697         sect_head and sect_tail.
698         (bfd_mach_o_get_mach_o_section): New macro.
699         (bfd_mach_o_lookup_section): Remove.
700         (bfd_mach_o_new_section_hook): New function.
701         * mach-o.c (bfd_mach_o_normalize_section_name): Use strncmp
702         instead of strcmp.
703         (bfd_mach_o_convert_section_name_to_bfd): Replaces section
704         parameter with segname and sectname parameters.  Adjust.
705         (bfd_mach_o_append_section_to_segment): New function.  Use a
706         linked list for Mach-O sections.
707         (bfd_mach_o_write_segment_32): Adjust.
708         (bfd_mach_o_write_segment_64): Ditto.
709         (bfd_mach_o_build_commands): Fix comment.  Adjust.
710         (bfd_mach_o_flatten_sections): Adjust.
711         (bfd_mach_o_print_section_map): Adjust.
712         (bfd_mach_o_set_section_flags_from_bfd): Ditto.
713         (bfd_mach_o_new_section_hook): New function.
714         (bfd_mach_o_init_section_from_mach_o): Ditto.
715         (bfd_mach_o_read_section_32): Remove section parameter.
716         Return a section instead.
717         (bfd_mach_o_read_section_64): Ditto.
718         (bfd_mach_o_read_section): Ditto.
719         (bfd_mach_o_make_bfd_section): Adjust.
720         (bfd_mach_o_read_segment): Adjust for new profile of
721         bfd_mach_o_read_section.
722         (bfd_mach_o_lookup_section): Remove.
723         * mach-o-target.c (bfd_mach_o_new_section_hook): Remove.
724
725 2011-08-08  Tristan Gingold  <gingold@adacore.com>
726
727         * mach-o.h (bfd_mach_o_version_min_command): New structure.
728         (bfd_mach_o_load_command): Add version_min.
729         (mach_o_data_struct): Fix comment.
730         * mach-o.c (bfd_mach_o_read_version_min): New function.
731         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_FUNCTION_STARTS,
732         BFD_MACH_O_LC_VERSION_MIN_MACOSX and
733         BFD_MACH_O_LC_VERSION_MIN_IPHONEOS.
734         (bfd_mach_o_get_name_or_null): New function.
735         (bfd_mach_o_get_name): Use the above new one.
736         (bfd_mach_o_load_command_name): Add the above new commands.
737         (bfd_mach_o_bfd_print_private_bfd_data): Display numerically
738         unknown commands.  Handle BFD_MACH_O_LC_FUNCTION_STARTS,
739         BFD_MACH_O_LC_VERSION_MIN_MACOSX and
740         BFD_MACH_O_LC_VERSION_MIN_IPHONEOS.
741
742 2011-08-08  Tristan Gingold  <gingold@adacore.com>
743
744         * mach-o.h: Move size macros to external.h
745         Move reloc macros to reloc.h and x86-64.h.
746         * mach-o-i386.c: Includes mach-o/reloc.h
747         * mach-o-x86-64.c: Ditto and includes mach-o/x86-64.h
748         * mach-o.c: Add includes.
749         (bfd_mach_o_write_header): Use structure from external.h to convert.
750         (bfd_mach_o_write_thread): Ditto.
751         (bfd_mach_o_write_relocs): Ditto.
752         (bfd_mach_o_write_section_32): Ditto.
753         (bfd_mach_o_write_section_64): Ditto.
754         (bfd_mach_o_write_segment_32): Ditto.
755         (bfd_mach_o_write_segment_64): Ditto.
756         (bfd_mach_o_write_symtab): Ditto.
757         (bfd_mach_o_write_contents): Ditto.
758         (bfd_mach_o_read_header): Ditto.
759         (bfd_mach_o_read_section_32): Ditto.
760         (bfd_mach_o_read_section_64): Ditto.
761         (bfd_mach_o_read_symtab_symbol): Ditto.
762         (bfd_mach_o_read_dylinker): Ditto.
763         (bfd_mach_o_read_dylib): Ditto.
764         (bfd_mach_o_read_dysymtab): Ditto.
765         (bfd_mach_o_read_symtab): Ditto.
766         (bfd_mach_o_read_linkedit): Ditto.
767         (bfd_mach_o_read_str): Ditto.
768         (bfd_mach_o_read_dyld_info): Ditto.
769         (bfd_mach_o_read_segment): Ditto.
770         (bfd_mach_o_read_command): Ditto.
771         (bfd_mach_o_archive_p): Ditto.
772         (bfd_mach_o_canonicalize_one_reloc): Ditto. Change the BUF parameter.
773         (bfd_mach_o_canonicalize_relocs): Adjust to call the above function.
774         (bfd_mach_o_read_dysymtab_symbol): Rename BUF variable.
775         (bfd_mach_o_read_uuid): Remove useless cast.  Use a macro instead
776         of an hard-coded value.
777
778 2011-08-08  Tristan Gingold  <gingold@adacore.com>
779
780         * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Fix cut-and-past typos.
781         (bfd_mach_o_x86_64_swap_reloc_out): Handle BFD_RELOC_32_PCREL,
782         BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64 and
783         BFD_RELOC_MACH_O_X86_64_GOT_LOAD.  Share common code.
784
785 2011-08-08  Tristan Gingold  <gingold@adacore.com>
786
787         * mach-o.c (bfd_mach_o_normalize_section_name): New function.
788         (bfd_mach_o_convert_section_name_to_bfd): Use it.
789         (bfd_mach_o_get_section_type_from_name): New function.
790         (bfd_mach_o_get_section_attribute_from_name): Ditto.
791         * mach-o.h (bfd_mach_o_section): Move bfdsection field at the end.
792         Add comments.  Add prototypes for the above new functions.
793
794 2011-08-05  Mark Kettenis  <kettenis@gnu.org>
795
796         * netbsd-core.c (netbsd_core_vec): Init match_priority field.
797
798 2011-08-05  Alan Modra  <amodra@gmail.com>
799
800         * elf64-ppc.c (maybe_strip_output): New function.
801         (ppc64_elf_size_stubs): Use it to strip .branch_lt and .eh_frame.
802
803 2011-08-05  Alan Modra  <amodra@gmail.com>
804
805         PR ld/12762
806         * elflink.c (_bfd_elf_section_already_linked): Return matched
807         status.  Remove COFF comdat section handling.
808         * linker.c (_bfd_generic_section_already_linked): Return matched
809         status.  Don't set SEC_GROUP in l_flags for plugin entries.
810         (bfd_section_already_linked): Update prototype.
811         * targets.c (_section_already_linked): Likewise.
812         * elf-bfd.h (_bfd_elf_section_already_linked): Likewise.
813         * libbfd-in.h (_bfd_generic_section_already_linked): Likewise.
814         (_bfd_nolink_section_already_linked): Update.
815         * libbfd.h: Regenerate.
816         * bfd-in2.h: Regenerate.
817
818 2011-08-05  Alan Modra  <amodra@gmail.com>
819
820         * elf32-ppc.c: Include dwarf2.h.
821         (struct ppc_elf_link_hash_table): Add glink_eh_frame.
822         (ppc_elf_create_glink): Create .eh_frame section.
823         (glink_eh_frame_cie): New array.
824         (ppc_elf_size_dynamic_sections): Size glink_eh_frame.
825         (ppc_elf_finish_dynamic_sections): Write glink_eh_frame.
826
827 2011-08-04  Tristan Gingold  <gingold@adacore.com>
828
829         * vms-alpha.c (_bfd_vms_write_eeom): Round vms_linkage_index.
830         (_bfd_vms_write_etir): Initialize vms_linkage_index to 0.
831
832 2011-08-03  Tristan Gingold  <gingold@adacore.com>
833
834         * mach-o.c (bfd_mach_o_canonicalize_symtab): Handle no symbols case.
835         (bfd_mach_o_read_symtab_symbols): Return if no symbols.
836
837 2011-08-02  Maciej W. Rozycki  <macro@codesourcery.com>
838
839         * elfxx-mips.c (check_4byte_branch): Remove function.
840         (check_relocated_bzc): New function.
841         (_bfd_mips_elf_relax_section): Permit the relaxation of LUI
842         instructions that immediately follow a compact branch
843         instruction.
844
845 2011-08-02  Alan Modra  <amodra@gmail.com>
846
847         * elf64-ppc.c (build_plt_stub): Correct emitted relocs when no
848         plt_static_chain.
849         (ppc_build_one_stub): Adjust get_relocs call to suit..
850         (ppc_size_one_stub): ..and reloc sizing.  Correct plt size corner case.
851
852 2011-08-01  H.J. Lu  <hongjiu.lu@intel.com>
853
854         PR ld/13048
855         * archures.c (bfd_mach_i386_intel_syntax): New.
856         (bfd_mach_i386_i8086): Updated.
857         (bfd_mach_i386_i386): Likewise.
858         (bfd_mach_x86_64): Likewise.
859         (bfd_mach_x64_32): Likewise.
860         (bfd_mach_i386_i386_intel_syntax): Likewise.
861         (bfd_mach_x86_64_intel_syntax): Likewise.
862         (bfd_mach_x64_32_intel_syntax): Likewise.
863         (bfd_mach_l1om): Likewise.
864         (bfd_mach_l1om_intel_syntax): Likewise.
865         (bfd_mach_k1om): Likewise.
866         (bfd_mach_k1om_intel_syntax): Likewise.
867
868         * bfd-in2.h: Regenerated.
869
870         * cpu-i386.c (bfd_i386_compatible): Check mach instead of
871         bits_per_address.
872         (bfd_x64_32_arch_intel_syntax): Set bits_per_address to 64.
873         (bfd_x64_32_arch): Likewise.
874
875         * elf64-x86-64.c: Include "libiberty.h".
876         (x86_64_elf_howto_table): Append x32 R_X86_64_32.
877         (elf_x86_64_rtype_to_howto): Support x32 R_X86_64_32.
878         (elf_x86_64_reloc_type_lookup): Likewise.
879         (elf_x86_64_reloc_name_lookup): Likewise.
880         (elf_x86_64_relocate_section): Likewise.
881         (elf_x86_64_check_relocs): Allow R_X86_64_64 relocations for x32.
882
883 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
884
885         * elfxx-mips.c (check_br32): Fix return type.
886
887 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
888
889         * elfxx-mips.c (bz_insn_16): Correct opcode mask.
890
891 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
892
893         * elfxx-mips.c: Adjust comments throughout.
894         (mips_elf_relax_delete_bytes): Reshape code.
895         (_bfd_mips_elf_relax_section): Remove check for
896         R_MICROMIPS_GPREL16 relocations.  Reshape code.
897
898 2011-07-28  Roland McGrath  <mcgrathr@google.com>
899
900         * elf32-i386.c (NACL_PLT_ENTRY_SIZE, NACLMASK): New macros.
901         (elf_i386_nacl_plt0_entry): New variable.
902         (elf_i386_plt_entry): New variable.
903         (elf_i386_nacl_pic_plt0_entry): New variable.
904         (elf_i386_nacl_pic_plt_entry): New variable.
905         (elf_i386_nacl_plt, elf_i386_nacl_arch_bed): New variables.
906         (elf_backend_arch_data): New macro setting for elf_i386_nacl_vec stanza.
907         (elf_backend_plt_alignment): Likewise.
908
909         * config.bfd: Handle i[3-7]86-*-nacl*.
910         * elf32-i386.c (bfd_elf32_i386_nacl_vec): New backend vector stanza.
911         * targets.c: Support bfd_elf32_i386_nacl_vec.
912         * configure.in: Likewise.
913         * configure: Regenerated.
914
915         * elf32-i386.c (struct elf_i386_plt_layout): New type.
916         (GET_PLT_ENTRY_SIZE): New macro.
917         (elf_i386_plt): New variable.
918         (struct elf_i386_backend_data): New member `plt'.
919         (elf_i386_arch_bed): Add initializer for it.
920         (elf_i386_vxworks_arch_bed): Likewise.
921         (elf_i386_allocate_dynrelocs): Use GET_PLT_ENTRY_SIZE.
922         (elf_i386_plt_sym_val): Likewise.
923         (elf_i386_relocate_section): Likewise.
924         (elf_i386_finish_dynamic_symbol): Likewise.
925         Also use other elf_i386_plt_layout members for PLT details.
926         (elf_i386_finish_dynamic_sections): Likewise.
927
928         * elf32-i386.c (struct elf_i386_backend_data): New type.
929         (get_elf_i386_backend_data): New macro.
930         (elf_i386_arch_bed): New variable.
931         (elf_backend_arch_data): New macro.
932         (struct elf_i386_link_hash_table): Remove plt0_pad_byte and is_vxworks.
933         (elf_i386_link_hash_table_create): Don't initialize them.
934         (elf_i386_create_dynamic_sections): Find is_vxworks flags in
935         elf_i386_backend_data, not elf_i386_link_hash_table.
936         (elf_i386_adjust_dynamic_symbol): Likewise.
937         (elf_i386_allocate_dynrelocs): Likewise.
938         (elf_i386_readonly_dynrelocs): Likewise.
939         (elf_i386_size_dynamic_sections): Likewise.
940         (elf_i386_relocate_section): Likewise.
941         (elf_i386_finish_dynamic_symbol): Likewise.
942         (elf_i386_finish_dynamic_sections): Likewise.  Same for plt0_pad_byte.
943         (elf_i386_vxworks_link_hash_table_create): Function removed.
944         (elf_i386_vxworks_arch_bed): New variable.
945         (elf_backend_arch_data): New macro in elf32-i386-vxworks stanza.
946
947         * elf-bfd.h (elf_backend_data): New member arch_backend_data.
948         * elfxx-target.h (elf_backend_arch_data): New macro.
949         (elfNN_bed): Use it as initializer for the new member.
950
951 2011-07-28  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
952
953         * elf64-hppa.c (elf_hppa_final_link_relocate): Fix handling of out
954         of range branches.
955
956 2011-07-26  Jakub Jelinek  <jakub@redhat.com>
957
958         * dwarf2.c (dwarf_debug_sections): Add .debug_macro
959         and .zdebug_macro entry.
960         (dwarf_debug_section_enum): Add debug_macro.
961
962 2011-07-26  Alan Modra  <amodra@gmail.com>
963
964         * elf64-ppc.c: Include dwarf2.h.
965         (struct ppc_link_hash_table): Add glink_eh_frame.
966         (create_linkage_sections): Create .eh_frame section.
967         (ppc64_elf_size_dynamic_sections): Arrange to drop unneeded
968         glink_eh_frame.
969         (glink_eh_frame_cie): New array.
970         (ppc64_elf_size_stubs): Size glink_eh_frame.
971         (ppc64_elf_build_stubs): Init glink_eh_frame contents.
972         (ppc64_elf_finish_dynamic_sections): Write glink_eh_frame.
973
974 2011-07-25  Hans-Peter Nilsson  <hp@bitrange.com>
975
976         PR ld/12815
977         * elf64-mmix.c (struct _mmix_elf_section_data): New members
978         has_warned_bpo and has_warned_pushj.
979         (mmix_final_link_relocate): Remove PARAMS and PTR macros,
980         converting to ISO C.  Add new parameter error_message.  All
981         callers changed.
982         (mmix_elf_perform_relocation): Ditto.
983         <case R_MMIX_PUSHJ_STUBBABLE, case R_MMIX_BASE_PLUS_OFFSET>:
984         Handle the case where mmix_elf_check_common_relocs has not been
985         called, missing preparations for relocs of the respective type.
986
987 2011-07-24  Chao-ying Fu  <fu@mips.com>
988             Ilie Garbacea  <ilie@mips.com>
989             Maciej W. Rozycki  <macro@codesourcery.com>
990             Joseph Myers  <joseph@codesourcery.com>
991             Catherine Moore  <clm@codesourcery.com>
992             Richard Sandiford  <rdsandiford@googlemail.com>
993
994         * archures.c (bfd_mach_mips_micromips): New macro.
995         * cpu-mips.c (I_micromips): New enum value.
996         (arch_info_struct): Add bfd_mach_mips_micromips.
997         * elfxx-mips.h (_bfd_mips_elf_is_target_special_symbol): New
998         prototype.
999         (_bfd_mips_elf_relax_section): Likewise.
1000         (_bfd_mips16_elf_reloc_unshuffle): Rename to...
1001         (_bfd_mips_elf_reloc_unshuffle): ... this.  Handle microMIPS
1002         ASE.
1003         (_bfd_mips16_elf_reloc_shuffle): Rename to...
1004         (_bfd_mips_elf_reloc_shuffle): ... this.  Handle microMIPS ASE.
1005         (gprel16_reloc_p): Handle microMIPS ASE.
1006         (literal_reloc_p): New function.
1007         * elf32-mips.c (elf_micromips_howto_table_rel): New variable.
1008         (_bfd_mips_elf32_gprel16_reloc): Handle microMIPS ASE.
1009         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
1010         and _bfd_mips_elf_reloc_shuffle changes.
1011         (mips_elf_gprel32_reloc): Update comment.
1012         (micromips_reloc_map): New variable.
1013         (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE.
1014         (mips_elf32_rtype_to_howto): Likewise.
1015         (mips_info_to_howto_rel): Likewise.
1016         (bfd_elf32_bfd_is_target_special_symbol): Define.
1017         (bfd_elf32_bfd_relax_section): Likewise.
1018         * elf64-mips.c (micromips_elf64_howto_table_rel): New variable.
1019         (micromips_elf64_howto_table_rela): Likewise.
1020         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
1021         and _bfd_mips_elf_reloc_shuffle changes.
1022         (micromips_reloc_map): Likewise.
1023         (bfd_elf64_bfd_reloc_type_lookup): Handle microMIPS ASE.
1024         (bfd_elf64_bfd_reloc_name_lookup): Likewise.
1025         (mips_elf64_rtype_to_howto): Likewise.
1026         (bfd_elf64_bfd_is_target_special_symbol): Define.
1027         * elfn32-mips.c (elf_micromips_howto_table_rel): New variable.
1028         (elf_micromips_howto_table_rela): Likewise.
1029         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
1030         and _bfd_mips_elf_reloc_shuffle changes.
1031         (micromips_reloc_map): Likewise.
1032         (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE.
1033         (bfd_elf32_bfd_reloc_name_lookup): Likewise.
1034         (mips_elf_n32_rtype_to_howto): Likewise.
1035         (bfd_elf32_bfd_is_target_special_symbol): Define.
1036         * elfxx-mips.c (LA25_LUI_MICROMIPS_1): New macro.
1037         (LA25_LUI_MICROMIPS_2): Likewise.
1038         (LA25_J_MICROMIPS_1, LA25_J_MICROMIPS_2): Likewise.
1039         (LA25_ADDIU_MICROMIPS_1, LA25_ADDIU_MICROMIPS_2): Likewise.
1040         (TLS_RELOC_P): Handle microMIPS ASE.
1041         (mips_elf_create_stub_symbol): Adjust value of stub symbol if
1042         target is a microMIPS function.
1043         (micromips_reloc_p): New function.
1044         (micromips_reloc_shuffle_p): Likewise.
1045         (got16_reloc_p, call16_reloc_p): Handle microMIPS ASE.
1046         (got_disp_reloc_p, got_page_reloc_p): New functions.
1047         (got_ofst_reloc_p): Likewise.
1048         (got_hi16_reloc_p, got_lo16_reloc_p): Likewise.
1049         (call_hi16_reloc_p, call_lo16_reloc_p): Likewise.
1050         (hi16_reloc_p, lo16_reloc_p, jal_reloc_p): Handle microMIPS ASE.
1051         (micromips_branch_reloc_p): New function.
1052         (tls_gd_reloc_p, tls_ldm_reloc_p): Likewise.
1053         (tls_gottprel_reloc_p): Likewise.
1054         (_bfd_mips16_elf_reloc_unshuffle): Rename to...
1055         (_bfd_mips_elf_reloc_unshuffle): ... this.  Handle microMIPS
1056         ASE.
1057         (_bfd_mips16_elf_reloc_shuffle): Rename to...
1058         (_bfd_mips_elf_reloc_shuffle): ... this.  Handle microMIPS ASE.
1059         (_bfd_mips_elf_lo16_reloc): Handle microMIPS ASE.
1060         (mips_tls_got_index, mips_elf_got_page): Likewise.
1061         (mips_elf_create_local_got_entry): Likewise.
1062         (mips_elf_relocation_needs_la25_stub): Likewise.
1063         (mips_elf_calculate_relocation): Likewise.
1064         (mips_elf_perform_relocation): Likewise.
1065         (_bfd_mips_elf_symbol_processing): Likewise.
1066         (_bfd_mips_elf_add_symbol_hook): Likewise.
1067         (_bfd_mips_elf_link_output_symbol_hook): Likewise.
1068         (mips_elf_add_lo16_rel_addend): Likewise.
1069         (_bfd_mips_elf_check_relocs): Likewise.
1070         (mips_elf_adjust_addend): Likewise.
1071         (_bfd_mips_elf_relocate_section): Likewise.
1072         (mips_elf_create_la25_stub): Likewise.
1073         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1074         (_bfd_mips_elf_gc_sweep_hook): Likewise.
1075         (_bfd_mips_elf_is_target_special_symbol): New function.
1076         (mips_elf_relax_delete_bytes): Likewise.
1077         (opcode_descriptor): New structure.
1078         (RA): New macro.
1079         (OP32_SREG, OP32_TREG, OP16_VALID_REG): Likewise.
1080         (b_insns_32, bc_insn_32, bz_insn_32, bzal_insn_32): New variables.
1081         (beq_insn_32): Likewise.
1082         (b_insn_16, bz_insn_16): New variables.
1083         (BZC32_REG_FIELD): New macro.
1084         (bz_rs_insns_32, bz_rt_insns_32): New variables.
1085         (bzc_insns_32, bz_insns_16):Likewise.
1086         (BZ16_REG, BZ16_REG_FIELD): New macros.
1087         (jal_insn_32_bd16, jal_insn_32_bd32): New variables.
1088         (jal_x_insn_32_bd32): Likewise.
1089         (j_insn_32, jalr_insn_32): Likewise.
1090         (ds_insns_32_bd16, ds_insns_32_bd32): Likewise.
1091         (jalr_insn_16_bd16, jalr_insn_16_bd32, jr_insn_16): Likewise.
1092         (JR16_REG): New macro.
1093         (ds_insns_16_bd16): New variable.
1094         (lui_insn): Likewise.
1095         (addiu_insn, addiupc_insn): Likewise.
1096         (ADDIUPC_REG_FIELD): New macro.
1097         (MOVE32_RD, MOVE32_RS): Likewise.
1098         (MOVE16_RD_FIELD, MOVE16_RS_FIELD): Likewise.
1099         (move_insns_32, move_insns_16): New variables.
1100         (nop_insn_32, nop_insn_16): Likewise.
1101         (MATCH): New macro.
1102         (find_match): New function.
1103         (check_br16_dslot, check_br32_dslot): Likewise.
1104         (check_br16, check_br32): Likewise.
1105         (IS_BITSIZE): New macro.
1106         (check_4byte_branch): New function.
1107         (_bfd_mips_elf_relax_section): Likewise.
1108         (_bfd_mips_elf_merge_private_bfd_data): Disallow linking MIPS16
1109         and microMIPS modules together.
1110         (_bfd_mips_elf_print_private_bfd_data): Handle microMIPS ASE.
1111         * reloc.c (BFD_RELOC_MICROMIPS_7_PCREL_S1): New relocation.
1112         (BFD_RELOC_MICROMIPS_10_PCREL_S1): Likewise.
1113         (BFD_RELOC_MICROMIPS_16_PCREL_S1): Likewise.
1114         (BFD_RELOC_MICROMIPS_GPREL16): Likewise.
1115         (BFD_RELOC_MICROMIPS_JMP, BFD_RELOC_MICROMIPS_HI16): Likewise.
1116         (BFD_RELOC_MICROMIPS_HI16_S): Likewise.
1117         (BFD_RELOC_MICROMIPS_LO16): Likewise.
1118         (BFD_RELOC_MICROMIPS_LITERAL): Likewise.
1119         (BFD_RELOC_MICROMIPS_GOT16): Likewise.
1120         (BFD_RELOC_MICROMIPS_CALL16): Likewise.
1121         (BFD_RELOC_MICROMIPS_GOT_HI16): Likewise.
1122         (BFD_RELOC_MICROMIPS_GOT_LO16): Likewise.
1123         (BFD_RELOC_MICROMIPS_CALL_HI16): Likewise.
1124         (BFD_RELOC_MICROMIPS_CALL_LO16): Likewise.
1125         (BFD_RELOC_MICROMIPS_SUB): Likewise.
1126         (BFD_RELOC_MICROMIPS_GOT_PAGE): Likewise.
1127         (BFD_RELOC_MICROMIPS_GOT_OFST): Likewise.
1128         (BFD_RELOC_MICROMIPS_GOT_DISP): Likewise.
1129         (BFD_RELOC_MICROMIPS_HIGHEST): Likewise.
1130         (BFD_RELOC_MICROMIPS_HIGHER): Likewise.
1131         (BFD_RELOC_MICROMIPS_SCN_DISP): Likewise.
1132         (BFD_RELOC_MICROMIPS_JALR): Likewise.
1133         (BFD_RELOC_MICROMIPS_TLS_GD): Likewise.
1134         (BFD_RELOC_MICROMIPS_TLS_LDM): Likewise.
1135         (BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16): Likewise.
1136         (BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16): Likewise.
1137         (BFD_RELOC_MICROMIPS_TLS_GOTTPREL): Likewise.
1138         (BFD_RELOC_MICROMIPS_TLS_TPREL_HI16): Likewise.
1139         (BFD_RELOC_MICROMIPS_TLS_TPREL_LO16): Likewise.
1140         * bfd-in2.h: Regenerate.
1141         * libbfd.h: Regenerate.
1142
1143 2011-07-22  H.J. Lu  <hongjiu.lu@intel.com>
1144
1145         * Makefile.am (ALL_MACHINES): Add cpu-k1om.lo.
1146         (ALL_MACHINES_CFILES): Add cpu-k1om.c.
1147         * Makefile.in: Regenerated.
1148
1149         * archures.c (bfd_architecture): Add bfd_arch_k1om.
1150         (bfd_k1om_arch): New.
1151         (bfd_archures_list): Add &bfd_k1om_arch.
1152         * bfd-in2.h: Regenerated.
1153
1154         * config.bfd (targ64_selvecs): Add bfd_elf64_k1om_vec if
1155         bfd_elf64_x86_64_vec is supported.  Add bfd_elf64_k1om_freebsd_vec
1156         if bfd_elf64_x86_64_freebsd_vec is supported.
1157         (targ_selvecs): Likewise.
1158
1159         * configure.in: Support bfd_elf64_k1om_vec and
1160         bfd_elf64_k1om_freebsd_vec.
1161         * configure: Regenerated.
1162
1163         * cpu-k1om.c: New.
1164
1165         * elf64-x86-64.c (elf64_k1om_elf_object_p): New.
1166         (bfd_elf64_k1om_vec): Likewise.
1167         (bfd_elf64_k1om_freebsd_vec): Likewise.
1168
1169         * targets.c (bfd_elf64_k1om_vec): New.
1170         (bfd_elf64_k1om_freebsd_vec): Likewise.
1171         (_bfd_target_vector): Add bfd_elf64_k1om_vec and
1172         bfd_elf64_k1om_freebsd_vec.
1173
1174 2011-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1175
1176         Fix false coff-go32-exe matches.
1177         * coff-i386.c (TARGET_SYM) <_bfd_check_format>: Conditionally use
1178         COFF_CHECK_FORMAT.
1179         * coff-stgo32.c (go32_check_format): New forward declaration.
1180         (COFF_CHECK_FORMAT): New defintion.
1181         (go32_check_format): New function.
1182
1183 2011-07-15  Alan Modra  <amodra@gmail.com>
1184
1185         * configure.in: Bump version.
1186         * configure: Regenerate.
1187
1188 2011-07-14  Alan Modra  <amodra@gmail.com>
1189
1190         * linker.c (_bfd_generic_section_already_linked): Set l_flags.
1191         * elf-bfd.h (struct already_linked): Forward declare.
1192
1193 2011-07-14  Alan Modra  <amodra@gmail.com>
1194
1195         * elflink.c (_bfd_elf_fix_symbol_flags): Loop on indirect syms.
1196         (_bfd_elf_adjust_dynamic_symbol): Remove FIXME.
1197
1198 2011-07-14  Alan Modra  <amodra@gmail.com>
1199
1200         * elf64-ppc.c (struct ppc_link_hash_table): Add plt_static_chain.
1201         (build_plt_stub): Add plt_static_chain param, don't load r11 if false.
1202         (build_tls_get_addr_stub): Likewise.
1203         (ppc_build_one_stub): Update calls to above.
1204         (ppc_size_one_stub): Adjust stub size.
1205         (ppc64_elf_size_stubs): Add plt_static_chain param, save to htab.
1206         * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype.
1207
1208 2011-07-12  Nick Clifton  <nickc@redhat.com>
1209
1210         * elf32-arm.c (elf32_arm_section_flags): Delete.
1211         (elf_backend_section_flags): Remove.
1212
1213 2011-07-11  H.J. Lu  <hongjiu.lu@intel.com>
1214
1215         PR ld/12982
1216         * elflink.c (bfd_elf_size_dynamic_sections): Also skip BFD_PLUGIN
1217         when setting stack_flags.
1218
1219 2011-07-11  Catherine Moore  <clm@codesourcery.com>
1220
1221         * aout-adobe.c (aout_32_bfd_lookup_section_flags): New definition.
1222         * aout-target.h (MY_bfd_lookup_section_flags): New definition.
1223         * aout-tic30.c (MY_bfd_lookup_section_flags): New definition.
1224         * bfd-in2.h: Regenerated.
1225         * bfd.c (bfd_lookup_section_flags): New definition.
1226         * binary.c (binary_bfd_lookup_section_flags): New definition.
1227         * bout.c (b_out_bfd_lookup_section_flags): New definition.
1228         * coff-alpha.c (_bfd_ecoff_bfd_lookup_section_flags): New definition.
1229         * coff-mips.c (_bfd_ecoff_bfd_lookup_section_flags): New definition.
1230         * coff-rs6000.c (rs6000coff_vec): Include
1231         bfd_generic_lookup_section_flags.
1232         (pmac_xcoff_vec): Likewise.
1233         * coffcode.h (coff_bfd_lookup_section_flags): New definition.
1234         * coff64-rs6000.c (rs6000coff64_vec): Include
1235         bfd_generic_lookup_section_flags.
1236         (aix5coff64_vec): Likewise.
1237         * ecoff.c (bfd_debug_section): Initialize flag_info field.
1238         * elf-bfd.h (elf_backend_lookup_section_flags_hook): Declare.
1239         (bfd_elf_lookup_section_flags): Declare.
1240         * elflink.c (bfd_elf_lookup_section_flags): New function.
1241         * elfxx-target.h (bfd_elfNN_bfd_lookup_section_flags): Define.
1242         (elf_backend_lookup_section_flags_hook): Define.
1243         (elf_backend_data): Add elf_backend_lookup_section_flags_hook.
1244         * i386msdos.c (msdos_bfd_lookup_section_flags): New define.
1245         * i386os9k.c (os9k_bfd_lookup_section_flags): New define.
1246         * ieee.c (ieee_bfd_lookup_section_flags): New define.
1247         * ihex.c (ihex_bfd_lookup_section_flags): New define.
1248         * libbfd-in.h (_bfd_nolink_bfd_lookup_section_flags): Declare.
1249         (bfd_generic_lookup_section_flags): Declare.
1250         * libbfd.h: Regenerated.
1251         * mach-o-target.c (bfd_mach_o_bfd_lookup_section_flags): New.
1252         * mmo.c (mmo_bfd_lookup_section_flags): New definition.
1253         * nlm-target.h (nlm_bfd_lookup_section_flags): New definition.
1254         * oasys.c (oasys_bfd_lookup_section_flags): New definition.
1255         * pef.c (bfd_pef_bfd_lookup_section_flags): New definition.
1256         * plugin.c (bfd_plugin_bfd_lookup_section_flags): New definition.
1257         * ppcboot.c (ppcboot_bfd_lookup_section_flags): New definition.
1258         * reloc.c (bfd_generic_lookup_section_flags): New function.
1259         * som.c (som_bfd_lookup_section_flags): New definition.
1260         * srec.c (srec_bfd_lookup_section_flags): New definition.
1261         * targets.c (flag_info): Declare.
1262         (NAME##_bfd_lookup_section_flags): Add to LINK jump table.
1263         (_bfd_lookup_section_flags): New.
1264         * tekhex.c (tekhex_bfd_lookup_section_flags): New definition.
1265         * versados.c (versados_bfd_lookup_section_flags): New definition.
1266         * vms-alpha.c (alpha_vms_bfd_lookup_section_flag): New definition.
1267         * xsym.c (bfd_sym_bfd_lookup_section_flags): New definition.
1268
1269 2011-07-11  H.J. Lu  <hongjiu.lu@intel.com>
1270
1271         PR ld/12978
1272         * elfnn-ia64.c (count_dyn_reloc): Fix a typo.
1273
1274 2011-07-09  Alan Modra  <amodra@gmail.com>
1275
1276         PR ld/12942
1277         * elflink.c (elf_link_add_object_symbols): Use elf_discarded_section
1278         rather than kept_section to determine whether a symbol is from
1279         a discarded section.
1280         * cofflink.c (coff_link_add_symbols): Make symbols from discarded
1281         sections appear undefined.
1282
1283 2011-07-09  H.J. Lu  <hongjiu.lu@intel.com>
1284
1285         PR ld/12942
1286         * elf-bfd.h (_bfd_elf_section_already_linked): Replace
1287         "asection *" with "struct already_linked *".
1288         * libbfd-in.h (_bfd_nolink_section_already_linked): Likewise.
1289         (_bfd_generic_section_already_linked): Likewise.
1290         (bfd_section_already_linked_table_insert): Likewise.
1291         (struct already_linked): New.
1292         (struct bfd_section_already_linked): Use it.
1293         * elflink.c (_bfd_elf_section_already_linked): Replace.
1294         "asection *" with "struct already_linked *".  Replace the plugin
1295         dummy with the LTO output.
1296         * linker.c (_bfd_generic_section_already_linked): Likewise.
1297         * targets.c (struct already_linked): Add forward declaration.
1298         (bfd_target): Replace "struct bfd_section *" with
1299         "struct already_linked *" in _section_already_linked.
1300         * bfd-in2.h: Regenerate.
1301         * libbfd.h: Regenerate.
1302
1303 2011-07-06  Tristan Gingold  <gingold@adacore.com>
1304
1305         * mach-o.h: Move loader related definitions to
1306         include/mach-o/loader.h.  Include it.
1307
1308 2011-07-05  H.J. Lu  <hongjiu.lu@intel.com>
1309
1310         * elf64-x86-64.c (elf_backend_post_process_headers): Always
1311         define to _bfd_elf_set_osabi.
1312
1313 2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
1314             Thomas Schwinge  <thomas@schwinge.name>
1315
1316         PR binutils/12913
1317         * elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of
1318         ELFOSABI_LINUX alias.
1319         * elf32-hppa.c: Likewise.
1320         * elf32-i370.c: Likewise.
1321         * elf64-hppa.c: Likewise.
1322
1323 2011-07-01  Ian Lance Taylor  <iant@google.com>
1324
1325         * elf32-i386.c (elf_i386_eh_frame_plt): Correct expression: change
1326         DW_OP_lit3 to DW_OP_lit2.
1327
1328 2011-07-01  Alan Modra  <amodra@gmail.com>
1329
1330         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't look at
1331         dyn relocs when called to copy flags for a weak sym.
1332         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
1333         (ppc64_elf_merge_private_bfd_data): Delete.
1334         (bfd_elf64_bfd_merge_private_bfd_data): Define as
1335         _bfd_generic_verify_endian_match.
1336
1337 2011-06-30  Bernd Schmidt  <bernds@codesourcery.com>
1338
1339         * bfd/elf32-tic6x.c (elf32_tic6x_set_osabi): Also set it if
1340         link_info is NULL.
1341
1342 2011-06-28  Tristan Gingold  <gingold@adacore.com>
1343
1344         * vms-alpha.c (vms_private_data_struct): Make vms_linkage_index
1345         unsigned int.
1346         (_bfd_vms_write_etir): Write linkage index from reloc.
1347
1348 2011-06-28  Fawzi Mohamed <fawzi.mohamed@nokia.com>
1349
1350         * mach-o.c (bfd_mach_o_read_command): Also ignore
1351         BFD_MACH_O_LC_ROUTINES_64.
1352
1353 2011-06-27  Tristan Gingold  <gingold@adacore.com>
1354
1355         * vms-alpha.c (_bfd_vms_write_etir): Use 'section' to get current
1356         section target index.
1357
1358 2011-06-27  Nick Clifton  <nickc@redhat.com>
1359
1360         * cisco-core.c (cisco_core_little_vec): Add initialization of
1361         match_priority field.
1362
1363 2011-06-27  Tristan Gingold  <gingold@adacore.com>
1364
1365         * cache.c: Include bfd_stdint.h.
1366         (cache_bmmap): Change profile.  Return region start and size.
1367         * bfdio.c (struct bfd_iovec): Change bmmap profile.
1368         (bfd_mmap): Change profile and adjust.   Update comment.
1369         (memory_bmmap): Change profile.
1370         * opncls.c (opncls_bmmap): Change profile.
1371         * vms-lib.c (vms_lib_bmmap): Likewise.
1372         * libbfd.h: Regenerate.
1373         * bfd-in2.h: Regenerate.
1374
1375 2011-06-27  Tristan Gingold  <gingold@adacore.com>
1376
1377         * vms-misc.c (vms_time_to_time_t): Adjust overflow detection.
1378         Add comment.
1379
1380 2011-06-25  H.J. Lu  <hongjiu.lu@intel.com>
1381
1382         * elf64-x86-64.c (elf_backend_post_process_headers): Don't
1383         define for FreeBSD/x86-64 nor FreeBSD/L1OM.  Define for L1OM.
1384
1385 2011-06-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
1386
1387         * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Initialize
1388         PLT_EH_FRAME.
1389         * elf32-i386.c (elf_i386_link_hash_table): Likewise.
1390
1391 2011-06-24  Richard Henderson  <rth@redhat.com>
1392
1393         PR ld/12928
1394         * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Recover the
1395         tlsgd insn before swapping adjacent insns.
1396
1397 2011-06-24  Tristan Gingold  <gingold@adacore.com>
1398
1399         * vms-alpha.c (alpha_vms_slurp_relocs): Add a guard for relocs in the
1400         absolute section.
1401
1402 2011-06-24  Alan Modra  <amodra@gmail.com>
1403
1404         PR ld/12921
1405         * elf.c (assign_file_positions_for_load_sections): Don't align
1406         sh_offset for all SHT_NOBITS sections here, just .tbss sections
1407         that don't get a PT_LOAD.
1408
1409 2011-06-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1410
1411         * elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE.
1412         (sh_elf_check_relocs): Likewise.
1413
1414 2011-06-22  Richard Henderson  <rth@redhat.com>
1415
1416         * elf64-alpha.c (elf64_alpha_check_relocs): No dynamic reloc for
1417         TPREL in a PIE image.
1418         (alpha_dynamic_entries_for_reloc): Likewise.
1419         (elf64_alpha_relocate_section): Allow TPREL in PIE images.
1420         (elf64_alpha_relax_got_load): Likewise.
1421
1422 2011-06-22  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
1423
1424         * elf32-arm.c (elf32_arm_final_link_relocate): Allow R_ARM_TLS_LE32
1425         for PIE.
1426
1427 2011-06-22  Alan Modra  <amodra@gmail.com>
1428
1429         * elflink.c (_bfd_elf_merge_symbol): Allow type changes for
1430         plugin symbols.  Fix segfault on linker scrip defined syms.
1431
1432 2011-06-20  Jakub Jelinek  <jakub@redhat.com>
1433
1434         PR ld/12570
1435         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Allow no relocations
1436         at all for linker created .eh_frame sections.
1437         (_bfd_elf_discard_section_eh_frame): Handle linker created
1438         .eh_frame sections with no relocations.
1439         * elf64-x86-64.c: Include dwarf2.h.
1440         (elf_x86_64_eh_frame_plt): New variable.
1441         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
1442         PLT_FDE_LEN_OFFSET): Define.
1443         (struct elf_x86_64_link_hash_table): Add plt_eh_frame field.
1444         (elf_x86_64_create_dynamic_sections): Create and fill in
1445         .eh_frame section for .plt section.
1446         (elf_x86_64_size_dynamic_sections): Write .plt section size
1447         into .eh_frame FDE covering .plt section.
1448         (elf_x86_64_finish_dynamic_sections): Write .plt section
1449         start into .eh_frame FDE covering .plt section.  Call
1450         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
1451         (elf_backend_plt_alignment): Define to 4.
1452         * elf32-i386.c: Include dwarf2.h.
1453         (elf_i386_eh_frame_plt): New variable.
1454         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
1455         PLT_FDE_LEN_OFFSET): Define.
1456         (struct elf_i386_link_hash_table): Add plt_eh_frame field.
1457         (elf_i386_create_dynamic_sections): Create and fill in
1458         .eh_frame section for .plt section.
1459         (elf_i386_size_dynamic_sections): Write .plt section size
1460         into .eh_frame FDE covering .plt section.
1461         (elf_i386_finish_dynamic_sections): Write .plt section
1462         start into .eh_frame FDE covering .plt section.  Call
1463         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
1464         (elf_backend_plt_alignment): Define to 4.
1465
1466 2011-06-19  H.J. Lu  <hongjiu.lu@intel.com>
1467
1468         * elf64-x86-64.c (elf_backend_post_process_headers): Defined
1469         for x32.
1470
1471 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
1472
1473         * elf64-x86-64.c: Include <stdarg.h> and CORE_HEADER if
1474         CORE_HEADER is defined.
1475         (elf_x86_64_write_core_note): New.
1476         (elf_backend_write_core_note): Likewise.
1477
1478         * hosts/x86-64linux.h (uint64_t): New.
1479         (user_regsx32_struct): Likewise.
1480         (elf_gregx32_t): Likewise.
1481         (ELF_NGREGX32): Likewise.
1482         (elf_gregsetx32_t): Likewise.
1483         (elf_prstatusx32): Likewise.
1484         (prstatusx32_t): Likewise.
1485         (user_fpregs32_struct): Removed.
1486         (user_fpxregs32_struct): Likewise.
1487         (user32): Likewise.
1488         (elf_fpregset32_t): Likewise.
1489         (elf_fpxregset32_t): Likewise.
1490         (prgregset32_t): Likewise.
1491         (prfpregset32_t): Likewise.
1492
1493 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
1494
1495         * elf64-x86-64.c (elf_x86_64_grok_prstatus): Support x32.
1496         (elf_x86_64_grok_psinfo): Likewise.
1497
1498 2011-06-16  Nick Clifton  <nickc@redhat.com>
1499
1500         * elf.c (elf_find_function): Fail if not provided with a symbol
1501         table.
1502
1503 2011-06-15  Ulrich Weigand  <ulrich.weigand@linaro.org>
1504
1505         * elf-bfd.h (elfcore_write_arm_vfp): Add prototype.
1506         * elf.c (elfcore_grok_arm_vfp): New function.
1507         (elfcore_grok_note): Call it to handle NT_ARM_VFP notes.
1508         (elfcore_write_arm_vfp): New function.
1509         (elfcore_write_register_note): Call it to handle .reg-arm-vfp.
1510
1511 2011-06-14  Richard Henderson  <rth@redhat.com>
1512
1513         * elf64-alpha.c (elf64_alpha_copy_indirect_symbol): Rename from
1514         elf64_alpha_merge_ind_symbols; adjust for the generic interface.
1515         (elf64_alpha_always_size_sections): Don't call
1516         elf64_alpha_merge_ind_symbols.
1517         (elf_backend_copy_indirect_symbol): New.
1518
1519 2011-06-14  Alan Modra  <amodra@gmail.com>
1520
1521         PR ld/12887
1522         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Check sec_info_type
1523         before doing anything.
1524         (_bfd_elf_discard_section_eh_frame): Likewise.
1525
1526 2011-06-14  Alan Modra  <amodra@gmail.com>
1527
1528         * Makefile.am: Formatting.
1529         * Makefile.in: Regenerate.
1530         * configure.in (bfd_elf64_tilegx_vec): Add elfxx-tilegx.lo.
1531         * po/SRC-POTFILES.in: Regnerate.
1532
1533 2011-06-14  Alan Modra  <amodra@gmail.com>
1534
1535         * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Don't use PTR.
1536         (allocate_dynrelocs, readonly_dynrelocs): Replace PTR with void *.
1537         Don't handle warning symbols here.
1538         * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): As above.
1539         (allocate_dynrelocs, readonly_dynrelocs): As above.
1540
1541 2011-06-14  Alan Modra  <amodra@gmail.com>
1542
1543         PR ld/12851
1544         * elflink.c (_bfd_elf_gc_mark_extra_sections): New function.
1545         (elf_gc_sweep): Don't treat debug and sections like .comment
1546         specially here.
1547         (bfd_elf_gc_sections): Treat note sections as gc roots only when
1548         not part of a group.  Always call gc_mark_extra_sections.
1549         * elf-bfd.h (_bfd_elf_gc_mark_extra_sections): Declare.
1550         * elfxx-target.h (elf_backend_gc_mark_extra_sections): Default to
1551         _bfd_elf_gc_mark_extra_sections.
1552         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Call
1553         _bfd_elf_gc_mark_extra_sections.
1554         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): Likewise.
1555
1556 2011-06-13  Nick Clifton  <nickc@redhat.com>
1557
1558         * elf32-tilepro.c (tilepro_elf_check_relocs): Delete unused local
1559         variable 'local_got_offsets'.
1560         * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1561         (tilegx_finish_dyn): Delete unused local variable 'abi_64_p'.
1562
1563 2011-06-13  Walter Lee  <walt@tilera.com>
1564
1565         * Makefile.am (ALL_MACHINES): Add cpu-tilegx.lo and cpu-tilepro.lo.
1566         (ALL_MACHINE_CFILES): Add cpu-tilegx.c and cpu-tilepro.c.
1567         (BFD32_BACKENDS): Add elf32-tilegx.lo, elf32-tilepro.lo,
1568         and elfxx-tilegx.lo.
1569         (BFD32_BACKENDS_CFILES): Add elf32-tilegx.c elf32-tilepro.c, and
1570         elfxx-tilegx.c.
1571         (BFD64_BACKENDS): Add elf64-tilegx.lo.
1572         (BFD64_BACKENDS_CFILES): Add elf64-tilegx.c.
1573         * Makefile.in: Regenerate.
1574         * arctures.c (bfd_architecture): Define bfd_arch_tilepro,
1575         bfd_arch_tilegx, bfd_mach_tilepro, bfd_mach_tilegx.
1576         (bfd_arch_info): Add bfd_tilegx_arch, bfd_tilepro_arch.
1577         (bfd_archures_list): Add bfd_tilegx_arch, bfd_tilepro_arch.
1578         bfd-in2.h: Regenerate.
1579         * config.bfd: Handle tilegx-*-* and tilepro-*-*.
1580         * configure.in: Handle bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
1581         and bfd_elf64_tilegx_vec.
1582         * configure: Regenerate.
1583         * elf-bfd.h (enum elf_target_id): Define TILEGX_ELF_DATA and
1584         TILEPRO_ELF_DATA.
1585         * libbfd.h: Regenerate.
1586         * reloc.c: Add BFD_RELOC_TILEPRO_{COPY, GLOB_DAT, JMP_SLOT,
1587         RELATIVE, BROFF_X1, JOFFLONG_X1, JOFFLONG_X1_PLT, IMM8_X0,
1588         IMM8_Y0, IMM8_X1, IMM8_Y1, DEST_IMM8_X1, MT_IMM15_X1, MF_IMM15_X1,
1589         IMM16_X0, IMM16_X1, IMM16_X0_LO, IMM16_X1_LO, IMM16_X0_HI,
1590         IMM16_X1_HI, IMM16_X0_HA, IMM16_X1_HA, IMM16_X0_PCREL,
1591         IMM16_X1_PCREL, IMM16_X0_LO_PCREL, IMM16_X1_LO_PCREL,
1592         IMM16_X0_HI_PCREL, IMM16_X1_HI_PCREL, IMM16_X0_HA_PCREL,
1593         IMM16_X1_HA_PCREL, IMM16_X0_GOT, IMM16_X1_GOT, IMM16_X0_GOT_LO,
1594         IMM16_X1_GOT_LO, IMM16_X0_GOT_HI, IMM16_X1_GOT_HI,
1595         IMM16_X0_GOT_HA, IMM16_X1_GOT_HA, MMSTART_X0, MMEND_X0,
1596         MMSTART_X1, MMEND_X1, SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1,
1597         IMM16_X0_TLS_GD, IMM16_X1_TLS_GD, IMM16_X0_TLS_GD_LO,
1598         IMM16_X1_TLS_GD_LO, IMM16_X0_TLS_GD_HI, IMM16_X1_TLS_GD_HI,
1599         IMM16_X0_TLS_GD_HA, IMM16_X1_TLS_GD_HA, IMM16_X0_TLS_IE,
1600         IMM16_X1_TLS_IE, IMM16_X0_TLS_IE_LO, IMM16_X1_TLS_IE_LO,
1601         IMM16_X0_TLS_IE_HI, IMM16_X1_TLS_IE_HI, IMM16_X0_TLS_IE_HA,
1602         IMM16_X1_TLS_IE_HA, TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
1603         Add BFD_RELOC_TILEGX_{HW0, HW1, HW2, HW3, HW0_LAST, HW1_LAST,
1604         HW2_LAST, COPY, GLOB_DAT, JMP_SLOT, RELATIVE, BROFF_X1,
1605         JUMPOFF_X1, JUMPOFF_X1_PLT, IMM8_X0, IMM8_Y0, IMM8_X1, IMM8_Y1,
1606         DEST_IMM8_X1, MT_IMM14_X1, MF_IMM14_X1, MMSTART_X0, MMEND_X0,
1607         SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1, IMM16_X0_HW0,
1608         IMM16_X1_HW0, IMM16_X0_HW1, IMM16_X1_HW1, IMM16_X0_HW2,
1609         IMM16_X1_HW2, IMM16_X0_HW3, IMM16_X1_HW3, IMM16_X0_HW0_LAST,
1610         IMM16_X1_HW0_LAST, IMM16_X0_HW1_LAST, IMM16_X1_HW1_LAST,
1611         IMM16_X0_HW2_LAST, IMM16_X1_HW2_LAST, IMM16_X0_HW0_PCREL,
1612         IMM16_X1_HW0_PCREL, IMM16_X0_HW1_PCREL, IMM16_X1_HW1_PCREL,
1613         IMM16_X0_HW2_PCREL, IMM16_X1_HW2_PCREL, IMM16_X0_HW3_PCREL,
1614         IMM16_X1_HW3_PCREL, IMM16_X0_HW0_LAST_PCREL,
1615         IMM16_X1_HW0_LAST_PCREL, IMM16_X0_HW1_LAST_PCREL,
1616         IMM16_X1_HW1_LAST_PCREL, IMM16_X0_HW2_LAST_PCREL,
1617         IMM16_X1_HW2_LAST_PCREL, IMM16_X0_HW0_GOT, IMM16_X1_HW0_GOT,
1618         IMM16_X0_HW1_GOT, IMM16_X1_HW1_GOT, IMM16_X0_HW2_GOT,
1619         IMM16_X1_HW2_GOT, IMM16_X0_HW3_GOT, IMM16_X1_HW3_GOT,
1620         IMM16_X0_HW0_LAST_GOT, IMM16_X1_HW0_LAST_GOT,
1621         IMM16_X0_HW1_LAST_GOT, IMM16_X1_HW1_LAST_GOT,
1622         IMM16_X0_HW2_LAST_GOT, IMM16_X1_HW2_LAST_GOT, IMM16_X0_HW0_TLS_GD,
1623         IMM16_X1_HW0_TLS_GD, IMM16_X0_HW1_TLS_GD, IMM16_X1_HW1_TLS_GD,
1624         IMM16_X0_HW2_TLS_GD, IMM16_X1_HW2_TLS_GD, IMM16_X0_HW3_TLS_GD,
1625         IMM16_X1_HW3_TLS_GD, IMM16_X0_HW0_LAST_TLS_GD,
1626         IMM16_X1_HW0_LAST_TLS_GD, IMM16_X0_HW1_LAST_TLS_GD,
1627         IMM16_X1_HW1_LAST_TLS_GD, IMM16_X0_HW2_LAST_TLS_GD,
1628         IMM16_X1_HW2_LAST_TLS_GD, IMM16_X0_HW0_TLS_IE,
1629         IMM16_X1_HW0_TLS_IE, IMM16_X0_HW1_TLS_IE, IMM16_X1_HW1_TLS_IE,
1630         IMM16_X0_HW2_TLS_IE, IMM16_X1_HW2_TLS_IE, IMM16_X0_HW3_TLS_IE,
1631         IMM16_X1_HW3_TLS_IE, IMM16_X0_HW0_LAST_TLS_IE,
1632         IMM16_X1_HW0_LAST_TLS_IE, IMM16_X0_HW1_LAST_TLS_IE,
1633         IMM16_X1_HW1_LAST_TLS_IE, IMM16_X0_HW2_LAST_TLS_IE,
1634         IMM16_X1_HW2_LAST_TLS_IE, TLS_DTPMOD64, TLS_DTPOFF64, TLS_TPOFF64,
1635         TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
1636         * targets.c (bfd_elf32_tilegx_vec): Declare.
1637         (bfd_elf32_tilepro_vec): Declare.
1638         (bfd_elf64_tilegx_vec): Declare.
1639         (bfd_target_vector): Add bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
1640         and bfd_elf64_tilegx_vec.
1641         * cpu-tilegx.c: New file.
1642         * cpu-tilepro.c: New file.
1643         * elf32-tilepro.h: New file.
1644         * elf32-tilepro.c: New file.
1645         * elf32-tilegx.c: New file.
1646         * elf32-tilegx.h: New file.
1647         * elf64-tilegx.c: New file.
1648         * elf64-tilegx.h: New file.
1649         * elfxx-tilegx.c: New file.
1650         * elfxx-tilegx.h: New file.
1651
1652 2011-06-13  Alan Modra  <amodra@gmail.com>
1653
1654         * linker.c (bfd_link_hash_traverse): Follow warning symbol link.
1655         (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle
1656         warning symbols here.
1657         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
1658         * elf32-arm.c (allocate_dynrelocs_for_symbol,
1659         elf32_arm_readonly_dynrelocs): Likewise.
1660         * elf32-bfin.c (bfin_discard_copies): Likewise.
1661         * elf32-cris.c (elf_cris_adjust_gotplt_to_got,
1662         elf_cris_discard_excess_dso_dynamics,
1663         elf_cris_discard_excess_program_dynamics): Likewise.
1664         * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs,
1665         clobber_millicode_symbols, readonly_dynrelocs): Likewise.
1666         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
1667         * elf32-i386.c (elf_i386_allocate_dynrelocs,
1668         elf_i386_readonly_dynrelocs): Likewise.
1669         * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1670         * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise.
1671         * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1672         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
1673         * elf32-microblaze.c (allocate_dynrelocs): Likewise.
1674         * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise.
1675         * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1676         * elf32-score.c (score_elf_sort_hash_table_f): Likewise.
1677         * elf32-score7.c (score_elf_sort_hash_table_f): Likewise.
1678         * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1679         * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs,
1680         elf32_tic6x_readonly_dynrelocs): Likewise.
1681         * elf32-vax.c (elf_vax_discard_copies): Likewise.
1682         * elf32-xstormy16.c (xstormy16_relax_plt_check,
1683         xstormy16_relax_plt_realloc): Likewise.
1684         * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise.
1685         * elf64-alpha.c (elf64_alpha_output_extsym,
1686         elf64_alpha_calc_got_offsets_for_symbol,
1687         elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise.
1688         * elf64-hppa.c (elf64_hppa_mark_exported_functions,
1689         allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions,
1690         elf_hppa_unmark_useless_dynamic_symbols,
1691         elf_hppa_remark_useless_dynamic_symbols): Likewise.
1692         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust,
1693         adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs,
1694         readonly_dynrelocs, merge_global_got, reallocate_got,
1695         undo_symbol_twiddle): Likewise.
1696         * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1697         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
1698         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs,
1699         elf_x86_64_readonly_dynrelocs): Likewise.
1700         * elflink.c (elf_link_renumber_hash_table_dynsyms,
1701         elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol,
1702         _bfd_elf_link_find_version_dependencies,
1703         _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol,
1704         _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets,
1705         elf_collect_hash_codes, elf_collect_gnu_hash_codes,
1706         elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol,
1707         elf_gc_propagate_vtable_entries_used,
1708         elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol,
1709         elf_gc_allocate_got_offsets): Likewise.
1710         * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free,
1711         elfNN_ia64_global_dyn_sym_thunk): Likewise.
1712         * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym,
1713         mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise.
1714         * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1715         * i386linux.c (linux_tally_symbols): Likewise.
1716         * m68klinux.c (linux_tally_symbols): Likewise.
1717         * sparclinux.c (linux_tally_symbols): Likewise.
1718         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
1719         * xcofflink.c (xcoff_post_gc_symbol): Likewise.
1720
1721         * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse
1722         function.  Update all callers.
1723         * aoutx.h (aout_link_write_other_symbol): Likewise.
1724         * pdp11.c (aout_link_write_other_symbol): Likewise.
1725         * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1726         * ecoff.c (ecoff_link_write_external): Likewise.
1727         * xcofflink.c (xcoff_write_global_symbol): Likewise.
1728         * vms-alpha.c (alpha_vms_link_output_symbol): Likewise.  Handle
1729         warning symbols.
1730         * ecoff.c (ecoff_link_hash_traverse): Delete.
1731         * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for
1732         _bfd_coff_write_global_sym.
1733         * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype.
1734         * libcoff.h: Regenerate.
1735
1736 2011-06-10  Nick Clifton  <nickc@redhat.com>
1737
1738         * elflink.c (_bfd_elf_link_create_dynamic_sections): If the
1739         backend does not provide a function for creating dynamic sections
1740         then fail.
1741         (bfd_elf_final_link): Issue a warning message if a dynamic section
1742         has the SHT_NOTE type.
1743         (bfd_elf_final_link): Do not look for dynamic strings in a section
1744         that does not have the SHT_STRTAB type or the name .dynstr.
1745         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Fail if the got
1746         section is not in the output binary.
1747         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Likewise.
1748
1749 2011-06-09  Tristan Gingold  <gingold@adacore.com>
1750
1751         * elfnn-ia64.c (elfNN_ia64_relax_section, elfNN_ia64_choose_gp)
1752         (elfNN_ia64_relocate_section, elfNN_vms_object_p): Remove trailing
1753         spaces.
1754
1755 2011-06-09  Tristan Gingold  <gingold@adacore.com>
1756
1757         * bfd.c (bfd_get_sign_extend_vma): Handle aixcoff.
1758
1759 2011-06-09  Nick Clifton  <nickc@redhat.com>
1760
1761         PR ld/12845
1762         * elf.c (_bfd_elf_init_private_section_data): Add an assertion
1763         that the output section has an allocated bfd_elf_section_data
1764         structure.
1765         * elfxx-mips.c (mips_elf_check_symbols): Do not create a stub for
1766         symbols in sections that have been removed by garbage collection.
1767
1768 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
1769
1770         * elf64-x86-64.c (elf_x86_64_check_relocs): Allow R_X86_64_64
1771         relocations in SEC_DEBUGGING sections when building shared
1772         libraries.
1773
1774 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
1775
1776         PR ld/12851
1777         * elflink.c (elf_gc_sweep): Don't check SHT_NOTE sections here.
1778         (bfd_elf_gc_sections): Also check SHT_NOTE sections.
1779
1780 2011-06-08  Tristan Gingold  <gingold@adacore.com>
1781
1782         * makefile.vms (OBJS): Add elfxx-ia64.obj
1783         Remove vax case.
1784
1785 2011-06-08  Alan Modra  <amodra@gmail.com>
1786
1787         * aix386-core.c, * cisco-core.c, * hpux-core.c, * osf-core.c,
1788         * sco5-core.c: Init match_priority field.
1789
1790 2011-06-08  Alan Modra  <amodra@gmail.com>
1791
1792         * elflink.c (_bfd_elf_archive_symbol_lookup): Follow warning and
1793         indirect links here.
1794
1795 2011-06-07  Joel Brobecker  <brobecker@adacore.com>
1796
1797         * irix-core.c (irix_core_vec): Add match_priority field.
1798
1799 2011-06-06  Alan Modra  <amodra@gmail.com>
1800
1801         * targets.c (bfd_target): Make ar_max_namelen an unsigned char.
1802         Add match_priority.
1803         * configure.in: Bump bfd version.
1804         * elfcode.h (elf_object_p): Delete hacks preventing match of
1805         EM_NONE and ELFOSABI_NONE targets when a better match exists.
1806         * elfxx-target.h (elf_match_priority): Define and use.
1807         * format.c (bfd_check_format_matches): Use target match_priority
1808         to choose best of multiple matching targets.  In cases with multiple
1809         matches rerun _bfd_check_format if we don't choose the last match.
1810         * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c,
1811         * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c,
1812         * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c,
1813         * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c,
1814         * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h,
1815         * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c,
1816         * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c,
1817         * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c,
1818         * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c,
1819         * vms-lib.c, * xsym.c: Init match_priority field.
1820         * configure: Regenerate.
1821         * bfd-in2.h: Regenerate.
1822
1823 2011-06-04  H.J. Lu  <hongjiu.lu@intel.com>
1824
1825         PR ld/12842
1826         * elfcode.h (elf_object_p): Revert the last change.
1827
1828 2011-06-04  Alan Modra  <amodra@gmail.com>
1829
1830         * archures.c (bfd_arch_get_compatible): If one arch is unknown,
1831         return the other arch.
1832         * elfcode.h (elf_object_p): Allow explicit match to generic ELF
1833         target.
1834
1835 2011-06-03  Bertram Felgenhauer  <bertram.felgenhauer@gmail.com>
1836
1837         PR ld/12682
1838         * hash.c (higher_primer_number): Add more, small, prime numbers.
1839         (bfd_hash_set_default_size): Likewise.
1840
1841 2011-06-02  Nick Clifton  <nickc@redhat.com>
1842
1843         * coff-mcore.c: Fix spelling typo.
1844         * coff-stgo32.c: Likewise.
1845         * elf32-arm.c: Likewise.
1846         * elf32-avr.c: Likewise.
1847         * elf-m68hc1x.c: Likewise.
1848         * elf32-mcore.c: Likewise.
1849         * elf32-mep.c: Likewise.
1850         * elf32-mt.c: Likewise.
1851         * elf32-ppc.c: Likewise.
1852         * elf32-xtensa.c: Likewise.
1853         * elf64-ppc.c: Likewise.
1854         * elfxx-mips.c: Likewise.
1855         * netbsd.h: Likewise.
1856         * nlmcode.h: Likewise.
1857         * vms-alpha.c: Likewise.
1858         * po/bfd.pot: Regenerate.
1859         * po/SRC-POTFILES.in: Regenerate.
1860
1861 2011-06-01  DJ Delorie  <dj@redhat.com>
1862
1863         * config.bfd: Add bfd_elf32_rx_be_ns_vec.
1864         * target.c: Likewise.
1865         * configure.in: Likewise.
1866         * configure.in: Regenerate.
1867         * elf32-rx.c: Add elf32-rx-be-ns target.
1868         (rx_elf_object_p): Never allow the be-ns target by default,
1869         only allow it if the user requests it.
1870
1871 2011-06-01  H.J. Lu  <hongjiu.lu@intel.com>
1872
1873         * elf32-i386.c (elf_i386_size_dynamic_sections): Properly warn
1874         relocation in readonly section in a shared object.
1875         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
1876
1877 2011-05-31  Nick Clifton  <nickc@redhat.com>
1878
1879         * archive.c (adjust_relative_path): Fix comment to prevent it
1880         corrupting the auto-generated bfd.h.
1881
1882 2011-05-31  Paul Brook  <paul@codesourcery.com>
1883
1884         * elf32-arm.c (elf32_arm_final_link_relocate): Only do bl conversion
1885         for known functions.
1886         (elf32_arm_swap_symbol_in): Only set ST_BRANCH_TO_ARM for function
1887         symbols.
1888
1889 2011-05-31  Paul Brook  <paul@codesourcery.com>
1890
1891         * elf32-arm.c (arm_stub_is_thumb): Add
1892         arm_stub_long_branch_v4t_thumb_tls_pic.
1893         (elf32_arm_final_link_relocate): TLS stubs are always ARM.
1894         Handle Thumb stubs.
1895
1896 2011-05-27  Nick Clifton  <nickc@redhat.com>
1897
1898         PR binutils/12710
1899         * archive.c (_bfd_get_elt_at_filepos): Set correct error value if
1900         unable to read a file pointed to by an entry in a thin archive.
1901         (adjust_relative_path): Use lrealpath to canonicalize paths.
1902         Handle the case where the reference path is above the current
1903         path in the directory tree.
1904
1905 2011-05-26  H.J. Lu  <hongjiu.lu@intel.com>
1906
1907         PR ld/12809
1908         * elf64-x86-64.c (elf_x86_64_relocate_section): Handle
1909         R_X86_64_TPOFF64 in executable.
1910
1911 2011-05-26  Alan Modra  <amodra@gmail.com>
1912
1913         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Remove most of comment.
1914         * elflink.c (_bfd_elf_symbol_refs_local_p): Expand
1915         local_protected comment.
1916
1917 2011-05-25  Tristan Gingold  <gingold@adacore.com>
1918
1919         * configure.in (bfd_elf32_ia64_big_vec, bfd_elf32_ia64_hpux_big_vec)
1920         (bfd_elf64_ia64_big_vec, bfd_elf64_ia64_hpux_big_vec)
1921         (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_vms_vec): Add elfxx-ia64.lo
1922         * Makefile.am (BFD64_BACKENDS): Add elfxx-ia64.lo
1923         (BFD64_BACKENDS_CFILES): Add elfxx-ia64.c
1924         (elf32-ia64.c): Created from elfnn-ia64.c
1925         (elf64-ia64.c): Likewise.
1926         * elfxx-ia64.h: New file.
1927         * elfxx-ia64.c: Split with elfnn-ia64.c.  Keep only the following
1928         functions.Includes elfxx-ia64.h.
1929         (elfNN_ia64_reloc): Renames to ia64_elf_reloc.  Adjust error message.
1930         (IA64_HOWTO): Adjust.
1931         (lookup_howto): Renames to ia64_elf_lookup_howto.  Make it public.
1932         (elfNN_ia64_reloc_type_lookup): Renames to
1933         ia64_elf_reloc_type_lookup. Make it public. Adjust calls.
1934         (elfNN_ia64_reloc_name_lookup): Renames to
1935         ia64_elf_reloc_name_lookup. Make it public.
1936         (elfNN_ia64_relax_br): Renames to ia64_elf_relax_br.  Make it public.
1937         (elfNN_ia64_relax_brl): Renames to ia64_elf_relax_brl. Make it
1938         public.
1939         (elfNN_ia64_relax_ldxmov): Renames to ia64_elf_relax_ldxmov.
1940         Move it and make it public.  Move prototype to elfxx-ia64.h
1941         (elfNN_ia64_install_value): Renames to ia64_elf_install_value.
1942         Move prototype to elfxx-ia64.h
1943         * elfnn-ia64.c: New file, split from elfxx-ia64.c.
1944         (elfNN_ia64_info_to_howto): Adjust calls.
1945         (elfNN_ia64_relax_section): Adjust calls.
1946         (count_dyn_reloc): Fix typo.
1947         (elfNN_ia64_relocate_section): Adjust calls.
1948         (elfNN_ia64_finish_dynamic_symbol): Likewise.
1949         (bfd_elfNN_bfd_reloc_type_lookup)
1950         (bfd_elfNN_bfd_reloc_name_lookup): Adjust macros.
1951         * configure: Regenerate.
1952         * Makefile.in: Regenerate.
1953
1954 2011-05-23  DJ Delorie  <dj@redhat.com>
1955
1956         * elf32-rx.c (rx_elf_object_p): When reading an RX object in, undo
1957         the vma/lma swapping done in elf32_rx_modify_program_headers.
1958
1959 2011-05-23  Nick Clifton  <nickc@redhat.com>
1960
1961         * elf-m10300.c (mn10300_elf_mkobject): New function.
1962         (bfd_elf32_mkobject): Define.
1963
1964 2011-05-23  Alan Modra  <amodra@gmail.com>
1965
1966         * elf-bfd.h: Comment typo fix.
1967         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Delete.  Replace with
1968         struct elf_dyn_relocs throughout.
1969         * elf64-ppc.c (struct ppc_dyn_relocs): Likewise.
1970
1971 2011-05-23  Alan Modra  <amodra@gmail.com>
1972
1973         * elf32-frv.c: Use info->callbacks->einfo throughout file in linker
1974         functions rather than warning callback or _bfd_error_handler.
1975         * elf32-ppc.c: Likewise.
1976         * elf64-ppc.c: Likewise.
1977         * elf32-ppc.c (ppc_elf_tls_optimize): Use %H in __tls_get_addr lost
1978         arg error.
1979         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
1980
1981 2011-05-23  Alan Modra  <amodra@gmail.com>
1982
1983         PR 12763
1984         * elf.c (assign_file_positions_for_load_sections): Set sh_offset for
1985         .tbss, and page align same for all SHT_NOBITS sections.
1986
1987 2011-05-21  Alan Modra  <amodra@gmail.com>
1988
1989         PR 12763
1990         * elf.c (_bfd_elf_make_section_from_shdr): Set up TLS section LMAs
1991         from PT_TLS header.
1992         (_bfd_elf_map_sections_to_segments): Don't create a final PT_LOAD
1993         segment if just for .tbss.
1994         (assign_file_positions_for_load_sections): Don't report "can't
1995         allocate in segment" errors for .tbss.
1996         (assign_file_positions_for_non_load_sections): Don't set p_filesz
1997         from SHT_NOBITS section filepos.
1998
1999 2011-05-20  Bernd Schmidt  <bernds@codesourcery.com>
2000
2001         * elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for
2002         R_C6000_PCR_H16 and R_C6000_PCR_L16.
2003         (elf32_tic6x_relocate_section): Handle them.
2004
2005 2011-05-18  Nick Clifton  <nickc@redhat.com>
2006
2007         PR ld/12761
2008         * elflink.c (elf_link_add_object_symbols): Process .gnu.warning
2009         sections when building shared libraries.
2010
2011 2011-05-18  Rafał Krypa  <r.krypa@samsung.com>
2012
2013         PR ld/12778
2014         * elf32-arm.c (elf32_arm_gc_sweep_hook): Use the computed dynamic
2015         reloc pointer.
2016
2017 2011-05-18  Tristan Gingold  <gingold@adacore.com>
2018
2019         * xcofflink.c (xcoff_link_add_symbols): Handle C_DWARF symbols.
2020         (xcoff_sweep): Always keep dwarf sections.
2021         (xcoff_link_input_bfd): Handle dwarf symbols and sections.
2022
2023 2011-05-18  Tristan Gingold  <gingold@adacore.com>
2024
2025         * libxcoff.h (struct xcoff_dwsect_name): New type.
2026         (XCOFF_DWSECT_NBR_NAMES): New macro.
2027         (xcoff_dwsect_names): Declare.
2028         * coffcode.h (sec_to_styp_flags): Handle xcoff dwarf sections.
2029         (styp_to_sec_flags): Ditto.
2030         (coff_new_section_hook): Ditto.
2031         (coff_slurp_symbol_table): Handle C_DWARF and C_INFO.
2032         * coff-rs6000.c (xcoff_dwsect_name): New variable.
2033
2034 2011-05-17  Tomohiro Kashiwada  <kikairoya@gmail.com>
2035
2036         PR ld/12759
2037         * elf32-rx.c (ignore_lma): New variable.
2038         (bfd_elf32_rx_set_target_flags): Add ignore_lma parameter.
2039         (rx_modify_program_headers): Only copy the LMA into the VMA if
2040         ignore_lma is true.
2041
2042 2011-05-17  Alan Modra  <amodra@gmail.com>
2043
2044         PR ld/12760
2045         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Adjust "notice" call.
2046         * elflink.c (elf_link_add_object_symbols): Likewise.
2047         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2048
2049 2011-05-16  Alan Modra  <amodra@gmail.com>
2050
2051         * linker.c (_bfd_generic_link_add_one_symbol): Don't init u.undef.weak.
2052
2053 2011-05-15  Richard Sandiford  <rdsandiford@googlemail.com>
2054
2055         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Record both local and
2056         global GOT entries for GOT_PAGE relocations against global symbols.
2057
2058 2011-05-13  Bernd Schmidt  <bernds@codesourcery.com>
2059
2060         * config.bfd (tic6x-*-elf, tic6x-*-uclinux): New.
2061         (tic6x-*-*): Replaced by these.
2062         * elf32-tic6x.c (elf32_tic6x_set_osabi): New static function.
2063         (elf32_tic6x_check_relocs): Create dynamic sections if -shared.
2064         (elf_backend_relocs_compatible, elf_backend_post_process_headers):
2065         Define.
2066         (elf32_bed, TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM,
2067         TARGET_BIG_NAME, ELF_OSABI): Redefine twice, and include
2068         "elf32-target.h" two more times.
2069         * configure.in: Handle bfd_elf32_tic6x_linux_be_vec,
2070         bfd_elf32_tic6x_linux_le_vec, bfd_elf32_tic6x_elf_be_vec and
2071         bfd_elf32_tic6x_elf_le_vec.
2072         * configure: Regenerate.
2073
2074 2011-05-13  Jan Beulich  <jbeulich@novell.com>
2075
2076         * config.bfd: Add targets x86_64-*-pe and x86_64-*-pep.
2077
2078 2011-05-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
2079
2080         * config.in: Regenerated.
2081         * configure: Regenerated.
2082         * configure.in: New tests for HAVE_PRPSINFO_T_PR_PID,
2083         HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and
2084         HAVE_PSINFO32_T_PR_PID.
2085         * elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by
2086         HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID
2087         and HAVE_PSINFO32_T_PR_PID.
2088         * hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition.
2089
2090 2011-05-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
2091
2092         * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and
2093         32bit psinfo.
2094         * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid.
2095         * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise.
2096
2097 2011-05-09  Paul Brook  <paul@codesourcery.com>
2098
2099         * bfd-in.h (elf32_tic6x_fix_exidx_coverage): Add prototype.
2100         * bfd-in2.h: Regenerate.
2101         * elf32-tic6x.c: Include limits.h.
2102         (tic6x_unwind_edit_type, tic6x_unwind_table_edit,
2103         _tic6x_elf_section_data): New.
2104         (elf32_tic6x_section_data): Define.
2105         (elf32_tic6x_new_section_hook): Allocate target specific data.
2106         (elf32_tic6x_add_unwind_table_edit): New function.
2107         (get_tic6x_elf_section_data, elf32_tic6x_adjust_exidx_size,
2108         elf32_tic6x_insert_cantunwind_after, elf32_tic6x_add_low31,
2109         elf32_tic6x_copy_exidx_entry): New functions.
2110         (elf_backend_write_section): Define.
2111
2112 2011-05-09  Paul Brook  <paul@codesourcery.com>
2113
2114         * elf32-tic6x.c (is_tic6x_elf_unwind_section_name,
2115         elf32_tic6x_fake_sections): New functions.
2116         (elf_backend_fake_sections): Define.
2117
2118 2011-05-09  Paul Brook  <paul@codesourcery.com>
2119
2120         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function.
2121         (elf_backend_gc_mark_extra_sections): Define.
2122
2123 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
2124
2125         PR ld/12365
2126         * cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
2127         references to symbols defined in discarded sections.
2128
2129 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
2130
2131         PR ld/12365
2132         * coffgen.c (coff_write_symbol): Assume input section is its own
2133         output section if output_section member not set.
2134         (coff_write_alien_symbol): Likewise.
2135
2136 2011-05-07  H.J. Lu  <hongjiu.lu@intel.com>
2137
2138         PR ld/12730
2139         * elf.c (_bfd_elf_section_offset): Check SEC_ELF_REVERSE_COPY.
2140
2141         * elflink.c (elf_link_input_bfd): Reverse copy .ctors/.dtors
2142         sections if needed.
2143
2144         * section.c (SEC_ELF_REVERSE_COPY): New.
2145         * bfd-in2.h: Regenerated.
2146
2147 2011-05-07  Anders Kaseorg  <andersk@ksplice.com>
2148
2149         PR 12739
2150         * libbfd.c (bfd_get_8, bfd_get_signed_8): Use const cast.
2151         * bfd-in2.h: Regenerate.
2152
2153 2011-05-06  Tristan Gingold  <gingold@adacore.com>
2154
2155         * vms-alpha.c (evax_section_flags): Remove SEC_IN_MEMORY.
2156         (_bfd_vms_slurp_egsd): Rename old_flags to vms_flags.  Handle
2157         any code section.  Add comments.
2158         (alpha_vms_object_p): Use void * instead of PTR.
2159         (alpha_vms_create_eisd_for_section): Fix test for setting DZRO.
2160         (build_module_list): Guard against no DST section.  Add comments.
2161         (alpha_vms_link_output_symbol): Discard undefined symbols.
2162         (alpha_vms_get_section_contents): Simply memcpy if the section was
2163         already loaded.  Fix typo.
2164         (vms_new_section_hook): Use void * instead of PTR.
2165         (vms_alpha_vec): Ditto.
2166
2167 2011-05-06  Richard Sandiford  <richard.sandiford@linaro.org>
2168
2169         * elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb
2170         branch to a PLT entry, redirect it to the PLT's Thumb entry point.
2171
2172 2011-05-05  Bernd Schmidt  <bernds@codesourcery.com>
2173
2174         * elf32-tic6x.c (elf32_tic6x_final_link): New function.
2175         (elf32_tic6x_merge_attributes): Do not warn for PID or PIC
2176         mismatch.  Choose the lower of the two values.
2177         (bfd_elf32_bfd_final_link): New macro.
2178
2179 2011-04-28  Tristan Gingold  <gingold@adacore.com>
2180
2181         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust for x_file.
2182         (bfd_xcoff_swap_aux_out): Ditto.
2183         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Ditto.
2184         (bfd_xcoff64_swap_aux_out): Ditto.
2185
2186 2011-05-04  Alan Modra  <amodra@gmail.com>
2187
2188         PR ld/12727
2189         * elf64-ppc.c (ppc_build_one_stub <ppc_sub_plt_call>): Clear
2190         was_undefined on dot-symbols.
2191
2192 2011-05-03  Paul Brook  <paul@codesourcery.com>
2193
2194
2195         * elf32-tic6x.c (elf32_tic6x_howto_table,
2196         elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook,
2197         elf32_tic6x_relocate_section, elf32_tic6x_check_relocs):
2198         Add R_C6000_EHTYPE.
2199
2200 2011-05-01  Alan Modra  <amodra@gmail.com>
2201
2202         PR ld/12718
2203         * elf32-i386.c (elf_i386_check_relocs): Ensure dynobj set before
2204         creating ifunc sections.
2205         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2206
2207 2011-04-30  H.J. Lu  <hongjiu.lu@intel.com>
2208
2209         * elf64-x86-64.c (elf_x86_64_merge_symbol): Correct parameter
2210         names.
2211
2212 2011-04-28  Tom Tromey  <tromey@redhat.com>
2213
2214         * bfdio.c (memory_bstat): Pass correct size to memset.
2215
2216 2011-04-28  Mike Frysinger  <vapier@gentoo.org>
2217
2218         * dwarf2.c (dwarf_debug_sections): Mark const.
2219         * elf.c (special_sections): Likewise.
2220         * libbfd-in.h (dwarf_debug_sections): Likewise.
2221         * libbfd.h: Regenerate.
2222
2223 2011-04-26  Kai Tietz  <ktietz@redhat.com>
2224
2225         * coffcode.h (sec_to_styp_flags): Allow linkonce for
2226         debugging sections.
2227
2228 2011-04-26  Tristan Gingold  <gingold@adacore.com>
2229
2230         * coff64-rs6000.c: Convert to ISO-C.  Remove PARAMS and PTR macros.
2231
2232 2011-04-24  Alan Modra  <amodra@gmail.com>
2233
2234         PR ld/12365
2235         PR ld/12696
2236         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call.
2237         * linker.c (_bfd_link_hash_newfunc): Clear bitfields.
2238         (_bfd_generic_link_add_one_symbol): Update "notice" call.
2239         * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when
2240         it is a redef of an IR symbol in a real BFD.
2241
2242 2011-04-22  H.J. Lu  <hongjiu.lu@intel.com>
2243
2244         * elf32-i386.c (elf_i386_readonly_dynrelocs): Warn relocation
2245         in readonly section in a shared object.
2246         (elf_i386_size_dynamic_sections): Likewise.
2247         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
2248         (elf_x86_64_size_dynamic_sections): Likewise.
2249
2250 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2251
2252         PR ld/12694
2253         * elf32-i386.c (elf_i386_readonly_dynrelocs): Skip local IFUNC
2254         symbols.
2255         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
2256
2257 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2258
2259         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Return false
2260         on dynamic symbol error.
2261         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2262
2263 2011-04-20  Tristan Gingold  <gingold@adacore.com>
2264
2265         * config.bfd (alpha*-*-*vms*, ia64*-*-*vms*): Define targ_selvecs.
2266
2267 2011-04-20  Alan Modra  <amodra@gmail.com>
2268
2269         * hash.c (bfd_default_hash_table_size): Make it an unsigned long.
2270         (bfd_hash_table_init_n): Overflow checking.
2271         (bfd_hash_set_default_size): Return current size.  Take unsigned long
2272         arg.  Add 65537 to hash_size primes.
2273         * bfd-in.h (bfd_hash_set_default_size): Update prototype.
2274         * bfd-in2.h: Regenerate.
2275
2276 2011-04-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
2277
2278         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Fix +1 overrun of
2279         memmove elements.
2280
2281 2011-04-20  Alan Modra  <amodra@gmail.com>
2282
2283         * libbfd.c (bfd_log2): Do return rounded up value.
2284         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Replace bfd_log2
2285         call with expanded old round down version of the function.
2286
2287         * archive.c (_bfd_get_elt_at_filepos): Don't release n_nfd.
2288         * elflink.c (elf_link_add_object_symbols): Delete redundant code.
2289
2290 2011-04-20  Alan Modra  <amodra@gmail.com>
2291
2292         PR ld/12365
2293         * elfcode.h (elf_slurp_symbol_table): Put common plugin IR symbols
2294         in their own common section.
2295         * elflink.c (elf_link_add_object_symbols): Likewise.
2296         * linker.c (generic_link_check_archive_element): Don't lose flags
2297         if common section is pre-existing.
2298         (_bfd_generic_link_add_one_symbol): Likewise.
2299
2300 2011-04-20  Alan Modra  <amodra@gmail.com>
2301
2302         PR ld/12365
2303         * elflink.c (_bfd_elf_merge_symbol): Update multiple_common calls.
2304         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.  Call
2305         multiple_definition regardless of allow_multiple_definition.
2306         * simple.c (simple_dummy_multiple_definition): Update.
2307         * xcofflink.c (xcoff_link_add_symbols): Update multiple_definition
2308         calls.
2309
2310 2011-04-18  Tristan Gingold  <gingold@adacore.com>
2311
2312         * coff-rs6000.c: Convert to ISO-C.  Remove PARAMS macro.
2313
2314 2011-04-18  Alan Modra  <amodra@gmail.com>
2315
2316         PR ld/12365
2317         PR ld/12672
2318         * bfd.c (BFD_PLUGIN): Define.
2319         (BFD_FLAGS_SAVED, BFD_FLAGS_FOR_BFD_USE_MASK): Add BFD_PLUGIN.
2320         * bfd-in2.h: Regenerate.
2321         * elflink.c (elf_link_output_extsym): Strip undefined plugin syms.
2322         * opncls.c (bfd_make_readable): Don't lose original bfd flags.
2323
2324 2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
2325
2326         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Do not check for
2327         SEC_LOAD.
2328
2329 2011-04-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2330
2331         * elf-bfd.h (struct sdt_note): New struct.
2332         (struct elf_obj_tdata) <sdt_note_head>: New field.
2333         * elf.c (elfobj_grok_stapsdt_note_1): New function.
2334         (elfobj_grok_stapsdt_note): Likewise.
2335         (elf_parse_notes): Added code to treat SystemTap note
2336         sections.
2337
2338 2011-04-12  Richard Henderson  <rth@redhat.com>
2339
2340         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Do not
2341         exclude empty .got sections.
2342
2343 2011-04-11  H.J. Lu  <hongjiu.lu@intel.com>
2344
2345         * elf32-i386.c (elf_i386_reloc_type_lookup): Fix the out of bound
2346         array access for BFD_RELOC_386_IRELATIVE.
2347
2348 2011-04-11  Bernd Schmidt  <bernds@codesourcery.com>
2349
2350         * elf32-tic6x.c (elf32_tic6x_check_relocs): Initialize pc_count field.
2351
2352 2011-04-11  Mark Wielaard  <mjw@redhat.com>
2353
2354         PR 10549
2355         * elf-bfd.h (has_ifunc_symbols): Renamed to has_gnu_symbols.
2356         (has_gnu_symbols): Renamed from has_ifunc_symbols.
2357         * elf.c (_bfd_elf_set_osabi): Use new has_gnu_symbols name.
2358         * elf32-arm.c (elf32_arm_add_symbol_hook): Set has_gnu_symbols
2359         also if STB_GNU_UNIQUE symbol binding was seen.
2360         * elf32-i386.c (elf_i386_add_symbol_hook): Likewise.
2361         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
2362         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
2363         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
2364         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
2365         * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
2366
2367 2011-04-11  Alan Modra  <amodra@gmail.com>
2368
2369         * bfd-in.h (bfd_get_section_limit): Don't use rawsize with output
2370         sections.
2371         * libbfd.c (_bfd_generic_get_section_contents): Likewise.
2372         (_bfd_generic_get_section_contents_in_window): Likewise.
2373         * section.c (bfd_get_section_contents): Likewise.
2374         * compress.c (bfd_get_full_section_contents): Likewise.
2375         * elf32-rx.c (rx_final_link): Ignore rawsize.
2376         * elf32-microblaze.c (microblaze_elf_relocate_section): Use correct
2377         bfd with bfd_get_section_limit.
2378         * elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter.  Use
2379         os->size during final link.  Update callers.
2380         * bfd-in2.h: Regenerate.
2381
2382 2011-04-10  Richard Sandiford  <rdsandiford@googlemail.com>
2383
2384         PR ld/12637
2385         * elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count
2386         as the number of global entries when merging with the primary GOT.
2387
2388 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2389
2390         * elf32-i386.c: Update copyright year.
2391         * elf64-x86-64.c: Likewise.
2392
2393 2011-04-09  Kai Tietz  <ktietz@redhat.com>
2394
2395         * peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary
2396         buffer and use rawsize for sorting.
2397         * coffcode.h (coff_compute_section_file_positions): Set rawsize
2398         before doing alignment.
2399
2400 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2401
2402         * elf32-i386.c (elf_i386_relocate_section): Return relocation
2403         error on unsupported relocation.
2404         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2405
2406 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
2407
2408         PR binutils/12657
2409         * hosts/x86-64linux.h (elf_prstatus32): Replace __pid_t with
2410         pid_t.
2411
2412 2011-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2413
2414         PR ld/12654
2415         * elf32-i386.c (elf_i386_relocate_section): Check !executable
2416         instead of shared for R_386_TLS_LDO_32.
2417
2418 2011-04-08  Tristan Gingold  <gingold@adacore.com>
2419
2420         * Makefile.am (SOURCE_HFILES): Remove xcoff-target.h
2421         * coff-pmac: Remove
2422         * xcoff-target.h: Remove
2423         * Makefile.in: Regenerate.
2424
2425 2011-04-07  Cary Coutant  <ccoutant@google.com>
2426
2427         * dwarf2.c (scan_unit_for_symbols): Check for DW_AT_specification.
2428
2429 2011-04-07  Paul Brook  <paul@codesourcery.com>
2430
2431         * elf32-tic6x.c (elf32_tic6x_howto_table): R_C6000_PREL31 is
2432         pc-relative.
2433         (elf32_tic6x_howto_table_rel): Ditto.
2434         (elf32_tic6x_relocate_section): Implement R_C6000_PREL31.
2435         (elf32_tic6x_check_relocs): Ditto.
2436
2437 2011-04-06  Joseph Myers  <joseph@codesourcery.com>
2438
2439         * config.bfd (thumb-*-oabi): Don't handle in list of obsolete
2440         targets.
2441         (strongarm*, thumb*, xscale*): Remove architectures.
2442         (strongarm-*-kaos*, thumb-*-coff, thumb-*-elf, thumb-epoc-pe*,
2443         thumb-*-pe*, strongarm-*-elf, strongarm-*-coff, xscale-*-elf,
2444         xscale-*-coff): Remove targets.
2445
2446 2011-04-01  Tristan Gingold  <gingold@adacore.com>
2447
2448         * elfxx-ia64.c: include bfd_stdint.h
2449
2450 2011-03-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
2451
2452         * elf32-tic6x.c (elf32_tic6x_relocate_section): Remove unused variable
2453         dynobj and its initialization.
2454
2455 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2456
2457         * makefile.vms (DEFS): Add HAVE_bfd_elf64_ia64_vms_vec.
2458         * configure.com: Set BFD_HOST_64BIT_LONG_LONG and
2459         BFD_HOST_LONG_LONG to 1.
2460
2461 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2462
2463         * vms-alpha.c (vms_get_remaining_object_record): Fix dec-c warning.
2464         (_bfd_vms_write_etir): Ditto.
2465         (_bfd_vms_slurp_etir): Avoid to use intptr_t
2466         * configure.com: Generate bfd_stdint.h
2467
2468 2011-03-31  Bernd Schmidt  <bernds@codesourcery.com>
2469
2470         * elf32-tic6x.h (struct elf32_tic6x_params): New.
2471         (elf32_tic6x_setup): Declare.
2472         * elf32-tic6x.c: Include <limits.h>.
2473         (ELF_DYNAMIC_LINKER, DEFAULT_STACK_SIZE, PLT_ENTRY_SIZE): Define.
2474         (struct elf32_tic6x_link_hash_table, struct elf32_link_hash_entry):
2475         New structures.
2476         (elf32_tic6x_link_hash_table, is_tic6x_elf): New macros.
2477         (tic6x_elf_scom_section, tic6x_elf_scom_symbol,
2478         tic6x_elf_scom_symbol_ptr): New static variables.
2479         (elf32_tic6x_howto_table, elf32_tic6x_howto_table_rel,
2480         elf32_tic6x_reloc_map): Add R_C6000_JUMP_SLOT, R_C6000_EHTYPE,
2481         R_C6000_PCR_H16 and R_C6000_PCR_L16.
2482         (elf32_tic6x_link_hash_newfunc, elf32_tic6x_link_hash_table_create,
2483         elf32_tic6x_link_hash_table_free, elf32_tic6x_setup,
2484         elf32_tic6x_using_dsbt, elf32_tic6x_install_rela,
2485         elf32_tic6x_create_dynamic_sections, elf32_tic6x_make_got_dynreloc,
2486         elf32_tic6x_finish_dynamic_symbol, elf32_tic6x_gc_sweep_hook,
2487         elf32_tic6x_adjust_dynamic_symbol): New static functions.
2488         (elf32_tic6x_relocate_section): For R_C6000_PCR_S21, convert branches
2489         to weak symbols as required by the ABI.
2490         Handle GOT and DSBT_INDEX relocs, and copy relocs to the output file
2491         as needed when generating DSBT output.
2492         (elf32_tic6x_check_relocs, elf32_tic6x_add_symbol_hook,
2493         elf32_tic6x_symbol_processing, elf32_tic6x_section_from_bfd_section,
2494         elf32_tic6x_allocate_dynrelocs, elf32_tic6x_size_dynamic_sections,
2495         elf32_tic6x_always_size_sections, elf32_tic6x_modify_program_headers,
2496         elf32_tic6x_finish_dynamic_sections, elf32_tic6x_plt_sym_val,
2497         elf32_tic6x_copy_private_data, elf32_tic6x_link_omit_section_dynsym):
2498         New static functions.
2499         (ELF_MAXPAGESIZE): Define to 0x1000.
2500         (bfd_elf32_bfd_copy_private_bfd_data,
2501         bfd_elf32_bfd_link_hash_table_create,
2502         bfd_elf32_bfd_link_hash_table_free, elf_backend_can_refcount,
2503         elf_backend_want_got_plt, elf_backend_want_dynbss,
2504         elf_backend_plt_readonly, elf_backend_got_header_size,
2505         elf_backend_gc_sweep_hook, elf_backend_modify_program_headers,
2506         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
2507         elf_backend_check_relocs, elf_backend_add_symbol_hook,
2508         elf_backend_symbol_processing, elf_backend_link_output_symbol_hook,
2509         elf_backend_section_from_bfd_section,
2510         elf_backend_finish_dynamic_symbol, elf_backend_always_size_sections,
2511         elf32_tic6x_size_dynamic_sections, elf_backend_finish_dynamic_sections,
2512         elf_backend_omit_section_dynsym, elf_backend_plt_sym_val): Define.
2513
2514         * bfd/reloc.c (BFD_RELOC_C6000_JUMP_SLOT, BFD_RELOC_C6000_EHTYPE,
2515         BFD_RELOC_C6000_PCR_H16, BFD_RELOC_C6000_PCR_S16): Add.
2516         * bfd/bfd-in2.h: Regenerate.
2517         * bfd/libbfd.h: Regenerate.
2518         * config.bfd: Accept tic6x-*-* instead of tic6x-*-elf.
2519
2520 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2521
2522         * coffcode.h (coff_slurp_symbol_table): Silently discard C_NULL
2523         entry on xcoff when value is C_NULL_VALUE.
2524
2525 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2526
2527         * libcoff-in.h (exec_hdr): Remove.
2528         * libcoff.h: Regenerate.
2529
2530 2011-03-30  Nick Clifton  <nickc@redhat.com>
2531
2532         * po/da.po: Updated Danish translation.
2533
2534 2011-03-29  Richard Henderson  <rth@redhat.com>
2535
2536         * elf64-alpha.c (elf64_alpha_gc_mark_hook): New.
2537         (elf64_alpha_gc_sweep_hook): New.
2538         (elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook): New.
2539         (elf_backend_can_gc_sections): New.
2540
2541 2011-03-26  John Marino  <binutils@marino.st>
2542
2543         * config.bfd: Add x86_64-*-dragonfly*, fix i386-*-dragonfly*.
2544         * configure.in: Delete unused bfd_elf32_i386_dragonfly_vec.
2545         * configure: Regenerate.
2546
2547 2011-03-25  Michael Snyder  <msnyder@vmware.com>
2548
2549         * coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.
2550
2551 2011-03-25  Tristan Gingold  <gingold@adacore.com>
2552
2553         * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Allow the use
2554         of find_nearest_line on object files.
2555
2556 2011-03-25  Tristan Gingold  <gingold@adacore.com>
2557
2558         * vms-alpha.c (evax_section_flags): Make $CODE$ section read-only.
2559         Minor reordering.
2560         (alpha_vms_create_eisd_for_section): Make code sections read-only.
2561
2562 2011-03-24  Alan Modra  <amodra@gmail.com>
2563
2564         * elf32-ppc.c (ppc_elf_tls_optimize): Catch more cases where
2565         old-style __tls_get_addr calls without marker relocs don't match
2566         their arg setup insn one for one.  If such mismatches are found
2567         report the reloc and don't do any tls optimization.
2568         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
2569
2570 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
2571
2572         * bfd-in2.h: Regenerate.
2573
2574 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
2575
2576         * archures.c: Add AVR XMEGA architecture information.
2577         * cpu-avr.c (arch_info_struct): Likewise.
2578         * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
2579         (elf32_avr_object_p): Likewise.
2580
2581 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2582
2583         * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation.
2584         * bfd-in2.h: Regenerate.
2585         * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition
2586         to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE
2587         entry.
2588         (elf32_arm_howto_from_type): Update accordingly.
2589         (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE.
2590         (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3.
2591         (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry
2592         with an extra noncall_refcount field.
2593         (arm_local_iplt_info): New structure.
2594         (elf_arm_obj_tdata): Add local_iplt.
2595         (elf32_arm_local_iplt): New accessor macro.
2596         (elf32_arm_link_hash_entry): Replace plt_thumb_refcount,
2597         plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info.
2598         Change tls_type to a bitfield and add is_iplt.
2599         (elf32_arm_link_hash_newfunc): Update accordingly.
2600         (elf32_arm_allocate_local_sym_info): New function.
2601         (elf32_arm_create_local_iplt): Likewise.
2602         (elf32_arm_get_plt_info): Likewise.
2603         (elf32_arm_plt_needs_thumb_stub_p): Likewise.
2604         (elf32_arm_get_local_dynreloc_list): Likewise.
2605         (create_ifunc_sections): Likewise.
2606         (elf32_arm_copy_indirect_symbol): Update after the changes to
2607         elf32_arm_link_hash_entry.  Assert the is_iplt has not yet been set.
2608         (arm_type_of_stub): Add an st_type argument.  Use elf32_arm_get_plt_info
2609         to get PLT information.  Assert that all STT_GNU_IFUNC references
2610         are turned into PLT references.
2611         (arm_build_one_stub): Pass the symbol type to
2612         elf32_arm_final_link_relocate.
2613         (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub.
2614         (elf32_arm_allocate_irelocs): New function.
2615         (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for
2616         all R_ARM_IRELATIVE.
2617         (elf32_arm_allocate_plt_entry): New function.
2618         (elf32_arm_populate_plt_entry): Likewise.
2619         (elf32_arm_final_link_relocate): Add an st_type parameter.
2620         Set srelgot to null for static objects.  Use separate variables
2621         to record which st_value and st_type should be used when generating
2622         a dynamic relocation.  Use elf32_arm_get_plt_info to find the
2623         symbol's PLT information, setting has_iplt_entry, splt,
2624         plt_offset and gotplt_offset accordingly.  Check whether
2625         STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change
2626         the relocation target accordingly.  Broaden assert to include
2627         .iplts.  Don't set sreloc for static relocations.  Assert that
2628         we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32
2629         and R_ARM_ABS32_NOI.  Generate R_ARM_IRELATIVE relocations instead
2630         of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC
2631         symbol.  Pass the symbol type to arm_type_of_stub.  Conditionally
2632         resolve GOT references to the .igot.plt entry.
2633         (elf32_arm_relocate_section): Update the call to
2634         elf32_arm_final_link_relocate.
2635         (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT
2636         information.  Treat R_ARM_REL32 and R_ARM_REL32_NOI as call
2637         relocations in shared libraries and relocatable executables.
2638         Count non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
2639         to get the list of dynamic relocations for a local symbol.
2640         (elf32_arm_check_relocs): Always create ifunc sections.  Set isym
2641         at the same time as setting h.  Use elf32_arm_allocate_local_sym_info
2642         to allocate local symbol information.  Treat R_ARM_REL32 and
2643         R_ARM_REL32_NOI as call relocations in shared libraries and
2644         relocatable executables.  Record PLT information for local
2645         STT_GNU_IFUNC functions as well as global functions.   Count
2646         non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
2647         to get the list of dynamic relocations for a local symbol.
2648         (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols.
2649         Don't remove STT_GNU_IFUNC PLTs unless all references have been
2650         removed.  Update after the changes to elf32_arm_link_hash_entry.
2651         (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT
2652         entries should live in .plt or .iplt.  Check whether the .igot.plt
2653         and .got entries can be combined.  Use elf32_arm_allocate_plt_entry
2654         to allocate .plt and .(i)got.plt entries.  Detect which .got
2655         entries will need R_ARM_IRELATIVE relocations and use
2656         elf32_arm_allocate_irelocs to allocate them.  Likewise other
2657         non-.got dynamic relocations.
2658         (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt
2659         and dynamic relocations for local STT_GNU_IFUNC symbols.
2660         Check whether the .igot.plt and .got entries can be combined.
2661         Detect which .got entries will need R_ARM_IRELATIVE relocations
2662         and use elf32_arm_allocate_irelocs to allocate them.  Use stashed
2663         section pointers intead of strcmp checks.  Handle iplt and igotplt.
2664         (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry
2665         to fill in .plt, .got.plt and .rel(a).plt entries.  Point
2666         STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations
2667         resolve to it.
2668         (elf32_arm_output_plt_map_1): New function, split out from
2669         elf32_arm_output_plt_map.  Handle .iplt entries.  Use
2670         elf32_arm_plt_needs_thumb_stub_p.
2671         (elf32_arm_output_plt_map): Call it.
2672         (elf32_arm_output_arch_local_syms): Add mapping symbols for
2673         local .iplt entries.
2674         (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols.
2675         (elf32_arm_swap_symbol_out): Likewise.
2676         (elf32_arm_add_symbol_hook): New function.
2677         (elf_backend_add_symbol_hook): Define for all targets.
2678
2679 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2680
2681         * elf-bfd.h (elf_link_hash_entry): Add target_internal.
2682         * elf.c (swap_out_syms): Set st_target_internal for each
2683         Elf_Internal_Sym.
2684         * elfcode.h (elf_swap_symbol_in): Likewise.
2685         * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
2686         * elf32-sh-symbian.c (sh_symbian_relocate_section): Likewise.
2687         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
2688         * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
2689         * elflink.c (elf_link_output_extsym): Likewise.
2690         (bfd_elf_final_link): Likewise.
2691         (elf_link_add_object_symbols): Copy st_target_internal
2692         to the hash table if we see a definition.
2693         (_bfd_elf_copy_link_hash_symbol_type): Copy target_internal.
2694         * elf32-arm.c (elf32_arm_stub_hash_entry): Replace st_type with
2695         a branch_type field.
2696         (a8_erratum_fix, a8_erratum_reloc): Likewise.
2697         (arm_type_of_stub): Replace actual_st_type with an
2698         actual_branch_type parameter.
2699         (arm_build_one_stub): Use branch types rather than st_types to
2700         determine the type of branch.
2701         (cortex_a8_erratum_scan): Likewise.
2702         (elf32_arm_size_stubs): Likewise.
2703         (bfd_elf32_arm_process_before_allocation): Likewise.
2704         (allocate_dynrelocs_for_symbol): Likewise.
2705         (elf32_arm_finish_dynamic_sections): Likewise.
2706         (elf32_arm_final_link_relocate): Replace sym_flags parameter with
2707         a branch_type parameter.
2708         (elf32_arm_relocate_section): Update call accordingly.
2709         (elf32_arm_adjust_dynamic_symbol): Don't check STT_ARM_TFUNC.
2710         (elf32_arm_output_map_sym): Initialize st_target_internal.
2711         (elf32_arm_output_stub_sym): Likewise.
2712         (elf32_arm_symbol_processing): Delete.
2713         (elf32_arm_swap_symbol_in): Convert STT_ARM_TFUNCs into STT_FUNCs.
2714         Use st_target_internal to record the branch type.
2715         (elf32_arm_swap_symbol_out): Use st_target_internal to test for
2716         Thumb functions.
2717         (elf32_arm_is_function_type): Delete.
2718         (elf_backend_symbol_processing): Likewise.
2719         (elf_backend_is_function_type): Likewise.
2720
2721 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2722
2723         * elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj.
2724         (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion
2725         into the PLT block.
2726
2727 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2728
2729         * elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p,
2730         may_need_local_target_p and may_become_dynamic_p to classify
2731         the relocation type.  Don't check info->symbolic or h->def_regular
2732         when deciding whether to record a potential dynamic reloc.
2733         Don't treat potential dynamic relocs as PLT references.
2734         (elf32_arm_gc_sweep_hook): Update to match.  Assert that we don't
2735         try to make the PLT reference count go negative.
2736
2737 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2738
2739         * elf32-arm.c (elf32_arm_final_link_relocate): Always fill in the
2740         GOT entry here, rather than leaving it to finish_dynamic_symbol.
2741         Only create a dynamic relocation for local references if
2742         info->shared.
2743         (allocate_dynrelocs_for_symbol): Update dynamic relocation
2744         allocation accordingly.
2745         (elf32_arm_finish_dynamic_symbol): Don't initialise the GOT entry here.
2746
2747 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2748
2749         * elf32-arm.c (elf32_arm_allocate_dynrelocs): New function.
2750         (elf32_arm_add_dynreloc): Likewise.
2751         (elf32_arm_adjust_dynamic_symbol): Use elf32_arm_allocate_dynrelocs
2752         to allocate dynamic relocations.
2753         (elf32_arm_size_dynamic_sections): Likewise.
2754         (allocate_dynrelocs): Likewise.  Rename to
2755         allocate_dynrelocs_for_symbol.
2756         (elf32_arm_final_link_relocate): Use elf32_arm_add_dynreloc to
2757         create dynamic relocations.
2758         (elf32_arm_finish_dynamic_symbol): Likewise.
2759
2760 2011-03-12  H.J. Lu  <hongjiu.lu@intel.com>
2761
2762         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
2763         x32 GD->IE and GD->LE transitions.
2764         (elf_x86_64_relocate_section): Supprt TLS x32 GD->IE, GD->LE
2765         and LD->LE transitions.
2766
2767 2011-03-10  Alan Modra  <amodra@gmail.com>
2768
2769         * elf64-ppc.c (ppc64_elf_relocate_section): Provide section/offset
2770         for LO_DS error message and correct multiple.
2771
2772 2011-03-10  Alan Modra  <amodra@gmail.com>
2773
2774         * elf64-ppc.c (bfd_elf64_bfd_link_just_syms): Define.
2775         (ppc64_elf_link_just_syms): New function.
2776         (opd_entry_value): Don't assume big-endian host.
2777         (get_r2off): New function.
2778         (ppc_build_one_stub, ppc_size_one_stub): Use it here.
2779
2780 2011-03-06  Michael Snyder  <msnyder@vmware.com>
2781
2782         * compress.c (bfd_compress_section_contents): Check for out of mem.
2783
2784         * elf64-x86-64.c (elf_x86_64_relocate_section): Document
2785         that case statement falls through intentionally.
2786
2787         * elf32-i386.c (elf_i386_relocate_section): Document fall through.
2788
2789 2011-03-04  Alan Modra  <amodra@gmail.com>
2790
2791         * archive.c (bsd_write_armap): Don't call stat in deterministic
2792         mode, and don't use st_mtime if stat returns error.
2793
2794 2011-03-03  Michael Snyder  <msnyder@vmware.com>
2795
2796         * elf64-x86-64.c (elf_x86_64_relocate_section): Remove dead code.
2797
2798         * coff-x86_64.c (coff_amd64_rtype_to_howto): Fencepost error.
2799
2800         * aoutx.h (aout_final_link): Use sizeof int not sizeof int*.
2801         (aout_link_write_other_symbol): Missing break statement.
2802
2803         * dwarf2.c (scan_unit_for_symbols): Stop memory leak.
2804
2805         * archive.c (_bfd_slurp_extended_name_table): Fail if bfd_seek fails.
2806
2807 2011-03-03  H.J. Lu  <hongjiu.lu@intel.com>
2808
2809         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
2810         x32 IE->LE transition.
2811         (elf_x86_64_relocate_section): Likewise.
2812
2813 2011-03-02  Bernd Schmidt  <bernds@codesourcery.com>
2814
2815         * elflink.c (is_reloc_section): Remove function.
2816         (get_dynamic_reloc_section_name): Construct string manually.
2817
2818 2011-02-28  Kai Tietz  <kai.tietz@onevision.com>
2819
2820         * archive.c (_bfd_find_nested_archive): Use filename_(n)cmp.
2821         (adjust_relative_path): Likewise.
2822         (_bfd_construct_extended_name_table): Likewise.
2823         * corefile.c (generic_core_file_matches_executable_p): Likewise.
2824         * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2825         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2826         * elf32-spu.c (sort_bfds): Likewise.
2827         (spu_elf_auto_overlay): Likewise.
2828         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
2829         * xcofflink.c (xcoff_set_import_path): Likewise.
2830         * xtensa-isa.c (xtensa_regfile_lookup): Likewise.
2831         (xtensa_regfile_lookup_shortname): Likewise.
2832
2833 2011-02-28  Alan Modra  <amodra@gmail.com>
2834
2835         PR 12513
2836         * archive.c (bfd_slurp_bsd_armap_f2): Sanity check parsed_size and
2837         stringsize.  Properly sanity check symdef_count.  Remove redundant
2838         bfd_release.
2839
2840 2011-02-25  Rafael Ávila de Espíndola <respindola@mozilla.com>
2841
2842         * plugin.c (bfd_plugin_object_p): Correctly set the filesize
2843         and handle claim_file seeking. Only try to load the plugin once.
2844
2845 2011-02-22  Andreas Schwab  <schwab@redhat.com>
2846
2847         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): For a TLS_GD
2848         relocation read the value from the second GOT slot.
2849
2850 2011-02-15  Tristan Gingold  <gingold@adacore.com>
2851
2852         * vms-alpha.c (alpha_vms_link_add_archive_symbols): Add a comment.
2853
2854 2011-02-15  Alan Modra  <amodra@gmail.com>
2855
2856         * elf64-ppc.c (ppc64_elf_edit_toc): Reinstate second read of
2857         toc relocs.  Fuss over free(NULL).
2858
2859 2011-02-14  Mike Frysinger  <vapier@gentoo.org>
2860
2861         * elflink.c (bfd_elf_size_dynamic_sections): Add
2862         bfd_get_symbol_leading_char to the start of newname.
2863
2864 2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2865
2866         * configure: Regenerate.
2867
2868 2011-02-09  Alan Modra  <amodra@gmail.com>
2869
2870         * elf64-ppc.c (ppc64_elf_edit_toc): Don't free toc relocs until
2871         we are done.  When optimising large toc, check that a global
2872         symbol on a toc reloc is defined in a kept section.
2873
2874 2011-02-08  Nick Clifton  <nickc@redhat.com>
2875
2876         PR binutils/12467
2877         * elf.c (assign_file_positions_for_load_sections): Set the program
2878         header offset and entry size to zero if there are no program
2879         headers.
2880
2881 2011-02-08  Alan Modra  <amodra@gmail.com>
2882
2883         * elf64-ppc.c (ppc64_elf_edit_toc): Don't segfault on NULL
2884         local_syms when looking for local symbols in .toc.
2885
2886 2011-02-01  Alan Modra  <amodra@gmail.com>
2887
2888         * elf64-ppc.c (ppc64_elf_next_input_section): Use elf_gp value
2889         for toc pointer on any section having makes_toc_func_call set.
2890         (check_pasted_section): Ensure pasted .init/.fini fragments use
2891         the same toc if any has makes_toc_func_call set.
2892
2893 2011-01-28  Joseph Myers  <joseph@codesourcery.com>
2894
2895         * elf32-ppc.c (ppc_elf_link_hash_newfunc): Initialize has_sda_refs
2896         field.
2897
2898 2011-01-22  Richard Sandiford  <rdsandiford@googlemail.com>
2899
2900         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Ignore
2901         common sections too.
2902
2903 2011-01-18  H.J. Lu  <hongjiu.lu@intel.com>
2904
2905         * elf64-x86-64.c (elf_backend_want_plt_sym): Redefine to 0 after
2906         Solaris target.
2907
2908 2011-01-18  Pierre Muller  <muller@ics.u-strasbg.fr>
2909
2910         Fix compilation for mingw64.
2911         * coffcode.h (coff_slurp_symbol_table): Add intptr_t intermediate
2912         typecast to avoid warning.
2913         * elf32-rx.c: Add "bfd_stdint.h" include required for int32_t type
2914         usage.
2915         * elfxx-ia64.c (elfNN_ia64_relax_br): Use intptr_t typeacast instead
2916         of long for pointer to avoid warning.
2917         (elfNN_ia64_relax_brl): Idem.
2918         (elfNN_ia64_install_value): Idem.
2919         * vms-alpha.c (_bfd_vms_slurp_etir): Idem.
2920
2921 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
2922
2923         * elf32-arm.c (elf32_arm_check_relocs): Check needs_plt rather than
2924         h->needs_plt when deciding whether to record a possible dynamic reloc.
2925
2926 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
2927
2928         * elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered
2929         dynamic relocs for the removed section.
2930
2931 2011-01-15  H.J. Lu  <hongjiu.lu@intel.com>
2932
2933         * elf64-x86-64.c (elf_x86_64_check_relocs): Check invalid x32
2934         relocations.
2935
2936 2011-01-14  H.J. Lu  <hongjiu.lu@intel.com>
2937
2938         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add pointer_r_type.
2939         (elf_x86_64_link_hash_table_create): Set pointer_r_type.
2940         (elf_x86_64_check_relocs): Handle R_X86_64_32 like R_X86_64_64
2941         for ILP32.  Remove ABI_64_P PIC check for R_X86_64_8,
2942         R_X86_64_16, R_X86_64_32 and R_X86_64_32S.
2943         (elf_x86_64_relocate_section):  Handle R_X86_64_32 like R_X86_64_64
2944         for ILP32.
2945
2946 2011-01-14  Alan Modra  <amodra@gmail.com>
2947
2948         * bfd.c (bfd_perror): Flush stdout before and stderr after printing
2949         error.
2950         (_bfd_default_error_handler): Likewise.
2951         * elf.c (print_segment_map): Likewise.
2952         * libbfd.c (warn_deprecated): Likewise.
2953         * som.c (som_sizeof_headers): No need to do so here.
2954         * coff-i860.c: Replace use of printf for error messages with
2955         _bfd_error_handler.
2956         * coff-ppc.c: Likewise.
2957         * coff-sh.c: Likewise.
2958         * elf32-bfin.c: Likewise.
2959         * elf32-dlx.c: Likewise.
2960         * elf32-mep.c: Likewise.
2961         * elf32-v850.c: Likewise.
2962         * mach-o.c: Likewise.
2963         * pef.c: Likewise.
2964
2965 2011-01-13  H.J. Lu  <hongjiu.lu@intel.com>
2966
2967         * elf64-x86-64.c (elf_x86_64_link_hash_table): Remove
2968         swap_reloca_out.
2969         (elf_x86_64_link_hash_table_create): Don't set swap_reloca_out.
2970         (elf_x86_64_check_relocs): Align relocation section to 4 byte
2971         for 32bit.
2972         (elf_x86_64_gc_sweep_hook): Replace ELF64_ST_TYPE with
2973         ELF_ST_TYPE.
2974         (elf_x86_64_finish_dynamic_symbol): Updated.
2975         (elf_x86_64_finish_dynamic_sections): Don't use
2976         Elf64_External_Dyn, bfd_elf64_swap_dyn_in, nor
2977         bfd_elf64_swap_dyn_out.
2978
2979 2011-01-14  J. Park  <grassman@gmail.com>
2980
2981         PR ld/12339
2982         * elf32-arm.c (allocate_dynrelocs): Don't set up eh before
2983         following bfd_link_hash_warning symbol link.
2984
2985 2011-01-10  Nathan Sidwell  <nathan@codesourcery.com>
2986             Glauber de Oliveira Costa  <glommer@gmail.com>
2987
2988         * reloc.c (BFD_RELOC_ARM_TLS_GOTDESC, BFD_RELOC_ARM_TLS_CALL,
2989         BFD_RELOC_ARM_THM_TLS_CALL, BFD_RELOC_ARM_TLS_DESCSEQ,
2990         BFD_RELOC_ARM_THM_TLS_DESCSEQ, BFD_RELOC_ARM_TLS_DESC): New
2991         relocations.
2992         * libbfd.h: Rebuilt.
2993         * bfd-in2.h: Rebuilt.
2994         * elf32-arm.c (elf32_arm_howto_table_1): Add new relocations.
2995         (elf32_arm_reloc_map): Likewise.
2996         (tls_trampoline, dl_tlsdesc_lazy_trampoline): New PLT templates.
2997         (elf32_arm_stub_long_branch_any_tls_pic,
2998         elf32_arm_stub_long_branch_v4t_thumb_tls_pic): New stub templates.
2999         (DEF_STUBS): Add new stubs.
3000         (struct_elf_arm_obj_data): Add local_tlsdesc_gotent field.
3001         (elf32_arm_local_tlsdesc_gotent): New.
3002         (GOT_TLS_GDESC): New mask.
3003         (GOT_TLS_GD_ANY): Define.
3004         (struct elf32_arm_link_hash_entry): Add tlsdesc_got field.
3005         (elf32_arm_compute_jump_table_size): New.
3006         (struct elf32_arm_link_hash_table): Add next_tls_desc_index,
3007         num_tls_desc, dt_tlsdesc_plt, dt_tlsdesc_got, tls_trampoline,
3008         sgotplt_jump_table_size fields.
3009         (elf32_arm_link_hash_newfunc): Initialize tlsdesc_got field.
3010         (elf32_arm_link_hash_table_create): Initialize new fields.
3011         (arm_type_of_stub): Check TLS desc relocs too.
3012         (elf32_arm_stub_name): TLS desc relocs can be shared.
3013         (elf32_arm_tls_transition): Determine relaxation.
3014         (arm_stub_required_alignment): Add tls stubs.
3015         (elf32_arm_size_stubs): Likewise.
3016         (elf32_arm_tls_relax): Perform TLS relaxing.
3017         (elf32_arm_final_link_relocate): Process TLS DESC relocations.
3018         (IS_ARM_TLS_GNU_RELOC): New.
3019         (IS_ARM_TLS_RELOC): Use it.
3020         (elf32_arm_relocate_section): Perform TLS relaxing.
3021         (elf32_arm_check_relocs): Anticipate TLS relaxing, process tls
3022         desc relocations.
3023         (allocate_dynrelocs): Allocate tls desc relcoations.
3024         (elf32_arm_output_arch_local_syms): Emit tls trampoline mapping
3025         symbols.
3026         (elf32_arm_size_dynamic_sections): Allocate tls trampolines and
3027         got slots.
3028         (elf32_arm_always_size_sections): New. Create _TLS_MODULE_BASE
3029         symbol.
3030         (elf32_arm_finish_dynamic_symbol): Adjust.
3031         (arm_put_trampoline): New.
3032         (elf32_arm_finish_dynamic_sections): Emit new dynamic tags and tls
3033         trampolines.
3034         (elf_backend_always_size_sections): Define.
3035
3036 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
3037
3038         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Optimized.
3039
3040 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
3041
3042         PR ld/12366
3043         PR ld/12371
3044         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Properly
3045         handle symbols marked with regular reference, but not non-GOT
3046         reference when building shared library.
3047
3048         * elf32-i386.c (elf_i386_gc_sweep_hook): Properly handle
3049         local and global STT_GNU_IFUNC symols when building shared
3050         library.
3051         * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
3052
3053 2011-01-05  DJ Delorie  <dj@redhat.com>
3054
3055         * reloc.c: Add BFD_RELOC_RX_OP_NEG.
3056         * libbfd.h: Regenerate.
3057         * bfd-in2.h: Regenerate.
3058         * elf32-rx.c: Add it to the list, corresponding to R_RX_OPneg.
3059
3060 2011-01-03  H.J. Lu  <hongjiu.lu@intel.com>
3061
3062         * cpu-i386.c (bfd_i386_compatible): New.
3063         (bfd_x64_32_arch_intel_syntax): Replace bfd_default_compatible
3064         with bfd_i386_compatible.
3065         (bfd_x86_64_arch_intel_syntax): Likewise.
3066         (bfd_i386_arch_intel_syntax): Likewise.
3067         (i8086_arch): Likewise.
3068         (bfd_x64_32_arch): Likewise.
3069         (bfd_x86_64_arch): Likewise.
3070         (bfd_i386_arch): Likewise.
3071
3072 For older changes see ChangeLog-2010
3073 \f
3074 Local Variables:
3075 mode: change-log
3076 left-margin: 8
3077 fill-column: 74
3078 version-control: never
3079 End: