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