ELF: Pass bfd_link_info to merge_gnu_properties
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2
3 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
4 to merge_gnu_properties.
5 * elf-properties.c (elf_merge_gnu_properties): Add struct
6 bfd_link_info * and pass it to merge_gnu_properties.
7 (elf_merge_gnu_property_list): Add struct bfd_link_info *
8 and pass it to elf_merge_gnu_properties.
9 (_bfd_elf_link_setup_gnu_properties): Pass info to
10 elf_merge_gnu_property_list.
11 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
12 bfd_link_info *.
13 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
14
15 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
16
17 PR 21564
18 * binary.c (binary_set_section_contents): Scale lma by octets
19 per byte to set filepos.
20
21 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
22
23 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
24 dynamic sections.
25
26 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
27
28 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
29 require TEXTREL.
30
31 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
32
33 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
34 patched section contents for TLS IE reloc.
35 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
36
37 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
38
39 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
40 RELOC_FOR_GLOBAL_SYMBOL macro.
41
42 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
43
44 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
45 changes.
46
47 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
48
49 * config/tc-arc.c (md_undefined_symbol): Changed.
50 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
51
52 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
53
54 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
55 symbols.
56
57 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
58
59 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
60 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
61
62 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
63
64 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
65 object is created.
66
67 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
68
69 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
70 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
71 is non-zero. Add clarifying comments.
72
73 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
74
75 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
76 name. Use local IFUNC symbol name string to report unsupported
77 non-PIC call to IFUNC function.
78 (elf_i386_relocate_section): Dump local IFUNC name with minfo
79 when generating R_386_IRELATIVE relocation.
80 (elf_i386_finish_dynamic_symbol): Likewise.
81 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
82 IFUNC symbol name.
83 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
84 when generating R_X86_64_IRELATIVE relocation.
85 (elf_x86_64_finish_dynamic_symbol): Likewise.
86
87 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
88
89 * elf.c (setup_group): Make sure BFD sections are created for all
90 group sections in the input file when processing SHF_GROUP
91 sections.
92 (bfd_section_from_shdr): Avoid duplicating logic already
93 implemented in `setup_group'.
94
95 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
96
97 PR binutils/21546
98 * peXXigen.c (pe_print_idata): Use the address of the first thunk
99 if the hint address is zero.
100
101 2017-06-06 James Clarke <jrtc27@jrtc27.com>
102
103 PR ld/19579
104 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
105 ELF_COMMON_DEF_P for common symbols.
106
107 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
108
109 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
110 SEC_GROUP sections as SEC_EXCLUDE.
111 (bfd_elf_set_group_contents): Replace use of abort with an assert.
112 (assign_section_numbers): Use resolve_section_groups flag instead
113 of relocatable link type.
114 (_bfd_elf_init_private_section_data): Use resolve_section_groups
115 flag instead of checking the final_link flag for part of the
116 checks in here. Fix white space as a result.
117 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
118 instead of relocatable link type.
119 (bfd_elf_final_link): Likewise.
120
121 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
122
123 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
124 variable `bed'.
125 * elf32-score.c (score_elf_final_link_relocate): Likewise.
126 (s3_bfd_score_elf_check_relocs): Likewise.
127 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
128 (score_elf_final_link_relocate): Likewise.
129 (s7_bfd_score_elf_check_relocs): Likewise.
130
131 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
132
133 * elflink.c (init_reloc_cookie_rels): Remove unused variable
134 `bed'.
135
136 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
137
138 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
139 from `reloc_count' rather than decrementing it.
140 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
141 `reloc_count' by `int_rels_per_ext_rel'.
142 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
143 `reloc_count' by `int_rels_per_ext_rel' for last relocation
144 entry determination.
145 (s3_bfd_score_elf_check_relocs): Likewise.
146 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
147 (s7_bfd_score_elf_relocate_section): Likewise.
148 (s7_bfd_score_elf_check_relocs): Likewise.
149 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
150 prototype and function.
151 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
152 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
153 triple rather than once the sum of REL and RELA relocation entry
154 counts.
155 (bfd_elf64_get_reloc_upper_bound): Remove macro.
156 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
157 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
158 storage allocation size determination.
159 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
160 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
161 by `int_rels_per_ext_rel' for last relocation entry
162 determination.
163 (bfd_elf_final_link): Do not multiply `reloc_count' by
164 `int_rels_per_ext_rel' for internal relocation storage
165 allocation size determination.
166 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
167 `int_rels_per_ext_rel' for last relocation entry determination.
168 (elf_gc_smash_unused_vtentry_relocs): Likewise.
169 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
170 (_bfd_mips_elf_relocate_section): Likewise.
171
172 2017-06-05 Alan Modra <amodra@gmail.com>
173
174 PR 21529
175 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
176
177 2017-06-01 John Baldwin <jhb@FreeBSD.org>
178
179 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
180 determine structure sizes.
181 (elfcore_grok_freebsd_prstatus): Likewise.
182
183 2017-06-01 Alan Modra <amodra@gmail.com>
184
185 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
186 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
187 dynamic objects.
188 (is_elfv2_localentry0): New function.
189 (ppc64_elf_tls_setup): Default params->plt_localentry0.
190 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
191 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
192 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
193 optimized localentry:0 stubs.
194 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
195 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
196 localentry:0 stubs.
197 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
198 DT_PPC64_OPT.
199 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
200
201 2017-05-30 Casey Smith <clegg89@gmail.com>
202
203 PR ld/21523
204 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
205 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
206
207 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
208
209 * cpu-arc.c (arc_compatible): New function.
210
211 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
212
213 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
214
215 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
216
217 PR binutils/21519
218 * bfdio.c (bfd_get_file_size): New function.
219 * bfd-in2.h: Regenerated.
220
221 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
222
223 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
224 comments.
225
226 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
227
228 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
229 dynobj instead of htab->elf.dynobj.
230
231 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
232
233 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
234 and function.
235 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
236 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
237 actual number of internal relocations retrieved. Adjust
238 function description.
239 (bfd_elf64_canonicalize_reloc): Remove macro.
240 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
241
242 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
243
244 * archures.c (bfd_mach_sparc_v9m8): Define.
245 (bfd_mach_sparc_v8plusm8): Likewise.
246 (bfd_mach_sparc_v9_p): Adjust to M8.
247 (bfd_mach_sparc_64bit_p): Likewise.
248 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
249 bfd_mach_sparc_v8plusm8.
250 * bfd-in2.h: Regenerated.
251 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
252 sparc:v8plusm8.
253 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
254 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
255 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
256 SHA3.
257 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
258 bfd_mach_sparc_v8plusm8.
259
260 2017-05-19 Alan Modra <amodra@gmail.com>
261
262 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
263 debug and special sections when no non-note alloc sections in an
264 object are kept.
265
266 2017-05-18 Alan Modra <amodra@gmail.com>
267
268 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
269 * elf-m10300.c: Likewise.
270 * elf.c: Likewise.
271 * elf32-arc.c: Likewise.
272 * elf32-bfin.c: Likewise.
273 * elf32-m68k.c: Likewise.
274 * elf32-nds32.c: Likewise.
275 * elf32-tilepro.c: Likewise.
276 * elflink.c: Likewise.
277 * elfnn-aarch64.c: Likewise.
278 * elfnn-riscv.c: Likewise.
279 * elfxx-tilegx.c: Likewise.
280 * mach-o.c: Likewise.
281 * peXXigen.c: Likewise.
282 * vms-alpha.c: Likewise.
283 * vms-lib.c: Likewise.
284
285 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
286
287 PR ld/20882
288 * elflink.c (elf_gc_mark_debug_section): New function.
289 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
290 referenced by kept debug sections.
291
292 2017-05-16 Alan Modra <amodra@gmail.com>
293
294 * elf-m10300.c: Rename occurrences of non_ir_ref.
295 * elf32-arm.c: Likewise.
296 * elf32-bfin.c: Likewise.
297 * elf32-cr16.c: Likewise.
298 * elf32-cris.c: Likewise.
299 * elf32-d10v.c: Likewise.
300 * elf32-dlx.c: Likewise.
301 * elf32-fr30.c: Likewise.
302 * elf32-frv.c: Likewise.
303 * elf32-hppa.c: Likewise.
304 * elf32-i370.c: Likewise.
305 * elf32-i386.c: Likewise.
306 * elf32-iq2000.c: Likewise.
307 * elf32-lm32.c: Likewise.
308 * elf32-m32c.c: Likewise.
309 * elf32-m32r.c: Likewise.
310 * elf32-m68hc1x.c: Likewise.
311 * elf32-m68k.c: Likewise.
312 * elf32-mcore.c: Likewise.
313 * elf32-metag.c: Likewise.
314 * elf32-microblaze.c: Likewise.
315 * elf32-moxie.c: Likewise.
316 * elf32-msp430.c: Likewise.
317 * elf32-mt.c: Likewise.
318 * elf32-nios2.c: Likewise.
319 * elf32-or1k.c: Likewise.
320 * elf32-ppc.c: Likewise.
321 * elf32-rl78.c: Likewise.
322 * elf32-s390.c: Likewise.
323 * elf32-score.c: Likewise.
324 * elf32-score7.c: Likewise.
325 * elf32-sh.c: Likewise.
326 * elf32-tic6x.c: Likewise.
327 * elf32-tilepro.c: Likewise.
328 * elf32-v850.c: Likewise.
329 * elf32-vax.c: Likewise.
330 * elf32-xstormy16.c: Likewise.
331 * elf32-xtensa.c: Likewise.
332 * elf64-alpha.c: Likewise.
333 * elf64-hppa.c: Likewise.
334 * elf64-ia64-vms.c: Likewise.
335 * elf64-mmix.c: Likewise.
336 * elf64-ppc.c: Likewise.
337 * elf64-s390.c: Likewise.
338 * elf64-sh64.c: Likewise.
339 * elf64-x86-64.c: Likewise.
340 * elflink.c: Likewise.
341 * elfnn-aarch64.c: Likewise.
342 * elfnn-ia64.c: Likewise.
343 * elfnn-riscv.c: Likewise.
344 * elfxx-mips.c: Likewise.
345 * elfxx-sparc.c: Likewise.
346 * elfxx-tilegx.c: Likewise.
347 * linker.c: Likewise.
348
349 2017-05-16 Alan Modra <amodra@gmail.com>
350
351 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
352 * elflink.c (elf_link_add_object_symbols): Update to use
353 non_ir_ref_dynamic.
354 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
355 non_ir_ref.
356 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
357
358 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
359
360 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
361
362 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
363
364 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
365 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
366 properties.
367 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
368
369 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
370
371 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
372 to plt_second.
373 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
374 to plt_second/plt_second_eh_frame.
375 (elf_x86_64_link_hash_newfunc): Updated.
376 (elf_x86_64_allocate_dynrelocs): Likewise.
377 (elf_x86_64_size_dynamic_sections): Likewise.
378 (elf_x86_64_relocate_section): Likewise.
379 (elf_x86_64_finish_dynamic_symbol): Likewise.
380 (elf_x86_64_finish_dynamic_sections): Likewise.
381 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
382 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
383 .plt.sec section.
384 (elf_backend_setup_gnu_properties): Updated. Create the
385 .plt.sec section instead of the .plt.sec section.
386
387 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
388
389 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
390 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
391 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
392
393 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
394
395 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
396 (bfd_elf64_set_reloc): Define.
397 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
398
399 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
400
401 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
402 (struct bfd_target): New field _bfd_set_reloc.
403 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
404 * reloc.c (_bfd_generic_set_reloc): New function.
405 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
406 * nlm-target.h (nlm_set_reloc): Likewise.
407 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
408 * aout-tic30.c (MY_set_reloc): Likewise.
409 * aout-target.h (MY_set_reloc): Likewise.
410 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
411 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
412 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
413 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
414 * aout-adobe.c (aout_32_set_reloc): Likewise.
415 * bout.c (b_out_set_reloc): Likewise.
416 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
417 * i386os9k.c (aout_32_set_reloc): Likewise.
418 * ieee.c (ieee_set_reloc): Likewise.
419 * oasys.c (oasys_set_reloc): Likewise.
420 * som.c (som_set_reloc): Likewise.
421 * versados.c (versados_set_reloc): Likewise.
422 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
423 _bfd_generic_set_reloc.
424 (rs6000_xcoff64_aix_vec): LIkewise.
425 * libbfd.c (_bfd_norelocs_set_reloc): New function.
426 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
427 * i386msdos.c (msdos_set_reloc): Define to
428 _bfd_norelocs_set_reloc.
429 * elfcode.h (elf_set_reloc): Define.
430 * bfd-in2.h: Regenerated.
431
432 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
433
434 PR ld/21481
435 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
436 for IFUNC function address.
437
438 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
439
440 * elf32-arc.c (FEATURE_LIST_NAME): Define.
441 (CONFLICT_LIST): Likewise.
442 (opcode/arc-attrs.h): Include.
443 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
444 (arc_extract_features): New file.
445 (arc_stralloc): Likewise.
446 (arc_elf_merge_attributes): Likewise.
447 (arc_elf_merge_private_bfd_data): Use object attributes.
448 (bfd_arc_get_mach_from_attributes): New function.
449 (arc_elf_object_p): Use object attributes.
450 (arc_elf_final_write_processing): Likewise.
451 (elf32_arc_obj_attrs_arg_type): New function.
452 (elf32_arc_obj_attrs_handle_unknown): Likewise.
453 (elf32_arc_section_from_shdr): Likewise.
454 (elf_backend_obj_attrs_vendor): Define.
455 (elf_backend_obj_attrs_section): Likewise.
456 (elf_backend_obj_attrs_arg_type): Likewise.
457 (elf_backend_obj_attrs_section_type): Likewise.
458 (elf_backend_obj_attrs_handle_unknown): Likewise.
459 (elf_backend_section_from_shdr): Likewise.
460
461 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
462
463 PR ld/21458
464 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
465 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
466 and the destination is a Thumb symbol.
467
468 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
469
470 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
471 initializer to silence GCC 4.2.
472 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
473
474 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
475
476 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
477 (LAZY_PLT_ENTRY_SIZE): This.
478 (NON_LAZY_PLT_ENTRY_SIZE): New.
479 (elf_x86_64_plt0_entry): Renamed to ...
480 (elf_x86_64_lazy_plt0_entry): This.
481 (elf_x86_64_plt_entry): Renamed to ...
482 (elf_x86_64_lazy_plt_entry): This.
483 (elf_x86_64_bnd_plt0_entry): Renamed to ...
484 (elf_x86_64_lazy_bnd_plt0_entry): This.
485 (elf_x86_64_legacy_plt_entry): Removed.
486 (elf_x86_64_bnd_plt_entry): Renamed to ...
487 (elf_x86_64_lazy_bnd_plt_entry): This.
488 (elf_x86_64_legacy_plt2_entry): Renamed to ...
489 (elf_x86_64_non_lazy_plt_entry): This.
490 (elf_x86_64_bnd_plt2_entry): Renamed to ...
491 (elf_x86_64_non_lazy_bnd_plt_entry): This.
492 (elf_x86_64_eh_frame_plt): Renamed to ...
493 (elf_x86_64_eh_frame_lazy_plt): This.
494 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
495 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
496 (elf_x86_64_eh_frame_plt_got): Renamed to ...
497 (elf_x86_64_eh_frame_non_lazy_plt): This.
498 (elf_x86_64_lazy_plt_layout): New.
499 (elf_x86_64_non_lazy_plt_layout): Likewise.
500 (elf_x86_64_plt_layout): Likewise.
501 (elf_x86_64_backend_data): Remove PLT layout information. Add
502 os for target system.
503 (GET_PLT_ENTRY_SIZE): Removed.
504 (elf_x86_64_lazy_plt): New.
505 (elf_x86_64_non_lazy_plt): Likewise.
506 (elf_x86_64_lazy_bnd_plt): Likewise.
507 (elf_x86_64_non_lazy_bnd_plt): Likewise.
508 (elf_x86-64_arch_bed): Updated.
509 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
510 (elf_x86_64_create_dynamic_sections): Removed.
511 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
512 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
513 (elf_x86-64_adjust_dynamic_symbol): Updated.
514 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
515 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
516 size for PLT0 if there is no PLT0. Get plt_entry_size from
517 non_lazy_plt for non-lazy PLT entries.
518 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
519 from non_lazy_plt for non-lazy PLT entries.
520 (elf_x86-64_relocate_section): Updated. Properly get PLT index
521 if there is no PLT0.
522 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
523 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
524 entries with non-lazy PLT layout. Don't fill the second and third
525 slots in the PLT entry if there is no PLT0.
526 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
527 if there is no PLT0. Set sh_entsize on the .plt.got section.
528 (compare_relocs): New.
529 (elf_x86_64_plt_type): Likewise.
530 (elf_x86_64_plt): Likewise.
531 (elf_x86_64_nacl_plt): New. Forward declaration.
532 (elf_x86_64_get_plt_sym_val): Removed.
533 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
534 against all dynamic relocations.
535 (elf_x86_64_link_setup_gnu_properties): New function.
536 (elf_backend_create_dynamic_sections): Updated.
537 (elf_backend_setup_gnu_properties): New.
538 (elf_x86_64_nacl_plt): New.
539 (elf_x86_64_nacl_arch_bed): Updated.
540
541 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
542
543 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
544 (LAZY_PLT_ENTRY_SIZE): This.
545 (NON_LAZY_PLT_ENTRY_SIZE): New.
546 (elf_i386_plt0_entry): Renamed to ...
547 (elf_i386_lazy_plt0_entry): This.
548 (elf_i386_plt_entry): Renamed to ...
549 (elf_i386_lazy_plt_entry): This.
550 (elf_i386_pic_plt0_entry): Renamed to ...
551 (elf_i386_pic_lazy_plt0_entry): This.
552 (elf_i386_pic_plt_entry): Renamed to ...
553 (elf_i386_pic_lazy_plt_entry): This.
554 (elf_i386_got_plt_entry): Renamed to ...
555 (elf_i386_non_lazy_plt_entry): This.
556 (elf_i386_pic_got_plt_entry): Renamed to ...
557 (elf_i386_pic_non_lazy_plt_entry): This.
558 (elf_i386_eh_frame_plt): Renamed to ...
559 (elf_i386_eh_frame_lazy_plt): This.
560 (elf_i386_eh_frame_plt_got): Renamed to ...
561 (elf_i386_eh_frame_non_lazy_plt): This.
562 (elf_i386_plt_layout): Renamed to ...
563 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
564 eh_frame_plt_got_size.
565 (elf_i386_non_lazy_plt_layout): New.
566 (elf_i386_plt_layout): Likewise.
567 (elf_i386_non_lazy_plt): Likewise.
568 (GET_PLT_ENTRY_SIZE): Removed.
569 (elf_i386_plt): Renamed to ...
570 (elf_i386_lazy_plt): This.
571 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
572 (elf_i386_arch_bed): Updated.
573 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
574 (elf_i386_create_dynamic_sections): Removed.
575 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
576 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
577 (elf_i386_adjust_dynamic_symbol): Updated.
578 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
579 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
580 size for PLT0 if there is no PLT0.
581 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
582 output section is discarded only if GOT isn't empty.
583 (elf_i386_relocate_section): Updated. Properly get PLT index
584 if there is no PLT0.
585 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
586 second and third slots in the PLT entry if there is no PLT0.
587 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
588 if there is no PLT0. Set sh_entsize on the .plt.got section.
589 (elf_i386_nacl_plt): Forward declaration.
590 (elf_i386_get_plt_sym_val): Removed.
591 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
592 against all dynamic relocations.
593 (elf_i386_link_setup_gnu_properties): New function.
594 (elf_backend_create_dynamic_sections): Updated.
595 (elf_backend_setup_gnu_properties): New.
596 (elf_i386_nacl_plt): Updated.
597 (elf_i386_nacl_arch_bed): Likewise.
598 (elf_i386_vxworks_arch_bed): Likewise.
599
600 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
601
602 * elflink.c (elf_output_implib): Remove executable flag from import
603 library bfd.
604 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
605 library is a relocatable object file.
606
607 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
608
609 PR ld/21404
610 * elf32-avr.c (avr_should_move_sym): New function.
611 (avr_should_reduce_sym_size): Likewise.
612 (avr_should_increase_sym_size): Likewise.
613 (elf32_avr_relax_delete_bytes): Adjust symbol values
614 and sizes by calling new functions.
615
616 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
617
618 * config.bfd (riscv32-*): Enable rv64.
619
620 2017-05-02 Alan Modra <amodra@gmail.com>
621
622 PR 21384
623 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
624 rather than h->root.type == bfd_link_hash_new.
625 (bfd_elf_record_link_assignment): Similarly, call
626 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
627
628 2017-04-29 Alan Modra <amodra@gmail.com>
629
630 PR 21432
631 * reloc.c (reloc_offset_in_range): New function.
632 (bfd_perform_relocation, bfd_install_relocation): Use it.
633 (_bfd_final_link_relocate): Likewise.
634
635 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
636
637 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
638 before using .plt.got.
639 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
640
641 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
642
643 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
644 instead of "+=" to update 0.
645
646 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
647
648 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
649 .plt.got section here.
650 (elf_i386_check_relocs): Don't create the .plt.got section.
651 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
652 the .plt.got and .plt.bnd sections here.
653 (elf_x86_64_check_relocs): Don't create the .plt.got nor
654 .plt.bnd sections.
655
656 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
657
658 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
659 has_bnd_reloc.
660 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
661 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
662 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
663 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
664 has_bnd_reloc.
665
666 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
667
668 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
669 to return bfd *.
670 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
671 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
672 the first relocatable ELF input with GNU properties.
673
674 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
675
676 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
677 VxWorks for non-PIC.
678
679 2017-04-27 Alan Modra <amodra@gmail.com>
680
681 * elf-bfd.h (struct elf_backend_data): Make asection param of
682 elf_backend_eh_frame_address_size const.
683 (_bfd_elf_eh_frame_address_size): Likewise.
684 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
685 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
686 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
687 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
688 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
689 (next_cie_fde_offset): Constify params.
690 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
691
692 2017-04-27 Alan Modra <amodra@gmail.com>
693
694 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
695 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
696 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
697 aug_data_len.
698 (offset_adjust): New function.
699 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
700 (adjust_eh_frame_local_symbols): Likewise.
701 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
702 after changing anything. Return true if anything changed.
703 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
704 _bfd_elf_adjust_eh_frame_global_symbol for globals.
705
706 2017-04-27 Alan Modra <amodra@gmail.com>
707
708 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
709 when force_local.
710
711 2017-04-27 Alan Modra <amodra@gmail.com>
712
713 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
714 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
715 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
716 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
717 for undef and undefweak dyn_relocs.
718 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
719 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
720 (allocate_got, allocate_dynrelocs): Likewise.
721 (ppc64_elf_relocate_section): Likewise.
722
723 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
724
725 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
726 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
727 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
728 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
729
730 2017-04-26 Nick Clifton <nickc@redhat.com>
731
732 PR binutils/21434
733 * reloc.c (bfd_perform_relocation): Check for a negative address
734 in the reloc.
735
736 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
737
738 PR ld/21334
739 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
740 member.
741 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
742 (elf_backend_always_renumber_dynsyms): Define.
743 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
744 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
745 * elflink.c (bfd_elf_size_dynamic_sections): Also call
746 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
747 it.
748 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
749
750 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
751
752 * elflink.c (bfd_elf_size_dynamic_sections): Only call
753 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
754 sections have been created.
755
756 2017-04-26 Nick Clifton <nickc@redhat.com>
757
758 PR binutils/21431
759 * compress.c (bfd_init_section_compress_status): Check the return
760 value from bfd_malloc.
761
762 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
763
764 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
765 no_finish_dynamic_symbol.
766 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
767 0.
768 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
769 weak symbol, don't make it dynamic.
770 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
771 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
772 relocation for GOT reference.
773 (elf_x86_64_finish_dynamic_symbol): Abort if
774 no_finish_dynamic_symbol isn't 0.
775
776 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
777
778 PR ld/21402
779 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
780 undefined weak symbol, don't make it dynamic.
781 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
782 set no_finish_dynamic_symbol and generate R_386_RELATIVE
783 relocation for R_386_GOT32.
784
785 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
786
787 PR ld/21425
788 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
789
790 2017-04-23 Alan Modra <amodra@gmail.com>
791
792 PR 21414
793 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
794 * elf.c (lcomm_sym): New.
795 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
796 * bfd-in2.h: Regenerate.
797
798 2017-04-23 Alan Modra <amodra@gmail.com>
799
800 PR 21412
801 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
802 parameters and comment.
803 (_bfd_elf_get_reloc_section): Delete.
804 (_bfd_elf_plt_get_reloc_section): Declare.
805 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
806 New functions. Don't blindly skip over assumed .rel/.rela prefix.
807 Extracted from..
808 (_bfd_elf_get_reloc_section): ..here. Delete.
809 (assign_section_numbers): Call elf_get_reloc_section.
810 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
811 * elfxx-target.h (elf_backend_get_reloc_section): Update.
812
813 2017-04-23 Alan Modra <amodra@gmail.com>
814
815 PR 21409
816 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
817 no symbols.
818
819 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
820
821 PR ld/21402
822 * elf32-i386.c (elf_i386_link_hash_entry): Add
823 no_finish_dynamic_symbol.
824 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
825 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
826 symbol, don't make it dynamic in PIE.
827 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
828 set no_finish_dynamic_symbol and generate R_386_RELATIVE
829 relocation for R_386_GOT32
830 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
831 isn't 0.
832
833 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
834
835 PR ld/19617
836 PR ld/21086
837 * elflink.c (elf_link_add_object_symbols): Require
838 --no-dynamic-linker with -E/--dynamic-list when creating
839 dynamic sections.
840
841 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
842
843 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
844 if forced local.
845
846 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
847
848 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
849 dynamic symbol sorting.
850
851 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
852
853 PR ld/21382
854 * elflink.c (elf_link_add_object_symbols): Preserve
855 dynamic_ref_after_ir_def when restoring the symbol table for
856 unneeded dynamic object.
857
858 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
859
860 PR ld/21401
861 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
862 on on undefined IFUNC symbol in the second PLT.
863
864 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
865
866 * peXXigen.c (pe_print_reloc): Correct chunk_end.
867
868 2017-04-19 Alan Modra <amodra@gmail.com>
869
870 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
871 or make dynamic for info->dynamic_undefined_weak 0 and 1.
872 * elf32-ppc.c:Formatting.
873 (ensure_undefweak_dynamic): Don't make dynamic when
874 info->dynamic_undefined_weak is zero.
875 (allocate_dynrelocs): Discard undefweak dyn_relocs for
876 info->dynamic_undefined_weak. Discard undef dyn_relocs when
877 not default visibility. Discard undef and undefweak
878 dyn_relocs earlier.
879 (ppc_elf_relocate_section): Adjust to suit.
880 * elf64-ppc.c: Formatting.
881 (ensure_undefweak_dynamic): Don't make dynamic when
882 info->dynamic_undefined_weak is zero.
883 (allocate_dynrelocs): Discard undefweak dyn_relocs for
884 info->dynamic_undefined_weak. Discard them earlier.
885
886 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
887
888 PR ld/21389
889 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
890 before generating the version definition section.
891
892 2017-04-17 Alan Modra <amodra@gmail.com>
893
894 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
895 state when a regular object file defines a symbol with
896 incompatible type to that defined by an earlier shared lib.
897
898 2017-04-13 Alan Modra <amodra@gmail.com>
899
900 * coffcode.h: Wrap some overly long _bfd_error_handler args.
901 * elf.c: Likewise.
902 * elf32-arm.c: Likewise.
903 * elf32-i386.c: Likewise.
904 * elf32-mep.c: Likewise.
905 * elf64-ia64-vms.c: Likewise.
906 * elf64-x86-64.c: Likewise.
907 * elflink.c: Likewise.
908 * elfnn-ia64.c: Likewise.
909 * elfxx-mips.c: Likewise.
910
911 2017-04-13 Alan Modra <amodra@gmail.com>
912
913 * aoutx.h: Use %B and %A in error messages throughout file.
914 * aout-cris.c: Likewise.
915 * archive.c: Likewise.
916 * binary.c: Likewise.
917 * coff-rs6000.c: Likewise.
918 * coff-tic4x.c: Likewise.
919 * coffcode.h: Likewise.
920 * coffgen.c: Likewise.
921 * cofflink.c: Likewise.
922 * coffswap.h: Likewise.
923 * cpu-arm.c: Likewise.
924 * elf-eh-frame.c: Likewise.
925 * elf-m10300.c: Likewise.
926 * elf.c: Likewise.
927 * elf32-arc.c: Likewise.
928 * elf32-arm.c: Likewise.
929 * elf32-bfin.c: Likewise.
930 * elf32-frv.c: Likewise.
931 * elf32-iq2000.c: Likewise.
932 * elf32-m32c.c: Likewise.
933 * elf32-microblaze.c: Likewise.
934 * elf32-nds32.c: Likewise.
935 * elf32-rl78.c: Likewise.
936 * elf32-rx.c: Likewise.
937 * elf32-score.c: Likewise.
938 * elf32-score7.c: Likewise.
939 * elf32-sh64.c: Likewise.
940 * elf32-v850.c: Likewise.
941 * elf32-vax.c: Likewise.
942 * elf32-visium.c: Likewise.
943 * elf64-ia64-vms.c: Likewise.
944 * elf64-mmix.c: Likewise.
945 * elf64-sh64.c: Likewise.
946 * elfcode.h: Likewise.
947 * elfnn-aarch64.c: Likewise.
948 * elfnn-ia64.c: Likewise.
949 * elfxx-mips.c: Likewise.
950 * hpux-core.c: Likewise.
951 * ieee.c: Likewise.
952 * ihex.c: Likewise.
953 * linker.c: Likewise.
954 * merge.c: Likewise.
955 * mmo.c: Likewise.
956 * oasys.c: Likewise.
957 * pdp11.c: Likewise.
958 * peXXigen.c: Likewise.
959 * rs6000-core.c: Likewise.
960 * vms-alpha.c: Likewise.
961 * xcofflink.c: Likewise.
962
963 2017-04-13 Alan Modra <amodra@gmail.com>
964
965 * bfd.c (PRINT_TYPE): Define.
966 (_doprnt): New function.
967 (error_handler_internal): Use _doprnt.
968 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
969 calls in their natural order, throughout file.
970 * coff-mcore.c: Likewise.
971 * coff-ppc.c: Likewise.
972 * coff-tic80.c: Likewise.
973 * cofflink.c: Likewise.
974 * elf-s390-common.c: Likewise.
975 * elf.c: Likewise.
976 * elf32-arm.c: Likewise.
977 * elf32-i386.c: Likewise.
978 * elf32-m32r.c: Likewise.
979 * elf32-msp430.c: Likewise.
980 * elf32-spu.c: Likewise.
981 * elf64-ia64-vms.c: Likewise.
982 * elf64-sparc.c: Likewise.
983 * elf64-x86-64.c: Likewise.
984 * elflink.c: Likewise.
985 * elfnn-aarch64.c: Likewise.
986 * elfnn-ia64.c: Likewise.
987 * elfxx-mips.c: Likewise.
988
989 2017-04-13 Alan Modra <amodra@gmail.com>
990
991 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
992 branch veneers" error. Fix double space and format message.
993 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
994 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
995
996 2017-04-13 Alan Modra <amodra@gmail.com>
997
998 * bfd-in2.h: Regenerate.
999
1000 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1001
1002 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
1003 extra `\n' in warning/error messages.
1004 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
1005 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1006
1007 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1008
1009 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
1010 processor-specific properties with generic ELF target vector.
1011
1012 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
1013
1014 * elf32-sparc.c (elf_backend_fixup_symbol): New.
1015 * elf64-sparc.c (elf_backend_fixup_symbol): New.
1016 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
1017 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
1018 has_non_got_reloc.
1019 (link_hash_newfunc): Initialize has_got_reloc and
1020 has_non_got_reloc.
1021 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
1022 section.
1023 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
1024 has_non_got_reloc.
1025 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
1026 has_non_got_reloc.
1027 (_bfd_sparc_elf_fixup_symbol): New function.
1028 (allocate_dynrelocs): Don't allocate space for dynamic
1029 relocations and discard relocations against resolved undefined
1030 weak symbols in executable. Don't make resolved undefined weak
1031 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
1032 relocation against undefined weak symbols in PIE.
1033 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
1034 relocations against resolved undefined weak symbols in PIE
1035 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
1036 without ynamic PLT/GOT relocations for resolved undefined weak
1037 symbols.
1038 Don't generate dynamic relocation against resolved undefined
1039 weak symbol in executable.
1040 (pie_finish_undefweak_symbol): New function.
1041 (_bfd_sparc_elf_finish_dynamic_sections): Call
1042 pie_finish_undefweak_symbol on all symbols in PIE.
1043 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
1044 (_bfd_sparc_elf_fixup_symbol): New function.
1045
1046 2017-04-10 Nick Clifton <nickc@redhat.com>
1047
1048 * config.bfd: Remove ns32k from obsolete list.
1049
1050 2017-04-10 Alan Modra <amodra@gmail.com>
1051
1052 PR 21287
1053 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
1054 (special_sections_i): Likewise for .init_array.
1055 (special_sections_p): Likewise for .preinit_array.
1056
1057 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
1058
1059 PR ld/19579
1060 PR ld/21306
1061 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
1062 ELF_COMMON_DEF_P for common symbols.
1063 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1064 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1065 * elflink.c (_bfd_elf_merge_symbol): Revert commits
1066 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
1067 07492f668d2173da7a2bda3707ff0985e0f460b6.
1068
1069 2017-04-07 Pedro Alves <palves@redhat.com>
1070
1071 * opncls.c (bfd_get_debug_link_info): Rename to...
1072 (bfd_get_debug_link_info_1): ... this. Change type of second
1073 parameter to void pointer. Adjust.
1074 (bfd_get_debug_link_info): Reimplement on top of
1075 bfd_get_debug_link_info_1.
1076 (separate_debug_file_exists, separate_alt_debug_file_exists):
1077 Change type of second parameter to void pointer. Adjust.
1078 (get_func_type, check_func_type): Change type of second parameter
1079 to void pointer.
1080 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
1081 the callback functions instead of passing the address of a local.
1082 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
1083 find_separate_debug_file.
1084 (get_alt_debug_link_info_shim): Change type of second parameter to
1085 void pointer. Adjust.
1086 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
1087 find_separate_debug_file.
1088 (get_build_id_name, bfd_boolean check_build_id_file): Change type
1089 of second parameter to void pointer. Adjust.
1090 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
1091 pointer local to find_separate_debug_file.
1092
1093 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1094
1095 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
1096 external symbols with a definition.
1097 (_bfd_coff_gc_mark_extra_sections): Fix typo.
1098
1099 2017-04-07 Alan Modra <amodra@gmail.com>
1100
1101 * po/SRC-POTFILES.in: Regenerate.
1102
1103 2017-04-05 Alan Modra <amodra@gmail.com>
1104
1105 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
1106 reference counting.
1107
1108 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
1109
1110 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
1111 numbers for DataDirectory entry indicies passed to
1112 add_data_entry().
1113
1114 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
1115
1116 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
1117 each GNU_MBIND section and align GNU_MBIND section to page size.
1118 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
1119 segment for each GNU_MBIND section.
1120 (_bfd_elf_init_private_section_data): Copy sh_info from input
1121 for GNU_MBIND section.
1122
1123 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
1124
1125 * elfnn-riscv.c (GP_NAME): Delete.
1126 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
1127 (_bfd_riscv_relax_lui): Likewise.
1128
1129 2017-04-04 Nick Clifton <nickc@redhat.com>
1130
1131 PR binutils/21342
1132 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
1133 dereference.
1134 (bfd_elf_final_link): Only initialize the extended symbol index
1135 section if there are extended symbol tables to list.
1136
1137 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
1138
1139 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
1140 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
1141 * configure.ac (elf): Add elf-properties.lo.
1142 * Makefile.in: Regenerated.
1143 * configure: Likewise.
1144 * elf-bfd.h (elf_property_kind): New.
1145 (elf_property): Likewise.
1146 (elf_property_list): Likewise.
1147 (elf_properties): Likewise.
1148 (_bfd_elf_parse_gnu_properties): Likewise.
1149 (_bfd_elf_get_property): Likewise.
1150 (_bfd_elf_link_setup_gnu_properties): Likewise.
1151 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
1152 and setup_gnu_properties.
1153 (elf_obj_tdata): Add properties.
1154 * elf-properties.c: New file.
1155 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
1156 (elf_i386_merge_gnu_properties): Likewise.
1157 (elf_backend_parse_gnu_properties): Likewise.
1158 (elf_backend_merge_gnu_properties): Likewise.
1159 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1160 (elf_x86_64_merge_gnu_properties): Likewise.
1161 (elf_backend_parse_gnu_properties): Likewise.
1162 (elf_backend_merge_gnu_properties): Likewise.
1163 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
1164 (elf_backend_parse_gnu_properties): Likewise.
1165 (elf_backend_setup_gnu_properties): Likewise.
1166 (elfNN_bed): Add elf_backend_parse_gnu_properties,
1167 elf_backend_merge_gnu_properties and
1168 elf_backend_setup_gnu_properties.
1169
1170 2017-03-30 Pip Cet <pipcet@gmail.com>
1171
1172 * elf32-wasm32.c: Add relocation code, two relocs.
1173 * reloc.c: Add wasm32 relocations.
1174 * libbfd.h: Regenerate.
1175 * bfd-in2.h: Regenerate.
1176 * bfd/po/bfd.pot: Regenerate.
1177
1178 2017-03-29 Nick Clifton <nickc@redhat.com>
1179
1180 PR binutils/18025
1181 * coff-bfd.h (struct coff_section_data): Add new fields:
1182 saved_bias and bias.
1183 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
1184 computed for PE binaries.
1185 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
1186 missing abbrev.
1187
1188 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
1189
1190 PR ld/16044
1191 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
1192 to handle a local symbol with a hash-symbol-entry; without PLT.
1193 Add BFD_ASSERT for an incidental case with GOT entry present.
1194 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
1195 isn't forced-or-set local.
1196
1197 2017-03-27 Pip Cet <pipcet@gmail.com>
1198
1199 * wasm-module.c: New file to support WebAssembly modules.
1200 * wasm-module.h: New file to support WebAssembly modules.
1201 * doc/webassembly.texi: Start documenting wasm-module.c.
1202 * config.bfd: Add wasm_vec.
1203 * targets.c: Likewise.
1204 * configure.ac: Likewise.
1205 * Makefile.am: Add entries for wasm-module.c.
1206 * Makefile.in: Regenerate.
1207 * configure: Regenerate.
1208 * po/SRC-POTFILES.in: Regenerate.
1209
1210 2017-03-27 Pip Cet <pipcet@gmail.com>
1211
1212 * cpu-wasm32.c: New file to support wasm32 architecture.
1213 * elf32-wasm32.c: New file to support wasm32 architecture.
1214 * Makefile.am: Add wasm32 architecture.
1215 * archures.c: Likewise.
1216 * config.bfd: Likewise.
1217 * configure.ac: Likewise.
1218 * targets.c: Likewise.
1219 * Makefile.in: Regenerate.
1220 * bfd-in2.h: Regenerate.
1221 * configure: Regenerate.
1222 * po/SRC-POTFILES.in: Regenerate.
1223
1224 2017-03-20 Alan Modra <amodra@gmail.com>
1225
1226 PR 21266
1227 * elf64-ppc.c (compare_symbols): Stabilize sort.
1228
1229 2017-03-18 Alan Modra <amodra@gmail.com>
1230
1231 * elf64-ppc.c (struct ppc_link_hash_table): Add
1232 local_ifunc_resolver and maybe_local_ifunc_resolver.
1233 (ppc_build_one_stub): Set flags on emitting dynamic
1234 relocation to ifunc.
1235 (ppc64_elf_relocate_section): Likewise.
1236 (ppc64_elf_finish_dynamic_symbol): Likewise.
1237 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
1238 local dynamic relocs to ifuncs.
1239 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
1240 local_ifunc_resolver and maybe_local_ifunc_resolver.
1241 (ppc_elf_relocate_section): Set flag on emitting dynamic
1242 relocation to ifuncs.
1243 (ppc_elf_finish_dynamic_symbol): Likewise.
1244 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
1245 dynamic relocs to ifuncs.
1246
1247 2017-03-13 Nick Clifton <nickc@redhat.com>
1248
1249 PR binutils/21202
1250 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
1251 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
1252 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
1253 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
1254 * bfd-in2.h: Regenerate.
1255 * libbfd.h: Regenerate.
1256 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
1257 names.
1258 (IS_AARCH64_TLSDESC_RELOC): Likewise.
1259 (elfNN_aarch64_howto_table): Likewise.
1260 (aarch64_tls_transition_without_check): Likewise.
1261 (aarch64_reloc_got_type): Likewise.
1262 (elfNN_aarch64_final_link_relocate): Likewise.
1263 (elfNN_aarch64_tls_relax): Likewise.
1264 (elfNN_aarch64_relocate_section): Likewise.
1265 (elfNN_aarch64_gc_sweep_hook): Likewise.
1266 (elfNN_aarch64_check_relocs): Likewise.
1267 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1268 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1269
1270 2017-03-11 Alan Modra <amodra@gmail.com>
1271
1272 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
1273 parameter is in fact used. Whitespace fixes.
1274 * elf64-ppc.c: Likewise.
1275
1276 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
1277
1278 * rs6000-core.c (CORE_NEW): Simplify macro when
1279 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
1280
1281 2017-03-07 Alan Modra <amodra@gmail.com>
1282
1283 PR 21224
1284 PR 20519
1285 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
1286 dyn_relocs check.
1287
1288 2017-03-05 Alan Modra <amodra@gmail.com>
1289
1290 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
1291 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
1292 (next_cie_fde_offset): New function.
1293 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
1294 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
1295 four bytes. Align CIEs to four or eight bytes depending on
1296 per_encoding_aligned8. Align FDEs according to their encoding.
1297 Pad last FDE to output section alignment.
1298 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
1299 assertion.
1300 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
1301 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
1302 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
1303
1304 2017-03-02 Martin Bickel <binutils@ineranves.de>
1305
1306 PR ld/21212
1307 * elf.c (rewrite_elf_program_header): Do not issue a warning for
1308 empty segments which have a zero filesz, but a non-zero memsz.
1309
1310 2017-03-02 Alan Modra <amodra@gmail.com>
1311
1312 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
1313
1314 2017-02-28 Alan Modra <amodra@gmail.com>
1315
1316 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
1317 (ppc64_elf_relocate_section): Likewise.
1318
1319 2017-02-28 Alan Modra <amodra@gmail.com>
1320
1321 PR 20995
1322 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
1323 rather than elf32_nios2_hash_table or elf_hash_table.
1324 (create_got_section): Likewise.
1325 (nios2_elf32_finish_dynamic_symbol): Likewise.
1326 (nios2_elf32_adjust_dynamic_symbol): Likewise.
1327 (nios2_elf32_size_dynamic_sections): Likewise.
1328 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
1329 vars. Use htab equivalents directly instead. Don't create
1330 all dynamic sections on needing just the GOT. Use a goto
1331 rather than a fall-through with reloc test. Ensure
1332 htab->dynobj is set when making dynamic sreloc section.
1333 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
1334 equivalent directly instead. Don't segfault on looking for
1335 .dynamic when dynamic sections have not been created. Don't
1336 segfault on .got.plt being discarded.
1337 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
1338 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
1339 fixme and another not so relevant comment.
1340 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
1341 already set, set hash table dynobj on creating .sbss.
1342
1343 2017-02-28 Alan Modra <amodra@gmail.com>
1344
1345 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
1346 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
1347 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
1348 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
1349 (ppc64_elf_relocate_section): Likewise.
1350 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
1351 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
1352 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
1353 * libbfd.h: Regenerate.
1354 * bfd-in2.h: Regenerate.
1355
1356 2017-02-28 Alan Modra <amodra@gmail.com>
1357
1358 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
1359 dynamic .data.rel.ro read-only.
1360 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
1361 rather than section flags when deciding where copy reloc goes.
1362 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
1363 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
1364 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
1365 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
1366 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
1367 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
1368 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
1369 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
1370 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1371 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
1372 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
1373 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
1374 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1375 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1376 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
1377 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
1378 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1379 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1380 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
1381
1382 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
1383
1384 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
1385 `jalr $0, $25' instruction encoding.
1386
1387 2017-02-27 Nick Clifton <nickc@redhat.com>
1388
1389 PR ld/21180
1390 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
1391 generating a seg-fault when encountering a symbol that has been
1392 deleted by garbage collection.
1393
1394 2017-02-25 Alan Modra <amodra@gmail.com>
1395
1396 * elf32-arc.c (struct dynamic_sections): Delete.
1397 (enum dyn_section_types): Delete.
1398 (dyn_section_names): Delete.
1399 (arc_create_dynamic_sections): Delete.
1400 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
1401 segfault on discarded .rela.plt section.
1402 (elf_arc_size_dynamic_sections): Formatting. Don't call
1403 arc_create_dynamic_sections. Don't allocate memory for sections
1404 handled by the generic linker. Correct code finding relocs in
1405 read-only sections. Set SEC_EXCLUDE on zero size .got,
1406 .got.plt, and .dynbss sections. Do set .interp for pies.
1407
1408 2017-02-24 Andrew Waterman <andrew@sifive.com>
1409
1410 * elfnn-riscv.c (GP_NAME): New macro.
1411 (riscv_global_pointer_value): Use it.
1412 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
1413 output section, consider only that section's alignment.
1414
1415 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1416
1417 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
1418 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
1419 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
1420 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
1421
1422 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1423
1424 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
1425 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
1426 or misaligned.
1427
1428 2017-02-23 Alan Modra <amodra@gmail.com>
1429
1430 PR 20744
1431 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
1432 16D relocations.
1433 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
1434 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
1435 relocs.
1436
1437 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
1438
1439 PR ld/20828
1440 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
1441 processing ahead of the call to `elf_gc_sweep_symbol'.
1442
1443 2017-02-22 Nick Clifton <nickc@redhat.com>
1444
1445 PR binutils/21193
1446 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
1447 created section 4-byte alignment.
1448
1449 2017-02-22 Alan Modra <amodra@gmail.com>
1450
1451 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
1452 on .got or .plt output section being discarded by script.
1453 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
1454 vxworks splt temp.
1455
1456 2017-02-21 Alan Modra <amodra@gmail.com>
1457
1458 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
1459 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
1460
1461 2017-02-20 Alan Modra <amodra@gmail.com>
1462
1463 PR 21181
1464 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
1465 if DT_RELSZ/DT_RELASZ is zero.
1466
1467 2017-02-17 Nick Clifton <nickc@redhat.com>
1468
1469 * compress.c (bfd_get_full_section_contents): Remember to reduce
1470 compressed size by the sizeof the compression header when
1471 decompressing the contents.
1472
1473 2017-02-17 Pedro Alves <palves@redhat.com>
1474
1475 * srec.c (Chunk): Rename to ...
1476 (_bfd_srec_len): ... this.
1477 (S3Forced): Rename to ...
1478 (_bfd_srec_forceS3): ... this.
1479 * objcopy.c: Adjust all references.
1480
1481 2017-02-17 Pedro Alves <palves@redhat.com>
1482
1483 * archive.c (bsd_write_armap): Rename to ...
1484 (_bfd_bsd_write_armap): ... this.
1485 (coff_write_armap): Rename to ...
1486 (_bfd_coff_write_armap): ... this.
1487 * libbfd-in.h (bsd_write_armap): Rename to ...
1488 (_bfd_bsd_write_armap): ... this.
1489 (coff_write_armap): Rename to ...
1490 (_bfd_coff_write_armap): ... this.
1491 * aout-target.h, aout-tic30.c: Adjust all users.
1492 * libbfd.h: Regenerate.
1493
1494 2017-02-17 Pedro Alves <palves@redhat.com>
1495
1496 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
1497 (warn_deprecated): Rename to ...
1498 (_bfd_warn_deprecated): ... this.
1499 * libbfd.c (warn_deprecated): Rename to ...
1500 (_bfd_warn_deprecated): ... this.
1501 * bfd-in2.h: Regenerate.
1502
1503 2017-02-17 Pedro Alves <palves@redhat.com>
1504
1505 * bfdio.c (real_ftell): Rename to ...
1506 (_bfd_real_ftell): ... this.
1507 (real_fseek): Rename to ...
1508 (_bfd_real_fseek): ... this.
1509 (real_fopen): Rename to ...
1510 (_bfd_real_fopen): ... this.
1511 * libbfd-in.h (real_ftell): Rename to ...
1512 (_bfd_real_ftell): ... this.
1513 (real_fseek): Rename to ...
1514 (_bfd_real_fseek): ... this.
1515 (real_fopen): Rename to ...
1516 (_bfd_real_fopen): ... this.
1517 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
1518 * libbfd.h: Regenerate.
1519
1520 2017-02-17 Pedro Alves <palves@redhat.com>
1521
1522 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
1523 * libbfd.c (read_unsigned_leb128): Rename to ...
1524 (_bfd_read_unsigned_leb128): ... this.
1525 (read_signed_leb128): Rename to ...
1526 (_bfd_read_signed_leb128): ... this.
1527 (safe_read_leb128): Rename to ...
1528 (_bfd_safe_read_leb128): ... this.
1529 * libbfd-in.h (read_unsigned_leb128): Rename to ...
1530 (_bfd_read_unsigned_leb128): ... this.
1531 (read_signed_leb128): Rename to ...
1532 (_bfd_read_signed_leb128): ... this.
1533 (safe_read_leb128): Rename to ...
1534 (_bfd_safe_read_leb128): ... this.
1535 * libbfd.h: Renegerate.
1536
1537 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1538
1539 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
1540 before trying to fine matching file and line information.
1541
1542 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1543
1544 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
1545 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
1546 not match current bfd, then reload debug information. Record bfd
1547 we're loading debug info for in the stash. If we have debug
1548 informatin in the cache then perform section placement before
1549 returning.
1550
1551 2017-02-16 Alan Modra <amodra@gmail.com>
1552
1553 PR 21000
1554 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
1555 * elfxx-target.h (elf_backend_no_page_alias): Define.
1556 (elfNN_bed): Init new field.
1557 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
1558 ensure PT_LOAD segment starts on a new page.
1559 * elf32-hppa.c (elf_backend_no_page_alias): Define.
1560
1561 2017-02-16 Alan Modra <amodra@gmail.com>
1562
1563 PR 21132
1564 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
1565 if pic.
1566
1567 2017-02-16 Jiong Wang <jiong.wang@arm.com>
1568
1569 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
1570 * bfd-in2.h: Regenerated.
1571
1572 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1573
1574 PR ld/21168
1575 * elf32-i386.c (elf_i386_relocate_section): Allow
1576 "lea foo@GOT, %reg" in PIC.
1577
1578 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1579
1580 PR ld/20244
1581 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
1582 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
1583 error against local IFUNC symbol without a base register for
1584 PIC.
1585
1586 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
1587
1588 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
1589 `%P: %H:' with `info->callbacks->einfo'.
1590 (ppc_elf_relocate_section): Likewise.
1591 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1592 (ppc64_elf_edit_toc): Likewise.
1593 (ppc64_elf_relocate_section): Likewise.
1594
1595 2017-02-14 Alan Modra <amodra@gmail.com>
1596
1597 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
1598 --gc-keep-exported, and test versioned field of sym rather than
1599 looking for @ in name.
1600
1601 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
1602
1603 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
1604 __global_pointer$.
1605
1606 2017-02-13 Nick Clifton <nickc@redhat.com>
1607
1608 PR binutils/21151
1609 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
1610 unit length field.
1611
1612 2017-02-07 Andrew Waterman <andrew@sifive.com>
1613
1614 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
1615 entry size if PLT header is written.
1616
1617 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
1618
1619 Fix sparc64 dynamic relocation processing to use the dynamic
1620 symbol count.
1621 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
1622 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
1623 should be used.
1624
1625 2017-02-03 Nick Clifton <nickc@redhat.com>
1626
1627 PR 21096
1628 * coffcode.h (coff_write_object_contents): Enlarge size of
1629 s_name_buf in order to avoid compile time warning about possible
1630 integer truncation.
1631 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
1632 32-bits of insn value before printing into buffer.
1633
1634 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1635
1636 * elfxx-mips.c (mips_elf_hash_sort_data): Add
1637 `max_local_dynindx'.
1638 (mips_elf_sort_hash_table): Handle it.
1639 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
1640 symbols bump up `max_local_dynindx' rather than
1641 `max_non_got_dynindx'.
1642
1643 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1644
1645 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
1646 `min_got_dynindx', `max_unref_got_dynindx' and
1647 `max_non_got_dynindx' members to the `bfd_size_type' data type.
1648 (mips_elf_sort_hash_table): Adjust accordingly.
1649
1650 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1651
1652 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
1653 to access the hash table.
1654
1655 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1656
1657 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
1658 non-NULL `htab' to the beginning.
1659
1660 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1661
1662 * elflink.c (elf_gc_sweep): Wrap overlong line.
1663
1664 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
1665
1666 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
1667 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
1668 * elfxx-mips.c (mips_elf_link_hash_table): Add
1669 `ignore_branch_isa' member.
1670 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
1671 in branch relocation calculation as an error if
1672 `ignore_branch_isa' has been set.
1673 (_bfd_mips_elf_insn32): Rename to...
1674 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
1675 parameter to `insn32' and add an `ignore_branch_isa' parameter.
1676 Handle the new parameter.
1677
1678 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
1679
1680 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
1681 local variable dynobj.
1682
1683 PR ld/20995
1684 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
1685 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
1686 executable from read-only sections into sdynrelro.
1687 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
1688 dynamic relocs in sdynrelro.
1689 (elf_backend_want_dynrelro): Define.
1690
1691 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
1692
1693 * config.bfd (*-*-rtemsaout*): Mark as removed.
1694
1695 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
1696
1697 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
1698 (arm-*-rtems*): Move to (arm*-*-eabi*).
1699 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
1700 (m68-*-rtems*): Move to (m68*-*-elf*).
1701
1702 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
1703
1704 * config.bfd (*-*-rtemscoff*): Mark as removed.
1705
1706 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
1707
1708 PR ld/20828
1709 * elflink.c (bfd_elf_record_link_assignment): Revert last
1710 change and don't ever clear `forced_local'. Set `mark'
1711 unconditionally.
1712 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
1713 file.
1714 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
1715 (bfd_elf_size_dynamic_sections): ... here.
1716 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
1717 and set `mark' instead in `__tls_get_addr_opt' processing.
1718 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
1719
1720 2017-01-24 Alan Modra <amodra@gmail.com>
1721
1722 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
1723 where dynamic relocs are preferable. Allow ifunc too.
1724 (ensure_undefweak_dynamic): New function.
1725 (allocate_dynrelocs): Use it here. Move plt handling last and
1726 don't make symbols dynamic, simplifying loop. Only make undef
1727 weak symbols with GOT entries dynamic. Correct condition
1728 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
1729 comments. Remove goto.
1730 (ppc_elf_relocate_section): Correct test for using dynamic
1731 symbol on GOT relocs. Rearrange test for emitting GOT relocs
1732 to suit. Set up explicit tls_index entries and implicit GOT
1733 tls_index entries resolvable at link time for
1734 __tls_get_addr_opt. Simplify test to clear mem for prelink.
1735 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
1736 (ensure_undefweak_dynamic): New function.
1737 (allocate_dynrelocs): Use it here. Only make undef weak symbols
1738 with GOT entries dynamic. Remove unnecessary test of
1739 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
1740 (ppc64_elf_relocate_section): Correct test for using dynamic
1741 symbol on GOT relocs. Rearrange test for emitting GOT relocs
1742 to suit. Set up explicit tls_index entries and implicit GOT
1743 tls_index entries resolvable at link time for __tls_get_addr_opt.
1744 Simplify expression to clear mem for prelink.
1745
1746 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
1747
1748 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
1749
1750 2017-01-20 Jiong Wang <jiong.wang@arm.com>
1751
1752 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
1753 (elf_backend_hash_symbol): Define.
1754
1755 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
1756
1757 PR ld/20828
1758 * elflink.c (bfd_elf_record_link_assignment): Clear any
1759 `forced_local' marking for DSO symbols that are not being
1760 provided.
1761
1762 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1763
1764 * elfnn-riscv.c (riscv_elf_object_p): New function.
1765
1766 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
1767
1768 PR ld/21038
1769 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
1770 plt_bnd_eh_frame.
1771 (elf_x86_64_check_relocs): Create .eh_frame section for the
1772 .plt.bnd section.
1773 (elf_x86_64_size_dynamic_sections): Allocate and initialize
1774 .eh_frame section for the .plt.bnd section.
1775 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
1776 for the .plt.bnd section.
1777
1778 2017-01-12 Nick Clifton <nickc@redhat.com>
1779
1780 PR binutils/20876
1781 * opncls.c (find_separate_debug_file): Add include_dirs
1782 parameter. Only include the directory part of the bfd's filename
1783 in search paths if include_dirs is true. Add a couple of extra
1784 locations for looking for debug files.
1785 ( bfd_follow_gnu_debuglink): Update invocation of
1786 find_separate_debug_file.
1787 (bfd_follow_gnu_debugaltlink): Likewise.
1788 (get_build_id): New function: Finds the build-id of the given bfd.
1789 (get_build_id_name): New function: Computes the name of the
1790 separate debug info file for a bfd, based upon its build-id.
1791 (check_build_id_file): New function: Checks to see if a separate
1792 debug info file exists at the given location, and that its
1793 build-id matches that of the original bfd.
1794 (bfd_follow_build_id_debuglink): New function: Finds a separate
1795 debug info file for a given bfd by using the build-id method.
1796 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
1797 method of locating a separate debug info file before using the
1798 debuglink method.
1799 * bfd-in2.h: Regenerate.
1800
1801 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
1802
1803 PR ld/21038
1804 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
1805 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
1806 elf_x86_64_eh_frame_plt_got.
1807 (elf_x86_64_size_dynamic_sections): Get unwind info from
1808 elf_x86_64_bnd_arch_bed for the BND PLT.
1809
1810 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
1811
1812 * config.bfd: Add entries for i686-redox and x86_64-redox.
1813
1814 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
1815
1816 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
1817 to 4 bytes.
1818 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
1819 .eh_frame section to 4 bytes for x32.
1820 (elf_x86_64_check_relocs): Likewise.
1821
1822 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
1823
1824 PR ld/20830
1825 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
1826 (PLT_GOT_FDE_LENGTH): Likewise.
1827 (elf_i386_plt_layout): Add eh_frame_plt_got and
1828 eh_frame_plt_got_size.
1829 (elf_i386_plt): Updated.
1830 (elf_i386_link_hash_table): Add plt_got_eh_frame.
1831 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
1832 (elf_i386_size_dynamic_sections): Allocate and initialize
1833 .eh_frame section for .plt.got.
1834 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
1835 .plt.got.
1836 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
1837 eh_frame_plt_got_size.
1838 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
1839 (PLT_GOT_FDE_LENGTH): Likewise.
1840 (elf_x86_64_backend_data): Add eh_frame_plt_got and
1841 eh_frame_plt_got_size.
1842 (elf_x86_64_arch_bed): Updated.
1843 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
1844 eh_frame_plt_got_size.
1845 (elf_x86_64_nacl_arch_bed): Likewise.
1846 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
1847 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
1848 (elf_x86_64_size_dynamic_sections): Allocate and initialize
1849 .eh_frame section for .plt.got.
1850 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
1851 for .plt.got.
1852
1853 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
1854
1855 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1856 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
1857
1858 2017-01-09 Nick Clifton <nickc@redhat.com>
1859
1860 * dwarf2.c (lookup_address_in_function_table): Return early if
1861 there are no functions in the given comp unit, or if the high
1862 address of the last function in the comp unit is less than the
1863 desired address.
1864
1865 2017-01-09 Nick Clifton <nickc@redhat.com>
1866
1867 PR binutils/21013
1868 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
1869 message if there are too many symbols to load.
1870
1871 2017-01-04 James Clarke <jrtc27@jrtc27.com>
1872
1873 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
1874 if relocs are cached.
1875
1876 2017-01-03 Rich Felker <bugdal@aerifal.cx>
1877
1878 PR ld/21017
1879 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
1880 for R_MICROBLAZE_GOTOFF_64.
1881
1882 2017-01-03 Nick Clifton <nickc@redhat.com>
1883
1884 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
1885 warning about using a possibly uninitialised variable.
1886
1887 2017-01-02 Alan Modra <amodra@gmail.com>
1888
1889 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
1890 (allocate_plt_static, allocate_dynrelocs): Use it.
1891
1892 2017-01-02 Alan Modra <amodra@gmail.com>
1893
1894 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
1895 .PARISC.unwind section.
1896
1897 2017-01-02 Alan Modra <amodra@gmail.com>
1898
1899 PR ld/20989
1900 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
1901 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
1902 indirect to GOT pointer relative code edit.
1903
1904 2017-01-02 Alan Modra <amodra@gmail.com>
1905
1906 Update year range in copyright notice of all files.
1907
1908 For older changes see ChangeLog-2016
1909 \f
1910 Copyright (C) 2017 Free Software Foundation, Inc.
1911
1912 Copying and distribution of this file, with or without modification,
1913 are permitted in any medium without royalty provided the copyright
1914 notice and this notice are preserved.
1915
1916 Local Variables:
1917 mode: change-log
1918 left-margin: 8
1919 fill-column: 74
1920 version-control: never
1921 End:
This page took 0.072782 seconds and 4 git commands to generate.