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