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