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