Fix address violation when parsing a corrupt IEEE binary.
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
c458d007
NC
12017-06-21 Nick Clifton <nickc@redhat.com>
2
3 PR binutils/21633
4 * ieee.c (ieee_slurp_sections): Check for a NULL return from
5 read_id.
6 (ieee_archive_p): Likewise.
7 (ieee_object_p): Likewise.
8
ce497010
NC
92017-06-21 Nick Clifton <nickc@redhat.com>
10
11 PR binutils/21640
12 * elf.c (setup_group): Zero the group section pointer list after
13 allocation so that loops can be caught. Check for NULL pointers
14 when processing a group list.
15
abfa390d
L
162017-06-19 H.J. Lu <hongjiu.lu@intel.com>
17
18 PR ld/21626
19 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
20 the DYNAMIC bit instead of bfd_count_sections.
21
bc21b167
NC
222017-06-19 Nick Clifton <nickc@redhat.com>
23
24 PR binutils/21618
25 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
26 length.
27 (evax_bfd_print_eeom): Likewise.
28 (evax_bfd_print_egsd): Check for an overlarge record length.
29 (evax_bfd_print_etir): Likewise.
30
acb56a83
NC
312017-06-19 Nick Clifton <nickc@redhat.com>
32
33 PR binutils/21612
34 * libieee.h (struct common_header_type): Add end_p field.
35 * ieee.c (this_byte_and_next): Do not advance input_p beyond
36 end_p.
37 (read_id): Check for a length that exceeds the remaining bytes in
38 the input buffer.
39 (ieee_seek): Initialise end_p.
40 (ieee_archive_p): Likewise.
41 (ieee_object_p): Likewise.
42
72e84f96
NC
432017-06-19 Nick Clifton <nickc@redhat.com>
44
80053e46
NC
45 PR binutils/21611
46 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
47 before reading the EIHS structure entries.
48
492017-06-19 Nick Clifton <nickc@redhat.com>
50
51 PR binutils/21615
72e84f96
NC
52 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
53 gsd_size. Check that there are enough bytes remaining to read the
54 type and size of the next egsd. Check that the size of the egsd
55 does not exceed the size of the record.
56
875ffa3e
AM
572017-06-19 Alan Modra <amodra@gmail.com>
58
59 * config.bfd: Correct targ_underscore for cris.
60
bdd32e03
AM
612017-06-18 Alan Modra <amodra@gmail.com>
62
63 * config.bfd: Correct targ_underscore for epiphany, ip2k,
64 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
65
4b48e2f6
NC
662017-06-16 Nick Clifton <nickc@redhat.com>
67
68 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
69 bucketlist is empty because there are no symbols to add to the
70 list.
71
7dba9362
AM
722017-06-16 Alan Modra <amodra@gmail.com>
73
74 PR ld/20022
75 PR ld/21557
76 PR ld/21562
77 PR ld/21571
78 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
79 (BFD_JUMP_TABLE_LINK): Likewise.
80 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
81 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
82 (bfd_elf_define_start_stop): New function.
83 * linker.c (bfd_generic_define_start_stop): New function.
84 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
85 new field.
86 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
87 * aout-target.h (MY_bfd_define_start_stop): Define.
88 * aout-tic30.c (MY_bfd_define_start_stop): Define.
89 * binary.c (binary_bfd_define_start_stop): Define.
90 * bout.c (b_out_bfd_define_start_stop): Define.
91 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
92 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
93 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
94 * coffcode.h (coff_bfd_define_start_stop): Define.
95 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
96 * i386msdos.c (msdos_bfd_define_start_stop): Define.
97 * i386os9k.c (os9k_bfd_define_start_stop): Define.
98 * ieee.c (ieee_bfd_define_start_stop): Define.
99 * ihex.c (ihex_bfd_define_start_stop): Define.
100 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
101 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
102 * mmo.c (mmo_bfd_define_start_stop): Define.
103 * nlm-target.h (nlm_bfd_define_start_stop): Define.
104 * oasys.c (oasys_bfd_define_start_stop): Define.
105 * pef.c (bfd_pef_bfd_define_start_stop): Define.
106 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
107 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
108 * som.c (som_bfd_define_start_stop): Define.
109 * srec.c (srec_bfd_define_start_stop): Define.
110 * tekhex.c (tekhex_bfd_define_start_stop): Define.
111 * versados.c (versados_bfd_define_start_stop): Define.
112 * vms-alpha.c (vms_bfd_define_start_stop): Define.
113 (alpha_vms_bfd_define_start_stop): Define.
114 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
115 * bfd-in2.h: Regenerate.
116 * libbfd.h: Regenerate.
117
d68f1976
JW
1182017-06-16 Jiong Wang <jiong.wang@arm.com>
119
120 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
121 SYMBOL_REFERENCES_LOCAL.
122
6353d82b
JW
1232017-06-15 Jiong Wang <jiong.wang@arm.com>
124
125 PR ld/21532
126 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
127 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
128 runtime for if there needs copy relocation elimination.
129 (need_copy_relocation_p): New function. Return true for symbol with
130 pc-relative references and if it's against read-only sections.
131 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
132 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
133 that are related with accessing external objects.
134 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
135 in elfNN_aarch64_check_relocs.
136
63634bb4
NC
1372017-06-15 Nick Clifton <nickc@redhat.com>
138
139 PR binutils/21582
140 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
141 bugs.
62b76e4b
NC
142 PR binutils/21581
143 (ieee_archive_p): Likewise.
63634bb4 144
76800cba
NC
1452017-06-15 Nick Clifton <nickc@redhat.com>
146
147 PR binutils/21579
148 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
149
f7e16c2a
MF
1502017-06-14 Max Filippov <jcmvbkbc@gmail.com>
151
152 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
153 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
154 keep both windowed and call0 ABI PLT definitions.
155 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
156 elf_xtensa_*_plt_entry endex.
157 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
158
f461bbd8
NC
1592017-06-14 Nick Clifton <nickc@redhat.com>
160
161 PR binutils/21578
162 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
163 flag value.
164
c53d2e6d
NC
1652017-06-14 Nick Clifton <nickc@redhat.com>
166
167 PR binutils/21589
168 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
169 maximum value for the ascic pointer. Check that name processing
170 does not read beyond this value.
171 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
172 end of etir record.
173
04f963fd
NC
1742017-06-14 Nick Clifton <nickc@redhat.com>
175
176 PR binutils/21591
177 * versados.c (versados_mkobject): Zero the allocated tdata structure.
178 (process_otr): Check for an invalid offset in the otr structure.
179
319c2dbe
SH
1802017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
181
182 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
183
cbd0eecf
L
1842017-06-13 H.J. Lu <hongjiu.lu@intel.com>
185
186 PR ld/20022
187 PR ld/21557
188 PR ld/21562
189 PR ld/21571
190 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
191 vtable field to a union.
192 (_bfd_elf_is_start_stop): Removed.
193 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
194 __start_SECNAME and __stop_SECNAME symbols.
195 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
196 * elflink.c (_bfd_elf_is_start_stop): Removed.
197 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
198 _bfd_elf_is_start_stop.
199 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
200 __stop_SECNAME symbols. Updated.
201 (elf_gc_smash_unused_vtentry_relocs): Likewise.
202 (bfd_elf_gc_record_vtinherit): Likewise.
203 (bfd_elf_gc_record_vtentry): Likewise.
204
10bbbc1d
NC
2052017-06-13 Nick Clifton <nickc@redhat.com>
206
207 PR ld/21524
208 * elflink.c (elf_link_adjust_relocs): Generate an error when
209 encountering a reloc against a symbol removed by garbage
210 collection.
211
5c3ce2bc
L
2122017-06-12 H.J. Lu <hongjiu.lu@intel.com>
213
214 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
215 to merge_gnu_properties.
216 * elf-properties.c (elf_merge_gnu_properties): Add struct
217 bfd_link_info * and pass it to merge_gnu_properties.
218 (elf_merge_gnu_property_list): Add struct bfd_link_info *
219 and pass it to elf_merge_gnu_properties.
220 (_bfd_elf_link_setup_gnu_properties): Pass info to
221 elf_merge_gnu_property_list.
222 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
223 bfd_link_info *.
224 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
225
9b97dfbf
AM
2262017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
227
228 PR 21564
229 * binary.c (binary_set_section_contents): Scale lma by octets
230 per byte to set filepos.
231
e3d1d408
CM
2322017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
233
234 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
235 dynamic sections.
236
64aa8e03
CM
2372017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
238
239 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
240 require TEXTREL.
241
a0abe743
CM
2422017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
243
244 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
245 patched section contents for TLS IE reloc.
246 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
247
f4e6805f
CM
2482017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
249
250 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
251 RELOC_FOR_GLOBAL_SYMBOL macro.
252
cd640291
CM
2532018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
254
255 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
256 changes.
257
7ef0acc1
VG
2582017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
259
260 * config/tc-arc.c (md_undefined_symbol): Changed.
261 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
262
cc89d0b3
CM
2632017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
264
265 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
266 symbols.
267
9d5c718b
CM
2682017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
269
270 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
271 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
272
be9e3704
CM
2732017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
274
275 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
276 object is created.
277
4ec192e6
RE
2782017-06-08 Richard Earnshaw <rearnsha@arm.com>
279
280 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
281 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
282 is non-zero. Add clarifying comments.
283
51fa2693
L
2842017-06-08 H.J. Lu <hongjiu.lu@intel.com>
285
286 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
287 name. Use local IFUNC symbol name string to report unsupported
288 non-PIC call to IFUNC function.
289 (elf_i386_relocate_section): Dump local IFUNC name with minfo
290 when generating R_386_IRELATIVE relocation.
291 (elf_i386_finish_dynamic_symbol): Likewise.
292 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
293 IFUNC symbol name.
294 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
295 when generating R_X86_64_IRELATIVE relocation.
296 (elf_x86_64_finish_dynamic_symbol): Likewise.
297
78e8a2ff
JM
2982017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
299
300 * elf.c (setup_group): Make sure BFD sections are created for all
301 group sections in the input file when processing SHF_GROUP
302 sections.
303 (bfd_section_from_shdr): Avoid duplicating logic already
304 implemented in `setup_group'.
305
9949827b
DBR
3062017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
307
308 PR binutils/21546
309 * peXXigen.c (pe_print_idata): Use the address of the first thunk
310 if the hint address is zero.
311
0ee3a6db
JC
3122017-06-06 James Clarke <jrtc27@jrtc27.com>
313
314 PR ld/19579
315 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
316 ELF_COMMON_DEF_P for common symbols.
317
7bdf4127
AB
3182017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
319
320 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
321 SEC_GROUP sections as SEC_EXCLUDE.
322 (bfd_elf_set_group_contents): Replace use of abort with an assert.
323 (assign_section_numbers): Use resolve_section_groups flag instead
324 of relocatable link type.
325 (_bfd_elf_init_private_section_data): Use resolve_section_groups
326 flag instead of checking the final_link flag for part of the
327 checks in here. Fix white space as a result.
328 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
329 instead of relocatable link type.
330 (bfd_elf_final_link): Likewise.
331
458ad2b8
JM
3322017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
333
334 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
335 variable `bed'.
336 * elf32-score.c (score_elf_final_link_relocate): Likewise.
337 (s3_bfd_score_elf_check_relocs): Likewise.
338 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
339 (score_elf_final_link_relocate): Likewise.
340 (s7_bfd_score_elf_check_relocs): Likewise.
341
fbebaf4a
JM
3422017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
343
344 * elflink.c (init_reloc_cookie_rels): Remove unused variable
345 `bed'.
346
056bafd4
MR
3472017-06-06 Maciej W. Rozycki <macro@imgtec.com>
348
349 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
350 from `reloc_count' rather than decrementing it.
351 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
352 `reloc_count' by `int_rels_per_ext_rel'.
353 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
354 `reloc_count' by `int_rels_per_ext_rel' for last relocation
355 entry determination.
356 (s3_bfd_score_elf_check_relocs): Likewise.
357 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
358 (s7_bfd_score_elf_relocate_section): Likewise.
359 (s7_bfd_score_elf_check_relocs): Likewise.
360 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
361 prototype and function.
362 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
363 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
364 triple rather than once the sum of REL and RELA relocation entry
365 counts.
366 (bfd_elf64_get_reloc_upper_bound): Remove macro.
367 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
368 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
369 storage allocation size determination.
370 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
371 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
372 by `int_rels_per_ext_rel' for last relocation entry
373 determination.
374 (bfd_elf_final_link): Do not multiply `reloc_count' by
375 `int_rels_per_ext_rel' for internal relocation storage
376 allocation size determination.
377 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
378 `int_rels_per_ext_rel' for last relocation entry determination.
379 (elf_gc_smash_unused_vtentry_relocs): Likewise.
380 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
381 (_bfd_mips_elf_relocate_section): Likewise.
382
af54f0eb
AM
3832017-06-05 Alan Modra <amodra@gmail.com>
384
385 PR 21529
386 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
387
6cf3bf88 3882017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
389
390 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
391 determine structure sizes.
392 (elfcore_grok_freebsd_prstatus): Likewise.
393
f378ab09
AM
3942017-06-01 Alan Modra <amodra@gmail.com>
395
396 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
397 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
398 dynamic objects.
399 (is_elfv2_localentry0): New function.
400 (ppc64_elf_tls_setup): Default params->plt_localentry0.
401 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
402 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
403 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
404 optimized localentry:0 stubs.
405 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
406 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
407 localentry:0 stubs.
408 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
409 DT_PPC64_OPT.
410 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
411
8c65b54f
CS
4122017-05-30 Casey Smith <clegg89@gmail.com>
413
414 PR ld/21523
415 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
416 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
417
64984c22
AK
4182017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
419
420 * cpu-arc.c (arc_compatible): New function.
421
37cd3877
AK
4222017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
423
424 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
425
8e2f54bc
L
4262017-05-30 H.J. Lu <hongjiu.lu@intel.com>
427
428 PR binutils/21519
429 * bfdio.c (bfd_get_file_size): New function.
430 * bfd-in2.h: Regenerated.
431
8e7f04f1 4322017-05-23 Dilian Palauzov <git-dpa@aegee.org>
433
434 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
435 comments.
436
25f94347
L
4372017-05-22 H.J. Lu <hongjiu.lu@intel.com>
438
439 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
440 dynobj instead of htab->elf.dynobj.
441
e5713223
MR
4422017-05-19 Maciej W. Rozycki <macro@imgtec.com>
443
444 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
445 and function.
446 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
447 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
448 actual number of internal relocations retrieved. Adjust
449 function description.
450 (bfd_elf64_canonicalize_reloc): Remove macro.
451 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
452
64517994
JM
4532017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
454
455 * archures.c (bfd_mach_sparc_v9m8): Define.
456 (bfd_mach_sparc_v8plusm8): Likewise.
457 (bfd_mach_sparc_v9_p): Adjust to M8.
458 (bfd_mach_sparc_64bit_p): Likewise.
459 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
460 bfd_mach_sparc_v8plusm8.
461 * bfd-in2.h: Regenerated.
462 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
463 sparc:v8plusm8.
464 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
465 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
466 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
467 SHA3.
468 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
469 bfd_mach_sparc_v8plusm8.
470
eb026f09
AM
4712017-05-19 Alan Modra <amodra@gmail.com>
472
473 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
474 debug and special sections when no non-note alloc sections in an
475 object are kept.
476
535b785f
AM
4772017-05-18 Alan Modra <amodra@gmail.com>
478
479 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
480 * elf-m10300.c: Likewise.
481 * elf.c: Likewise.
482 * elf32-arc.c: Likewise.
483 * elf32-bfin.c: Likewise.
484 * elf32-m68k.c: Likewise.
485 * elf32-nds32.c: Likewise.
486 * elf32-tilepro.c: Likewise.
487 * elflink.c: Likewise.
488 * elfnn-aarch64.c: Likewise.
489 * elfnn-riscv.c: Likewise.
490 * elfxx-tilegx.c: Likewise.
491 * mach-o.c: Likewise.
492 * peXXigen.c: Likewise.
493 * vms-alpha.c: Likewise.
494 * vms-lib.c: Likewise.
495
b7c871ed
L
4962017-05-17 H.J. Lu <hongjiu.lu@intel.com>
497
498 PR ld/20882
499 * elflink.c (elf_gc_mark_debug_section): New function.
500 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
501 referenced by kept debug sections.
502
bc4e12de
AM
5032017-05-16 Alan Modra <amodra@gmail.com>
504
505 * elf-m10300.c: Rename occurrences of non_ir_ref.
506 * elf32-arm.c: Likewise.
507 * elf32-bfin.c: Likewise.
508 * elf32-cr16.c: Likewise.
509 * elf32-cris.c: Likewise.
510 * elf32-d10v.c: Likewise.
511 * elf32-dlx.c: Likewise.
512 * elf32-fr30.c: Likewise.
513 * elf32-frv.c: Likewise.
514 * elf32-hppa.c: Likewise.
515 * elf32-i370.c: Likewise.
516 * elf32-i386.c: Likewise.
517 * elf32-iq2000.c: Likewise.
518 * elf32-lm32.c: Likewise.
519 * elf32-m32c.c: Likewise.
520 * elf32-m32r.c: Likewise.
521 * elf32-m68hc1x.c: Likewise.
522 * elf32-m68k.c: Likewise.
523 * elf32-mcore.c: Likewise.
524 * elf32-metag.c: Likewise.
525 * elf32-microblaze.c: Likewise.
526 * elf32-moxie.c: Likewise.
527 * elf32-msp430.c: Likewise.
528 * elf32-mt.c: Likewise.
529 * elf32-nios2.c: Likewise.
530 * elf32-or1k.c: Likewise.
531 * elf32-ppc.c: Likewise.
532 * elf32-rl78.c: Likewise.
533 * elf32-s390.c: Likewise.
534 * elf32-score.c: Likewise.
535 * elf32-score7.c: Likewise.
536 * elf32-sh.c: Likewise.
537 * elf32-tic6x.c: Likewise.
538 * elf32-tilepro.c: Likewise.
539 * elf32-v850.c: Likewise.
540 * elf32-vax.c: Likewise.
541 * elf32-xstormy16.c: Likewise.
542 * elf32-xtensa.c: Likewise.
543 * elf64-alpha.c: Likewise.
544 * elf64-hppa.c: Likewise.
545 * elf64-ia64-vms.c: Likewise.
546 * elf64-mmix.c: Likewise.
547 * elf64-ppc.c: Likewise.
548 * elf64-s390.c: Likewise.
549 * elf64-sh64.c: Likewise.
550 * elf64-x86-64.c: Likewise.
551 * elflink.c: Likewise.
552 * elfnn-aarch64.c: Likewise.
553 * elfnn-ia64.c: Likewise.
554 * elfnn-riscv.c: Likewise.
555 * elfxx-mips.c: Likewise.
556 * elfxx-sparc.c: Likewise.
557 * elfxx-tilegx.c: Likewise.
558 * linker.c: Likewise.
559
4070765b
AM
5602017-05-16 Alan Modra <amodra@gmail.com>
561
562 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
563 * elflink.c (elf_link_add_object_symbols): Update to use
564 non_ir_ref_dynamic.
565 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
566 non_ir_ref.
567 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
568
25499ac7
MR
5692017-05-15 Maciej W. Rozycki <macro@imgtec.com>
570
571 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
572
73caa85d
L
5732017-05-12 H.J. Lu <hongjiu.lu@intel.com>
574
575 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
576 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
577 properties.
578 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
579
f2c29a16
L
5802017-05-11 H.J. Lu <hongjiu.lu@intel.com>
581
582 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
583 to plt_second.
584 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
585 to plt_second/plt_second_eh_frame.
586 (elf_x86_64_link_hash_newfunc): Updated.
587 (elf_x86_64_allocate_dynrelocs): Likewise.
588 (elf_x86_64_size_dynamic_sections): Likewise.
589 (elf_x86_64_relocate_section): Likewise.
590 (elf_x86_64_finish_dynamic_symbol): Likewise.
591 (elf_x86_64_finish_dynamic_sections): Likewise.
592 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
593 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
594 .plt.sec section.
595 (elf_backend_setup_gnu_properties): Updated. Create the
596 .plt.sec section instead of the .plt.sec section.
597
dc2be3d2
L
5982017-05-11 H.J. Lu <hongjiu.lu@intel.com>
599
600 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
601 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
602 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
603
db84b98a
JM
6042017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
605
606 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
607 (bfd_elf64_set_reloc): Define.
608 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
609
23186865
JM
6102017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
611
612 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
613 (struct bfd_target): New field _bfd_set_reloc.
614 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
615 * reloc.c (_bfd_generic_set_reloc): New function.
616 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
617 * nlm-target.h (nlm_set_reloc): Likewise.
618 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
619 * aout-tic30.c (MY_set_reloc): Likewise.
620 * aout-target.h (MY_set_reloc): Likewise.
621 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
622 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
623 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
624 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
625 * aout-adobe.c (aout_32_set_reloc): Likewise.
626 * bout.c (b_out_set_reloc): Likewise.
627 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
628 * i386os9k.c (aout_32_set_reloc): Likewise.
629 * ieee.c (ieee_set_reloc): Likewise.
630 * oasys.c (oasys_set_reloc): Likewise.
631 * som.c (som_set_reloc): Likewise.
632 * versados.c (versados_set_reloc): Likewise.
633 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
634 _bfd_generic_set_reloc.
635 (rs6000_xcoff64_aix_vec): LIkewise.
636 * libbfd.c (_bfd_norelocs_set_reloc): New function.
637 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
638 * i386msdos.c (msdos_set_reloc): Define to
639 _bfd_norelocs_set_reloc.
640 * elfcode.h (elf_set_reloc): Define.
641 * bfd-in2.h: Regenerated.
642
aab82f4c
L
6432017-05-10 H.J. Lu <hongjiu.lu@intel.com>
644
645 PR ld/21481
646 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
647 for IFUNC function address.
648
53a346d8
CZ
6492017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
650
651 * elf32-arc.c (FEATURE_LIST_NAME): Define.
652 (CONFLICT_LIST): Likewise.
653 (opcode/arc-attrs.h): Include.
654 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
655 (arc_extract_features): New file.
656 (arc_stralloc): Likewise.
657 (arc_elf_merge_attributes): Likewise.
658 (arc_elf_merge_private_bfd_data): Use object attributes.
659 (bfd_arc_get_mach_from_attributes): New function.
660 (arc_elf_object_p): Use object attributes.
661 (arc_elf_final_write_processing): Likewise.
662 (elf32_arc_obj_attrs_arg_type): New function.
663 (elf32_arc_obj_attrs_handle_unknown): Likewise.
664 (elf32_arc_section_from_shdr): Likewise.
665 (elf_backend_obj_attrs_vendor): Define.
666 (elf_backend_obj_attrs_section): Likewise.
667 (elf_backend_obj_attrs_arg_type): Likewise.
668 (elf_backend_obj_attrs_section_type): Likewise.
669 (elf_backend_obj_attrs_handle_unknown): Likewise.
670 (elf_backend_section_from_shdr): Likewise.
671
e645cf40
AG
6722017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
673
674 PR ld/21458
675 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
676 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
677 and the destination is a Thumb symbol.
678
dd9e66ee
L
6792017-05-08 H.J. Lu <hongjiu.lu@intel.com>
680
681 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
682 initializer to silence GCC 4.2.
683 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
684
38b12349
L
6852017-05-08 H.J. Lu <hongjiu.lu@intel.com>
686
687 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
688 (LAZY_PLT_ENTRY_SIZE): This.
689 (NON_LAZY_PLT_ENTRY_SIZE): New.
690 (elf_x86_64_plt0_entry): Renamed to ...
691 (elf_x86_64_lazy_plt0_entry): This.
692 (elf_x86_64_plt_entry): Renamed to ...
693 (elf_x86_64_lazy_plt_entry): This.
694 (elf_x86_64_bnd_plt0_entry): Renamed to ...
695 (elf_x86_64_lazy_bnd_plt0_entry): This.
696 (elf_x86_64_legacy_plt_entry): Removed.
697 (elf_x86_64_bnd_plt_entry): Renamed to ...
698 (elf_x86_64_lazy_bnd_plt_entry): This.
699 (elf_x86_64_legacy_plt2_entry): Renamed to ...
700 (elf_x86_64_non_lazy_plt_entry): This.
701 (elf_x86_64_bnd_plt2_entry): Renamed to ...
702 (elf_x86_64_non_lazy_bnd_plt_entry): This.
703 (elf_x86_64_eh_frame_plt): Renamed to ...
704 (elf_x86_64_eh_frame_lazy_plt): This.
705 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
706 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
707 (elf_x86_64_eh_frame_plt_got): Renamed to ...
708 (elf_x86_64_eh_frame_non_lazy_plt): This.
709 (elf_x86_64_lazy_plt_layout): New.
710 (elf_x86_64_non_lazy_plt_layout): Likewise.
711 (elf_x86_64_plt_layout): Likewise.
712 (elf_x86_64_backend_data): Remove PLT layout information. Add
713 os for target system.
714 (GET_PLT_ENTRY_SIZE): Removed.
715 (elf_x86_64_lazy_plt): New.
716 (elf_x86_64_non_lazy_plt): Likewise.
717 (elf_x86_64_lazy_bnd_plt): Likewise.
718 (elf_x86_64_non_lazy_bnd_plt): Likewise.
719 (elf_x86-64_arch_bed): Updated.
720 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
721 (elf_x86_64_create_dynamic_sections): Removed.
722 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
723 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
724 (elf_x86-64_adjust_dynamic_symbol): Updated.
725 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
726 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
727 size for PLT0 if there is no PLT0. Get plt_entry_size from
728 non_lazy_plt for non-lazy PLT entries.
729 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
730 from non_lazy_plt for non-lazy PLT entries.
731 (elf_x86-64_relocate_section): Updated. Properly get PLT index
732 if there is no PLT0.
733 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
734 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
735 entries with non-lazy PLT layout. Don't fill the second and third
736 slots in the PLT entry if there is no PLT0.
737 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
738 if there is no PLT0. Set sh_entsize on the .plt.got section.
739 (compare_relocs): New.
740 (elf_x86_64_plt_type): Likewise.
741 (elf_x86_64_plt): Likewise.
742 (elf_x86_64_nacl_plt): New. Forward declaration.
743 (elf_x86_64_get_plt_sym_val): Removed.
744 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
745 against all dynamic relocations.
746 (elf_x86_64_link_setup_gnu_properties): New function.
747 (elf_backend_create_dynamic_sections): Updated.
748 (elf_backend_setup_gnu_properties): New.
749 (elf_x86_64_nacl_plt): New.
750 (elf_x86_64_nacl_arch_bed): Updated.
751
f604c2a2
L
7522017-05-08 H.J. Lu <hongjiu.lu@intel.com>
753
754 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
755 (LAZY_PLT_ENTRY_SIZE): This.
756 (NON_LAZY_PLT_ENTRY_SIZE): New.
757 (elf_i386_plt0_entry): Renamed to ...
758 (elf_i386_lazy_plt0_entry): This.
759 (elf_i386_plt_entry): Renamed to ...
760 (elf_i386_lazy_plt_entry): This.
761 (elf_i386_pic_plt0_entry): Renamed to ...
762 (elf_i386_pic_lazy_plt0_entry): This.
763 (elf_i386_pic_plt_entry): Renamed to ...
764 (elf_i386_pic_lazy_plt_entry): This.
765 (elf_i386_got_plt_entry): Renamed to ...
766 (elf_i386_non_lazy_plt_entry): This.
767 (elf_i386_pic_got_plt_entry): Renamed to ...
768 (elf_i386_pic_non_lazy_plt_entry): This.
769 (elf_i386_eh_frame_plt): Renamed to ...
770 (elf_i386_eh_frame_lazy_plt): This.
771 (elf_i386_eh_frame_plt_got): Renamed to ...
772 (elf_i386_eh_frame_non_lazy_plt): This.
773 (elf_i386_plt_layout): Renamed to ...
774 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
775 eh_frame_plt_got_size.
776 (elf_i386_non_lazy_plt_layout): New.
777 (elf_i386_plt_layout): Likewise.
778 (elf_i386_non_lazy_plt): Likewise.
779 (GET_PLT_ENTRY_SIZE): Removed.
780 (elf_i386_plt): Renamed to ...
781 (elf_i386_lazy_plt): This.
782 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
783 (elf_i386_arch_bed): Updated.
784 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
785 (elf_i386_create_dynamic_sections): Removed.
786 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
787 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
788 (elf_i386_adjust_dynamic_symbol): Updated.
789 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
790 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
791 size for PLT0 if there is no PLT0.
792 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
793 output section is discarded only if GOT isn't empty.
794 (elf_i386_relocate_section): Updated. Properly get PLT index
795 if there is no PLT0.
796 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
797 second and third slots in the PLT entry if there is no PLT0.
798 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
799 if there is no PLT0. Set sh_entsize on the .plt.got section.
800 (elf_i386_nacl_plt): Forward declaration.
801 (elf_i386_get_plt_sym_val): Removed.
802 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
803 against all dynamic relocations.
804 (elf_i386_link_setup_gnu_properties): New function.
805 (elf_backend_create_dynamic_sections): Updated.
806 (elf_backend_setup_gnu_properties): New.
807 (elf_i386_nacl_plt): Updated.
808 (elf_i386_nacl_arch_bed): Likewise.
809 (elf_i386_vxworks_arch_bed): Likewise.
810
046734ff
TP
8112017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
812
813 * elflink.c (elf_output_implib): Remove executable flag from import
814 library bfd.
815 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
816 library is a relocatable object file.
817
b660e9eb
SKS
8182017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
819
820 PR ld/21404
821 * elf32-avr.c (avr_should_move_sym): New function.
822 (avr_should_reduce_sym_size): Likewise.
823 (avr_should_increase_sym_size): Likewise.
824 (elf32_avr_relax_delete_bytes): Adjust symbol values
825 and sizes by calling new functions.
826
763a5fa4
PD
8272017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
828
829 * config.bfd (riscv32-*): Enable rv64.
830
73ec947d
AM
8312017-05-02 Alan Modra <amodra@gmail.com>
832
833 PR 21384
834 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
835 rather than h->root.type == bfd_link_hash_new.
836 (bfd_elf_record_link_assignment): Similarly, call
837 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
838
a941291c
AM
8392017-04-29 Alan Modra <amodra@gmail.com>
840
841 PR 21432
842 * reloc.c (reloc_offset_in_range): New function.
843 (bfd_perform_relocation, bfd_install_relocation): Use it.
844 (_bfd_final_link_relocate): Likewise.
845
750eaa47
L
8462017-04-28 H.J. Lu <hongjiu.lu@intel.com>
847
848 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
849 before using .plt.got.
850 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
851
5b66fac4
L
8522017-04-27 H.J. Lu <hongjiu.lu@intel.com>
853
854 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
855 instead of "+=" to update 0.
856
de9a3c42
L
8572017-04-27 H.J. Lu <hongjiu.lu@intel.com>
858
859 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
860 .plt.got section here.
861 (elf_i386_check_relocs): Don't create the .plt.got section.
862 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
863 the .plt.got and .plt.bnd sections here.
864 (elf_x86_64_check_relocs): Don't create the .plt.got nor
865 .plt.bnd sections.
866
da3d25af
L
8672017-04-27 H.J. Lu <hongjiu.lu@intel.com>
868
869 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
870 has_bnd_reloc.
871 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
872 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
873 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
874 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
875 has_bnd_reloc.
876
fba37edd
L
8772017-04-27 H.J. Lu <hongjiu.lu@intel.com>
878
879 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
880 to return bfd *.
881 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
882 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
883 the first relocatable ELF input with GNU properties.
884
1f78f649
L
8852017-04-27 H.J. Lu <hongjiu.lu@intel.com>
886
887 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
888 VxWorks for non-PIC.
889
76c20d54
AM
8902017-04-27 Alan Modra <amodra@gmail.com>
891
892 * elf-bfd.h (struct elf_backend_data): Make asection param of
893 elf_backend_eh_frame_address_size const.
894 (_bfd_elf_eh_frame_address_size): Likewise.
895 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
896 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
897 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
898 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
899 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
900 (next_cie_fde_offset): Constify params.
901 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
902
d7153c4a
AM
9032017-04-27 Alan Modra <amodra@gmail.com>
904
905 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
906 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
907 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
908 aug_data_len.
909 (offset_adjust): New function.
910 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
911 (adjust_eh_frame_local_symbols): Likewise.
912 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
913 after changing anything. Return true if anything changed.
914 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
915 _bfd_elf_adjust_eh_frame_global_symbol for globals.
916
641338d8
AM
9172017-04-27 Alan Modra <amodra@gmail.com>
918
919 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
920 when force_local.
921
21d68fcd
AM
9222017-04-27 Alan Modra <amodra@gmail.com>
923
924 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
925 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
926 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
927 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
928 for undef and undefweak dyn_relocs.
929 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
930 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
931 (allocate_got, allocate_dynrelocs): Likewise.
932 (ppc64_elf_relocate_section): Likewise.
933
97d343d4
L
9342017-04-26 H.J. Lu <hongjiu.lu@intel.com>
935
936 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
937 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
938 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
939 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
940
04b31182
NC
9412017-04-26 Nick Clifton <nickc@redhat.com>
942
943 PR binutils/21434
944 * reloc.c (bfd_perform_relocation): Check for a negative address
945 in the reloc.
946
23ec1e32
MR
9472017-04-26 Maciej W. Rozycki <macro@imgtec.com>
948
949 PR ld/21334
950 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
951 member.
952 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
953 (elf_backend_always_renumber_dynsyms): Define.
954 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
955 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
956 * elflink.c (bfd_elf_size_dynamic_sections): Also call
957 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
958 it.
959 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
960
c46cec3a
MR
9612017-04-26 Maciej W. Rozycki <macro@imgtec.com>
962
963 * elflink.c (bfd_elf_size_dynamic_sections): Only call
964 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
965 sections have been created.
966
e63d1232
NC
9672017-04-26 Nick Clifton <nickc@redhat.com>
968
969 PR binutils/21431
970 * compress.c (bfd_init_section_compress_status): Check the return
971 value from bfd_malloc.
972
9e9821dd
L
9732017-04-24 H.J. Lu <hongjiu.lu@intel.com>
974
975 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
976 no_finish_dynamic_symbol.
977 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
978 0.
979 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
980 weak symbol, don't make it dynamic.
981 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
982 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
983 relocation for GOT reference.
984 (elf_x86_64_finish_dynamic_symbol): Abort if
985 no_finish_dynamic_symbol isn't 0.
986
0dc9a308
L
9872017-04-24 H.J. Lu <hongjiu.lu@intel.com>
988
989 PR ld/21402
990 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
991 undefined weak symbol, don't make it dynamic.
992 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
993 set no_finish_dynamic_symbol and generate R_386_RELATIVE
994 relocation for R_386_GOT32.
995
1587442d
L
9962017-04-24 H.J. Lu <hongjiu.lu@intel.com>
997
998 PR ld/21425
999 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
1000
7eacd66b
AM
10012017-04-23 Alan Modra <amodra@gmail.com>
1002
1003 PR 21414
1004 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
1005 * elf.c (lcomm_sym): New.
1006 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
1007 * bfd-in2.h: Regenerate.
1008
bce964aa
AM
10092017-04-23 Alan Modra <amodra@gmail.com>
1010
1011 PR 21412
1012 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
1013 parameters and comment.
1014 (_bfd_elf_get_reloc_section): Delete.
1015 (_bfd_elf_plt_get_reloc_section): Declare.
1016 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
1017 New functions. Don't blindly skip over assumed .rel/.rela prefix.
1018 Extracted from..
1019 (_bfd_elf_get_reloc_section): ..here. Delete.
1020 (assign_section_numbers): Call elf_get_reloc_section.
1021 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
1022 * elfxx-target.h (elf_backend_get_reloc_section): Update.
1023
97e83a10
AM
10242017-04-23 Alan Modra <amodra@gmail.com>
1025
1026 PR 21409
1027 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
1028 no symbols.
1029
e133d005
L
10302017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1031
1032 PR ld/21402
1033 * elf32-i386.c (elf_i386_link_hash_entry): Add
1034 no_finish_dynamic_symbol.
1035 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
1036 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
1037 symbol, don't make it dynamic in PIE.
1038 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
1039 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1040 relocation for R_386_GOT32
1041 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
1042 isn't 0.
1043
3c5fce9b
L
10442017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1045
1046 PR ld/19617
1047 PR ld/21086
1048 * elflink.c (elf_link_add_object_symbols): Require
1049 --no-dynamic-linker with -E/--dynamic-list when creating
1050 dynamic sections.
1051
0fad2956
MR
10522017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1053
1054 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
1055 if forced local.
1056
64575f78
MR
10572017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1058
1059 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
1060 dynamic symbol sorting.
1061
59fa66c5
L
10622017-04-20 H.J. Lu <hongjiu.lu@intel.com>
1063
1064 PR ld/21382
1065 * elflink.c (elf_link_add_object_symbols): Preserve
1066 dynamic_ref_after_ir_def when restoring the symbol table for
1067 unneeded dynamic object.
1068
e492d2f8
L
10692017-04-19 H.J. Lu <hongjiu.lu@intel.com>
1070
1071 PR ld/21401
1072 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
1073 on on undefined IFUNC symbol in the second PLT.
1074
10169134
WAF
10752017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
1076
1077 * peXXigen.c (pe_print_reloc): Correct chunk_end.
1078
954b63d4
AM
10792017-04-19 Alan Modra <amodra@gmail.com>
1080
1081 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
1082 or make dynamic for info->dynamic_undefined_weak 0 and 1.
1083 * elf32-ppc.c:Formatting.
1084 (ensure_undefweak_dynamic): Don't make dynamic when
1085 info->dynamic_undefined_weak is zero.
1086 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1087 info->dynamic_undefined_weak. Discard undef dyn_relocs when
1088 not default visibility. Discard undef and undefweak
1089 dyn_relocs earlier.
1090 (ppc_elf_relocate_section): Adjust to suit.
1091 * elf64-ppc.c: Formatting.
1092 (ensure_undefweak_dynamic): Don't make dynamic when
1093 info->dynamic_undefined_weak is zero.
1094 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1095 info->dynamic_undefined_weak. Discard them earlier.
1096
e6699019
L
10972017-04-17 H.J. Lu <hongjiu.lu@intel.com>
1098
1099 PR ld/21389
1100 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
1101 before generating the version definition section.
1102
c5d37467
AM
11032017-04-17 Alan Modra <amodra@gmail.com>
1104
1105 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
1106 state when a regular object file defines a symbol with
1107 incompatible type to that defined by an earlier shared lib.
1108
63a5468a
AM
11092017-04-13 Alan Modra <amodra@gmail.com>
1110
1111 * coffcode.h: Wrap some overly long _bfd_error_handler args.
1112 * elf.c: Likewise.
1113 * elf32-arm.c: Likewise.
1114 * elf32-i386.c: Likewise.
1115 * elf32-mep.c: Likewise.
1116 * elf64-ia64-vms.c: Likewise.
1117 * elf64-x86-64.c: Likewise.
1118 * elflink.c: Likewise.
1119 * elfnn-ia64.c: Likewise.
1120 * elfxx-mips.c: Likewise.
1121
dae82561
AM
11222017-04-13 Alan Modra <amodra@gmail.com>
1123
1124 * aoutx.h: Use %B and %A in error messages throughout file.
1125 * aout-cris.c: Likewise.
1126 * archive.c: Likewise.
1127 * binary.c: Likewise.
1128 * coff-rs6000.c: Likewise.
1129 * coff-tic4x.c: Likewise.
1130 * coffcode.h: Likewise.
1131 * coffgen.c: Likewise.
1132 * cofflink.c: Likewise.
1133 * coffswap.h: Likewise.
1134 * cpu-arm.c: Likewise.
1135 * elf-eh-frame.c: Likewise.
1136 * elf-m10300.c: Likewise.
1137 * elf.c: Likewise.
1138 * elf32-arc.c: Likewise.
1139 * elf32-arm.c: Likewise.
1140 * elf32-bfin.c: Likewise.
1141 * elf32-frv.c: Likewise.
1142 * elf32-iq2000.c: Likewise.
1143 * elf32-m32c.c: Likewise.
1144 * elf32-microblaze.c: Likewise.
1145 * elf32-nds32.c: Likewise.
1146 * elf32-rl78.c: Likewise.
1147 * elf32-rx.c: Likewise.
1148 * elf32-score.c: Likewise.
1149 * elf32-score7.c: Likewise.
1150 * elf32-sh64.c: Likewise.
1151 * elf32-v850.c: Likewise.
1152 * elf32-vax.c: Likewise.
1153 * elf32-visium.c: Likewise.
1154 * elf64-ia64-vms.c: Likewise.
1155 * elf64-mmix.c: Likewise.
1156 * elf64-sh64.c: Likewise.
1157 * elfcode.h: Likewise.
1158 * elfnn-aarch64.c: Likewise.
1159 * elfnn-ia64.c: Likewise.
1160 * elfxx-mips.c: Likewise.
1161 * hpux-core.c: Likewise.
1162 * ieee.c: Likewise.
1163 * ihex.c: Likewise.
1164 * linker.c: Likewise.
1165 * merge.c: Likewise.
1166 * mmo.c: Likewise.
1167 * oasys.c: Likewise.
1168 * pdp11.c: Likewise.
1169 * peXXigen.c: Likewise.
1170 * rs6000-core.c: Likewise.
1171 * vms-alpha.c: Likewise.
1172 * xcofflink.c: Likewise.
1173
c08bb8dd
AM
11742017-04-13 Alan Modra <amodra@gmail.com>
1175
1176 * bfd.c (PRINT_TYPE): Define.
1177 (_doprnt): New function.
1178 (error_handler_internal): Use _doprnt.
1179 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
1180 calls in their natural order, throughout file.
1181 * coff-mcore.c: Likewise.
1182 * coff-ppc.c: Likewise.
1183 * coff-tic80.c: Likewise.
1184 * cofflink.c: Likewise.
1185 * elf-s390-common.c: Likewise.
1186 * elf.c: Likewise.
1187 * elf32-arm.c: Likewise.
1188 * elf32-i386.c: Likewise.
1189 * elf32-m32r.c: Likewise.
1190 * elf32-msp430.c: Likewise.
1191 * elf32-spu.c: Likewise.
1192 * elf64-ia64-vms.c: Likewise.
1193 * elf64-sparc.c: Likewise.
1194 * elf64-x86-64.c: Likewise.
1195 * elflink.c: Likewise.
1196 * elfnn-aarch64.c: Likewise.
1197 * elfnn-ia64.c: Likewise.
1198 * elfxx-mips.c: Likewise.
1199
10463f39
AM
12002017-04-13 Alan Modra <amodra@gmail.com>
1201
1202 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
1203 branch veneers" error. Fix double space and format message.
1204 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
1205 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
1206
4af8774e
AM
12072017-04-13 Alan Modra <amodra@gmail.com>
1208
1209 * bfd-in2.h: Regenerate.
1210
e4097f5e
L
12112017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1212
1213 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
1214 extra `\n' in warning/error messages.
1215 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
1216 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1217
537616aa
L
12182017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1219
1220 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
1221 processor-specific properties with generic ELF target vector.
1222
bb1dd176
QZ
12232017-04-10 Qing Zhao <qing.zhao@oracle.com>
1224
1225 * elf32-sparc.c (elf_backend_fixup_symbol): New.
1226 * elf64-sparc.c (elf_backend_fixup_symbol): New.
1227 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
1228 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
1229 has_non_got_reloc.
1230 (link_hash_newfunc): Initialize has_got_reloc and
1231 has_non_got_reloc.
1232 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
1233 section.
1234 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
1235 has_non_got_reloc.
1236 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
1237 has_non_got_reloc.
1238 (_bfd_sparc_elf_fixup_symbol): New function.
1239 (allocate_dynrelocs): Don't allocate space for dynamic
1240 relocations and discard relocations against resolved undefined
1241 weak symbols in executable. Don't make resolved undefined weak
1242 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
1243 relocation against undefined weak symbols in PIE.
1244 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
1245 relocations against resolved undefined weak symbols in PIE
1246 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
1247 without ynamic PLT/GOT relocations for resolved undefined weak
1248 symbols.
1249 Don't generate dynamic relocation against resolved undefined
1250 weak symbol in executable.
1251 (pie_finish_undefweak_symbol): New function.
1252 (_bfd_sparc_elf_finish_dynamic_sections): Call
1253 pie_finish_undefweak_symbol on all symbols in PIE.
1254 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
1255 (_bfd_sparc_elf_fixup_symbol): New function.
1256
d236cfd4
NC
12572017-04-10 Nick Clifton <nickc@redhat.com>
1258
1259 * config.bfd: Remove ns32k from obsolete list.
1260
6f9dbcd4
AM
12612017-04-10 Alan Modra <amodra@gmail.com>
1262
1263 PR 21287
1264 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
1265 (special_sections_i): Likewise for .init_array.
1266 (special_sections_p): Likewise for .preinit_array.
1267
8170f769
L
12682017-04-07 H.J. Lu <hongjiu.lu@intel.com>
1269
1270 PR ld/19579
1271 PR ld/21306
1272 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
1273 ELF_COMMON_DEF_P for common symbols.
1274 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1275 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1276 * elflink.c (_bfd_elf_merge_symbol): Revert commits
1277 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
1278 07492f668d2173da7a2bda3707ff0985e0f460b6.
1279
49f4617b
PA
12802017-04-07 Pedro Alves <palves@redhat.com>
1281
1282 * opncls.c (bfd_get_debug_link_info): Rename to...
1283 (bfd_get_debug_link_info_1): ... this. Change type of second
1284 parameter to void pointer. Adjust.
1285 (bfd_get_debug_link_info): Reimplement on top of
1286 bfd_get_debug_link_info_1.
1287 (separate_debug_file_exists, separate_alt_debug_file_exists):
1288 Change type of second parameter to void pointer. Adjust.
1289 (get_func_type, check_func_type): Change type of second parameter
1290 to void pointer.
1291 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
1292 the callback functions instead of passing the address of a local.
1293 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
1294 find_separate_debug_file.
1295 (get_alt_debug_link_info_shim): Change type of second parameter to
1296 void pointer. Adjust.
1297 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
1298 find_separate_debug_file.
1299 (get_build_id_name, bfd_boolean check_build_id_file): Change type
1300 of second parameter to void pointer. Adjust.
1301 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
1302 pointer local to find_separate_debug_file.
1303
13042017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
1305
1306 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
1307 external symbols with a definition.
1308 (_bfd_coff_gc_mark_extra_sections): Fix typo.
1309
86abf93a
AM
13102017-04-07 Alan Modra <amodra@gmail.com>
1311
1312 * po/SRC-POTFILES.in: Regenerate.
1313
8dea77f0
AM
13142017-04-05 Alan Modra <amodra@gmail.com>
1315
1316 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
1317 reference counting.
1318
477bdd39
JT
13192017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
1320
1321 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
1322 numbers for DataDirectory entry indicies passed to
1323 add_data_entry().
1324
a91e1603
L
13252017-04-04 H.J. Lu <hongjiu.lu@intel.com>
1326
1327 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
1328 each GNU_MBIND section and align GNU_MBIND section to page size.
1329 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
1330 segment for each GNU_MBIND section.
1331 (_bfd_elf_init_private_section_data): Copy sh_info from input
1332 for GNU_MBIND section.
1333
b5292032
PD
13342017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
1335
1336 * elfnn-riscv.c (GP_NAME): Delete.
1337 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
1338 (_bfd_riscv_relax_lui): Likewise.
1339
ad32986f
NC
13402017-04-04 Nick Clifton <nickc@redhat.com>
1341
1342 PR binutils/21342
1343 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
1344 dereference.
1345 (bfd_elf_final_link): Only initialize the extended symbol index
1346 section if there are extended symbol tables to list.
1347
46bed679
L
13482017-04-03 H.J. Lu <hongjiu.lu@intel.com>
1349
1350 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
1351 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
1352 * configure.ac (elf): Add elf-properties.lo.
1353 * Makefile.in: Regenerated.
1354 * configure: Likewise.
1355 * elf-bfd.h (elf_property_kind): New.
1356 (elf_property): Likewise.
1357 (elf_property_list): Likewise.
1358 (elf_properties): Likewise.
1359 (_bfd_elf_parse_gnu_properties): Likewise.
1360 (_bfd_elf_get_property): Likewise.
1361 (_bfd_elf_link_setup_gnu_properties): Likewise.
1362 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
1363 and setup_gnu_properties.
1364 (elf_obj_tdata): Add properties.
1365 * elf-properties.c: New file.
1366 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
1367 (elf_i386_merge_gnu_properties): Likewise.
1368 (elf_backend_parse_gnu_properties): Likewise.
1369 (elf_backend_merge_gnu_properties): Likewise.
1370 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1371 (elf_x86_64_merge_gnu_properties): Likewise.
1372 (elf_backend_parse_gnu_properties): Likewise.
1373 (elf_backend_merge_gnu_properties): Likewise.
1374 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
1375 (elf_backend_parse_gnu_properties): Likewise.
1376 (elf_backend_setup_gnu_properties): Likewise.
1377 (elfNN_bed): Add elf_backend_parse_gnu_properties,
1378 elf_backend_merge_gnu_properties and
1379 elf_backend_setup_gnu_properties.
1380
f96bd6c2
PC
13812017-03-30 Pip Cet <pipcet@gmail.com>
1382
1383 * elf32-wasm32.c: Add relocation code, two relocs.
1384 * reloc.c: Add wasm32 relocations.
1385 * libbfd.h: Regenerate.
1386 * bfd-in2.h: Regenerate.
1387 * bfd/po/bfd.pot: Regenerate.
1388
e643cb45
NC
13892017-03-29 Nick Clifton <nickc@redhat.com>
1390
1391 PR binutils/18025
1392 * coff-bfd.h (struct coff_section_data): Add new fields:
1393 saved_bias and bias.
1394 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
1395 computed for PE binaries.
1396 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
1397 missing abbrev.
1398
086554e8
HPN
13992017-03-28 Hans-Peter Nilsson <hp@axis.com>
1400
1401 PR ld/16044
1402 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
1403 to handle a local symbol with a hash-symbol-entry; without PLT.
1404 Add BFD_ASSERT for an incidental case with GOT entry present.
1405 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
1406 isn't forced-or-set local.
1407
a6be0538
PC
14082017-03-27 Pip Cet <pipcet@gmail.com>
1409
1410 * wasm-module.c: New file to support WebAssembly modules.
1411 * wasm-module.h: New file to support WebAssembly modules.
1412 * doc/webassembly.texi: Start documenting wasm-module.c.
1413 * config.bfd: Add wasm_vec.
1414 * targets.c: Likewise.
1415 * configure.ac: Likewise.
1416 * Makefile.am: Add entries for wasm-module.c.
1417 * Makefile.in: Regenerate.
1418 * configure: Regenerate.
1419 * po/SRC-POTFILES.in: Regenerate.
1420
79b1d3cb
PC
14212017-03-27 Pip Cet <pipcet@gmail.com>
1422
1423 * cpu-wasm32.c: New file to support wasm32 architecture.
1424 * elf32-wasm32.c: New file to support wasm32 architecture.
1425 * Makefile.am: Add wasm32 architecture.
1426 * archures.c: Likewise.
1427 * config.bfd: Likewise.
1428 * configure.ac: Likewise.
1429 * targets.c: Likewise.
1430 * Makefile.in: Regenerate.
1431 * bfd-in2.h: Regenerate.
1432 * configure: Regenerate.
1433 * po/SRC-POTFILES.in: Regenerate.
1434
aaed6f5b
AM
14352017-03-20 Alan Modra <amodra@gmail.com>
1436
1437 PR 21266
1438 * elf64-ppc.c (compare_symbols): Stabilize sort.
1439
82e66161
AM
14402017-03-18 Alan Modra <amodra@gmail.com>
1441
1442 * elf64-ppc.c (struct ppc_link_hash_table): Add
1443 local_ifunc_resolver and maybe_local_ifunc_resolver.
1444 (ppc_build_one_stub): Set flags on emitting dynamic
1445 relocation to ifunc.
1446 (ppc64_elf_relocate_section): Likewise.
1447 (ppc64_elf_finish_dynamic_symbol): Likewise.
1448 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
1449 local dynamic relocs to ifuncs.
1450 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
1451 local_ifunc_resolver and maybe_local_ifunc_resolver.
1452 (ppc_elf_relocate_section): Set flag on emitting dynamic
1453 relocation to ifuncs.
1454 (ppc_elf_finish_dynamic_symbol): Likewise.
1455 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
1456 dynamic relocs to ifuncs.
1457
f955cccf
NC
14582017-03-13 Nick Clifton <nickc@redhat.com>
1459
1460 PR binutils/21202
1461 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
1462 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
1463 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
1464 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
1465 * bfd-in2.h: Regenerate.
1466 * libbfd.h: Regenerate.
1467 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
1468 names.
1469 (IS_AARCH64_TLSDESC_RELOC): Likewise.
1470 (elfNN_aarch64_howto_table): Likewise.
1471 (aarch64_tls_transition_without_check): Likewise.
1472 (aarch64_reloc_got_type): Likewise.
1473 (elfNN_aarch64_final_link_relocate): Likewise.
1474 (elfNN_aarch64_tls_relax): Likewise.
1475 (elfNN_aarch64_relocate_section): Likewise.
1476 (elfNN_aarch64_gc_sweep_hook): Likewise.
1477 (elfNN_aarch64_check_relocs): Likewise.
1478 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1479 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1480
4aef7643
AM
14812017-03-11 Alan Modra <amodra@gmail.com>
1482
1483 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
1484 parameter is in fact used. Whitespace fixes.
1485 * elf64-ppc.c: Likewise.
1486
f03265d9
ST
14872017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
1488
1489 * rs6000-core.c (CORE_NEW): Simplify macro when
1490 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
1491
b1b07054
AM
14922017-03-07 Alan Modra <amodra@gmail.com>
1493
1494 PR 21224
1495 PR 20519
1496 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
1497 dyn_relocs check.
1498
2e0ce1c8
AM
14992017-03-05 Alan Modra <amodra@gmail.com>
1500
1501 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
1502 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
1503 (next_cie_fde_offset): New function.
1504 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
1505 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
1506 four bytes. Align CIEs to four or eight bytes depending on
1507 per_encoding_aligned8. Align FDEs according to their encoding.
1508 Pad last FDE to output section alignment.
1509 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
1510 assertion.
1511 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
1512 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
1513 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
1514
f98450c6
NC
15152017-03-02 Martin Bickel <binutils@ineranves.de>
1516
1517 PR ld/21212
1518 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 1519 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 1520
673cff9b
AM
15212017-03-02 Alan Modra <amodra@gmail.com>
1522
1523 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
1524
3de43e7b
AM
15252017-02-28 Alan Modra <amodra@gmail.com>
1526
1527 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
1528 (ppc64_elf_relocate_section): Likewise.
1529
4ef97a1b
AM
15302017-02-28 Alan Modra <amodra@gmail.com>
1531
1532 PR 20995
1533 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
1534 rather than elf32_nios2_hash_table or elf_hash_table.
1535 (create_got_section): Likewise.
1536 (nios2_elf32_finish_dynamic_symbol): Likewise.
1537 (nios2_elf32_adjust_dynamic_symbol): Likewise.
1538 (nios2_elf32_size_dynamic_sections): Likewise.
1539 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
1540 vars. Use htab equivalents directly instead. Don't create
1541 all dynamic sections on needing just the GOT. Use a goto
1542 rather than a fall-through with reloc test. Ensure
1543 htab->dynobj is set when making dynamic sreloc section.
1544 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
1545 equivalent directly instead. Don't segfault on looking for
1546 .dynamic when dynamic sections have not been created. Don't
1547 segfault on .got.plt being discarded.
1548 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
1549 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
1550 fixme and another not so relevant comment.
1551 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
1552 already set, set hash table dynobj on creating .sbss.
1553
7ba71655
AM
15542017-02-28 Alan Modra <amodra@gmail.com>
1555
1556 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
1557 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
1558 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
1559 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
1560 (ppc64_elf_relocate_section): Likewise.
1561 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
1562 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
1563 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
1564 * libbfd.h: Regenerate.
1565 * bfd-in2.h: Regenerate.
1566
afbf7e8e
AM
15672017-02-28 Alan Modra <amodra@gmail.com>
1568
1569 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
1570 dynamic .data.rel.ro read-only.
1571 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
1572 rather than section flags when deciding where copy reloc goes.
1573 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
1574 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
1575 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
1576 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
1577 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
1578 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
1579 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
1580 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
1581 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1582 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
1583 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
1584 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
1585 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1586 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1587 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
1588 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
1589 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1590 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1591 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
1592
0e392101
MR
15932017-02-28 Maciej W. Rozycki <macro@imgtec.com>
1594
1595 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
1596 `jalr $0, $25' instruction encoding.
1597
bd757ca7
NC
15982017-02-27 Nick Clifton <nickc@redhat.com>
1599
1600 PR ld/21180
1601 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
1602 generating a seg-fault when encountering a symbol that has been
1603 deleted by garbage collection.
1604
034fed0b
AM
16052017-02-25 Alan Modra <amodra@gmail.com>
1606
1607 * elf32-arc.c (struct dynamic_sections): Delete.
1608 (enum dyn_section_types): Delete.
1609 (dyn_section_names): Delete.
1610 (arc_create_dynamic_sections): Delete.
1611 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
1612 segfault on discarded .rela.plt section.
1613 (elf_arc_size_dynamic_sections): Formatting. Don't call
1614 arc_create_dynamic_sections. Don't allocate memory for sections
1615 handled by the generic linker. Correct code finding relocs in
1616 read-only sections. Set SEC_EXCLUDE on zero size .got,
1617 .got.plt, and .dynbss sections. Do set .interp for pies.
1618
d0f744f9
AW
16192017-02-24 Andrew Waterman <andrew@sifive.com>
1620
1621 * elfnn-riscv.c (GP_NAME): New macro.
1622 (riscv_global_pointer_value): Use it.
1623 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
1624 output section, consider only that section's alignment.
1625
5d58c733
MR
16262017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1627
1628 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
1629 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
1630 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
1631 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
1632
c1556ecd
MR
16332017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1634
1635 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
1636 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
1637 or misaligned.
1638
5499c7c7
AM
16392017-02-23 Alan Modra <amodra@gmail.com>
1640
1641 PR 20744
1642 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
1643 16D relocations.
1644 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
1645 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
1646 relocs.
1647
902e9fc7
MR
16482017-02-22 Maciej W. Rozycki <macro@imgtec.com>
1649
1650 PR ld/20828
1651 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
1652 processing ahead of the call to `elf_gc_sweep_symbol'.
1653
758d96d8
NC
16542017-02-22 Nick Clifton <nickc@redhat.com>
1655
1656 PR binutils/21193
1657 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
1658 created section 4-byte alignment.
1659
6528b6eb
AM
16602017-02-22 Alan Modra <amodra@gmail.com>
1661
1662 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
1663 on .got or .plt output section being discarded by script.
1664 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
1665 vxworks splt temp.
1666
24f1a751
AM
16672017-02-21 Alan Modra <amodra@gmail.com>
1668
1669 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
1670 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
1671
64487780
AM
16722017-02-20 Alan Modra <amodra@gmail.com>
1673
1674 PR 21181
1675 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
1676 if DT_RELSZ/DT_RELASZ is zero.
1677
6438d1be
NC
16782017-02-17 Nick Clifton <nickc@redhat.com>
1679
1680 * compress.c (bfd_get_full_section_contents): Remember to reduce
1681 compressed size by the sizeof the compression header when
1682 decompressing the contents.
1683
4bc26c69
PA
16842017-02-17 Pedro Alves <palves@redhat.com>
1685
1686 * srec.c (Chunk): Rename to ...
1687 (_bfd_srec_len): ... this.
1688 (S3Forced): Rename to ...
1689 (_bfd_srec_forceS3): ... this.
1690 * objcopy.c: Adjust all references.
1691
7ec22e0f
PA
16922017-02-17 Pedro Alves <palves@redhat.com>
1693
1694 * archive.c (bsd_write_armap): Rename to ...
1695 (_bfd_bsd_write_armap): ... this.
1696 (coff_write_armap): Rename to ...
1697 (_bfd_coff_write_armap): ... this.
1698 * libbfd-in.h (bsd_write_armap): Rename to ...
1699 (_bfd_bsd_write_armap): ... this.
1700 (coff_write_armap): Rename to ...
1701 (_bfd_coff_write_armap): ... this.
1702 * aout-target.h, aout-tic30.c: Adjust all users.
1703 * libbfd.h: Regenerate.
1704
8c8402cc
PA
17052017-02-17 Pedro Alves <palves@redhat.com>
1706
1707 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
1708 (warn_deprecated): Rename to ...
1709 (_bfd_warn_deprecated): ... this.
1710 * libbfd.c (warn_deprecated): Rename to ...
1711 (_bfd_warn_deprecated): ... this.
1712 * bfd-in2.h: Regenerate.
1713
c7c3d11b
PA
17142017-02-17 Pedro Alves <palves@redhat.com>
1715
1716 * bfdio.c (real_ftell): Rename to ...
1717 (_bfd_real_ftell): ... this.
1718 (real_fseek): Rename to ...
1719 (_bfd_real_fseek): ... this.
1720 (real_fopen): Rename to ...
1721 (_bfd_real_fopen): ... this.
1722 * libbfd-in.h (real_ftell): Rename to ...
1723 (_bfd_real_ftell): ... this.
1724 (real_fseek): Rename to ...
1725 (_bfd_real_fseek): ... this.
1726 (real_fopen): Rename to ...
1727 (_bfd_real_fopen): ... this.
1728 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
1729 * libbfd.h: Regenerate.
1730
4265548c
PA
17312017-02-17 Pedro Alves <palves@redhat.com>
1732
1733 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
1734 * libbfd.c (read_unsigned_leb128): Rename to ...
1735 (_bfd_read_unsigned_leb128): ... this.
1736 (read_signed_leb128): Rename to ...
1737 (_bfd_read_signed_leb128): ... this.
1738 (safe_read_leb128): Rename to ...
1739 (_bfd_safe_read_leb128): ... this.
1740 * libbfd-in.h (read_unsigned_leb128): Rename to ...
1741 (_bfd_read_unsigned_leb128): ... this.
1742 (read_signed_leb128): Rename to ...
1743 (_bfd_read_signed_leb128): ... this.
1744 (safe_read_leb128): Rename to ...
1745 (_bfd_safe_read_leb128): ... this.
1746 * libbfd.h: Renegerate.
1747
3239a423
AB
17482017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1749
1750 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
1751 before trying to fine matching file and line information.
1752
90ed9b8b
AB
17532017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1754
1755 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
1756 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
1757 not match current bfd, then reload debug information. Record bfd
1758 we're loading debug info for in the stash. If we have debug
1759 informatin in the cache then perform section placement before
1760 returning.
1761
a8c75b76
AM
17622017-02-16 Alan Modra <amodra@gmail.com>
1763
1764 PR 21000
1765 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
1766 * elfxx-target.h (elf_backend_no_page_alias): Define.
1767 (elfNN_bed): Init new field.
1768 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
1769 ensure PT_LOAD segment starts on a new page.
1770 * elf32-hppa.c (elf_backend_no_page_alias): Define.
1771
247d6c4c
AM
17722017-02-16 Alan Modra <amodra@gmail.com>
1773
1774 PR 21132
1775 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
1776 if pic.
1777
90571206
JW
17782017-02-16 Jiong Wang <jiong.wang@arm.com>
1779
1780 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
1781 * bfd-in2.h: Regenerated.
1782
2a568401
L
17832017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1784
1785 PR ld/21168
1786 * elf32-i386.c (elf_i386_relocate_section): Allow
1787 "lea foo@GOT, %reg" in PIC.
1788
a5def14f
L
17892017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1790
1791 PR ld/20244
1792 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
1793 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
1794 error against local IFUNC symbol without a base register for
1795 PIC.
1796
174d0a74
MR
17972017-02-15 Maciej W. Rozycki <macro@imgtec.com>
1798
1799 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
1800 `%P: %H:' with `info->callbacks->einfo'.
1801 (ppc_elf_relocate_section): Likewise.
1802 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1803 (ppc64_elf_edit_toc): Likewise.
1804 (ppc64_elf_relocate_section): Likewise.
1805
e278ae05
AM
18062017-02-14 Alan Modra <amodra@gmail.com>
1807
1808 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
1809 --gc-keep-exported, and test versioned field of sym rather than
1810 looking for @ in name.
1811
10ddfe62
PD
18122017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
1813
1814 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
1815 __global_pointer$.
1816
d11135f5
NC
18172017-02-13 Nick Clifton <nickc@redhat.com>
1818
1819 PR binutils/21151
1820 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
1821 unit length field.
1822
cc162427
AW
18232017-02-07 Andrew Waterman <andrew@sifive.com>
1824
1825 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
1826 entry size if PLT header is written.
1827
3d044c0c
SL
18282017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
1829
1830 Fix sparc64 dynamic relocation processing to use the dynamic
1831 symbol count.
1832 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
1833 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
1834 should be used.
1835
1b7e3d2f
NC
18362017-02-03 Nick Clifton <nickc@redhat.com>
1837
1838 PR 21096
1839 * coffcode.h (coff_write_object_contents): Enlarge size of
1840 s_name_buf in order to avoid compile time warning about possible
1841 integer truncation.
1842 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
1843 32-bits of insn value before printing into buffer.
1844
e17b0c35
MR
18452017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1846
1847 * elfxx-mips.c (mips_elf_hash_sort_data): Add
1848 `max_local_dynindx'.
1849 (mips_elf_sort_hash_table): Handle it.
1850 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
1851 symbols bump up `max_local_dynindx' rather than
1852 `max_non_got_dynindx'.
1853
55f8b9d2
MR
18542017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1855
1856 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
1857 `min_got_dynindx', `max_unref_got_dynindx' and
1858 `max_non_got_dynindx' members to the `bfd_size_type' data type.
1859 (mips_elf_sort_hash_table): Adjust accordingly.
1860
0f8c4b60
MR
18612017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1862
1863 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
1864 to access the hash table.
1865
17a80fa8
MR
18662017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1867
1868 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
1869 non-NULL `htab' to the beginning.
1870
8f56d4fd
MR
18712017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1872
1873 * elflink.c (elf_gc_sweep): Wrap overlong line.
1874
8b10b0b3
MR
18752017-01-30 Maciej W. Rozycki <macro@imgtec.com>
1876
1877 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
1878 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
1879 * elfxx-mips.c (mips_elf_link_hash_table): Add
1880 `ignore_branch_isa' member.
1881 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
1882 in branch relocation calculation as an error if
1883 `ignore_branch_isa' has been set.
1884 (_bfd_mips_elf_insn32): Rename to...
1885 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
1886 parameter to `insn32' and add an `ignore_branch_isa' parameter.
1887 Handle the new parameter.
1888
1fbd05e1
HPN
18892017-01-27 Hans-Peter Nilsson <hp@axis.com>
1890
22d9a0de
HPN
1891 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
1892 local variable dynobj.
1893
1fbd05e1
HPN
1894 PR ld/20995
1895 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
1896 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
1897 executable from read-only sections into sdynrelro.
1898 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
1899 dynamic relocs in sdynrelro.
1900 (elf_backend_want_dynrelro): Define.
1901
4a7324e1
SH
19022017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
1903
1904 * config.bfd (*-*-rtemsaout*): Mark as removed.
1905
c75b4ebd
SH
19062017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
1907
1908 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
1909 (arm-*-rtems*): Move to (arm*-*-eabi*).
1910 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
1911 (m68-*-rtems*): Move to (m68*-*-elf*).
1912
850d84f6
SH
19132017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
1914
1915 * config.bfd (*-*-rtemscoff*): Mark as removed.
1916
b531344c
MR
19172017-01-24 Maciej W. Rozycki <macro@imgtec.com>
1918
1919 PR ld/20828
1920 * elflink.c (bfd_elf_record_link_assignment): Revert last
1921 change and don't ever clear `forced_local'. Set `mark'
1922 unconditionally.
1923 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
1924 file.
1925 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
1926 (bfd_elf_size_dynamic_sections): ... here.
1927 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
1928 and set `mark' instead in `__tls_get_addr_opt' processing.
1929 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
1930
f0158f44
AM
19312017-01-24 Alan Modra <amodra@gmail.com>
1932
1933 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
1934 where dynamic relocs are preferable. Allow ifunc too.
1935 (ensure_undefweak_dynamic): New function.
1936 (allocate_dynrelocs): Use it here. Move plt handling last and
1937 don't make symbols dynamic, simplifying loop. Only make undef
1938 weak symbols with GOT entries dynamic. Correct condition
1939 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
1940 comments. Remove goto.
1941 (ppc_elf_relocate_section): Correct test for using dynamic
1942 symbol on GOT relocs. Rearrange test for emitting GOT relocs
1943 to suit. Set up explicit tls_index entries and implicit GOT
1944 tls_index entries resolvable at link time for
1945 __tls_get_addr_opt. Simplify test to clear mem for prelink.
1946 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
1947 (ensure_undefweak_dynamic): New function.
1948 (allocate_dynrelocs): Use it here. Only make undef weak symbols
1949 with GOT entries dynamic. Remove unnecessary test of
1950 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
1951 (ppc64_elf_relocate_section): Correct test for using dynamic
1952 symbol on GOT relocs. Rearrange test for emitting GOT relocs
1953 to suit. Set up explicit tls_index entries and implicit GOT
1954 tls_index entries resolvable at link time for __tls_get_addr_opt.
1955 Simplify expression to clear mem for prelink.
1956
2d0ca824
YN
19572017-01-23 Yury Norov <ynorov@caviumnetworks.com>
1958
1959 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
1960
7f784814
JW
19612017-01-20 Jiong Wang <jiong.wang@arm.com>
1962
1963 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
1964 (elf_backend_hash_symbol): Define.
1965
81ff47b3
MR
19662017-01-18 Maciej W. Rozycki <macro@imgtec.com>
1967
1968 PR ld/20828
1969 * elflink.c (bfd_elf_record_link_assignment): Clear any
1970 `forced_local' marking for DSO symbols that are not being
1971 provided.
1972
640d6bfd
KLC
19732017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1974
1975 * elfnn-riscv.c (riscv_elf_object_p): New function.
1976
8361ed4d
L
19772017-01-12 H.J. Lu <hongjiu.lu@intel.com>
1978
1979 PR ld/21038
1980 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
1981 plt_bnd_eh_frame.
1982 (elf_x86_64_check_relocs): Create .eh_frame section for the
1983 .plt.bnd section.
1984 (elf_x86_64_size_dynamic_sections): Allocate and initialize
1985 .eh_frame section for the .plt.bnd section.
1986 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
1987 for the .plt.bnd section.
1988
2425a30e
NC
19892017-01-12 Nick Clifton <nickc@redhat.com>
1990
1991 PR binutils/20876
1992 * opncls.c (find_separate_debug_file): Add include_dirs
1993 parameter. Only include the directory part of the bfd's filename
1994 in search paths if include_dirs is true. Add a couple of extra
1995 locations for looking for debug files.
1996 ( bfd_follow_gnu_debuglink): Update invocation of
1997 find_separate_debug_file.
1998 (bfd_follow_gnu_debugaltlink): Likewise.
1999 (get_build_id): New function: Finds the build-id of the given bfd.
2000 (get_build_id_name): New function: Computes the name of the
2001 separate debug info file for a bfd, based upon its build-id.
2002 (check_build_id_file): New function: Checks to see if a separate
2003 debug info file exists at the given location, and that its
2004 build-id matches that of the original bfd.
2005 (bfd_follow_build_id_debuglink): New function: Finds a separate
2006 debug info file for a given bfd by using the build-id method.
2007 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
2008 method of locating a separate debug info file before using the
2009 debuglink method.
2010 * bfd-in2.h: Regenerate.
2011
9e659176
L
20122017-01-11 H.J. Lu <hongjiu.lu@intel.com>
2013
2014 PR ld/21038
2015 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
2016 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
2017 elf_x86_64_eh_frame_plt_got.
2018 (elf_x86_64_size_dynamic_sections): Get unwind info from
2019 elf_x86_64_bnd_arch_bed for the BND PLT.
2020
f2e2d2f5
JS
20212017-01-11 Jeremy Soller <jackpot51@gmail.com>
2022
2023 * config.bfd: Add entries for i686-redox and x86_64-redox.
2024
52b232b3
L
20252017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2026
2027 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
2028 to 4 bytes.
2029 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
2030 .eh_frame section to 4 bytes for x32.
2031 (elf_x86_64_check_relocs): Likewise.
2032
fff53dae
L
20332017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2034
2035 PR ld/20830
2036 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
2037 (PLT_GOT_FDE_LENGTH): Likewise.
2038 (elf_i386_plt_layout): Add eh_frame_plt_got and
2039 eh_frame_plt_got_size.
2040 (elf_i386_plt): Updated.
2041 (elf_i386_link_hash_table): Add plt_got_eh_frame.
2042 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
2043 (elf_i386_size_dynamic_sections): Allocate and initialize
2044 .eh_frame section for .plt.got.
2045 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
2046 .plt.got.
2047 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
2048 eh_frame_plt_got_size.
2049 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
2050 (PLT_GOT_FDE_LENGTH): Likewise.
2051 (elf_x86_64_backend_data): Add eh_frame_plt_got and
2052 eh_frame_plt_got_size.
2053 (elf_x86_64_arch_bed): Updated.
2054 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
2055 eh_frame_plt_got_size.
2056 (elf_x86_64_nacl_arch_bed): Likewise.
2057 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
2058 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
2059 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2060 .eh_frame section for .plt.got.
2061 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2062 for .plt.got.
2063
f129e49f
L
20642017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2065
2066 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
2067 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
2068
cd6581da
NC
20692017-01-09 Nick Clifton <nickc@redhat.com>
2070
2071 * dwarf2.c (lookup_address_in_function_table): Return early if
2072 there are no functions in the given comp unit, or if the high
2073 address of the last function in the comp unit is less than the
2074 desired address.
2075
98f02962
NC
20762017-01-09 Nick Clifton <nickc@redhat.com>
2077
2078 PR binutils/21013
2079 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
2080 message if there are too many symbols to load.
2081
ae4fda66
JC
20822017-01-04 James Clarke <jrtc27@jrtc27.com>
2083
2084 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
2085 if relocs are cached.
2086
de1010f4
RF
20872017-01-03 Rich Felker <bugdal@aerifal.cx>
2088
2089 PR ld/21017
2090 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
2091 for R_MICROBLAZE_GOTOFF_64.
2092
09fe2662
NC
20932017-01-03 Nick Clifton <nickc@redhat.com>
2094
2095 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
2096 warning about using a possibly uninitialised variable.
2097
595e0a47
AM
20982017-01-02 Alan Modra <amodra@gmail.com>
2099
2100 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
2101 (allocate_plt_static, allocate_dynrelocs): Use it.
2102
7bd9df3b
AM
21032017-01-02 Alan Modra <amodra@gmail.com>
2104
2105 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
2106 .PARISC.unwind section.
2107
5b86074c
AM
21082017-01-02 Alan Modra <amodra@gmail.com>
2109
2110 PR ld/20989
2111 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
2112 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
2113 indirect to GOT pointer relative code edit.
2114
2571583a
AM
21152017-01-02 Alan Modra <amodra@gmail.com>
2116
2117 Update year range in copyright notice of all files.
2118
5c1ad6b5 2119For older changes see ChangeLog-2016
3499769a 2120\f
5c1ad6b5 2121Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
2122
2123Copying and distribution of this file, with or without modification,
2124are permitted in any medium without royalty provided the copyright
2125notice and this notice are preserved.
2126
2127Local Variables:
2128mode: change-log
2129left-margin: 8
2130fill-column: 74
2131version-control: never
2132End:
This page took 0.21238 seconds and 4 git commands to generate.