Fix compile time warning building gas for arm-wince target.
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
57963c05
AM
12017-06-26 Alan Modra <amodra@gmail.com>
2
3 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
4 a --just-syms bfd.
5 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
6 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
7 .preinit_array on --just-syms bfds.
8 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
9 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
10 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
11
5cc4ca83
ST
122017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
13
14 * elf.c (find_link): Bounds check "hint".
15
bff0500d
TP
162017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
17
18 * elf32-arm.c (using_thumb_only): Update list of architectures in
19 BFD_ASSERT for which the logic is valid.
20 (using_thumb2_bl): Likewise.
21 (using_thumb2): Likewise and return true for ARMv8-R.
22 (arch_has_arm_nop): Likewise.
23 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
24 merging logic. Update commentis for value 15 of v8m_baseline,
25 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
26 merging of value 15 of Tag_CPU_arch.
27
4aa57d6a
JW
282017-06-23 Jiong Wang <jiong.wang@arm.com>
29
30 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
31 BFD_RELOC_AARCH64_ADR_GOT_PAGE
32 * bfd-in2.h: Regenerate.
33
5d8763a3
L
342017-06-22 H.J. Lu <hongjiu.lu@intel.com>
35
36 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
37 the error_alignment label forward. Properly align program
38 property note section.
39
e652757b
EC
402017-06-22 Eric Christopher <echristo@gmail.com>
41
42 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
43 abs to fix a truncation warning.
44
84da4cf8
L
452017-06-22 H.J. Lu <hongjiu.lu@intel.com>
46
47 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
48 local undefined weak symbol to 0.
49 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
50
48580982
L
512017-06-22 H.J. Lu <hongjiu.lu@intel.com>
52
53 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
54 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
55 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
56 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
57 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
58 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
59 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
60 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
61
ee2fdd6f
L
622017-06-22 H.J. Lu <hongjiu.lu@intel.com>
63
64 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
65 (elf_i386_lazy_ibt_plt_entry): Likewise.
66 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
67 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
68 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
69 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
70 (elf_i386_lazy_plt_layout): Likewise.
71 (elf_i386_non_lazy_plt_layout): Likewise.
72 (elf_i386_link_hash_entry): Add plt_second.
73 (elf_i386_link_hash_table): Add plt_second and
74 plt_second_eh_frame.
75 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
76 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
77 the second PLT. Check the second PLT.
78 (elf_i386_relocate_section): Use the second PLT to resolve
79 PLT reference if needed.
80 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
81 needed.
82 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
83 second PLT. Generate unwind info for the second PLT.
84 (elf_i386_plt_type): Add plt_second.
85 (elf_i386_get_synthetic_symtab): Support the second PLT.
86 (elf_i386_parse_gnu_properties): Support
87 GNU_PROPERTY_X86_FEATURE_1_AND.
88 (elf_i386_merge_gnu_properties): Support
89 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
90 on GNU_PROPERTY_X86_FEATURE_1_IBT
91 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
92 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
93 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
94 is set on all relocatable inputs.
95 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
96 (elf_x32_lazy_ibt_plt_entry): Likewise.
97 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
98 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
99 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
100 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
101 (elf_x86_64_lazy_ibt_plt): Likewise.
102 (elf_x32_lazy_ibt_plt): Likewise.
103 (elf_x86_64_non_lazy_ibt_plt): Likewise.
104 (elf_x32_non_lazy_ibt_plt): Likewise.
105 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
106 (elf_x86_64_parse_gnu_properties): Support
107 GNU_PROPERTY_X86_FEATURE_1_AND.
108 (elf_x86_64_merge_gnu_properties): Support
109 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
110 on GNU_PROPERTY_X86_FEATURE_1_IBT
111 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
112 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
113 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
114 is set on all relocatable inputs.
115
d19237d9
NC
1162017-06-22 Nick Clifton <nickc@redhat.com>
117
118 PR binutils/21649
119 * som.c (setup_sections): NUL terminate the space_strings buffer.
120 Check that the space.name field does not index beyond the end of
121 the space_strings buffer.
122
6879f5a9
NC
1232017-06-21 Nick Clifton <nickc@redhat.com>
124
125 PR binutils/21646
126 * coff-sh.c (sh_reloc): Check for an out of range reloc.
127
7adc0a81
NC
1282017-06-21 Nick Clifton <nickc@redhat.com>
129
130 PR binutils/21639
131 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
132 type of the size parameter.
133 (_bfd_vms_save_counted_string): Add second parameter - the maximum
134 length of the counted string.
135 * vms.h (_bfd_vms_save_sized_string): Update prototype.
136 (_bfd_vms_save_counted_string): Likewise.
137 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
138 _bfd_vms_save_counted_string.
139 (_bfd_vms_slurp_ehdr): Likewise.
140 (_bfd_vms_slurp_egsd): Likewise.
141 (Parse_module): Likewise.
142
6e1816be
AM
1432017-06-21 Alan Modra <amodra@gmail.com>
144
145 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
146 calls before tocsave calls.
147 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
148 following nop.
149
20bd1b6b
NC
1502017-06-21 Nick Clifton <nickc@redhat.com>
151
152 PR binutils/21645
153 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
154 bfd_get_full_section_contents returns no contents.
155
3de58d95
NC
1562017-06-21 Nick Clifton <nickc@redhat.com>
157
158 PR binutils/21638
159 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
160 record.
161
cb06d03a
NC
1622017-06-21 Nick Clifton <nickc@redhat.com>
163
164 PR binutils/21637
165 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
166 list.
167 (image_set_ptr): Likewise.
168 (alpha_vms_fix_sec_rel): Likewise.
169 (alpha_vms_slurp_relocs): Likewise.
170
c458d007
NC
1712017-06-21 Nick Clifton <nickc@redhat.com>
172
173 PR binutils/21633
174 * ieee.c (ieee_slurp_sections): Check for a NULL return from
175 read_id.
176 (ieee_archive_p): Likewise.
177 (ieee_object_p): Likewise.
178
ce497010
NC
1792017-06-21 Nick Clifton <nickc@redhat.com>
180
181 PR binutils/21640
182 * elf.c (setup_group): Zero the group section pointer list after
183 allocation so that loops can be caught. Check for NULL pointers
184 when processing a group list.
185
abfa390d
L
1862017-06-19 H.J. Lu <hongjiu.lu@intel.com>
187
188 PR ld/21626
189 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
190 the DYNAMIC bit instead of bfd_count_sections.
191
bc21b167
NC
1922017-06-19 Nick Clifton <nickc@redhat.com>
193
194 PR binutils/21618
195 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
196 length.
197 (evax_bfd_print_eeom): Likewise.
198 (evax_bfd_print_egsd): Check for an overlarge record length.
199 (evax_bfd_print_etir): Likewise.
200
acb56a83
NC
2012017-06-19 Nick Clifton <nickc@redhat.com>
202
203 PR binutils/21612
204 * libieee.h (struct common_header_type): Add end_p field.
205 * ieee.c (this_byte_and_next): Do not advance input_p beyond
206 end_p.
207 (read_id): Check for a length that exceeds the remaining bytes in
208 the input buffer.
209 (ieee_seek): Initialise end_p.
210 (ieee_archive_p): Likewise.
211 (ieee_object_p): Likewise.
212
72e84f96
NC
2132017-06-19 Nick Clifton <nickc@redhat.com>
214
80053e46
NC
215 PR binutils/21611
216 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
217 before reading the EIHS structure entries.
218
2192017-06-19 Nick Clifton <nickc@redhat.com>
220
221 PR binutils/21615
72e84f96
NC
222 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
223 gsd_size. Check that there are enough bytes remaining to read the
224 type and size of the next egsd. Check that the size of the egsd
225 does not exceed the size of the record.
226
875ffa3e
AM
2272017-06-19 Alan Modra <amodra@gmail.com>
228
229 * config.bfd: Correct targ_underscore for cris.
230
bdd32e03
AM
2312017-06-18 Alan Modra <amodra@gmail.com>
232
233 * config.bfd: Correct targ_underscore for epiphany, ip2k,
234 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
235
4b48e2f6
NC
2362017-06-16 Nick Clifton <nickc@redhat.com>
237
238 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
239 bucketlist is empty because there are no symbols to add to the
240 list.
241
7dba9362
AM
2422017-06-16 Alan Modra <amodra@gmail.com>
243
244 PR ld/20022
245 PR ld/21557
246 PR ld/21562
247 PR ld/21571
248 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
249 (BFD_JUMP_TABLE_LINK): Likewise.
250 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
251 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
252 (bfd_elf_define_start_stop): New function.
253 * linker.c (bfd_generic_define_start_stop): New function.
254 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
255 new field.
256 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
257 * aout-target.h (MY_bfd_define_start_stop): Define.
258 * aout-tic30.c (MY_bfd_define_start_stop): Define.
259 * binary.c (binary_bfd_define_start_stop): Define.
260 * bout.c (b_out_bfd_define_start_stop): Define.
261 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
262 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
263 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
264 * coffcode.h (coff_bfd_define_start_stop): Define.
265 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
266 * i386msdos.c (msdos_bfd_define_start_stop): Define.
267 * i386os9k.c (os9k_bfd_define_start_stop): Define.
268 * ieee.c (ieee_bfd_define_start_stop): Define.
269 * ihex.c (ihex_bfd_define_start_stop): Define.
270 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
271 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
272 * mmo.c (mmo_bfd_define_start_stop): Define.
273 * nlm-target.h (nlm_bfd_define_start_stop): Define.
274 * oasys.c (oasys_bfd_define_start_stop): Define.
275 * pef.c (bfd_pef_bfd_define_start_stop): Define.
276 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
277 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
278 * som.c (som_bfd_define_start_stop): Define.
279 * srec.c (srec_bfd_define_start_stop): Define.
280 * tekhex.c (tekhex_bfd_define_start_stop): Define.
281 * versados.c (versados_bfd_define_start_stop): Define.
282 * vms-alpha.c (vms_bfd_define_start_stop): Define.
283 (alpha_vms_bfd_define_start_stop): Define.
284 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
285 * bfd-in2.h: Regenerate.
286 * libbfd.h: Regenerate.
287
d68f1976
JW
2882017-06-16 Jiong Wang <jiong.wang@arm.com>
289
290 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
291 SYMBOL_REFERENCES_LOCAL.
292
6353d82b
JW
2932017-06-15 Jiong Wang <jiong.wang@arm.com>
294
295 PR ld/21532
296 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
297 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
298 runtime for if there needs copy relocation elimination.
299 (need_copy_relocation_p): New function. Return true for symbol with
300 pc-relative references and if it's against read-only sections.
301 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
302 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
303 that are related with accessing external objects.
304 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
305 in elfNN_aarch64_check_relocs.
306
63634bb4
NC
3072017-06-15 Nick Clifton <nickc@redhat.com>
308
309 PR binutils/21582
310 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
311 bugs.
62b76e4b
NC
312 PR binutils/21581
313 (ieee_archive_p): Likewise.
63634bb4 314
76800cba
NC
3152017-06-15 Nick Clifton <nickc@redhat.com>
316
317 PR binutils/21579
318 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
319
f7e16c2a
MF
3202017-06-14 Max Filippov <jcmvbkbc@gmail.com>
321
322 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
323 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
324 keep both windowed and call0 ABI PLT definitions.
325 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
326 elf_xtensa_*_plt_entry endex.
327 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
328
f461bbd8
NC
3292017-06-14 Nick Clifton <nickc@redhat.com>
330
331 PR binutils/21578
332 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
333 flag value.
334
c53d2e6d
NC
3352017-06-14 Nick Clifton <nickc@redhat.com>
336
337 PR binutils/21589
338 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
339 maximum value for the ascic pointer. Check that name processing
340 does not read beyond this value.
341 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
342 end of etir record.
343
04f963fd
NC
3442017-06-14 Nick Clifton <nickc@redhat.com>
345
346 PR binutils/21591
347 * versados.c (versados_mkobject): Zero the allocated tdata structure.
348 (process_otr): Check for an invalid offset in the otr structure.
349
319c2dbe
SH
3502017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
351
352 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
353
cbd0eecf
L
3542017-06-13 H.J. Lu <hongjiu.lu@intel.com>
355
356 PR ld/20022
357 PR ld/21557
358 PR ld/21562
359 PR ld/21571
360 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
361 vtable field to a union.
362 (_bfd_elf_is_start_stop): Removed.
363 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
364 __start_SECNAME and __stop_SECNAME symbols.
365 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
366 * elflink.c (_bfd_elf_is_start_stop): Removed.
367 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
368 _bfd_elf_is_start_stop.
369 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
370 __stop_SECNAME symbols. Updated.
371 (elf_gc_smash_unused_vtentry_relocs): Likewise.
372 (bfd_elf_gc_record_vtinherit): Likewise.
373 (bfd_elf_gc_record_vtentry): Likewise.
374
10bbbc1d
NC
3752017-06-13 Nick Clifton <nickc@redhat.com>
376
377 PR ld/21524
378 * elflink.c (elf_link_adjust_relocs): Generate an error when
379 encountering a reloc against a symbol removed by garbage
380 collection.
381
5c3ce2bc
L
3822017-06-12 H.J. Lu <hongjiu.lu@intel.com>
383
384 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
385 to merge_gnu_properties.
386 * elf-properties.c (elf_merge_gnu_properties): Add struct
387 bfd_link_info * and pass it to merge_gnu_properties.
388 (elf_merge_gnu_property_list): Add struct bfd_link_info *
389 and pass it to elf_merge_gnu_properties.
390 (_bfd_elf_link_setup_gnu_properties): Pass info to
391 elf_merge_gnu_property_list.
392 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
393 bfd_link_info *.
394 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
395
9b97dfbf
AM
3962017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
397
398 PR 21564
399 * binary.c (binary_set_section_contents): Scale lma by octets
400 per byte to set filepos.
401
e3d1d408
CM
4022017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
403
404 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
405 dynamic sections.
406
64aa8e03
CM
4072017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
408
409 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
410 require TEXTREL.
411
a0abe743
CM
4122017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
413
414 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
415 patched section contents for TLS IE reloc.
416 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
417
f4e6805f
CM
4182017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
419
420 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
421 RELOC_FOR_GLOBAL_SYMBOL macro.
422
cd640291
CM
4232018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
424
425 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
426 changes.
427
7ef0acc1
VG
4282017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
429
430 * config/tc-arc.c (md_undefined_symbol): Changed.
431 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
432
cc89d0b3
CM
4332017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
434
435 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
436 symbols.
437
9d5c718b
CM
4382017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
439
440 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
441 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
442
be9e3704
CM
4432017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
444
445 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
446 object is created.
447
4ec192e6
RE
4482017-06-08 Richard Earnshaw <rearnsha@arm.com>
449
450 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
451 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
452 is non-zero. Add clarifying comments.
453
51fa2693
L
4542017-06-08 H.J. Lu <hongjiu.lu@intel.com>
455
456 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
457 name. Use local IFUNC symbol name string to report unsupported
458 non-PIC call to IFUNC function.
459 (elf_i386_relocate_section): Dump local IFUNC name with minfo
460 when generating R_386_IRELATIVE relocation.
461 (elf_i386_finish_dynamic_symbol): Likewise.
462 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
463 IFUNC symbol name.
464 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
465 when generating R_X86_64_IRELATIVE relocation.
466 (elf_x86_64_finish_dynamic_symbol): Likewise.
467
78e8a2ff
JM
4682017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
469
470 * elf.c (setup_group): Make sure BFD sections are created for all
471 group sections in the input file when processing SHF_GROUP
472 sections.
473 (bfd_section_from_shdr): Avoid duplicating logic already
474 implemented in `setup_group'.
475
9949827b
DBR
4762017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
477
478 PR binutils/21546
479 * peXXigen.c (pe_print_idata): Use the address of the first thunk
480 if the hint address is zero.
481
0ee3a6db
JC
4822017-06-06 James Clarke <jrtc27@jrtc27.com>
483
484 PR ld/19579
485 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
486 ELF_COMMON_DEF_P for common symbols.
487
7bdf4127
AB
4882017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
489
490 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
491 SEC_GROUP sections as SEC_EXCLUDE.
492 (bfd_elf_set_group_contents): Replace use of abort with an assert.
493 (assign_section_numbers): Use resolve_section_groups flag instead
494 of relocatable link type.
495 (_bfd_elf_init_private_section_data): Use resolve_section_groups
496 flag instead of checking the final_link flag for part of the
497 checks in here. Fix white space as a result.
498 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
499 instead of relocatable link type.
500 (bfd_elf_final_link): Likewise.
501
458ad2b8
JM
5022017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
503
504 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
505 variable `bed'.
506 * elf32-score.c (score_elf_final_link_relocate): Likewise.
507 (s3_bfd_score_elf_check_relocs): Likewise.
508 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
509 (score_elf_final_link_relocate): Likewise.
510 (s7_bfd_score_elf_check_relocs): Likewise.
511
fbebaf4a
JM
5122017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
513
514 * elflink.c (init_reloc_cookie_rels): Remove unused variable
515 `bed'.
516
056bafd4
MR
5172017-06-06 Maciej W. Rozycki <macro@imgtec.com>
518
519 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
520 from `reloc_count' rather than decrementing it.
521 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
522 `reloc_count' by `int_rels_per_ext_rel'.
523 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
524 `reloc_count' by `int_rels_per_ext_rel' for last relocation
525 entry determination.
526 (s3_bfd_score_elf_check_relocs): Likewise.
527 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
528 (s7_bfd_score_elf_relocate_section): Likewise.
529 (s7_bfd_score_elf_check_relocs): Likewise.
530 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
531 prototype and function.
532 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
533 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
534 triple rather than once the sum of REL and RELA relocation entry
535 counts.
536 (bfd_elf64_get_reloc_upper_bound): Remove macro.
537 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
538 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
539 storage allocation size determination.
540 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
541 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
542 by `int_rels_per_ext_rel' for last relocation entry
543 determination.
544 (bfd_elf_final_link): Do not multiply `reloc_count' by
545 `int_rels_per_ext_rel' for internal relocation storage
546 allocation size determination.
547 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
548 `int_rels_per_ext_rel' for last relocation entry determination.
549 (elf_gc_smash_unused_vtentry_relocs): Likewise.
550 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
551 (_bfd_mips_elf_relocate_section): Likewise.
552
af54f0eb
AM
5532017-06-05 Alan Modra <amodra@gmail.com>
554
555 PR 21529
556 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
557
6cf3bf88 5582017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
559
560 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
561 determine structure sizes.
562 (elfcore_grok_freebsd_prstatus): Likewise.
563
f378ab09
AM
5642017-06-01 Alan Modra <amodra@gmail.com>
565
566 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
567 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
568 dynamic objects.
569 (is_elfv2_localentry0): New function.
570 (ppc64_elf_tls_setup): Default params->plt_localentry0.
571 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
572 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
573 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
574 optimized localentry:0 stubs.
575 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
576 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
577 localentry:0 stubs.
578 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
579 DT_PPC64_OPT.
580 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
581
8c65b54f
CS
5822017-05-30 Casey Smith <clegg89@gmail.com>
583
584 PR ld/21523
585 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
586 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
587
64984c22
AK
5882017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
589
590 * cpu-arc.c (arc_compatible): New function.
591
37cd3877
AK
5922017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
593
594 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
595
8e2f54bc
L
5962017-05-30 H.J. Lu <hongjiu.lu@intel.com>
597
598 PR binutils/21519
599 * bfdio.c (bfd_get_file_size): New function.
600 * bfd-in2.h: Regenerated.
601
8e7f04f1 6022017-05-23 Dilian Palauzov <git-dpa@aegee.org>
603
604 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
605 comments.
606
25f94347
L
6072017-05-22 H.J. Lu <hongjiu.lu@intel.com>
608
609 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
610 dynobj instead of htab->elf.dynobj.
611
e5713223
MR
6122017-05-19 Maciej W. Rozycki <macro@imgtec.com>
613
614 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
615 and function.
616 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
617 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
618 actual number of internal relocations retrieved. Adjust
619 function description.
620 (bfd_elf64_canonicalize_reloc): Remove macro.
621 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
622
64517994
JM
6232017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
624
625 * archures.c (bfd_mach_sparc_v9m8): Define.
626 (bfd_mach_sparc_v8plusm8): Likewise.
627 (bfd_mach_sparc_v9_p): Adjust to M8.
628 (bfd_mach_sparc_64bit_p): Likewise.
629 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
630 bfd_mach_sparc_v8plusm8.
631 * bfd-in2.h: Regenerated.
632 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
633 sparc:v8plusm8.
634 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
635 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
636 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
637 SHA3.
638 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
639 bfd_mach_sparc_v8plusm8.
640
eb026f09
AM
6412017-05-19 Alan Modra <amodra@gmail.com>
642
643 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
644 debug and special sections when no non-note alloc sections in an
645 object are kept.
646
535b785f
AM
6472017-05-18 Alan Modra <amodra@gmail.com>
648
649 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
650 * elf-m10300.c: Likewise.
651 * elf.c: Likewise.
652 * elf32-arc.c: Likewise.
653 * elf32-bfin.c: Likewise.
654 * elf32-m68k.c: Likewise.
655 * elf32-nds32.c: Likewise.
656 * elf32-tilepro.c: Likewise.
657 * elflink.c: Likewise.
658 * elfnn-aarch64.c: Likewise.
659 * elfnn-riscv.c: Likewise.
660 * elfxx-tilegx.c: Likewise.
661 * mach-o.c: Likewise.
662 * peXXigen.c: Likewise.
663 * vms-alpha.c: Likewise.
664 * vms-lib.c: Likewise.
665
b7c871ed
L
6662017-05-17 H.J. Lu <hongjiu.lu@intel.com>
667
668 PR ld/20882
669 * elflink.c (elf_gc_mark_debug_section): New function.
670 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
671 referenced by kept debug sections.
672
bc4e12de
AM
6732017-05-16 Alan Modra <amodra@gmail.com>
674
675 * elf-m10300.c: Rename occurrences of non_ir_ref.
676 * elf32-arm.c: Likewise.
677 * elf32-bfin.c: Likewise.
678 * elf32-cr16.c: Likewise.
679 * elf32-cris.c: Likewise.
680 * elf32-d10v.c: Likewise.
681 * elf32-dlx.c: Likewise.
682 * elf32-fr30.c: Likewise.
683 * elf32-frv.c: Likewise.
684 * elf32-hppa.c: Likewise.
685 * elf32-i370.c: Likewise.
686 * elf32-i386.c: Likewise.
687 * elf32-iq2000.c: Likewise.
688 * elf32-lm32.c: Likewise.
689 * elf32-m32c.c: Likewise.
690 * elf32-m32r.c: Likewise.
691 * elf32-m68hc1x.c: Likewise.
692 * elf32-m68k.c: Likewise.
693 * elf32-mcore.c: Likewise.
694 * elf32-metag.c: Likewise.
695 * elf32-microblaze.c: Likewise.
696 * elf32-moxie.c: Likewise.
697 * elf32-msp430.c: Likewise.
698 * elf32-mt.c: Likewise.
699 * elf32-nios2.c: Likewise.
700 * elf32-or1k.c: Likewise.
701 * elf32-ppc.c: Likewise.
702 * elf32-rl78.c: Likewise.
703 * elf32-s390.c: Likewise.
704 * elf32-score.c: Likewise.
705 * elf32-score7.c: Likewise.
706 * elf32-sh.c: Likewise.
707 * elf32-tic6x.c: Likewise.
708 * elf32-tilepro.c: Likewise.
709 * elf32-v850.c: Likewise.
710 * elf32-vax.c: Likewise.
711 * elf32-xstormy16.c: Likewise.
712 * elf32-xtensa.c: Likewise.
713 * elf64-alpha.c: Likewise.
714 * elf64-hppa.c: Likewise.
715 * elf64-ia64-vms.c: Likewise.
716 * elf64-mmix.c: Likewise.
717 * elf64-ppc.c: Likewise.
718 * elf64-s390.c: Likewise.
719 * elf64-sh64.c: Likewise.
720 * elf64-x86-64.c: Likewise.
721 * elflink.c: Likewise.
722 * elfnn-aarch64.c: Likewise.
723 * elfnn-ia64.c: Likewise.
724 * elfnn-riscv.c: Likewise.
725 * elfxx-mips.c: Likewise.
726 * elfxx-sparc.c: Likewise.
727 * elfxx-tilegx.c: Likewise.
728 * linker.c: Likewise.
729
4070765b
AM
7302017-05-16 Alan Modra <amodra@gmail.com>
731
732 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
733 * elflink.c (elf_link_add_object_symbols): Update to use
734 non_ir_ref_dynamic.
735 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
736 non_ir_ref.
737 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
738
25499ac7
MR
7392017-05-15 Maciej W. Rozycki <macro@imgtec.com>
740
741 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
742
73caa85d
L
7432017-05-12 H.J. Lu <hongjiu.lu@intel.com>
744
745 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
746 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
747 properties.
748 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
749
f2c29a16
L
7502017-05-11 H.J. Lu <hongjiu.lu@intel.com>
751
752 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
753 to plt_second.
754 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
755 to plt_second/plt_second_eh_frame.
756 (elf_x86_64_link_hash_newfunc): Updated.
757 (elf_x86_64_allocate_dynrelocs): Likewise.
758 (elf_x86_64_size_dynamic_sections): Likewise.
759 (elf_x86_64_relocate_section): Likewise.
760 (elf_x86_64_finish_dynamic_symbol): Likewise.
761 (elf_x86_64_finish_dynamic_sections): Likewise.
762 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
763 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
764 .plt.sec section.
765 (elf_backend_setup_gnu_properties): Updated. Create the
766 .plt.sec section instead of the .plt.sec section.
767
dc2be3d2
L
7682017-05-11 H.J. Lu <hongjiu.lu@intel.com>
769
770 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
771 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
772 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
773
db84b98a
JM
7742017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
775
776 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
777 (bfd_elf64_set_reloc): Define.
778 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
779
23186865
JM
7802017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
781
782 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
783 (struct bfd_target): New field _bfd_set_reloc.
784 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
785 * reloc.c (_bfd_generic_set_reloc): New function.
786 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
787 * nlm-target.h (nlm_set_reloc): Likewise.
788 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
789 * aout-tic30.c (MY_set_reloc): Likewise.
790 * aout-target.h (MY_set_reloc): Likewise.
791 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
792 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
793 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
794 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
795 * aout-adobe.c (aout_32_set_reloc): Likewise.
796 * bout.c (b_out_set_reloc): Likewise.
797 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
798 * i386os9k.c (aout_32_set_reloc): Likewise.
799 * ieee.c (ieee_set_reloc): Likewise.
800 * oasys.c (oasys_set_reloc): Likewise.
801 * som.c (som_set_reloc): Likewise.
802 * versados.c (versados_set_reloc): Likewise.
803 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
804 _bfd_generic_set_reloc.
805 (rs6000_xcoff64_aix_vec): LIkewise.
806 * libbfd.c (_bfd_norelocs_set_reloc): New function.
807 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
808 * i386msdos.c (msdos_set_reloc): Define to
809 _bfd_norelocs_set_reloc.
810 * elfcode.h (elf_set_reloc): Define.
811 * bfd-in2.h: Regenerated.
812
aab82f4c
L
8132017-05-10 H.J. Lu <hongjiu.lu@intel.com>
814
815 PR ld/21481
816 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
817 for IFUNC function address.
818
53a346d8
CZ
8192017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
820
821 * elf32-arc.c (FEATURE_LIST_NAME): Define.
822 (CONFLICT_LIST): Likewise.
823 (opcode/arc-attrs.h): Include.
824 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
825 (arc_extract_features): New file.
826 (arc_stralloc): Likewise.
827 (arc_elf_merge_attributes): Likewise.
828 (arc_elf_merge_private_bfd_data): Use object attributes.
829 (bfd_arc_get_mach_from_attributes): New function.
830 (arc_elf_object_p): Use object attributes.
831 (arc_elf_final_write_processing): Likewise.
832 (elf32_arc_obj_attrs_arg_type): New function.
833 (elf32_arc_obj_attrs_handle_unknown): Likewise.
834 (elf32_arc_section_from_shdr): Likewise.
835 (elf_backend_obj_attrs_vendor): Define.
836 (elf_backend_obj_attrs_section): Likewise.
837 (elf_backend_obj_attrs_arg_type): Likewise.
838 (elf_backend_obj_attrs_section_type): Likewise.
839 (elf_backend_obj_attrs_handle_unknown): Likewise.
840 (elf_backend_section_from_shdr): Likewise.
841
e645cf40
AG
8422017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
843
844 PR ld/21458
845 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
846 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
847 and the destination is a Thumb symbol.
848
dd9e66ee
L
8492017-05-08 H.J. Lu <hongjiu.lu@intel.com>
850
851 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
852 initializer to silence GCC 4.2.
853 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
854
38b12349
L
8552017-05-08 H.J. Lu <hongjiu.lu@intel.com>
856
857 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
858 (LAZY_PLT_ENTRY_SIZE): This.
859 (NON_LAZY_PLT_ENTRY_SIZE): New.
860 (elf_x86_64_plt0_entry): Renamed to ...
861 (elf_x86_64_lazy_plt0_entry): This.
862 (elf_x86_64_plt_entry): Renamed to ...
863 (elf_x86_64_lazy_plt_entry): This.
864 (elf_x86_64_bnd_plt0_entry): Renamed to ...
865 (elf_x86_64_lazy_bnd_plt0_entry): This.
866 (elf_x86_64_legacy_plt_entry): Removed.
867 (elf_x86_64_bnd_plt_entry): Renamed to ...
868 (elf_x86_64_lazy_bnd_plt_entry): This.
869 (elf_x86_64_legacy_plt2_entry): Renamed to ...
870 (elf_x86_64_non_lazy_plt_entry): This.
871 (elf_x86_64_bnd_plt2_entry): Renamed to ...
872 (elf_x86_64_non_lazy_bnd_plt_entry): This.
873 (elf_x86_64_eh_frame_plt): Renamed to ...
874 (elf_x86_64_eh_frame_lazy_plt): This.
875 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
876 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
877 (elf_x86_64_eh_frame_plt_got): Renamed to ...
878 (elf_x86_64_eh_frame_non_lazy_plt): This.
879 (elf_x86_64_lazy_plt_layout): New.
880 (elf_x86_64_non_lazy_plt_layout): Likewise.
881 (elf_x86_64_plt_layout): Likewise.
882 (elf_x86_64_backend_data): Remove PLT layout information. Add
883 os for target system.
884 (GET_PLT_ENTRY_SIZE): Removed.
885 (elf_x86_64_lazy_plt): New.
886 (elf_x86_64_non_lazy_plt): Likewise.
887 (elf_x86_64_lazy_bnd_plt): Likewise.
888 (elf_x86_64_non_lazy_bnd_plt): Likewise.
889 (elf_x86-64_arch_bed): Updated.
890 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
891 (elf_x86_64_create_dynamic_sections): Removed.
892 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
893 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
894 (elf_x86-64_adjust_dynamic_symbol): Updated.
895 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
896 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
897 size for PLT0 if there is no PLT0. Get plt_entry_size from
898 non_lazy_plt for non-lazy PLT entries.
899 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
900 from non_lazy_plt for non-lazy PLT entries.
901 (elf_x86-64_relocate_section): Updated. Properly get PLT index
902 if there is no PLT0.
903 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
904 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
905 entries with non-lazy PLT layout. Don't fill the second and third
906 slots in the PLT entry if there is no PLT0.
907 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
908 if there is no PLT0. Set sh_entsize on the .plt.got section.
909 (compare_relocs): New.
910 (elf_x86_64_plt_type): Likewise.
911 (elf_x86_64_plt): Likewise.
912 (elf_x86_64_nacl_plt): New. Forward declaration.
913 (elf_x86_64_get_plt_sym_val): Removed.
914 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
915 against all dynamic relocations.
916 (elf_x86_64_link_setup_gnu_properties): New function.
917 (elf_backend_create_dynamic_sections): Updated.
918 (elf_backend_setup_gnu_properties): New.
919 (elf_x86_64_nacl_plt): New.
920 (elf_x86_64_nacl_arch_bed): Updated.
921
f604c2a2
L
9222017-05-08 H.J. Lu <hongjiu.lu@intel.com>
923
924 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
925 (LAZY_PLT_ENTRY_SIZE): This.
926 (NON_LAZY_PLT_ENTRY_SIZE): New.
927 (elf_i386_plt0_entry): Renamed to ...
928 (elf_i386_lazy_plt0_entry): This.
929 (elf_i386_plt_entry): Renamed to ...
930 (elf_i386_lazy_plt_entry): This.
931 (elf_i386_pic_plt0_entry): Renamed to ...
932 (elf_i386_pic_lazy_plt0_entry): This.
933 (elf_i386_pic_plt_entry): Renamed to ...
934 (elf_i386_pic_lazy_plt_entry): This.
935 (elf_i386_got_plt_entry): Renamed to ...
936 (elf_i386_non_lazy_plt_entry): This.
937 (elf_i386_pic_got_plt_entry): Renamed to ...
938 (elf_i386_pic_non_lazy_plt_entry): This.
939 (elf_i386_eh_frame_plt): Renamed to ...
940 (elf_i386_eh_frame_lazy_plt): This.
941 (elf_i386_eh_frame_plt_got): Renamed to ...
942 (elf_i386_eh_frame_non_lazy_plt): This.
943 (elf_i386_plt_layout): Renamed to ...
944 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
945 eh_frame_plt_got_size.
946 (elf_i386_non_lazy_plt_layout): New.
947 (elf_i386_plt_layout): Likewise.
948 (elf_i386_non_lazy_plt): Likewise.
949 (GET_PLT_ENTRY_SIZE): Removed.
950 (elf_i386_plt): Renamed to ...
951 (elf_i386_lazy_plt): This.
952 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
953 (elf_i386_arch_bed): Updated.
954 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
955 (elf_i386_create_dynamic_sections): Removed.
956 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
957 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
958 (elf_i386_adjust_dynamic_symbol): Updated.
959 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
960 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
961 size for PLT0 if there is no PLT0.
962 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
963 output section is discarded only if GOT isn't empty.
964 (elf_i386_relocate_section): Updated. Properly get PLT index
965 if there is no PLT0.
966 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
967 second and third slots in the PLT entry if there is no PLT0.
968 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
969 if there is no PLT0. Set sh_entsize on the .plt.got section.
970 (elf_i386_nacl_plt): Forward declaration.
971 (elf_i386_get_plt_sym_val): Removed.
972 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
973 against all dynamic relocations.
974 (elf_i386_link_setup_gnu_properties): New function.
975 (elf_backend_create_dynamic_sections): Updated.
976 (elf_backend_setup_gnu_properties): New.
977 (elf_i386_nacl_plt): Updated.
978 (elf_i386_nacl_arch_bed): Likewise.
979 (elf_i386_vxworks_arch_bed): Likewise.
980
046734ff
TP
9812017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
982
983 * elflink.c (elf_output_implib): Remove executable flag from import
984 library bfd.
985 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
986 library is a relocatable object file.
987
b660e9eb
SKS
9882017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
989
990 PR ld/21404
991 * elf32-avr.c (avr_should_move_sym): New function.
992 (avr_should_reduce_sym_size): Likewise.
993 (avr_should_increase_sym_size): Likewise.
994 (elf32_avr_relax_delete_bytes): Adjust symbol values
995 and sizes by calling new functions.
996
763a5fa4
PD
9972017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
998
999 * config.bfd (riscv32-*): Enable rv64.
1000
73ec947d
AM
10012017-05-02 Alan Modra <amodra@gmail.com>
1002
1003 PR 21384
1004 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
1005 rather than h->root.type == bfd_link_hash_new.
1006 (bfd_elf_record_link_assignment): Similarly, call
1007 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
1008
a941291c
AM
10092017-04-29 Alan Modra <amodra@gmail.com>
1010
1011 PR 21432
1012 * reloc.c (reloc_offset_in_range): New function.
1013 (bfd_perform_relocation, bfd_install_relocation): Use it.
1014 (_bfd_final_link_relocate): Likewise.
1015
750eaa47
L
10162017-04-28 H.J. Lu <hongjiu.lu@intel.com>
1017
1018 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
1019 before using .plt.got.
1020 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1021
5b66fac4
L
10222017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1023
1024 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
1025 instead of "+=" to update 0.
1026
de9a3c42
L
10272017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1028
1029 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
1030 .plt.got section here.
1031 (elf_i386_check_relocs): Don't create the .plt.got section.
1032 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
1033 the .plt.got and .plt.bnd sections here.
1034 (elf_x86_64_check_relocs): Don't create the .plt.got nor
1035 .plt.bnd sections.
1036
da3d25af
L
10372017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1038
1039 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
1040 has_bnd_reloc.
1041 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
1042 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
1043 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
1044 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
1045 has_bnd_reloc.
1046
fba37edd
L
10472017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1048
1049 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
1050 to return bfd *.
1051 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
1052 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
1053 the first relocatable ELF input with GNU properties.
1054
1f78f649
L
10552017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1056
1057 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
1058 VxWorks for non-PIC.
1059
76c20d54
AM
10602017-04-27 Alan Modra <amodra@gmail.com>
1061
1062 * elf-bfd.h (struct elf_backend_data): Make asection param of
1063 elf_backend_eh_frame_address_size const.
1064 (_bfd_elf_eh_frame_address_size): Likewise.
1065 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
1066 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
1067 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
1068 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
1069 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
1070 (next_cie_fde_offset): Constify params.
1071 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
1072
d7153c4a
AM
10732017-04-27 Alan Modra <amodra@gmail.com>
1074
1075 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
1076 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
1077 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
1078 aug_data_len.
1079 (offset_adjust): New function.
1080 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
1081 (adjust_eh_frame_local_symbols): Likewise.
1082 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
1083 after changing anything. Return true if anything changed.
1084 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
1085 _bfd_elf_adjust_eh_frame_global_symbol for globals.
1086
641338d8
AM
10872017-04-27 Alan Modra <amodra@gmail.com>
1088
1089 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
1090 when force_local.
1091
21d68fcd
AM
10922017-04-27 Alan Modra <amodra@gmail.com>
1093
1094 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1095 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
1096 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
1097 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
1098 for undef and undefweak dyn_relocs.
1099 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1100 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
1101 (allocate_got, allocate_dynrelocs): Likewise.
1102 (ppc64_elf_relocate_section): Likewise.
1103
97d343d4
L
11042017-04-26 H.J. Lu <hongjiu.lu@intel.com>
1105
1106 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
1107 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
1108 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
1109 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
1110
04b31182
NC
11112017-04-26 Nick Clifton <nickc@redhat.com>
1112
1113 PR binutils/21434
1114 * reloc.c (bfd_perform_relocation): Check for a negative address
1115 in the reloc.
1116
23ec1e32
MR
11172017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1118
1119 PR ld/21334
1120 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
1121 member.
1122 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
1123 (elf_backend_always_renumber_dynsyms): Define.
1124 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
1125 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
1126 * elflink.c (bfd_elf_size_dynamic_sections): Also call
1127 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
1128 it.
1129 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1130
c46cec3a
MR
11312017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1132
1133 * elflink.c (bfd_elf_size_dynamic_sections): Only call
1134 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
1135 sections have been created.
1136
e63d1232
NC
11372017-04-26 Nick Clifton <nickc@redhat.com>
1138
1139 PR binutils/21431
1140 * compress.c (bfd_init_section_compress_status): Check the return
1141 value from bfd_malloc.
1142
9e9821dd
L
11432017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1144
1145 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
1146 no_finish_dynamic_symbol.
1147 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
1148 0.
1149 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
1150 weak symbol, don't make it dynamic.
1151 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
1152 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
1153 relocation for GOT reference.
1154 (elf_x86_64_finish_dynamic_symbol): Abort if
1155 no_finish_dynamic_symbol isn't 0.
1156
0dc9a308
L
11572017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1158
1159 PR ld/21402
1160 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
1161 undefined weak symbol, don't make it dynamic.
1162 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
1163 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1164 relocation for R_386_GOT32.
1165
1587442d
L
11662017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1167
1168 PR ld/21425
1169 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
1170
7eacd66b
AM
11712017-04-23 Alan Modra <amodra@gmail.com>
1172
1173 PR 21414
1174 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
1175 * elf.c (lcomm_sym): New.
1176 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
1177 * bfd-in2.h: Regenerate.
1178
bce964aa
AM
11792017-04-23 Alan Modra <amodra@gmail.com>
1180
1181 PR 21412
1182 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
1183 parameters and comment.
1184 (_bfd_elf_get_reloc_section): Delete.
1185 (_bfd_elf_plt_get_reloc_section): Declare.
1186 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
1187 New functions. Don't blindly skip over assumed .rel/.rela prefix.
1188 Extracted from..
1189 (_bfd_elf_get_reloc_section): ..here. Delete.
1190 (assign_section_numbers): Call elf_get_reloc_section.
1191 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
1192 * elfxx-target.h (elf_backend_get_reloc_section): Update.
1193
97e83a10
AM
11942017-04-23 Alan Modra <amodra@gmail.com>
1195
1196 PR 21409
1197 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
1198 no symbols.
1199
e133d005
L
12002017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1201
1202 PR ld/21402
1203 * elf32-i386.c (elf_i386_link_hash_entry): Add
1204 no_finish_dynamic_symbol.
1205 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
1206 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
1207 symbol, don't make it dynamic in PIE.
1208 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
1209 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1210 relocation for R_386_GOT32
1211 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
1212 isn't 0.
1213
3c5fce9b
L
12142017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1215
1216 PR ld/19617
1217 PR ld/21086
1218 * elflink.c (elf_link_add_object_symbols): Require
1219 --no-dynamic-linker with -E/--dynamic-list when creating
1220 dynamic sections.
1221
0fad2956
MR
12222017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1223
1224 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
1225 if forced local.
1226
64575f78
MR
12272017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1228
1229 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
1230 dynamic symbol sorting.
1231
59fa66c5
L
12322017-04-20 H.J. Lu <hongjiu.lu@intel.com>
1233
1234 PR ld/21382
1235 * elflink.c (elf_link_add_object_symbols): Preserve
1236 dynamic_ref_after_ir_def when restoring the symbol table for
1237 unneeded dynamic object.
1238
e492d2f8
L
12392017-04-19 H.J. Lu <hongjiu.lu@intel.com>
1240
1241 PR ld/21401
1242 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
1243 on on undefined IFUNC symbol in the second PLT.
1244
10169134
WAF
12452017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
1246
1247 * peXXigen.c (pe_print_reloc): Correct chunk_end.
1248
954b63d4
AM
12492017-04-19 Alan Modra <amodra@gmail.com>
1250
1251 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
1252 or make dynamic for info->dynamic_undefined_weak 0 and 1.
1253 * elf32-ppc.c:Formatting.
1254 (ensure_undefweak_dynamic): Don't make dynamic when
1255 info->dynamic_undefined_weak is zero.
1256 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1257 info->dynamic_undefined_weak. Discard undef dyn_relocs when
1258 not default visibility. Discard undef and undefweak
1259 dyn_relocs earlier.
1260 (ppc_elf_relocate_section): Adjust to suit.
1261 * elf64-ppc.c: Formatting.
1262 (ensure_undefweak_dynamic): Don't make dynamic when
1263 info->dynamic_undefined_weak is zero.
1264 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1265 info->dynamic_undefined_weak. Discard them earlier.
1266
e6699019
L
12672017-04-17 H.J. Lu <hongjiu.lu@intel.com>
1268
1269 PR ld/21389
1270 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
1271 before generating the version definition section.
1272
c5d37467
AM
12732017-04-17 Alan Modra <amodra@gmail.com>
1274
1275 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
1276 state when a regular object file defines a symbol with
1277 incompatible type to that defined by an earlier shared lib.
1278
63a5468a
AM
12792017-04-13 Alan Modra <amodra@gmail.com>
1280
1281 * coffcode.h: Wrap some overly long _bfd_error_handler args.
1282 * elf.c: Likewise.
1283 * elf32-arm.c: Likewise.
1284 * elf32-i386.c: Likewise.
1285 * elf32-mep.c: Likewise.
1286 * elf64-ia64-vms.c: Likewise.
1287 * elf64-x86-64.c: Likewise.
1288 * elflink.c: Likewise.
1289 * elfnn-ia64.c: Likewise.
1290 * elfxx-mips.c: Likewise.
1291
dae82561
AM
12922017-04-13 Alan Modra <amodra@gmail.com>
1293
1294 * aoutx.h: Use %B and %A in error messages throughout file.
1295 * aout-cris.c: Likewise.
1296 * archive.c: Likewise.
1297 * binary.c: Likewise.
1298 * coff-rs6000.c: Likewise.
1299 * coff-tic4x.c: Likewise.
1300 * coffcode.h: Likewise.
1301 * coffgen.c: Likewise.
1302 * cofflink.c: Likewise.
1303 * coffswap.h: Likewise.
1304 * cpu-arm.c: Likewise.
1305 * elf-eh-frame.c: Likewise.
1306 * elf-m10300.c: Likewise.
1307 * elf.c: Likewise.
1308 * elf32-arc.c: Likewise.
1309 * elf32-arm.c: Likewise.
1310 * elf32-bfin.c: Likewise.
1311 * elf32-frv.c: Likewise.
1312 * elf32-iq2000.c: Likewise.
1313 * elf32-m32c.c: Likewise.
1314 * elf32-microblaze.c: Likewise.
1315 * elf32-nds32.c: Likewise.
1316 * elf32-rl78.c: Likewise.
1317 * elf32-rx.c: Likewise.
1318 * elf32-score.c: Likewise.
1319 * elf32-score7.c: Likewise.
1320 * elf32-sh64.c: Likewise.
1321 * elf32-v850.c: Likewise.
1322 * elf32-vax.c: Likewise.
1323 * elf32-visium.c: Likewise.
1324 * elf64-ia64-vms.c: Likewise.
1325 * elf64-mmix.c: Likewise.
1326 * elf64-sh64.c: Likewise.
1327 * elfcode.h: Likewise.
1328 * elfnn-aarch64.c: Likewise.
1329 * elfnn-ia64.c: Likewise.
1330 * elfxx-mips.c: Likewise.
1331 * hpux-core.c: Likewise.
1332 * ieee.c: Likewise.
1333 * ihex.c: Likewise.
1334 * linker.c: Likewise.
1335 * merge.c: Likewise.
1336 * mmo.c: Likewise.
1337 * oasys.c: Likewise.
1338 * pdp11.c: Likewise.
1339 * peXXigen.c: Likewise.
1340 * rs6000-core.c: Likewise.
1341 * vms-alpha.c: Likewise.
1342 * xcofflink.c: Likewise.
1343
c08bb8dd
AM
13442017-04-13 Alan Modra <amodra@gmail.com>
1345
1346 * bfd.c (PRINT_TYPE): Define.
1347 (_doprnt): New function.
1348 (error_handler_internal): Use _doprnt.
1349 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
1350 calls in their natural order, throughout file.
1351 * coff-mcore.c: Likewise.
1352 * coff-ppc.c: Likewise.
1353 * coff-tic80.c: Likewise.
1354 * cofflink.c: Likewise.
1355 * elf-s390-common.c: Likewise.
1356 * elf.c: Likewise.
1357 * elf32-arm.c: Likewise.
1358 * elf32-i386.c: Likewise.
1359 * elf32-m32r.c: Likewise.
1360 * elf32-msp430.c: Likewise.
1361 * elf32-spu.c: Likewise.
1362 * elf64-ia64-vms.c: Likewise.
1363 * elf64-sparc.c: Likewise.
1364 * elf64-x86-64.c: Likewise.
1365 * elflink.c: Likewise.
1366 * elfnn-aarch64.c: Likewise.
1367 * elfnn-ia64.c: Likewise.
1368 * elfxx-mips.c: Likewise.
1369
10463f39
AM
13702017-04-13 Alan Modra <amodra@gmail.com>
1371
1372 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
1373 branch veneers" error. Fix double space and format message.
1374 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
1375 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
1376
4af8774e
AM
13772017-04-13 Alan Modra <amodra@gmail.com>
1378
1379 * bfd-in2.h: Regenerate.
1380
e4097f5e
L
13812017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1382
1383 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
1384 extra `\n' in warning/error messages.
1385 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
1386 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1387
537616aa
L
13882017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1389
1390 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
1391 processor-specific properties with generic ELF target vector.
1392
bb1dd176
QZ
13932017-04-10 Qing Zhao <qing.zhao@oracle.com>
1394
1395 * elf32-sparc.c (elf_backend_fixup_symbol): New.
1396 * elf64-sparc.c (elf_backend_fixup_symbol): New.
1397 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
1398 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
1399 has_non_got_reloc.
1400 (link_hash_newfunc): Initialize has_got_reloc and
1401 has_non_got_reloc.
1402 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
1403 section.
1404 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
1405 has_non_got_reloc.
1406 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
1407 has_non_got_reloc.
1408 (_bfd_sparc_elf_fixup_symbol): New function.
1409 (allocate_dynrelocs): Don't allocate space for dynamic
1410 relocations and discard relocations against resolved undefined
1411 weak symbols in executable. Don't make resolved undefined weak
1412 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
1413 relocation against undefined weak symbols in PIE.
1414 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
1415 relocations against resolved undefined weak symbols in PIE
1416 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
1417 without ynamic PLT/GOT relocations for resolved undefined weak
1418 symbols.
1419 Don't generate dynamic relocation against resolved undefined
1420 weak symbol in executable.
1421 (pie_finish_undefweak_symbol): New function.
1422 (_bfd_sparc_elf_finish_dynamic_sections): Call
1423 pie_finish_undefweak_symbol on all symbols in PIE.
1424 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
1425 (_bfd_sparc_elf_fixup_symbol): New function.
1426
d236cfd4
NC
14272017-04-10 Nick Clifton <nickc@redhat.com>
1428
1429 * config.bfd: Remove ns32k from obsolete list.
1430
6f9dbcd4
AM
14312017-04-10 Alan Modra <amodra@gmail.com>
1432
1433 PR 21287
1434 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
1435 (special_sections_i): Likewise for .init_array.
1436 (special_sections_p): Likewise for .preinit_array.
1437
8170f769
L
14382017-04-07 H.J. Lu <hongjiu.lu@intel.com>
1439
1440 PR ld/19579
1441 PR ld/21306
1442 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
1443 ELF_COMMON_DEF_P for common symbols.
1444 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1445 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1446 * elflink.c (_bfd_elf_merge_symbol): Revert commits
1447 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
1448 07492f668d2173da7a2bda3707ff0985e0f460b6.
1449
49f4617b
PA
14502017-04-07 Pedro Alves <palves@redhat.com>
1451
1452 * opncls.c (bfd_get_debug_link_info): Rename to...
1453 (bfd_get_debug_link_info_1): ... this. Change type of second
1454 parameter to void pointer. Adjust.
1455 (bfd_get_debug_link_info): Reimplement on top of
1456 bfd_get_debug_link_info_1.
1457 (separate_debug_file_exists, separate_alt_debug_file_exists):
1458 Change type of second parameter to void pointer. Adjust.
1459 (get_func_type, check_func_type): Change type of second parameter
1460 to void pointer.
1461 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
1462 the callback functions instead of passing the address of a local.
1463 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
1464 find_separate_debug_file.
1465 (get_alt_debug_link_info_shim): Change type of second parameter to
1466 void pointer. Adjust.
1467 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
1468 find_separate_debug_file.
1469 (get_build_id_name, bfd_boolean check_build_id_file): Change type
1470 of second parameter to void pointer. Adjust.
1471 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
1472 pointer local to find_separate_debug_file.
1473
14742017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
1475
1476 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
1477 external symbols with a definition.
1478 (_bfd_coff_gc_mark_extra_sections): Fix typo.
1479
86abf93a
AM
14802017-04-07 Alan Modra <amodra@gmail.com>
1481
1482 * po/SRC-POTFILES.in: Regenerate.
1483
8dea77f0
AM
14842017-04-05 Alan Modra <amodra@gmail.com>
1485
1486 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
1487 reference counting.
1488
477bdd39
JT
14892017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
1490
1491 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
1492 numbers for DataDirectory entry indicies passed to
1493 add_data_entry().
1494
a91e1603
L
14952017-04-04 H.J. Lu <hongjiu.lu@intel.com>
1496
1497 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
1498 each GNU_MBIND section and align GNU_MBIND section to page size.
1499 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
1500 segment for each GNU_MBIND section.
1501 (_bfd_elf_init_private_section_data): Copy sh_info from input
1502 for GNU_MBIND section.
1503
b5292032
PD
15042017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
1505
1506 * elfnn-riscv.c (GP_NAME): Delete.
1507 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
1508 (_bfd_riscv_relax_lui): Likewise.
1509
ad32986f
NC
15102017-04-04 Nick Clifton <nickc@redhat.com>
1511
1512 PR binutils/21342
1513 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
1514 dereference.
1515 (bfd_elf_final_link): Only initialize the extended symbol index
1516 section if there are extended symbol tables to list.
1517
46bed679
L
15182017-04-03 H.J. Lu <hongjiu.lu@intel.com>
1519
1520 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
1521 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
1522 * configure.ac (elf): Add elf-properties.lo.
1523 * Makefile.in: Regenerated.
1524 * configure: Likewise.
1525 * elf-bfd.h (elf_property_kind): New.
1526 (elf_property): Likewise.
1527 (elf_property_list): Likewise.
1528 (elf_properties): Likewise.
1529 (_bfd_elf_parse_gnu_properties): Likewise.
1530 (_bfd_elf_get_property): Likewise.
1531 (_bfd_elf_link_setup_gnu_properties): Likewise.
1532 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
1533 and setup_gnu_properties.
1534 (elf_obj_tdata): Add properties.
1535 * elf-properties.c: New file.
1536 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
1537 (elf_i386_merge_gnu_properties): Likewise.
1538 (elf_backend_parse_gnu_properties): Likewise.
1539 (elf_backend_merge_gnu_properties): Likewise.
1540 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1541 (elf_x86_64_merge_gnu_properties): Likewise.
1542 (elf_backend_parse_gnu_properties): Likewise.
1543 (elf_backend_merge_gnu_properties): Likewise.
1544 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
1545 (elf_backend_parse_gnu_properties): Likewise.
1546 (elf_backend_setup_gnu_properties): Likewise.
1547 (elfNN_bed): Add elf_backend_parse_gnu_properties,
1548 elf_backend_merge_gnu_properties and
1549 elf_backend_setup_gnu_properties.
1550
f96bd6c2
PC
15512017-03-30 Pip Cet <pipcet@gmail.com>
1552
1553 * elf32-wasm32.c: Add relocation code, two relocs.
1554 * reloc.c: Add wasm32 relocations.
1555 * libbfd.h: Regenerate.
1556 * bfd-in2.h: Regenerate.
1557 * bfd/po/bfd.pot: Regenerate.
1558
e643cb45
NC
15592017-03-29 Nick Clifton <nickc@redhat.com>
1560
1561 PR binutils/18025
1562 * coff-bfd.h (struct coff_section_data): Add new fields:
1563 saved_bias and bias.
1564 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
1565 computed for PE binaries.
1566 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
1567 missing abbrev.
1568
086554e8
HPN
15692017-03-28 Hans-Peter Nilsson <hp@axis.com>
1570
1571 PR ld/16044
1572 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
1573 to handle a local symbol with a hash-symbol-entry; without PLT.
1574 Add BFD_ASSERT for an incidental case with GOT entry present.
1575 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
1576 isn't forced-or-set local.
1577
a6be0538
PC
15782017-03-27 Pip Cet <pipcet@gmail.com>
1579
1580 * wasm-module.c: New file to support WebAssembly modules.
1581 * wasm-module.h: New file to support WebAssembly modules.
1582 * doc/webassembly.texi: Start documenting wasm-module.c.
1583 * config.bfd: Add wasm_vec.
1584 * targets.c: Likewise.
1585 * configure.ac: Likewise.
1586 * Makefile.am: Add entries for wasm-module.c.
1587 * Makefile.in: Regenerate.
1588 * configure: Regenerate.
1589 * po/SRC-POTFILES.in: Regenerate.
1590
79b1d3cb
PC
15912017-03-27 Pip Cet <pipcet@gmail.com>
1592
1593 * cpu-wasm32.c: New file to support wasm32 architecture.
1594 * elf32-wasm32.c: New file to support wasm32 architecture.
1595 * Makefile.am: Add wasm32 architecture.
1596 * archures.c: Likewise.
1597 * config.bfd: Likewise.
1598 * configure.ac: Likewise.
1599 * targets.c: Likewise.
1600 * Makefile.in: Regenerate.
1601 * bfd-in2.h: Regenerate.
1602 * configure: Regenerate.
1603 * po/SRC-POTFILES.in: Regenerate.
1604
aaed6f5b
AM
16052017-03-20 Alan Modra <amodra@gmail.com>
1606
1607 PR 21266
1608 * elf64-ppc.c (compare_symbols): Stabilize sort.
1609
82e66161
AM
16102017-03-18 Alan Modra <amodra@gmail.com>
1611
1612 * elf64-ppc.c (struct ppc_link_hash_table): Add
1613 local_ifunc_resolver and maybe_local_ifunc_resolver.
1614 (ppc_build_one_stub): Set flags on emitting dynamic
1615 relocation to ifunc.
1616 (ppc64_elf_relocate_section): Likewise.
1617 (ppc64_elf_finish_dynamic_symbol): Likewise.
1618 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
1619 local dynamic relocs to ifuncs.
1620 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
1621 local_ifunc_resolver and maybe_local_ifunc_resolver.
1622 (ppc_elf_relocate_section): Set flag on emitting dynamic
1623 relocation to ifuncs.
1624 (ppc_elf_finish_dynamic_symbol): Likewise.
1625 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
1626 dynamic relocs to ifuncs.
1627
f955cccf
NC
16282017-03-13 Nick Clifton <nickc@redhat.com>
1629
1630 PR binutils/21202
1631 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
1632 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
1633 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
1634 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
1635 * bfd-in2.h: Regenerate.
1636 * libbfd.h: Regenerate.
1637 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
1638 names.
1639 (IS_AARCH64_TLSDESC_RELOC): Likewise.
1640 (elfNN_aarch64_howto_table): Likewise.
1641 (aarch64_tls_transition_without_check): Likewise.
1642 (aarch64_reloc_got_type): Likewise.
1643 (elfNN_aarch64_final_link_relocate): Likewise.
1644 (elfNN_aarch64_tls_relax): Likewise.
1645 (elfNN_aarch64_relocate_section): Likewise.
1646 (elfNN_aarch64_gc_sweep_hook): Likewise.
1647 (elfNN_aarch64_check_relocs): Likewise.
1648 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1649 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1650
4aef7643
AM
16512017-03-11 Alan Modra <amodra@gmail.com>
1652
1653 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
1654 parameter is in fact used. Whitespace fixes.
1655 * elf64-ppc.c: Likewise.
1656
f03265d9
ST
16572017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
1658
1659 * rs6000-core.c (CORE_NEW): Simplify macro when
1660 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
1661
b1b07054
AM
16622017-03-07 Alan Modra <amodra@gmail.com>
1663
1664 PR 21224
1665 PR 20519
1666 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
1667 dyn_relocs check.
1668
2e0ce1c8
AM
16692017-03-05 Alan Modra <amodra@gmail.com>
1670
1671 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
1672 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
1673 (next_cie_fde_offset): New function.
1674 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
1675 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
1676 four bytes. Align CIEs to four or eight bytes depending on
1677 per_encoding_aligned8. Align FDEs according to their encoding.
1678 Pad last FDE to output section alignment.
1679 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
1680 assertion.
1681 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
1682 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
1683 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
1684
f98450c6
NC
16852017-03-02 Martin Bickel <binutils@ineranves.de>
1686
1687 PR ld/21212
1688 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 1689 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 1690
673cff9b
AM
16912017-03-02 Alan Modra <amodra@gmail.com>
1692
1693 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
1694
3de43e7b
AM
16952017-02-28 Alan Modra <amodra@gmail.com>
1696
1697 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
1698 (ppc64_elf_relocate_section): Likewise.
1699
4ef97a1b
AM
17002017-02-28 Alan Modra <amodra@gmail.com>
1701
1702 PR 20995
1703 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
1704 rather than elf32_nios2_hash_table or elf_hash_table.
1705 (create_got_section): Likewise.
1706 (nios2_elf32_finish_dynamic_symbol): Likewise.
1707 (nios2_elf32_adjust_dynamic_symbol): Likewise.
1708 (nios2_elf32_size_dynamic_sections): Likewise.
1709 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
1710 vars. Use htab equivalents directly instead. Don't create
1711 all dynamic sections on needing just the GOT. Use a goto
1712 rather than a fall-through with reloc test. Ensure
1713 htab->dynobj is set when making dynamic sreloc section.
1714 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
1715 equivalent directly instead. Don't segfault on looking for
1716 .dynamic when dynamic sections have not been created. Don't
1717 segfault on .got.plt being discarded.
1718 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
1719 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
1720 fixme and another not so relevant comment.
1721 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
1722 already set, set hash table dynobj on creating .sbss.
1723
7ba71655
AM
17242017-02-28 Alan Modra <amodra@gmail.com>
1725
1726 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
1727 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
1728 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
1729 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
1730 (ppc64_elf_relocate_section): Likewise.
1731 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
1732 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
1733 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
1734 * libbfd.h: Regenerate.
1735 * bfd-in2.h: Regenerate.
1736
afbf7e8e
AM
17372017-02-28 Alan Modra <amodra@gmail.com>
1738
1739 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
1740 dynamic .data.rel.ro read-only.
1741 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
1742 rather than section flags when deciding where copy reloc goes.
1743 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
1744 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
1745 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
1746 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
1747 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
1748 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
1749 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
1750 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
1751 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1752 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
1753 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
1754 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
1755 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1756 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1757 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
1758 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
1759 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1760 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1761 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
1762
0e392101
MR
17632017-02-28 Maciej W. Rozycki <macro@imgtec.com>
1764
1765 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
1766 `jalr $0, $25' instruction encoding.
1767
bd757ca7
NC
17682017-02-27 Nick Clifton <nickc@redhat.com>
1769
1770 PR ld/21180
1771 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
1772 generating a seg-fault when encountering a symbol that has been
1773 deleted by garbage collection.
1774
034fed0b
AM
17752017-02-25 Alan Modra <amodra@gmail.com>
1776
1777 * elf32-arc.c (struct dynamic_sections): Delete.
1778 (enum dyn_section_types): Delete.
1779 (dyn_section_names): Delete.
1780 (arc_create_dynamic_sections): Delete.
1781 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
1782 segfault on discarded .rela.plt section.
1783 (elf_arc_size_dynamic_sections): Formatting. Don't call
1784 arc_create_dynamic_sections. Don't allocate memory for sections
1785 handled by the generic linker. Correct code finding relocs in
1786 read-only sections. Set SEC_EXCLUDE on zero size .got,
1787 .got.plt, and .dynbss sections. Do set .interp for pies.
1788
d0f744f9
AW
17892017-02-24 Andrew Waterman <andrew@sifive.com>
1790
1791 * elfnn-riscv.c (GP_NAME): New macro.
1792 (riscv_global_pointer_value): Use it.
1793 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
1794 output section, consider only that section's alignment.
1795
5d58c733
MR
17962017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1797
1798 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
1799 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
1800 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
1801 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
1802
c1556ecd
MR
18032017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1804
1805 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
1806 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
1807 or misaligned.
1808
5499c7c7
AM
18092017-02-23 Alan Modra <amodra@gmail.com>
1810
1811 PR 20744
1812 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
1813 16D relocations.
1814 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
1815 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
1816 relocs.
1817
902e9fc7
MR
18182017-02-22 Maciej W. Rozycki <macro@imgtec.com>
1819
1820 PR ld/20828
1821 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
1822 processing ahead of the call to `elf_gc_sweep_symbol'.
1823
758d96d8
NC
18242017-02-22 Nick Clifton <nickc@redhat.com>
1825
1826 PR binutils/21193
1827 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
1828 created section 4-byte alignment.
1829
6528b6eb
AM
18302017-02-22 Alan Modra <amodra@gmail.com>
1831
1832 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
1833 on .got or .plt output section being discarded by script.
1834 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
1835 vxworks splt temp.
1836
24f1a751
AM
18372017-02-21 Alan Modra <amodra@gmail.com>
1838
1839 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
1840 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
1841
64487780
AM
18422017-02-20 Alan Modra <amodra@gmail.com>
1843
1844 PR 21181
1845 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
1846 if DT_RELSZ/DT_RELASZ is zero.
1847
6438d1be
NC
18482017-02-17 Nick Clifton <nickc@redhat.com>
1849
1850 * compress.c (bfd_get_full_section_contents): Remember to reduce
1851 compressed size by the sizeof the compression header when
1852 decompressing the contents.
1853
4bc26c69
PA
18542017-02-17 Pedro Alves <palves@redhat.com>
1855
1856 * srec.c (Chunk): Rename to ...
1857 (_bfd_srec_len): ... this.
1858 (S3Forced): Rename to ...
1859 (_bfd_srec_forceS3): ... this.
1860 * objcopy.c: Adjust all references.
1861
7ec22e0f
PA
18622017-02-17 Pedro Alves <palves@redhat.com>
1863
1864 * archive.c (bsd_write_armap): Rename to ...
1865 (_bfd_bsd_write_armap): ... this.
1866 (coff_write_armap): Rename to ...
1867 (_bfd_coff_write_armap): ... this.
1868 * libbfd-in.h (bsd_write_armap): Rename to ...
1869 (_bfd_bsd_write_armap): ... this.
1870 (coff_write_armap): Rename to ...
1871 (_bfd_coff_write_armap): ... this.
1872 * aout-target.h, aout-tic30.c: Adjust all users.
1873 * libbfd.h: Regenerate.
1874
8c8402cc
PA
18752017-02-17 Pedro Alves <palves@redhat.com>
1876
1877 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
1878 (warn_deprecated): Rename to ...
1879 (_bfd_warn_deprecated): ... this.
1880 * libbfd.c (warn_deprecated): Rename to ...
1881 (_bfd_warn_deprecated): ... this.
1882 * bfd-in2.h: Regenerate.
1883
c7c3d11b
PA
18842017-02-17 Pedro Alves <palves@redhat.com>
1885
1886 * bfdio.c (real_ftell): Rename to ...
1887 (_bfd_real_ftell): ... this.
1888 (real_fseek): Rename to ...
1889 (_bfd_real_fseek): ... this.
1890 (real_fopen): Rename to ...
1891 (_bfd_real_fopen): ... this.
1892 * libbfd-in.h (real_ftell): Rename to ...
1893 (_bfd_real_ftell): ... this.
1894 (real_fseek): Rename to ...
1895 (_bfd_real_fseek): ... this.
1896 (real_fopen): Rename to ...
1897 (_bfd_real_fopen): ... this.
1898 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
1899 * libbfd.h: Regenerate.
1900
4265548c
PA
19012017-02-17 Pedro Alves <palves@redhat.com>
1902
1903 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
1904 * libbfd.c (read_unsigned_leb128): Rename to ...
1905 (_bfd_read_unsigned_leb128): ... this.
1906 (read_signed_leb128): Rename to ...
1907 (_bfd_read_signed_leb128): ... this.
1908 (safe_read_leb128): Rename to ...
1909 (_bfd_safe_read_leb128): ... this.
1910 * libbfd-in.h (read_unsigned_leb128): Rename to ...
1911 (_bfd_read_unsigned_leb128): ... this.
1912 (read_signed_leb128): Rename to ...
1913 (_bfd_read_signed_leb128): ... this.
1914 (safe_read_leb128): Rename to ...
1915 (_bfd_safe_read_leb128): ... this.
1916 * libbfd.h: Renegerate.
1917
3239a423
AB
19182017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1919
1920 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
1921 before trying to fine matching file and line information.
1922
90ed9b8b
AB
19232017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1924
1925 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
1926 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
1927 not match current bfd, then reload debug information. Record bfd
1928 we're loading debug info for in the stash. If we have debug
1929 informatin in the cache then perform section placement before
1930 returning.
1931
a8c75b76
AM
19322017-02-16 Alan Modra <amodra@gmail.com>
1933
1934 PR 21000
1935 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
1936 * elfxx-target.h (elf_backend_no_page_alias): Define.
1937 (elfNN_bed): Init new field.
1938 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
1939 ensure PT_LOAD segment starts on a new page.
1940 * elf32-hppa.c (elf_backend_no_page_alias): Define.
1941
247d6c4c
AM
19422017-02-16 Alan Modra <amodra@gmail.com>
1943
1944 PR 21132
1945 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
1946 if pic.
1947
90571206
JW
19482017-02-16 Jiong Wang <jiong.wang@arm.com>
1949
1950 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
1951 * bfd-in2.h: Regenerated.
1952
2a568401
L
19532017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1954
1955 PR ld/21168
1956 * elf32-i386.c (elf_i386_relocate_section): Allow
1957 "lea foo@GOT, %reg" in PIC.
1958
a5def14f
L
19592017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1960
1961 PR ld/20244
1962 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
1963 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
1964 error against local IFUNC symbol without a base register for
1965 PIC.
1966
174d0a74
MR
19672017-02-15 Maciej W. Rozycki <macro@imgtec.com>
1968
1969 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
1970 `%P: %H:' with `info->callbacks->einfo'.
1971 (ppc_elf_relocate_section): Likewise.
1972 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1973 (ppc64_elf_edit_toc): Likewise.
1974 (ppc64_elf_relocate_section): Likewise.
1975
e278ae05
AM
19762017-02-14 Alan Modra <amodra@gmail.com>
1977
1978 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
1979 --gc-keep-exported, and test versioned field of sym rather than
1980 looking for @ in name.
1981
10ddfe62
PD
19822017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
1983
1984 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
1985 __global_pointer$.
1986
d11135f5
NC
19872017-02-13 Nick Clifton <nickc@redhat.com>
1988
1989 PR binutils/21151
1990 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
1991 unit length field.
1992
cc162427
AW
19932017-02-07 Andrew Waterman <andrew@sifive.com>
1994
1995 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
1996 entry size if PLT header is written.
1997
3d044c0c
SL
19982017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
1999
2000 Fix sparc64 dynamic relocation processing to use the dynamic
2001 symbol count.
2002 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
2003 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
2004 should be used.
2005
1b7e3d2f
NC
20062017-02-03 Nick Clifton <nickc@redhat.com>
2007
2008 PR 21096
2009 * coffcode.h (coff_write_object_contents): Enlarge size of
2010 s_name_buf in order to avoid compile time warning about possible
2011 integer truncation.
2012 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
2013 32-bits of insn value before printing into buffer.
2014
e17b0c35
MR
20152017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2016
2017 * elfxx-mips.c (mips_elf_hash_sort_data): Add
2018 `max_local_dynindx'.
2019 (mips_elf_sort_hash_table): Handle it.
2020 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
2021 symbols bump up `max_local_dynindx' rather than
2022 `max_non_got_dynindx'.
2023
55f8b9d2
MR
20242017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2025
2026 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
2027 `min_got_dynindx', `max_unref_got_dynindx' and
2028 `max_non_got_dynindx' members to the `bfd_size_type' data type.
2029 (mips_elf_sort_hash_table): Adjust accordingly.
2030
0f8c4b60
MR
20312017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2032
2033 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
2034 to access the hash table.
2035
17a80fa8
MR
20362017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2037
2038 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
2039 non-NULL `htab' to the beginning.
2040
8f56d4fd
MR
20412017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2042
2043 * elflink.c (elf_gc_sweep): Wrap overlong line.
2044
8b10b0b3
MR
20452017-01-30 Maciej W. Rozycki <macro@imgtec.com>
2046
2047 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
2048 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
2049 * elfxx-mips.c (mips_elf_link_hash_table): Add
2050 `ignore_branch_isa' member.
2051 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
2052 in branch relocation calculation as an error if
2053 `ignore_branch_isa' has been set.
2054 (_bfd_mips_elf_insn32): Rename to...
2055 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
2056 parameter to `insn32' and add an `ignore_branch_isa' parameter.
2057 Handle the new parameter.
2058
1fbd05e1
HPN
20592017-01-27 Hans-Peter Nilsson <hp@axis.com>
2060
22d9a0de
HPN
2061 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
2062 local variable dynobj.
2063
1fbd05e1
HPN
2064 PR ld/20995
2065 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
2066 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
2067 executable from read-only sections into sdynrelro.
2068 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
2069 dynamic relocs in sdynrelro.
2070 (elf_backend_want_dynrelro): Define.
2071
4a7324e1
SH
20722017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2073
2074 * config.bfd (*-*-rtemsaout*): Mark as removed.
2075
c75b4ebd
SH
20762017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2077
2078 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
2079 (arm-*-rtems*): Move to (arm*-*-eabi*).
2080 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
2081 (m68-*-rtems*): Move to (m68*-*-elf*).
2082
850d84f6
SH
20832017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2084
2085 * config.bfd (*-*-rtemscoff*): Mark as removed.
2086
b531344c
MR
20872017-01-24 Maciej W. Rozycki <macro@imgtec.com>
2088
2089 PR ld/20828
2090 * elflink.c (bfd_elf_record_link_assignment): Revert last
2091 change and don't ever clear `forced_local'. Set `mark'
2092 unconditionally.
2093 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
2094 file.
2095 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
2096 (bfd_elf_size_dynamic_sections): ... here.
2097 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
2098 and set `mark' instead in `__tls_get_addr_opt' processing.
2099 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
2100
f0158f44
AM
21012017-01-24 Alan Modra <amodra@gmail.com>
2102
2103 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
2104 where dynamic relocs are preferable. Allow ifunc too.
2105 (ensure_undefweak_dynamic): New function.
2106 (allocate_dynrelocs): Use it here. Move plt handling last and
2107 don't make symbols dynamic, simplifying loop. Only make undef
2108 weak symbols with GOT entries dynamic. Correct condition
2109 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
2110 comments. Remove goto.
2111 (ppc_elf_relocate_section): Correct test for using dynamic
2112 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2113 to suit. Set up explicit tls_index entries and implicit GOT
2114 tls_index entries resolvable at link time for
2115 __tls_get_addr_opt. Simplify test to clear mem for prelink.
2116 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
2117 (ensure_undefweak_dynamic): New function.
2118 (allocate_dynrelocs): Use it here. Only make undef weak symbols
2119 with GOT entries dynamic. Remove unnecessary test of
2120 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
2121 (ppc64_elf_relocate_section): Correct test for using dynamic
2122 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2123 to suit. Set up explicit tls_index entries and implicit GOT
2124 tls_index entries resolvable at link time for __tls_get_addr_opt.
2125 Simplify expression to clear mem for prelink.
2126
2d0ca824
YN
21272017-01-23 Yury Norov <ynorov@caviumnetworks.com>
2128
2129 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
2130
7f784814
JW
21312017-01-20 Jiong Wang <jiong.wang@arm.com>
2132
2133 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
2134 (elf_backend_hash_symbol): Define.
2135
81ff47b3
MR
21362017-01-18 Maciej W. Rozycki <macro@imgtec.com>
2137
2138 PR ld/20828
2139 * elflink.c (bfd_elf_record_link_assignment): Clear any
2140 `forced_local' marking for DSO symbols that are not being
2141 provided.
2142
640d6bfd
KLC
21432017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2144
2145 * elfnn-riscv.c (riscv_elf_object_p): New function.
2146
8361ed4d
L
21472017-01-12 H.J. Lu <hongjiu.lu@intel.com>
2148
2149 PR ld/21038
2150 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
2151 plt_bnd_eh_frame.
2152 (elf_x86_64_check_relocs): Create .eh_frame section for the
2153 .plt.bnd section.
2154 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2155 .eh_frame section for the .plt.bnd section.
2156 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2157 for the .plt.bnd section.
2158
2425a30e
NC
21592017-01-12 Nick Clifton <nickc@redhat.com>
2160
2161 PR binutils/20876
2162 * opncls.c (find_separate_debug_file): Add include_dirs
2163 parameter. Only include the directory part of the bfd's filename
2164 in search paths if include_dirs is true. Add a couple of extra
2165 locations for looking for debug files.
2166 ( bfd_follow_gnu_debuglink): Update invocation of
2167 find_separate_debug_file.
2168 (bfd_follow_gnu_debugaltlink): Likewise.
2169 (get_build_id): New function: Finds the build-id of the given bfd.
2170 (get_build_id_name): New function: Computes the name of the
2171 separate debug info file for a bfd, based upon its build-id.
2172 (check_build_id_file): New function: Checks to see if a separate
2173 debug info file exists at the given location, and that its
2174 build-id matches that of the original bfd.
2175 (bfd_follow_build_id_debuglink): New function: Finds a separate
2176 debug info file for a given bfd by using the build-id method.
2177 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
2178 method of locating a separate debug info file before using the
2179 debuglink method.
2180 * bfd-in2.h: Regenerate.
2181
9e659176
L
21822017-01-11 H.J. Lu <hongjiu.lu@intel.com>
2183
2184 PR ld/21038
2185 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
2186 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
2187 elf_x86_64_eh_frame_plt_got.
2188 (elf_x86_64_size_dynamic_sections): Get unwind info from
2189 elf_x86_64_bnd_arch_bed for the BND PLT.
2190
f2e2d2f5
JS
21912017-01-11 Jeremy Soller <jackpot51@gmail.com>
2192
2193 * config.bfd: Add entries for i686-redox and x86_64-redox.
2194
52b232b3
L
21952017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2196
2197 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
2198 to 4 bytes.
2199 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
2200 .eh_frame section to 4 bytes for x32.
2201 (elf_x86_64_check_relocs): Likewise.
2202
fff53dae
L
22032017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2204
2205 PR ld/20830
2206 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
2207 (PLT_GOT_FDE_LENGTH): Likewise.
2208 (elf_i386_plt_layout): Add eh_frame_plt_got and
2209 eh_frame_plt_got_size.
2210 (elf_i386_plt): Updated.
2211 (elf_i386_link_hash_table): Add plt_got_eh_frame.
2212 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
2213 (elf_i386_size_dynamic_sections): Allocate and initialize
2214 .eh_frame section for .plt.got.
2215 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
2216 .plt.got.
2217 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
2218 eh_frame_plt_got_size.
2219 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
2220 (PLT_GOT_FDE_LENGTH): Likewise.
2221 (elf_x86_64_backend_data): Add eh_frame_plt_got and
2222 eh_frame_plt_got_size.
2223 (elf_x86_64_arch_bed): Updated.
2224 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
2225 eh_frame_plt_got_size.
2226 (elf_x86_64_nacl_arch_bed): Likewise.
2227 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
2228 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
2229 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2230 .eh_frame section for .plt.got.
2231 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2232 for .plt.got.
2233
f129e49f
L
22342017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2235
2236 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
2237 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
2238
cd6581da
NC
22392017-01-09 Nick Clifton <nickc@redhat.com>
2240
2241 * dwarf2.c (lookup_address_in_function_table): Return early if
2242 there are no functions in the given comp unit, or if the high
2243 address of the last function in the comp unit is less than the
2244 desired address.
2245
98f02962
NC
22462017-01-09 Nick Clifton <nickc@redhat.com>
2247
2248 PR binutils/21013
2249 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
2250 message if there are too many symbols to load.
2251
ae4fda66
JC
22522017-01-04 James Clarke <jrtc27@jrtc27.com>
2253
2254 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
2255 if relocs are cached.
2256
de1010f4
RF
22572017-01-03 Rich Felker <bugdal@aerifal.cx>
2258
2259 PR ld/21017
2260 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
2261 for R_MICROBLAZE_GOTOFF_64.
2262
09fe2662
NC
22632017-01-03 Nick Clifton <nickc@redhat.com>
2264
2265 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
2266 warning about using a possibly uninitialised variable.
2267
595e0a47
AM
22682017-01-02 Alan Modra <amodra@gmail.com>
2269
2270 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
2271 (allocate_plt_static, allocate_dynrelocs): Use it.
2272
7bd9df3b
AM
22732017-01-02 Alan Modra <amodra@gmail.com>
2274
2275 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
2276 .PARISC.unwind section.
2277
5b86074c
AM
22782017-01-02 Alan Modra <amodra@gmail.com>
2279
2280 PR ld/20989
2281 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
2282 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
2283 indirect to GOT pointer relative code edit.
2284
2571583a
AM
22852017-01-02 Alan Modra <amodra@gmail.com>
2286
2287 Update year range in copyright notice of all files.
2288
5c1ad6b5 2289For older changes see ChangeLog-2016
3499769a 2290\f
5c1ad6b5 2291Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
2292
2293Copying and distribution of this file, with or without modification,
2294are permitted in any medium without royalty provided the copyright
2295notice and this notice are preserved.
2296
2297Local Variables:
2298mode: change-log
2299left-margin: 8
2300fill-column: 74
2301version-control: never
2302End:
This page took 0.191623 seconds and 4 git commands to generate.