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