]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/ChangeLog
RISC-V: Don't generate the ELF privilege attributes when no CSR are used.
[thirdparty/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
a975c88e
SC
12020-06-04 Stephen Casner <casner@acm.org>
2
3 Extend pdp11-aout symbol table format to accommodate .stab
4 symbols and implement correct handling of them.
5
6 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
7 (N_STAB, is_stab): Needed new function is_stab to disambiguate
8 normal vs. .stab symbol table type values, replacing N_STAB mask.
9 (translate_from_native_sym_flags): Determine correct section for
10 different .stab types.
11 (translate_to_native_sym_flags): Leave .stab types intact.
12 (translate_symbol_table): Error if symbol indicates overlay;
13 store desc field from .stab symbols.
14 (write_syms): Output desc field with symbol.
15 (aout_link_check_ar_symbols): Skip .stab symbols.
16 (aout_link_add_symbols): Correctly distinguish .stab symbols.
17 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
18 (aout_link_write_symbols): Write 0 for desk and ovly fields;
19 correctly distinguish .stab symbols and select calculate their
20 section and value; and copy desc and ovly fields from input symbol
21 to output symbol.
22
3b9313c4
SC
232020-06-04 Stephen Casner <casner@acm.org>
24
25 * aoutx.h (translate_symbol_table): Comment had external and
26 internal swapped.
27 * pdp11.c (translate_symbol_table): Likewise.
28
add5f777
L
292020-06-04 H.J. Lu <hongjiu.lu@intel.com>
30
31 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
32 (is_x86_elf): Check elf.hash_table_id instead of target_id.
33 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
34
c4b126b8
L
352020-06-04 H.J. Lu <hongjiu.lu@intel.com>
36
37 PR ld/26080
38 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
39 in debug section against symbol defined in shared library to 0.
40 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
41 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
42 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
43 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
44 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
45 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
46 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
47 * elf32-sh.c (sh_elf_check_relocs): Likewise.
48 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
49 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
50 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
51 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
52 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
53 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
54 reference.
55 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
56 there is non-GOT reference.
57 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
58 non-alloced sections.
59
31af1e68
SC
602020-06-03 Stephen Casner <casner@acm.org>
61
62 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
63
64 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
65 files with relocs.
66 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
67 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
68 other size that doesn't qcover the header word.
69 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
70 string table, and zero it.
71 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
72 message and set bfd_error on finding an invalid name string offset.
73 (add_to_stringtab): INLINE -> inline
74 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
75 bound check.
76 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
77 any relocs that could not be recognised.
78 92744f05809 PR 20929 - Check for relocs without an associated symbol.
79 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
80 name exists and is long enough, before attempting to see if it is
81 for a .o file.
82 c3864421222 - Correct case for N_SO being the last symbol.
83 50455f1ab29 PR 20891 - Handle the case where the main file name
84 and the directory name are both empty.
85 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
86 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
87 range string table offsets.
88 531336e3a0b PR 20909 - Fix off-by-one error in check for an
89 illegal string offset.
90 (aout_link_includes_newfunc): Add comment.
91 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
92 on unexpected relocation type rather than ASSERT.
93
d4d8aee3
L
942020-06-03 H.J. Lu <hongjiu.lu@intel.com>
95
96 PR ld/26066
97 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
98 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
99
58ee44ef
L
1002020-06-03 H.J. Lu <hongjiu.lu@intel.com>
101
102 PR ld/26066
103 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
104 non-alloced sections.
105
9a689602
L
1062020-06-03 H.J. Lu <hongjiu.lu@intel.com>
107
108 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
109 dynamic relocations for non SEC_ALLOC sections.
110
0bff7528
GN
1112020-06-03 Gunther Nikl <gnikl@justmail.de>
112
113 * aout64.c (BMAGIC, QMAGIC): Do not define.
114 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
115 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
116 to check the file format.
117 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
118 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
119 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
120
50d03636
L
1212020-06-03 H.J. Lu <hongjiu.lu@intel.com>
122
123 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
124 relocations for non SEC_ALLOC sections.
125
d49e5065
L
1262020-06-03 H.J. Lu <hongjiu.lu@intel.com>
127
128 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
129 * elf32-arm.c (maybe_set_textrel): Removed.
130 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
131 with _bfd_elf_maybe_set_textrel.
132 * elf32-csky.c (maybe_set_textrel): Removed.
133 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
134 with _bfd_elf_maybe_set_textrel.
135 * elf32-hppa.c (maybe_set_textrel): Removed.
136 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
137 with _bfd_elf_maybe_set_textrel.
138 * elf32-lm32.c (maybe_set_textrel): Removed.
139 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
140 with _bfd_elf_maybe_set_textrel.
141 * elf32-m32r.c (maybe_set_textrel): Removed.
142 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
143 with _bfd_elf_maybe_set_textrel.
144 * elf32-metag.c (maybe_set_textrel): Removed.
145 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
146 with _bfd_elf_maybe_set_textrel.
147 * elf32-nds32.c (maybe_set_textrel): Removed.
148 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
149 with _bfd_elf_maybe_set_textrel.
150 * elf32-or1k.c (maybe_set_textrel): Removed.
151 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
152 with _bfd_elf_maybe_set_textrel.
153 * elf32-ppc.c (maybe_set_textrel): Removed.
154 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
155 with _bfd_elf_maybe_set_textrel.
156 * elf32-s390.c (maybe_set_textrel): Removed.
157 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
158 with _bfd_elf_maybe_set_textrel.
159 * elf32-sh.c (maybe_set_textrel): Removed.
160 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
161 with _bfd_elf_maybe_set_textrel.
162 * elf32-tic6x.c (maybe_set_textrel): Removed.
163 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
164 with _bfd_elf_maybe_set_textrel.
165 * elf32-tilepro.c (maybe_set_textrel): Removed.
166 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
167 with _bfd_elf_maybe_set_textrel.
168 * elf64-ppc.c (maybe_set_textrel): Removed.
169 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
170 with _bfd_elf_maybe_set_textrel.
171 * elf64-s390.c (maybe_set_textrel): Removed.
172 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
173 with _bfd_elf_maybe_set_textrel.
174 * elfnn-aarch64.c (maybe_set_textrel): Removed.
175 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
176 with _bfd_elf_maybe_set_textrel.
177 * elfnn-riscv.c (maybe_set_textrel): Removed.
178 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
179 with _bfd_elf_maybe_set_textrel.
180 * elfxx-sparc.c (maybe_set_textrel): Removed.
181 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
182 with _bfd_elf_maybe_set_textrel.
183 * elfxx-tilegx.c (maybe_set_textrel): Removed.
184 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
185 with _bfd_elf_maybe_set_textrel.
186 * elfxx-x86.c (maybe_set_textrel): Removed.
187 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
188 with _bfd_elf_maybe_set_textrel.
189 * elflink.c (_bfd_elf_maybe_set_textrel): New.
190
ad172eaa
L
1912020-06-03 H.J. Lu <hongjiu.lu@intel.com>
192
193 PR ld/26067
194 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
195 dyn_relocs.
196 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
197 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
198 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
199 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
200 Likewise.
201 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
202 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
203 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
204 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
205 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
206 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
207 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
208 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
209 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
210 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
211 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
212 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
213 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
214 (elf_backend_copy_indirect_symbol): Likewise.
215 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
216 (elf_backend_copy_indirect_symbol): Likewise.
217 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
218
5dbc8b37
L
2192020-06-03 H.J. Lu <hongjiu.lu@intel.com>
220
221 PR ld/26067
222 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
223 * elf32-arm.c (readonly_dynrelocs): Removed.
224 (maybe_set_textrel): Replace readonly_dynrelocs with
225 _bfd_elf_readonly_dynrelocs.
226 * elf32-csky.c (readonly_dynrelocs): Removed.
227 (maybe_set_textrel): Replace readonly_dynrelocs with
228 _bfd_elf_readonly_dynrelocs.
229 * elf32-hppa.c(readonly_dynrelocs): Removed.
230 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
231 _bfd_elf_readonly_dynrelocs.
232 (maybe_set_textrel): Likewise.
233 * elf32-lm32.c (readonly_dynrelocs): Removed.
234 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
235 with _bfd_elf_readonly_dynrelocs.
236 (maybe_set_textrel): Likewise.
237 * elf32-m32r.c (readonly_dynrelocs): Removed.
238 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
239 with _bfd_elf_readonly_dynrelocs.
240 (maybe_set_textrel): Likewise.
241 * elf32-metag.c (readonly_dynrelocs): Removed.
242 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
243 with _bfd_elf_readonly_dynrelocs.
244 (maybe_set_textrel): Likewise.
245 * elf32-microblaze.c (readonly_dynrelocs): Removed.
246 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
247 with _bfd_elf_readonly_dynrelocs.
248 * elf32-nds32.c (readonly_dynrelocs): Removed.
249 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
250 with _bfd_elf_readonly_dynrelocs.
251 (maybe_set_textrel): Likewise.
252 * elf32-or1k.c (readonly_dynrelocs): Removed.
253 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
254 with _bfd_elf_readonly_dynrelocs.
255 * elf32-ppc.c (readonly_dynrelocs): Removed.
256 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
257 _bfd_elf_readonly_dynrelocs.
258 (ppc_elf_adjust_dynamic_symbol): Likewise.
259 (maybe_set_textrel): Likewise.
260 * elf32-s390.c (readonly_dynrelocs): Removed.
261 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
262 with _bfd_elf_readonly_dynrelocs.
263 (maybe_set_textrel): Likewise.
264 * elf32-sh.c (readonly_dynrelocs): Removed.
265 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
266 _bfd_elf_readonly_dynrelocs.
267 (maybe_set_textrel): Likewise.
268 * elf32-tic6x.c (readonly_dynrelocs): Removed.
269 (maybe_set_textrel): Replace readonly_dynrelocs with
270 _bfd_elf_readonly_dynrelocs.
271 * elf32-tilepro.c (readonly_dynrelocs): Removed.
272 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
273 with _bfd_elf_readonly_dynrelocs.
274 (maybe_set_textrel): Likewise.
275 * elf64-ppc.c (readonly_dynrelocs): Removed.
276 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
277 _bfd_elf_readonly_dynrelocs.
278 (ppc64_elf_adjust_dynamic_symbol): Likewise.
279 (maybe_set_textrel): Likewise.
280 * elf64-s390.c (readonly_dynrelocs): Removed.
281 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
282 with _bfd_elf_readonly_dynrelocs.
283 (maybe_set_textrel): Likewise.
284 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
285 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
286 (maybe_set_textrel): Replace readonly_dynrelocs with
287 _bfd_elf_readonly_dynrelocs.
288 * elfnn-riscv.c (readonly_dynrelocs): Removed.
289 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
290 with _bfd_elf_readonly_dynrelocs.
291 (maybe_set_textrel): Likewise.
292 * elfxx-sparc.c (readonly_dynrelocs): Removed.
293 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
294 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
295 (maybe_set_textrel): Likewise.
296 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
297 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
298 with _bfd_elf_readonly_dynrelocs.
299 (maybe_set_textrel): Likewise.
300 * elfxx-x86.c (readonly_dynrelocs): Removed.
301 (maybe_set_textrel): Replace readonly_dynrelocs with
302 _bfd_elf_readonly_dynrelocs.
303 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
304
433953ff
L
3052020-06-03 H.J. Lu <hongjiu.lu@intel.com>
306
307 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
308 -fsanitize=undefined.
309
67580036
AM
3102020-06-03 Alan Modra <amodra@gmail.com>
311
312 PR 26069
313 PR 18758
314 * peicode.h (pe_ILF_make_a_section): Align data for compilers
315 other than gcc.
316 (pe_ILF_build_a_bfd): Likewise.
317
0ed18fa1
AM
3182020-06-03 Alan Modra <amodra@gmail.com>
319
7eea15c5 320 PR 26069
0ed18fa1
AM
321 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
322 core files as well as objects.
323
190eb1dd
L
3242020-06-01 H.J. Lu <hongjiu.lu@intel.com>
325
326 PR ld/26067
327 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
328 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
329 Updated.
330 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
331 (elf_arc_link_hash_newfunc): Updated.
332 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
333 (elf32_arm_link_hash_newfunc): Updated.
334 (elf32_arm_copy_indirect_symbol): Likewise.
335 (elf32_arm_check_relocs): Likewise.
336 (readonly_dynrelocs): Likewise.
337 (allocate_dynrelocs_for_symbol): Likewise.
338 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
339 (csky_elf_link_hash_newfunc): Updated.
340 (csky_allocate_dynrelocs): Likewise.
341 (readonly_dynrelocs): Likewise.
342 (csky_elf_copy_indirect_symbol): Likewise.
343 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
344 (hppa_link_hash_newfunc): Updated.
345 (elf32_hppa_copy_indirect_symbol): Likewise.
346 (elf32_hppa_hide_symbol): Likewise.
347 (elf32_hppa_adjust_dynamic_symbol): Likewise.
348 (allocate_dynrelocs): Likewise.
349 (elf32_hppa_relocate_section): Likewise.
350 * elf32-i386.c (elf_i386_check_relocs): Likewise.
351 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
352 (lm32_elf_link_hash_newfunc): Likewise.
353 (lm32_elf_link_hash_table_create): Updated.
354 (readonly_dynrelocs): Likewise.
355 (allocate_dynrelocs): Likewise.
356 (lm32_elf_copy_indirect_symbol): Likewise.
357 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
358 (m32r_elf_link_hash_newfunc): Likewise.
359 (m32r_elf_link_hash_table_create): Updated.
360 (m32r_elf_copy_indirect_symbol): Likewise.
361 (allocate_dynrelocs): Likewise.
362 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
363 (metag_link_hash_newfunc): Updated.
364 (elf_metag_copy_indirect_symbol): Likewise.
365 (readonly_dynrelocs): Likewise.
366 (allocate_dynrelocs): Likewise.
367 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
368 dyn_relocs.
369 (link_hash_newfunc): Updated.
370 (microblaze_elf_check_relocs): Likewise.
371 (microblaze_elf_copy_indirect_symbol): Likewise.
372 (readonly_dynrelocs): Likewise.
373 (allocate_dynrelocs): Likewise.
374 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
375 (nds32_elf_link_hash_newfunc): Updated.
376 (nds32_elf_copy_indirect_symbol): Likewise.
377 (readonly_dynrelocs): Likewise.
378 (allocate_dynrelocs): Likewise.
379 (nds32_elf_check_relocs): Likewise.
380 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
381 (link_hash_newfunc): Updated.
382 (nios2_elf32_copy_indirect_symbol): Likewise.
383 (nios2_elf32_check_relocs): Likewise.
384 (allocate_dynrelocs): Likewise.
385 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
386 (or1k_elf_link_hash_newfunc): Updated.
387 (readonly_dynrelocs): Likewise.
388 (allocate_dynrelocs): Likewise.
389 (or1k_elf_copy_indirect_symbol): Likewise.
390 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
391 (ppc_elf_link_hash_newfunc): Updated.
392 (ppc_elf_copy_indirect_symbol): Likewise.
393 (ppc_elf_check_relocs): Likewise.
394 (readonly_dynrelocs): Likewise.
395 (ppc_elf_adjust_dynamic_symbol): Likewise.
396 (allocate_dynrelocs): Likewise.
397 (ppc_elf_relocate_section): Likewise.
398 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
399 (link_hash_newfunc): Updated.
400 (elf_s390_copy_indirect_symbol): Likewise.
401 (readonly_dynrelocs): Likewise.
402 (elf_s390_adjust_dynamic_symbol): Likewise.
403 (allocate_dynrelocs): Likewise.
404 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
405 (sh_elf_link_hash_newfunc): Updated.
406 (readonly_dynrelocs): Likewise.
407 (allocate_dynrelocs): Likewise.
408 (sh_elf_copy_indirect_symbol): Likewise.
409 (sh_elf_check_relocs): Likewise.
410 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
411 (elf32_tic6x_link_hash_newfunc): Likewise.
412 (elf32_tic6x_link_hash_table_create): Updated.
413 (readonly_dynrelocs): Likewise.
414 (elf32_tic6x_check_relocs): Likewise.
415 (elf32_tic6x_allocate_dynrelocs): Likewise.
416 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
417 dyn_relocs.
418 (link_hash_newfunc): Updated.
419 (tilepro_elf_copy_indirect_symbol): Likewise.
420 (tilepro_elf_check_relocs): Likewise.
421 (allocate_dynrelocs): Likewise.
422 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
423 (ppc64_elf_copy_indirect_symbol): Updated.
424 (ppc64_elf_check_relocs): Likewise.
425 (readonly_dynrelocs): Likewise.
426 (ppc64_elf_adjust_dynamic_symbol): Likewise.
427 (dec_dynrel_count): Likewise.
428 (allocate_dynrelocs): Likewise.
429 (ppc64_elf_relocate_section): Likewise.
430 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
431 (link_hash_newfunc): Updated.
432 (elf_s390_copy_indirect_symbol): Likewise.
433 (readonly_dynrelocs): Likewise.
434 (allocate_dynrelocs): Likewise.
435 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
436 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
437 dyn_relocs.
438 (elfNN_aarch64_link_hash_newfunc): Updated.
439 (elfNN_aarch64_copy_indirect_symbol): Likewise.
440 (readonly_dynrelocs): Likewise.
441 (need_copy_relocation_p): Likewise.
442 (elfNN_aarch64_allocate_dynrelocs): Likewise.
443 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
444 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
445 (link_hash_newfunc): Updated.
446 (riscv_elf_copy_indirect_symbol): Likewise.
447 (riscv_elf_check_relocs): Likewise.
448 (readonly_dynrelocs): Likewise.
449 (allocate_dynrelocs): Likewise.
450 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
451 dyn_relocs.
452 (link_hash_newfunc): Updated.
453 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
454 (_bfd_sparc_elf_check_relocs): Likewise.
455 (readonly_dynrelocs): Likewise.
456 (allocate_dynrelocs): Likewise.
457 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
458 (link_hash_newfunc): Updated.
459 (tilegx_elf_copy_indirect_symbol): Likewise.
460 (tilegx_elf_check_relocs): Likewise.
461 (readonly_dynrelocs): Likewise.
462 (allocate_dynrelocs): Likewise.
463 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
464 (readonly_dynrelocs): Likewise.
465 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
466 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
467
2fdb65f2
AM
4682020-06-01 Alan Modra <amodra@gmail.com>
469
470 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
471 command against cmd_length, not the end of record. For
472 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
473 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
474 cmd_length test.
475
12adf805
DF
4762020-05-28 David Faust <david.faust@oracle.com>
477
478 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
479 R_BPF_INSN_{32,64} relocations.
480
66e3eb08
SC
4812020-05-28 Stephen Casner <casner@acm.org>
482
483 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
484 addreses in .long (used in testsuites) and .stab values.
485
a6dbf402
L
4862020-05-27 H.J. Lu <hongjiu.lu@intel.com>
487
488 PR ld/22909
489 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
490 Check bfd_link_dll when issue a DT_TEXTREL warning.
491 * elfxx-x86.c (maybe_set_textrel): Likewise.
492 (_bfd_x86_elf_size_dynamic_sections): Likewise.
493
9e7cb4c3
NC
4942020-05-26 Nick Clifton <nickc@redhat.com>
495
496 * plugin.c (try_load_plugin): Extend error message when a plugin
497 fails to open.
498
c892b447
AM
4992020-05-23 Alan Modra <amodra@gmail.com>
500
501 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
502
6f3fe02b
AM
5032020-05-22 Alan Modra <amodra@gmail.com>
504
505 PR 25882
506 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
507 attributes from shared libraries, and do not return an error if
508 they don't match.
509
0490dd41
AM
5102020-05-21 Alan Modra <amodra@gmail.com>
511
512 PR 25993
513 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
514 filename.
515 (_bfd_delete_bfd): Free the copy.
516 (_bfd_new_bfd): Free nbfd->memory on error.
517
c9594989
AM
5182020-05-21 Alan Modra <amodra@gmail.com>
519
520 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
521 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
522 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
523 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
524 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
525 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
526 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
527 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
528 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
529 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
530 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
531 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
532 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
533 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
534 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
535 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
536 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
537 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
538 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
539 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
540
8f595e9b
NC
5412020-05-20 Nelson Chu <nelson.chu@sifive.com>
542
543 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
544 get_default_version. It is used to find the default version for
545 the specific extension.
546 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
547 default_major_version and default_minor_version. Add new bfd_boolean
548 parameter *use_default_version. Set it to TRUE if we need to call
549 the callback rps->get_default_version to find the default version.
550 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
551 the default version in riscv_parsing_subset_version, and then call
552 riscv_add_subset to add the subset into subset list.
553 (riscv_parse_prefixed_ext): Likewise.
554 (riscv_std_z_ext_strtab): Support Zicsr extensions.
555 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
556 strings rather than characters.
557 riscv_merge_arch_attr_info): The callback function get_default_version
558 is only needed for assembler, so set it to NULL int the linker.
559 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
560 * elfxx-riscv.h: Updated.
561
7b958a48
AM
5622020-05-20 Alan Modra <amodra@gmail.com>
563
564 PR 25993
565 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
566 use bfd_set_filename.
567 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
568 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
569 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
570 (bfd_create): Likewise.
571 (_bfd_delete_bfd): Don't free filename.
572 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
573 return pointer to the copy or NULL on alloc fail.
574 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
575 result of bfd_set_filename.
576 * bfd-in2.h: Regenerate.
577
3c568b8a
AM
5782020-05-20 Alan Modra <amodra@gmail.com>
579
580 PR 26011
581 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
582 section size against file size.
583 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
584
6fd1d259
GN
5852020-05-19 Gunther Nikl <gnikl@justmail.de>
586
587 PR 26005
11c0dd51
NC
588 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
589 and memset when allocating memory for the sections_being_created
590 array.
6fd1d259 591
7e94cf6c
SH
5922020-05-19 Stafford Horne <shorne@gmail.com>
593
594 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
595 to relgot.
596 (or1k_elf_relocate_section): Access srelgot via
597 htab->root.srelgot. Add assertions for srelgot->contents.
598 Introduce local variable for srelgot to not reuse global
599 sreloc.
600 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
601 (or1k_set_got_and_rela_sizes): New function.
602 (or1k_initial_exec_offset): New function.
603 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
604 (or1k_elf_relocate_section): Allow for TLS to handle multiple
605 model access.
606 (or1k_elf_check_relocs): Use OR to set TLS access.
607 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
608 sizes.
609 (or1k_elf_size_dynamic_sections): Use
610 or1k_set_got_and_rela_sizes to set sizes.
611 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
612 (TCB_SIZE): New macro.
613 (tpoff): Use TCB_SIZE and alignment to calculate offset.
614 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
615 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
616 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
617 (tpoff): Add dynamic boolean argument.
618 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
619
7e057737
SP
6202020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
621
622 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
623 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
624 cases with BFD_RELOC_AARCH64_JUMP26.
625 (elfNN_aarch64_check_relocs): Likewise.
626
765cf5f6
AM
6272020-05-19 Alan Modra <amodra@gmail.com>
628
629 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
630 bfd_get_filename rather than accessing bfd->filename directly.
631 * aout-target.h (MY (object_p)): Likewise.
632 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
633 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
634 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
635 (_bfd_archive_bsd44_construct_extended_name_table),
636 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
637 (_bfd_bsd_write_armap): Likewise.
638 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
639 * cache.c (bfd_open_file): Likewise.
640 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
641 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
642 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
643 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
644 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
645 * elf32-nds32.c (nds32_elf_output_symbol_hook),
646 (patch_tls_desc_to_ie): Likewise.
647 * elf32-spu.c (sort_bfds, print_one_overlay_section),
648 (spu_elf_auto_overlay): Likewise.
649 * elf64-hppa.c (elf_hppa_final_link): Likewise.
650 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
651 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
652 * elflink.c (bfd_elf_size_dynamic_sections),
653 (elf_link_input_bfd): Likewise.
654 * linker.c (_bfd_generic_link_output_symbols): Likewise.
655 * mach-o.c (bfd_mach_o_follow_dsym),
656 (bfd_mach_o_close_and_cleanup): Likewise.
657 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
658 (find_separate_debug_file, get_build_id_name): Likewise.
659 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
660 * plugin.c (bfd_plugin_open_input): Likewise.
661 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
662 * som.c (som_write_armap): Likewise.
663 * srec.c (srec_write_record, srec_write_symbols): Likewise.
664 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
665 (_bfd_vms_lib_write_archive_contents): Likewise.
666 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
667
39a1432c
AM
6682020-05-19 Alan Modra <amodra@gmail.com>
669
670 PR 25713
671 * bfdio.c (_bfd_real_fopen): Typo fix.
672
ed02cdb5
NC
6732020-05-18 Nick Clifton <nickc@redhat.com>
674
675 PR 26005
676 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
677 for the sections_being_created array.
678
7a87e9c8
AM
6792020-05-18 Alan Modra <amodra@gmail.com>
680
681 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
682 they can be freed without also freeing internal_relocs.
683
ca859a89
JC
6842020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
685
686 PR 25713
687 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
688 separators into DOS style when creating a WIN32 fullpath.
689
fc46e8bd
NC
6902020-05-14 Nelson Chu <nelson.chu@sifive.com>
691
692 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
693 to initialize RISC-V tdata.
694
533f049e
GN
6952020-05-12 Gunther Nikl <gnikl@justmail.de>
696
697 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
698 relocation size.
699
94ba9882
AM
7002020-05-11 Alan Modra <amodra@gmail.com>
701
702 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
703
7c1f4227
AM
7042020-05-11 Alan Modra <amodra@gmail.com>
705
706 * elf64-ppc.c: Rename powerxx to power10 throughout.
707
4d5acb1e
AM
7082020-05-11 Alan Modra <amodra@gmail.com>
709
710 PR 25961
711 * coffgen.c (coff_get_normalized_symtab): Check that buffer
712 contains required number of auxents before processing any auxent.
713 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
714 file name from auxents for PE.
715
7242fa8a
GN
7162020-05-04 Gunther Nikl <gnikl@justmail.de>
717
718 * aout-cris.c (DEFAULT_ARCH): Delete define.
719 (MY_set_arch_mach): Likewise.
720 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
721 of bfd_arch_cris.
722 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
723 of r_type before the shift.
724
7252020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
cff69cf4
WD
726
727 PR ld/25665
728 * elfnn-aarch64.c (group_sections): Copy implementation from
729 elf32-arm.c.
730
a2714d6c
AM
7312020-05-01 Alan Modra <amodra@gmail.com>
732
733 PR 25900
734 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
735 accessing root.u.def of symbols. Also check root.u.def.section
736 is non-NULL. Reverse tests so as to make the logic positive.
737
a8acd6ee
AM
7382020-05-01 Alan Modra <amodra@gmail.com>
739
740 PR 25882
741 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
742 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
743
6b728d32
AM
7442020-05-01 Alan Modra <amodra@gmail.com>
745
746 PR 25882
747 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
748 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
749 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
750 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
751 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
752 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
753 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
754 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
755 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
756 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
757
91ed9b71
AM
7582020-05-01 Alan Modra <amodra@gmail.com>
759
760 PR 25882
761 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
762 from shared libraries.
763
d548f47d
MF
7642020-04-29 Max Filippov <jcmvbkbc@gmail.com>
765
766 * elf32-xtensa.c (relax_section): Don't negate diff_value for
767 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
768 equals 0. Report overflow when the result has negative sign but
769 all significant bits are zero.
770
dfa85db1
GN
7712020-04-29 Gunther Nikl <gnikl@justmail.de>
772
773 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
774 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
775
48e5bada
AM
7762020-04-28 Alan Modra <amodra@gmail.com>
777
778 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
779 Emit warning message.
780
251dae91
TC
7812020-04-27 Tamar Christina <tamar.christina@arm.com>
782
783 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
784 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
785 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
786 to x86_64_pe_big_vec as it not a big-endian format.
787 (vec i386_pe_big_vec): New.
788 * configure.ac: Likewise.
789 * targets.c: Likewise.
790 * configure: Regenerate.
791 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
792 COFF_WITH_PE_BIGOBJ): New.
793 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
794 New.
795 (x86_64_pe_be_vec): Moved.
796
27456742
AK
7972020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
798
799 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
800 * elf.c (elfcore_grok_arc_v2): New function.
801 (elfcore_grok_note): Call the new function to handle the corresponding
802 note.
803 (elfcore_write_arc_v2): New function.
804 (elfcore_write_register_note): Call the new function to handle the
805 corresponding pseudo-sections.
806
30ce8e47
MF
8072020-04-22 Max Filippov <jcmvbkbc@gmail.com>
808
809 PR ld/25861
810 * bfd-in2.h: Regenerated.
811 * elf32-xtensa.c (elf_howto_table): New entries for
812 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
813 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
814 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
815 R_XTENSA_NDIFF{8,16,32}.
816 * libbfd.h (bfd_reloc_code_real_names): Add names for
817 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
818 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
819 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
820 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
821
c36876fe
TC
8222020-04-21 Tamar Christina <tamar.christina@arm.com>
823
824 PR binutils/24753
825 * compress.c (bfd_get_full_section_contents): Exclude sections with no
826 content.
827
6f6fd151
L
8282020-04-21 H.J. Lu <hongjiu.lu@intel.com>
829
830 PR ld/25849
831 * elf-bfd.h (elf_backend_data): Add
832 elf_backend_strip_zero_sized_dynamic_sections.
833 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
834 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
835 New macro.
836 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
837 function.
838 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
839 New macro.
840 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
841
1f7f2abb
L
8422020-04-21 H.J. Lu <hongjiu.lu@intel.com>
843
844 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
845 sec.
846 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
847 DT_TEXTREL with -M.
848 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
849
e04f33c0
NC
8502020-04-21 Nick Clifton <nickc@redhat.com>
851
852 * po/sr.po: Updated Serbian translation.
853
fad3d2c1
AM
8542020-04-21 Alan Modra <amodra@gmail.com>
855
856 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
857 processing.
858
23c8270e
SC
8592020-04-20 Stephen Casner <casner@acm.org>
860
861 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
862 causing globals from linker script to be treated as debug symbols.
863 (translate_symbol_table): Don't sign-extend symbol values from 16
864 to 64 bits in nm output.
865
2efec98b
AM
8662020-04-20 Alan Modra <amodra@gmail.com>
867
868 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
869
18f97353
AM
8702020-04-18 Alan Modra <amodra@gmail.com>
871
872 * section.c (bfd_is_const_section): Correct test for special
873 sections.
874 * bfd-in2.h: Regenerate.
875
8d55d10a
AM
8762020-04-17 Alan Modra <amodra@gmail.com>
877
878 PR 25842
879 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
880 NULL nodename.
881
8e4979ac
NC
8822020-04-16 Nick Clifton <nickc@redhat.com>
883
884 PR 25803
885 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
886 abort with a more helpful error message.
887
aec72fda
AM
8882020-04-16 Alan Modra <amodra@gmail.com>
889
890 PR 25827
891 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
892 strdup(0).
893
95a51568
FS
8942020-04-15 Fangrui Song <maskray@google.com>
895
896 PR binutils/24613
897 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
898 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
899 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
900 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
901 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
902 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
903 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
904 * elf32-sh.c (sh_elf_relocate_section): Likewise.
905 * elf32-spu.c (spu_elf_relocate_section): Likewise.
906 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
907 * elflink.c (elf_link_output_extsym): Likewise.
908 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
909
7ecb5154
AM
9102020-04-15 Alan Modra <amodra@gmail.com>
911
912 PR 25823
913 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
914 pointer into strings that may be freed for section name, always
915 allocate a new string.
916
f717994f
JMG
9172020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
918 Jan W. Jagersma <jwjagersma@gmail.com>
919
920 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
921 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
922 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
923 (_bfd_go32_mkobject): New functions.
924 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
925 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
926 (go32exe_mkobject): Call _bfd_go32_mkobject.
927 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
928 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
929 and COFF_GO32.
930 (coff_write_relocs): Enable extended reloc counter code if
931 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
932 (coff_write_object_contents): Likewise. Pad section headers
933 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
934 instead of coff_swap_scnhdr_out.
935 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
936 enable extended reloc counter.
937 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
938 Declare with ATTRIBUTE_UNUSED.
939 * libcoff-in.h: (struct coff_tdata): New field go32.
940 (obj_go32): Define.
941 * libcoff.h: Regenerate.
942
34ca5531
FS
9432020-04-14 Fangrui Song <maskray@google.com>
944
945 PR gas/25768
946 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
947 12.
948
fa1477dc
SC
9492020-04-14 Stephen Casner <casner@acm.org>
950
951 PR ld/25677
952 * pdp11.c: Add implementation of --imagic option.
953 (adjust_o_magic): Fix objcopy --extract-symbol test.
954 * libaout.h (enum aout_magic): Add i_magic.
955
a0543b0b
RO
9562020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
957 Nick Clifton <nickc@redhat.com>
958
959 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
960 <0>: Ignore.
961 <default>: Error rather than abort.
962
3349112e
L
9632020-04-03 H.J. Lu <hongjiu.lu@intel.com>
964
965 PR ld/25767
966 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
967 relocation section from section group.
968
4d095f5b
JJ
9692020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
970
971 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
972 bfd->origin to file offset.
973 * bfdwin.c (bfd_get_file_window): Likewise.
974 * bfd.c: Clarify the use of the bfd->origin field.
975 * bfd-in2.h: Regenerate.
976 * coff-i386.c: Don't include go32exe.h. Allow overriding
977 coff_write_object_contents via COFF_WRITE_CONTENTS.
978 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
979 (go32exe_write_object_contents): New functions.
980 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
981 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
982 (create_go32_stub): Remove check for 2k size limit. Read stub
983 from go32exe_temp_stub if present.
984 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
985 copy variable-length stub.
986 (go32_check_format): Read stub to go32exe_temp_stub, set
987 origin, return go32exe_cleanup.
988 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
989 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
990 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
991 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
992 Remove functions and their associated #defines.
993 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
994 * libcoff-in.h: (struct coff_tdata): New field stub_size.
995 Rename field go32stub to stub.
996 * libcoff.h: Regenerate.
997 * coff-stgo32.c (go32_check_format): Rename to...
998 (go32exe_check_format): ...this.
999 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1000 (go32exe_copy_private_bfd_data): ...this.
1001 (stub_bytes): Rename to...
1002 (go32exe_default_stub): ...this.
1003 (create_go32_stub): Rename to...
1004 (go32exe_create_stub): ...this.
1005 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1006 when possible.
1007
382aae06
L
10082020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1009
1010 PR ld/25749
1011 PR ld/25754
1012 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1013 relocation to R_386_32 for relocation against non-preemptible
1014 absolute symbol.
1015 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1016 allocate dynamic relocation for non-preemptible absolute symbol.
1017 (elf_i386_relocate_section): Pass sec to
1018 GENERATE_DYNAMIC_RELOCATION_P.
1019 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1020 (elf_x86_64_convert_load_reloc): Covert load relocation to
1021 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1022 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1023 for non-preemptible absolute symbol if they overflow.
1024 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1025 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1026 symbol. Don't allocate dynamic relocation for non-preemptible
1027 absolute symbol.
1028 (elf_x86_64_relocate_section): Don't generate relative relocation
1029 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1030 to GENERATE_DYNAMIC_RELOCATION_P.
1031 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1032 against non-preemptible absolute symbol.
1033 (_bfd_elf_x86_valid_reloc_p): New function.
1034 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1035 GOT_ABS GOT slot.
1036 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1037 argument. Don't generate dynamic relocation against
1038 non-preemptible absolute symbol.
1039 (ABS_SYMBOL_P): New.
1040 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1041 against non-preemptible absolute symbol.
1042 (GOT_ABS): New.
1043 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1044 (_bfd_elf_x86_valid_reloc_p): New.
1045
a7618269
TC
10462020-04-01 Tamar Christina <tamar.christina@arm.com>
1047
1048 PR ld/16017
1049 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1050 address in the GOT if in thumb only mode.
1051
15ccbdd7
TC
10522020-04-01 Tamar Christina <tamar.christina@arm.com>
1053
1054 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1055
7b948a25
HPN
10562020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1057
1058 * mmo.c (mmo_scan): Create .text section only when needed, not
1059 from the start.
1060
89b599df
AM
10612020-03-31 Alan Modra <amodra@gmail.com>
1062
1063 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1064 return value check.
1065
81699544
AM
10662020-03-31 Alan Modra <amodra@gmail.com>
1067
1068 * vms-alpha.c (image_write): Check bounds for sections without
1069 contents too. Error on non-zero write to section without
1070 contents.
1071 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1072
b3b360de
AM
10732020-03-31 Alan Modra <amodra@gmail.com>
1074
1075 * tekhex.c (pass_over): Check is_eof before reading buffer.
1076
00386881
NC
10772020-03-30 Nick Clifton <nickc@redhat.com>
1078
1079 PR binutils/pr25662
1080 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1081 field to timestamp and make it an integer.
1082 * libcoff.h: Regenerate.
1083 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1084 field in the pe_data structure rather than the insert_timestamp
1085 field.
1086
988b7300
AM
10872020-03-30 Alan Modra <amodra@gmail.com>
1088
1089 PR 25745
1090 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1091 statistics message.
1092
aa49fc22
NC
10932020-03-26 Nick Clifton <nickc@redhat.com>
1094
1095 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1096 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1097 prototype.
1098 * libbfd.h: Regenerate.
1099
ff768510
AM
11002020-03-26 Alan Modra <amodra@gmail.com>
1101
1102 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1103
f75fbe8a
AM
11042020-03-26 Alan Modra <amodra@gmail.com>
1105
1106 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1107 array.
1108 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1109
aac88046
NC
11102020-03-25 Nick Clifton <nickc@redhat.com>
1111
1112 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1113 function.
1114 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1115 * libbfd.h: Regenerate.
1116
cf2611fe
SV
11172020-03-25 Shahab Vahedi <shahab@synopsys.com>
1118
1119 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1120 correct field name in the output string.
1121
d16e3d2e
AM
11222020-03-25 Alan Modra <amodra@gmail.com>
1123
1124 PR 25662
1125 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1126 for SHT_NOBITS section if first in segment.
1127
1081065c
L
11282020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1129
1130 PR binutils/25708
1131 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1132 (_bfd_elf_get_symbol_version_string): This.
1133 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1134 (_bfd_elf_get_symbol_version_string): This.
1135 (bfd_elf_print_symbol): Pass TRUE to
1136 _bfd_elf_get_symbol_version_string.
1137 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1138 bfd_boolean argument.
1139 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1140 * targets.c (_bfd_get_symbol_version_string): Likewise.
1141 (bfd_get_symbol_version_string): Likewise.
1142 * bfd-in2.h: Regenerated.
1143
0b8448af 11442020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 1145 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
1146
1147 PR 25713
1148 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1149 Win32 systems.
1150
ec2e748a
NC
11512020-03-24 Nick Clifton <nickc@redhat.com>
1152
1153 PR 25681
1154 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1155 segment to use for PT_GNU_RELRO, ignore empty sections in a
1156 segment's current list.
1157
cda7e560
L
11582020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1159
1160 PR binutils/25717
1161 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1162
7e6e972f
L
11632020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1164
1165 PR binutils/25708
1166 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1167 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1168 on the previous _bfd_elf_get_symbol_version_string.
1169 (_bfd_elf_get_symbol_version_string): Use it.
1170
65109548
AM
11712020-03-24 Alan Modra <amodra@gmail.com>
1172
1173 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1174 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1175 struct areltdata.
1176
fdde2fb6
SH
11772020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1178
1179 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1180
cf28cfef
AM
11812020-03-23 Alan Modra <amodra@gmail.com>
1182
1183 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1184 symbol count. Allocate an extra byte to ensure name strings
1185 are terminated. Sanity check name offsets. Release memory on
1186 error return.
1187
5e737279
AM
11882020-03-23 Alan Modra <amodra@gmail.com>
1189
1190 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1191 field hasn't been read. Remove unnecessary casts.
1192
c15a8f17
AM
11932020-03-22 Alan Modra <amodra@gmail.com>
1194
1195 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1196 enough to read number of symbols.
1197
3d98c460
L
11982020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1199
1200 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1201 (EXECUTABLE_SUFFIX): Likewise.
1202 * config.in: Regenerated.
1203 * configure: Likewise.
1204 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1205 _bfd_generic_close_and_cleanup.
1206 (plugin_list_entry): Remove resolution_file, resolution_option,
1207 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1208 lto_wrapper, gcc_env and initialized,
1209 (need_lto_wrapper_p): Removed.
1210 (get_lto_wrapper): Likewise.
1211 (setup_lto_wrapper_env): Likewise.
1212 (register_all_symbols_read): Likewise.
1213 (egister_cleanup): Likewise.
1214 (get_symbols): Likewise.
1215 (add_input_file): Likewise.
1216 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1217 (add_symbols): Updated.
1218 (try_claim): Likewise.
1219 (try_load_plugin): Likewise.
1220 (bfd_plugin_canonicalize_symtab): Likewise.
1221 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1222 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1223
c3a1714c
L
12242020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1225
1226 PR binutils/25640
1227 * plugin.c (plugin_list_entry): Add has_symbol_type.
1228 (add_symbols_v2): New function.
1229 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1230 provides symbol type.
1231 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1232 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1233 available.
1234
67338173
AM
12352020-03-20 Alan Modra <amodra@gmail.com>
1236
1237 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1238 enough to read number of symbols.
1239
a859124d
AM
12402020-03-20 Alan Modra <amodra@gmail.com>
1241
1242 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1243 backend functions for NULL before calling.
1244 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1245 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1246 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1247 * elfnn-ia64.c (ignore_errors): New function.
1248 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1249
f3a08f77
NC
12502020-03-19 Nick Clifton <nickc@redhat.com>
1251
1252 PR 25676
1253 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1254 location of the varinfo in the unit's debug info data. Change the
1255 type of the stack field to a boolean.
1256 (lookup_var_by_offset): New function. Returns the varinfo
1257 structure for the variable described at the given offset in the
1258 unit's debug info.
1259 (scan_unit_for_symbols): Add support for variables which have the
1260 DW_AT_specification attribute.
1261
6a541707
NC
12622020-03-19 Nick Clifton <nickc@redhat.com>
1263
1264 PR 25699
1265 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1266 error return.
1267
effc14f5
SH
12682020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1269
1270 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1271
ac4bf06c
NC
12722020-03-18 Nick Clifton <nickc@redhat.com>
1273
1274 PR 25673
1275 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1276 memory access when processing a corrupt secondary reloc section.
1277
53215f21
CL
12782020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1279
1280 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1281 instead of calling abort.
1282 * elf32-csky.c (csky_build_one_stub): Likewise.
1283 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1284 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1285 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1286 * elf32-metag.c (metag_build_one_stub): Likewise.
1287 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1288 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1289 (ppc_size_one_stub): Likewise.
1290 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1291
327ef784
NC
12922020-03-17 Nick Clifton <nickc@redhat.com>
1293
d3c3c542 1294 PR 25688
327ef784
NC
1295 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1296 with error messages.
1297
ecbbbdba
NC
12982020-03-17 Nick Clifton <nickc@redhat.com>
1299
1300 PR 25687
1301 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1302 free. Add free on another failure path.
1303
4b3ecb3b
AM
13042020-03-16 Alan Modra <amodra@gmail.com>
1305
1306 PR 25675
1307 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1308 we have a non-zero section count. Do lma comparison in octets.
1309
7bac4137
AM
13102020-03-16 Alan Modra <amodra@gmail.com>
1311
1312 * vms-alpha.c (dst_restore_location): Validate index into
1313 dst_ptr_offsets array before accessing. Return status.
1314 (dst_retrieve_location): Similarly, making "loc" parameter a
1315 pointer to return value.
1316 (_bfd_vms_slurp_etir): Update calls to above functions.
1317
8b5d0a4f
KR
13182020-03-14 Kamil Rytarowski <n54@gmx.com>
1319
1320 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1321 targets.
1322 * configure: Regenerated.
1323
48e81d7f
AM
13242020-03-14 Alan Modra <amodra@gmail.com>
1325
1326 * section.c (BFD_FAKE_SECTIONS): Formatting.
1327 * bfd-in2.h: Regenerate.
1328
06d949ec
KR
13292020-03-13 Kamil Rytarowski <n54@gmx.com>
1330
1331 * elf.c (elfcore_grok_netbsd_note): Add support for
1332 NT_NETBSDCORE_LWPSTATUS notes.
1333
abf874aa
CL
13342020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1335
1336 * bfd-in2.h: Regenerate.
1337 * section.c (asection): Add already_assigned field.
1338 (BFD_FAKE_SECTION): Add default initializer for it.
1339 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1340 * elf32-arm.c (arm_build_one_stub): Add support for
1341 non_contiguous_regions.
1342 * elf32-csky.c (csky_build_one_stub): Likewise.
1343 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1344 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1345 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1346 * elf32-metag.c (metag_build_one_stub): Likewise.
1347 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1348 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1349 (ppc_size_one_stub): Likewise.
1350 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1351 * elflink.c (elf_link_input_bfd): Likewise.
1352
74e10d17
L
13532020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1354
1355 PR ld/24920
1356 * elf-linker-x86.h (elf_linker_x86_params): Add
1357 static_before_all_inputs and has_dynamic_linker.
1358 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1359 dynamic input objects if -static is passed at command-line
1360 before all input files without --dynamic-linker unless
1361 --no-dynamic-linker is used.
1362
015ec493
KR
13632020-03-13 Kamil Rytarowski <n54@gmx.com>
1364
1365 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1366
66631823
CE
13672020-03-13 Christian Eggers <ceggers@gmx.de>
1368
1369 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1370 "p_paddr" from "at".
1371 * elfcode.h (bfd_from_remote_memory): Add units to several
1372 parameters. New local "opb". Fix usage of p_align. Fix
1373 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1374 call of target_read_memory.
1375 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1376 calculation of "offset" and "output_offset".
1377 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1378 from "offset" and fix calculation of "end" from "vma+size". Fix
1379 comparison between "sh_addr" and "vma"/"output_offset".
1380 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1381 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1382 member.
1383 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1384 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1385 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1386 assignment of p_paddr from phdr_lma. Fix comparison between
1387 "lma+size" and "next->lma".
1388 (elf_sort_segments): Fix assignment from p_paddr to lma.
1389 (assign_file_positions_for_load_sections): Add unit (bytes) to
1390 local "align". Fix calculation of local "off_adjust". Fix
1391 calculation of local "filehdr_vaddr".
1392 (assign_file_positions_for_non_load_sections): New local "opb".
1393 Fix calculation of "end" from "p_size". Fix comparison between
1394 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1395 from "end" and "p_vaddr".
1396 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1397 vma. Fix assignment to p_paddr from lma. Fix comparison between
1398 p_paddr and lma. Fix assignment to p_paddr from lma.
1399 * merge.c (sec_merge_emit): New local "opb". Convert
1400 "alignment_power" to octets.
1401 (_bfd_add_merge_section): New locals "alignment_power" and
1402 "opb". Fix comparison between "alignment_power" and
1403 "sizeof(align)".
1404 (_bfd_merge_sections): New local "opb". Divide size by opb
1405 before checking align mask.
1406
502794d4
CE
14072020-03-13 Christian Eggers <ceggers@gmx.de>
1408
1409 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1410 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1411 section LMA/VMA.
1412 (_bfd_elf_make_section_from_phdr): Similarly.
1413 (elf_fake_sections): Fix calculation of
1414 Elf_Internal_shdr::sh_addr from section VMA.
1415 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1416 and bytes.
1417 (assign_file_positions_for_load_sections): Fix calculations of
1418 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1419 comparison between program header address and section LMA.
1420 (assign_file_positions_for_non_load_sections): Likewise.
1421 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1422 (IS_CONTAINED_BY_VMA): Add parameter opb.
1423 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1424 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1425 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1426 Fix calculations of p_addr_valid and p_vaddr_offset.
1427 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1428 with octets per byte when comparing against p_vaddr.
1429
8248d21a
AM
14302020-03-11 Alan Modra <amodra@gmail.com>
1431
1432 * som.c (setup_sections): Sanity check subspace.name.
1433
435edf0b
AM
14342020-03-11 Alan Modra <amodra@gmail.com>
1435
1436 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1437
6b5e16ff
AM
14382020-03-10 Alan Modra <amodra@gmail.com>
1439
1440 PR 25648
1441 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1442 addresses here.
1443
2f57795b
AM
14442020-03-09 Alan Modra <amodra@gmail.com>
1445
1446 * wasm-module.c (wasm_scan): Sanity check file name length
1447 before allocating memory. Move common section setup code. Do
1448 without bfd_tell to calculate section size.
1449
a0dcf297
NC
14502020-03-06 Nick Clifton <nickc@redhat.com>
1451
1452 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1453 with error messages and failure return values.
1454
e15a8da9
MF
14552020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1456
1457 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1458 relocation sections for any removed reference to a dynamic symbol.
1459
a8e14f4c
NC
14602020-03-05 Nick Clifton <nickc@redhat.com>
1461
1462 * elf-bfd.h (struct elf_backend_data): Add new fields:
1463 init_secondary_reloc_section, slurp_secondary_reloc_section,
1464 write_secondary_reloc_section.
1465 (_bfd_elf_init_secondary_reloc_section): Prototype.
1466 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1467 (_bfd_elf_write_secondary_reloc_section): Prototype.
1468 * elf.c ( bfd_section_from_shdr): Invoke the new
1469 init_secondary_reloc_section backend function, if defined, when a
1470 second reloc section is encountered.
1471 (swap_out_syms): Invoke the new symbol_section_index function, if
1472 defined, when computing the section index of an OS/PROC specific
1473 symbol.
1474 (_bfd_elf_init_secondary_reloc_section): New function.
1475 (_bfd_elf_slurp_secondary_reloc_section): New function.
1476 (_bfd_elf_write_secondary_reloc_section): New function.
1477 (_bfd_elf_copy_special_section_fields): New function.
1478 * elfcode.h (elf_write_relocs): Invoke the new
1479 write_secondary_relocs function, if defined, in order to emit
1480 secondary relocs.
1481 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1482 function, if defined, in order to read in secondary relocs.
1483 * elfxx-target.h (elf_backend_copy_special_section_fields):
1484 Provide a non-NULL default definition.
1485 (elf_backend_init_secondary_reloc_section): Likewise.
1486 (elf_backend_slurp_secondary_reloc_section): Likewise.
1487 (elf_backend_write_secondary_reloc_section): Likewise.
1488 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1489 fields.
1490 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1491 * configure: Regenerate.
1492
6f8f95b4
AM
14932020-03-05 Alan Modra <amodra@gmail.com>
1494
1495 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1496 against file size before allocating memory. Use bfd_alloc rather
1497 than bfd_zalloc for carsym/strings memory.
1498
233bf4f8
AM
14992020-03-04 Alan Modra <amodra@gmail.com>
1500
1501 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1502 sh_addr mod sh_addalign is zero.
1503
1039fd9a
AM
15042020-03-04 Alan Modra <amodra@gmail.com>
1505
1506 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1507
f5714099
AM
15082020-03-03 Alan Modra <amodra@gmail.com>
1509
1510 * format.c (struct bfd_preserve): Add cleanup field.
1511 (bfd_preserve_save): Add cleanup param and save.
1512 (bfd_preserve_restore): Return cleanup.
1513 (bfd_preserve_finish): Call the cleanup for the discarded match.
1514 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1515 and clear when preserving a match. Restore cleanup too when
1516 restoring that match.
1517
40b35c78
AM
15182020-03-02 Alan Modra <amodra@gmail.com>
1519
1520 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1521 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1522 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1523 (core_sco5_vec): Correct initialisers.
1524
601b73d5
AM
15252020-03-02 Alan Modra <amodra@gmail.com>
1526
1527 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1528 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1529 * cisco-core.c (cisco_core_file_validate): Likewise.
1530 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1531 * hpux-core.c (hpux_core_core_file_p): Likewise.
1532 * irix-core.c (irix_core_core_file_p): Likewise.
1533 * lynx-core.c (lynx_core_file_p): Likewise.
1534 * netbsd-core.c (netbsd_core_file_p): Likewise.
1535 * osf-core.c (osf_core_core_file_p): Likewise.
1536 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1537 * sco5-core.c (sco5_core_file_p): Likewise.
1538
728d32c4
L
15392020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1540
1541 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1542
cb001c0d
AM
15432020-03-02 Alan Modra <amodra@gmail.com>
1544
1545 * targets.c (bfd_cleanup): New typedef.
1546 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1547 * libbfd-in.h (_bfd_no_cleanup): Define.
1548 * format.c (bfd_reinit): Add cleanup parameter, call it.
1549 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1550 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1551 * aout-target.h (callback, object_p): Return bfd_cleanup.
1552 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1553 * archive.c (bfd_generic_archive_p): Likewise.
1554 * binary.c (binary_object_p): Likewise.
1555 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1556 * coff-ia64.c (ia64coff_object_p): Likewise.
1557 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1558 * coff-sh.c (coff_small_object_p): Likewise.
1559 * coff-stgo32.c (go32_check_format): Likewise.
1560 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1561 (xcoff64_core_p): Likewise.
1562 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1563 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1564 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1565 * elfcode.h (elf_object_p): Likewise.
1566 * elfcore.h (elf_core_file_p): Likewise.
1567 * i386msdos.c (msdos_object_p): Likewise.
1568 * ihex.c (ihex_object_p): Likewise.
1569 * libaout.h (some_aout_object_p): Likewise.
1570 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1571 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1572 * libbfd.c (_bfd_dummy_target): Likewise.
1573 * libcoff-in.h (coff_object_p): Likewise.
1574 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1575 (bfd_mach_o_arm64_core_p): Likewise.
1576 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1577 (bfd_mach_o_arm_core_p): Likewise.
1578 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1579 (bfd_mach_o_i386_core_p): Likewise.
1580 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1581 (bfd_mach_o_x86_64_core_p): Likewise.
1582 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1583 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1584 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1585 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1586 * mmo.c (mmo_object_p): Likewise.
1587 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1588 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1589 (pe_bfd_object_p): Likewise.
1590 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1591 * ppcboot.c (ppcboot_object_p): Likewise.
1592 * rs6000-core.c (rs6000coff_core_p): Likewise.
1593 * som.c (som_object_setup, som_object_p): Likewise.
1594 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1595 * tekhex.c (tekhex_object_p): Likewise.
1596 * vms-alpha.c (alpha_vms_object_p): Likewise.
1597 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1598 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1599 * wasm-module.c (wasm_object_p): Likewise.
1600 * xsym.c (bfd_sym_object_p): Likewise.
1601 * xsym.h (bfd_sym_object_p): Likewise.
1602 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1603 return type.
1604 * pdp11.c (some_aout_object_p): Likewise.
1605 * plugin.c (register_ld_plugin_object_p): Update object_p
1606 parameter type.
1607 * plugin.h (register_ld_plugin_object_p): Likewise.
1608 * bfd-in2.h: Regenerate.
1609 * libbfd.h: Regenerate.
1610 * libcoff.h: Regenerate.
1611
a4dd6c97
AM
16122020-03-02 Alan Modra <amodra@gmail.com>
1613
1614 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1615 applicable section flags.
1616 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1617 (mips_ecoff_bele_vec): Likewise.
1618 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1619 and .sbss sections.
1620 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1621 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1622
bf577467
AM
16232020-03-02 Alan Modra <amodra@gmail.com>
1624
1625 * elf32-m32r.c (m32r_elf_section_flags): New function.
1626 (elf_backend_section_flags): Define.
1627 * elf32-nds32.c (nds32_elf_section_flags): New function.
1628 (elf_backend_section_flags): Define.
1629 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1630 .sbss and .sdata sections.
1631 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1632 for SHF_V850_GPREL sections.
1633 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1634 FIXME.
1635 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1636 for SHF_PARISC_SHORT sections.
1637 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1638 (elf_backend_section_flags): Define.
1639 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1640 for SHF_MIPS_GPREL sections. Delete FIXME.
1641
8c803a2d
AM
16422020-03-02 Alan Modra <amodra@gmail.com>
1643
1644 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1645 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1646 calling elf_backend_section_flags with adjusted params. Use
1647 newsect->flags past that point.
1648 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1649 special sections.
1650 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1651 to have their type overridden, and all sh_flags but processor and
1652 os specific.
1653 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1654 * elf32-mep.c (mep_elf_section_flags): Likewise.
1655 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1656 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1657 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1658 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1659 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1660 stub BFD and non-aarch64 input files when scanning for stubs.
1661
7d4b2d2d
AM
16622020-03-02 Alan Modra <amodra@gmail.com>
1663
1664 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1665 limit to decompressed element size.
1666
26f60d59
AM
16672020-03-02 Alan Modra <amodra@gmail.com>
1668
1669 * vms-lib.c (vms_traverse_index): Add recur_count param and
1670 update calls. Fail on excessive recursion.
1671
9cb56943
AM
16722020-03-02 Alan Modra <amodra@gmail.com>
1673
1674 * vms-alpha.c (vms_get_remaining_object_record): Use
1675 bfd_realloc_or_free rather than bfd_realloc.
1676 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1677 (dst_define_location, parse_module): Likewise, and check realloc
1678 return status before using memory. Return status from function
1679 adjusting all callers.
1680
182ec670
AM
16812020-02-28 Alan Modra <amodra@gmail.com>
1682
1683 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1684
1b088c82
AM
16852020-02-28 Alan Modra <amodra@gmail.com>
1686
1687 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1688 Remove duplicate undersize check.
1689
5f602802
AM
16902020-02-27 Alan Modra <amodra@gmail.com>
1691
1692 PR 24511
1693 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1694
49d9fd42
AM
16952020-02-27 Alan Modra <amodra@gmail.com>
1696
1697 PR 24511
1698 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1699 (coff_section_type): Adjust comment.
1700 (decode_section_type): Likewise. Call coff_section_type before
1701 decode_section_type.
1702 (bfd_decode_symclass): Use 'c' for common sections other than
1703 the standard one.
1704
05f52dc2
AM
17052020-02-27 Alan Modra <amodra@gmail.com>
1706
1707 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1708 malloc'd block.
1709
ff69a894
AM
17102020-02-27 Alan Modra <amodra@gmail.com>
1711
1712 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1713 if file is an archive element.
1714 * bfd-in2.h: Regenerate.
1715
02f7e7ee
AM
17162020-02-26 Alan Modra <amodra@gmail.com>
1717
1718 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1719 bfd_set_error on failing test. Don't bother changing bfd_error on
1720 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1721 Check sym name is within string buffer. Use size_t for some vars.
1722 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1723 int_buf. Don't change bfd_error on file read error. Use
1724 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1725 calculations to catch overflows before they occur. malloc and
1726 free raw armap rather than using bfd_alloc. Read raw armap before
1727 allocating carsym+strings buffer.
1728 (_bfd_slurp_extended_name_table): Localize variables. Check
1729 name size against file size.
1730
cc4c4f40
AM
17312020-02-26 Alan Modra <amodra@gmail.com>
1732
1733 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1734
e0b317de
AM
17352020-02-26 Alan Modra <amodra@gmail.com>
1736
1737 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1738 malloc. Check for NULL return from bfd_malloc.
1739 (rx_table_find, rx_table_map): Likewise.
1740 (rx_set_section_contents): Check bfd_alloc return.
1741 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1742
dc1e8a47
AM
17432020-02-26 Alan Modra <amodra@gmail.com>
1744
1745 * aoutx.h: Indent labels correctly. Format error strings.
1746 * archive.c: Likewise.
1747 * archive64.c: Likewise.
1748 * coff-arm.c: Likewise.
1749 * coff-rs6000.c: Likewise.
1750 * coff-stgo32.c: Likewise.
1751 * cpu-arm.c: Likewise.
1752 * dwarf2.c: Likewise.
1753 * elf-ifunc.c: Likewise.
1754 * elf-properties.c: Likewise.
1755 * elf-s390-common.c: Likewise.
1756 * elf-strtab.c: Likewise.
1757 * elf.c: Likewise.
1758 * elf32-arm.c: Likewise.
1759 * elf32-bfin.c: Likewise.
1760 * elf32-cr16.c: Likewise.
1761 * elf32-csky.c: Likewise.
1762 * elf32-i386.c: Likewise.
1763 * elf32-m68k.c: Likewise.
1764 * elf32-msp430.c: Likewise.
1765 * elf32-nds32.c: Likewise.
1766 * elf32-nios2.c: Likewise.
1767 * elf32-pru.c: Likewise.
1768 * elf32-xtensa.c: Likewise.
1769 * elf64-ia64-vms.c: Likewise.
1770 * elf64-x86-64.c: Likewise.
1771 * elfcode.h: Likewise.
1772 * elfcore.h: Likewise.
1773 * elflink.c: Likewise.
1774 * elfnn-aarch64.c: Likewise.
1775 * elfnn-ia64.c: Likewise.
1776 * elfnn-riscv.c: Likewise.
1777 * elfxx-mips.c: Likewise.
1778 * elfxx-sparc.c: Likewise.
1779 * elfxx-x86.c: Likewise.
1780 * i386lynx.c: Likewise.
1781 * merge.c: Likewise.
1782 * pdp11.c: Likewise.
1783 * plugin.c: Likewise.
1784 * reloc.c: Likewise.
1785
e310298c
AM
17862020-02-26 Alan Modra <amodra@gmail.com>
1787
1788 PR 25593
1789 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1790 "dyn_loaded".
1791 (bfd_elf_add_dt_needed_tag): Declare.
1792 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1793 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1794 from elf_add_dt_needed_tag. Remove soname and doit param.
1795 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1796 to see whether as-needed lib is already loaded, use dyn_loaded
1797 list instead. When saving and restoring around as-needed lib
1798 handle possibility that dynstr has not been initialised. Don't
1799 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1800 Mark libs loaded via DT_NEEDED entries of other libs with
1801 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1802 the output.
1803 (elf_link_check_versioned_symbol): Remove now unneccesary
1804 DYNAMIC check when traversing dyn_loaded list.
1805
b570b954
AM
18062020-02-26 Alan Modra <amodra@gmail.com>
1807
1808 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1809
ecda9016
L
18102020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1811
1812 PR binutils/25584
1813 * plugin.c (need_lto_wrapper_p): New.
1814 (bfd_plugin_set_program_name): Add an int argument to set
1815 need_lto_wrapper_p.
1816 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1817 set.
1818 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1819
a98c743f
AM
18202020-02-24 Alan Modra <amodra@gmail.com>
1821
1822 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1823
c893ce36
AM
18242020-02-24 Alan Modra <amodra@gmail.com>
1825
1826 * vms-lib.c (struct carsym_mem): Add limit.
1827 (vms_add_index): Heed limit.
1828 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1829 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1830 Always return actual number read.
1831 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1832 assertion with error exit.
1833
7b3c2715
AM
18342020-02-22 Alan Modra <amodra@gmail.com>
1835
1836 PR 25585
1837 * elf.c (assign_file_positions_for_load_sections): Continue linking
1838 on "PHDR segment not covered by LOAD segment" errors.
1839
a4425a57
AM
18402020-02-21 Alan Modra <amodra@gmail.com>
1841
1842 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1843 overflow check.
1844 (bfd_mach_o_canonicalize_reloc): Likewise.
1845 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1846 counts and offsets against file size.
1847 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1848 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1849 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1850 against file size. Delete symbol table error message.
1851 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1852 against file size.
1853 (bfd_mach_o_read_symtab): Likewise.
1854 (bfd_mach_o_read_command): Pass file size.
1855 (bfd_mach_o_scan): Sanity check command count against file size.
1856
dda2980f
AM
18572020-02-21 Alan Modra <amodra@gmail.com>
1858
1859 PR 25569
1860 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1861 "text", "data" and "bss" section pointer vars. Don't update
1862 section size, just exec header sizes.
1863 (adjust_sizes_and_vmas): Don't update text section size. Set
1864 initial exec header a_text. Print exec headers sizes.
1865 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1866 (adjust_sizes_and_vmas): Similarly. Formatting.
1867 (final_link): Correct final file extension.
1868
00e49dff
NC
18692020-02-20 Nick Clifton <nickc@redhat.com>
1870
1871 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1872 callback.
1873 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1874 default definition.
1875 (elfNN_bed): Initialise the symbol_section_index field.
1876 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1877 OS and PROC specific section indicies. Warn if converting other
1878 reserved incidies to SHN_ABS.
1879
fcaaac0a
SB
18802020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1881
1882 PR 25537
1883 * cpu-z80.c: Add machine type compatibility checking.
1884
dcf06b89
L
18852020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1886
1887 PR binutils/25355
1888 * plugin.c (plugin_list_entry): Remove handle.
1889 (try_load_plugin): Call dlclose before return.
1890
2c7c5554
AM
18912020-02-19 Alan Modra <amodra@gmail.com>
1892
1893 * libbfd-in.h (_bfd_constant_p): Define.
1894 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1895 file size before allocating memory.
1896 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1897 * elf.c (bfd_elf_get_str_section): Likewise.
1898 (_bfd_elf_slurp_version_tables): Likewise.
1899 * libbfd.h: Regenerate.
1900
2bb3687b
AM
19012020-02-19 Alan Modra <amodra@gmail.com>
1902
1903 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1904 * aoutx.h (aout_get_external_symbols): Replace calls to
1905 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1906 (slurp_reloc_table): Likewise.
1907 * archive.c (do_slurp_bsd_armap): Likewise.
1908 (do_slurp_coff_armap): Likewise.
1909 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1910 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1911 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1912 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1913 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1914 (_bfd_coff_get_external_symbols): Likewise.
1915 * ecoff.c (ecoff_slurp_symbolic_header),
1916 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1917 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1918 (ecoff_indirect_link_order): Likewise.
1919 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1920 (_bfd_elf_slurp_version_tables): Likewise.
1921 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1922 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1923 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1924 * elf64-alpha.c (READ): Likewise.
1925 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1926 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1927 * elfcode.h (elf_slurp_symbol_table),
1928 (elf_slurp_reloc_table_from_section): Likewise.
1929 * elflink.c (elf_link_add_object_symbols),
1930 (elf_link_check_versioned_symbol): Likewise.
1931 * elfxx-mips.c (READ): Likewise.
1932 * i386lynx.c (slurp_reloc_table): Likewise.
1933 * lynx-core.c (lynx_core_file_p): Likewise.
1934 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1935 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1936 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1937 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1938 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1939 (bfd_pef_parse_symbols): Likewise.
1940 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1941 * som.c (setup_sections, som_slurp_string_table),
1942 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1943 (som_bfd_fill_in_ar_symbols): Likewise.
1944 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1945 (evax_bfd_print_image): Likewise.
1946 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1947 * wasm-module.c (wasm_scan): Likewise.
1948 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1949 * xsym.c (bfd_sym_read_name_table),
1950 (bfd_sym_print_type_information_table_entry): Likewise.
1951 * libbfd.h: Regenerate.
1952
806470a2
AM
19532020-02-19 Alan Modra <amodra@gmail.com>
1954
1955 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1956 reading external relocs.
1957 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1958 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1959 after bfd_bread.
1960 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1961 bfd_release.
1962 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1963 (m32c_elf_relax_section): Likewise.
1964 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1965 (rl78_elf_relax_section): Likewise.
1966 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1967 (elf32_rx_relax_section): Likewise.
1968 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1969 parameter types and use..
1970 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1971 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1972 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1973 being read from file, just the extra.
1974 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1975 after reading external syms. Free on failure.
1976
1f4361a7
AM
19772020-02-19 Alan Modra <amodra@gmail.com>
1978
1979 * coffcode.h (buy_and_read, coff_slurp_line_table),
1980 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1981 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1982 corresponding bfd_alloc call. Adjust variables to suit.
1983 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1984 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1985 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1986 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1987 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1988 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1989 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1990 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1991 * elf64-alpha.c (READ): Likewise.
1992 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1993 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1994 (bfd_from_remote_memory): Likewise.
1995 * elfcore.h (core_find_build_id): Likewise.
1996 * elfxx-mips.c (READ): Likewise.
1997 * mach-o.c (bfd_mach_o_mangle_sections),
1998 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1999 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2000 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2001 * som.c (setup_sections, som_prep_for_fixups)
2002 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2003 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2004 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2005 (som_bfd_ar_write_symbol_stuff): Likewise.
2006 * vms-alpha.c (vector_grow1): Likewise.
2007 * vms-lib.c (vms_add_index): Likewise.
2008 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2009 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2010 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2011 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2012 (bfd_alloc2, bfd_zalloc2): Delete.
2013 (_bfd_mul_overflow): Define.
2014 * libbfd.h: Regenerate.
2015
446f7ed5
AM
20162020-02-19 Alan Modra <amodra@gmail.com>
2017
2018 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2019 bfd_zalloc2.
2020 (assign_section_numbers): Likewise.
2021 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2022 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2023 bfd_malloc2, size_t amt, and unsigned tls_count.
2024 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2025 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2026 (elf_output_implib): Use bfd_alloc.
2027
b03202e3
AM
20282020-02-19 Alan Modra <amodra@gmail.com>
2029
2030 * bfd.c (struct bfd): Move format and direction to other
2031 bitfields. Add "size".
2032 * bfdio.c (bfd_get_size): Cache size when not writing file.
2033 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2034 returning zero, ie. unknown.
2035 (bfd_get_alt_debug_link_info): Likewise.
2036 * bfd-in2.h: Regenerate.
2037
7c5fa58e
AM
20382020-02-19 Alan Modra <amodra@gmail.com>
2039
2040 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2041 bfd_get_file_size twice.
2042 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2043 zero, ie. unknown, return.
2044 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2045 * elfcode.h (elf_swap_shdr_in): Likewise.
2046 (elf_object_p): Don't call bfd_get_file_size twice and correct
2047 file size check.
2048
96d3b80f
AM
20492020-02-19 Alan Modra <amodra@gmail.com>
2050
2051 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2052 FALSE if memory alloc fails. Adjust calls.
2053 * som.c (som_prep_for_fixups): Likewise.
2054 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2055 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2056 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2057 * som.c (som_build_and_write_symbol_table): Return via error_return
2058 on seek failure.
2059 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2060 (VEC_APPEND_EL): Delete.
2061 (vector_grow1): Return pointer to element. Catch overflow.
2062 Return NULL on memory allocation failure.
2063 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2064 (alpha_vms_add_fixup_ca): Likewise.
2065 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2066 before using.
2067 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2068
986f0783
AM
20692020-02-19 Alan Modra <amodra@gmail.com>
2070
2071 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2072 * aout-target.h (object_p): Likewise.
2073 * aout-tic30.c (tic30_aout_object_p): Likewise.
2074 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2075 (emit_stringtab, write_syms, link_hash_table_create),
2076 (aout_link_write_other_symbol): Likewise.
2077 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2078 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2079 (_bfd_compute_and_write_armap): Likewise.
2080 * archures.c (bfd_arch_list): Likewise.
2081 * bfd.c (bfd_record_phdr): Likewise.
2082 * binary.c (binary_canonicalize_symtab): Likewise.
2083 * cisco-core.c (cisco_core_file_validate): Likewise.
2084 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2085 (find_arm_glue, record_arm_to_thumb_glue),
2086 (record_thumb_to_arm_glue): Likewise.
2087 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2088 (ppc_allocate_toc_section): Likewise.
2089 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2090 * coff-sh.c (sh_relax_section): Likewise.
2091 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2092 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2093 (coff_set_alignment_hook, coff_mkobject),
2094 (coff_compute_section_file_positions): Likewise.
2095 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2096 (coff_find_nearest_line_with_names),
2097 ( bfd_coff_set_symbol_class): Likewise.
2098 * cofflink.c (_bfd_coff_link_hash_table_create),
2099 (_bfd_coff_link_input_bfd): Likewise.
2100 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2101 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2102 (build_line_info_table, sort_line_sequences),
2103 (line_info_add_include_dir, line_info_add_file_name),
2104 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2105 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2106 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2107 (_bfd_ecoff_find_nearest_line),
2108 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2109 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2110 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2111 * elf-m10300.c (mn10300_elf_relax_section),
2112 (elf32_mn10300_link_hash_table_create): Likewise.
2113 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2114 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2115 * elf32-arm.c (elf32_arm_link_hash_table_create),
2116 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2117 (elf32_arm_new_section_hook): Likewise.
2118 * elf32-avr.c (elf_avr_new_section_hook),
2119 (elf32_avr_link_hash_table_create, get_local_syms),
2120 (elf32_avr_setup_section_lists): Likewise.
2121 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2122 (bfin_link_hash_table_create): Likewise.
2123 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2124 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2125 * elf32-csky.c (csky_elf_link_hash_table_create),
2126 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2127 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2128 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2129 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2130 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2131 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2132 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2133 (m32r_elf_check_relocs): Likewise.
2134 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2135 (elf32_m68hc11_setup_section_lists),
2136 (elf32_m68hc11_size_stubs): Likewise.
2137 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2138 * elf32-metag.c (elf_metag_link_hash_table_create),
2139 (elf_metag_setup_section_lists): Likewise.
2140 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2141 (microblaze_elf_check_relocs): Likewise.
2142 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2143 (nds32_elf_check_relocs): Likewise.
2144 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2145 (get_local_syms, nios2_elf32_check_relocs),
2146 (nios2_elf32_link_hash_table_create): Likewise.
2147 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2148 (or1k_elf_check_relocs): Likewise.
2149 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2150 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2151 * elf32-s390.c (elf_s390_link_hash_table_create),
2152 (elf_s390_check_relocs): Likewise.
2153 * elf32-score.c (score_elf_create_got_section),
2154 (s3_elf32_score_new_section_hook),
2155 (elf32_score_link_hash_table_create): Likewise.
2156 * elf32-score7.c (score_elf_create_got_section),
2157 (s7_elf32_score_new_section_hook): Likewise.
2158 * elf32-sh.c (sh_elf_link_hash_table_create),
2159 (sh_elf_check_relocs): Likewise.
2160 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2161 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2162 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2163 (tilepro_elf_check_relocs): Likewise.
2164 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2165 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2166 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2167 (elf_xtensa_new_section_hook): Likewise.
2168 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2169 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2170 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2171 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2172 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2173 * elf64-ppc.c (ppc64_elf_new_section_hook),
2174 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2175 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2176 * elf64-s390.c (elf_s390_link_hash_table_create),
2177 (elf_s390_check_relocs): Likewise.
2178 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2179 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2180 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2181 (elf_link_add_archive_symbols, compute_bucket_count),
2182 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2183 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2184 (bfd_elf_final_link): Likewise.
2185 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2186 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2187 (elfNN_aarch64_new_section_hook): Likewise.
2188 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2189 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2190 (riscv_elf_check_relocs): Likewise.
2191 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2192 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2193 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2194 (_bfd_mips_elf_link_hash_table_create): Likewise.
2195 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2196 (_bfd_sparc_elf_check_relocs),
2197 (_bfd_sparc_elf_new_section_hook): Likewise.
2198 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2199 (tilegx_elf_check_relocs): Likewise.
2200 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2201 * format.c (bfd_check_format_matches): Likewise.
2202 * hash.c (_bfd_stringtab_init): Likewise.
2203 * ihex.c (ihex_scan): Likewise.
2204 * irix-core.c (irix_core_core_file_p): Likewise.
2205 * linker.c (bfd_wrapped_link_hash_lookup),
2206 (_bfd_generic_link_hash_table_create),
2207 (_bfd_generic_reloc_link_order): Likewise.
2208 * lynx-core.c (lynx_core_file_p): Likewise.
2209 * netbsd-core.c (netbsd_core_file_p): Likewise.
2210 * osf-core.c (osf_core_core_file_p): Likewise.
2211 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2212 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2213 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2214 * peicode.h (pe_mkobject): Likewise.
2215 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2216 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2217 * sco5-core.c (read_uarea): Likewise.
2218 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2219 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2220 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2221 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2222 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2223 * srec.c (srec_scan): Likewise.
2224 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2225 * targets.c (bfd_target_list): Likewise.
2226 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2227 * trad-core.c (trad_unix_core_file_p): Likewise.
2228 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2229 (vms_new_section_hook): Likewise.
2230 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2231 * xcofflink.c (xcoff_get_section_contents),
2232 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2233 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2234 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2235
2d0e1217
AM
22362020-02-19 Alan Modra <amodra@gmail.com>
2237
2238 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2239
99845b3b
L
22402020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2241
2242 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2243 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2244 a build_list_p argument. Don't search plugin_list. Short circuit
2245 when building the plugin list.
2246 (has_plugin): Renamed to has_plugin_list.
2247 (bfd_plugin_set_plugin): Don't set has_plugin.
2248 (bfd_plugin_specified_p): Check plugin_list instead.
2249 (build_plugin_list): New function.
2250 (load_plugin): Call build_plugin_list and use plugin_list.
2251
22fe7df8
L
22522020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2253
2254 PR binutils/25355
2255 * plugin.c (try_claim): Always clean up for LTO wrapper.
2256 (try_load_plugin): Treat each object as independent. Create a
2257 copy for plugin name.
2258
c675ec1e
NC
22592020-02-11 Nick Clifton <nickc@redhat.com>
2260
2261 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2262 for addresses in print statements.
2263 (msp430_elf_relax_delete_bytes): Likewise.
2264 (msp430_elf_relax_add_words): Likewise.
2265 (msp430_elf_relax_section): Likewise.
2266
1d07a805
L
22672020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2268
2269 * plugin.c (add_symbols): Clear plugin_data memory.
2270
0aa99dcd
L
22712020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2272
2273 PR binutils/25355
2274 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2275 (EXECUTABLE_SUFFIX): Likewise.
2276 * config.in: Regenerated.
2277 * configure: Likewise.
2278 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2279 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2280 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2281 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2282 (get_lto_wrapper): New.
2283 (setup_lto_wrapper_env): Likewise.
2284 (current_plugin): Likewise.
2285 (register_all_symbols_read): Likewise.
2286 (register_cleanup): Likewise.
2287 (get_symbols): Likewise.
2288 (add_input_file): Likewise.
2289 (bfd_plugin_close_and_cleanup): Likewise.
2290 (claim_file): Removed.
2291 (register_claim_file): Set current_plugin->claim_file.
2292 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2293 lto_syms in current_plugin.
2294 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2295 all_symbols_read handler. Copy real symbols to plugin_data.
2296 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2297 (try_load_plugin): Don't reuse the previous plugin for LTO
2298 wrapper. Set up GCC LTO wrapper if possible. Don't set
2299 plugin_list_iter->claim_file.
2300 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2301 possible.
2302 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2303 real_syms.
2304
ac4280da
JL
23052020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2306
2307 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2308 check if previous instruction matches a conditional jump inserted
2309 earlier. Invert conditional jump and delete branch in this case.
2310
8d6cb116
JL
23112020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2312
2313 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2314 msp430_elf_relax_add_words. Support insertion of either one or two
2315 words.
2316 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2317 needs to be grown. Handle insertion of branch instruction to replace
2318 jump.
2319
d60f5448
JL
23202020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2321
2322 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2323 debugging relocations.
2324 (msp430_elf_relax_delete_bytes): Likewise.
2325 (msp430_elf_relax_add_two_words): Likewise.
2326 (msp430_elf_relax_section): Likewise.
2327
e1f85e11
AM
23282020-02-10 Alan Modra <amodra@gmail.com>
2329
2330 * archures.c: Wrap overlong z80 comments.
2331 * bfd-in2.h: Regenerate.
2332
9fc0b501
SB
23332020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2334
2335 PR 25469
2336 * archures.c: Add GBZ80 and Z80N machine values.
2337 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2338 * coff-z80.c: Add support for new reloc.
2339 * coffcode.h: Add support for new machine values.
2340 * cpu-z80.c: Add support for new machine names.
2341 * elf32-z80.c: Add support for new reloc.
2342 * bfd-in2.h: Regenerate.
2343 * libbfd.h: Regenerate.
2344
9984857c
NC
23452020-02-07 Nick Clifton <nickc@redhat.com>
2346
2347 PR 23932
2348 * elf.c (rewrite_elf_program_header): Do not complain if no
2349 sections are mapped to a segment.
2350
5242a0a0
L
23512020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2352
2353 PR ld/25490
2354 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2355 for garbage collection on __patchable_function_entries section
2356 without linked-to section.
2357
b7d07216
L
23582020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2359
2360 PR gas/25381
2361 * bfd-in2.h: Regenerated.
2362 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2363 on section if gc_mark of any of its linked-to sections is set
2364 and don't set gc_mark again.
2365 * section.c (asection): Add linked_to_symbol_name to map_head
2366 union.
2367
b93a662b
MR
23682020-02-06 Maciej W. Rozycki <macro@wdc.com>
2369
2370 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2371 reporting an unrecognized instruction with R_V850_LONGJUMP.
2372
6df4c9c2
AM
23732020-02-05 Alan Modra <amodra@gmail.com>
2374
2375 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2376
24872cb3
AM
23772020-02-04 Alan Modra <amodra@gmail.com>
2378
2379 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2380 R_PPC_VLE_ADDR20, goto copy_reloc.
2381
ef4627fa
L
23822020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2383
2384 * bfd-in2.h: Regenerated.
2385 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2386
a8c4d40b
L
23872020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2388
2389 PR gas/25380
2390 * bfd-in2.h: Regenerated.
2391 * ecoff.c (bfd_debug_section): Add section_id.
2392 * section.c (bfd_section): Add section_id.
2393 (SEC_ASSEMBLER_SECTION_ID): New.
2394 (BFD_FAKE_SECTION): Add section_id.
2395
5a9212a1
NC
23962020-02-01 Nick Clifton <nickc@redhat.com>
2397
2398 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2399 obsolete list.
2400
e7cbe0c4
SL
24012020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2402
2403 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2404 encodings are relative to the GOT on nios2, too.
2405
72ebe8c5
AM
24062020-01-31 Alan Modra <amodra@gmail.com>
2407
2408 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2409 file. Use $< and $@ in rules.
2410 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2411 (elf32-ia64.c, elf64-ia64.c): Likewise.
2412 (elf32-riscv.c, elf64-riscv.c): Likewise.
2413 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2414 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2415 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2416 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2417 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2418 * Makefile.in: Regenerate.
2419
327301a4
AM
24202020-01-31 Alan Modra <amodra@gmail.com>
2421
2422 PR 4110
2423 * elf.c (setup_group): Don't clear entire section contents,
2424 just the padding after group flags. Release alloc'd memory
2425 after a seek or read failure.
2426
b5d36aaa
JT
24272020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2428
2429 * peXXigen.c (pe_is_repro): New function.
2430 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2431 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2432
1957ab10
JT
24332020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2434
2435 * peXXigen.c (debug_type_names): Add names for new debug data type
2436 values.
2437
87b2920f
JT
24382020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2439
2440 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2441 inner loop. Fix a memory leak.
2442
72913831
AM
24432020-01-30 Alan Modra <amodra@gmail.com>
2444
2445 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2446 or obj_coff_keep_strings here.
2447 (coff_get_normalized_symtab): Free external syms directly.
2448 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2449 on error exit path.
2450
c35d018b
JW
24512020-01-27 Jim Wilson <jimw@sifive.com>
2452
2453 * cpu-riscv.c (riscv_scan): New.
2454 (N): Change bfd_default_scan to riscv_scan.
2455
086b06f3
AS
24562020-01-27 Andreas Schwab <schwab@suse.de>
2457
2458 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2459 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2460 * Makefile.in: Regenerate.
2461 * cpu-plugin.c: Remove.
2462 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2463 (bfd_plugin_arch): Remove declaration.
2464 * bfd-in2.h: Regenerate.
2465 * po/SRC-POTFILES.in: Regenerate.
2466
3024a17a
AM
24672020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2468 Alan Modra <amodra@gmail.com>
2469
2470 PR ld/25458
2471 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2472
b5f998b2
JW
24732020-01-24 Jim Wilson <jimw@sifive.com>
2474
2475 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2476 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2477 avoid over long line.
2478
caa31cfa
NC
24792020-01-24 Nick Clifton <nickc@redhat.com>
2480
2481 PR 25447
2482 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2483 syms and keep strings flags as these may have been set in order to
2484 prevent a bogus call to free.
2485
24e648d4
NC
24862020-01-23 Nick Clifton <nickc@redhat.com>
2487
2488 * po/fr.po: Updated French translation.
2489
67641dd3
AM
24902020-01-23 Alan Modra <amodra@gmail.com>
2491
2492 PR 25444
2493 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2494 by zero when p_align is zero.
2495
403d1bd9
JW
24962020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2497
2498 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2499 (riscv_prefix_cmp): Likewise.
2500 (riscv_non_std_ext_p): Deleted.
2501 (riscv_std_sv_ext_p): Likewise.
2502 (riscv_non_std_sv_ext_p): Likewise.
2503 (riscv_merge_non_std_and_sv_ext): Rename to...
2504 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2505 (riscv_merge_arch_attr_info): Replace 3 calls to
2506 riscv_merge_non_std_and_sv_ext with single call to
2507 riscv_merge_multi_letter_ext.
2508 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2509 encounter a 'z' prefix.
2510 (riscv_get_prefix_class): New function, return prefix class based
2511 on first few characters of input string.
2512 (riscv_parse_config): New structure to factor out minor differences
2513 in extension class parsing behaviour.
2514 (riscv_parse_sv_or_non_std_ext): Rename to...
2515 (riscv_parse_prefixed_ext): and parameterise with
2516 riscv_parse_config.
2517 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2518 (riscv_multi_letter_ext_valid_p): New.
2519 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2520 (riscv_parse_subset): Delegate all non-single-letter parsing work
2521 to riscv_parse_prefixed_ext.
2522 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2523 (riscv_get_prefix_class): Declare.
2524
a804e476
AM
25252020-01-22 Alan Modra <amodra@gmail.com>
2526
2527 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2528 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2529 __tls_get_addr_desc.
2530 (ppc64_elf_size_stubs): Add section for linker generated
2531 __tls_get_addr_desc wrapper function. Loop at least once if
2532 generating this function.
2533 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2534 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2535
9e7028aa
AM
25362020-01-22 Alan Modra <amodra@gmail.com>
2537
2538 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2539 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2540 tga_desc_fd.
2541 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2542 (STDU_R1_0R1, ADDI_R1_R1): Define.
2543 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2544 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2545 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2546 no_tls_get_addr_regsave.
2547 (branch_reloc_hash_match): Add hash3 and hash4.
2548 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2549 (ppc64_elf_size_dynamic_sections): Likewise.
2550 (ppc64_elf_relocate_section): Likewise.
2551 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2552 __tls_get_addr stub.
2553 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2554 eh_frame.
2555 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2556 eh_frame for regsave __tls_get_addr.
2557
abc489c6
AM
25582020-01-22 Alan Modra <amodra@gmail.com>
2559
2560 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2561 which __tls_get_addr calls will be eliminated.
2562
26916852
NC
25632020-01-20 Nick Clifton <nickc@redhat.com>
2564
2565 * po/pt.po: Updates Portuguese translation.
2566 * po/ru.po: Updated Russian translation.
2567 * po/uk.po: Updated Ukranian translation.
2568
14470f07
L
25692020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2570
2571 PR ld/25416
2572 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2573 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2574 X32 mode.
2575 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2576 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2577 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2578 "rex leal x@tlsdesc(%rip), %reg" to
2579 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2580 "call *(%eax)" to "nopl (%rax)".
2581
b9ca1af6
AM
25822020-01-20 Alan Modra <amodra@gmail.com>
2583
2584 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2585 (MTLR_R11): Don't define.
2586 (LD_R0_0R3, CMPDI_R0_0): Define.
2587 (build_tls_get_addr_stub): Don't use r11 in stub.
2588
ed7007c1
AM
25892020-01-20 Alan Modra <amodra@gmail.com>
2590
2591 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2592 (defined_sym_val, is_tls_get_addr): Likewise.
2593
1b1bb2c6
NC
25942020-01-18 Nick Clifton <nickc@redhat.com>
2595
2596 * version.m4 (BFD_VERSION): Set to 2.34.50.
2597 * configure: Regenerate.
2598 * po/bfd.pot: Regenerate.
2599
ae774686
NC
26002020-01-18 Nick Clifton <nickc@redhat.com>
2601
2602 Binutils 2.34 branch created.
2603
07f1f3aa
CB
26042020-01-17 Christian Biesinger <cbiesinger@google.com>
2605
2606 * coff-arm.c: Fix spelling error (seperate).
2607 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2608 error (seperate).
2609 * sysdep.h (strnlen): Fix spelling error (seperate).
2610
0d1cc75d
LB
26112020-01-15 Lars Brinkhoff <lars@nocrew.org>
2612
2613 PR 20694
2614 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2615
e1c6cf61
AM
26162020-01-15 Alan Modra <amodra@gmail.com>
2617
2618 PR 25384
2619 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2620 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2621 of function symbols unless dot symbols are present. Do warn
2622 whenever one is created, regardles of whether a PLT entry is
2623 also emitted for the function symbol.
2624
ef4e5ba5
AM
26252020-01-14 Alan Modra <amodra@gmail.com>
2626
2627 * som.c (som_bfd_count_ar_symbols): Error when file position
2628 of symbols on chains is not strictly increasing.
2629
8ab484c2
AM
26302020-01-14 Alan Modra <amodra@gmail.com>
2631
2632 * vms.h (VMS_DEBUG): Define as 0.
2633 * vms-alpha.c (image_write): Move debug output after bounds check.
2634 Tidy bounds check.
2635 (_bfd_vms_slurp_eihd): Warning fix.
2636 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2637
b50ef514
AM
26382020-01-13 Alan Modra <amodra@gmail.com>
2639
2640 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2641 for "ignored" records.
2642
0c0adcc5
AM
26432020-01-13 Alan Modra <amodra@gmail.com>
2644
2645 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2646 Delete asect name check. Move asect NULL check to wasm_object_p.
2647 Correct bounds check of sizes against end. Replace uses of
2648 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2649 just one bfd_release.
2650 (wasm_scan): Don't use malloc/strdup for section names,
2651 bfd_alloc instead. Simplify code prefixing section name.
2652 Formatting. Don't attempt to free memory here..
2653 (wasm_object_p): ..do so here.
2654
7f026732
SN
26552020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2656
2657 PR ld/22269
2658 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2659 UNDEFWEAK_NO_DYNAMIC_RELOC.
2660 (allocate_dynrelocs_for_symbol): Likewise.
2661
8cd0e5e9
TC
26622020-01-10 Tamar Christina <tamar.christina@arm.com>
2663
2664 PR 25210
2665 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2666
71780f45
AM
26672020-01-10 Alan Modra <amodra@gmail.com>
2668
2669 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2670
b899eb3b
NC
26712020-01-09 Nick Clifton <nickc@redhat.com>
2672
2673 PR 25221
2674 * bfd.c (bfd_convert_section_contents): Check for a compress
2675 header size that is larger than the actual section size.
2676
4c6ee646
AM
26772020-01-08 Alan Modra <amodra@gmail.com>
2678
2679 PR 25351
2680 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2681 after removing sections.
2682
85f78364
JW
26832020-01-06 Jim Wilson <jimw@sifive.com>
2684
2685 PR 25205
2686 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2687 check for !bfd_link_pic (info).
2688 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2689 <R_RISCV_JAL>: Add comment.
2690 (_bfd_riscv_relax_section): For plt.offset check, add check for
2691 bfd_link_pic (info). Add comment.
2692
49078ece
AM
26932020-01-06 Alan Modra <amodra@gmail.com>
2694
2695 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2696 match failures. Don't init to bfd_error_wrong_format before
2697 calling _bfd_check_format.
2698
ab356be7
AM
26992020-01-06 Alan Modra <amodra@gmail.com>
2700
2701 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2702 status rather than exiting on stack overflow or underflow.
2703 (_bfd_vms_slurp_etir): Adjust to suit.
2704
85d86817
AM
27052020-01-06 Alan Modra <amodra@gmail.com>
2706
2707 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2708
3e6aa775
AM
27092020-01-06 Alan Modra <amodra@gmail.com>
2710
2711 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2712 command. Check name offset is within command.
2713 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2714 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2715 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2716 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2717 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2718 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2719 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2720 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2721 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2722 (bfd_mach_o_read_segment): Similarly.
2723 (bfd_mach_o_read_thread): Properly bound check thread struct.
2724 Don't repeat checks on second loop.
2725 (bfd_mach_o_read_command): Fail on invalid command length.
2726
ea933f17
AM
27272020-01-04 Alan Modra <amodra@gmail.com>
2728
2729 * format.c (bfd_check_format_matches): Add preserve_match.
2730 Save initial bfd state in "preserve", matched bfd state in
2731 "preserve_match". Save just the first match. Release
2732 bfd_alloc memory. Restore and finish preserved state as
2733 appropriate on all function exit paths.
2734
f24bdec4
AM
27352020-01-04 Alan Modra <amodra@gmail.com>
2736
2737 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2738
991fb595
AM
27392020-01-04 Alan Modra <amodra@gmail.com>
2740
2741 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2742 match too.
2743
f2a3559d
NC
27442020-01-03 Nick Clifton <nickc@redhat.com>
2745
2746 PR 25307
2747 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2748 there is enough data remaining in the code buffer before
2749 attempting to read a function stub.
2750
7a0fb7be
NC
27512020-01-03 Nick Clifton <nickc@redhat.com>
2752
2753 PR 25308
2754 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2755 return value from bfd_malloc.
2756 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2757 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2758 (elf32_arm_filter_cmse_symbols): Likewise.
2759 (elf32_arm_write_section): Likewise.
2760 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2761 (bfd_mach_o_follow_dsym): Likewise.
2762 * pef.c (bfd_pef_print_loader_section): Likewise.
2763 (bfd_pef_scan_start_address): Likewise.
2764 (bfd_pef_parse_function_stubs): Likewise.
2765 (bfd_pef_parse_symbols): Likewise.
2766
b26a3d58
ST
27672020-01-03 Sergei Trofimovich <siarheit@google.com>
2768
2769 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2770 on binary inputs ld/PR25316.
2771 (is_ia64_elf): new helper to filter on ia64 objects.
2772
4bb7a87e
JB
27732020-01-03 Jan Beulich <jbeulich@suse.com>
2774
2775 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2776 in parameter names.
2777 (bfd_mach_o_scan): Insert underscore in two variable names.
2778
6655dba2
SB
27792020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2780
2781 * Makefile.am: Add z80-elf target support.
2782 * configure.ac: Likewise.
2783 * targets.c: Likewise.
2784 * Makefile.in: Regenerate.
2785 * configure: Regenerate.
2786 * config.bfd: Add z80-elf target support and new arches: ez80 and
2787 z180.
2788 * elf32-z80.c: New file.
2789 * archures.c: Add new z80 architectures: eZ80 and Z180.
2790 * coffcode.h: Likewise.
2791 * cpu-z80.c: Likewise.
2792 * coff-z80.c: Add new relocations for Z80 target and local label
2793 check.
2794 * reloc.c: Add new relocs.
2795 * bfd-in2.h: Regenerate.
2796 * libbfd.h: Regenerate.
2797
0db131fb
TC
27982020-01-02 Tamar Christina <tamar.christina@arm.com>
2799
2800 PR 25210
2801 PR 24753
2802 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2803
b14ce8bf
AM
28042020-01-01 Alan Modra <amodra@gmail.com>
2805
2806 Update year range in copyright notice of all files.
2807
0b114740 2808For older changes see ChangeLog-2019
3499769a 2809\f
0b114740 2810Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
2811
2812Copying and distribution of this file, with or without modification,
2813are permitted in any medium without royalty provided the copyright
2814notice and this notice are preserved.
2815
2816Local Variables:
2817mode: change-log
2818left-margin: 8
2819fill-column: 74
2820version-control: never
2821End: