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