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