Add support for 32-bit and 64-bit PowerPC AIX core files.
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2015-10-27 Sangamesh Mallayya <nickc@redhat.com>sangamesh.swamy@in.ibm.com>
2
3 * configure.ac (powerpc64-*-aix[5-9].*): Match powerpc64 running
4 aix for core file support.
5 * configure: Regenerate.
6 * rs6000-core.c: Check for __ld_info64 if compiling 64-bit gdb.
7 Added BFD64 check if we are using old core file format for 32-bit gdb.
8 Set sizeof CORE_COMMONSZ appropriately in case of either new or
9 old core file format.
10 (read_hdr): Added BFD64 check for 64-bit support.
11 (rs6000coff_core_p): Likewise.
12 (rs6000coff_core_file_matches_executable_p): Likewise.
13 (rs6000coff_core_file_failing_command): Likewise.
14 (rs6000coff_core_file_failing_signal): Likewise.
15 Add support for debugging core files generated by binaries in
16 Large Memory model.
17 (rs6000coff_core_p): If Large Memory Model is used, then the .data
18 segment should start from BDATAORG which has been defined in the
19 system header files.
20
21 2015-10-26 H.J. Lu <hongjiu.lu@intel.com>
22
23 PR ld/19175
24 * elf32-i386.c (elf_i386_convert_load): Check bfd_link_hash_new
25 instead of calling bfd_link_get_defined_symbol.
26 * elf64-x86-64.c (elf_x86_64_convert_load): Likewise. Skip
27 relocation overflow for bfd_link_hash_new.
28 * linker.c (bfd_link_get_defined_symbol): Removed.
29 * bfd-in2.h: Regenerated.
30
31 2015-10-26 H.J. Lu <hongjiu.lu@intel.com>
32
33 PR ld/19171
34 * elf32-i386.c (elf_i386_convert_load): Call
35 bfd_link_get_defined_symbol to check if a symbol is defined.
36 * elf64-x86-64.c (elf_x86_64_convert_load): Call
37 bfd_link_get_defined_symbol to get defined symbol section and
38 value.
39 * linker.c (bfd_link_get_defined_symbol): New function.
40 * bfd-in2.h: Regenerated.
41
42 2015-10-23 Alan Modra <amodra@gmail.com>
43
44 PR ld/11133
45 PR ld/19161
46 PR ld/19167
47 * elflink.c (_bfd_elf_gc_mark_hook): Delete code handling __start_*
48 and __stop_* symbol refs.
49 (_bfd_elf_gc_mark_rsec): Add start_stop parameter. Handle __start_*
50 and __stop_* symbol refs here..
51 (_bfd_elf_gc_mark_reloc): ..and here.
52 * elf-bfd.h (_bfd_elf_gc_mark_hook): Update prototype.
53 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Update
54 _bfd_elf_gc_mark_rsec call.
55
56 2015-10-23 Alan Modra <amodra@gmail.com>
57
58 PR ld/11133
59 PR ld/19161
60 * elflink.c (elf_gc_sweep): Revert last patch.
61 (_bfd_elf_gc_mark_hook): Don't set SEC_KEEP here.
62
63 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
64
65 PR ld/19161
66 * elflink.c (elf_gc_sweep): Always keep sections marked with
67 SEC_KEEP.
68
69 2015-10-22 Hans-Peter Nilsson <hp@bitrange.com>
70
71 * mmo.c (struct mmo_data_struct): New members
72 symbol_consistency_override_calculated and ignore_symbol_consistency.
73 (mmo_section_has_contents, mmo_ignore_symbol_consistency): New
74 functions.
75 (mmo_create_symbol): Check with mmo_ignore_symbol_consistency if to
76 report an error for unexpected value of Main.
77 (mmo_write_symbols_and_terminator): Similar.
78
79 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
80
81 * elf32-i386.c (elf_i386_convert_load): Use call_nop_byte and
82 check call_nop_as_suffix for 1-byte NOP padding to pad call.
83 * elf64-x86-64.c (elf_x86_64_convert_load): Likewise.
84
85 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
86
87 * elf64-x86-64.c: Include opcode/i386.h.
88 (x86_64_elf_howto_table): Add R_X86_64_GOTPCRELX and
89 R_X86_64_REX_GOTPCRELX.
90 (R_X86_64_standard): Replace R_X86_64_PLT32_BND with
91 R_X86_64_REX_GOTPCRELX.
92 (x86_64_reloc_map): Add BFD_RELOC_X86_64_GOTPCRELX and
93 BFD_RELOC_X86_64_REX_GOTPCRELX.
94 (need_convert_mov_to_lea): Renamed to ...
95 (need_convert_load): This.
96 (elf_x86_64_check_relocs): Handle R_X86_64_GOTPCRELX and
97 R_X86_64_REX_GOTPCRELX. Replace need_convert_mov_to_lea with
98 need_convert_load.
99 (elf_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPCRELX and
100 R_X86_64_REX_GOTPCRELX.
101 (elf_x86_64_size_dynamic_sections): Likewise.
102 (elf_x86_64_relocate_section): Likewise.
103 (elf_x86_64_convert_mov_to_lea): Renamed to ...
104 (elf_x86_64_convert_load): This. Replace need_convert_mov_to_lea
105 with need_convert_load. Support R_X86_64_GOTPCRELX and
106 R_X86_64_REX_GOTPCRELX transformations.
107 * reloc.c (BFD_RELOC_X86_64_GOTPCRELX): New.
108 (BFD_RELOC_X86_64_REX_GOTPCRELX): Likewise.
109 * bfd-in2.h: Regenerated.
110 * libbfd.h: Likewise.
111
112 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
113
114 * elf32-i386.c: Include opcode/i386.h.
115 (elf_howto_table): Add R_386_GOT32X.
116 (R_386_ext2): Replace R_386_IRELATIVE with R_386_GOT32X.
117 (elf_i386_reloc_type_lookup): Handle BFD_RELOC_386_GOT32X.
118 (need_convert_mov_to_lea): Renamed to ...
119 (need_convert_load): This.
120 (elf_i386_check_relocs): Handle R_386_GOT32X. Replace
121 need_convert_mov_to_lea with need_convert_load.
122 (elf_i386_gc_sweep_hook): Handle R_386_GOT32X.
123 (elf_i386_size_dynamic_sections): Likewise.
124 (elf_i386_relocate_section): Likewise.
125 (elf_i386_convert_mov_to_lea): Renamed to ...
126 (elf_i386_convert_load): This. Replace need_convert_mov_to_lea
127 with need_convert_load. Support R_386_GOT32X transformations.
128 * reloc.c (BFD_RELOC_386_GOT32X): New.
129 * bfd-in2.h: Regenerated.
130 * libbfd.h: Likewise.
131
132 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
133
134 * elf32-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
135 only when linking an executable.
136 (elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
137 slot.
138 * elf64-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
139 only when linking an executable.
140 (elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
141 slot.
142
143 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
144
145 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Set the PLT
146 reference counters for local IFUNC calls.
147 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
148
149 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
150
151 * elf32-s390.c (elf_s390_check_relocs): Fallthrough to the PLT
152 slot allocating code for GOTOFF relocs on ifunc symbols.
153 (elf_s390_gc_sweep_hook): Decrement plt refcount for GOTOFF relocs
154 on ifunc symbols.
155 (elf_s390_relocate_section): Redirect a GOTOFF reloc to an iplt
156 slot.
157
158 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
159
160 PR ld/18841
161 * elf32-s390.c (elf_s390_reloc_type_class): Return
162 reloc_class_ifunc for ifunc symbols.
163 * elf64-s390.c (elf_s390_reloc_type_class): Likewise.
164
165 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
166
167 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Call
168 elf_s390_finish_ifunc_symbol only for actually defined symbols.
169 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
170
171 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
172
173 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs): Remove
174 `head' parameter.
175 * elf32-s390.c (allocate_dynrelocs): Don't use last parameter.
176 * elf64-s390.c (allocate_dynrelocs): Don't use last parameter.
177
178 2015-10-20 Hans-Peter Nilsson <hp@bitrange.com>
179
180 * mmo.c (mmo_write_symbols_and_terminator): Correct printed value
181 of Main in error message.
182
183 2015-10-18 Doug Evans <xdje42@gmail.com>
184
185 * targets.c (bfd_flavour_name): "MMO" is spelled "mmo".
186
187 2015-10-17 Alan Modra <amodra@gmail.com>
188
189 * elf64-ppc.c (ppc64_elf_size_stubs): Correct __glink_PLTresolve
190 eh_frame FDE for ELFv1.
191
192 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
193
194 * elf32-i386.c (elf_i386_convert_mov_to_lea): Check if symbol
195 is defined.
196 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
197
198 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
199
200 * elf32-i386.c (elf_i386_convert_mov_to_lea): Don't check
201 def_regular.
202 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
203
204 2015-10-15 H.J. Lu <hongjiu.lu@intel.com>
205
206 * elflink.c (_bfd_elf_merge_symbol): Fix typos in comments
207
208 2015-10-15 Alan Modra <amodra@gmail.com>
209
210 * elf32-v850.c (v850_elf_copy_private_bfd_data): Remove assertion
211 that input and output .note.renesas sections are same size.
212 Instead, only copy input to output if they are.
213
214 2015-10-15 Riku Voipio <riku.voipio@iki.fi>
215
216 PR ld/19123
217 * elfcore.h (elf_core_file_p): Use the file_ptr type to hold the
218 offset for bfd_seek.
219 * elfcode.h (elf_object_p): Likewise.
220
221 2015-10-14 Rich Felker <dalias@libc.org>
222
223 PR ld/19091
224 * elf32-sh.c (sh_elf_size_dynamic_sections): Always emit
225 DT_PLTGOT for FDPIC output.
226
227 2015-10-13 Alan Modra <amodra@gmail.com>
228
229 * elf.c (_bfd_elf_map_sections_to_segments): Don't set
230 PT_GNU_RELRO p_flags.
231 (assign_file_positions_for_non_load_sections): Set PT_GNU_RELRO
232 flags to PF_R here.
233
234 2015-10-12 H.J. Lu <hongjiu.lu@intel.com>
235
236 PR ld/19073
237 * elflink.c (_bfd_elf_add_default_symbol): Skip the unversioned
238 definition after the default version.
239
240 2015-10-12 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
241
242 PR ld/19083
243 * elf32-s390.c (elf_s390_gc_sweep_hook): Do not reduce got
244 refcount for relocs not really requiring a got slot.
245 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
246
247 2015-10-11 John David Anglin <danglin@gcc.gnu.org>
248
249 * elf-hppa.h (elf_hppa_action_discarded): Ignore relocations in
250 .data.rel.ro.local.
251
252 2015-10-07 Cupertino Miranda <cmiranda@synopsys.com>
253
254 * archures.c: Remove support for older ARC. Added support for new
255 ARC cpus (ARC600, ARC601, ARC700, ARCV2).
256 * bfd-in2.h: Likewise.
257 * config.bfd: Likewise.
258 * cpu-arc.c: Likewise.
259 * elf32-arc.c: Totally changed file with a refactored
260 inplementation of the ARC port.
261 * libbfd.h: Added ARC specific relocation types.
262 * reloc.c: Likewise.
263
264 2015-10-06 H.J. Lu <hongjiu.lu@intel.com>
265
266 * bfd.c (bfd_update_compression_header): Clear the ch_reserved
267 field in 64-bit output.
268 (bfd_convert_section_contents): Likewise.
269
270 2015-10-05 H.J. Lu <hongjiu.lu@intel.com>
271
272 PR ld/18914
273 * elflink.c (elf_link_add_object_symbols): Don't re-export a
274 symbol if it isn't undefined.
275
276 2015-10-04 H.J. Lu <hongjiu.lu@intel.com>
277
278 * config.bfd (targ_selvecs, targ64_selvecs): Add iamcu_elf32_vec,
279 i386_pei_vec and x86_64_pei_vec for Solaris2/x86.
280
281 2015-10-02 Renlin Li <renlin.li@arm.com>
282
283 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Add
284 TLSIE_MOVW_GOTTPREL_G1.
285 (aarch64_tls_transition_without_check): Add
286 TLSIE_MOVW_GOTTPREL_G1 to TLSLE_MOVW_TPREL_G2
287 transition for local symbol.
288 (elfNN_aarch64_tls_relax): Add a argument to pass tp offset.
289 Add TLSIE_MOVW_GOTTPREL_G1 relaxation.
290 (elfNN_aarch64_relocate_section): Call elfNN_aarch64_tls_relax
291 with new argument.
292
293 2015-10-02 Renlin Li <renlin.li@arm.com>
294
295 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Add
296 relax transitions for TLSDESC_ADD, TLSDESC_LDR, TLSDESC_OFF_G0_NC,
297 TLSDESC_OFF_G1.
298 (aarch64_tls_transition_without_check): Add relaxation support.
299 (aarch64_reloc_got_type): Add support.
300 (elfNN_aarch64_final_link_relocate): Likewise.
301 (elfNN_aarch64_tls_relax): Likewise.
302 (elfNN_aarch64_relocate_section): Likewise.
303 (elfNN_aarch64_gc_sweep_hook): Likewise.
304 (elfNN_aarch64_check_relocs): Likewise.
305 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
306 (_bfd_aarch64_elf_resolve_relocation): Likewise.
307
308 2015-10-02 Renlin Li <renlin.li@arm.com>
309
310 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Check overflow for
311 BFD_RELOC_AARCH64_TLSDESC_OFF_G1.
312
313 2015-10-02 Renlin Li <renlin.li@arm.com>
314
315 * elfnn-aarch64.c(IS_AARCH64_TLS_RELAX_RELOC):
316 Add relaxation support for TLSGD_MOVW_G0_NC and TLSGD_MOVW_G1.
317 (aarch64_tls_transition_without_check): Likewise
318 (elfNN_aarch64_tls_relax): Likwise.
319
320 2015-10-02 Renlin Li <renlin.li@arm.com>
321
322 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Create GOT section
323 for TLSLE_MOVW_TPREL_G(1, 1_NC, 2) relocation.
324
325 2015-10-02 Renlin Li <renlin.li@arm.com>
326
327 * reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
328 AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
329 * libbfd.h: Regenerate.
330 * bfd-in2.h: Likewise.
331 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
332 TLSIE_MOVW_GOTTPREL_G1 check overflow.
333 (aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
334 and TLSIE_MOVW_GOTTPREL_G0_NC.
335 (elfNN_aarch64_final_link_relocate): Likewise.
336 (elfNN_aarch64_relocate_section): Likewise.
337 (elfNN_aarch64_gc_sweep_hook): Likewise.
338 (elfNN_aarch64_check_relocs): Likewise.
339 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
340 (_bfd_aarch64_elf_resolve_relocation): Likewise.
341
342 2015-10-02 Renlin Li <renlin.li@arm.com>
343
344 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
345 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC support.
346 (elfNN_aarch64_final_link_relocate): Likewise.
347 (elfNN_aarch64_relocate_section): Likewise.
348 (elfNN_aarch64_gc_sweep_hook): Likewise.
349 (elfNN_aarch64_check_relocs): Likewise.
350 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
351 (_bfd_aarch64_elf_resolve_relocation): Likewise.
352
353 2015-10-02 Renlin Li <renlin.li@arm.com>
354
355 * reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC): New entry.
356 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
357 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC.
358 * libbfd.h: Regenerate.
359 * bfd-in2.h: Likewise
360
361 2015-10-02 Renlin Li <renlin.li@arm.com>
362
363 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
364 BFD_RELOC_AARCH64_TLSGD_MOVW_G1 support.
365 (elfNN_aarch64_final_link_relocate): Likewise.
366 (elfNN_aarch64_relocate_section): Likewise.
367 (elfNN_aarch64_gc_sweep_hook): Likewise.
368 (elfNN_aarch64_check_relocs): Likewise.
369 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
370 (_bfd_aarch64_elf_resolve_relocation): Likewise.
371
372 2015-10-02 Renlin Li <renlin.li@arm.com>
373
374 * reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G1): New entry.
375 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
376 BFD_RELOC_AARCH64_TLSGD_MOVW_G1.
377 * bfd-in2.h: Regenerate.
378 * libbfd.h: Likewise.
379
380 2015-10-02 Renlin Li <renlin.li@arm.com>
381
382 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
383 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC support.
384 (elfNN_aarch64_final_link_relocate): Likewise.
385 (elfNN_aarch64_gc_sweep_hook): Likewise.
386 (elfNN_aarch64_check_relocs): Likewise.
387 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
388 (_bfd_aarch64_elf_resolve_relocation): Likewise.
389
390 2015-10-02 Renlin Li <renlin.li@arm.com>
391
392 * reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC): New.
393 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry
394 MOVW_GOTOFF_G0_NC.
395 * libbfd.h: Regnerate.
396 * bfd-in2.h: Regenerate.
397
398 2015-10-02 Renlin Li <renlin.li@arm.com>
399
400 * elfnn-aarch64.c (aarch64_reloc_got_type): Add support
401 for BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
402 (elfNN_aarch64_gc_sweep_hook): Likewise.
403 (elfNN_aarch64_check_relocs): Likewise
404 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
405 (_bfd_aarch64_elf_resolve_relocation): Likewise
406 (elfNN_aarch64_final_link_relocate): Likewise
407
408 2015-010-02 Renlin Li <renlin.li@arm.com>
409
410 * reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G1): New.
411 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
412 MOVW_GOTOFF_G1.
413 * libbfd.h: Regenerate.
414 * bfd-in2.h: Regenerate.
415
416 2015-10-02 Renlin Li <renlin.li@arm.com>
417
418 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
419 BFD_RELOC_AARCH64_LD_64_GOTOFF_LO15 support.
420 (elfNN_aarch64_gc_sweep_hook): Likewise.
421 (elfNN_aarch64_check_relocs): Likewise
422 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
423 (_bfd_aarch64_elf_resolve_relocation): Likewise
424 (elfNN_aarch64_final_link_relocate): Calculate offset within GOT.
425
426 2015-10-02 Renlin Li <renlin.li@arm.com>
427
428 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Change if to
429 switch statement.
430
431 2015-10-01 H.J. Lu <hongjiu.lu@intel.com>
432
433 PR ld/19031
434 * elf64-x86-64.c (elf_x86_64_check_relocs): Set
435 pointer_equality_needed for R_X86_64_PC32 reloc in non-code
436 sections.
437
438 2015-10-01 Renlin Li <renlin.li@arm.com>
439
440 * elfnn-aarch64.c (elfNN_aarch64_output_plt_map): Remove.
441 (elfNN_aarch64_output_arch_local_syms): Emit AARCH64_MAP_INSN once.
442
443 2015-10-01 Kaz Kojima <kkojima@rr.iij4u.or.jp>
444
445 * config.bfd (targ_selvecs): Remove sh_elf32_vec and
446 sh_elf32_le_vec from sh*-*-linux cases.
447
448 2015-10-01 Alan Modra <amodra@gmail.com>
449
450 PR ld/19013
451 * elflink.c (_bfd_elf_merge_sections): Revert last change.
452
453 2015-09-30 H.J. Lu <hongjiu.lu@intel.com>
454
455 PR ld/19031
456 * elf32-i386.c (elf_i386_check_relocs): Set
457 pointer_equality_needed for R_386_PC32 reloc in non-code
458 sections.
459
460 2015-09-30 H.J. Lu <hongjiu.lu@intel.com>
461
462 PR ld/19013
463 * elflink.c (_bfd_elf_merge_sections): Only merge input bfds
464 that have the compatible ELF machine code with the output bfd.
465
466 2015-09-30 Alan Modra <amodra@gmail.com>
467
468 PR ld/19013
469 * elflink.c (_bfd_elf_merge_sections): Only merge input bfds that
470 will be handled by elf_link_input_bfd. Rename abfd param to obfd.
471
472 2015-09-30 Rich Felker <dalias@libc.org>
473
474 * config.bfd (targ_selvecs): Add fdpic and misc targets
475 for sh*-*-linux*.
476
477 2015-09-29 Andrew Stubbs <ams@codesourcery.com>
478 H.J. Lu <hongjiu.lu@intel.com>
479
480 PR binutils/19020
481 * bfd.c (bfd_convert_section_contents): Add ptr_size parameter.
482 * bfd-in2.h: Regenerated.
483
484 2015-08-11 Peter Zotov <whitequark@whitequark.org>
485
486 PR ld/18759
487 * elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
488 (R_OR1K_16_PCREL): Likewise.
489 (R_OR1K_8_PCREL): Likewise.
490
491 2015-09-23 Nick Clifton <nickc@redhat.com>
492
493 * bout.c (b_out_slurp_reloc_table): Cast constant to unsigned in
494 order to avoid problems with left shifting negative values.
495 (abs32code): Likewise.
496 * mach-o.c (FILE_ALIGN): Likewise.
497 * coff-rs6000.c (xcoff_debug_sections): Delete unused static
498 array.
499 * elf32-visium.c (visium_reloc_map): Likewise.
500 * elf32-arm.c (elf32_arm_final_link_relocate): Remove useless
501 calls to abs function.
502 * elf32-frv.c (_frvfdpic_relax_tls_entries): Likewise.
503 * elf32-score.c (score_elf_final_link_relocate): Likewise.
504 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
505 * elf32-i860.c (i860_howto_pc26_reloc): Use multiplication instead
506 of shifting to create a negative mask.
507 * elf32-msp430.c (elf_backend_special_sections): Define.
508 * elfxx-mips.c (got_ofst_reloc_p): Delete unused function.
509 (got_hi16_reloc_p): Delete unused function.
510 * ppcboot.c (ppcboot_bfd_print_private_bfd_data): Fix test of
511 partition name.
512
513 2015-09-23 Nick Clifton <nickc@redhat.com>
514
515 PR binutils/15835
516 * elf-bfd.h (struct elf_section_list): New structure.
517 (struct elf_obj_tdata): Replace symtab_shndx_hdr with
518 symtab_shndx_list. Delete symtab_shndx_section.
519 (elf_symtab_shndx): Replace macro with elf_symtab_shndx_list.
520 * elf.c (bfd_elf_get_syms): If symtab index sections are present,
521 scan them for the section that matches the provided symbol table.
522 (bfd_section_from_shdr): Record all SHT_SYMTAB_SHNDX sections.
523 (assign_section_numbers): Use the first symtab index table in the
524 list.
525 (_bfd_elf_compute_section_file_positions): Replace use of
526 symtab_shndx_hdr with use of symtab_shndx_list.
527 (find_section_in_list): New function.
528 (assign_file_postions_except_relocs): Use new function.
529 (_bfd_elf_copy_private_symbol_data): Likewise.
530 (swap_out_syms): Handle multiple symbol table index sections.
531 * elf32-m32c.c (m32c_elf_relax_section): Replace use of
532 symtab_shndx_hdr with use of symtab_shndx_list.
533 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
534 * elf32-rx.c (rx_relax_section): Likewise.
535 * elf32-v850.c (v850_elf_relax_delete_bytes): Likewise.
536 * elflink.c (bfd_elf_final_link): Likewise.
537
538 2015-09-21 H.J. Lu <hongjiu.lu@intel.com>
539
540 * bfd.c (bfd_update_compression_header): Use bfd_put_32 on
541 ch_type.
542 (bfd_check_compression_header): Use bfd_get_32 on ch_type.
543 (bfd_convert_section_contents): Use bfd_get_32 and bfd_put_32
544 on ch_type.
545
546 2015-09-20 Rich Felker <dalias@libc.org>
547
548 * elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create
549 .interp when info->nointerp.
550 (bfd_elf_size_dynamic_sections): Adjust assert.
551 * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't size .interp
552 when info->nointerp.
553 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
554 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
555 * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise.
556 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
557 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
558 * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
559 * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
560 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
561 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
562 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
563 * elf32-metag.c (elf_metag_size_dynamic_sections): Likewise.
564 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
565 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
566 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
567 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
568 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
569 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
570 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
571 * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
572 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Likewise.
573 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
574 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
575 * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise.
576 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
577 * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
578 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
579 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
580 * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
581 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
582 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise.
583 * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise.
584 * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
585 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
586 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
587
588 2015-09-18 Doug Evans <xdje42@gmail.com>
589
590 * targets.c (enum bfd_flavour): Add comment.
591 (bfd_flavour_name): New function.
592 * bfd-in2.h: Regenerate.
593
594 2015-09-18 Alan Modra <amodra@gmail.com>
595
596 * elf64-ppc.h (struct ppc64_elf_params <tls_get_addr_opt>): Rename
597 from no_tls_get_addr_opt.
598 * elf64-ppc.c: Update for rename and inversion of tls_get_addr_opt.
599 (ppc64_elf_tls_setup): Set tls_get_addr_opt to 0 only when at
600 default of -1.
601
602 2015-09-17 Alan Modra <amodra@gmail.com>
603
604 PR 18867
605 * elflink.c (elf_link_adjust_relocs): Correct start of insertion
606 sort main loop.
607
608 2015-09-16 Alan Modra <amodra@gmail.com>
609
610 PR 18867
611 * elflink.c (elf_link_adjust_relocs): Modify insertion sort to
612 insert a run. Return status in case of malloc failure.
613 Adjust callers.
614
615 2015-09-15 Max Filippov <jcmvbkbc@gmail.com>
616
617 * elf32-xtensa.c (elf_xtensa_be_plt_entry)
618 (elf_xtensa_le_plt_entry): Emit 'entry' instruction only for
619 windowed ABI.
620 (elf_xtensa_create_plt_entry): Generate 'l32r' offsets and fix
621 up instructions according to ABI.
622
623 2015-09-14 Rich Felker <dalias@libc.org>
624
625 * elf32-sh.c (sh_elf_relocate_section): Set EF_SH_PIC flag
626 instead of clearing it on cross-section relocations.
627 (sh_elf_merge_private_data): Clear EF_SH_PIC flag by default.
628
629 2015-09-12 Helge Deller <deller@gmx.de>
630
631 PR ld/18514
632 * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Set .plt entry
633 size to 0.
634
635 2015-09-09 Jiong Wang <jiong.wang@arm.com>
636
637 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Sort alphabetically.
638
639 2015-09-09 Jiong Wang <jiong.wang@arm.com>
640
641 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Support three
642 TLS local dynamic traditional relocations types.
643 (elfNN_aarch64_tls_relax): Support TLS local dynamic traditional to
644 local executable relaxation.
645
646 2015-09-03 H.J. Lu <hongjiu.lu@intel.com>
647
648 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Remove
649 convert_mov_to_lea.
650
651 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
652
653 * elf32-i386.c (R_386_irelative): Renamed to ...
654 (R_386_ext2): This.
655 (R_386_vt_offset): Updated.
656 (elf_i386_rtype_to_howto): Likewise.
657 (elf_i386_relocate_section): Likewise.
658
659 2015-09-01 H.J. Lu <hongjiu.lu@intel.com>
660
661 PR ld/18900
662 * elf32-i386.c (elf_i386_link_hash_entry): Add
663 func_pointer_refcount.
664 (elf_i386_link_hash_newfunc): Clear func_pointer_refcount.
665 (elf_i386_get_local_sym_hash): Likewise.
666 (elf_i386_copy_indirect_symbol): Also copy
667 func_pointer_refcount.
668 (elf_i386_check_relocs): Increment func_pointer_refcount.
669 (elf_i386_gc_sweep_hook): Decrement func_pointer_refcount.
670 (elf_i386_allocate_dynrelocs): Don't create the PLT entry if
671 there are only function pointer relocations which can be
672 resolved at run-time. Keep dynanamic relocations for run-time
673 function pointer initialization.
674 (elf_i386_relocate_section): Copy dynamic function pointer
675 relocations.
676 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
677 func_pointer_refcount.
678 (elf_x86_64_link_hash_newfunc): Clear func_pointer_refcount.
679 (elf_x86_64_get_local_sym_hash): Likewise.
680 (elf_x86_64_copy_indirect_symbol): Also copy
681 func_pointer_refcount.
682 (elf_x86_64_check_relocs): Increment func_pointer_refcount.
683 (elf_x86_64_gc_sweep_hook): Decrement func_pointer_refcount.
684 (elf_x86_64_allocate_dynrelocs): Don't create the PLT entry if
685 there are only function pointer relocations which can be
686 resolved at run-time. Keep dynanamic relocations for run-time
687 function pointer initialization.
688 (elf_x86_64_relocate_section): Copy dynamic function pointer
689 relocations.
690
691 2015-09-01 Alan Modra <amodra@gmail.com>
692
693 * elf64-ppc.c (ppc64_elf_maybe_function_sym): Adjust symbol value
694 if .opd section has been edited.
695
696 2015-09-01 Alan Modra <amodra@gmail.com>
697
698 PR 18878
699 * elf64-ppc.c (ARRAY_SIZE): Define. Use throughout.
700 (enum ppc_stub_type): Add ppc_stub_save_res.
701 (struct map_stub): Add "next" and "needs_save_res".
702 (struct ppc_link_hash_entry): Add "save_res" flag.
703 (struct ppc_link_hash_table): Add "group".
704 (sfpr_define): Add stub_sec param. Define symbol in stub_sec if
705 stub_sec is non-null. Set "save_res".
706 (save_res_funcs): Make file scope, rename from funcs. Adjust uses.
707 (ppc64_elf_adjust_dynamic_symbol): Prohibit plt call to save_res syms.
708 (ppc_build_one_stub): Handle ppc_stub_save_res.
709 (ppc_size_one_stub): Set stub type to ppc_size_one_stub on finding
710 stub for linker defined save_res sym.
711 (group_sections): Init new fields of struct map_stub.
712 (ppc64_elf_size_stubs): Reserve space for save/restore func copy.
713 (ppc64_elf_build_stubs): Copy save/restore funcs to groups. Emit
714 alias syms too.
715 (ppc64_elf_relocate_section): Set destination for ppc_stub_save_res.
716
717 2015-08-31 Alan Modra <amodra@gmail.com>
718
719 * elf64-ppc.c (get_r2off): Return -1 on error.
720 (ppc_build_one_stub): Adjust for get_r2off change. Don't emit
721 addi r2,r2,0 on r2off stubs when the low 16-bit delta is zero.
722 (ppc_size_one_stub): Corresponding size changes for r2off stubs.
723 Add condition in test for -R objects.
724
725 2015-08-31 Alan Modra <amodra@gmail.com>
726
727 * section.c (section_id): Make file scope.
728 (bfd_get_next_section_id): New function.
729 * elf64-ppc.c (struct map_stub): Remove toc_off field. Move decl.
730 (struct ppc_stub_hash_entry): Delete stub_sec and id_sec. Add
731 group. Update all uses.
732 (struct ppc_link_hash_table): Delete top_id, top_index, and
733 input_list. Add sec_info_arr_size. Rename stub_group to
734 sec_info, and make group info indirect. Update stub_group refs
735 throughout file.
736 (ppc_add_stub): Don't look for stub_sec on link_sec stub_group
737 entry.
738 (ppc_build_one_stub): Delete FIXME.
739 (ppc64_elf_setup_section_lists): Size htab->sec_info for all
740 sections, not just input sections. Don't create htab->input_list.
741 (ppc64_elf_next_input_section): Update to use sec_info union as
742 list pointer.
743 (PREV_SEC): Delete.
744 (group_sections): Pass "info" param rather than "htab". Iterate
745 over output sections rather than input_list. Use sec_info union
746 as list pointers. Alloc atruct map_stub, and return fail status.
747 * bfd-in2.h: Regenerate.
748
749 2015-08-31 Alan Modra <amodra@gmail.com>
750
751 * elflink.c (elf_sort_symbol): Use correctly sized type for
752 calculating signed section->id difference.
753 (elf_link_add_object_symbols): Likewise.
754 * pef.c (bfd_pef_scan_start_address): Warning fix.
755 * vms-alpha.c (vms_new_section_hook): Likewise.
756
757 2015-08-31 Alan Modra <amodra@gmail.com>
758
759 * elf32-nds32.c (nds32_convert_32_to_16_alu1): Warning fix.
760 (find_relocs_at_address_addr): Make "reloc_type" an enum.
761 (nds32_elf_relax_delete_blanks): Warning fix.
762 (nds32_elf_relax_loadstore): Correct loop bound.
763
764 2015-08-31 Alan Modra <amodra@gmail.com>
765
766 * section.c (struct bfd_section): Make "id" and "index" unsigned.
767 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust local var to suit.
768 * elf.c (elf_map_symbols): Likewise.
769 * elf64-ppc.c (sym_exists_at): Make "id" param unsigned.
770 (struct ppc_link_hash_table): Make "top_id" and "top_index" unsigned.
771 (ppc64_elf_setup_section_lists): Ditto for local vars.
772 * elf32-arm.c: Similarly to elf64-ppc.c.
773 * elf32-avr.c: Likewise.
774 * elf32-hppa.c: Likewise.
775 * elf32-m68hc1x.c: Likewise.
776 * elf32-metag.c: Likewise.
777 * elf32-nios2.c: Likewise.
778 * elfnn-aarch64.c: Likewise.
779 * simple.c (struct saved_offsets): Make "section_count" unsigned.
780 * bfd-in2.h: Regenerate.
781
782 2015-08-27 Alan Modra <amodra@gmail.com>
783
784 PR 18867
785 * elf64-alpha.c (elf64_alpha_sort_relocs_p): New function.
786 (elf_backend_sort_relocs_p): Define.
787
788 2015-08-26 Alan Modra <amodra@gmail.com>
789
790 PR 18867
791 * elflink.c (cmp_ext32l_r_offset, cmp_ext32b_r_offset): Delete.
792 (cmp_ext64l_r_offset, cmp_ext64b_r_offset): Delete.
793 (ext32l_r_offset, ext32b_r_offset, ext64l_r_offset, ext64b_r_offset):
794 New functions.
795 (elf_link_adjust_relocs): Use an insertion sort to sort relocs.
796
797 2015-08-26 Matthew Fortune <matthew.fortune@imgtec.com>
798
799 PR ld/18401
800 * elfxx-mips.c (bfd_mips_isa_ext_mach): New function: Converts an
801 ISA value to a bfd machine number.
802 (bfd_mips_isa_ext): Update the ISA level and revision if
803 necessary. Use mips_mach_extends_p to decide if the ISA extension
804 needs to be set.
805 (_bfd_mips_elf_merge_private_bfd_data): Allow the ISA extension to
806 be inferred from the ABI setting. Set the ISA level from the
807 maximum of the incoming and outgoing ISA levels.
808
809 2015-08-25 Nick Clifton <nickc@redhat.com>
810
811 PR binutils/18854
812 * elf.c (bfd_section_from_shdr): Replace assertions with warnings
813 about multiple symbol tables.
814
815 2015-08-25 Renlin Li <renlin.li@arm.com>
816
817 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of
818 ILP64.
819 * bfd-in2.h: Regenerate.
820
821 2015-08-22 Alan Modra <amodra@gmail.com>
822
823 * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename.
824 Don't copy fields not set by _bfd_elf_swap_verdef_in.
825
826 2015-08-19 Jiong Wang <jiong.wang@arm.com>
827
828 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
829 types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
830 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
831 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
832 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
833 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
834 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
835 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
836 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
837 (elfNN_aarch64_final_link_relocate): Likewise.
838 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
839 (_bfd_aarch64_elf_resolve_relocation): Likewise.
840
841 2015-08-19 Jiong Wang <jiong.wang@arm.com>
842
843 * reloc.c (BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
844 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
845 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
846 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
847 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
848 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC.
849 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
850 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC): New entries.
851 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
852 * bfd-in2.h: Regenerate.
853 * libbfd.h: Regenerate.
854
855 2015-08-19 Jiong Wang <jiong.wang@arm.com>
856
857 PR ld/18276
858 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
859 types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
860 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
861 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
862 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
863 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
864 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
865 (elfNN_aarch64_final_link_relocate): Likewise.
866 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
867 (_bfd_aarch64_elf_resolve_relocation): Likewise.
868
869 2015-08-19 Jiong Wang <jiong.wang@arm.com>
870
871 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
872 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
873 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
874 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
875 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
876 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2): New entries.
877 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
878 * bfd-in2.h: Regenerate.
879 * libbfd.h: Regenerate.
880
881 2015-08-19 Jiong Wang <jiong.wang@arm.com>
882
883 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
884 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
885 (aarch64_reloc_got_type): Likewise.
886 (elfNN_aarch64_final_link_relocate): Likewise.
887 (elfNN_aarch64_relocate_section): Likewise.
888 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
889 (_bfd_aarch64_elf_resolve_relocation): Likewise.
890
891 2015-08-19 Jiong Wang <jiong.wang@arm.com>
892
893 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
894 * bfd-in2.h: Regenerate.
895 * libbfd.h: Regenerate.
896 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
897 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
898
899 2015-08-19 Alan Modra <amodra@gmail.com>
900
901 * elf-s390-common.c: Simplify expressions using
902 bfd_linke_executable, bfd_link_pie and bfd_link_pic.
903 * elf32-arm.c: Likewise.
904 * elf32-bfin.c: Likewise.
905 * elf32-frv.c: Likewise.
906 * elf32-m68k.c: Likewise.
907 * elf32-nios2.c: Likewise.
908 * elf32-ppc.c: Likewise.
909 * elf32-s390.c: Likewise.
910 * elf32-sh.c: Likewise.
911 * elf64-alpha.c: Likewise.
912 * elf64-ppc.c: Likewise.
913 * elf64-s390.c: Likewise.
914 * elflink.c: Likewise.
915
916 2015-08-18 Jiong Wang <jiong.wang@arm.com>
917
918 * elfnn-aarch64.c (aarch64_reloc_got_type): Delete useless check.
919 (elfNN_aarch64_relocate_section): Likewise.
920 (elfNN_aarch64_gc_sweep_hook): Likewise.
921 (elfNN_aarch64_check_relocs): Likewise.
922
923 2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
924
925 PR ld/18841
926 * elf-bfd.h (elf_link_hash_table): Add dynsym.
927 * elf32-i386.c (elf_i386_reloc_type_class): Return
928 reloc_class_ifunc for relocation against STT_GNU_IFUNC symbol.
929 * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
930 * elflink.c (_bfd_elf_link_create_dynamic_sections): Set dynsym.
931 (bfd_elf_size_dynsym_hash_dynstr): Use dynsym.
932 (elf_final_link_info): Remove dynsym_sec.
933 (elf_link_output_extsym): Replace dynsym_sec with dynsym.
934 (bfd_elf_final_link): Remove reference to dynsym_sec. Replace
935 dynsym_sec with dynsym.
936
937 2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
938
939 * bfd/aoutx.h: Replace shared, executable, relocatable and pie
940 fields with bfd_link_executable, bfd_link_dll,
941 bfd_link_relocatable, bfd_link_pic and bfd_link_pie.
942 * bfd/bout.c: Likewise.
943 * bfd/coff-alpha.c: Likewise.
944 * bfd/coff-arm.c: Likewise.
945 * bfd/coff-i386.c: Likewise.
946 * bfd/coff-i960.c: Likewise.
947 * bfd/coff-m68k.c: Likewise.
948 * bfd/coff-mcore.c: Likewise.
949 * bfd/coff-mips.c: Likewise.
950 * bfd/coff-ppc.c: Likewise.
951 * bfd/coff-rs6000.c: Likewise.
952 * bfd/coff-sh.c: Likewise.
953 * bfd/coff-tic80.c: Likewise.
954 * bfd/coff-x86_64.c: Likewise.
955 * bfd/coff64-rs6000.c: Likewise.
956 * bfd/coffgen.c: Likewise.
957 * bfd/cofflink.c: Likewise.
958 * bfd/ecoff.c: Likewise.
959 * bfd/ecofflink.c: Likewise.
960 * bfd/elf-bfd.h: Likewise.
961 * bfd/elf-eh-frame.c: Likewise.
962 * bfd/elf-ifunc.c: Likewise.
963 * bfd/elf-m10200.c: Likewise.
964 * bfd/elf-m10300.c: Likewise.
965 * bfd/elf-s390-common.c: Likewise.
966 * bfd/elf-vxworks.c: Likewise.
967 * bfd/elf.c: Likewise.
968 * bfd/elf32-arm.c: Likewise.
969 * bfd/elf32-avr.c: Likewise.
970 * bfd/elf32-bfin.c: Likewise.
971 * bfd/elf32-cr16.c: Likewise.
972 * bfd/elf32-cr16c.c: Likewise.
973 * bfd/elf32-cris.c: Likewise.
974 * bfd/elf32-crx.c: Likewise.
975 * bfd/elf32-d10v.c: Likewise.
976 * bfd/elf32-dlx.c: Likewise.
977 * bfd/elf32-epiphany.c: Likewise.
978 * bfd/elf32-fr30.c: Likewise.
979 * bfd/elf32-frv.c: Likewise.
980 * bfd/elf32-ft32.c: Likewise.
981 * bfd/elf32-h8300.c: Likewise.
982 * bfd/elf32-hppa.c: Likewise.
983 * bfd/elf32-i370.c: Likewise.
984 * bfd/elf32-i386.c: Likewise.
985 * bfd/elf32-i860.c: Likewise.
986 * bfd/elf32-ip2k.c: Likewise.
987 * bfd/elf32-iq2000.c: Likewise.
988 * bfd/elf32-lm32.c: Likewise.
989 * bfd/elf32-m32c.c: Likewise.
990 * bfd/elf32-m32r.c: Likewise.
991 * bfd/elf32-m68hc11.c: Likewise.
992 * bfd/elf32-m68hc1x.c: Likewise.
993 * bfd/elf32-m68k.c: Likewise.
994 * bfd/elf32-mcore.c: Likewise.
995 * bfd/elf32-mep.c: Likewise.
996 * bfd/elf32-metag.c: Likewise.
997 * bfd/elf32-microblaze.c: Likewise.
998 * bfd/elf32-moxie.c: Likewise.
999 * bfd/elf32-msp430.c: Likewise.
1000 * bfd/elf32-mt.c: Likewise.
1001 * bfd/elf32-nds32.c: Likewise.
1002 * bfd/elf32-nios2.c: Likewise.
1003 * bfd/elf32-or1k.c: Likewise.
1004 * bfd/elf32-ppc.c: Likewise.
1005 * bfd/elf32-rl78.c: Likewise.
1006 * bfd/elf32-rx.c: Likewise.
1007 * bfd/elf32-s390.c: Likewise.
1008 * bfd/elf32-score.c: Likewise.
1009 * bfd/elf32-score7.c: Likewise.
1010 * bfd/elf32-sh-symbian.c: Likewise.
1011 * bfd/elf32-sh.c: Likewise.
1012 * bfd/elf32-sh64.c: Likewise.
1013 * bfd/elf32-spu.c: Likewise.
1014 * bfd/elf32-tic6x.c: Likewise.
1015 * bfd/elf32-tilepro.c: Likewise.
1016 * bfd/elf32-v850.c: Likewise.
1017 * bfd/elf32-vax.c: Likewise.
1018 * bfd/elf32-visium.c: Likewise.
1019 * bfd/elf32-xc16x.c: Likewise.
1020 * bfd/elf32-xstormy16.c: Likewise.
1021 * bfd/elf32-xtensa.c: Likewise.
1022 * bfd/elf64-alpha.c: Likewise.
1023 * bfd/elf64-hppa.c: Likewise.
1024 * bfd/elf64-ia64-vms.c: Likewise.
1025 * bfd/elf64-mmix.c: Likewise.
1026 * bfd/elf64-ppc.c: Likewise.
1027 * bfd/elf64-s390.c: Likewise.
1028 * bfd/elf64-sh64.c: Likewise.
1029 * bfd/elf64-x86-64.c: Likewise.
1030 * bfd/elflink.c: Likewise.
1031 * bfd/elfnn-aarch64.c: Likewise.
1032 * bfd/elfnn-ia64.c: Likewise.
1033 * bfd/elfxx-mips.c: Likewise.
1034 * bfd/elfxx-sparc.c: Likewise.
1035 * bfd/elfxx-tilegx.c: Likewise.
1036 * bfd/i386linux.c: Likewise.
1037 * bfd/linker.c: Likewise.
1038 * bfd/m68klinux.c: Likewise.
1039 * bfd/pdp11.c: Likewise.
1040 * bfd/pe-mips.c: Likewise.
1041 * bfd/peXXigen.c: Likewise.
1042 * bfd/reloc.c: Likewise.
1043 * bfd/reloc16.c: Likewise.
1044 * bfd/sparclinux.c: Likewise.
1045 * bfd/sunos.c: Likewise.
1046 * bfd/vms-alpha.c: Likewise.
1047 * bfd/xcofflink.c: Likewise.
1048
1049 2015-08-18 Alan Modra <amodra@gmail.com>
1050
1051 PR 18667
1052 * Makefile.am: Use $(SED) in place of sed throughout.
1053 * Makefile.in: Regenerate.
1054
1055 2015-08-18 Alan Modra <amodra@gmail.com>
1056
1057 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't redefine .TOC.
1058 if already defined, and set linker_def.
1059 (ppc64_elf_set_toc): Use .TOC. value if defined other than by
1060 the backend.
1061
1062 2015-08-14 Alan Modra <amodra@gmail.com>
1063
1064 PR ld/18759
1065 * elf32-or1k.c: Revert 2015-08-11 change.
1066
1067 2015-08-13 H.J. Lu <hongjiu.lu@intel.com>
1068
1069 PR ld/18801
1070 * elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error
1071 for read-only segment with dynamic IFUNC relocations.
1072 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
1073
1074 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
1075
1076 * elfxx-mips.c (STUB_MOVE): Change to use 'or' only.
1077 (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry,
1078 mips_n64_exec_plt0_entry, micromips_insn32_o32_exec_plt0_entry):
1079 Update to use 'or' instead of 'addu/daddu'.
1080 (_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE.
1081 (move_insns_32): Reorder table.
1082
1083 2015-08-11 H.J. Lu <hongjiu.lu@intel.com>
1084
1085 * elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
1086 relocations in debug sections.
1087 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1088
1089 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1090
1091 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
1092 message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
1093
1094 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1095
1096 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
1097 (aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
1098
1099 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1100
1101 * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
1102 Loose the check for symbol from ABS section.
1103 (elfNN_aarch64_size_stubs): Pass sym_sec.
1104
1105 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1106
1107 PR ld/18668
1108 * elfnn-aarch64.c (aarch64_type_of_stub): Update destination for
1109 calls go through plt stub.
1110 (elfNN_aarch64_final_link_relocate): Adjust code logic for CALL26,
1111 JUMP26 relocation to support inserting veneer for call to plt stub.
1112
1113 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1114
1115 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1116 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
1117 (aarch64_reloc_got_type): Likewise.
1118 (elfNN_aarch64_final_link_relocate): Likewise.
1119 (elfNN_aarch64_relocate_section): Likewise.
1120 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1121 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1122
1123 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1124
1125 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry.
1126 * bfd-in2.h: Regenerate.
1127 * libbfd.h: Regenerate.
1128 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1129 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
1130
1131 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1132
1133 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1134 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
1135 (aarch64_reloc_got_type): Likewise.
1136 (elfNN_aarch64_final_link_relocate): Likewise.
1137 (elfNN_aarch64_relocate_section): Likewise.
1138 (elfNN_aarch64_gc_sweep_hook): Likewise.
1139 (elfNN_aarch64_check_relocs): Likewise.
1140 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1141 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1142
1143 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1144
1145 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry.
1146 * bfd-in2.h: Regenerate.
1147 * libbfd.h: Regenerate.
1148 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1149 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
1150
1151 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1152
1153 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1154 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
1155 (aarch64_reloc_got_type): Likewise.
1156 (elfNN_aarch64_final_link_relocate): Likewise.
1157 (elfNN_aarch64_relocate_section): Likewise.
1158 (elfNN_aarch64_gc_sweep_hook): Likewise.
1159 (elfNN_aarch64_check_relocs): Likewise.
1160 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1161 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1162
1163 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1164
1165 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry.
1166 * bfd-in2.h: Regenerate.
1167 * libbfd.h: Regenerate.
1168 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1169 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
1170
1171 2015-08-11 H.J. Lu <hongjiu.lu@intel.com>
1172
1173 PR ld/18808
1174 * elf32-i386.c (elf_i386_relocate_section): Skip IFUNC
1175 relocations in debug sections.
1176 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1177
1178 2015-08-11 Peter Zotov <whitequark@whitequark.org>
1179
1180 PR ld/18759
1181 * elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
1182 (R_OR1K_16_PCREL): Likewise.
1183 (R_OR1K_8_PCREL): Likewise.
1184
1185 2015-08-11 Nick Clifton <nickc@redhat.com>
1186
1187 PR binutils/18747
1188 * coff-sh.c (_bfd_sh_align_load_span): Fix typo when setting
1189 opcode count.
1190
1191 PR binutils/18758
1192 * elf.c (_bfd_elf_setup_sections): Add checks for corrupt section
1193 group information.
1194 * peicode.h (pe_ILF_make_a_section): Ensure alignment of the
1195 used_by_bfd pointer.
1196 (pe_ILF_build_a_bfd): Ensure alignment of vars.data pointer.
1197
1198 2015-08-11 H.J. Lu <hongjiu.lu@intel.com>
1199
1200 * elf.c (_bfd_elf_copy_private_bfd_data): Fix a typo.
1201
1202 2015-08-10 H.J. Lu <hongjiu.lu@intel.com>
1203
1204 * elf-bfd.h (elf_symbol_version): New enum.
1205 (elf_link_hash_entry): Replace hidden with versioned.
1206 * elflink.c (_bfd_elf_merge_symbol): Don't look for symbol
1207 version if the symbol is unversioned. Initialize versioned.
1208 (_bfd_elf_add_default_symbol): Don't look for symbol version
1209 if the symbol is unversioned or hidden. Initialize versioned.
1210 (elf_collect_hash_codes): Don't look for symbol version if the
1211 symbol is unversioned.
1212 (elf_collect_gnu_hash_codes): Likewise.
1213 (bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
1214 (_bfd_elf_link_hash_copy_indirect): Check versioned instead of
1215 hidden.
1216 (elf_link_output_extsym): Likewise.
1217
1218 2015-08-07 H.J. Lu <hongjiu.lu@intel.com>
1219
1220 PR binutils/18785
1221 * elf.c (_bfd_elf_copy_private_bfd_data): When copying the
1222 sh_link and sh_info fields in stripped section headers, we also
1223 check if the sh_type, sh_flags, sh_addralign and sh_entsize
1224 fields of the output section match the output. Since
1225 --only-keep-debug turns all non-debug sections into SHT_NOBITS
1226 sections, the output SHT_NOBITS type matches any input type.
1227
1228 2015-08-07 H.J. Lu <hongjiu.lu@intel.com>
1229
1230 PR ld/18720
1231 * elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate
1232 if the new symbol matches the existing one. The new hidden
1233 versioned symbol matches the existing symbol if they have the
1234 same symbol version. Update the existing symbol only if they
1235 match.
1236 (_bfd_elf_add_default_symbol): Update call to
1237 _bfd_elf_merge_symbol.
1238 (_bfd_elf_link_assign_sym_version): Don't set the hidden field
1239 here.
1240 (elf_link_add_object_symbols): Override a definition only if the
1241 new symbol matches the existing one.
1242 (_bfd_elf_link_hash_copy_indirect): Don't copy any references to
1243 the hidden versioned symbol.
1244 (elf_link_output_extsym): Bind a symbol locally when linking
1245 executable if it is locally defined, hidden versioned, not
1246 referenced by shared library and not exported. Turn on
1247 VERSYM_HIDDEN only if the hidden versioned symbol is defined
1248 locally.
1249
1250 2015-08-05 Nick Clifton <nickc@redhat.com>
1251
1252 * elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
1253 sh_info fields of sections whose type has been changed to
1254 SHT_NOBITS.
1255
1256 2015-08-04 Yuriy M. Kaminskiy" <yumkam@gmail.com>
1257 Tyler Hicks <tyhicks@canonical.com>
1258
1259 PR binutils/18750
1260 * ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
1261 and stack overflow when char is signed and \200-\376 was in place of hex
1262 digit; also fixes \377 was handled as EOF instead of "incorrect character".
1263 (ihex_read_section): Changed for consistency.
1264 (ihex_bad_byte): Prevent (now impossible to trigger) stack
1265 overflow and incorrect escape sequence handling.
1266 * srec.c (srec_bad_byte): Likewise.
1267
1268 2015-08-03 Hans-Peter Nilsson <hp@axis.com>
1269
1270 * elf32-cris.c (cris_elf_relocate_section)
1271 (elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
1272 (elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
1273 just link_info->symbolic, to check if a symbol should be bound
1274 symbolically.
1275
1276 2015-07-30 H.J. Lu <hongjiu.lu@intel.com>
1277
1278 PR ld/18735
1279 * elflink.c (_bfd_elf_add_default_symbol): Add the default
1280 symbol if not performing a relocatable link.
1281 (elf_link_add_object_symbols): Adjust the default symbol if
1282 not performing a relocatable link.
1283
1284 2015-07-29 H.J. Lu <hongjiu.lu@intel.com>
1285
1286 * elflink.c (elf_link_add_object_symbols): Remove
1287 !info->relocatable check for info->executable. Add
1288 !info->relocatable check for !info->executable.
1289 (elf_link_output_extsym): Remove
1290 !info->relocatable check for info->executable.
1291
1292 2015-07-29 Hans-Peter Nilsson <hp@bitrange.com>
1293
1294 * mmo.c (mmo_write_symbols_and_terminator): Skip symbol-type
1295 assignment loop for bfd plugin objects.
1296
1297 2015-07-28 Alan Modra <amodra@gmail.com>
1298
1299 * elf.c (_bfd_elf_map_sections_to_segments): Do not make a new
1300 segment for loaded sections after nonloaded sections if the
1301 sections are on the same page.
1302
1303 2015-07-28 Iain Buclaw <ibuclaw@gdcproject.org>
1304
1305 * configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
1306 * config.in, configure: Regenerate.
1307
1308 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
1309
1310 * configure: Regenerated.
1311
1312 2015-07-27 Nick Clifton <nickc@redhat.com>
1313
1314 * elf32-msp430.c (uses_large_model): New function.
1315 (msp430_elf_eh_frame_address_size): New function.
1316 (elf_backend_eh_frame_address_size): Define.
1317
1318 2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
1319
1320 PR ld/18705
1321 * elfnn-aarch64.c (elf_backend_extern_protected_data): Define.
1322
1323 2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
1324
1325 PR ld/18705
1326 * elf32-arm.c (elf_backend_extern_protected_data): Define.
1327
1328 2015-07-25 H.J. Lu <hongjiu.lu@intel.com>
1329
1330 PR ld/18718
1331 * elflink.c (elf_link_output_extsym): Check symbol version
1332 section check only if not linking executable, the symbol is
1333 referenced by shared library or not locally defined.
1334
1335 2015-07-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1336
1337 * elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to
1338 check if a symbol should be bound symbolically.
1339 * elf32-hppa.c (elf32_hppa_check_relocs,
1340 elf32_hppa_adjust_dynamic_symbol, elf32_hppa_relocate_section,
1341 elf32_hppa_finish_dynamic_symbol): Likewise.
1342 * elf32-m68k.c (elf_m68k_check_relocs,
1343 elf_m68k_relocate_section): Likewise.
1344 * elf32-nios2.c (nios2_elf32_relocate_section,
1345 nios2_elf32_check_relocs, allocate_dynrelocs): Likewise.
1346 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol,
1347 elf32_tic6x_relocate_section): Likewise.
1348
1349 2015-07-24 Alan Modra <amodra@gmail.com>
1350
1351 * elf.c (_bfd_elf_assign_file_positions_for_non_load): Use .rela
1352 prefix for reloc section corresponding to rela section associated
1353 with renamed debug section.
1354
1355 2015-07-24 Alan Modra <amodra@gmail.com>
1356
1357 * section.c (bfd_get_section_by_name_if): Iterate over entire hash
1358 chain.
1359
1360 2015-07-23 Joseph Myers <joseph@codesourcery.com>
1361
1362 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
1363 <DT_MIPS_RLD_MAP_REL>: Add target address to host address
1364 difference, not to host pointer.
1365
1366 2015-07-22 Alan Modra <amodra@gmail.com>
1367
1368 * elf64-ppc.c (opd_entry_value): Remove assertion. Instead,
1369 return -1 if symbol referenced is not defined. Tidy.
1370
1371 2015-07-20 Alan Modra <amodra@gmail.com>
1372
1373 * po/SRC-POTFILES.in: Regenerate.
1374
1375 2015-07-17 Jiong Wang <jiong.wang@arm.com>
1376
1377 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Sort alphabetically.
1378 (IS_AARCH64_TLSDESC_RELOC): Sort alphabetically.
1379
1380 2015-07-16 Jiong Wang <jiong.wang@arm.com>
1381
1382 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1383 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1384 (aarch64_reloc_got_type): Ditto.
1385 (elfNN_aarch64_final_link_relocate): Ditto.
1386 (elfNN_aarch64_relocate_section): Ditto.
1387 (elfNN_aarch64_gc_sweep_hook): Ditto.
1388 (elfNN_aarch64_check_relocs): Ditto.
1389 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1390 (_bfd_aarch64_elf_resolve_relocation): Ditto.
1391
1392 2015-07-16 Jiong Wang <jiong.wang@arm.com>
1393
1394 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PREL21): New entry.
1395 * bfd-in2.h: Regenerate.
1396 * libbfd.h: Regenerate.
1397 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1398 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1399
1400 2015-07-10 H.J. Lu <hongjiu.lu@intel.com>
1401
1402 PR binutils/18656
1403 * bfd.c (bfd_convert_section_size): New function.
1404 (bfd_convert_section_contents): Likewise.
1405 * bfd-in2.h: Regenerated.
1406
1407 2015-07-09 Catherine Moore <clm@codesourcery.com>
1408
1409 * elflink.c (bfd_elf_size_dynamic_sections): Call to
1410 _bfd_elf_maybe_strip_eh_frame_hdr should be before
1411 bed->elf_backend_size_dynamic_sections.
1412
1413 2015-07-08 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
1414
1415 * elf32-avr.c: Add 32 bit PC relative relocation for AVR target.
1416
1417 2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
1418
1419 * elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value
1420 plus addend rather than the original st_value when looking up
1421 entries in opd->adjust.
1422
1423 2015-07-03 Kai Tietz <ktietz@redhat.com>
1424 Nick Clifton <nickc@redhat.com>
1425
1426 PR ld/11539
1427 * coffcode.h (coff_bfd_gc_sections): Define default
1428 to bfd_coff_gc_sections function.
1429 (coff_gc_mark_hook_fn): New type.
1430 * coffgen.c (init_reloc_cookie): Copy and adjust coff
1431 related code about gc-sections from elflink.c to here.
1432 (fini_reloc_cookie): Likewise.
1433 (init_reloc_cookie_rels): Likewise.
1434 (fini_reloc_cookie_rels): Likewise.
1435 (init_reloc_cookie_for_section): Likewise.
1436 (fini_reloc_cookie_for_section): Likewise.
1437 (_bfd_coff_gc_mark_hook): Likewise.
1438 (_bfd_coff_gc_mark_rsec): Likewise.
1439 (_bfd_coff_gc_mark_reloc): Likewise.
1440 (_bfd_coff_gc_mark): Likewise.
1441 (_bfd_coff_gc_mark_extra_sections): Likewise.
1442 (coff_gc_sweep_symbol_info): Likewise.
1443 (coff_gc_sweep_symbol): Likewise.
1444 (gc_sweep_hook_fn): Likewise.
1445 (coff_gc_sweep): Likewise.
1446 (bfd_coff_gc_sections): Likewise.
1447 (_bfd_coff_gc_keep): Likewise.
1448 * libcoff-in.h (coff_reloc_cookie): New struct.
1449 (bfd_coff_gc_sections): New prototype.
1450 * libcoff.h: Regenerate.
1451
1452 2015-07-01 Sandra Loosemore <sandra@codesourcery.com>
1453 Cesar Philippidis <cesar@codesourcery.com>
1454
1455 * bfd-in2.h: Regenerated.
1456 * elf32-nios2.c (elf_nios2_howto_table_rel): Rename to...
1457 (elf_nios2_r1_howto_table_rel): This.
1458 (elf_nios2_r2_howto_table_rel): New.
1459 (BFD_IS_R2): New.
1460 (lookup_howto): Add ABFD parameter. Adjust to look up in either
1461 the R1 or R2 relocation table, as determined by ABFD.
1462 (nios2_reloc_map): Add R2 relocations.
1463 (nios2_elf32_bfd_reloc_type_lookup): Do lookup using lookup_howto.
1464 Pass it the ABFD parameter.
1465 (nios2_elf32_bfd_reloc_name_lookup): Use ABFD to decide whether to
1466 return an R1 or R2 relocation.
1467 (nios2_elf32_info_to_howto): Do lookup using lookup_howto.
1468 Pass it the ABFD parameter.
1469 (nios2_elf32_do_call26_relocate): Check for alignment on a 4-byte
1470 boundary.
1471 (nios2_elf32_relocate_section): Adjust call to lookup_howto.
1472 * libbfd.h: Regenerated.
1473 * reloc.c (BFD_RELOC_NIOS2_R2_S12): New.
1474 (BFD_RELOC_NIOS2_R2_I10_1_PCREL): New.
1475 (BFD_RELOC_NIOS2_R2_T1I7_1_PCREL): New.
1476 (BFD_RELOC_NIOS2_R2_T1I7_2): New.
1477 (BFD_RELOC_NIOS2_R2_T2I4): New.
1478 (BFD_RELOC_NIOS2_R2_T2I4_1): New.
1479 (BFD_RELOC_NIOS2_R2_T2I4_2): New.
1480 (BFD_RELOC_NIOS2_R2_X1I7_2): New.
1481 (BFD_RELOC_NIOS2_R2_X2L5): New.
1482 (BFD_RELOC_NIOS2_R2_F1I5_2): New.
1483 (BFD_RELOC_NIOS2_R2_L5I4X1): New.
1484 (BFD_RELOC_NIOS2_R2_T1X1I6): New.
1485 (BFD_RELOC_NIOS2_R2_T1X1I6_2): New.
1486
1487 2015-07-01 Sandra Loosemore <sandra@codesourcery.com>
1488 Cesar Philippidis <cesar@codesourcery.com>
1489
1490 * archures.c (bfd_mach_nios2r1, bfd_mach_nios2r2): New.
1491 * bfd-in2.h: Regenerated.
1492 * cpu-nios2.c (nios2_compatible): New.
1493 (N): Use nios2_compatible instead of bfd_default_compatible.
1494 (NIOS2R1_NEXT, NIOS2R2_NEXT): Define.
1495 (arch_info_struct): New.
1496 (bfd_nios2_arch): Chain to NIOS2R1_NEXT.
1497 * elf32-nios2.c (is_nios2_elf): New.
1498 (nios2_elf32_merge_private_bfd_data): New.
1499 (nios2_elf32_object_p): New.
1500 (bfd_elf32_bfd_merge_private_bfd_data): Define.
1501 (elf_backend_object_p): Define.
1502
1503 2015-07-01 H.J. Lu <hongjiu.lu@intel.com>
1504
1505 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Refactor.
1506
1507 2015-06-30 Nick Clifton <nickc@redhat.com>
1508
1509 PR binutils/18570
1510 * elf-attrs.c (obj_attr_size): Use an unsigned int type for the tag.
1511 (write_obj_attribute): Likewise.
1512 (elf_new_obj_attr): Likewise.
1513 (bfd_elf_get_obj_attr_int): Likewise.
1514 (bfd_elf_add_obj_attr_int): Likewise.
1515 (bfd_elf_add_obj_attr_string): Likewise.
1516 (bfd_elf_add_obj_attr_int_string): Likewise.
1517 (gnu_obj_attrs_arg_type): Likewise.
1518 (_bfd_elf_obj_attrs_arg_type): Likewise.
1519 (_bfd_elf_parse_attributes): Likewise.
1520 (_bfd_elf_merge_unknown_attribute_list): Likewise.
1521 * elf-bfd.h (struct obj_attribute_list): Likewise.
1522 Update prototypes.
1523
1524 2015-06-28 H.J. Lu <hongjiu.lu@intel.com>
1525
1526 * bfd-in.h (compressed_debug_section_type): Remove
1527 COMPRESS_DEBUG_ZLIB.
1528 * bfd-in2.h : Regenerated.
1529
1530 2015-06-26 Matthew Fortune <matthew.fortune@imgtec.com>
1531
1532 * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable
1533 instead of !shared to indicate an application vs shared library.
1534 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1535 (_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL.
1536 (_bfd_mips_elf_get_target_dtag): Likewise.
1537
1538 2015-06-25 DJ Delorie <dj@redhat.com>
1539
1540 * elf32-msp430.c (msp430_final_link_relocate): Fix comments. Fix
1541 REL loads to match RELA stores.
1542
1543 2015-06-25 H.J. Lu <hongjiu.lu@intel.com>
1544
1545 * elf.c (_bfd_elf_compute_section_file_positions): Don't
1546 initialize sh_size for .shstrtab here.
1547
1548 2015-06-25 H.J. Lu <hongjiu.lu@intel.com>
1549
1550 PR gas/18451
1551 * elf-bfd.h (elf_sym_strtab): New.
1552 (elf_link_hash_table): Add strtabcount, strtabsize and
1553 strtab.
1554 (_bfd_elf_stringtab_init): Removed.
1555 * elf.c (_bfd_elf_stringtab_init): Removed.
1556 (_bfd_elf_compute_section_file_positions): Replace
1557 bfd_strtab_hash/_bfd_elf_stringtab_init/_bfd_stringtab_free/
1558 _bfd_stringtab_size with
1559 elf_strtab_hash/_bfd_elf_strtab_init/_bfd_elf_strtab_free/
1560 _bfd_elf_strtab_size. Use _bfd_elf_strtab_add,
1561 _bfd_elf_strtab_finalize and _bfd_elf_strtab_offset to get
1562 st_name.
1563 (swap_out_syms): Likewise.
1564 * elflink.c (elf_final_link_info): Replace bfd_strtab_hash
1565 with elf_strtab_hash. Remove symbuf, symbuf_count,
1566 symbuf_size and shndxbuf_size.
1567 (elf_link_flush_output_syms): Removed.
1568 (elf_link_output_sym): Renamed to ...
1569 (elf_link_output_symstrtab): This. Replace _bfd_stringtab_add
1570 with _bfd_elf_strtab_add. Don't flush symbols to the file nor
1571 swap out symbols.
1572 (elf_link_swap_symbols_out): New.
1573 (elf_link_output_extsym): Replace elf_link_output_sym with
1574 elf_link_output_symstrtab.
1575 (elf_link_input_bfd): Likewise.
1576 (elf_final_link_free): Replace _bfd_stringtab_free with
1577 _bfd_elf_strtab_free. Remove symbuf.
1578 (bfd_elf_final_link): Replace _bfd_elf_stringtab_init with
1579 _bfd_elf_strtab_init. Don't set symbuf, symbuf_count,
1580 symbuf_size nor shndxbuf_size. Initialize strtabsize and
1581 strtab. Initialize symshndxbuf to -1 when number of sections
1582 >= 64K. Replace elf_link_output_sym/elf_link_output_sym with
1583 elf_link_output_symstrtab/elf_link_output_symstrtab. Don't
1584 call elf_link_flush_output_syms. Call _bfd_elf_strtab_finalize
1585 and elf_link_swap_symbols_out. Replace _bfd_stringtab_size
1586 and _bfd_stringtab_emit with _bfd_elf_strtab_size and
1587 _bfd_elf_strtab_emit.
1588
1589 2015-06-24 H.J. Lu <hongjiu.lu@intel.com>
1590
1591 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Silence older
1592 GCC warning.
1593
1594 2015-06-24 H.J. Lu <hongjiu.lu@intel.com>
1595
1596 * elf32-i386.c (elf_i386_allocate_dynrelocs): Always allocate
1597 space for the first .plt entry.
1598 (elf_i386_size_dynamic_sections): Always add DT_PLTGOT for .plt
1599 section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1600 there are PLT relocations.
1601 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Always
1602 allocate space for the first .plt entry.
1603 (elf_x86_64_size_dynamic_sections): Always add DT_PLTGOT for
1604 .plt section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1605 there are PLT relocations.
1606
1607 2015-06-24 H.J. Lu <hongjiu.lu@intel.com>
1608
1609 PR ld/18591
1610 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert
1611 R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation
1612 overflow.
1613
1614 2015-06-23 Jiong Wang <jiong.wang@arm.com>
1615
1616 * elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function.
1617 (elfNN_aarch64_size_dynamic_sections): Traverse hash table to check
1618 relocations against read-only sections.
1619
1620 2015-06-18 Nick Clifton <nickc@redhat.com>
1621
1622 PR 18481
1623 * elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.
1624
1625 2015-06-15 Jon Turney <jon.turney@dronecode.org.uk>
1626
1627 * bfd.c: Change struct bfd_build_id to use bfd_size_type.
1628 * bfd-in2.h : Regenerate.
1629
1630 2015-06-16 Alan Modra <amodra@gmail.com>
1631
1632 * elf32-ppc.c (ppc_elf_relocate_section): Correct binary search of
1633 dynamic relocs.
1634
1635 2015-06-10 Jon Turney <jon.turney@dronecode.org.uk>
1636
1637 * elf-bfd.h : Remove struct elf_build_id.
1638 * bfd.c : Add struct bfd_build_id.
1639 * bfd-in2.h: Regenerate.
1640 * elf.c (elfobj_grok_gnu_build_id): Update to use bfd_build_id.
1641 * libpei.h: Add protoype and macros for
1642 bfd_XXi_slurp_codeview_record.
1643 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Make public
1644 * peicode.h (pe_bfd_read_buildid): Add.
1645 (pe_bfd_object_p): Use pe_bfd_read_buildid().
1646
1647 2015-06-15 Renlin Li <renlin.li@arm.com>
1648
1649 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry.
1650 * bfd-in2.h: Regenerate.
1651 * libbfd.h: Regenerate.
1652 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1653 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15.
1654
1655 2015-06-15 Alan Modra <amodra@gmail.com>
1656
1657 * cofflink.c (_bfd_coff_generic_relocate_section): Revert
1658 2014-03-26 change. Call _bfd_clear_contents for relocs against
1659 local and global symbols defined in discarded input sections.
1660
1661 2015-06-05 Nick Clifton <nickc@redhat.com>
1662
1663 * elf32-msp430.c (rl78_sym_diff_handler): New function.
1664 (msp430_howto_table): Use the new function for the SYM_DIFF reloc.
1665 (msp430x_howto_table): Likewise.
1666
1667 2015-06-05 Alan Modra <amodra@gmail.com>
1668
1669 * elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
1670 relocs with insns moved by --ppc476-workaround. Correct
1671 output of REL16 relocs.
1672
1673 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1674
1675 * elfnn-aarch64.c (aarch64_reloc_got_type): Support
1676 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1677 (elfNN_aarch64_final_link_relocate): Ditto.
1678 (elfNN_aarch64_gc_swap_hook): Ditto.
1679 (elfNN_aarch64_check_relocs): Ditto.
1680 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1681
1682 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1683
1684 * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
1685 * bfd-in2.h: Regenerate.
1686 * libbfd.h: Regenerate.
1687 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1688 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1689
1690 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1691
1692 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
1693 complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1694 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
1695 PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1696
1697 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1698
1699 * elfnn-aarch64.c (aarch64_reloc_got_type): Support
1700 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
1701 (elfNN_aarch64_final_link_relocate): Ditto.
1702 (elfNN_aarch64_gc_swap_hook): Ditto.
1703 (elfNN_aarch64_check_relocs): Ditto.
1704 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1705
1706 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1707
1708 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
1709 * bfd-in2.h: Regenerate.
1710 * libbfd.h: Regenerate.
1711 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1712 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
1713
1714 2015-05-28 Catherine Moore <clm@codesourcery.com>
1715 Bernd Schmidt <bernds@codesourcery.com>
1716 Paul Brook <paul@codesourcery.com>
1717
1718 bfd/
1719 * bfd-in2.h: Regenerated.
1720 * elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
1721 (COMPACT_EH_CANT_UNWIND_OPCODE): Define.
1722 (dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
1723 eh_frame_hdr_info.
1724 (compact_eh_frame_hdr_info): Declare.
1725 (eh_frame_hdr_info): Redeclare with union for dwarf-specific
1726 fields and compact-eh fields.
1727 (elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
1728 (bfd_elf_section_data): Add eh_frame_entry_field.
1729 (elf_section_eh_frame_entry): Define.
1730 (bfd_elf_parse_eh_frame_entries): Declare.
1731 (_bfd_elf_parse_eh_frame_entry): Declare.
1732 (_bfd_elf_end_eh_frame_parsing): Declare.
1733 (_bfd_elf_write_section_eh_frame_entry): Declare.
1734 (_bfd_elf_eh_frame_entry_present): Declare.
1735 (_bfd_elf_section_for_symbol): Declare.
1736 * elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
1737 (bfd_elf_record_eh_frame_entry): New function.
1738 (_bfd_elf_parse_eh_frame_entry): New function.
1739 (_bfd_elf_parse_eh_frame): Update hdr_info field references.
1740 (cmp_eh_frame_hdr): New function.
1741 (add_eh_frame_hdr_terminator): New function.
1742 (_bfd_elf_end_eh_frame_parsing): New function.
1743 (find_merged_cie): Update hdr_info field references.
1744 (_bfd_elf_discard_section_eh_frame): Likewise.
1745 (_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
1746 (_bfd_elf_eh_frame_entry_present): New function.
1747 (_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
1748 (_bfd_elf_write_section_eh_frame_entry): New function.
1749 (_bfd_elf_write_section_eh_frame): Update hdr_info field references.
1750 (_bfd_elf_fixup_eh_frame_hdr): New function.
1751 (write_compact_eh_frame_hdr): New function.
1752 (write_dwarf_eh_frame_hdr): New function.
1753 (_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
1754 * elflink.c (_bfd_elf_section_for_symbol): New function.
1755 (elf_section_ignore_discarded_relocs): Add Compact EH support.
1756 (elf_link_input_bfd): Likewise.
1757 (bfd_elf_final_link): Likewise.
1758 (_bfd_elf_gc_mark): Likewise.
1759 (bfd_elf_parse_eh_frame_entries): New function.
1760 (bfd_elf_gc_sections): Add Compact EH support.
1761 (bfd_elf_discard_info): Likewise.
1762 * elfxx-mips.c: Include dwarf2.h.
1763 (_bfd_mips_elf_compact_eh_encoding): New function.
1764 (_bfd_mips_elf_cant_unwind_opcode): New function.
1765 * elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
1766 (_bfd_mips_elf_cant_unwind_opcode): Declare.
1767 (elf_backend_compact_eh_encoding): Define.
1768 (elf_backend_cant_unwind_opcode): Define.
1769 * elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
1770 (elf_backend_cant_unwind_opcode): Provide default.
1771 (elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
1772 elf_backend_cant_unwind_opcode.
1773 * section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.
1774
1775 2015-05-27 H.J. Lu <hongjiu.lu@intel.com>
1776
1777 PR binutils/18458
1778 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
1779 for now binding only if pointer equality isn't needed.
1780 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
1781 binding only if pointer equality isn't needed.
1782 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
1783 section for now binding only if pointer equality isn't needed.
1784 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
1785 binding only if pointer equality isn't needed.
1786
1787 2015-05-26 H.J. Lu <hongjiu.lu@intel.com>
1788
1789 PR binutils/18437
1790 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
1791 in .rel.plt/.rela.plt.
1792 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
1793
1794 2015-05-19 Jiong Wang <jiong.wang@arm.com>
1795
1796 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
1797 relocation case labels alphabetically.
1798 (elfNN_aarch64_final_link_relocate): Ditto.
1799 (elfNN_aarch64_tls_relax): Ditto.
1800 (elfNN_aarch64_relocate_section): Ditto.
1801 (elfNN_aarch64_gc_sweep_hook): Ditto.
1802 (elfNN_aarch64_check_relocs): Ditto.
1803 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1804 (_bfd_aarch64_elf_resolve_relocation): Ditto.
1805
1806 2015-05-18 Jiong Wang <jiong.wang@arm.com>
1807
1808 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite
1809 comments.
1810
1811 2015-05-16 H.J. Lu <hongjiu.lu@intel.com>
1812
1813 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
1814 for now binding.
1815 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
1816 binding.
1817 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
1818 section for now binding.
1819 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
1820 binding.
1821
1822 2015-05-14 H.J. Lu <hongjiu.lu@intel.com>
1823
1824 * bfd.c (bfd_update_compression_header): Also write the zlib
1825 header if the SHF_COMPRESSED bit cleared..
1826 (bfd_check_compression_header): Return the uncompressed size.
1827 * compress.c (decompress_contents): Don't skip the zlib header.
1828 (bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
1829 which doesn't have the zlib header.
1830 (bfd_init_section_decompress_status): Likewise.
1831 (bfd_get_full_section_contents): Updated.
1832 (bfd_is_section_compressed): Likewise.
1833 (bfd_is_section_compressed_with_header): Return the uncompressed
1834 size.
1835 * elf.c (_bfd_elf_make_section_from_shdr): Updated.
1836 * bfd-in2.h: Regenerated.
1837
1838 2015-05-14 Jiong Wang <jiong.wang@arm.com>
1839
1840 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow
1841 check restrictions.
1842
1843 2015-05-14 Max Filippov <jcmvbkbc@gmail.com>
1844
1845 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
1846 as GOT reference when plt.refcount is not positive.
1847
1848 2015-05-12 H.J. Lu <hongjiu.lu@intel.com>
1849
1850 * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
1851 for the first .plt entry only if needed.
1852 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1853
1854 2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
1855
1856 * Makefile.am (ALL_MACHINES): Add cpu-iamcu.lo.
1857 (ALL_MACHINES_CFILES): Likewise.
1858 * archures.c (bfd_mach_iamcu): New.
1859 (bfd_mach_i386_iamcu): Likewise.
1860 (bfd_mach_i386_iamcu_intel_syntax): Likewise.
1861 (bfd_iamcu_arch): Likewise.
1862 (bfd_archures_list): Add &bfd_iamcu_arch.
1863 * config.bfd (targ_selvecs): Add iamcu_elf32_vec to
1864 i386_elf32_vec.
1865 (targ_archs): Add bfd_iamcu_arch if needed.
1866 * configure.ac: Support iamcu_elf32_vec.
1867 * cpu-iamcu.c: New file.
1868 * elf32-i386.c (elf32_iamcu_elf_object_p): New function.
1869 Add support for iamcu_elf32_vec and elf32_iamcu_bed.
1870 * targets.c (iamcu_elf32_vec): New.
1871 (_bfd_target_vector): Add iamcu_elf32_vec.
1872 * Makefile.in: Regenerated.
1873 * bfd-in2.h: Likewise.
1874 * configure: Likewise.
1875
1876 2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
1877
1878 * elfcode.h (elf_object_p): Replace EM_486 with EM_IAMCU.
1879
1880 2015-05-10 H.J. Lu <hongjiu.lu@intel.com>
1881
1882 * elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
1883 and output_bfd with abfd.
1884 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
1885
1886 2015-05-06 Toni Spets <toni.spets@iki.fi>
1887
1888 PR ld/18372
1889 * peXXigen.c (rsrc_process_section): Skip discarded resource
1890 sections.
1891
1892 2015-05-01 H.J. Lu <hongjiu.lu@intel.com>
1893
1894 * config.bfd: Support i[3-7]86-*-elf*.
1895
1896 2015-04-30 H.J. Lu <hongjiu.lu@intel.com>
1897
1898 * elf32-i386.c (elf_backend_post_process_headers): Undef for
1899 Solaris 2.
1900
1901 2015-04-30 Nick Clifton <nickc@redhat.com>
1902
1903 PR 18317
1904 * elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
1905 mep_reloc.
1906 (mep_reloc): Delete unused function.
1907
1908 2015-04-29 Nick Clifton <nickc@redhat.com>
1909
1910 PR 17099
1911 * coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
1912 relocs.
1913
1914 2015-04-27 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1915
1916 * elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
1917 * elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
1918 elf_s390_merge_obj_attributes.
1919 * elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.
1920
1921 2015-04-24 Jiong Wang <jiong.wang@arm.com>
1922
1923 PR ld/18270
1924 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
1925 GOT_NORMAL for both sgot/srelgot section.
1926 (elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
1927 and generate necessary runtime relocation for GOT entry.
1928
1929 2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
1930
1931 PR binutils/18209
1932 * archive.c (_bfd_get_elt_at_filepos): Copy is_linker_input.
1933
1934 2015-04-24 Jiong Wang <jiong.wang@arm.com>
1935
1936 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
1937 PC-relative relocation for external symbol.
1938
1939 2015-04-24 Nick Clifton <nickc@redhat.com>
1940
1941 PR 18313
1942 * compress.c (decompress_contents): Zero initialse the z_stream
1943 structure.
1944
1945 2015-04-24 Nick Clifton <nickc@redhat.com>
1946
1947 * elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
1948 local labels to include local labels with a numeric suffix and
1949 fake symbols.
1950
1951 2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
1952
1953 PR binutils/18316
1954 * section.c (SEC_MEP_VLIW): New.
1955 * bfd-in2.h: Regenerated.
1956
1957 2015-04-23 H.J. Lu <hongjiu.lu@intel.com>
1958
1959 PR ld/18277
1960 * compress.c (bfd_compress_section_contents): Remove the
1961 write_compress argument.
1962 (bfd_init_section_compress_status): Updated.
1963 (bfd_compress_section): Likewise.
1964 * elf.c (_bfd_elf_set_reloc_sh_name): New.
1965 (_bfd_elf_init_reloc_shdr): Add delay_st_name_p. Set sh_name
1966 to (unsigned int) -1 if delay_st_name_p is TRUE. Use
1967 _bfd_elf_set_reloc_sh_name.
1968 (elf_fake_sections): Don't rename DWARF debug section for
1969 linker output if it will be compressed. Instead, set
1970 delay_st_name_p to TRUE and pass it to _bfd_elf_init_reloc_shdr.
1971 (assign_section_numbers): Call _bfd_elf_strtab_addref only if
1972 sh_name != (unsigned int) -1. Don't finalize nor assign
1973 shstrtab section here. Delay setting output section names to
1974 _bfd_elf_write_object_contents.
1975 (_bfd_elf_compute_section_file_positions): Update comments on
1976 sh_offset for shstrtab section.
1977 (assign_file_positions_for_non_load_sections): Set sh_offset to
1978 -1 for shstrtab section.
1979 (assign_file_positions_except_relocs): Likewise.
1980 (_bfd_elf_assign_file_positions_for_non_load): Set up sh_name
1981 when compressing DWARF debug sections. Place shstrtab section
1982 after DWARF debug sections have been compressed.
1983 (_bfd_elf_write_object_contents): Setting sh_name for output
1984 sections.
1985
1986 2015-04-23 H.J. Lu <hongjiu.lu@intel.com>
1987
1988 PR binutils/18209
1989 * bfd.c (bfd): Add is_linker_input.
1990 * elf.c (convert_debug_to_zdebug): New.
1991 (convert_zdebug_to_debug): Likewise.
1992 (_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
1993 .zdebug_* here. Use convert_zdebug_to_debug. Set SEC_ELF_RENAME.
1994 (_bfd_elf_init_reloc_shdr): Pass a pointer to section name
1995 instead of a pointer to section.
1996 (elf_fake_sections): Rename the section name if SEC_ELF_RENAME
1997 is set.
1998 * section.c (SEC_ELF_RENAME): New.
1999 * bfd-in2.h: Regenerated.
2000
2001 2015-04-23 Alan Modra <amodra@gmail.com>
2002
2003 * elf64-ppc.c (TOC_BASE_ALIGN): Define.
2004 (ppc64_elf_next_toc_section): Align multi-got toc base.
2005 (ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol.
2006
2007 2015-04-22 H.J. Lu <hongjiu.lu@intel.com>
2008
2009 PR ld/18289
2010 * elf32-i386.c (elf_i386_link_hash_entry): Add gotoff_ref.
2011 (elf_i386_link_hash_newfunc): Initialize gotoff_ref to 0.
2012 (elf_i386_create_dynamic_sections): Always allow copy relocs for
2013 building executables.
2014 (elf_i386_copy_indirect_symbol): Also copy gotoff_ref.
2015 (elf_i386_check_relocs): Set gotoff_ref for R_386_GOTOFF.
2016 (elf_i386_adjust_dynamic_symbol): Also allocate copy relocs for
2017 PIE and R_386_GOTOFF.
2018 (elf_i386_relocate_section): Allow R_386_GOTOFF in executable.
2019
2020 2015-04-20 H.J. Lu <hongjiu.lu@intel.com>
2021
2022 * elf.c (assign_section_numbers): Always set up sh_name.
2023
2024 2015-04-20 H.J. Lu <hongjiu.lu@intel.com>
2025
2026 * elf.c (assign_file_positions_for_non_load_sections): Iterate
2027 sections by pointer.
2028 (_bfd_elf_assign_file_positions_for_non_load): Likewise.
2029
2030 2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
2031
2032 * bfd-in.h (compressed_debug_section_type): New.
2033 * compress.c (bfd_compress_section_contents): Add an argument
2034 for linker write compression and always generate .zdebug_*
2035 section when linking.
2036 (bfd_init_section_compress_status): Pass FALSE to
2037 bfd_compress_section_contents.
2038 (bfd_compress_section): New function.
2039 * elf.c (elf_fake_sections): For linking, set SEC_ELF_COMPRESS
2040 on DWARF debug sections if COMPRESS_DEBUG is set and rename
2041 section if COMPRESS_DEBUG_GABI_ZLIB isn't set.
2042 (assign_file_positions_for_non_load_sections): Set sh_offset
2043 to -1 if SEC_ELF_COMPRESS is set.
2044 (assign_file_positions_except_relocs): Likwise.
2045 (_bfd_elf_assign_file_positions_for_relocs): Renamed to ...
2046 (_bfd_elf_assign_file_positions_for_non_load): This. Change
2047 return time to bfd_boolean. Compress the section if
2048 SEC_ELF_COMPRESS is set.
2049 (_bfd_elf_write_object_contents): Updated.
2050 (_bfd_elf_set_section_contents): Write section contents to
2051 the buffer if SEC_ELF_COMPRESS is set.
2052 * merge.c: Include "elf-bfd.h".
2053 (sec_merge_emit): Add arguments for contents and offset. Write
2054 to contents with offset if contents isn't NULL.
2055 (_bfd_write_merged_section): Write section contents to the
2056 buffer if SEC_ELF_COMPRESS is set. Pass contents and
2057 output_offset to sec_merge_emit.
2058 * elflink.c (bfd_elf_final_link): Allocate the buffer for
2059 output section contents if SEC_ELF_COMPRESS is set.
2060 * section.c (SEC_ELF_COMPRESS): New.
2061 * bfd-in2.h: Regenerated.
2062
2063 2015-04-15 Alan Modra <amodra@gmail.com>
2064
2065 * elf32-rl78.c (rl78_elf_relocate_section): Typo fix.
2066
2067 2015-04-14 Nick Clifton <nickc@redhat.com>
2068
2069 * elf32-rl78.c (RL78_OP_REL): New macro.
2070 (rl78_elf_howto_table): Use it for complex relocs.
2071 (get_symbol_value): Handle the cases when the info or status
2072 arguments are NULL.
2073 (get_romstart): Cache the status returned by get_symbol_value.
2074 (get_ramstart): Likewise.
2075 (RL78_STACK_PUSH): Generate an error message if the stack
2076 overflows.
2077 (RL78_STACK_POP): Likewise for underflows.
2078 (rl78_compute_complex_reloc): New function. Contains the basic
2079 processing code for all RL78 complex relocs.
2080 (rl78_special_reloc): New function. Provides special reloc
2081 handling for complex relocs.
2082 (rl78_elf_relocate_section): Use rl78_compute_complex_reloc.
2083 (rl78_offset_for_reloc): Likewise.
2084
2085 2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
2086
2087 PR ld/pr17709
2088 * elflink.c (_bfd_elf_adjust_dynamic_copy): Check
2089 info->extern_protected_data when warning copy relocs against
2090 protected symbols.
2091 (_bfd_elf_symbol_refs_local_p): Check info->extern_protected_data
2092 when checking protected non-function symbols.
2093
2094 2015-04-13 John Baldwin <jhb@FreeBSD.org>
2095
2096 * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on
2097 FreeBSD.
2098 (elfcore_write_xstatereg): Use correct note name on FreeBSD.
2099
2100 2015-04-13 H.J. Lu <hongjiu.lu@intel.com>
2101
2102 PR ld/18250
2103 * elflink.c (elf_link_is_defined_archive_symbol): Return FALSE
2104 if the object has been claimed by plugin.
2105
2106 2015-04-11 H.J. Lu <hongjiu.lu@intel.com>
2107
2108 * elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
2109 with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
2110 protected data symbol when building shared library.
2111 * elf64-x86-64.c (elf_x86_64_relocate_section): Check
2112 R_X86_64_GOTOFF64 against undefined symbol and replace
2113 SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL when checking
2114 R_X86_64_GOTOFF64 against protected data symbol when building
2115 shared library.
2116
2117 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
2118
2119 PR ld/pr17709
2120 * elf32-i386.c (elf_i386_relocate_section): Also check R_386_GOTOFF
2121 against protected data symbol when building shared library.
2122 * elf64-x86-64.c (elf_x86_64_relocate_section): Also check
2123 R_X86_64_GOTOFF64 against protected data symbol when building
2124 shared library.
2125
2126 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
2127
2128 PR ld/pr15228
2129 PR ld/pr17709
2130 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
2131 * elf32-i386.c (elf_backend_extern_protected_data): New.
2132 Defined to 1.
2133 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2134 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
2135 copy relocs against protected symbols if extern_protected_data
2136 is true.
2137 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
2138 non-function symbols if extern_protected_data is true.
2139 * elfxx-target.h (elf_backend_extern_protected_data): New.
2140 Default to 0.
2141 (elfNN_bed): Initialize extern_protected_data with
2142 elf_backend_extern_protected_data.
2143
2144 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
2145
2146 * compress.c (bfd_compress_section_contents): Replace bfd_malloc
2147 and free with bfd_alloc and bfd_release on compressed buffer.
2148 Release buffer if compressed section isn't smaller.
2149
2150 2015-04-10 Alan Modra <amodra@gmail.com>
2151
2152 PR ld/18222
2153 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error
2154 on adding a protected visibility variable to .dynbss.
2155
2156 2015-04-10 Alan Modra <amodra@gmail.com>
2157
2158 Revert 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
2159 PR ld/pr15228
2160 PR ld/pr17709
2161 * elf-bfd.h (elf_backend_data): Delete extern_protected_data.
2162 * elf32-i386.c (elf_backend_extern_protected_data): Delete.
2163 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2164 * elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
2165 extern_protected_data test.
2166 (_bfd_elf_symbol_refs_local_p): Likewise.
2167 * elfxx-target.h (elf_backend_extern_protected_data): Delete.
2168 (elfNN_bed): Delete elf_backend_extern_protected_data init.
2169
2170 2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
2171
2172 * compress.c (bfd_compress_section_contents): Update comments.
2173 (bfd_init_section_decompress_status): Likewise.
2174 (bfd_init_section_compress_status): Likewise.
2175
2176 2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
2177
2178 * elfxx-target.h (TARGET_BIG_SYM): Add BFD_COMPRESS_GABI to
2179 object_flags.
2180 (TARGET_LITTLE_SYM): Likewise.
2181
2182 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2183
2184 * elf32-xtensa.c (splay-tree.h): include header.
2185 (text_action_struct): drop next pointer.
2186 (text_action_list_struct): drop head pointer, add count and
2187 tree fields.
2188 (find_fill_action): instead of linear search in text_action_list
2189 search in the tree.
2190 (text_action_compare, action_first, action_next): new functions.
2191 (text_action_add, text_action_add_literal): instead of linear
2192 search and insertion insert new node into the tree.
2193 (removed_by_actions): pass additional parameter: action_list,
2194 use it to traverse the tree.
2195 (offset_with_removed_text): pass additional action_list parameter
2196 to removed_by_actions.
2197 (map_action_fn_context): new typedef.
2198 (map_action_fn_context_struct): new structure.
2199 (map_action_fn): new function.
2200 (map_removal_by_action): use splay_tree_foreach to build map.
2201 (find_insn_action): replace linear search in text_action_list
2202 with series of splay_tree_lookups.
2203 (print_action, print_action_list_fn): new functions.
2204 (print_action_list): use splay_tree_foreach.
2205 (init_xtensa_relax_info): drop action_list.head initialization.
2206 Initialize the tree.
2207 (compute_text_actions): use non-zero action_list_count instead of
2208 non-NULL action list.
2209 (xlate_map_context): new typedef.
2210 (xlate_map_context_struct): new structure.
2211 (xlate_map_fn): new function.
2212 (build_xlate_map): use splay_tree_foreach to build map.
2213 (action_remove_bytes_fn): new function.
2214 (relax_section): use zero action_list_count instead of NULL
2215 action list. Use splay_tree_foreach to count final section size.
2216 Drop unused variable 'removed'.
2217
2218 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2219
2220 * elf32-xtensa.c (removed_literal_map_entry): new typedef.
2221 (removed_literal_map_entry_struct): new structure.
2222 (removed_literal_list_struct): add new fields: n_map and map.
2223 (map_removed_literal, removed_literal_compare): new functions.
2224 (find_removed_literal): build index array for literals ordered
2225 by VMA, use binary search to find removed literal.
2226
2227 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2228
2229 * elf32-xtensa.c (removal_by_action_entry_struct,
2230 removal_by_action_map_struct): new structures.
2231 (removal_by_action_entry, removal_by_action_map): new typedefs.
2232 (text_action_list_struct): add new field: map.
2233 (map_removal_by_action, removed_by_actions_map,
2234 offset_with_removed_text_map): new functions.
2235 (relax_section): replace offset_with_removed_text with
2236 offset_with_removed_text_map.
2237 (translate_reloc, relax_property_section, relax_section_symbols):
2238 replace removed_by_actions with removed_by_actions_map.
2239
2240 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2241
2242 * elf32-xtensa.c (reloc_range_list, reloc_range_list_entry,
2243 reloc_range): new typedef.
2244 (reloc_range_list_struct, reloc_range_list_entry_struct,
2245 reloc_range_struct): new structures.
2246 (reloc_range_compare, build_reloc_ranges,
2247 reloc_range_list_append, reloc_range_list_remove,
2248 reloc_range_list_update_range, free_reloc_range_list): new
2249 functions.
2250 (compute_text_actions): precompute relocation opcodes before the
2251 loop. Add relevant_relocs variable, initialize it before the
2252 loop, pass it to the check_section_ebb_pcrels_fit.
2253 (check_section_ebb_pcrels_fit): add new parameter:
2254 relevant_relocs. Update address range in the relevant_relocs if
2255 it's non-NULL and iterate only over relevant relocations.
2256
2257 2015-04-09 Nick Clifton <nickc@redhat.com>
2258
2259 * elf32-rx.c (describe_flags): Report the settings of the string
2260 insn using bits.
2261 (rx_elf_merge_private_bfd_data): Handle merging of the string insn
2262 using bits.
2263
2264 2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
2265
2266 * compress.c (bfd_compress_section_contents): Work around a GCC
2267 uninitialized warning bug fixed in GCC 4.7.
2268
2269 2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
2270
2271 * archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
2272 bit.
2273 * bfd.c (bfd::flags): Increase size to 18 bits.
2274 (BFD_COMPRESS_GABI): New.
2275 (BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
2276 (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
2277 (bfd_update_compression_header): New fuction.
2278 (bfd_check_compression_header): Likewise.
2279 (bfd_get_compression_header_size): Likewise.
2280 (bfd_is_section_compressed_with_header): Likewise.
2281 * compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
2282 (bfd_compress_section_contents): Return the uncompressed size if
2283 the full section contents is compressed successfully. Support
2284 converting from/to .zdebug* sections.
2285 (bfd_get_full_section_contents): Call
2286 bfd_get_compression_header_size to get compression header size.
2287 (bfd_is_section_compressed): Renamed to ...
2288 (bfd_is_section_compressed_with_header): This. Add a pointer
2289 argument to return compression header size.
2290 (bfd_is_section_compressed): Use it.
2291 (bfd_init_section_decompress_status): Call
2292 bfd_get_compression_header_size to get compression header size.
2293 Return FALSE if uncompressed section size is 0.
2294 * elf.c (_bfd_elf_make_section_from_shdr): Support converting
2295 from/to .zdebug* sections.
2296 * bfd-in2.h: Regenerated.
2297
2298 2015-04-07 Alan Modra <amodra@gmail.com>
2299
2300 * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
2301 mapped to output .got section.
2302
2303 2015-04-07 Alan Modra <amodra@gmail.com>
2304
2305 * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
2306 and has_addr16_lo. Make has_sda_refs a bitfield.
2307 (ppc_elf_check_relocs): Set new flags.
2308 (ppc_elf_link_hash_table_create): Update default_params.
2309 (ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
2310 where we won't be making .dynbss entries or editing code. Set
2311 params->pic_fixup when we'll edit code for protected var access.
2312 (allocate_dynrelocs): Allocate got entry for edited code and
2313 discard dyn_relocs.
2314 (struct ppc_elf_relax_info): Add picfixup_size.
2315 (ppc_elf_relax_section): Rename struct one_fixup to struct
2316 one_branch_fixup. Rename fixups to branch_fixups. Size space for
2317 pic fixups.
2318 (ppc_elf_relocate_section): Edit non-PIC accessing protected
2319 visibility variables to PIC. Don't emit dyn_relocs for code
2320 we've edited.
2321 * elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
2322
2323 2015-04-07 Nick Clifton <nickc@redhat.com>
2324
2325 * elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
2326 local labels as local.
2327
2328 2015-04-06 H.J. Lu <hongjiu.lu@intel.com>
2329
2330 * compress.c (get_uncompressed_size): Removed.
2331 (bfd_compress_section_contents): Use bfd_putb64 to write
2332 uncompressed section size.
2333 (bfd_init_section_decompress_status): Replace
2334 get_uncompressed_size with bfd_getb64.
2335
2336 2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
2337
2338 * elf.c (_bfd_elf_init_private_section_data): Also preserve the
2339 SHF_COMPRESSED bit if not decompress.
2340
2341 2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
2342
2343 * compress.c (get_uncompressed_size): New. Extracted from ...
2344 (bfd_init_section_decompress_status): This. Use it.
2345
2346 2015-04-02 Andrew Turner <andrew@freebsd.org>
2347
2348 * config.bfd: Add aarch64-*-freebsd* target triple.
2349
2350 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
2351
2352 * configure: Regenerated.
2353
2354 2015-04-01 Tejas Belagod <tejas.belagod@arm.com>
2355 Marcus Shawcroft <marcus.shawcroft@arm.com>
2356 Jiong Wang <jiong.wang@arm.com>
2357
2358 * bfd-in.h (bfd_elf64_aarch64_set_options)
2359 (bfd_elf32_aarch64_set_options): Add parameter.
2360 * bfd-in2.h: Regenerated.
2361 * elfnn-aarch64.c (aarch64_erratum_843419_stub)
2362 (_bfd_aarch64_adrp_p, _bfd_aarch64_erratum_843419_sequence_p)
2363 (_bfd_aarch64_erratum_843419_stub_name)
2364 (_bfd_aarch64_erratum_843419_fixup)
2365 (_bfd_aarch64_erratum_843419_scan)
2366 (_bfd_aarch64_erratum_843419_branch_to_stub)
2367 (_bfd_aarch64_erratum_843419_p): Define.
2368 (enum elf_aarch64_stub_type): Define
2369 aarch64_stub_erratum_843419_veneer.
2370 (struct elf_aarch64_stub_hash_entry): Define adrp_offset.
2371 (struct elf_aarch64_link_hash_table): Define fix_erratum_843419
2372 and fix_erratum_843419_adr.
2373 (stub_hash_newfunc): Initialize adrp_offset;
2374 (_bfd_aarch64_add_stub_entry_after): Define.
2375 (aarch64_map_one_stub, aarch64_build_one_stub)
2376 (aarch64_size_one_stub): Handle
2377 aarch64_stub_erratum_843419_veneer.
2378 (_bfd_aarch64_resize_stubs): Round stub section size.
2379 (elfNN_aarch64_size_stubs): Add scan for 843419.
2380 (bfd_elfNN_aarch64_set_options): Add parameter. Initialize
2381 fix_erratum_843419 and fix_erratum_843419_adr.
2382 (struct erratum_835769_branch_to_stub_data): Add info.
2383 (elfNN_aarch64_write_section): Initialise info. Handle 843419.
2384 (elfNN_aarch64_size_dynamic_sections): Handle 843419.
2385 * elfxx-aarch64.c (_bfd_aarch64_decode_adrp_imm)
2386 (_bfd_aarch64_sign_extend): Define.
2387 (reencode_adr_imm): Remove static. Rename to:
2388 (_bfd_aarch64_reencode_adr_imm): Define.
2389 (_bfd_aarch64_elf_put_addend): Call _bfd_aarch64_reencode_adr_imm.
2390 * elfxx-aarch64.h (AARCH64_ADR_OP, AARCH64_ADRP_OP)
2391 (AARCH64_ADRP_OP_MASK, _bfd_aarch64_sign_extend)
2392 (_bfd_aarch64_decode_adrp_imm, _bfd_aarch64_reencode_adr_imm):
2393 Define.
2394
2395 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
2396
2397 * configure: Regenerated.
2398
2399 2015-03-31 Ed Schouten <ed@nuxi.nl>
2400
2401 * config.bfd (targ_defvec): Set to x86_64_elf64_cloudabi_vec
2402 for x86_64-*-cloudabi*.
2403 * configure.ac: Handle x86_64_elf64_cloudabi_vec.
2404 * configure: Regenerated.
2405 * elf64-x86-64.c (TARGET_LITTLE_SYM): Support x86_64-*-cloudabi*.
2406 (TARGET_LITTLE_NAME): Likewise.
2407 (ELF_OSABI): Likewise.
2408 (elf64_bed): Likewise.
2409 * targets.c (x86_64_elf64_cloudabi_vec): New.
2410 (_bfd_target_vector): Add x86_64_elf64_cloudabi_vec.
2411
2412 2015-03-31 H.J. Lu <hongjiu.lu@intel.com>
2413
2414 * configure.ac: Revert the AM_ZLIB change.
2415 * Makefile.in: Regenerated.
2416 * aclocal.m4: Likewise.
2417 * configure: Likewise.
2418 * doc/Makefile.in: Likewise.
2419
2420 2015-03-30 H.J. Lu <hongjiu.lu@intel.com>
2421
2422 PR ld/18169
2423 * elf-bfd.h (elf_backend_data): Add get_reloc_section.
2424 (_bfd_elf_get_reloc_section): New.
2425 * elf.c (_bfd_elf_get_reloc_section): Likewise.
2426 (assign_section_numbers): Call get_reloc_section to look up the
2427 section the relocs apply.
2428 * elfxx-target.h (elf_backend_get_reloc_section): Likewise.
2429 (elfNN_bed): Initialize get_reloc_section with
2430 elf_backend_get_reloc_section.
2431
2432 2015-03-29 H.J. Lu <hongjiu.lu@intel.com>
2433
2434 * Makefile.am (ZLIB): New.
2435 (ZLIBINC): Likewise.
2436 (AM_CFLAGS): Add $(ZLIBINC).
2437 (libbfd_la_LIBADD): Add $(ZLIB).
2438 * compress.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
2439 (decompress_contents): Don't check HAVE_ZLIB_H.
2440 (bfd_compress_section_contents): Likewise.
2441 (bfd_get_full_section_contents): Likewise.
2442 (bfd_init_section_decompress_status): Likewise.
2443 (bfd_init_section_compress_status): Likewise.
2444 * configure.ac (AM_ZLIB): Removed.
2445 (zlibdir): New. AC_SUBST.
2446 (zlibinc): Likewise.
2447 Add --with-system-zlib.
2448 * Makefile.in: Regenerated.
2449 * acinclude.m4: Likewise.
2450 * config.in: Likewise.
2451 * configure: Likewise.
2452 * doc/Makefile.in: Likewise.
2453
2454 2015-03-27 Alan Modra <amodra@gmail.com>
2455
2456 PR ld/15228
2457 PR ld/18167
2458 * elflink.c (elf_merge_st_other): Add "sec" parameter. Don't set
2459 protected_def when symbol section is read-only. Adjust all calls.
2460 * elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
2461
2462 2015-03-26 Tejas Belagod <tejas.belagod@arm.com>
2463
2464 * elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic
2465 _bfd_final_link_relocate with aarch64_relocate.
2466
2467 2015-03-26 H.J. Lu <hongjiu.lu@intel.com>
2468
2469 PR ld/18160
2470 * elflink.c (elf_gc_sweep): Skip if relocation is incompatible.
2471 (bfd_elf_gc_sections): Likewise.
2472
2473 2015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
2474
2475 * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Adjust stub section
2476 size for initial branch.
2477 (elfNN_aarch64_build_stubs): Write initial branch.
2478 _bfd_aarch64_decode_(elfNN_aarch64_output_arch_local_syms): Write
2479 mapping symbol on initial branch.
2480
2481 2015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
2482
2483 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan):
2484 Update erratum count.
2485
2486 2015-03-25 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2487
2488 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on
2489 first matching debug section.
2490
2491 2015-03-24 H.J. Lu <hongjiu.lu@intel.com>
2492
2493 PR gas/18087
2494 * compress.c (bfd_compress_section_contents): Don't write the
2495 zlib header and set contents as well as compress_status if
2496 compression didn't make the section smaller.
2497 (bfd_init_section_compress_status): Don't check compression
2498 size here.
2499
2500 2015-03-24 Nick Clifton <nickc@redhat.com>
2501
2502 PR binutils/17512
2503 * coffgen.c (coff_get_normalized_symtab): Fix test for out of
2504 range auxillary sections.
2505
2506 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2507
2508 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor
2509 code into:
2510 (_bfd_aarch64_get_stub_for_link_section): Define.
2511
2512 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2513
2514 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
2515 update of section_group[].stub_sec.
2516
2517 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2518
2519 * elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove.
2520 (erratum_835769_scan) Drop fix_table_size_p and fixes_p arguments.
2521 Delete fixes, fix_table_size and associated code. Call
2522 _bfd_aarch64_add_stub_entry_in_group. Rename to...
2523 (bfd_aarch64_erratum_835769_scan): Define.
2524 (elfNN_aarch64_size_stubs): Delete erratum_835769_fixes,
2525 erratum_835769_fix_table_size, i and associated code. Relocate
2526 call to _bfd_aarch64_erratum_835769_scan. Delete adhoc stub size
2527 correction. Delete construction of stub entry from
2528 erratum_835769_fixes array.
2529
2530 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2531
2532 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Use
2533 _bfd_aarch64_add_stub_entry_in_group.
2534
2535 2015-03-24 Alan Modra <amodra@gmail.com>
2536
2537 * elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
2538 stubs, even those for undefined weak symbols. Otherwise, don't
2539 report relocation overflow on branches to undefined strong
2540 symbols. Fix memory leak.
2541 * elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
2542 overflow on branches to undefined strong symbols.
2543
2544 2015-03-23 Keith Seitz <keiths@redhat.com>
2545
2546 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
2547 missing ';'.
2548
2549 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2550
2551 * elfnn-aarch64.c (erratum_835769_scan): Factor stub name
2552 construction into...
2553 (_bfd_aarch64_erratum_835769_stub_name): Define.
2554
2555 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2556
2557 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Factor out
2558 stub resize code into...
2559 (bfd_aarch64_resize_stubs): Define.
2560
2561 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2562
2563 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor stub
2564 creation code into...
2565 (bfd_aarch64_create_stub_section): Define.
2566
2567 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2568
2569 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Rename
2570 from elf_aarch64_create_or_find_stub_sec.
2571 (_bfd_aarch64_add_stub_entry_in_group): Rename from
2572 elfNN_aarch64_add_stub. Call
2573 _bfd_aarch64_create_or_find_stub_sec.
2574 (elfNN_aarch64_size_stubs, elfNN_aarch64_size_stubs): Call
2575 _bfd_aarch64_add_stub_entry_in_group.
2576
2577 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2578
2579 * elfnn-aarch64.c (erratum_835769_scan) Add comment. Reverse
2580 sense of boolean return.
2581 (elfNN_aarch64_size_stubs): Adjust for above.
2582
2583 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2584
2585 * elfnn-aarch64.c (elf_aarch64_create_or_find_stub_sec):
2586 Remove unused parameter.
2587 (elfNN_aarch64_size_stubs): Adjust for above.
2588
2589 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2590
2591 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Remove bfd_indx.
2592
2593 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2594
2595 * elfnn-aarch64.c (aarch64_erratum_835769_fixes)
2596 (num_aarch64_erratum_835769_fixes): Remove.
2597 (elfNN_aarch64_size_stubs): Remove assignments to above.
2598
2599 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2600
2601 * elfnn-aarch64.c (aarch64_mem_op_p): Update comment. Rename rtn
2602 to rt2.
2603 (aarch64_erratum_seqeunce): Rename rtn to rt2.
2604
2605 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2606
2607 * elfnn-aarch64.c (elfNN_aarch64_write_section): Adjust layout.
2608
2609 2015-03-19 Nick Clifton <nickc@redhat.com>
2610
2611 * elf32-rl78.c (rl78_cpu_name): New function. Prints the name of
2612 the RL78 core based upon the flags.
2613 (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
2614 flags.
2615 (rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
2616 (elf32_rl78_machine): Always return bfd_mach_rl78.
2617
2618 2015-03-19 Nick Clifton <nickc@redhat.com>
2619
2620 PR 18078
2621 * compress.c (bfd_compress_section_contents): Do not define this
2622 function if it is not used.
2623
2624 2015-03-18 H.J. Lu <hongjiu.lu@intel.com>
2625
2626 * compress.c (bfd_compress_section_contents): Make it static.
2627 * bfd/bfd-in2.h: Regenerated.
2628
2629 2015-03-18 Eric Youngdale <eyoungdale@ptc.com>
2630
2631 PR ld/16598
2632 * peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs
2633 suitable for the AMD64.
2634
2635 2015-03-18 Jon Turney <jon.turney@dronecode.org.uk>
2636 Nick Clifton <nickc@redhat.com>
2637
2638 PR binutils/18087
2639 * coffgen.c (make_a_section_from_file): Only prepend a z to a
2640 debug section's name if the section was actually compressed.
2641 * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
2642 * compress.c (bfd_init_section_compress_status): Do not compress
2643 the section if doing so would make it bigger. In such cases leave
2644 the section alone and return COMPRESS_SECTION_NONE.
2645
2646 2015-03-17 Alan Modra <amodra@gmail.com>
2647
2648 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0
2649 on nothing to do, before malloc of returned symbol array.
2650
2651 2015-03-16 Nick Clifton <nickc@redhat.com>
2652
2653 * elf32-rx.c (elf32_rx_relax_delete_bytes): If the relocs are not
2654 stored in the elf_section_data structure then load them as
2655 necessary.
2656
2657 2015-03-14 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2658
2659 * elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
2660 relocs against code sections.
2661 * elf32-s390.c: Define elf_backend_sort_relocs_p.
2662 * elf64-s390.c: Likewise.
2663
2664 2015-03-11 Alan Modra <amodra@gmail.com>
2665
2666 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
2667 reverse order. Account for larger size of __tls_get_addr_opt stub.
2668
2669 2015-03-10 Yuri Gribov <y.gribov@samsung.arm>
2670
2671 PR ld/16572
2672 * elf32-arm.c (elf32_arm_final_link_relocate): Remove support for
2673 ELF_ARM_HASENTRY.
2674 (elf32_arm_print_private_bfd_data): Likewise.
2675
2676 2015-03-06 Nick Clifton <nickc@redhat.com>
2677
2678 PR binutils/17765
2679 * elflink.c (put_value): Like previous delta, but for the 32-bit
2680 case.
2681
2682 2015-03-05 Nick Clifton <nickc@redhat.com>
2683
2684 PR binutils/17765
2685 * elflink.c (put_value): Avoid using an undefined shift
2686 operation.
2687
2688 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
2689
2690 PR ld/pr15228
2691 PR ld/pr17709
2692 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
2693 * elf32-i386.c (elf_backend_extern_protected_data): New.
2694 Defined to 1.
2695 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2696 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
2697 copy relocs against protected symbols if extern_protected_data
2698 is true.
2699 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
2700 non-function symbols if extern_protected_data is true.
2701 * elfxx-target.h (elf_backend_extern_protected_data): New.
2702 Default to 0.
2703 (elfNN_bed): Initialize extern_protected_data with
2704 elf_backend_extern_protected_data.
2705
2706 2015-03-05 Nick Clifton <nickc@redhat.com>
2707
2708 PR binutils/18025
2709 * coffgen.c (coff_find_nearest_line_with_names): If the dwarf2
2710 lookup fails, check for an address bias in the dwarf info, and if
2711 one exists, retry the lookup with the biased value.
2712 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): New function.
2713 Determines if a bias exists bewteen the addresses of functions
2714 based on DWARF information vs symbol table information.
2715 * libbfd-in.h (_bfd_dwarf2_find_symbol_bias): Prototype.
2716 * libbfd.h: Regenerate.
2717
2718 2015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
2719
2720 * elfxx-aarch64.c (decode_add_imm, decode_movw_imm)
2721 (decode_tst_branch_ofs_14, decode_ld_lit_ofs_19)
2722 (decode_cond_branch_ofs_19, decode_branch_ofs_26): Remove.
2723
2724 2015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
2725
2726 * elfnn-aarch64.c (aarch64_build_one_stub): Call abort.
2727 (aarch64_size_one_stub): Likewise.
2728 (aarch64_map_one_stub): Likewise.
2729
2730 2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
2731
2732 * cpu-s390.c (N): New macro.
2733 (bfd_s390_31_arch): New. Define only if default target word size
2734 is 64 bits. Otherwise define...
2735 (bfd_390_64_arch): ...this. Make static.
2736 (bfd_s390_arch): Define according to the default target word size.
2737 Let the 'next' field point to the alternate arch.
2738
2739 2015-03-04 Richard Sandiford <richard.sandiford@arm.com>
2740
2741 PR gas/17843
2742 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
2743 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
2744 to be used with MOVK rather than MOVZ.
2745
2746 2015-03-03 DJ Delorie <dj@redhat.com>
2747
2748 * elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
2749 there's a symbol.
2750
2751 2015-02-28 Alan Modra <amodra@gmail.com>
2752
2753 * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
2754 not PLT_NEW.
2755
2756 2015-02-27 H.J. Lu <hongjiu.lu@intel.com>
2757
2758 * elf32-i386.c (need_convert_mov_to_lea): New.
2759 (elf_i386_check_relocs): Set need_convert_mov_to_lea if needed.
2760 (elf_i386_convert_mov_to_lea): Return TRUE if
2761 need_convert_mov_to_lea is unset.
2762 * elf64-x86-64.c (need_convert_mov_to_lea): New.
2763 (elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed.
2764 (elf_x86_64_convert_mov_to_lea): Return TRUE if
2765 need_convert_mov_to_lea is unset.
2766
2767 2015-02-27 Nick Clifton <nickc@redhat.com>
2768
2769 PR binutils/17910
2770 * coffgen.c (_bfd_coff_internal_syment_name): Only check for
2771 string length overflow when the string table length is actually
2772 set.
2773
2774 2015-02-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
2775
2776 * bfd/bfd-in2.h: Regenerate.
2777 * bfd/libbfd.h: Regenerate.
2778
2779 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
2780
2781 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix
2782 TLSDESC_LD_PREL19 field width and masks.
2783 (aarch64_tls_transition_without_check)
2784 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
2785 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
2786 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
2787 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19.
2788 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2789 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2790
2791 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
2792
2793 * elfnn-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Reorder R_TYPE
2794 tests.
2795 (aarch64_tls_transition_without_check)
2796 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
2797 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
2798 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
2799 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21.
2800 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2801 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2802 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
2803
2804 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
2805
2806 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC)
2807 (elfNN_aarch64_howto_table, aarch64_tls_transition_without_check)
2808 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
2809 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
2810 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
2811 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21.
2812 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2813 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2814 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
2815
2816 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
2817
2818 * elfnn-aarch64.c: (TLSIE_LD_GOTTREL_PREL19): Fix HOWTO bit field width.
2819 (aarch64_tls_transition_without_check, aarch64_reloc_got_type)
2820 (elfNN_aarch64_final_link_relocate, elfNN_aarch64_tls_relax)
2821 (elfNN_aarch64_relocate_section, elfNN_aarch64_gc_sweep_hook)
2822 (elfNN_aarch64_check_relocs): Handle
2823 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19.
2824
2825 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2826 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2827
2828 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
2829
2830 * elfnn-aarch64.c: (TLSDESC_CALL): Fix HOWTO bit field width.
2831
2832 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
2833
2834 * elfnn-aarch64.c (TLSLE_MOVW_TPREL_G2)
2835 (TLSLE_MOVW_TPREL_G1, TLSLE_MOVW_TPREL_G1_NC)
2836 (TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC): Fix bit field
2837 width.
2838
2839 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
2840
2841 * elfnn-aarch64.c: (TLSIE_MOVW_GOTTPREL_G0_NC): Fix HOWTO bit
2842 field width.
2843
2844 2015-02-26 Nick Clifton <nickc@redhat.com>
2845
2846 PR binutils/17512
2847 * coffcode.h (coff_compute_section_file_positions): Report
2848 negative page sizes.
2849 * elf.c (elf_fake_sections): Handle excessive alignmment powers.
2850 (assign_file_positions_for_non_load_sections): Replace assertion
2851 with an error message.
2852 (rewrite_elf_program_header): Handle excessive segment
2853 alignments.
2854 * mach-o.c (bfd_mach_o_read_section_32): Likewise.
2855 (bfd_mach_o_read_section_64): Likewise.
2856 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Use %B to
2857 print a bfd name, not %A.
2858
2859 2015-02-26 Alan Modra <amodra@gmail.com>
2860
2861 * elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
2862 thread-safe stubs for iplt.
2863 (build_tls_get_addr_stub): Restore r2 immediately after call.
2864
2865 2015-02-26 Terry Guo <terry.guo@arm.com>
2866
2867 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Update how we
2868 merge Tag_ABI_HardFP_use.
2869
2870 2015-02-26 Alan Modra <amodra@gmail.com>
2871
2872 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Heed -z nocopyreloc.
2873 Use text relocs rather than giving an error on trying to use
2874 .dynbss for protected shared lib vars.
2875 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
2876
2877 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
2878
2879 * elf32-avr.c (struct elf_avr_section_data): New structure.
2880 (struct avr_relax_info): New structure.
2881 (elf_avr_new_section_hook): New function.
2882 (struct elf_avr_section_data): Add relax_info.
2883 (get_avr_relax_info): New function.
2884 (init_avr_relax_info): New function.
2885 (elf32_avr_relax_delete_bytes): Find next property record before
2886 deleting bytes. When deleting don't move bytes beyond the next
2887 property record.
2888 (avr_elf32_assign_records_to_section): New function.
2889 (avr_property_record_compare): New function.
2890 (avr_load_all_property_sections): New function.
2891 (elf32_avr_relax_section): Load property data. After relaxing the
2892 section, move any .align directives that have enough deleted bytes
2893 before them.
2894 (bfd_elf32_new_section_hook): Define.
2895
2896 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
2897
2898 * elf32-avr.h (struct avr_property_header): New strucure.
2899 (avr_elf32_load_property_records): Declare.
2900 (avr_elf32_property_record_name): Declare.
2901 * elf32-avr.c: Add bfd_stdint.h include.
2902 (retrieve_local_syms): New function.
2903 (get_elf_r_symndx_section): New function.
2904 (get_elf_r_symndx_offset): New function.
2905 (internal_reloc_compare): New function.
2906 (struct avr_find_section_data): New structure.
2907 (avr_is_section_for_address): New function.
2908 (avr_find_section_for_address): New function.
2909 (avr_elf32_load_records_from_section): New function.
2910 (avr_elf32_load_property_records): New function.
2911 (avr_elf32_property_record_name): New function.
2912
2913 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
2914
2915 * elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
2916 (AVR_PROPERTY_RECORDS_VERSION): Define.
2917 (AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
2918 (struct avr_property_record): New structure.
2919
2920 2015-02-24 Nick Clifton <nickc@redhat.com>
2921
2922 * elf32-v850.c (v850_set_note): New function. Creates a Renesas
2923 style note entry.
2924 (v850_elf_make_note_section): New function. Creates a note
2925 section.
2926 (v850_elf_create_sections): New function. Create a note section
2927 if one is not already present.
2928 (v850_elf_set_note): New function. Adds a note to a bfd.
2929 (v850_elf_copy_private_bfd_data): New function. Copies V850
2930 notes.
2931 (v850_elf_merge_notes): New function. Merges V850 notes.
2932 (print_v850_note): New function. Displays a V850 note.
2933 (v850_elf_print_notes): New function. Displays all notes attached
2934 to a bfd.
2935 (v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
2936 (v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
2937 (v850_elf_fake_sections): Set the type of the V850 note section.
2938 * bfd-in.h (v850_elf_create_sections): Add prototype.
2939 (v850_elf_set_note): Add prototype.
2940 * bfd-in2.h: Regenerate.
2941
2942 2015-02-24 Nick Clifton <nickc@redhat.com>
2943
2944 * configure.ac (AC_CHECK_HEADERS): Add wctype.h.
2945 * configure: Regenerate.
2946 * config.in: Regenerate.
2947 * peXXigen.c: Include wctype.h if HAVE_WCTYPE_H is defined.
2948 (u16_mbtowc): Use wint_t types if HAVE_WCTYPE_H is defined.
2949 (rsrc_cmp): Use towlower instead of wcsncasecmp if HAVE_WCTYPE_H
2950 is defined.
2951
2952 2015-02-24 Nick Clifton <nickc@redhat.com>
2953
2954 * pdp11.c (set_section_contents): Pad the .text and .data sections
2955 to their aligned sizes.
2956
2957 2015-02-23 Yoshinori Sato <ysato@users.sourceforge.jp>
2958
2959 * config.bfd: Add h8300-*-linux.
2960 * configure.ac: Add h8300_elf32_linux_vec.
2961 * configure: Regenerate.
2962 * elf32-h8300.c: Likewise.
2963 * targets.c(_bfd_target_vector): Likewise.
2964
2965 2015-02-23 Nick Clifton <nickc@redhat.com>
2966
2967 PR 17914
2968 * cpu-w65.c: Correct typos in license notice.
2969
2970 PR 17940
2971 * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug
2972 symbols at end of sections. Adjust function sizes.
2973
2974 2015-02-20 Andreas Arnez <arnez@linux.vnet.ibm.com>
2975
2976 * elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
2977 (elfcore_write_s390_vxrs_high): Likewise.
2978 * elf.c (elfcore_grok_s390_vxrs_low): New function.
2979 (elfcore_grok_s390_vxrs_high): New function.
2980 (elfcore_grok_note): Call them.
2981 (elfcore_write_s390_vxrs_low): New function.
2982 (elfcore_write_s390_vxrs_high): New function.
2983 (elfcore_write_register_note): Call them.
2984
2985 2015-02-19 Branko Drevensek <branko.drevensek@gmail.com>
2986
2987 PR 17995
2988 * verilog.c (verilog_write_record): Correct buffer size.
2989
2990 2015-02-19 Alan Modra <amodra@gmail.com>
2991
2992 * elflink.c (_bfd_elf_define_linkage_sym): Set 'bed' earlier.
2993
2994 2015-02-19 Alan Modra <amodra@gmail.com>
2995
2996 PR ld/4317
2997 * elflink.c (elf_link_input_bfd): Drop undefined local syms.
2998 (elf_link_output_extsym): Drop local and global undefined syms.
2999 Tidy. Expand comment.
3000
3001 2015-02-17 Alan Modra <amodra@gmail.com>
3002
3003 PR ld/17975
3004 * elflink.c (struct elf_outext_info): Remove need_second_pass
3005 and second_pass.
3006 (elf_link_output_extsym): Delete code handling second forced
3007 local pass. Move code emitting NULL STT_FILE symbol later, so
3008 that it can be omitted if forced local is stripped. Don't
3009 emit the NULL STT_FILE if no file symbols have been output.
3010 (bfd_elf_final_link): Remove second forced local pass.
3011 * elf32-ppc.c (add_stub_sym): Set linker_def on linker syms.
3012 (ppc_elf_size_dynamic_sections): Likewise.
3013 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3014 (build_global_entry_stubs): Likewise.
3015 (ppc64_elf_build_stubs): Likewise.
3016
3017 2015-02-16 H.J. Lu <hongjiu.lu@intel.com>
3018
3019 PR ld/17975
3020 * elflink.c (elf_link_output_extsym): Only check filesym_count
3021 when outputting a NULL FILE symbol. Set second_pass_sym to
3022 h->forced_local && !h->root.linker_def.
3023
3024 2015-02-15 H.J. Lu <hongjiu.lu@intel.com>
3025
3026 * elf32-i386.c (elf_i386_always_size_sections): Set root.linker_def
3027 on _TLS_MODULE_BASE_.
3028 * elf64-x86-64.c (elf_x86_64_always_size_sections): Likewise.
3029
3030 2015-02-15 Alan Modra <amodra@gmail.com>
3031
3032 * dwarf2.c (read_rangelist): Correct buffer overflow check
3033 Whitespace throughout file.
3034
3035 2015-02-14 Alan Modra <amodra@gmail.com>
3036
3037 PR ld/17973
3038 * bfd.c (struct bfd): Add lto_output.
3039 * linker.c (_bfd_handle_already_linked): Explicitly test for
3040 objects added by the lto plugin.
3041 * opncls.c (_bfd_new_bfd_contained_in): Copy lto_output and
3042 no_export flags from archive.
3043 * archive.c (open_nested_file): New function, setting lto_output
3044 and no_export, extracted from..
3045 (find_nested_archive): ..here. Flip params. Rename from
3046 _bfd_find_nested_archive.
3047 (_bfd_get_elt_at_filepos): Correct var typo. Use open_nested_file.
3048 (_bfd_look_for_bfd_in_cache): Copy no_export.
3049 * elflink.c (elf_link_add_object_symbols): Remove now unnecessary
3050 my_archive->no_export test.
3051 (elf_link_input_bfd): Drop existing lto_output STT_FILE syms.
3052 Don't use the file name when adding lto_output STT_FILE sym.
3053 * bfd-in2.h: Regenerate.
3054
3055 2015-02-13 Alan Modra <amodra@gmail.com>
3056
3057 PR binutils/17512
3058 * elf64-ppc.c (opd_entry_value): Tighten offset check. Remove
3059 now redundant assert.
3060
3061 2015-02-12 Nick Clifton <nickc@redhat.com>
3062
3063 PR binutils/17512
3064 * dwarf.c (read_1_byte, read_1_signed_byte, read_2_bytes)
3065 (read_4_bytes, read_8_bytes, read_n_bytes, read_string)
3066 (read_indirect_string, read_alt_indirect_string)
3067 (read_alt_indirect_ref, read_address, read_abbrevs)
3068 (read_attribute_value, read_attribute, decode_line_info)
3069 (find_abstract_instance_name, read_rangelist)
3070 (scan_unit_for_symbols, parse_comp_unit)
3071 (_bfd_dwarf2_find_nearest_line): Harden DWARF reading code. Pass
3072 end pointers to reading functions and check for offsets taking
3073 pointers out of range. Replace calls to read_*_leb128 with calls
3074 to safe_read_leb128.
3075
3076 (* elf64-ppc.c (opd_entry_value): Add a check for an overlarge
3077 offset.
3078 * syms.c (_bfd_stab_section_find_nearest_line): Add checks for
3079 computed file_name address being before the start of the string
3080 table.
3081
3082 2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
3083
3084 PR ld/17878
3085 * bfd.c (bfd_plugin_format): New.
3086 (bfd): Add plugin_format and plugin_dummy_bfd.
3087 * plugin.c (try_load_plugin): Take a pointer to bfd_boolean
3088 argument to return TRUE if any plugin is found. Set plugin_format.
3089 (has_plugin): New.
3090 (bfd_plugin_target_p): New.
3091 (bfd_plugin_specified_p): Likewise.
3092 (bfd_plugin_target_p): Likewise.
3093 (register_ld_plugin_object_p): Likewise.
3094 (bfd_plugin_set_plugin): Set has_plugin.
3095 (load_plugin): Cache try_load_plugin result.
3096 (bfd_plugin_object_p): Try ld_plugin_object_p first. Check
3097 plugin_format.
3098 * plugin.h (bfd_plugin_target_p): New.
3099 (bfd_plugin_specified_p): Likewise.
3100 (register_ld_plugin_object_p): Likewise.
3101 * bfd-in2.h: Regenerated.
3102
3103 2015-02-11 Pedro Alves <palves@redhat.com>
3104
3105 * libbfd-in.h [__cplusplus]: Open extern "C" scope.
3106 * libcoff-in.h [__cplusplus]: Open extern "C" scope.
3107 * libbfd.h: Regenerate.
3108 * libcoff.h: Regenerate.
3109
3110 * elf-bfd.h [__cplusplus]: Wrap in extern "C".
3111 * mach-o.h [__cplusplus]: Wrap in extern "C".
3112 * som.h [__cplusplus]: Wrap in extern "C".
3113
3114 2015-02-10 Nick Clifton <nickc@redhat.com>
3115
3116 PR binutils/17512
3117 * coffcode.h (styp_to_sec_flags): Use an unsigned long type to
3118 hold the flag bits.
3119 * peXXigen.c (pe_print_reloc): Use unsigned types to hold the
3120 size and number of relocs.
3121 (pe_print_debugdata): Use a 32-bit aligned buffer to store the
3122 codeview record.
3123 * versados.c (process_otr): Check the esdid value before using it
3124 to access the EDATA.
3125
3126 2015-02-09 Ed Maste <emaste@freebsd.org>
3127
3128 * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing
3129 uninitialized and unused variable.
3130 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3131
3132 2015-02-09 Alan Modra <amodra@gmail.com>
3133
3134 * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
3135 tls_sec.
3136 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3137 * elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.
3138
3139 2015-02-09 Alan Modra <amodra@gmail.com>
3140
3141 * elflink.c: Whitespace, formatting fixes.
3142 (elf_link_input_bfd): Clarify comment.
3143 (elf_link_output_extsym): Exclude symbols in linker created
3144 sections when testing for plugin symbols.
3145
3146 2015-02-07 H.J. Lu <hongjiu.lu@intel.com>
3147
3148 PR ld/17935
3149 * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a
3150 warning for relocation in readonly section for -z text.
3151 (elf_i386_size_dynamic_sections): Likewise.
3152 * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
3153 (elf_x86_64_size_dynamic_sections): Likewise.
3154
3155 2015-02-06 H.J. Lu <hongjiu.lu@intel.com>
3156
3157 PR ld/12365
3158 PR ld/14272
3159 * elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change.
3160 (elf_link_input_bfd): Mark the plugin symbol undefined if it is
3161 referenced from a non-IR file.
3162
3163 2015-02-06 Nick Clifton <nickc@redhat.com>
3164
3165 PR binutils/17512
3166 * peXXigen.c (rsrc_print_resource_entries): Add range check for
3167 addresses that wrap around the address space.
3168 (rsrc_parse_entry): Likewise.
3169
3170 2015-02-03 H.J. Lu <hongjiu.lu@intel.com>
3171
3172 PR ld/12365
3173 PR ld/14272
3174 * elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol
3175 undefined if it is referenced from a non-IR file.
3176
3177 2015-02-03 Nick Clifton <nickc@redhat.com>
3178
3179 PR binutils/17512
3180 * ecoff.c: Use bfd_alloc2 to allocate space for structure arrays.
3181 (_bfd_ecoff_slurp_symbol_table): Check for a negative symbol
3182 index or an out of range fdr index.
3183 * elf-m10300.c (mn10300_info_to_howto): Fix typo in error message.
3184 * elf32-arc.c (arc_info_to_howto_rel): Likewise.
3185 * elf32-avr.c (avr_info_to_howto_rela): Likewise.
3186 * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
3187 * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
3188 * elf32-cris.c (cris_info_to_howto_rela): Likewise.
3189 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
3190 * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
3191 * elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
3192 * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
3193 * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
3194 * elf32-frv.c (frv_info_to_howto_rela): Likewise.
3195 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
3196 * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
3197 * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
3198 * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
3199 * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
3200 * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
3201 * elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
3202 * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
3203 * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
3204 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3205 * elf32-mep.c (mep_info_to_howto_rela): Likewise.
3206 * elf32-metag.c (metag_info_to_howto_rela): Likewise.
3207 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3208 * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
3209 * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
3210 * elf32-mt.c (mt_info_to_howto_rela): Likewise.
3211 * elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
3212 * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
3213 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
3214 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3215 * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
3216 * elf32-rx.c (rx_info_to_howto_rela): Likewise.
3217 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
3218 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
3219 * elf32-v850.c (v850_elf_perform_relocation): Likewise.
3220 * elf32-vax.c (rtype_to_howto): Likewise.
3221 * elf32-visium.c (visium_info_to_howto_rela): Likewise.
3222 * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
3223 * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
3224 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3225 * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
3226 * mach-o.c: Use bfd_alloc2 to allocate space for structure arrays.
3227 (bfd_mach_o_canonicalize_one_reloc): Fix check on out
3228 of range symbol indicies.
3229 (bfd_mach_o_canonicalize_relocs): Check for out of range alloc.
3230 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise.
3231 (bfd_mach_o_build_dysymtab): Likewise.
3232 (bfd_mach_o_write_symtab_content): Set the string table size to
3233 zero upon error.
3234 (bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the
3235 read fails.
3236 * peXXigen.c (pe_print_edata): Check for numeric overflow in edt
3237 fields.
3238 * tekhex.c (first_phase): Check for src pointer reaching end of
3239 buffer.
3240
3241 2015-02-03 Will Newton <will.newton@linaro.org>
3242
3243 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
3244 Set st_value to zero for undefined symbols if the reference
3245 is weak or pointer_equality_needed is FALSE.
3246
3247 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
3248 comment discussing why we clear st_value for some symbols.
3249
3250 2015-02-02 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3251
3252 * elf32-nds32.c (nds32_get_section_contents): Add one more argument.
3253 (nds32_elf_relocate_section): Do not relocate R_NDS32_LONGJUMP7.
3254
3255 2015-01-29 Alan Modra <amodra@gmail.com>
3256
3257 * elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
3258 optimization. Tidy mask for GOT_TLSGD optimization.
3259 * elf32-ppc.c (ppc_elf_relocate_section): Likewise. Correct
3260 location of nop zapping high insn too.
3261
3262 2015-01-28 Alan Modra <amodra@gmail.com>
3263
3264 * elf64-ppc.h (struct ppc64_elf_params): Add "object_in_toc".
3265 * elf64-ppc.c (ppc64_elf_add_symbol_hook): Assume that global symbols
3266 in .toc indicate xlc compiled code that might require a rw .toc.
3267
3268 2015-01-28 James Bowman <james.bowman@ftdichip.com>
3269
3270 * Makefile.am: Add FT32 files.
3271 * archures.c (enum bfd_architecture): Add bfd_arch_ft32.
3272 (bfd_mach_ft32): Define.
3273 (bfd_ft32_arch): Declare.
3274 (bfd_archures_list): Add bfd_ft32_arch.
3275 * config.bfd: Handle FT32.
3276 * configure.ac: Likewise.
3277 * cpu-ft32.c: New file.
3278 * elf32-ft32.c: New file.
3279 * reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
3280 BFD_RELOC_FT32_18): Define.
3281 * targets.c (_bfd_target_vector): Add ft32_elf32_vec.
3282 * bfd-in2.h: Regenerate.
3283 * libbfd.h: Regenerate.
3284 * Makefile.in: Regenerate.
3285 * configure: Regenerate.
3286 * po/SRC-POTFILES.in: Regenerate.
3287
3288 2015-01-27 Nick Clifton <nickc@redhat.com>
3289
3290 PR binutils/17512
3291 * pdp11.c (aout_get_external_symbols): Return false if there are
3292 no symbols.
3293
3294 * dwarf2.c (concat_filename): Check for an empty directory table.
3295 (scan_unit_for_symbols): Check for reading off the end of the
3296 unit.
3297 (parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
3298 non-string form.
3299 * elf64-ppc.c (opd_entry_value): Fail if there are no relocs
3300 available.
3301
3302 2015-01-26 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3303
3304 * elf32-nds32.c (nds32_elf_pick_relax): Fix again setting.
3305
3306 2015-01-22 DJ Delorie <dj@redhat.com>
3307
3308 * elf32-m32c.c (m32c_apply_reloc_24): New.
3309 (m32c_elf_howto_table): Use it for R_M32C_24.
3310 (m32c_elf_relocate_section): Handle R_M32C_24 specially.
3311
3312 2015-01-22 Nick Clifton <nickc@redhat.com>
3313
3314 PR binutils/17512
3315 * coffcode.h (handle_COMDAT): When searching for the section
3316 symbol, make sure that there is space left in the symbol table.
3317 * vms-alpha.c (_bfd_vms_slurp_ehdr): Add range checks.
3318
3319 2015-01-21 Nick Clifton <nickc@redhat.com>
3320
3321 PR binutils/17512
3322 * coffcode.h (coff_set_arch_mach_hook): Check return value from
3323 bfd_malloc.
3324 (coff_slurp_line_table): Return FALSE if the line number
3325 information was corrupt.
3326 (coff_slurp_symbol_table): Return FALSE if the symbol information
3327 was corrupt.
3328 * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
3329 initialise the fields of the dyld_info structure.
3330 (bfd_mach_o_build_exec_seg_command): Replace assertion with an
3331 error message and a return value.
3332 (bfd_mach_o_layout_commands): Change the function to boolean.
3333 Return FALSE if the function fails.
3334 (bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
3335 fails.
3336 (bfd_mach_o_read_command): Fail if an unrecognised command is
3337 encountered.
3338 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
3339 read fails.
3340 (slurp_symtab): Check the return from bfd_malloc.
3341 (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
3342 encountered an error.
3343 (_bfd_XXi_final_link_postscript): Fail if a section could not be
3344 copied.
3345 * peicode.h (pe_bfd_object_p): Fail if the header could not be
3346 swapped in.
3347 * tekhex.c (first_phase): Fail if the section is too big.
3348 * versados.c (struct esdid): Add content_size field.
3349 (process_otr): Use and check the new field.
3350 (versados_get_section_contents): Check that the section exists and
3351 that the requested data is available.
3352
3353 2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
3354
3355 * elf32-nios2.c (elf_backend_default_execstack): Define as 0.
3356
3357 2015-01-20 Alan Modra <amodra@gmail.com>
3358
3359 PR ld/17615
3360 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
3361 ELF_COMMON_DEF syms.
3362
3363 2015-01-19 Alan Modra <amodra@gmail.com>
3364
3365 PR ld/17615
3366 * elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
3367 linker script assignments too.
3368 * elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
3369 (bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
3370
3371 2015-01-19 Alan Modra <amodra@gmail.com>
3372
3373 * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Correct loop iteration
3374 to allow return of first howto.
3375 * elf32-fr30.c (fr30_reloc_type_lookup): Likewise.
3376 * elf32-m32c.c (m32c_reloc_type_lookup): Likewise.
3377 * elf32-moxie.c (moxie_reloc_type_lookup): Likewise.
3378 * elf32-or1k.c (or1k_reloc_type_lookup): Likewise.
3379 * elf32-rl78.c (rl78_reloc_type_lookup): Likewise.
3380 * elf32-rx.c (rx_reloc_type_lookup): Likewise.
3381 * elf32-tilepro.c (tilepro_reloc_type_lookup): Likewise.
3382 * elf32-xstormy16.c (xstormy16_reloc_type_lookup): Likewise.
3383 * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
3384 * elf32-nios2.c (nios2_reloc_map): Add mapping for R_NIOS2_NONE.
3385 * elf32-spu.c (spu_elf_bfd_to_reloc_type): Allow return of R_SPU_NONE.
3386 (spu_elf_reloc_type_lookup): Adjust to suit.
3387
3388 2015-01-19 Alan Modra <amodra@gmail.com>
3389
3390 * bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
3391 (bfd_get_section_limit): ..here.
3392 * reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
3393 (bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
3394 * elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
3395 * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
3396 bfd_reloc_outofrange check.
3397 * bfd-in2.h: Regenerate.
3398
3399 * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
3400 on zero size relocs.
3401 * ecoff.c (ecoff_reloc_link_order): Likewise.
3402 * elf32-nds32.c (nds32_relocate_contents): Likewise.
3403 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3404
3405 * reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
3406 (_bfd_clear_contents): Likewise.
3407 * elfxx-mips.c (mips_elf_obtain_contents): Likewise.
3408 (mips_elf_perform_relocation): Likewise.
3409
3410 * aoutx.h (aout_link_reloc_link_order): Allow for NULL return
3411 from malloc on zero size alloc.
3412 * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
3413 * elflink.c (elf_reloc_link_order): Likewise.
3414 * linker.c (_bfd_generic_reloc_link_order): Likewise.
3415 * pdp11.c (aout_link_reloc_link_order): Likewise.
3416 * xcofflink.c (xcoff_reloc_link_order): Likewise.
3417
3418 * aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
3419 bitsize 0, and complain_overflow_dont.
3420 * coff-sparc.c (coff_sparc_howto_table): Likewise.
3421 * elf-hppa.h (elf_hppa_howto_table): Likewise.
3422 * elf-m10200.c (elf_mn10200_howto_table): Likewise.
3423 * elf-m10300.c (elf_mn10300_howto_table): Likewise.
3424 * elf32-arc.c (elf_arc_howto_table): Likewise.
3425 * elf32-arm.c (elf32_arm_howto_table_1): Likewise.
3426 * elf32-avr.c (elf_avr_howto_table): Likewise.
3427 * elf32-bfin.c (bfin_howto_table): Likewise.
3428 * elf32-cr16.c (cr16_elf_howto_table): Likewise.
3429 * elf32-cris.c (cris_elf_howto_table): Likewise.
3430 * elf32-crx.c (crx_elf_howto_table): Likewise.
3431 * elf32-d10v.c (elf_d10v_howto_table): Likewise.
3432 * elf32-d30v.c (elf_d30v_howto_table): Likewise.
3433 * elf32-dlx.c (dlx_elf_howto_table): Likewise.
3434 * elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
3435 * elf32-fr30.c (fr30_elf_howto_table): Likewise.
3436 * elf32-frv.c (elf32_frv_howto_table): Likewise.
3437 * elf32-h8300.c (h8_elf_howto_table): Likewise.
3438 * elf32-i370.c (i370_elf_howto_raw): Likewise.
3439 * elf32-i386.c (elf_howto_table): Likewise.
3440 * elf32-i860.c (elf32_i860_howto_table): Likewise.
3441 * elf32-i960.c (elf32_i960_relocate): Likewise.
3442 * elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
3443 * elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
3444 * elf32-lm32.c (lm32_elf_howto_table): Likewise.
3445 * elf32-m32c.c (m32c_elf_howto_table): Likewise.
3446 * elf32-m32r.c (m32r_elf_howto_table): Likewise.
3447 * elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
3448 * elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
3449 * elf32-m68k.c (howto_table): Likewise.
3450 * elf32-mcore.c (mcore_elf_howto_raw): Likewise.
3451 * elf32-mep.c (mep_elf_howto_table): Likewise.
3452 * elf32-metag.c (elf_metag_howto_table): Likewise.
3453 * elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
3454 * elf32-mips.c (elf_mips_howto_table_rel): Likewise.
3455 * elf32-moxie.c (moxie_elf_howto_table): Likewise.
3456 * elf32-msp430.c (elf_msp430_howto_table): Likewise.
3457 * elf32-mt.c (mt_elf_howto_table): Likewise.
3458 * elf32-nds32.c (nds32_elf_howto_table): Likewise.
3459 * elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
3460 * elf32-or1k.c (or1k_elf_howto_table): Likewise.
3461 * elf32-pj.c (pj_elf_howto_table): Likewise.
3462 * elf32-ppc.c (ppc_elf_howto_raw): Likewise.
3463 * elf32-rl78.c (rl78_elf_howto_table): Likewise.
3464 * elf32-rx.c (rx_elf_howto_table): Likewise.
3465 * elf32-s390.c (elf_howto_table): Likewise.
3466 * elf32-score.c (elf32_score_howto_table): Likewise.
3467 * elf32-score7.c (elf32_score_howto_table): Likewise.
3468 * elf32-sh-relocs.h (R_SH_NONE): Likewise.
3469 * elf32-spu.c (elf_howto_table): Likewise.
3470 * elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
3471 * elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
3472 * elf32-v850.c (v850_elf_howto_table): Likewise.
3473 * elf32-vax.c (howto_table): Likewise.
3474 * elf32-visium.c (visium_elf_howto_table): Likewise.
3475 * elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
3476 * elf32-xgate.c (elf_xgate_howto_table): Likewise.
3477 * elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
3478 * elf32-xtensa.c (elf_howto_table): Likewise.
3479 * elf64-alpha.c (elf64_alpha_howto_table): Likewise.
3480 * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
3481 * elf64-mmix.c (elf_mmix_howto_table): Likewise.
3482 * elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
3483 * elf64-s390.c (elf_howto_table): Likewise.
3484 * elf64-sh64.c (sh_elf64_howto_table): Likewise.
3485 * elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
3486 * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
3487 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
3488 (elfNN_aarch64_howto_none): Likewise.
3489 * elfxx-ia64.c (ia64_howto_table): Likewise.
3490 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
3491 * elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
3492 * nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
3493
3494 2015-01-15 H.J. Lu <hongjiu.lu@intel.com>
3495
3496 PR ld/17847
3497 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't complain
3498 about -fPIC if the symbol is undefined when building executable.
3499
3500 2015-01-15 Nick Clifton <nickc@redhat.com>
3501
3502 PR binutils/17512
3503 * elf-m10300.c (mn10300_info_to_howto): Replace assertion with an
3504 error message. Never return an invalid howto pointer.
3505 * elf32-cr16.c (cr16_info_to_howto): Likewise.
3506 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
3507 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
3508 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3509 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3510 * elf32-mips.c (mips_elf32_rtype_to_howto): Likewise.
3511 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
3512 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3513 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
3514 * elf32-v850.c (v850_elf_info_to_howto_rela): Likewise.
3515 * elf32-vax.c (rtype_to_howto): Likewise.
3516 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3517 * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
3518 * elfn32-mips.c (sh_elf_info_to_howto): Likewise.
3519 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
3520 (sh_elf_reloc): Check that the reloc is in range.
3521 * reloc.c (bfd_perform_relocation): Check that the section is big
3522 enough for the entire reloc.
3523 (bfd_generic_get_relocated_section_contents): Report unexpected
3524 return values from perform_reloc.
3525
3526 2015-01-15 Nick Clifton <nickc@redhat.com>
3527
3528 * elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
3529 relocs. Include PC-relative adjustment for R_MSP430X_ABS16
3530 relaxation.
3531
3532 2015-01-15 Alan Modra <amodra@gmail.com>
3533
3534 * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
3535 any output section matching a linker created dynobj section.
3536
3537 2015-01-15 Alan Modra <amodra@gmail.com>
3538
3539 PR 17842
3540 * elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
3541 (bfd_elf_final_link): Always create a symbol table when emit_relocs.
3542 Don't assign symtab file position unless symbols will be output.
3543 Merge blocks with condition in common. Don't call
3544 elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
3545 unless other symbols are output. Move assignment of symtab_shndx
3546 file position. Localize variable.
3547
3548 2015-01-14 Jiong Wang <jiong.wang@arm.com>
3549
3550 * elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when
3551 trying to defer them to runtime.
3552
3553 2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
3554
3555 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
3556 to check if a symbol should be bound symbolically.
3557
3558 2015-01-13 Jiong Wang <jiong.wang@arm.com>
3559
3560 * elfnn-aarch64.c: (elfNN_aarch64_howto_table): Enable overflow check
3561 for TLSLE_MOVW_TPREL_G2.
3562
3563 2015-01-13 Jiong Wang <jiong.wang@arm.com>
3564
3565 PR ld/17415
3566 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark
3567 R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned.
3568 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the
3569 bit mask.
3570
3571 2015-01-12 Terry Guo <terry.guo@arm.com>
3572
3573 * elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New
3574 function.
3575 (_bfd_elf_gc_mark_extra_sections): Use it.
3576
3577 2015-01-11 H.J. Lu <hongjiu.lu@intel.com>
3578
3579 PR ld/17827
3580 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
3581 only discard space for pc-relative relocs symbols which turn
3582 out to need copy relocs.
3583
3584 2015-01-09 Nick Clifton <nickc@redhat.com>
3585
3586 * tekhex.c (getvalue): Fix thinko in test for correct extraction
3587 of value.
3588 (getsym): Return false if there was not enough data to extract the
3589 symbol.
3590
3591 2015-01-09 Anthony Green <green@moxielogic.com>
3592
3593 * elf32-moxie.c (ELF_MACHINE_ALT1): Define.
3594
3595 2015-01-08 Nick Clifton <nickc@redhat.com>
3596
3597 * elf32-msp430.c (msp430_elf_relax_section): Add relaxation of
3598 16-bit absolute BR instructions to 10-bit pc-relative JMP
3599 instructions.
3600
3601 2015-01-08 Nick Clifton <nickc@redhat.com>
3602
3603 PR binutils/17512
3604 * coffcode.h (coff_slurp_symbol_table): Return false if we failed
3605 to load the line table.
3606 * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum
3607 maxpagesize of 1.
3608 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if
3609 the Data Directory Size is too large.
3610
3611 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
3612
3613 PR binutils/17512
3614 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation.
3615 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3616
3617 2015-01-06 Nick Clifton <nickc@redhat.com>
3618
3619 PR binutils/17512
3620 * mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the
3621 string table.
3622
3623 * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
3624 (bfd_perform_relocation): Include the size of the reloc in the
3625 test for an out of range relocation.
3626 (bfd_generic_get_relocated_section_contents): Remove reloc range
3627 test.
3628
3629 * coff-i860.c (CALC_ADDEND): Always set an addend value.
3630 * tekhex.c (getvalue): Add an end pointer parameter. Use it to
3631 avoid reading off the end of the buffer.
3632 (getsym): Likewise.
3633 (first_phase): Likewise.
3634 (pass_over): Pass an end pointer to the invoked function.
3635
3636 2015-01-05 H.J. Lu <hongjiu.lu@intel.com>
3637
3638 PR binutils/17512
3639 * elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt
3640 input.
3641 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3642
3643 2015-01-05 Nick Clifton <nickc@redhat.com>
3644
3645 PR binutils/17512
3646 * archive.c (do_slurp_bsd_armap): Make sure that the parsed sized
3647 is at least big enough for the header to be read.
3648 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocs.
3649 * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks.
3650 (bfd_mach_o_read_command): Prevetn duplicate error messages about
3651 unrecognized commands.
3652 * syms.c (_bfd_stab_section_find_nearest_line): Add range checks
3653 when indexing into the string table.
3654
3655 2015-01-01 Alan Modra <amodra@gmail.com>
3656
3657 Update year range in copyright notice of all files.
3658
3659 For older changes see ChangeLog-2014
3660 \f
3661 Copyright (C) 2015 Free Software Foundation, Inc.
3662
3663 Copying and distribution of this file, with or without modification,
3664 are permitted in any medium without royalty provided the copyright
3665 notice and this notice are preserved.
3666
3667 Local Variables:
3668 mode: change-log
3669 left-margin: 8
3670 fill-column: 74
3671 version-control: never
3672 End:
This page took 0.10984 seconds and 4 git commands to generate.