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