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