Update documentation regarding the bfd returned by bfd_openr_next_archived_file
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2017-12-15 Nick Clifton <nickc@redhat.com>
2
3 PR 22571
4 * archive.c (bfd_openr_next_archived_file): Extend the
5 documentation to note that it is necessary to call
6 bfd_check_format on the rrturned bfd before using it.
7
8 2017-12-14 Nick Clifton <nickc@redhat.com>
9
10 * cpu-mt.c: Update address of FSF in copyright notice.
11 * elf32-m32c.c: Likewise.
12 * elf32-mt.c: Likewise.
13 * elf32-rl78.c: Likewise.
14 * elf32-rx.c: Likewise.
15 * elf32-rx.h: Likewise.
16 * elf32-spu.h: Likewise.
17 * hosts/x86-64linux.h: Likewise.
18
19 2017-12-13 Renlin Li <renlin.li@arm.com>
20
21 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Disallow
22 BFD_RELOC_AARCH64_16 in shared object const section. Disallow
23 BFD_RELOC_AARCH64_32 in shared object const section under LP64.
24
25 2017-12-11 Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
26
27 * bfd.c (bfd_get_sign_extend_vma): Correct typo.
28
29 2017-12-09 Alan Modra <amodra@gmail.com>
30
31 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): When emitting
32 dynamic R_SPARC_RELATIVE for GOT entries, ensure the section
33 contents are zeroed.
34
35 2017-12-08 Nick Clifton <nickc@redhat.com>
36
37 * elfcode.h (elf_write_relocs): Check for an empty howto field.
38
39 2017-12-08 Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
40
41 * bfd.c (bfd_get_sign_extend_vma): Handle aix5coff64-rs6000.
42
43 2017-12-06 Alan Modra <amodra@gmail.com>
44
45 * doc/header.sed: Trim trailing space when splitting lines.
46 * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
47 * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
48 * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
49 * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
50 * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
51 * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
52 * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
53 * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
54 * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
55 * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
56 * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
57 * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
58 * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
59 * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
60 * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
61 * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
62 * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
63 * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
64 * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
65 * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
66 * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
67 * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
68 * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
69 * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
70 * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
71 * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
72 * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
73 * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
74 * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
75 * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
76 * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
77 * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
78 * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
79 * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
80 * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
81 * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
82 * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
83 * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
84 * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
85 * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
86 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
87 * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
88 * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
89 * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
90 * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
91 * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
92 * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
93 * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
94 * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
95 * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
96 * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
97 * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
98 * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
99 * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
100 * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
101 * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
102 * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
103 * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
104 * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
105 * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
106 * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
107 * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
108 * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
109 * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
110 * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
111 * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
112 * xsym.c, * xsym.h: Whitespace fixes.
113 * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
114
115 2017-12-06 Alan Modra <amodra@gmail.com>
116
117 * elf32-lm32.c (lm32_elf_check_relocs): Skip non-ALLOC sections.
118 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
119 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
120 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
121 * elf32-sh.c (sh_elf_check_relocs): Likewise.
122
123 2017-12-06 Alan Modra <amodra@gmail.com>
124
125 * elf32-hppa.c (struct elf32_hppa_dyn_reloc_entry): Delete. Use
126 struct elf_dyn_relocs throughout file instead.
127 (elf32_hppa_adjust_dynamic_symbol): Comment tidy.
128 * elf32-lm32.c (struct elf_lm32_dyn_relocs): Delete. Use
129 struct elf_dyn_relocs throughout file instead.
130 (lm32_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
131 * elf32-m32r.c (struct elf_m32r_dyn_relocs): Delete. Use
132 struct elf_dyn_relocs throughout file instead.
133 (m32r_elf_adjust_dynamic_symbol): Use readonly_dynrelocs, but disable.
134 Disable -z no-copyreloc too.
135 * elf32-metag.c (struct elf_metag_dyn_reloc_entry): Delete. Use
136 struct elf_dyn_relocs throughout file instead.
137 (elf_metag_adjust_dynamic_symbol): Use readonly_dynrelocs.
138 * elf32-microblaze.c (struct elf32_mb_dyn_relocs): Delete. Use
139 struct elf_dyn_relocs throughout file instead.
140 (readonly_dynrelocs): New function.
141 (microblaze_elf_adjust_dynamic_symbol): Use it.
142 * elf32-nds32.c (struct elf_nds32_dyn_relocs): Delete. Use
143 struct elf_dyn_relocs throughout file instead.
144 (nds32_elf_adjust_dynamic_symbol): Use readonly_dynrelocs, but disable.
145 Disable -z no-copyreloc too.
146 * elf32-nios2.c (struct elf32_nios2_dyn_relocs): Delete. Use
147 struct elf_dyn_relocs throughout file instead.
148 * elf32-or1k.c (struct elf_or1k_dyn_relocs): Delete. Use
149 struct elf_dyn_relocs throughout file instead.
150 (or1k_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
151 * elf32-sh.c (struct elf_sh_dyn_relocs): Delete. Use
152 struct elf_dyn_relocs throughout file instead.
153 (sh_elf_adjust_dynamic_symbol): Use readonly_dynrelocs, but disable.
154 Disable -z no-copyreloc too.
155 * elf32-tilepro.c (struct tilepro_elf_dyn_relocs): Delete. Use
156 struct elf_dyn_relocs throughout file instead.
157 (tilepro_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
158 * elfnn-riscv.c (struct riscv_elf_dyn_relocs): Delete. Use
159 struct elf_dyn_relocs throughout file instead.
160 (riscv_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
161 * elfxx-sparc.c (struct _bfd_sparc_elf_dyn_relocs): Delete. Use
162 struct elf_dyn_relocs throughout file instead.
163 (_bfd_sparc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
164 * elfxx-tilegx.c (struct tilegx_elf_dyn_relocs): Delete. Use
165 struct elf_dyn_relocs throughout file instead.
166 (tilegx_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
167 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Use readonly_dynrelocs.
168 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Use readonly_dynrelocs.
169
170 2017-12-06 Alan Modra <amodra@gmail.com>
171
172 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Comment tidy.
173 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
174 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
175
176 2017-12-04 Alan Modra <amodra@gmail.com>
177
178 * elfxx-x86.c (readonly_dynrelocs): New function.
179 (maybe_set_textrel): New function. Always prints via minfo and
180 correct "readonly" to "read-only" in warning message., replacing..
181 (_bfd_x86_elf_readonly_dynrelocs): ..this.
182 (_bfd_x86_elf_size_dynamic_sections): Correct "readonly" to
183 "read-only" in warning message. Formatting.
184 (_bfd_x86_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
185 * linker.c (bfd_link_hash_traverse): Comment typo fix.
186
187 2017-12-01 H.J. Lu <hongjiu.lu@intel.com>
188
189 * elfxx-x86.c (_bfd_x86_elf_readonly_dynrelocs): Print symbol
190 for map file output.
191
192 2017-12-01 Alan Modra <amodra@gmail.com>
193
194 * elf32-hppa.c (maybe_set_textrel): Print symbol for map file output.
195 * elf32-ppc.c (maybe_set_textrel): Likewise.
196 * elf64-ppc.c (maybe_set_textrel): Likewise.
197 * elf32-arm.c (readonly_dynrelocs): New function.
198 (maybe_set_textrel): New function, replacing..
199 (elf32_arm_readonly_dynrelocs): ..this.
200 * elf32-lm32.c (readonly_dynrelocs): New function.
201 (maybe_set_textrel): New function, replacing old version of..
202 (readonly_dynrelocs): ..this.
203 * elf32-m32r.c (readonly_dynrelocs): New function.
204 (maybe_set_textrel): New function, replacing old version of..
205 (readonly_dynrelocs): ..this.
206 * elf32-metag.c (readonly_dynrelocs): New function.
207 (maybe_set_textrel): New function, replacing old version of..
208 (readonly_dynrelocs): ..this.
209 * elf32-nds32.c: Delete unnecessary forward declarations.
210 (readonly_dynrelocs): New function.
211 (maybe_set_textrel): New function, replacing old version of..
212 (readonly_dynrelocs): ..this.
213 * elf32-or1k.c (readonly_dynrelocs): New function.
214 (maybe_set_textrel): New function, replacing old version of..
215 (readonly_dynrelocs): ..this.
216 * elf32-s390.c (readonly_dynrelocs): New function.
217 (maybe_set_textrel): New function, replacing old version of..
218 (readonly_dynrelocs): ..this.
219 * elf32-sh.c (readonly_dynrelocs): New function.
220 (maybe_set_textrel): New function, replacing old version of..
221 (readonly_dynrelocs): ..this.
222 * elf32-tic6x.c (readonly_dynrelocs): New function.
223 (maybe_set_textrel): New function, replacing..
224 (elf32_tic6x_readonly_dynrelocs): ..this.
225 * elf32-tilepro.c (readonly_dynrelocs): New function.
226 (maybe_set_textrel): New function, replacing old version of..
227 (readonly_dynrelocs): ..this.
228 * elf64-s390.c (readonly_dynrelocs): New function.
229 (maybe_set_textrel): New function, replacing old version of..
230 (readonly_dynrelocs): ..this.
231 * elfnn-aarch64.c (readonly_dynrelocs): New function.
232 (maybe_set_textrel): New function, replacing..
233 (aarch64_readonly_readonly_dynrelocs): ..this.
234 * elfnn-riscv.c (readonly_dynrelocs): New function.
235 (maybe_set_textrel): New function, replacing old version of..
236 (readonly_dynrelocs): ..this.
237 * elfxx-sparc.c (readonly_dynrelocs): New function.
238 (maybe_set_textrel): New function, replacing old version of..
239 (readonly_dynrelocs): ..this.
240 * elfxx-tilegx.c (readonly_dynrelocs): New function.
241 (maybe_set_textrel): New function, replacing old version of..
242 (readonly_dynrelocs): ..this.
243
244 2017-12-01 Alan Modra <amodra@gmail.com>
245
246 PR 22533
247 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Don't do anything
248 special with non_got_ref for weak aliases.
249 (elf32_hppa_check_relocs): Tweak setting of non_got_ref.
250 (elf32_hppa_adjust_dynamic_symbol): When initialising weak aliases,
251 don't uselessly copy non_got_ref. Clear dyn_relocs instead if
252 strong symbol is allocated in dynbss. Tidy comments.
253 (elf32_hppa_relocate_section): Comment fix.
254 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't do anything
255 special with non_got_ref for weak aliases.
256 (ppc_elf_adjust_dynamic_symbol): When initialising weak aliases,
257 don't uselessly copy non_got_ref. Clear dyn_relocs instead if
258 strong symbol is allocated in dynbss. Tidy comments.
259 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't do anything
260 special with non_got_ref for weak aliases.
261 (ppc64_elf_adjust_dynamic_symbol): When initialising weak aliases,
262 don't uselessly copy non_got_ref. Clear dyn_relocs instead if
263 strong symbol is allocated in dynbss. Tidy comments.
264
265 2017-11-29 Nick Clifton <nickc@redhat.com>
266
267 PR 22509
268 * coffcode.h (coff_slurp_reloc_table): Check for a NULL symbol
269 pointer when processing relocs.
270
271 2017-11-29 Stefan Stroe <stroestefan@gmail.com>
272
273 * po/Make-in (datadir): Define as @datadir@.
274 (localedir): Define as @localedir@.
275 (gnulocaledir, gettextsrcdir): Use @datarootdir@.
276
277 2017-11-28 Nick Clifton <nickc@redhat.com>
278
279 PR 22507
280 * coffgen.c (_bfd_coff_read_string_table): Check for an excessive
281 size of the external string table.
282
283 2017-11-28 Nick Clifton <nickc@redhat.com>
284
285 PR 22506
286 * reloc.c (reloc_offset_in_range): Rename to
287 bfd_reloc_offset_in_range and export.
288 (bfd_perform_relocation): Rename function invocation.
289 (bfd_install_relocation): Likewise.
290 (bfd_final_link_relocate): Likewise.
291 * bfd-in2.h: Regenerate.
292 * coff-arm.c (coff_arm_reloc): Use bfd_reloc_offset_in_range.
293 * coff-i386.c (coff_i386_reloc): Likewise.
294 * coff-i860.c (coff_i860_reloc): Likewise.
295 * coff-m68k.c (mk68kcoff_common_addend_special_fn): Likewise.
296 * coff-m88k.c (m88k_special_reloc): Likewise.
297 * coff-mips.c (mips_reflo_reloc): Likewise.
298 * coff-x86_64.c (coff_amd64_reloc): Likewise.
299
300 2017-11-28 H.J. Lu <hongjiu.lu@intel.com>
301
302 * elf-m10300.c (mn10300_elf_check_relocs): Don't set
303 non_ir_ref_regular.
304 * elf32-arm.c (elf32_arm_check_relocs): Likewise.
305 * elf32-bfin.c (bfin_check_relocs): Likewise.
306 * elf32-cr16.c (cr16_elf_check_relocs): Likewise.
307 * elf32-cris.c (cris_elf_check_relocs): Likewise.
308 * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
309 * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
310 * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
311 * elf32-frv.c (elf32_frv_check_relocs): Likewise.
312 * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
313 * elf32-i370.c (i370_elf_check_relocs): Likewise.
314 * elf32-i386.c (elf_i386_check_relocs): Likewise.
315 * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
316 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
317 * elf32-m32c.c (m32c_elf_check_relocs): Likewise.
318 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
319 * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
320 * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
321 * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
322 * elf32-metag.c (elf_metag_check_relocs): Likewise.
323 * elf32-microblaze.c (microblaze_elf_check_relocs): Likewise.
324 * elf32-moxie.c (moxie_elf_check_relocs): Likewise.
325 * elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
326 * elf32-mt.c (mt_elf_check_relocs): Likewise.
327 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
328 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
329 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
330 * elf32-rl78.c (rl78_elf_check_relocs): Likewise.
331 * elf32-s390.c (elf_s390_check_relocs): Likewise.
332 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
333 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
334 * elf32-sh.c (sh_elf_check_relocs): Likewise.
335 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
336 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
337 * elf32-v850.c (v850_elf_check_relocs): Likewise.
338 * elf32-vax.c (elf_vax_check_relocs): Likewise.
339 * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
340 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
341 * elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise.
342 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
343 * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
344 * elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise.
345 * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
346 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
347 * elf64-s390.c (elf_s390_check_relocs): Likewise.
348 * elf64-sh64.c (sh_elf64_check_relocs): Likewise.
349 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
350 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
351 * elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise.
352 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
353 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
354 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
355 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
356
357 2017-11-28 Alan Modra <amodra@gmail.com>
358
359 PR 22471
360 * elflink.c (_bfd_elf_merge_symbol): Allow weak symbols to override
361 early passes over linker script symbols.
362 * linker.c (_bfd_generic_link_add_one_symbol): Allow symbols to
363 override early passes over linker script symbols. Clear ldscript_def
364 on symbol definitions.
365
366 2017-11-28 Alan Modra <amodra@gmail.com>
367
368 * elf64-mmix.c (bfd_elf64_bfd_copy_link_hash_symbol_type): Define.
369
370 2017-11-28 H.J. Lu <hongjiu.lu@intel.com>
371
372 PR ld/22502
373 * elflink.c (_bfd_elf_merge_symbol): Also skip definition from
374 an IR object.
375 (elf_link_add_object_symbols): If linker plugin is enabled, set
376 non_ir_ref_regular on symbols referenced in regular objects so
377 that linker plugin will get the correct symbol resolution.
378
379 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
380
381 PR ld/22263
382 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use
383 bfd_link_executable instead of bfd_link_pic for TLS.
384 (elfNN_aarch64_allocate_dynrelocs): Likewise.
385 (aarch64_can_relax_tls): Likewise.
386
387 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
388
389 PR ld/22269
390 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Use
391 UNDEFWEAK_NO_DYNAMIC_RELOC to avoid dynamic GOT relocs.
392 (elfNN_aarch64_allocate_dynrelocs): Likewise.
393
394 2017-11-24 H.J. Lu <hongjiu.lu@intel.com>
395
396 PR binutils/22444
397 * elf.c (elf_read_notes): Add an argument for note aligment.
398 (elf_parse_notes): Likewise.
399 (_bfd_elf_make_section_from_shdr): Pass section aligment to
400 elf_parse_notes.
401 (bfd_section_from_phdr): Pass segment aligment to elf_read_notes.
402 (elf_parse_notes): Add an argument for note aligment. Use
403 ELF_NOTE_DESC_OFFSET to get the offset of the note descriptor.
404 Use ELF_NOTE_NEXT_OFFSET to get the offset of the next note
405 entry.
406 (elf_read_notes): Add an argument for note aligment and pass it
407 to elf_parse_notes.
408
409 2017-11-23 Alan Modra <amodra@gmail.com>
410
411 * elf32-hppa.c (pc_dynrelocs): Define.
412 (elf32_hppa_copy_indirect_symbol): Don't copy dyn_relocs to weakdefs.
413 (alias_readonly_dynrelocs): New function.
414 (elf32_hppa_adjust_dynamic_symbol): Don't clear non_got_ref to
415 indicate dyn_relocs should be discarded, discard them here.
416 Use alias_readonly_dynrelocs.
417 (allocate_dynrelocs): Don't test or clear non_got_ref.
418 (elf32_hppa_relocate_section): Simplify test for dynamic relocs.
419 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't copy dyn_relocs
420 to weakdefs.
421 (alias_readonly_dynrelocs, pc_dynrelocs): New functions.
422 (ppc_elf_adjust_dynamic_symbol): Don't clear non_got_ref to
423 indicate dyn_relocs should be discarded, discard them here.
424 Use alias_readonly_dynrelocs.
425 (allocate_dynrelocs): Don't test or clear non_got_ref.
426 (ppc_elf_relocate_section): Simplify test for dynamic relocs.
427
428 2017-11-23 Alan Modra <amodra@gmail.com>
429
430 * elf64-ppc.c (struct ppc_link_hash_entry): Delete weakref field.
431 (ppc64_elf_copy_indirect_symbol): Don't set weakref.
432 (alias_readonly_dynrelocs): Use u.alias rather than weakref.
433 (ppc64_elf_adjust_dynamic_symbol): Don't use
434 alias_readonly_dynrelocs for function symbols.
435
436 2017-11-23 Alan Modra <amodra@gmail.com>
437
438 * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias.
439 Rename u.weakdef to u.alias and update comment.
440 (weakdef): New static inline function.
441 * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias
442 rather than u.weakdef != NULL, and use weakdef function.
443 (_bfd_elf_adjust_dynamic_symbol): Likewise.
444 (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on
445 all aliases if def has been overridden in a regular object, not
446 u.weakdef.
447 (elf_link_add_object_symbols): Delete new_weakdef flag. Test
448 is_weakalias and use weakdef. Set is_weakalias and circular
449 u.alias. Update comments.
450 (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than
451 u.weakdef != NULL and use weakdef function.
452 * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test
453 is_weakalias rather than u.weakdef != NULL and use weakdef
454 function. Assert that def is strong defined.
455 * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise.
456 * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
457 * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise.
458 (bfin_adjust_dynamic_symbol): Likewise.
459 * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
460 * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
461 * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise.
462 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
463 * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
464 * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
465 * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
466 * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
467 * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
468 * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise.
469 * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise.
470 * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise.
471 * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
472 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
473 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
474 * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise.
475 * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise.
476 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
477 * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
478 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise.
479 (tilepro_elf_adjust_dynamic_symbol): Likewise.
480 * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
481 * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise.
482 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise.
483 * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise.
484 * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise.
485 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
486 (ppc64_elf_adjust_dynamic_symbol): Likewise.
487 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
488 * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
489 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
490 * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise.
491 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise.
492 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
493 * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
494 (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
495 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
496 (tilegx_elf_adjust_dynamic_symbol): Likewise.
497 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
498
499 2017-11-21 Alan Modra <amodra@gmail.com>
500
501 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
502 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
503
504 2017-11-20 Nick Clifton <nickc@redhat.com>
505
506 PR 22450
507 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
508 objects without a GNU_PROPERTY note section when looking for a bfd
509 onto which notes can be accumulated.
510
511 2017-11-20 Alan Modra <amodra@gmail.com>
512
513 PR 22451
514 PR 22460
515 * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
516 and leave rel_hdr->sh_flags zero. Update calls.
517 (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
518 flag when !gas before adding rel/rela section to group. Set
519 output rel/rela SHF_GROUP flags.
520
521 2017-11-18 Jim Wilson <jimw@sifive.com>
522
523 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
524 and to in error message.
525
526 2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
527
528 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
529 "%F%P:", instead of "%F:", to linker callback in case of error.
530
531 2017-11-16 Nick Clifton <nickc@redhat.com>
532
533 PR 22421
534 * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
535 (elfcore_grok_openbsd_procinfo): Likewise.
536 (elfcore_grok_nto_status): Likewise.
537
538 2017-11-16 Nick Clifton <nickc@redhat.com>
539
540 * merge.c (sec_merge_emit): Always create padding buffer. Add
541 asserts to make sure that the buffer is long enough.
542
543 2017-11-15 Alan Modra <amodra@gmail.com>
544
545 * bfd.c (union _bfd_doprnt_args): Add "Bad".
546 (_bfd_doprnt): Handle more flags.
547 (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
548 (error_handler_internal): Init args type to Bad.
549
550 2017-11-14 Alan Modra <amodra@gmail.com>
551
552 PR 22431
553 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
554 non-empty dynamic section.
555 (ppc_build_one_stub): Take elf_gp from output bfd, not output
556 section owner.
557 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
558
559 2017-11-14 Alan Modra <amodra@gmail.com>
560
561 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
562 .eh_frame info.
563
564 2017-11-13 Jan Beulich <jbeulich@suse.com>
565
566 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
567 Define.
568 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
569 (coff_write_object_contents): Likewise. Issue diagnostic for too
570 large alignment.
571
572 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
573
574 PR ld/22423
575 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
576 PT_PHDR segment.
577
578 2017-11-12 Alan Modra <amodra@gmail.com>
579
580 * elflink.c (elf_link_add_object_symbols): Ignore anything but
581 defined and defweak symbols when setting up weakdefs.
582
583 2017-11-12 Alan Modra <amodra@gmail.com>
584
585 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
586 to keep dyn_relocs, clear to discard. Comment.
587 (allocate_dynrelocs): Always clear non_got_ref when clearing
588 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
589 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
590 dyn_relocs on undefined syms to handle for non-pic too.
591 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
592 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
593 to keep dyn_relocs, clear to discard. Comment.
594 (allocate_dynrelocs): Always clear non_got_ref when clearing
595 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
596 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
597 dyn_relocs on undefined syms to handle for non-pic too.
598 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
599 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
600 dyn_relocs here. Don't bother setting non_got_ref. Comment.
601 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
602 ifuncs. Move code deleting dyn_relocs on undefined symbols to
603 handle for non-pic too. Don't test non_got_ref. Do test
604 dynamic_adjusted and ELF_COMMON_DEF_P.
605
606 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
607
608 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
609 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
610 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
611
612 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
613
614 * elf32-mips.c (elf32_mips_write_core_note): New function.
615 (elf_backend_write_core_note): New macro.
616 * elf64-mips.c (elf64_mips_write_core_note): New function.
617 (elf_backend_write_core_note): New macro.
618 * elfn32-mips.c (elf32_mips_write_core_note): New function.
619 (elf_backend_write_core_note): New macro.
620
621 2017-11-07 Alan Modra <amodra@gmail.com>
622
623 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
624 statistics message.
625
626 2017-11-07 Alan Modra <amodra@gmail.com>
627
628 * sysdep.h: Formatting, comment fixes.
629 (gettext, ngettext): Redefine when ENABLE_NLS.
630 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
631 (_): Define using gettext.
632 (textdomain, bindtextdomain): Use safer "do nothing".
633 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
634 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
635
636 2017-11-05 Alan Modra <amodra@gmail.com>
637
638 PR 22397
639 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
640 after.
641
642 2017-11-05 Alan Modra <amodra@gmail.com>
643
644 PR 22397
645 * bfd.c (union _bfd_doprnt_args): New.
646 (PRINT_TYPE): Add FIELD arg. Take value from args.
647 (_bfd_doprnt): Replace ap parameter with args. Adjust all
648 PRINT_TYPE invocations and reading of format args to suit.
649 Move "%%" handling out of switch handling args. Support
650 positional parameters.
651 (_bfd_doprnt_scan): New function.
652 (error_handler_internal): Call _bfd_doprnt_scan and read args.
653
654 2017-11-04 Alan Modra <amodra@gmail.com>
655
656 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
657 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
658 (ppc_elf_relocate_section): Don't output a dynamic relocation
659 for IE GOT entries in an executable.
660 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
661 (ppc64_elf_size_dynamic_sections): Likewise.
662 (ppc64_elf_relocate_section): Likewise.
663
664 2017-11-04 Alan Modra <amodra@gmail.com>
665
666 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
667 callers. Don't bother with SEC_ALLOC test. Return section pointer.
668 Move minfo call to..
669 (maybe_set_textrel): ..here.
670 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
671 (maybe_set_textrel): Call minfo to print textrel warning to map file.
672
673 2017-11-04 Alan Modra <amodra@gmail.com>
674
675 * elf32-hppa.c (enum _tls_type): Move.
676 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
677 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
678 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
679 (got_entries_needed, got_relocs_needed): New functions.
680 (allocate_dynrelocs): Use them.
681 (elf32_hppa_size_dynamic_sections): Likewise.
682 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
683 Correct code emitting relocs on GD/IE got entries. Report an
684 error when a symbol has both normal and TLS GOT relocs.
685
686 2017-11-04 Alan Modra <amodra@gmail.com>
687
688 PR 22394
689 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
690 for plabels when non-pic.
691 (maybe_set_textrel): New function.
692 (readonly_dynrelocs): Move and rewrite.
693 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
694 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
695 for functions. Expand non_got_ref comments.
696 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
697
698 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
699
700 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
701 Don't use func_pointer_refcount. Don't set plt.refcount nor
702 non_got_ref for function pointer reference.
703 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
704 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
705 func_pointer_refcount.
706 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
707 func_pointer_refcount.
708 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
709 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
710 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
711
712 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
713 Nick Clifton <nickc@redhat.com>
714
715 PR 22385
716 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
717 overlarge raw syment count.
718 (coff_get_normalized_symtab): Likewise.
719
720 2017-11-01 James Bowman <james.bowman@ftdichip.com>
721
722 * archures.c: Add bfd_mach_ft32b.
723 * cpu-ft32.c: Add arch_info_struct.
724 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
725 DIFF32.
726 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
727 DIFF32.
728 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
729 (elf32_ft32_adjust_diff_reloc_value)
730 (elf32_ft32_adjust_reloc_if_spans_insn)
731 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
732 (ft32_elf_relax_section): New function.
733 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
734 * bfd-in2.h: Regenerate.
735 * libbfd.h: Regenerate.
736
737 2017-11-01 Nick Clifton <nickc@redhat.com>
738
739 PR 22376
740 * coffcode.h (coff_slurp_line_table): Check for an excessively
741 large line number count.
742
743 2017-11-01 Nick Clifton <nickc@redhat.com>
744
745 PR 22373
746 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
747 and offset in light of further possible bogus values.
748
749 2017-11-01 Alan Modra <amodra@gmail.com>
750
751 PR 22374
752 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
753 entry when just a dynamic reloc can serve. Ensure no dynamic
754 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
755 Expand and move the non_got_ref comment.
756 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
757
758 2017-11-01 Nick Clifton <nickc@redhat.com>
759
760 PR 22369
761 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
762 file.
763 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
764 members of an archive.
765
766 2017-10-31 Nick Clifton <nickc@redhat.com>
767
768 PR 22373
769 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
770 offset values.
771
772 2017-10-30 Alan Modra <amodra@gmail.com>
773
774 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
775 elf target.
776
777 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
778 relocs_compatible.
779 (bfd_elf_gc_sections): Likewise.
780
781 2017-10-30 Alan Modra <amodra@gmail.com>
782
783 PR 22269
784 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
785 ensure non_got_ref is not set due to debug references.
786 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
787 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
788 need for a plt entry.
789 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
790 dynamic relocs when pic. Remove bogus code attempting to handle
791 commons.
792 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
793 and simplify.
794 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
795 and SYMBOL_REFERENCES_LOCAL in GOT handling.
796
797 2017-10-28 Alan Modra <amodra@gmail.com>
798
799 PR 22300
800 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
801 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
802 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
803 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
804
805 2017-10-25 Alan Modra <amodra@gmail.com>
806
807 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
808 optionally prefixed with "_".
809 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
810
811 2017-10-24 Andrew Waterman <andrew@sifive.com>
812
813 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
814 when rd is x0.
815
816 2017-10-24 Renlin Li <renlin.li@arm.com>
817
818 PR ld/21703
819 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
820
821 2017-10-23 Nick Clifton <nickc@redhat.com>
822
823 PR 22319
824 * elflink.c (elf_link_output_extsym): Keep global undefined
825 symbols if they have been marked as needed.
826
827 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
828
829 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
830 function.
831 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
832 `_bfd_mips_elf_mkobject'.
833
834 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
835
836 PR gas/22304
837 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
838
839 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
840
841 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
842 (riscv_pcgp_lo_reloc): Likewise.
843 (riscv_pcgp_relocs): Likewise.
844 (riscv_init_pcgp_relocs): New function.
845 (riscv_free_pcgp_relocs): Likewise.
846 (riscv_record_pcgp_hi_reloc): Likewise.
847 (riscv_record_pcgp_lo_reloc): Likewise.
848 (riscv_delete_pcgp_hi_reloc): Likewise.
849 (riscv_use_pcgp_hi_reloc): Likewise.
850 (riscv_record_pcgp_lo_reloc): Likewise.
851 (riscv_find_pcgp_lo_reloc): Likewise.
852 (riscv_delete_pcgp_lo_reloc): Likewise.
853 (_bfd_riscv_relax_pc): Likewise.
854 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
855 via the new functions above.
856
857 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
858
859 * elfnn-riscv.c (R_RISCV_DELETE): New define.
860 (_bfd_riscv_relax_delete): New function.
861 (perform_relocation): Handle R_RISCV_DELETE.
862 (_bfd_riscv_relax_section): Likewise.
863
864 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
865
866 PR ld/22263
867 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
868 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
869 bfd_link_executable for TLS check.
870 (tilegx_elf_check_relocs): Likewise.
871 (allocate_dynrelocs): Likewise.
872 (tilegx_elf_relocate_section): Likewise.
873
874 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
875
876 PR ld/22263
877 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
878 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
879 bfd_link_executable for TLS check.
880 (tilepro_elf_check_relocs): Likewise.
881 (allocate_dynrelocs): Likewise.
882 (tilepro_elf_relocate_section): Likewise.
883
884 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
885
886 PR ld/22263
887 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
888 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
889 bfd_link_executable for TLS check.
890 (_bfd_sparc_elf_check_relocs): Likewise.
891 (allocate_dynrelocs): Likewise.
892 (_bfd_sparc_elf_relocate_section): Likewise.
893
894 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
895
896 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
897 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
898 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
899
900 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
901
902 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
903 indirect and warning symbols.
904
905 2017-10-17 Alan Modra <amodra@gmail.com>
906
907 PR 22307
908 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
909 against size left rather than comparing pointers. Reorganise loop.
910
911 2017-10-17 Alan Modra <amodra@gmail.com>
912
913 PR 22306
914 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
915 and error for any other size that doesn't cover the header word.
916
917 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
918
919 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
920 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
921 (elf_backend_gc_sweep_hook): Likewise.
922 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
923 (bfinfdpic_gc_sweep_hook): Likewise.
924 (elf_backend_gc_sweep_hook): Likewise.
925 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
926 (elf_backend_gc_sweep_hook): Likewise.
927 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
928 (elf_backend_gc_sweep_hook): Likewise.
929 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
930 (elf_backend_gc_sweep_hook): Likewise.
931 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
932 (elf_backend_gc_sweep_hook): Likewise.
933 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
934 (elf_backend_gc_sweep_hook): Likewise.
935 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
936 from comments.
937 (elf_m68k_remove_got_entry_type): Removed.
938 (elf_m68k_find_got_entry_ptr): Likewise.
939 (elf_m68k_remove_got_entry): Likewise.
940 (elf_m68k_gc_sweep_hook): Likewise.
941 (elf_backend_gc_sweep_hook): Likewise.
942 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
943 (elf_backend_gc_sweep_hook): Likewise.
944 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
945 (elf_backend_gc_sweep_hook): Likewise.
946 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
947 (elf_backend_gc_sweep_hook): Likewise.
948 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
949 (elf_backend_gc_sweep_hook): Likewise.
950 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
951 (elf_backend_gc_sweep_hook): Likewise.
952 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
953 (elf_backend_gc_sweep_hook): Likewise.
954 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
955 (elf_backend_gc_sweep_hook): Likewise.
956 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
957 (elf_backend_gc_sweep_hook): Likewise.
958 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
959 (elf_backend_gc_sweep_hook): Likewise.
960 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
961 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
962 (elf_backend_gc_sweep_hook): Likewise.
963 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
964 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
965 (elf_backend_gc_sweep_hook): Likewise.
966 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
967 (elf_backend_gc_sweep_hook): Likewise.
968 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
969 (elf_backend_gc_sweep_hook): Likewise.
970 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
971 (elf_backend_gc_sweep_hook): Likewise.
972 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
973 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
974 (elf_backend_gc_sweep_hook): Likewise.
975 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
976 (ppc64_elf_gc_sweep_hook): Likewise.
977 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
978 (elf_backend_gc_sweep_hook): Likewise.
979 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
980 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
981 * elflink.c (elf_link_add_object_symbols): Don't call
982 _bfd_elf_link_check_relocs here.
983 (gc_sweep_hook_fn): Removed.
984 (elf_gc_sweep): Remove gc_sweep_hook.
985 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
986 (elf_backend_gc_sweep_hook): Likewise.
987 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
988 (elf_backend_gc_sweep_hook): Likewise.
989 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
990 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
991 (elf_backend_gc_sweep_hook): Likewise.
992 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
993 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
994 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
995 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
996 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
997 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
998
999 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1000
1001 * elf32-i386.c (elf_i386_backend_data): Removed.
1002 (get_elf_i386_backend_data): Likewise.
1003 (elf_i386_arch_bed): Replace elf_i386_backend_data with
1004 elf_x86_backend_data.
1005 (elf_i386_get_synthetic_symtab): Likewise.
1006 (elf_i386_nacl_arch_bed): Likewise.
1007 (elf_i386_vxworks_arch_bed): Likewise.
1008 (elf_i386_relocate_section): Check target_os instead of
1009 is_vxworks.
1010 (elf_i386_finish_dynamic_symbol): Likewise.
1011 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
1012 Check target_os instead of is_vxworks.
1013 (elf_i386_link_setup_gnu_properties): Remove normal_target and
1014 is_vxworks. Initialize plt0_pad_byte.
1015 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
1016 (get_elf_x86_64_arch_data): Likewise.
1017 (get_elf_x86_64_backend_data): Likewise.
1018 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
1019 elf_x86_backend_data.
1020 (elf_x86_64_get_synthetic_symtab): Likewise.
1021 (elf_x86_64_nacl_arch_bed): Likewise.
1022 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
1023 normal_target. Initialize plt0_pad_byte.
1024 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
1025 instead of is_vxworks.
1026 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1027 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1028 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1029 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
1030 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
1031 Update normal_target. Set up plt0_pad_byte. Check target_os
1032 instead of is_vxworks.
1033 * elfxx-x86.h (elf_x86_target_os): New.
1034 (elf_x86_backend_data): Likewise.
1035 (get_elf_x86_backend_data): Likewise.
1036 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
1037 and target_os.
1038 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
1039 plt0_pad_byte.
1040
1041 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1042
1043 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
1044 _bfd_x86_elf_finish_dynamic_sections.
1045 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
1046 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
1047 function.
1048 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
1049 prototype.
1050
1051 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1052
1053 PR ld/21384
1054 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
1055 hide symbol which was forced to be dynamic.
1056
1057 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1058
1059 PR ld/22269
1060 * elf32-cris.c (cris_elf_relocate_section): Don't generate
1061 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1062 (cris_elf_check_relocs): Don't allocate dynamic relocation
1063 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1064
1065 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1066
1067 PR ld/22269
1068 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
1069 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1070 (sh_elf_relocate_section): Don't generate dynamic relocation if
1071 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1072
1073 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1074
1075 PR ld/22269
1076 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
1077 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1078 (elf_s390_relocate_section): Don't generate dynamic relocation
1079 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1080 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
1081 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1082 (elf_s390_relocate_section): Don't generate dynamic relocation
1083 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1084
1085 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1086
1087 PR ld/22269
1088 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
1089 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1090 (allocate_dynrelocs): Discard dynamic relocations if
1091 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1092
1093 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1094
1095 PR ld/22269
1096 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
1097 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
1098 true.
1099 (allocate_dynrelocs): Discard dynamic relocations if
1100 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1101
1102 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1103
1104 PR ld/22269
1105 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
1106 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1107 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
1108 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1109 (elf_m68k_relocate_section): Don't generate dynamic relocation
1110 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1111
1112 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1113
1114 PR ld/22269
1115 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
1116 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1117 (allocate_dynrelocs): Discard dynamic relocations if
1118 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1119 (elf32_hppa_relocate_section): Don't generate dynamic
1120 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1121
1122 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1123
1124 PR ld/22269
1125 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
1126 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1127 (allocate_fptr): Don't allocate function pointer if
1128 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1129 (allocate_dynrel_entries): Don't allocate dynamic relocation
1130 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1131 (set_got_entry): Don't set GOT entry if
1132 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1133 (set_pltoff_entry): Don't set PLTOFF entry if
1134 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1135 (elfNN_ia64_relocate_section): Don't install dynamic relocation
1136 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1137
1138 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1139
1140 PR ld/22269
1141 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
1142 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1143 (allocate_dynrelocs): Don't allocate dynamic relocations if
1144 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1145
1146 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1147
1148 PR ld/22269
1149 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
1150 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1151 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
1152 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1153
1154 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1155
1156 PR ld/22269
1157 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
1158 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1159 (tilepro_elf_relocate_section): Don't generate dynamic
1160 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1161 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
1162 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1163 (tilegx_elf_relocate_section): Don't generate dynamic
1164 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1165
1166 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1167
1168 PR ld/22269
1169 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
1170 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
1171 true.
1172 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
1173 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
1174
1175 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
1176
1177 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
1178 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
1179 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
1180
1181 2017-10-12 James Bowman <james.bowman@ftdichip.com>
1182
1183 * bfd-in2.h: Regenerate.
1184 * libbfd.h: Regenerate.
1185 * elf32-ft32.c: Add HOWTO R_FT32_15.
1186 * reloc.c: Add BFD_RELOC_FT32_15.
1187
1188 2017-10-12 Nick Clifton <nickc@redhat.com>
1189
1190 * reloc.c (enum bfd_reloc_status): Start values at 2.
1191 * bfd-in2.h: Regenerate.
1192 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
1193 that a TRUE return indicates success. Compare the result of
1194 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
1195 (build_one_stub): Change sense of tests against aarch64_relocate
1196 return value.
1197 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
1198 than FALSE, when an error is detected.
1199 (elfNN_aarch64_final_link_relocate): Likewise.
1200
1201 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
1202
1203 * elf32-i386.c (elf_backend_hide_symbol): New.
1204 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
1205 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
1206 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
1207
1208 2017-10-12 Alan Modra <amodra@gmail.com>
1209
1210 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
1211 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
1212 (bfd_elf_define_start_stop): Likewise.
1213
1214 2017-10-12 Alan Modra <amodra@gmail.com>
1215
1216 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
1217 when executable rather than non-PIC.
1218 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
1219 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
1220
1221 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1222
1223 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
1224 member.
1225 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
1226 (elf_external_linux_prpsinfo64_ugid32): ... this.
1227 (swap_linux_prpsinfo32_out): Rename to...
1228 (swap_linux_prpsinfo32_ugid32_out): ... this.
1229 (elf_external_linux_prpsinfo64_ugid16): New structure.
1230 (swap_linux_prpsinfo64_ugid16_out): New function.
1231 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
1232 (elf_backend_linux_prpsinfo64_ugid16): Define.
1233 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
1234 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
1235 of the 64-bit Linux core PRPSINFO note.
1236 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
1237
1238 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1239
1240 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
1241 member.
1242 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
1243 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
1244 (elf_external_ppc_linux_prpsinfo32)
1245 (swap_ppc_linux_prpsinfo32_out): Move to...
1246 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
1247 (swap_linux_prpsinfo32_ugid32_out): ... these.
1248 (elf_external_linux_prpsinfo32): Rename to...
1249 (elf_external_linux_prpsinfo32_ugid16): ... this.
1250 (swap_linux_prpsinfo32_out): Rename to...
1251 (swap_linux_prpsinfo32_ugid16_out): ... this.
1252 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
1253 (elf_backend_linux_prpsinfo32_ugid16): Define.
1254 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
1255 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
1256 of the 32-bit Linux core PRPSINFO note.
1257 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1258 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1259 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1260 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1261 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1262 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1263 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1264 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1265 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1266 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
1267
1268 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
1269
1270 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
1271 `gap' member ahead of `pr_flag'.
1272
1273 2017-10-11 Pedro Alves <palves@redhat.com>
1274
1275 * bfd.c (_doprnt): Rename to ...
1276 (_bfd_doprnt): ... this.
1277 (error_handler_internal): Adjust.
1278
1279 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
1280
1281 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
1282 instead of incrementing it.
1283 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1284
1285 2017-10-10 Renlin Li <renlin.li@arm.com>
1286
1287 PR ld/21402
1288 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
1289 symbols into dynamic.
1290
1291 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1292
1293 PR ld/22274
1294 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
1295 (riscv_elf_link_hash_table_create): Initialize max_alignment to
1296 (bfd_vma) -1.
1297 (_bfd_riscv_relax_section): Cache the max alignment of output
1298 sections if possible.
1299
1300 2017-10-10 Alan Modra <amodra@gmail.com>
1301
1302 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
1303 .opd whenever .opd is present and non-zero size. Move code
1304 setting abiversion to/from output file earlier. Only set
1305 u.opd.func_sec when --gc-sections. Read relocs and set up
1306 u.opd.func_sec values here..
1307 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
1308 section tests.
1309 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
1310
1311 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1312
1313 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
1314 isymbuf.
1315
1316 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
1317
1318 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
1319 .interp section with "ld --no-dynamic-linker".
1320
1321 2017-10-09 Alan Modra <amodra@gmail.com>
1322
1323 PR 22212
1324 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
1325 funcinfo_hash_table and varinfo_hash_table.
1326
1327 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1328
1329 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
1330 in read-only section with minfo.
1331 (sh_elf_size_dynamic_sections): Likewise.
1332
1333 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1334
1335 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
1336 a strayed comment.
1337
1338 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1339
1340 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
1341 this_hdr.sh_entsize only if section size > 0.
1342
1343 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
1344
1345 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
1346
1347 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
1348
1349 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
1350 in read-only section with minfo.
1351 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1352
1353 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1354
1355 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
1356 comments.
1357
1358 2017-10-06 John Baldwin <jhb@FreeBSD.org>
1359
1360 * elf-bfd.h (struct elf_backend_data): Add
1361 `elf_backend_grok_freebsd_prstatus'.
1362 * elf.c (elfcore_grok_freebsd_note): Call
1363 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
1364 present.
1365 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
1366 function.
1367 (elf_backend_grok_freebsd_prstatus): Define.
1368 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
1369 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
1370
1371 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1372
1373 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
1374 and has_non_got_reloc with zero_undefweak.
1375 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1376 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
1377 zero_undefweak to 1.
1378 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
1379 has_non_got_reloc with zero_undefweak.
1380 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
1381 has_got_reloc and has_non_got_reloc with zero_undefweak.
1382 (elf_x86_link_hash_entry): Likewise.
1383
1384 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1385
1386 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
1387 (VERIFY_COPY_RELOC): Likewise.
1388
1389 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1390
1391 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
1392 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1393 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1394
1395 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1396
1397 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
1398 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1399 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1400
1401 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1402
1403 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
1404 * elf32-i386.c (elf_i386_relocate_section): Use it.
1405 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1406
1407 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1408
1409 * elf32-i386.c (X86_SIZE_TYPE_P): New.
1410 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1411 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
1412 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1413 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
1414
1415 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1416
1417 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
1418 (PLT_LOCAL_IFUNC_P): Likewise.
1419 * elf32-i386.c (elf_i386_relocate_section): Use them.
1420 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1421
1422 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1423
1424 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
1425 * elf32-i386.c (elf_i386_relocate_section): Use it.
1426 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1427
1428 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1429
1430 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
1431 * elf32-i386.c (elf_i386_relocate_section): Use it.
1432 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1433
1434 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1435
1436 * elf32-i386.c (X86_PCREL_TYPE_P): New.
1437 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1438 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
1439 (X86_PCREL_TYPE_P): This.
1440 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1441 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
1442 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
1443 X86_PCREL_TYPE_P.
1444 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
1445
1446 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1447
1448 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
1449 * elf32-i386.c (elf_i386_tls_transition): Use it.
1450 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1451
1452 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1453
1454 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
1455 Dump dynamic relocation in read-only section with minfo if
1456 needed.
1457 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
1458 (maybe_set_textrel): Likewise.
1459 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
1460 read-only section with minfo.
1461
1462 2017-10-05 John Baldwin <jhb@FreeBSD.org>
1463
1464 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
1465
1466 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1467
1468 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
1469 in read-only section with minfo.
1470 (tilepro_elf_size_dynamic_sections): Likewise.
1471 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
1472 (tilegx_elf_size_dynamic_sections): Likewise.
1473
1474 2017-10-05 Pedro Alves <palves@redhat.com>
1475
1476 PR 22245
1477 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
1478 ellipsis parameter. Split out bfd_error_on_input code to..
1479 (bfd_set_input_error): .. New function.
1480 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
1481 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
1482 * bfd-in2.h: Regenerate.
1483
1484 2017-10-05 Alan Modra <amodra@gmail.com>
1485
1486 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
1487 fini_array error value.
1488
1489 2017-10-05 Alan Modra <amodra@gmail.com>
1490
1491 PR 21167
1492 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
1493 groups.
1494 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
1495 flag from section.
1496 (elf_fake_sections): Adjust calls. Exit immediately on failure.
1497 (bfd_elf_set_group_contents): Add associated reloc section indices
1498 to group contents.
1499
1500 2017-10-04 Alan Modra <amodra@gmail.com>
1501
1502 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1503 classify symbols for ELFv2.
1504
1505 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1506
1507 PR 22245
1508 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1509 undergoes default promotion.
1510 * bfd-in2.h: Regenerate.
1511
1512 2017-10-02 Alan Modra <amodra@gmail.com>
1513
1514 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1515 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1516
1517 2017-10-01 Alan Modra <amodra@gmail.com>
1518
1519 PR 21957
1520 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1521 (add_line_info): Always put end_sequence last.
1522
1523 2017-10-01 Alan Modra <amodra@gmail.com>
1524
1525 PR 22047
1526 * dwarf2.c (read_section): Allocate buffer with extra byte for
1527 bfd_simple_get_relocated_section_contents rather than copying
1528 afterwards.
1529
1530 2017-09-29 Alan Modra <amodra@gmail.com>
1531
1532 * merge.c (merge_strings): Return FALSE on malloc failure.
1533 (_bfd_merge_sections): Return failures from record_section and
1534 merge_strings.
1535
1536 2017-09-28 Alan Modra <amodra@gmail.com>
1537
1538 PR 22220
1539 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1540 a case where plugin_notice isn't called.
1541
1542 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1543
1544 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1545 comparison.
1546
1547 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1548
1549 PR ld/22199
1550 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1551 output_bfd to info->callbacks->minfo.
1552
1553 2017-09-26 Nick Clifton <nickc@redhat.com>
1554
1555 PR 22172
1556 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
1557 assertion failure if elf_x86_64_rtype_to_howto has already issued
1558 an error message.
1559
1560 2017-09-26 Alan Modra <amodra@gmail.com>
1561
1562 PR 22210
1563 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1564 read data.
1565
1566 2017-09-26 Nick Clifton <nickc@redhat.com>
1567
1568 PR 22210
1569 * dwarf2.c (read_formatted_entries): Fail early if we know that
1570 the loop parsing data entries will overflow the end of the
1571 section.
1572
1573 2017-09-26 Alan Modra <amodra@gmail.com>
1574
1575 PR 22209
1576 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1577 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1578 to stash->info_ptr_memory, and check die_ref is within that memory.
1579 Set info_ptr_end correctly when another CU is refd. Check die_ref
1580 for DW_FORM_ref4 etc. is within CU.
1581
1582 2017-09-26 Alan Modra <amodra@gmail.com>
1583
1584 PR 22205
1585 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1586 (read_formatted_entries): Init "fe".
1587 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1588
1589 2017-09-26 Alan Modra <amodra@gmail.com>
1590
1591 PR 22204
1592 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1593 bounds in inner loop.
1594
1595 2017-09-25 Alan Modra <amodra@gmail.com>
1596
1597 PR 22202
1598 * dwarf1.c (parse_die): Sanity check pointer against section limit
1599 before dereferencing.
1600 (parse_line_table): Likewise.
1601
1602 2017-09-25 Alan Modra <amodra@gmail.com>
1603
1604 PR 22201
1605 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1606 has string form.
1607 (parse_comp_unit): Likewise.
1608
1609 2017-09-25 Alan Modra <amodra@gmail.com>
1610
1611 PR 22200
1612 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1613
1614 2017-09-24 Alan Modra <amodra@gmail.com>
1615
1616 PR 22197
1617 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1618 within section bounds.
1619
1620 2017-09-24 Alan Modra <amodra@gmail.com>
1621
1622 PR 22191
1623 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1624
1625 2017-09-24 Alan Modra <amodra@gmail.com>
1626
1627 PR 22187
1628 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1629 pname param. Return status. Make name const. Don't abort,
1630 return an error. Formatting. Exit if current info_ptr matches
1631 orig_info_ptr. Update callers.
1632 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1633 nested_funcs an array of structs for extensibility. Formatting.
1634
1635 2017-09-24 Alan Modra <amodra@gmail.com>
1636
1637 PR 22186
1638 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1639 rather than dividing by zero.
1640
1641 2017-09-24 Alan Modra <amodra@gmail.com>
1642
1643 PR 22169
1644 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1645
1646 2017-09-24 Alan Modra <amodra@gmail.com>
1647
1648 PR 22167
1649 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1650
1651 2017-09-24 Alan Modra <amodra@gmail.com>
1652
1653 PR 22166
1654 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1655 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1656 verref.
1657
1658 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1659
1660 PR binutils/22170
1661 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1662 corrupted PLT.
1663
1664 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1665
1666 PR binutils/22163
1667 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1668 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1669
1670 2017-09-22 Pedro Alves <palves@redhat.com>
1671 Alan Modra <amodra@gmail.com>
1672
1673 * version.h: Add comment.
1674
1675 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1676
1677 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1678 NT_S390_GS_BC, correct the previously swapped invocations of
1679 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1680
1681 2017-09-19 Alan Modra <amodra@gmail.com>
1682
1683 PR 21441
1684 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1685 size.
1686
1687 2017-09-19 Alan Modra <amodra@gmail.com>
1688
1689 PR 22150
1690 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1691 symbols before calculating verrefs. Don't renumber dynsyms
1692 after gc. Exclude .gnu.version when zero or one dynsym.
1693 Localize some vars and reindent.
1694
1695 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1696
1697 PR ld/22148
1698 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1699 return from bfd_canonicalize_dynamic_reloc.
1700
1701 2017-09-15 Alan Modra <amodra@gmail.com>
1702
1703 PR 22116
1704 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1705 overflows bfd_size_type.
1706
1707 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1708
1709 PR ld/22135
1710 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1711 to indicate if conversion is performed.
1712 (elf_i386_check_relocs): Cache section contents and relocations
1713 if conversion is performed.
1714 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1715 contents and relocations if conversion is performed.
1716
1717 2017-09-14 Nick Clifton <nickc@redhat.com>
1718
1719 PR binutils/22113
1720 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1721 entries.
1722
1723 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1724
1725 * elfxx-x86.h: Fix a typo in comments.
1726
1727 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1728
1729 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1730
1731 2017-09-09 Alan Modra <amodra@gmail.com>
1732
1733 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1734 plt_stub_align.
1735
1736 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1737
1738 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1739 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1740 (elf_i386_finish_dynamic_symbol): Likewise.
1741 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1742 (elf_x86_64_finish_dynamic_symbol): Likewise.
1743 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1744 (_bfd_x86_elf_fixup_symbol): Likewise.
1745
1746 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1747
1748 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1749 check has_non_got_reloc.
1750
1751 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1752
1753 PR ld/22115
1754 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1755 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1756 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1757 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1758 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1759 and linker_def on __ehdr_start if it is referenced and not
1760 defined.
1761 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1762 and return TRUE when building executable, if a symbol has
1763 non-GOT/non-PLT relocations in text section or there is no
1764 dynamic linker.
1765 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1766
1767 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1768
1769 * elfxx-x86.h: Update comments.
1770
1771 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1772
1773 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1774 elf_x86_plt_layout_table with elf_x86_init_table.
1775 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1776 Likewise.
1777 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1778 Likewise.
1779 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1780 (elf_x86_init_table): This.
1781 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1782 elf_x86_plt_layout_table with elf_x86_init_table.
1783
1784 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1785
1786 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1787 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1788 * configure: Regenerated.
1789 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1790 and r_sym fields of plt_layout.
1791 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1792 Likewise.
1793 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1794 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1795 r_info nor r_sym fields.
1796 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1797 fields of htab.
1798 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1799
1800 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1801
1802 * (_bfd_riscv_relax_align): Call bfd_set_error and
1803 print an error message when unable to relax a .align directive.
1804
1805 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1806
1807 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1808 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1809 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1810 R_RISCV_PCREL_HI20 relocs, and pass the result to
1811 riscv_record_pcrel_hi_reloc.
1812
1813 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1814
1815 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1816 r_type_p. Remove the converted argument. Replace
1817 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1818 the new relocation type via r_type_p.
1819 (elf_i386_relocate_section): Likewise.
1820 (elf_i386_finish_dynamic_symbol): Likewise.
1821 (need_convert_load): Removed.
1822 (check_relocs_failed): Updated.
1823 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1824 instead of setting need_convert_load.
1825 (_bfd_i386_elf_convert_load): Removed.
1826 * elf64-x86-64.c (need_convert_load): Removed.
1827 (check_relocs_failed): Updated.
1828 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1829 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1830 Return the new relocation type via r_type_p.
1831 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1832 instead of setting need_convert_load.
1833 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1834 been converted.
1835 (_bfd_x86_64_elf_convert_load): Removed.
1836 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1837 with SYMBOL_REFERENCES_LOCAL_P.
1838 (elf_x86_64_finish_dynamic_symbol): Likewise.
1839 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1840 set convert_load.
1841 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1842 (_bfd_x86_elf_link_symbol_references_local): New function.
1843 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1844 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1845 SYMBOL_REFERENCES_LOCAL_P.
1846 (elf_x86_link_hash_entry): Add local_ref.
1847 (elf_x86_link_hash_table): Remove convert_load.
1848 (_bfd_i386_elf_convert_load): Removed.
1849 (_bfd_x86_64_elf_convert_load): Likewise.
1850 (_bfd_x86_elf_link_symbol_references_local): New.
1851
1852 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1853
1854 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1855 (elf_x86_64_info_to_howto): Get the real relocation type by
1856 masking out R_X86_64_converted_reloc_bit.
1857 (elf_x86_64_check_tls_transition): Get the real relocation type
1858 by masking out R_X86_64_converted_reloc_bit.
1859 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1860 instead of setting converted_reloc.
1861 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1862 instead of converted_reloc. Get the real relocation type by
1863 masking out R_X86_64_converted_reloc_bit.
1864 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1865 R_X86_64_converted_reloc_bit is valid.
1866 * elfxx-x86.h (converted_reloc): Removed.
1867
1868 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1869
1870 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1871 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1872 to get the relocation type again.
1873 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1874 r_type when calling elf_x86_64_tls_transition. Don't use
1875 ELF32_R_TYPE to get the relocation type again.
1876
1877 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1878
1879 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1880 converted_reloc.
1881
1882 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1883
1884 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1885 argument. Don't check relocation overflow. Avoid relocation
1886 overflow if --no-relax is used. Set converted_reloc on symbol
1887 if a GOTPCREL relocation is converted.
1888 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1889 --no-relax if GOTPCREL relocation conversion leads to relocation
1890 overflow.
1891 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1892
1893 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1894 Edmar Wienskoski <edmar.wienskoski@nxp.com
1895
1896 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1897 (ppc_elf_check_relocs): Handle it.
1898 (ppc_elf_vle_split20): New function.
1899 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1900
1901 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1902
1903 PR ld/22071
1904 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1905 for x86-64 if GOT_TLS_GDESC_P is true.
1906
1907 2017-09-03 Alan Modra <amodra@gmail.com>
1908
1909 PR 22067
1910 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1911
1912 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1913
1914 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1915 tls_get_addr for x86-64 in one place.
1916
1917 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1918
1919 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1920 with elfxx-x86.lo for 64-bit BFD.
1921 * configure: Regenerated.
1922
1923 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1924
1925 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1926 (_bfd_i386_elf_convert_load): This. Remove static.
1927 (elf_i386_size_dynamic_sections): Removed.
1928 (elf_backend_size_dynamic_sections): Likewise.
1929 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1930 (_bfd_x86_64_elf_convert_load): This. Remove static.
1931 (elf_x86_64_size_dynamic_sections): Removed.
1932 (elf_backend_size_dynamic_sections): Likewise.
1933 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1934 (elf_x86_allocate_dynrelocs): This. Make it static.
1935 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1936 (elf_x86_allocate_local_dynreloc): This. Make it static.
1937 (elf_i386_is_reloc_section): New function.
1938 (elf_x86_64_is_reloc_section): Likewise.
1939 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1940 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1941 Rearrange got_entry_size initialization.
1942 (_bfd_x86_elf_size_dynamic_sections): New function.
1943 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1944 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1945 (_bfd_i386_elf_convert_load): New.
1946 (_bfd_x86_64_elf_convert_load): Likewise.
1947 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1948 (elf_backend_size_dynamic_sections): Likewise.
1949 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1950 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1951
1952 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1953
1954 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1955 update comments.
1956
1957 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1958
1959 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1960 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1961
1962 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1963
1964 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1965 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1966 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1967 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1968 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1969 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1970
1971 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1972
1973 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1974 (elf_i386_allocate_local_dynrelocs): Likewise.
1975 (elf_i386_size_dynamic_sections): Replace
1976 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1977 with _bfd_x86_elf_allocate_dynrelocs and
1978 _bfd_x86_elf_allocate_local_dynrelocs.
1979 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1980 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1981 (elf_x86_64_size_dynamic_sections): Replace
1982 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1983 with _bfd_x86_elf_allocate_dynrelocs and
1984 _bfd_x86_elf_allocate_local_dynrelocs.
1985 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1986 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1987 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1988 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1989
1990 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1991
1992 * elf32-i386.c (is_i386_elf): Removed.
1993 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1994 (elf_i386_size_dynamic_sections): Likewise.
1995 (elf_i386_relocate_section): Likewise.
1996 * elf64-x86-64.c (is_x86_64_elf): Removed.
1997 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1998 is_x86_elf.
1999 (elf_x86_64_size_dynamic_sections): Likewise.
2000 (elf_x86_64_relocate_section): Likewise.
2001 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
2002 target_id.
2003 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
2004 (is_x86_elf): New.
2005
2006 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
2007
2008 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
2009 (elf_i386_allocate_dynrelocs): Replace
2010 elf_i386_compute_jump_table_size with
2011 elf_x86_compute_jump_table_size.
2012 (elf_i386_size_dynamic_sections): Likewise.
2013 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
2014 (elf_x86_64_allocate_dynrelocs): Replace
2015 elf_x86_64_compute_jump_table_size with
2016 elf_x86_compute_jump_table_size.
2017 (elf_x86_64_size_dynamic_sections): Likewise.
2018 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
2019 got_entry_size.
2020 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
2021 (elf_x86_compute_jump_table_size): New.
2022
2023 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
2024
2025 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
2026 sizeof_reloc.
2027 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
2028 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
2029
2030 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
2031
2032 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
2033 with htab->is_vxworks.
2034 (elf_i386_size_dynamic_sections): Likewise.
2035 (elf_i386_relocate_section): Likewise.
2036 (elf_i386_finish_dynamic_symbol): Likewise.
2037 (elf_i386_finish_dynamic_sections): Likewise.
2038
2039 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
2040
2041 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
2042 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
2043 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
2044 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
2045 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
2046 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
2047 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
2048 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
2049
2050 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
2051
2052 PR ld/22064
2053 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
2054 ELF_COMMON_DEF_P for common symbols.
2055
2056 2017-09-02 Alan Modra <amodra@gmail.com>
2057
2058 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
2059 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
2060 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2061
2062 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
2063
2064 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
2065 (elf_backend_gc_mark_hook): Likewise.
2066 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
2067 (elf_backend_gc_mark_hook): Likewise.
2068 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
2069 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
2070 (elf_backend_gc_mark_hook): Likewise.
2071
2072 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
2073
2074 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
2075 (elf_backend_adjust_dynamic_symbol): Likewise.
2076 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
2077 (elf_backend_adjust_dynamic_symbol): Likewise.
2078 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
2079 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
2080 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
2081 (_bfd_x86_elf_adjust_dynamic_symbol): New.
2082 (elf_backend_adjust_dynamic_symbol): Likewise.
2083
2084 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
2085
2086 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
2087 comments.
2088
2089 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
2090
2091 * elf32-i386.c (elf_i386_mkobject): Removed.
2092 (bfd_elf32_mkobject): Likewise.
2093 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
2094 (bfd_elf64_mkobject): Likewise.
2095 (bfd_elf32_mkobject): Likewise.
2096 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
2097 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
2098 (bfd_elf64_mkobject): Likewise.
2099 (bfd_elf32_mkobject): Likewise.
2100
2101 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
2102
2103 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
2104 Call _bfd_x86_elf_link_setup_gnu_properties.
2105 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
2106 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
2107 entries.
2108 (elf_x86_64_non_lazy_plt): Likewise.
2109 (elf_x86_64_lazy_bnd_plt): Likewise.
2110 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2111 (elf_x86_64_lazy_ibt_plt): Likewise.
2112 (elf_x32_lazy_ibt_plt): Likewise.
2113 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2114 (elf_x32_non_lazy_ibt_plt): Likewise.
2115 (elf_x86_64_nacl_plt): Likewise.
2116 (elf_x86_64_link_setup_gnu_properties): Updated. Call
2117 _bfd_x86_elf_link_setup_gnu_properties.
2118 * elfxx-x86.c: Include elf-vxworks.h".
2119 (_bfd_x86_elf_link_setup_gnu_properties): New function.
2120 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
2121 comments for pic_plt0_entry and pic_plt_entry.
2122 (elf_x86_non_lazy_plt_layout): Likewise.
2123 (elf_x86_plt_layout_table): New.
2124 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
2125
2126 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
2127
2128 PR ld/22061
2129 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
2130 .eh_frame section for the second PLT.
2131 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
2132 alignment of .eh_frame section for the second PLT.
2133
2134 2017-09-01 Nick Clifton <nickc@redhat.com>
2135
2136 PR 22059
2137 * dwarf2.c (decode_line_info): Fix test for an overlong line info
2138 structure.
2139
2140 2017-09-01 Nick Clifton <nickc@redhat.com>
2141
2142 PR 22058
2143 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
2144 attribute buffer is NUL terminated.
2145
2146 2017-08-31 Nick Clifton <nickc@redhat.com>
2147
2148 PR 22047
2149 * dwarf2.c (read_section): If necessary add a terminating NUL byte
2150 to dwarf string sections.
2151
2152 2017-08-31 Alan Modra <amodra@gmail.com>
2153
2154 * po/SRC-POTFILES.in: Regenerate.
2155
2156 2017-08-31 Alan Modra <amodra@gmail.com>
2157
2158 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
2159 for a section containing just a terminator. Allow multiple
2160 terminators at end of section.
2161 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
2162 sections when not adding alignment. Assert on terminator in
2163 the middle of FDEs.
2164
2165 2017-08-31 Alan Modra <amodra@gmail.com>
2166
2167 PR 21441
2168 PR 22048
2169 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
2170 terminators.
2171
2172 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2173
2174 * configure.ac (bfd_backends): Add elf64.lo together with
2175 elfxx-x86.lo for 64-bit BFD.
2176 * configure: Regenerated.
2177
2178 2017-08-31 James Bowman <james.bowman@ftdichip.com>
2179
2180 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
2181 for R_FT32_18.
2182
2183 2017-08-31 Alan Modra <amodra@gmail.com>
2184
2185 PR binutils/22032
2186 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
2187 before _close_and_cleanup. Call iovec->bclose after.
2188 (bfd_close): Remove code common to, and call, bfd_close_all_done.
2189
2190 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2191
2192 * elf32-i386.c (elf_i386_plt_type): Removed.
2193 (elf_i386_plt): Likewise.
2194 (elf_i386_get_synthetic_symtab): Updated. Call
2195 _bfd_x86_elf_get_synthetic_symtab.
2196 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
2197 (elf_x86_64_plt): Likewise.
2198 (elf_x86_64_get_synthetic_symtab): Updated. Call
2199 _bfd_x86_elf_get_synthetic_symtab.
2200 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
2201 (elf_x86_64_get_plt_got_vma): Likewise.
2202 (elf_i386_valid_plt_reloc_p): Likewise.
2203 (elf_x86_64_valid_plt_reloc_p): Likewise.
2204 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
2205 * elfxx-x86.h (elf_x86_plt_type): New.
2206 (elf_x86_plt): Likewise.
2207 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
2208
2209 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2210
2211 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
2212 target_id instead of elf_machine_code.
2213
2214 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2215
2216 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
2217 (elf_i386_lazy_plt_layout): Likewise.
2218 (elf_i386_non_lazy_plt_layout): Likewise.
2219 (elf_i386_plt_layout): Likewise.
2220 (elf_i386_link_hash_table): Likewise.
2221 (elf_i386_next_tls_desc_index): Likewise.
2222 (elf_i386_srelplt2): Likewise.
2223 (elf_i386_plt): Likewise.
2224 (elf_i386_lazy_plt): Likewise.
2225 (elf_i386_non_lazy_plt): Likewise.
2226 (elf_i386_link_hash_table_create): Likewise.
2227 (bfd_elf32_bfd_link_hash_table_create): Likewise.
2228 (elf_i386_lazy_plt): Updated.
2229 (elf_i386_non_lazy_plt): Likewise.
2230 (elf_i386_lazy_ibt_plt): Likewise.
2231 (elf_i386_non_lazy_ibt_plt): Likewise.
2232 (elf_i386_allocate_dynrelocs): Likewise.
2233 (elf_i386_size_dynamic_sections): Likewise.
2234 (elf_i386_relocate_section): Likewise.
2235 (elf_i386_finish_dynamic_symbol): Likewise.
2236 (elf_i386_finish_dynamic_sections): Likewise.
2237 (elf_i386_get_synthetic_symtab): Likewise.
2238 (elf_i386_link_setup_gnu_properties): Likewise.
2239 (elf_i386_nacl_plt): Likewise.
2240 * elf64-x86-64.c (ABI_64_P): Removed.
2241 (ELF64_DYNAMIC_INTERPRETER): Likewise.
2242 (ELF32_DYNAMIC_INTERPRETER): Likewise.
2243 (elf_x86_64_lazy_plt_layout): Likewise.
2244 (elf_x86_64_non_lazy_plt_layout): Likewise.
2245 (elf_x86_64_plt_layout): Likewise.
2246 (elf_x86_64_link_hash_table): Likewise.
2247 (elf_x86_64_plt): Likewise.
2248 (elf_x86_64_lazy_plt): Likewise.
2249 (elf_x86_64_non_lazy_plt): Likewise.
2250 (elf_x86_64_link_hash_table_create): Likewise.
2251 (bfd_elf64_bfd_link_hash_table_create): Likewise.
2252 (bfd_elf32_bfd_link_hash_table_create): Likewise.
2253 (elf_x86_64_lazy_plt): Updated.
2254 (elf_x86_64_non_lazy_plt): Likewise.
2255 (elf_x86_64_lazy_bnd_plt): Likewise.
2256 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2257 (elf_x86_64_lazy_ibt_plt): Likewise.
2258 (elf_x32_lazy_ibt_plt): Likewise.
2259 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2260 (elf_x32_non_lazy_ibt_plt): Likewise.
2261 (elf_x86_64_allocate_dynrelocs): Likewise.
2262 (elf_x86_64_size_dynamic_sections): Likewise.
2263 (elf_x86_64_relocate_section): Likewise.
2264 (elf_x86_64_finish_dynamic_symbol): Likewise.
2265 (elf_x86_64_finish_dynamic_sections): Likewise.
2266 (elf_x86_64_get_synthetic_symtab): Likewise.
2267 (elf_x86_64_link_setup_gnu_properties): Likewise.
2268 (elf_x86_64_nacl_plt): Likewise.
2269 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
2270 "elf/x86-64.h".
2271 (ELF32_DYNAMIC_INTERPRETER): New.
2272 (ELF64_DYNAMIC_INTERPRETER): Likewise.
2273 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
2274 (_bfd_x86_elf_link_hash_table_create): Likewise.
2275 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
2276 (elf_x86_link_hash_table_free): This. Make it static.
2277 * elfxx-x86.h: Don't include "objalloc.h".
2278 (ABI_64_P): New.
2279 (elf_x86_lazy_plt_layout): Likewise.
2280 (elf_x86_non_lazy_plt_layout): Likewise.
2281 (elf_x86_plt_layout): Likewise.
2282 (_bfd_x86_elf_link_hash_table_create): Likewise.
2283 (bfd_elf64_bfd_link_hash_table_create): Likewise.
2284 (bfd_elf32_bfd_link_hash_table_create): Likewise.
2285 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
2286 srelplt2 and next_tls_desc_index.
2287 (_bfd_x86_elf_link_hash_table_free): Removed.
2288
2289 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
2290
2291 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
2292 branch offset interpretation.
2293
2294 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2295
2296 PR binutils/22032
2297 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
2298
2299 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2300
2301 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
2302 (elf_x86_64_srelplt2): Likewise.
2303
2304 2017-08-30 Alan Modra <amodra@gmail.com>
2305
2306 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
2307 (ppc64_elf_tls_optimize): Set it.
2308 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
2309 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
2310 addis would add zero.
2311 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
2312 (ppc_elf_tls_optimize): Set it.
2313 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
2314 insn on TPREL16_LO relocs to use r2 when addis would add zero.
2315
2316 2017-08-30 Alan Modra <amodra@gmail.com>
2317
2318 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
2319 __tls_get_addr call sequences to LE, don't move the addi down
2320 to the nop. Replace the bl with addi and leave the nop alone.
2321
2322 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2323
2324 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
2325 Re-indent.
2326 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
2327 Likewise.
2328 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
2329
2330 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2331
2332 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
2333 (BFD64_BACKENDS): Likewise.
2334 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
2335 (BFD64_BACKENDS_CFILES): Likewise.
2336 * Makefile.in: Regenerated.
2337 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
2338 elf32-i386.lo and elf64-x86-64.lo.
2339 * configure: Regenerated.
2340 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
2341 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
2342 "objalloc.h" and "hashtab.h".
2343 (ELIMINATE_COPY_RELOCS): Removed.
2344 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
2345 (SYMBOL_NO_COPYRELOC): Likewise.
2346 (elf_i386_link_hash_entry): Likewise.
2347 (GOT_UNKNOWN): Likewise.
2348 (GOT_NORMAL): Likewise.
2349 (GOT_TLS_GD): Likewise.
2350 (elf_i386_hash_entry): Likewise.
2351 (elf_i386_obj_tdata): Likewise.
2352 (elf_i386_tdata): Likewise.
2353 (elf_i386_local_got_tls_type): Likewise.
2354 (elf_i386_local_tlsdesc_gotent): Likewise.
2355 (elf_i386_hash_table): Likewise.
2356 (elf_i386_link_hash_newfunc): Likewise.
2357 (elf_i386_local_htab_hash): Likewise.
2358 (elf_i386_local_htab_eq): Likewise.
2359 (elf_i386_get_local_sym_hash): Likewise.
2360 (elf_i386_link_hash_table_free): Likewise.
2361 (elf_i386_copy_indirect_symbol): Likewise.
2362 (elf_i386_fixup_symbol): Likewise.
2363 (elf_i386_readonly_dynrelocs): Likewise.
2364 (elf_i386_always_size_sections): Likewise.
2365 (elf_i386_set_tls_module_base): Likewise.
2366 (elf_i386_dtpoff_base): Likewise.
2367 (compare_relocs): Likewise.
2368 (elf_i386_hash_symbol): Likewise.
2369 (elf_i386_parse_gnu_properties): Likewise.
2370 (elf_i386_merge_gnu_properties): Likewise.
2371 (elf_i386_link_check_relocs): Likewise.
2372 (elf_i386_merge_symbol_attribute): Likewise.
2373 (bfd_elf32_bfd_link_check_relocs): Likewise.
2374 (elf_backend_copy_indirect_symbol): Likewise.
2375 (elf_backend_always_size_sections): Likewise.
2376 (elf_backend_omit_section_dynsym): Likewise.
2377 (elf_backend_hash_symbol): Likewise.
2378 (elf_backend_fixup_symbol): Likewise.
2379 (elf_backend_parse_gnu_properties): Likewise.
2380 (elf_backend_merge_gnu_properties): Likewise.
2381 (elf_backend_merge_symbol_attribute): Likewise.
2382 (elf_i386_mkobject): Updated.
2383 (elf_i386_link_hash_table_create): Likewise.
2384 (elf_i386_check_tls_transition): Likewise.
2385 (elf_i386_tls_transition): Likewise.
2386 (elf_i386_convert_load_reloc): Likewise.
2387 (elf_i386_check_relocs): Likewise.
2388 (elf_i386_adjust_dynamic_symbol): Likewise.
2389 (elf_i386_allocate_dynrelocs): Likewise.
2390 (elf_i386_convert_load): Likewise.
2391 (elf_i386_size_dynamic_sections): Likewise.
2392 (elf_i386_relocate_section): Likewise.
2393 (elf_i386_finish_dynamic_symbol ): Likewise.
2394 (elf_i386_finish_dynamic_sections): Likewise.
2395 (elf_i386_output_arch_local_syms): Likewise.
2396 (elf_i386_get_synthetic_symtab): Likewise.
2397 (elf_i386_link_setup_gnu_properties): Likewise.
2398 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
2399 of elf_link_hash_table, as base.
2400 (elf_i386_next_tls_desc_index): New.
2401 (elf_i386_srelplt2): Likewise.
2402 (elf_i386_plt): Likewise.
2403 (elf_i386_lazy_plt): Likewise.
2404 (elf_i386_non_lazy_plt): Likewise.
2405 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
2406 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
2407 "objalloc.h" and "hashtab.h".
2408 (ELIMINATE_COPY_RELOCS): Removed.
2409 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
2410 (SYMBOL_NO_COPYRELOC): Likewise.
2411 (elf_x86_64_link_hash_entry): Likewise.
2412 (GOT_UNKNOWN): Likewise.
2413 (GOT_NORMAL): Likewise.
2414 (GOT_TLS_GD): Likewise.
2415 (elf_x86_64_hash_entry): Likewise.
2416 (elf_x86_64_obj_tdata): Likewise.
2417 (elf_x86_64_tdata): Likewise.
2418 (elf_x86_64_local_got_tls_type): Likewise.
2419 (elf_x86_64_local_tlsdesc_gotent): Likewise.
2420 (elf_x86_64_hash_table): Likewise.
2421 (elf_x86_64_link_hash_newfunc): Likewise.
2422 (elf_x86_64_local_htab_hash): Likewise.
2423 (elf_x86_64_local_htab_eq): Likewise.
2424 (elf_x86_64_get_local_sym_hash): Likewise.
2425 (elf_x86_64_link_hash_table_free): Likewise.
2426 (elf_x86_64_copy_indirect_symbol): Likewise.
2427 (elf_x86_64_fixup_symbol): Likewise.
2428 (elf_x86_64_readonly_dynrelocs): Likewise.
2429 (elf_x86_64_always_size_sections): Likewise.
2430 (elf_x86_64_set_tls_module_base): Likewise.
2431 (elf_x86_64_dtpoff_base): Likewise.
2432 (compare_relocs): Likewise.
2433 (elf_x86_64_merge_symbol_attribute): Likewise.
2434 (elf_x86_64_hash_symbol): Likewise.
2435 (elf_x86_64_parse_gnu_properties): Likewise.
2436 (elf_x86_64_merge_gnu_properties): Likewise.
2437 (elf_x86_64_link_check_relocs): Likewise.
2438 (elf_backend_copy_indirect_symbol): Likewise.
2439 (elf_backend_always_size_sections): Likewise.
2440 (bfd_elf64_bfd_link_check_relocs): Likewise.
2441 (elf_backend_merge_symbol_attribute): Likewise.
2442 (elf_backend_hash_symbol): Likewise.
2443 (elf_backend_omit_section_dynsym): Likewise.
2444 (elf_backend_fixup_symbol): Likewise.
2445 (elf_backend_parse_gnu_properties): Likewise.
2446 (elf_backend_merge_gnu_properties): Likewise.
2447 (bfd_elf32_bfd_link_check_relocs): Likewise.
2448 (elf_x86_64_mkobject): Updated.
2449 (elf_x86_64_link_hash_table_create): Likewise.
2450 (elf_x86_64_check_tls_transition): Likewise.
2451 (elf_x86_64_tls_transition): Likewise.
2452 (elf_x86_64_convert_load_reloc): Likewise.
2453 (elf_x86_64_check_relocs): Likewise.
2454 (elf_x86_64_adjust_dynamic_symbol): Likewise.
2455 (elf_x86_64_allocate_dynrelocs): Likewise.
2456 (elf_x86_64_convert_load): Likewise.
2457 (elf_x86_64_size_dynamic_sections): Likewise.
2458 (elf_x86_64_relocate_section): Likewise.
2459 (elf_x86_64_finish_dynamic_symbol ): Likewise.
2460 (elf_x86_64_finish_dynamic_sections): Likewise.
2461 (elf_x86_64_output_arch_local_syms): Likewise.
2462 (elf_x86_64_get_synthetic_symtab): Likewise.
2463 (elf_x86_64_link_setup_gnu_properties): Likewise.
2464 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
2465 instead of elf_link_hash_table, as base.
2466 (elf_x86_64_next_tls_desc_index): New.
2467 (elf_x86_64_srelplt2): Likewise.
2468 (elf_x86_64_plt): Likewise.
2469 (elf_x86_64_lazy_plt): Likewise.
2470 (elf_x86_64_non_lazy_plt): Likewise.
2471 * elfxx-x86.c: New file.
2472 * elfxx-x86.h: Likewise.
2473
2474 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2475
2476 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
2477 return.
2478 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2479
2480 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2481
2482 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
2483 sections before checking dynamic relocations and free invalid
2484 PLT section contents.
2485 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2486
2487 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2488
2489 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
2490 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
2491
2492 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2493
2494 PR binutils/22018
2495 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
2496 PLT section size.
2497 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2498
2499 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2500
2501 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2502 def_protected.
2503 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2504
2505 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
2506
2507 PR ld/21997
2508 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
2509 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
2510 Add a has_no_copy_on_protected bitfield.
2511 (elf_has_no_copy_on_protected): New.
2512 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
2513 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2514 (elf_merge_gnu_property_list): Likewise.
2515 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
2516 to FALSE for elf_has_no_copy_on_protected.
2517 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
2518 (elf_i386_link_hash_entry): Add def_protected.
2519 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2520 when checking info->nocopyreloc.
2521 (elf_i386_link_setup_gnu_properties): Don't set
2522 extern_protected_data here.
2523 (elf_i386_merge_symbol_attribute): New function.
2524 (elf_backend_merge_symbol_attribute): New.
2525 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
2526 (elf_x86_64_link_hash_entry): Add def_protected.
2527 (elf_x86_64_need_pic): Report protected symbol for def_protected.
2528 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2529 when checking info->nocopyreloc.
2530 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
2531 relocation run-time overflow and unresolvable R_X86_64_32S
2532 relocation against protected data symbol defined in shared object
2533 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2534 (elf_x86_64_link_setup_gnu_properties): Don't set
2535 extern_protected_data here.
2536 (elf_x86_64_merge_symbol_attribute): New function.
2537 (elf_backend_merge_symbol_attribute): New.
2538
2539 2017-08-26 Alan Modra <amodra@gmail.com>
2540
2541 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2542 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2543 (ppc_elf_relocate_section): Comment fix.
2544 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2545 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2546 Support dynamic relocs for TPREL16 when non-pic too.
2547 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
2548 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
2549 when non-pic too.
2550
2551 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
2552
2553 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
2554 "symbol" in comments.
2555 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
2556
2557 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2558
2559 PR ld/22001
2560 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
2561 R_X86_64_PC32 relocation run-time overflow and unresolvable
2562 R_X86_64_32S relocation with -z nocopyreloc.
2563
2564 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2565
2566 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
2567 Undefined symbols may not have a type.
2568 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2569
2570 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2571
2572 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2573 bfd_link_info. Report shared, PIE or PDE object based on
2574 bfd_link_info.
2575 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2576 (elf_x86_64_relocate_section): Likewise.
2577
2578 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2579
2580 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2581 for function symbols.
2582 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2583
2584 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2585
2586 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2587 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2588 is set on any input relocatable file.
2589 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2590
2591 2017-08-23 Alan Modra <amodra@gmail.com>
2592
2593 PR 21988
2594 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2595 ensure_undefweak_dynamic. Handle undefined too.
2596 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2597 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2598 (allocate_dynrelocs): Discard undefined non-default visibility
2599 relocs first. Make undefined syms dynamic. Tidy goto.
2600
2601 2017-08-21 Alan Modra <amodra@gmail.com>
2602 H.J. Lu <hongjiu.lu@intel.com>
2603
2604 PR ld/21964
2605 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2606 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2607
2608 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2609
2610 PR ld/20125
2611 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2612 undefined weak symbols.
2613
2614 2017-08-18 Nick Clifton <nickc@redhat.com>
2615
2616 PR binutils/21962
2617 * tekhex.c (getsym): Fix check for source pointer walking off the
2618 end of the input buffer.
2619
2620 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2621
2622 PR ld/18808
2623 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2624 relocations in debug sections, change abort to _bfd_error_handler.
2625
2626 2017-08-14 Nick Clifton <nickc@redhat.com>
2627
2628 PR 21957
2629 * elf.c (setup_group): Check for an empty or very small group
2630 section.
2631 * po/bfd.pot: Regenerate.
2632
2633 2017-08-14 Alan Modra <amodra@gmail.com>
2634
2635 PR 21441
2636 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2637 alignment padding here.
2638 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2639 in a reverse pass over sections.
2640
2641 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2642
2643 PR binutils/21943
2644 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2645 for @plt suffixes first.
2646 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2647
2648 2017-08-08 Nick Clifton <nickc@redhat.com>
2649
2650 PR 21916
2651 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2652 small section lengths.
2653 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2654 table.
2655 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2656 there is enough data present in the note.
2657
2658 2017-08-08 Alan Modra <amodra@gmail.com>
2659
2660 PR 21017
2661 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2662 got.refcount for GOTOFF relocs, just create .got section.
2663
2664 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2665
2666 * elflink.c (elf_link_add_object_symbols): Move common symbol
2667 check after bed->common_definition.
2668
2669 2017-08-07 Alan Modra <amodra@gmail.com>
2670
2671 PR 21910
2672 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2673 needed to define various dynamic tags have been discarded.
2674
2675 2017-08-07 Nick Clifton <nickc@redhat.com>
2676
2677 PR 21884
2678 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2679 has not been set then use the bfd returned by
2680 _bfd_elf_link_setup_gnu_properties. If that is null then search
2681 through all the input bfds selecting the first normal, ELF format
2682 one.
2683 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2684
2685 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2686
2687 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2688 to 1 bit.
2689 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2690 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2691 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2692 (elf_i386_link_check_relocs): New function.
2693 (bfd_elf32_bfd_link_check_relocs): New.
2694 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2695 to 1 bit.
2696 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2697 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2698 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2699 (elf_x86_64_link_check_relocs): New function.
2700 (bfd_elf64_bfd_link_check_relocs): New.
2701 (bfd_elf32_bfd_link_check_relocs): Likewise.
2702
2703 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2704
2705 PR ld/21903:
2706 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2707 as undefined for --no-define-common.
2708
2709 2017-08-05 Alan Modra <amodra@gmail.com>
2710
2711 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2712 hppa_link_hash_table.
2713
2714 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2715
2716 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2717 entries for sysregs with negative indices.
2718
2719 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2720
2721 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2722 isn't the S/390 specific elf data.
2723 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2724
2725 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2726
2727 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2728 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2729 [R_RISCV_ADD16]: Likewise.
2730 [R_RISCV_ADD32]: Likewise.
2731 [R_RISCV_ADD64]: Likewise.
2732 [R_RISCV_SUB6]: Likewise.
2733 [R_RISCV_SUB8]: Likewise.
2734 [R_RISCV_SUB16]: Likewise.
2735 [R_RISCV_SUB32]: Likewise.
2736 [R_RISCV_SUB64]: Likewise.
2737
2738 2017-07-31 Alan Modra <amodra@gmail.com>
2739
2740 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2741 without ld.so checks.
2742
2743 2017-07-29 Alan Modra <amodra@gmail.com>
2744
2745 PR 21847
2746 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2747 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2748 (is_elfv2_localentry0): Test non_zero_localentry.
2749 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2750
2751 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2752
2753 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2754 pointer check for htab->elf.irelplt.
2755 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2756
2757 2017-07-27 Nick Clifton <nickc@redhat.com>
2758
2759 PR 21840
2760 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2761 size is -1.
2762 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2763 with error return.
2764 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2765 are NULL.
2766 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2767 of end pointer.
2768 (evax_bfd_print_emh): Check for invalid string lengths.
2769
2770 2017-07-25 Nick Clifton <nickc@redhat.com>
2771
2772 * po/fr.po: Updated French translation.
2773
2774 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2775
2776 PR 21824
2777 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2778 16-bit absolute branches into 10-bit pc-relative branches on the
2779 MSP430 as well as the MSP430X.
2780
2781 2017-07-25 Alan Modra <amodra@gmail.com>
2782
2783 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2784 (stub_eh_frame_size): New function.
2785 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2786 (group_sections): Init group tls_get_addr_opt_bctrl.
2787 (ppc64_elf_size_stubs): Update sizing and initialization of
2788 .eh_frame. Iteration over stubs via group list.
2789 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2790 (ppc64_elf_finish_dynamic_sections): Update finalization of
2791 .eh_frame.
2792
2793 2017-07-24 Nick Clifton <nickc@redhat.com>
2794
2795 PR 21813
2796 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2797 of the relocs to the canonicalize_one_reloc routine.
2798 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2799 for the _bfd_mach_o_canonicalize_one_reloc field.
2800 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2801 res_base parameter. Use to check for corrupt pair relocs.
2802 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2803 Likewise.
2804 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2805 Likewise.
2806 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2807 Likewise.
2808
2809 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2810 enough data in the record before attempting to parse it.
2811 (_bfd_vms_slurp_eeom): Likewise.
2812
2813 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2814 (image_set_ptr): Likewise.
2815 (alpha_vms_slurp_relocs): Likewise.
2816
2817 (alpha_vms_object_p): Check for a truncated record.
2818
2819 2017-07-24 Nick Clifton <nickc@redhat.com>
2820
2821 PR 21803
2822 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2823 an unrecognized reloc and sets the bfd_error value.
2824 * libbfd.h: Regenerate.
2825 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2826 function.
2827 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2828 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2829 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2830 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2831 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2832
2833 2017-07-23 Alan Modra <amodra@gmail.com>
2834
2835 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2836 restore of LR.
2837
2838 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2839
2840 PR ld/18841
2841 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2842 reloc_class_ifunc for ifunc symbols.
2843
2844 2017-07-19 Nick Clifton <nickc@redhat.com>
2845
2846 PR 21787
2847 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2848 correct magic bytes at the start, set the error to wrong format
2849 and clear the format selector before returning NULL.
2850
2851 2017-07-19 Nick Clifton <nickc@redhat.com>
2852
2853 PR 21786
2854 * coff-rs6000.c (_bfd_strntol): New function.
2855 (_bfd_strntoll): New function.
2856 (GET_VALUE_IN_FIELD): New macro.
2857 (EQ_VALUE_IN_FIELD): new macro.
2858 (_bfd_xcoff_slurp_armap): Use new macros.
2859 (_bfd_xcoff_archive_p): Likewise.
2860 (_bfd_xcoff_read_ar_hdr): Likewise.
2861 (_bfd_xcoff_openr_next_archived_file): Likewise.
2862 (_bfd_xcoff_stat_arch_elt): Likewise.
2863 * coff64-rs6000.c (_bfd_strntol): New function.
2864 (_bfd_strntoll): New function.
2865 (GET_VALUE_IN_FIELD): New macro.
2866 (xcoff64_slurp_armap): Use new macros.
2867
2868 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2869 John Eric Martin <John.Martin@emmicro-us.com>
2870
2871 * bfd-in2.h: Regenerate.
2872 * libbfd.h: Regenerate.
2873 * elf32-arc.c (JLI): Define.
2874 * reloc.c: Add JLI relocations.
2875
2876 2017-07-18 Nick Clifton <nickc@redhat.com>
2877
2878 PR 21775
2879 * coff-sh.c: Fix spelling typos.
2880 * compress.c: Likewise.
2881 * cpu-pdp11.c: Likewise.
2882 * ecofflink.c: Likewise.
2883 * elf-m10300.c: Likewise.
2884 * elf.c: Likewise.
2885 * elf32-arm.c: Likewise.
2886 * elf32-m68k.c: Likewise.
2887 * elf32-nds32.c: Likewise.
2888 * elf32-ppc.c: Likewise.
2889 * elf32-sh.c: Likewise.
2890 * elf32-v850.c: Likewise.
2891 * elf64-ppc.c: Likewise.
2892 * elf64-x86-64.c: Likewise.
2893 * elflink.c: Likewise.
2894 * elfnn-aarch64.c: Likewise.
2895 * elfxx-mips.c: Likewise.
2896 * som.c: Likewise.
2897 * sunos.c: Likewise.
2898 * vms-alpha.c: Likewise.
2899 * xcofflink.c: Likewise.
2900
2901 2017-07-18 Nick Clifton <nickc@redhat.com>
2902
2903 PR binutils/21781
2904 * coffcode.h (handle_COMDAT): Replace abort with an error message
2905 and return.
2906
2907 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2908
2909 PR ld/21782
2910 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2911 to shared library.
2912
2913 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2914
2915 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2916
2917 2017-07-16 Alan Modra <amodra@gmail.com>
2918
2919 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2920 __tls_index GOT entries when using __tls_get_addr_opt stub.
2921 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2922
2923 2017-07-12 Alan Modra <amodra@gmail.com>
2924
2925 * po/es.po: Update from translationproject.org/latest/bfd/.
2926 * po/fi.po: Likewise.
2927 * po/fr.po: Likewise.
2928 * po/id.po: Likewise.
2929 * po/ja.po: Likewise.
2930 * po/ro.po: Likewise.
2931 * po/ru.po: Likewise.
2932 * po/sr.po: Likewise.
2933 * po/sv.po: Likewise.
2934 * po/tr.po: Likewise.
2935 * po/uk.po: Likewise.
2936 * po/vi.po: Likewise.
2937 * po/zh_CN.po: Likewise.
2938 * po/hr.po: New file from translationproject.org.
2939 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2940 * configure: Regenerate.
2941
2942 2017-07-12 Nick Clifton <nickc@redhat.com>
2943
2944 Fix compile time warnings using gcc 7.1.1.
2945 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2946 plt_name buffer.
2947 (elf_xtensa_get_gotplt_section): Increase length of got_name
2948 buffer.
2949 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2950 default return of FALSE.
2951 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2952 default return of FALSE.
2953
2954 2017-07-12 Alan Modra <amodra@gmail.com>
2955
2956 * binary.c (binary_set_section_contents): Don't print filepos in
2957 error message.
2958 (coff_write_object_contents): Cast size_t for error message.
2959 (coff_slurp_line_table): Don't use bfd_vma symndx.
2960 (coff_slurp_reloc_table): Remove unneeded cast.
2961 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2962 error message.
2963 (find_abstract_instance_name): Likewise.
2964 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2965 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2966 (elf32_arm_check_relocs): Make r_symndx an int.
2967 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2968 format string.
2969 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2970 message arg.
2971 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2972 error message.
2973 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2974 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2975 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2976 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2977 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2978 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2979 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2980 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2981 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2982 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2983 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2984 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2985 and use %lu for error message.
2986 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2987 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2988 error message.
2989
2990 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2991 in error message.
2992 (elf32_arm_final_link_relocate): Likewise.
2993 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2994 * coffcode.h (styp_to_sec_flags): Likewise.
2995 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2996 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2997 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2998 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2999 (elf32_bfin_merge_private_bfd_data): Likewise.
3000 * elf32-cris.c (cris_elf_relocate_section): Likewise.
3001 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
3002 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
3003 (i370_elf_relocate_section): Likewise.
3004 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
3005 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
3006 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
3007 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
3008 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
3009 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
3010 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
3011 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
3012 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
3013 * ieee.c (ieee_write_id, read_id): Likewise.
3014 * mach-o.c (bfd_mach_o_write_contents): Likewise.
3015 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
3016 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
3017 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
3018 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
3019 * stabs.c (_bfd_link_section_stabs): Likewise.
3020
3021 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
3022 format.
3023 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
3024 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
3025 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
3026 * coff-sh.c (sh_relax_section): Likewise.
3027 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
3028 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
3029 * coffcode.h (coff_slurp_reloc_table): Likewise.
3030 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3031 (_bfd_coff_read_string_table): Likewise.
3032 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
3033 * compress.c (bfd_get_full_section_contents): Likewise.
3034 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
3035 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
3036 * elf.c (bfd_elf_string_from_elf_section): Likewise.
3037 * elf32-arc.c (arc_special_overflow_checks): Likewise.
3038 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
3039 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
3040 (elf32_arm_write_section): Likewise.
3041 * elf32-bfin.c (bfin_relocate_section): Likewise.
3042 (bfinfdpic_relocate_section): Likewise.
3043 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3044 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
3045 * elf32-i386.c (elf_i386_tls_transition): Likewise.
3046 (elf_i386_relocate_section): Likewise.
3047 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
3048 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
3049 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
3050 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
3051 * elf32-metag.c (elf_metag_relocate_section): Likewise.
3052 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
3053 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
3054 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
3055 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
3056 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
3057 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
3058 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
3059 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
3060 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
3061 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
3062 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
3063 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
3064 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
3065 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
3066 * elf32-sh.c (sh_elf_relax_section): Likewise.
3067 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
3068 (sh_elf_relocate_section): Likewise.
3069 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
3070 * elf32-spu.c (spu_elf_relocate_section): Likewise.
3071 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
3072 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
3073 * elf32-v850.c (v850_elf_relax_section): Likewise.
3074 * elf32-vax.c (elf_vax_check_relocs): Likewise.
3075 (elf_vax_relocate_section): Likewise.
3076 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
3077 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
3078 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
3079 (do_fix_for_relocatable_link): Likewise.
3080 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
3081 (elf64_alpha_relax_with_lituse): Likewise.
3082 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
3083 (elf_hppa_final_link_relocate): Likewise.
3084 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
3085 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
3086 (elf64_vms_link_add_object_symbols): Likewise.
3087 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
3088 (mmix_final_link_relocate): Likewise.
3089 * elf64-s390.c (invalid_tls_insn): Likewise.
3090 (elf_s390_relocate_section): Likewise.
3091 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
3092 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
3093 (elf_x86_64_relocate_section): Likewise.
3094 * elfcode.h (elf_slurp_symbol_table): Likewise.
3095 * elfcore.h (elf_core_file_p): Likewise.
3096 * elflink.c (elf_link_read_relocs_from_section): Likewise.
3097 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
3098 (elfNN_aarch64_relocate_section): Likewise.
3099 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
3100 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
3101 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
3102 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3103 (_bfd_mips_elf_relocate_section): Likewise.
3104 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
3105 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
3106 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
3107 * ieee.c (ieee_slurp_external_symbols): Likewise.
3108 * ihex.c (ihex_write_object_content): Likewise.
3109 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
3110 * merge.c (_bfd_merged_section_offset): Likewise.
3111 * mmo.c (mmo_write_loc_chunk): Likewise.
3112 (mmo_write_object_contents): Likewise.
3113 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
3114 * stabs.c (_bfd_link_section_stabs): Likewise.
3115 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
3116
3117 2017-07-11 Alan Modra <amodra@gmail.com>
3118
3119 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
3120
3121 2017-07-11 Alan Modra <amodra@gmail.com>
3122
3123 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
3124 instruction" error using _bfd_error_handler, not einfo.
3125
3126 2017-07-10 Nick Clifton <nickc@redhat.com>
3127
3128 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
3129 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
3130
3131 2017-07-07 John Baldwin <jhb@FreeBSD.org>
3132
3133 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
3134
3135 2017-07-07 Alan Modra <amodra@gmail.com>
3136
3137 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
3138
3139 2017-07-07 Alan Modra <amodra@gmail.com>
3140
3141 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
3142 as long long. Move code replacing "ll" with "I64", and simplify.
3143
3144 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
3145
3146 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
3147 to 1.
3148
3149 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
3150
3151 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
3152 xtime.
3153 (line_info_add_file_name): Likewise.
3154 (decode_line_info): Likewise.
3155
3156 2017-07-04 Tristan Gingold <gingold@adacore.com>
3157
3158 * version.m4: Bump version to 2.29.51
3159 * configure: Regenerate.
3160
3161 2017-07-04 Jiong Wang <jiong.wang@arm.com>
3162
3163 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
3164 sanity check at the head of this function.
3165
3166 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
3167
3168 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
3169 dwarf_line_str_size.
3170 (struct attr_abbrev): Add field implicit_const.
3171 (dwarf_debug_sections): Add .debug_line_str.
3172 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
3173 (dwarf_debug_section_assert): Add static assertion.
3174 (read_indirect_line_string): New.
3175 (read_abbrevs): Support DW_FORM_implicit_const.
3176 (is_str_attr): Support DW_FORM_line_strp.
3177 (read_attribute_value): Support DW_FORM_line_strp and
3178 DW_FORM_implicit_const.
3179 (read_attribute): Support DW_FORM_implicit_const.
3180 (line_info_add_include_dir, line_info_add_include_dir_stub):
3181 (line_info_add_file_name, read_formatted_entries): New.
3182 (decode_line_info, parse_comp_unit): Support DWARF 5.
3183 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
3184
3185 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
3186
3187 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
3188 abort statement that was put for symbols that are not dynamic.
3189
3190 2017-07-03 Tristan Gingold <gingold@adacore.com>
3191
3192 * po/bfd.pot: Regenerate
3193
3194 2017-07-03 Alan Modra <amodra@gmail.com>
3195
3196 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
3197 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
3198 * elf.c (setup_group): Use "Lx" to print sh_size.
3199 (_bfd_elf_setup_sections): Remove unnecessary cast and print
3200 unknown section type in hex.
3201 (copy_special_section_fields): Style fix.
3202 (bfd_section_from_shdr): Correct format for sh_link. Use a
3203 common error message for all the variants of unrecognized
3204 section types.
3205 (assign_file_positions_for_load_sections): Use "Lx" for lma
3206 adjust error message.
3207 (assign_file_positions_for_non_load_sections): Formatting.
3208 (rewrite_elf_program_header): Formatting. Use "Lx" for
3209 bfd_vma values in error messages.
3210 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
3211 ELF_R_SYM value to type expected by format.
3212 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
3213 in error messages.
3214 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
3215 (elf_link_input_bfd): Use "Lx" for r_info.
3216 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
3217
3218 2017-07-03 Alan Modra <amodra@gmail.com>
3219
3220 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
3221 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
3222 Microsoft C library variant of long long format specifier.
3223 (PRINT20): Cast value to bfd_uint64_t not long long.
3224 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
3225 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
3226 long long. Don't cast to bfd_vma.
3227 * elf32-score.c (score3_bfd_getl48): Likewise.
3228 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
3229
3230 2017-07-03 Alan Modra <amodra@gmail.com>
3231
3232 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
3233 print d_tag.
3234 (bfd_elf_print_symbol): Don't cast symbol->flags.
3235 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
3236 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
3237 _bfd_error_handler argument order.
3238 (ppc_elf_merge_private_bfd_data): Don't cast flags.
3239
3240 2017-07-03 Alan Modra <amodra@gmail.com>
3241
3242 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
3243 AC_TYPE_LONG_DOUBLE.
3244 * configure: Regenerate.
3245 * config.in: Regenerate.
3246
3247 2017-06-29 Andrew Waterman <andrew@sifive.com>
3248
3249 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
3250 relocs.
3251
3252 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
3253
3254 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
3255 unless it is undefined weak.
3256 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
3257 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
3258 relocation.
3259 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
3260 is not dynamic in PIC, abort.
3261
3262 2017-06-29 Jiong Wang <jiong.wang@arm.com>
3263
3264 PR ld/21402
3265 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
3266 undefined weak symbols into dynamic.
3267 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
3268 relocation for non-dynamic symbols.
3269 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
3270
3271 2017-06-29 Jiong Wang <jiong.wang@arm.com>
3272
3273 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
3274 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
3275 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
3276 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
3277 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
3278 support for them.
3279
3280 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
3281
3282 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
3283 (elfcore_write_s390_gs_bc): Likewise.
3284 * elf.c (elfcore_grok_s390_gs_cb): New function.
3285 (elfcore_grok_s390_gs_bc): New function.
3286 (elfcore_grok_note): Call them.
3287 (elfcore_write_s390_gs_cb): New function.
3288 (elfcore_write_s390_gs_bc): New function.
3289 (elfcore_write_register_note): Call them.
3290
3291 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
3292
3293 * libbfd.c (_bfd_generic_get_section_contents): Don't call
3294 bfd_get_file_size. Check archive element size.
3295 (_bfd_generic_get_section_contents_in_window): Likewise.
3296
3297 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
3298
3299 * bfd-in2.h: Regenerated.
3300 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
3301 (bfd_get_file_size): Likewise.
3302
3303 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
3304 Matthew Fortune <matthew.fortune@imgtec.com>
3305
3306 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
3307 * cpu-mips.c (I_interaptiv_mr2): New enum value.
3308 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
3309 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
3310 case.
3311 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
3312 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
3313 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
3314 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
3315 `bfd_mach_mips_interaptiv_mr2' entries.
3316 * bfd-in2.h: Regenerate.
3317
3318 2017-06-27 Nick Clifton <nickc@redhat.com>
3319
3320 * tekhex.c (pass_over): Revert accidental conversion of a local
3321 array to a static array.
3322
3323 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3324
3325 PR ld/13402
3326 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
3327 reloc addend if necessary. Adjust diff only if
3328 shrinked_insn_address < end_address.
3329
3330 2017-06-27 Alan Modra <amodra@gmail.com>
3331
3332 PR binutils/21665
3333 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
3334 (_bfd_generic_get_section_contents_in_window): Likewise.
3335
3336 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
3337
3338 * elfnn-riscv.c (perform_relocation): Support the new
3339 R_RISCV_32_PCREL relocation.
3340 (riscv_elf_relocate_section): Likewise.
3341 * elfxx-riscv.c (howto_table): Likewise.
3342 (riscv_reloc_map): Likewise.
3343 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
3344 * libbfd.h: Regenerate.
3345
3346 2017-06-27 Alan Modra <amodra@gmail.com>
3347
3348 PR binutils/21665
3349 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
3350 Use unsigned file pointer type, and remove cast.
3351 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
3352 Add "count", not "sz".
3353
3354 2017-06-26 Pedro Alves <palves@redhat.com>
3355
3356 PR binutils/21665
3357 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
3358 "sz".
3359
3360 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
3361
3362 PR binutils/21665
3363 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
3364 a missing line.
3365
3366 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
3367
3368 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
3369 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
3370 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
3371 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
3372 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
3373
3374 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
3375
3376 PR binutils/21665
3377 * compress.c (bfd_get_full_section_contents): Don't check the
3378 file size here.
3379 * libbfd.c (_bfd_generic_get_section_contents): Check for and
3380 reject a section whose size + offset is greater than the size
3381 of the entire file.
3382 (_bfd_generic_get_section_contents_in_window): Likewise.
3383
3384 2017-06-26 Nick Clifton <nickc@redhat.com>
3385
3386 PR binutils/21670
3387 * tekhex.c (getvalue): Check for the source pointer exceeding the
3388 end pointer before the first byte is read.
3389
3390 2017-06-26 Nick Clifton <nickc@redhat.com>
3391
3392 PR binutils/21665
3393 * opncls.c (get_build_id): Check that the section is big enough
3394 to contain the whole note.
3395 * compress.c (bfd_get_full_section_contents): Check for and reject
3396 a section whose size is greater than the size of the entire file.
3397 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
3398 contain a notes section.
3399
3400 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3401
3402 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
3403 pointer checks.
3404 (elf_s390_modify_segment_map): Likewise.
3405 (bfd_elf_s390_set_options): Lisewise.
3406
3407 2017-06-26 Alan Modra <amodra@gmail.com>
3408
3409 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
3410 a --just-syms bfd.
3411 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
3412 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
3413 .preinit_array on --just-syms bfds.
3414 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
3415 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
3416 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
3417
3418 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
3419
3420 * elf.c (find_link): Bounds check "hint".
3421
3422 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
3423
3424 * elf32-arm.c (using_thumb_only): Update list of architectures in
3425 BFD_ASSERT for which the logic is valid.
3426 (using_thumb2_bl): Likewise.
3427 (using_thumb2): Likewise and return true for ARMv8-R.
3428 (arch_has_arm_nop): Likewise.
3429 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
3430 merging logic. Update commentis for value 15 of v8m_baseline,
3431 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
3432 merging of value 15 of Tag_CPU_arch.
3433
3434 2017-06-23 Jiong Wang <jiong.wang@arm.com>
3435
3436 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
3437 BFD_RELOC_AARCH64_ADR_GOT_PAGE
3438 * bfd-in2.h: Regenerate.
3439
3440 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3441
3442 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
3443 the error_alignment label forward. Properly align program
3444 property note section.
3445
3446 2017-06-22 Eric Christopher <echristo@gmail.com>
3447
3448 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
3449 abs to fix a truncation warning.
3450
3451 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3452
3453 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
3454 local undefined weak symbol to 0.
3455 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
3456
3457 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3458
3459 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
3460 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3461 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
3462 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3463 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
3464 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3465 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
3466 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3467
3468 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3469
3470 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
3471 (elf_i386_lazy_ibt_plt_entry): Likewise.
3472 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
3473 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
3474 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
3475 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
3476 (elf_i386_lazy_plt_layout): Likewise.
3477 (elf_i386_non_lazy_plt_layout): Likewise.
3478 (elf_i386_link_hash_entry): Add plt_second.
3479 (elf_i386_link_hash_table): Add plt_second and
3480 plt_second_eh_frame.
3481 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
3482 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
3483 the second PLT. Check the second PLT.
3484 (elf_i386_relocate_section): Use the second PLT to resolve
3485 PLT reference if needed.
3486 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
3487 needed.
3488 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
3489 second PLT. Generate unwind info for the second PLT.
3490 (elf_i386_plt_type): Add plt_second.
3491 (elf_i386_get_synthetic_symtab): Support the second PLT.
3492 (elf_i386_parse_gnu_properties): Support
3493 GNU_PROPERTY_X86_FEATURE_1_AND.
3494 (elf_i386_merge_gnu_properties): Support
3495 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3496 on GNU_PROPERTY_X86_FEATURE_1_IBT
3497 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
3498 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3499 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3500 is set on all relocatable inputs.
3501 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
3502 (elf_x32_lazy_ibt_plt_entry): Likewise.
3503 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
3504 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
3505 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
3506 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
3507 (elf_x86_64_lazy_ibt_plt): Likewise.
3508 (elf_x32_lazy_ibt_plt): Likewise.
3509 (elf_x86_64_non_lazy_ibt_plt): Likewise.
3510 (elf_x32_non_lazy_ibt_plt): Likewise.
3511 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
3512 (elf_x86_64_parse_gnu_properties): Support
3513 GNU_PROPERTY_X86_FEATURE_1_AND.
3514 (elf_x86_64_merge_gnu_properties): Support
3515 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3516 on GNU_PROPERTY_X86_FEATURE_1_IBT
3517 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
3518 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3519 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3520 is set on all relocatable inputs.
3521
3522 2017-06-22 Nick Clifton <nickc@redhat.com>
3523
3524 PR binutils/21649
3525 * som.c (setup_sections): NUL terminate the space_strings buffer.
3526 Check that the space.name field does not index beyond the end of
3527 the space_strings buffer.
3528
3529 2017-06-21 Nick Clifton <nickc@redhat.com>
3530
3531 PR binutils/21646
3532 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3533
3534 2017-06-21 Nick Clifton <nickc@redhat.com>
3535
3536 PR binutils/21639
3537 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
3538 type of the size parameter.
3539 (_bfd_vms_save_counted_string): Add second parameter - the maximum
3540 length of the counted string.
3541 * vms.h (_bfd_vms_save_sized_string): Update prototype.
3542 (_bfd_vms_save_counted_string): Likewise.
3543 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
3544 _bfd_vms_save_counted_string.
3545 (_bfd_vms_slurp_ehdr): Likewise.
3546 (_bfd_vms_slurp_egsd): Likewise.
3547 (Parse_module): Likewise.
3548
3549 2017-06-21 Alan Modra <amodra@gmail.com>
3550
3551 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
3552 calls before tocsave calls.
3553 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
3554 following nop.
3555
3556 2017-06-21 Nick Clifton <nickc@redhat.com>
3557
3558 PR binutils/21645
3559 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3560 bfd_get_full_section_contents returns no contents.
3561
3562 2017-06-21 Nick Clifton <nickc@redhat.com>
3563
3564 PR binutils/21638
3565 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3566 record.
3567
3568 2017-06-21 Nick Clifton <nickc@redhat.com>
3569
3570 PR binutils/21637
3571 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3572 list.
3573 (image_set_ptr): Likewise.
3574 (alpha_vms_fix_sec_rel): Likewise.
3575 (alpha_vms_slurp_relocs): Likewise.
3576
3577 2017-06-21 Nick Clifton <nickc@redhat.com>
3578
3579 PR binutils/21633
3580 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3581 read_id.
3582 (ieee_archive_p): Likewise.
3583 (ieee_object_p): Likewise.
3584
3585 2017-06-21 Nick Clifton <nickc@redhat.com>
3586
3587 PR binutils/21640
3588 * elf.c (setup_group): Zero the group section pointer list after
3589 allocation so that loops can be caught. Check for NULL pointers
3590 when processing a group list.
3591
3592 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3593
3594 * elf-s390.h: New file.
3595 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3596 field.
3597 (elf_s390_additional_program_headers): New function.
3598 (elf_s390_modify_segment_map): New function.
3599 (bfd_elf_s390_set_options): New function.
3600 (elf_backend_additional_program_headers)
3601 (elf_backend_modify_segment_map): Add macro definitions.
3602
3603 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3604
3605 PR ld/21626
3606 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3607 the DYNAMIC bit instead of bfd_count_sections.
3608
3609 2017-06-19 Nick Clifton <nickc@redhat.com>
3610
3611 PR binutils/21618
3612 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3613 length.
3614 (evax_bfd_print_eeom): Likewise.
3615 (evax_bfd_print_egsd): Check for an overlarge record length.
3616 (evax_bfd_print_etir): Likewise.
3617
3618 2017-06-19 Nick Clifton <nickc@redhat.com>
3619
3620 PR binutils/21612
3621 * libieee.h (struct common_header_type): Add end_p field.
3622 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3623 end_p.
3624 (read_id): Check for a length that exceeds the remaining bytes in
3625 the input buffer.
3626 (ieee_seek): Initialise end_p.
3627 (ieee_archive_p): Likewise.
3628 (ieee_object_p): Likewise.
3629
3630 2017-06-19 Nick Clifton <nickc@redhat.com>
3631
3632 PR binutils/21611
3633 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3634 before reading the EIHS structure entries.
3635
3636 2017-06-19 Nick Clifton <nickc@redhat.com>
3637
3638 PR binutils/21615
3639 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3640 gsd_size. Check that there are enough bytes remaining to read the
3641 type and size of the next egsd. Check that the size of the egsd
3642 does not exceed the size of the record.
3643
3644 2017-06-19 Alan Modra <amodra@gmail.com>
3645
3646 * config.bfd: Correct targ_underscore for cris.
3647
3648 2017-06-18 Alan Modra <amodra@gmail.com>
3649
3650 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3651 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3652
3653 2017-06-16 Nick Clifton <nickc@redhat.com>
3654
3655 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3656 bucketlist is empty because there are no symbols to add to the
3657 list.
3658
3659 2017-06-16 Alan Modra <amodra@gmail.com>
3660
3661 PR ld/20022
3662 PR ld/21557
3663 PR ld/21562
3664 PR ld/21571
3665 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3666 (BFD_JUMP_TABLE_LINK): Likewise.
3667 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3668 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3669 (bfd_elf_define_start_stop): New function.
3670 * linker.c (bfd_generic_define_start_stop): New function.
3671 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3672 new field.
3673 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3674 * aout-target.h (MY_bfd_define_start_stop): Define.
3675 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3676 * binary.c (binary_bfd_define_start_stop): Define.
3677 * bout.c (b_out_bfd_define_start_stop): Define.
3678 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3679 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3680 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3681 * coffcode.h (coff_bfd_define_start_stop): Define.
3682 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3683 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3684 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3685 * ieee.c (ieee_bfd_define_start_stop): Define.
3686 * ihex.c (ihex_bfd_define_start_stop): Define.
3687 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3688 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3689 * mmo.c (mmo_bfd_define_start_stop): Define.
3690 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3691 * oasys.c (oasys_bfd_define_start_stop): Define.
3692 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3693 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3694 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3695 * som.c (som_bfd_define_start_stop): Define.
3696 * srec.c (srec_bfd_define_start_stop): Define.
3697 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3698 * versados.c (versados_bfd_define_start_stop): Define.
3699 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3700 (alpha_vms_bfd_define_start_stop): Define.
3701 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3702 * bfd-in2.h: Regenerate.
3703 * libbfd.h: Regenerate.
3704
3705 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3706
3707 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3708 SYMBOL_REFERENCES_LOCAL.
3709
3710 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3711
3712 PR ld/21532
3713 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3714 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3715 runtime for if there needs copy relocation elimination.
3716 (need_copy_relocation_p): New function. Return true for symbol with
3717 pc-relative references and if it's against read-only sections.
3718 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3719 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3720 that are related with accessing external objects.
3721 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3722 in elfNN_aarch64_check_relocs.
3723
3724 2017-06-15 Nick Clifton <nickc@redhat.com>
3725
3726 PR binutils/21582
3727 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3728 bugs.
3729 PR binutils/21581
3730 (ieee_archive_p): Likewise.
3731
3732 2017-06-15 Nick Clifton <nickc@redhat.com>
3733
3734 PR binutils/21579
3735 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3736
3737 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3738
3739 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3740 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3741 keep both windowed and call0 ABI PLT definitions.
3742 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3743 elf_xtensa_*_plt_entry endex.
3744 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3745
3746 2017-06-14 Nick Clifton <nickc@redhat.com>
3747
3748 PR binutils/21578
3749 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3750 flag value.
3751
3752 2017-06-14 Nick Clifton <nickc@redhat.com>
3753
3754 PR binutils/21589
3755 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3756 maximum value for the ascic pointer. Check that name processing
3757 does not read beyond this value.
3758 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3759 end of etir record.
3760
3761 2017-06-14 Nick Clifton <nickc@redhat.com>
3762
3763 PR binutils/21591
3764 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3765 (process_otr): Check for an invalid offset in the otr structure.
3766
3767 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3768
3769 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3770
3771 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3772
3773 PR ld/20022
3774 PR ld/21557
3775 PR ld/21562
3776 PR ld/21571
3777 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3778 vtable field to a union.
3779 (_bfd_elf_is_start_stop): Removed.
3780 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3781 __start_SECNAME and __stop_SECNAME symbols.
3782 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3783 * elflink.c (_bfd_elf_is_start_stop): Removed.
3784 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3785 _bfd_elf_is_start_stop.
3786 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3787 __stop_SECNAME symbols. Updated.
3788 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3789 (bfd_elf_gc_record_vtinherit): Likewise.
3790 (bfd_elf_gc_record_vtentry): Likewise.
3791
3792 2017-06-13 Nick Clifton <nickc@redhat.com>
3793
3794 PR ld/21524
3795 * elflink.c (elf_link_adjust_relocs): Generate an error when
3796 encountering a reloc against a symbol removed by garbage
3797 collection.
3798
3799 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3800
3801 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3802 to merge_gnu_properties.
3803 * elf-properties.c (elf_merge_gnu_properties): Add struct
3804 bfd_link_info * and pass it to merge_gnu_properties.
3805 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3806 and pass it to elf_merge_gnu_properties.
3807 (_bfd_elf_link_setup_gnu_properties): Pass info to
3808 elf_merge_gnu_property_list.
3809 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3810 bfd_link_info *.
3811 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3812
3813 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3814
3815 PR 21564
3816 * binary.c (binary_set_section_contents): Scale lma by octets
3817 per byte to set filepos.
3818
3819 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3820
3821 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3822 dynamic sections.
3823
3824 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3825
3826 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3827 require TEXTREL.
3828
3829 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3830
3831 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3832 patched section contents for TLS IE reloc.
3833 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3834
3835 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3836
3837 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3838 RELOC_FOR_GLOBAL_SYMBOL macro.
3839
3840 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3841
3842 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3843 changes.
3844
3845 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3846
3847 * config/tc-arc.c (md_undefined_symbol): Changed.
3848 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3849
3850 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3851
3852 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3853 symbols.
3854
3855 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3856
3857 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3858 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3859
3860 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3861
3862 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3863 object is created.
3864
3865 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3866
3867 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3868 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3869 is non-zero. Add clarifying comments.
3870
3871 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3872
3873 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3874 name. Use local IFUNC symbol name string to report unsupported
3875 non-PIC call to IFUNC function.
3876 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3877 when generating R_386_IRELATIVE relocation.
3878 (elf_i386_finish_dynamic_symbol): Likewise.
3879 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3880 IFUNC symbol name.
3881 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3882 when generating R_X86_64_IRELATIVE relocation.
3883 (elf_x86_64_finish_dynamic_symbol): Likewise.
3884
3885 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3886
3887 * elf.c (setup_group): Make sure BFD sections are created for all
3888 group sections in the input file when processing SHF_GROUP
3889 sections.
3890 (bfd_section_from_shdr): Avoid duplicating logic already
3891 implemented in `setup_group'.
3892
3893 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3894
3895 PR binutils/21546
3896 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3897 if the hint address is zero.
3898
3899 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3900
3901 PR ld/19579
3902 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3903 ELF_COMMON_DEF_P for common symbols.
3904
3905 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3906
3907 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3908 SEC_GROUP sections as SEC_EXCLUDE.
3909 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3910 (assign_section_numbers): Use resolve_section_groups flag instead
3911 of relocatable link type.
3912 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3913 flag instead of checking the final_link flag for part of the
3914 checks in here. Fix white space as a result.
3915 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3916 instead of relocatable link type.
3917 (bfd_elf_final_link): Likewise.
3918
3919 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3920
3921 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3922 variable `bed'.
3923 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3924 (s3_bfd_score_elf_check_relocs): Likewise.
3925 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3926 (score_elf_final_link_relocate): Likewise.
3927 (s7_bfd_score_elf_check_relocs): Likewise.
3928
3929 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3930
3931 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3932 `bed'.
3933
3934 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3935
3936 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3937 from `reloc_count' rather than decrementing it.
3938 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3939 `reloc_count' by `int_rels_per_ext_rel'.
3940 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3941 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3942 entry determination.
3943 (s3_bfd_score_elf_check_relocs): Likewise.
3944 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3945 (s7_bfd_score_elf_relocate_section): Likewise.
3946 (s7_bfd_score_elf_check_relocs): Likewise.
3947 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3948 prototype and function.
3949 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3950 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3951 triple rather than once the sum of REL and RELA relocation entry
3952 counts.
3953 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3954 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3955 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3956 storage allocation size determination.
3957 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3958 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3959 by `int_rels_per_ext_rel' for last relocation entry
3960 determination.
3961 (bfd_elf_final_link): Do not multiply `reloc_count' by
3962 `int_rels_per_ext_rel' for internal relocation storage
3963 allocation size determination.
3964 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3965 `int_rels_per_ext_rel' for last relocation entry determination.
3966 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3967 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3968 (_bfd_mips_elf_relocate_section): Likewise.
3969
3970 2017-06-05 Alan Modra <amodra@gmail.com>
3971
3972 PR 21529
3973 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3974
3975 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3976
3977 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3978 determine structure sizes.
3979 (elfcore_grok_freebsd_prstatus): Likewise.
3980
3981 2017-06-01 Alan Modra <amodra@gmail.com>
3982
3983 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3984 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3985 dynamic objects.
3986 (is_elfv2_localentry0): New function.
3987 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3988 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3989 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3990 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3991 optimized localentry:0 stubs.
3992 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3993 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3994 localentry:0 stubs.
3995 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3996 DT_PPC64_OPT.
3997 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3998
3999 2017-05-30 Casey Smith <clegg89@gmail.com>
4000
4001 PR ld/21523
4002 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
4003 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
4004
4005 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
4006
4007 * cpu-arc.c (arc_compatible): New function.
4008
4009 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
4010
4011 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
4012
4013 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
4014
4015 PR binutils/21519
4016 * bfdio.c (bfd_get_file_size): New function.
4017 * bfd-in2.h: Regenerated.
4018
4019 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
4020
4021 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
4022 comments.
4023
4024 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
4025
4026 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
4027 dynobj instead of htab->elf.dynobj.
4028
4029 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
4030
4031 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
4032 and function.
4033 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
4034 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
4035 actual number of internal relocations retrieved. Adjust
4036 function description.
4037 (bfd_elf64_canonicalize_reloc): Remove macro.
4038 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
4039
4040 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
4041
4042 * archures.c (bfd_mach_sparc_v9m8): Define.
4043 (bfd_mach_sparc_v8plusm8): Likewise.
4044 (bfd_mach_sparc_v9_p): Adjust to M8.
4045 (bfd_mach_sparc_64bit_p): Likewise.
4046 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
4047 bfd_mach_sparc_v8plusm8.
4048 * bfd-in2.h: Regenerated.
4049 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
4050 sparc:v8plusm8.
4051 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
4052 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
4053 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
4054 SHA3.
4055 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
4056 bfd_mach_sparc_v8plusm8.
4057
4058 2017-05-19 Alan Modra <amodra@gmail.com>
4059
4060 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
4061 debug and special sections when no non-note alloc sections in an
4062 object are kept.
4063
4064 2017-05-18 Alan Modra <amodra@gmail.com>
4065
4066 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
4067 * elf-m10300.c: Likewise.
4068 * elf.c: Likewise.
4069 * elf32-arc.c: Likewise.
4070 * elf32-bfin.c: Likewise.
4071 * elf32-m68k.c: Likewise.
4072 * elf32-nds32.c: Likewise.
4073 * elf32-tilepro.c: Likewise.
4074 * elflink.c: Likewise.
4075 * elfnn-aarch64.c: Likewise.
4076 * elfnn-riscv.c: Likewise.
4077 * elfxx-tilegx.c: Likewise.
4078 * mach-o.c: Likewise.
4079 * peXXigen.c: Likewise.
4080 * vms-alpha.c: Likewise.
4081 * vms-lib.c: Likewise.
4082
4083 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
4084
4085 PR ld/20882
4086 * elflink.c (elf_gc_mark_debug_section): New function.
4087 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
4088 referenced by kept debug sections.
4089
4090 2017-05-16 Alan Modra <amodra@gmail.com>
4091
4092 * elf-m10300.c: Rename occurrences of non_ir_ref.
4093 * elf32-arm.c: Likewise.
4094 * elf32-bfin.c: Likewise.
4095 * elf32-cr16.c: Likewise.
4096 * elf32-cris.c: Likewise.
4097 * elf32-d10v.c: Likewise.
4098 * elf32-dlx.c: Likewise.
4099 * elf32-fr30.c: Likewise.
4100 * elf32-frv.c: Likewise.
4101 * elf32-hppa.c: Likewise.
4102 * elf32-i370.c: Likewise.
4103 * elf32-i386.c: Likewise.
4104 * elf32-iq2000.c: Likewise.
4105 * elf32-lm32.c: Likewise.
4106 * elf32-m32c.c: Likewise.
4107 * elf32-m32r.c: Likewise.
4108 * elf32-m68hc1x.c: Likewise.
4109 * elf32-m68k.c: Likewise.
4110 * elf32-mcore.c: Likewise.
4111 * elf32-metag.c: Likewise.
4112 * elf32-microblaze.c: Likewise.
4113 * elf32-moxie.c: Likewise.
4114 * elf32-msp430.c: Likewise.
4115 * elf32-mt.c: Likewise.
4116 * elf32-nios2.c: Likewise.
4117 * elf32-or1k.c: Likewise.
4118 * elf32-ppc.c: Likewise.
4119 * elf32-rl78.c: Likewise.
4120 * elf32-s390.c: Likewise.
4121 * elf32-score.c: Likewise.
4122 * elf32-score7.c: Likewise.
4123 * elf32-sh.c: Likewise.
4124 * elf32-tic6x.c: Likewise.
4125 * elf32-tilepro.c: Likewise.
4126 * elf32-v850.c: Likewise.
4127 * elf32-vax.c: Likewise.
4128 * elf32-xstormy16.c: Likewise.
4129 * elf32-xtensa.c: Likewise.
4130 * elf64-alpha.c: Likewise.
4131 * elf64-hppa.c: Likewise.
4132 * elf64-ia64-vms.c: Likewise.
4133 * elf64-mmix.c: Likewise.
4134 * elf64-ppc.c: Likewise.
4135 * elf64-s390.c: Likewise.
4136 * elf64-sh64.c: Likewise.
4137 * elf64-x86-64.c: Likewise.
4138 * elflink.c: Likewise.
4139 * elfnn-aarch64.c: Likewise.
4140 * elfnn-ia64.c: Likewise.
4141 * elfnn-riscv.c: Likewise.
4142 * elfxx-mips.c: Likewise.
4143 * elfxx-sparc.c: Likewise.
4144 * elfxx-tilegx.c: Likewise.
4145 * linker.c: Likewise.
4146
4147 2017-05-16 Alan Modra <amodra@gmail.com>
4148
4149 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
4150 * elflink.c (elf_link_add_object_symbols): Update to use
4151 non_ir_ref_dynamic.
4152 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
4153 non_ir_ref.
4154 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
4155
4156 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
4157
4158 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
4159
4160 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
4161
4162 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
4163 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
4164 properties.
4165 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4166
4167 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
4168
4169 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
4170 to plt_second.
4171 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
4172 to plt_second/plt_second_eh_frame.
4173 (elf_x86_64_link_hash_newfunc): Updated.
4174 (elf_x86_64_allocate_dynrelocs): Likewise.
4175 (elf_x86_64_size_dynamic_sections): Likewise.
4176 (elf_x86_64_relocate_section): Likewise.
4177 (elf_x86_64_finish_dynamic_symbol): Likewise.
4178 (elf_x86_64_finish_dynamic_sections): Likewise.
4179 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
4180 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
4181 .plt.sec section.
4182 (elf_backend_setup_gnu_properties): Updated. Create the
4183 .plt.sec section instead of the .plt.sec section.
4184
4185 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
4186
4187 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
4188 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
4189 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
4190
4191 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
4192
4193 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
4194 (bfd_elf64_set_reloc): Define.
4195 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
4196
4197 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
4198
4199 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
4200 (struct bfd_target): New field _bfd_set_reloc.
4201 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
4202 * reloc.c (_bfd_generic_set_reloc): New function.
4203 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
4204 * nlm-target.h (nlm_set_reloc): Likewise.
4205 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
4206 * aout-tic30.c (MY_set_reloc): Likewise.
4207 * aout-target.h (MY_set_reloc): Likewise.
4208 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
4209 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
4210 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
4211 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
4212 * aout-adobe.c (aout_32_set_reloc): Likewise.
4213 * bout.c (b_out_set_reloc): Likewise.
4214 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
4215 * i386os9k.c (aout_32_set_reloc): Likewise.
4216 * ieee.c (ieee_set_reloc): Likewise.
4217 * oasys.c (oasys_set_reloc): Likewise.
4218 * som.c (som_set_reloc): Likewise.
4219 * versados.c (versados_set_reloc): Likewise.
4220 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
4221 _bfd_generic_set_reloc.
4222 (rs6000_xcoff64_aix_vec): LIkewise.
4223 * libbfd.c (_bfd_norelocs_set_reloc): New function.
4224 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
4225 * i386msdos.c (msdos_set_reloc): Define to
4226 _bfd_norelocs_set_reloc.
4227 * elfcode.h (elf_set_reloc): Define.
4228 * bfd-in2.h: Regenerated.
4229
4230 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
4231
4232 PR ld/21481
4233 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
4234 for IFUNC function address.
4235
4236 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
4237
4238 * elf32-arc.c (FEATURE_LIST_NAME): Define.
4239 (CONFLICT_LIST): Likewise.
4240 (opcode/arc-attrs.h): Include.
4241 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
4242 (arc_extract_features): New file.
4243 (arc_stralloc): Likewise.
4244 (arc_elf_merge_attributes): Likewise.
4245 (arc_elf_merge_private_bfd_data): Use object attributes.
4246 (bfd_arc_get_mach_from_attributes): New function.
4247 (arc_elf_object_p): Use object attributes.
4248 (arc_elf_final_write_processing): Likewise.
4249 (elf32_arc_obj_attrs_arg_type): New function.
4250 (elf32_arc_obj_attrs_handle_unknown): Likewise.
4251 (elf32_arc_section_from_shdr): Likewise.
4252 (elf_backend_obj_attrs_vendor): Define.
4253 (elf_backend_obj_attrs_section): Likewise.
4254 (elf_backend_obj_attrs_arg_type): Likewise.
4255 (elf_backend_obj_attrs_section_type): Likewise.
4256 (elf_backend_obj_attrs_handle_unknown): Likewise.
4257 (elf_backend_section_from_shdr): Likewise.
4258
4259 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
4260
4261 PR ld/21458
4262 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
4263 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
4264 and the destination is a Thumb symbol.
4265
4266 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
4267
4268 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
4269 initializer to silence GCC 4.2.
4270 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
4271
4272 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
4273
4274 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
4275 (LAZY_PLT_ENTRY_SIZE): This.
4276 (NON_LAZY_PLT_ENTRY_SIZE): New.
4277 (elf_x86_64_plt0_entry): Renamed to ...
4278 (elf_x86_64_lazy_plt0_entry): This.
4279 (elf_x86_64_plt_entry): Renamed to ...
4280 (elf_x86_64_lazy_plt_entry): This.
4281 (elf_x86_64_bnd_plt0_entry): Renamed to ...
4282 (elf_x86_64_lazy_bnd_plt0_entry): This.
4283 (elf_x86_64_legacy_plt_entry): Removed.
4284 (elf_x86_64_bnd_plt_entry): Renamed to ...
4285 (elf_x86_64_lazy_bnd_plt_entry): This.
4286 (elf_x86_64_legacy_plt2_entry): Renamed to ...
4287 (elf_x86_64_non_lazy_plt_entry): This.
4288 (elf_x86_64_bnd_plt2_entry): Renamed to ...
4289 (elf_x86_64_non_lazy_bnd_plt_entry): This.
4290 (elf_x86_64_eh_frame_plt): Renamed to ...
4291 (elf_x86_64_eh_frame_lazy_plt): This.
4292 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
4293 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
4294 (elf_x86_64_eh_frame_plt_got): Renamed to ...
4295 (elf_x86_64_eh_frame_non_lazy_plt): This.
4296 (elf_x86_64_lazy_plt_layout): New.
4297 (elf_x86_64_non_lazy_plt_layout): Likewise.
4298 (elf_x86_64_plt_layout): Likewise.
4299 (elf_x86_64_backend_data): Remove PLT layout information. Add
4300 os for target system.
4301 (GET_PLT_ENTRY_SIZE): Removed.
4302 (elf_x86_64_lazy_plt): New.
4303 (elf_x86_64_non_lazy_plt): Likewise.
4304 (elf_x86_64_lazy_bnd_plt): Likewise.
4305 (elf_x86_64_non_lazy_bnd_plt): Likewise.
4306 (elf_x86-64_arch_bed): Updated.
4307 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
4308 (elf_x86_64_create_dynamic_sections): Removed.
4309 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
4310 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
4311 (elf_x86-64_adjust_dynamic_symbol): Updated.
4312 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
4313 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
4314 size for PLT0 if there is no PLT0. Get plt_entry_size from
4315 non_lazy_plt for non-lazy PLT entries.
4316 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
4317 from non_lazy_plt for non-lazy PLT entries.
4318 (elf_x86-64_relocate_section): Updated. Properly get PLT index
4319 if there is no PLT0.
4320 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
4321 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
4322 entries with non-lazy PLT layout. Don't fill the second and third
4323 slots in the PLT entry if there is no PLT0.
4324 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
4325 if there is no PLT0. Set sh_entsize on the .plt.got section.
4326 (compare_relocs): New.
4327 (elf_x86_64_plt_type): Likewise.
4328 (elf_x86_64_plt): Likewise.
4329 (elf_x86_64_nacl_plt): New. Forward declaration.
4330 (elf_x86_64_get_plt_sym_val): Removed.
4331 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
4332 against all dynamic relocations.
4333 (elf_x86_64_link_setup_gnu_properties): New function.
4334 (elf_backend_create_dynamic_sections): Updated.
4335 (elf_backend_setup_gnu_properties): New.
4336 (elf_x86_64_nacl_plt): New.
4337 (elf_x86_64_nacl_arch_bed): Updated.
4338
4339 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
4340
4341 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
4342 (LAZY_PLT_ENTRY_SIZE): This.
4343 (NON_LAZY_PLT_ENTRY_SIZE): New.
4344 (elf_i386_plt0_entry): Renamed to ...
4345 (elf_i386_lazy_plt0_entry): This.
4346 (elf_i386_plt_entry): Renamed to ...
4347 (elf_i386_lazy_plt_entry): This.
4348 (elf_i386_pic_plt0_entry): Renamed to ...
4349 (elf_i386_pic_lazy_plt0_entry): This.
4350 (elf_i386_pic_plt_entry): Renamed to ...
4351 (elf_i386_pic_lazy_plt_entry): This.
4352 (elf_i386_got_plt_entry): Renamed to ...
4353 (elf_i386_non_lazy_plt_entry): This.
4354 (elf_i386_pic_got_plt_entry): Renamed to ...
4355 (elf_i386_pic_non_lazy_plt_entry): This.
4356 (elf_i386_eh_frame_plt): Renamed to ...
4357 (elf_i386_eh_frame_lazy_plt): This.
4358 (elf_i386_eh_frame_plt_got): Renamed to ...
4359 (elf_i386_eh_frame_non_lazy_plt): This.
4360 (elf_i386_plt_layout): Renamed to ...
4361 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
4362 eh_frame_plt_got_size.
4363 (elf_i386_non_lazy_plt_layout): New.
4364 (elf_i386_plt_layout): Likewise.
4365 (elf_i386_non_lazy_plt): Likewise.
4366 (GET_PLT_ENTRY_SIZE): Removed.
4367 (elf_i386_plt): Renamed to ...
4368 (elf_i386_lazy_plt): This.
4369 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
4370 (elf_i386_arch_bed): Updated.
4371 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
4372 (elf_i386_create_dynamic_sections): Removed.
4373 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
4374 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
4375 (elf_i386_adjust_dynamic_symbol): Updated.
4376 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
4377 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
4378 size for PLT0 if there is no PLT0.
4379 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
4380 output section is discarded only if GOT isn't empty.
4381 (elf_i386_relocate_section): Updated. Properly get PLT index
4382 if there is no PLT0.
4383 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
4384 second and third slots in the PLT entry if there is no PLT0.
4385 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
4386 if there is no PLT0. Set sh_entsize on the .plt.got section.
4387 (elf_i386_nacl_plt): Forward declaration.
4388 (elf_i386_get_plt_sym_val): Removed.
4389 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
4390 against all dynamic relocations.
4391 (elf_i386_link_setup_gnu_properties): New function.
4392 (elf_backend_create_dynamic_sections): Updated.
4393 (elf_backend_setup_gnu_properties): New.
4394 (elf_i386_nacl_plt): Updated.
4395 (elf_i386_nacl_arch_bed): Likewise.
4396 (elf_i386_vxworks_arch_bed): Likewise.
4397
4398 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
4399
4400 * elflink.c (elf_output_implib): Remove executable flag from import
4401 library bfd.
4402 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
4403 library is a relocatable object file.
4404
4405 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
4406
4407 PR ld/21404
4408 * elf32-avr.c (avr_should_move_sym): New function.
4409 (avr_should_reduce_sym_size): Likewise.
4410 (avr_should_increase_sym_size): Likewise.
4411 (elf32_avr_relax_delete_bytes): Adjust symbol values
4412 and sizes by calling new functions.
4413
4414 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
4415
4416 * config.bfd (riscv32-*): Enable rv64.
4417
4418 2017-05-02 Alan Modra <amodra@gmail.com>
4419
4420 PR 21384
4421 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
4422 rather than h->root.type == bfd_link_hash_new.
4423 (bfd_elf_record_link_assignment): Similarly, call
4424 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
4425
4426 2017-04-29 Alan Modra <amodra@gmail.com>
4427
4428 PR 21432
4429 * reloc.c (reloc_offset_in_range): New function.
4430 (bfd_perform_relocation, bfd_install_relocation): Use it.
4431 (_bfd_final_link_relocate): Likewise.
4432
4433 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
4434
4435 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
4436 before using .plt.got.
4437 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
4438
4439 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4440
4441 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
4442 instead of "+=" to update 0.
4443
4444 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4445
4446 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
4447 .plt.got section here.
4448 (elf_i386_check_relocs): Don't create the .plt.got section.
4449 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
4450 the .plt.got and .plt.bnd sections here.
4451 (elf_x86_64_check_relocs): Don't create the .plt.got nor
4452 .plt.bnd sections.
4453
4454 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4455
4456 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
4457 has_bnd_reloc.
4458 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
4459 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
4460 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
4461 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
4462 has_bnd_reloc.
4463
4464 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4465
4466 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
4467 to return bfd *.
4468 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
4469 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
4470 the first relocatable ELF input with GNU properties.
4471
4472 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4473
4474 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
4475 VxWorks for non-PIC.
4476
4477 2017-04-27 Alan Modra <amodra@gmail.com>
4478
4479 * elf-bfd.h (struct elf_backend_data): Make asection param of
4480 elf_backend_eh_frame_address_size const.
4481 (_bfd_elf_eh_frame_address_size): Likewise.
4482 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
4483 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
4484 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
4485 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
4486 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
4487 (next_cie_fde_offset): Constify params.
4488 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
4489
4490 2017-04-27 Alan Modra <amodra@gmail.com>
4491
4492 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
4493 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
4494 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
4495 aug_data_len.
4496 (offset_adjust): New function.
4497 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
4498 (adjust_eh_frame_local_symbols): Likewise.
4499 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
4500 after changing anything. Return true if anything changed.
4501 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
4502 _bfd_elf_adjust_eh_frame_global_symbol for globals.
4503
4504 2017-04-27 Alan Modra <amodra@gmail.com>
4505
4506 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4507 when force_local.
4508
4509 2017-04-27 Alan Modra <amodra@gmail.com>
4510
4511 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4512 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
4513 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
4514 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
4515 for undef and undefweak dyn_relocs.
4516 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4517 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
4518 (allocate_got, allocate_dynrelocs): Likewise.
4519 (ppc64_elf_relocate_section): Likewise.
4520
4521 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
4522
4523 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
4524 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
4525 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
4526 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
4527
4528 2017-04-26 Nick Clifton <nickc@redhat.com>
4529
4530 PR binutils/21434
4531 * reloc.c (bfd_perform_relocation): Check for a negative address
4532 in the reloc.
4533
4534 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4535
4536 PR ld/21334
4537 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
4538 member.
4539 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
4540 (elf_backend_always_renumber_dynsyms): Define.
4541 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
4542 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
4543 * elflink.c (bfd_elf_size_dynamic_sections): Also call
4544 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
4545 it.
4546 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4547
4548 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4549
4550 * elflink.c (bfd_elf_size_dynamic_sections): Only call
4551 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
4552 sections have been created.
4553
4554 2017-04-26 Nick Clifton <nickc@redhat.com>
4555
4556 PR binutils/21431
4557 * compress.c (bfd_init_section_compress_status): Check the return
4558 value from bfd_malloc.
4559
4560 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4561
4562 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
4563 no_finish_dynamic_symbol.
4564 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
4565 0.
4566 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
4567 weak symbol, don't make it dynamic.
4568 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
4569 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
4570 relocation for GOT reference.
4571 (elf_x86_64_finish_dynamic_symbol): Abort if
4572 no_finish_dynamic_symbol isn't 0.
4573
4574 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4575
4576 PR ld/21402
4577 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4578 undefined weak symbol, don't make it dynamic.
4579 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4580 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4581 relocation for R_386_GOT32.
4582
4583 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4584
4585 PR ld/21425
4586 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4587
4588 2017-04-23 Alan Modra <amodra@gmail.com>
4589
4590 PR 21414
4591 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4592 * elf.c (lcomm_sym): New.
4593 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4594 * bfd-in2.h: Regenerate.
4595
4596 2017-04-23 Alan Modra <amodra@gmail.com>
4597
4598 PR 21412
4599 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4600 parameters and comment.
4601 (_bfd_elf_get_reloc_section): Delete.
4602 (_bfd_elf_plt_get_reloc_section): Declare.
4603 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4604 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4605 Extracted from..
4606 (_bfd_elf_get_reloc_section): ..here. Delete.
4607 (assign_section_numbers): Call elf_get_reloc_section.
4608 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4609 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4610
4611 2017-04-23 Alan Modra <amodra@gmail.com>
4612
4613 PR 21409
4614 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4615 no symbols.
4616
4617 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4618
4619 PR ld/21402
4620 * elf32-i386.c (elf_i386_link_hash_entry): Add
4621 no_finish_dynamic_symbol.
4622 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4623 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4624 symbol, don't make it dynamic in PIE.
4625 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4626 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4627 relocation for R_386_GOT32
4628 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4629 isn't 0.
4630
4631 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4632
4633 PR ld/19617
4634 PR ld/21086
4635 * elflink.c (elf_link_add_object_symbols): Require
4636 --no-dynamic-linker with -E/--dynamic-list when creating
4637 dynamic sections.
4638
4639 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4640
4641 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4642 if forced local.
4643
4644 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4645
4646 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4647 dynamic symbol sorting.
4648
4649 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4650
4651 PR ld/21382
4652 * elflink.c (elf_link_add_object_symbols): Preserve
4653 dynamic_ref_after_ir_def when restoring the symbol table for
4654 unneeded dynamic object.
4655
4656 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4657
4658 PR ld/21401
4659 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4660 on on undefined IFUNC symbol in the second PLT.
4661
4662 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4663
4664 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4665
4666 2017-04-19 Alan Modra <amodra@gmail.com>
4667
4668 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4669 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4670 * elf32-ppc.c:Formatting.
4671 (ensure_undefweak_dynamic): Don't make dynamic when
4672 info->dynamic_undefined_weak is zero.
4673 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4674 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4675 not default visibility. Discard undef and undefweak
4676 dyn_relocs earlier.
4677 (ppc_elf_relocate_section): Adjust to suit.
4678 * elf64-ppc.c: Formatting.
4679 (ensure_undefweak_dynamic): Don't make dynamic when
4680 info->dynamic_undefined_weak is zero.
4681 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4682 info->dynamic_undefined_weak. Discard them earlier.
4683
4684 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4685
4686 PR ld/21389
4687 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4688 before generating the version definition section.
4689
4690 2017-04-17 Alan Modra <amodra@gmail.com>
4691
4692 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4693 state when a regular object file defines a symbol with
4694 incompatible type to that defined by an earlier shared lib.
4695
4696 2017-04-13 Alan Modra <amodra@gmail.com>
4697
4698 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4699 * elf.c: Likewise.
4700 * elf32-arm.c: Likewise.
4701 * elf32-i386.c: Likewise.
4702 * elf32-mep.c: Likewise.
4703 * elf64-ia64-vms.c: Likewise.
4704 * elf64-x86-64.c: Likewise.
4705 * elflink.c: Likewise.
4706 * elfnn-ia64.c: Likewise.
4707 * elfxx-mips.c: Likewise.
4708
4709 2017-04-13 Alan Modra <amodra@gmail.com>
4710
4711 * aoutx.h: Use %B and %A in error messages throughout file.
4712 * aout-cris.c: Likewise.
4713 * archive.c: Likewise.
4714 * binary.c: Likewise.
4715 * coff-rs6000.c: Likewise.
4716 * coff-tic4x.c: Likewise.
4717 * coffcode.h: Likewise.
4718 * coffgen.c: Likewise.
4719 * cofflink.c: Likewise.
4720 * coffswap.h: Likewise.
4721 * cpu-arm.c: Likewise.
4722 * elf-eh-frame.c: Likewise.
4723 * elf-m10300.c: Likewise.
4724 * elf.c: Likewise.
4725 * elf32-arc.c: Likewise.
4726 * elf32-arm.c: Likewise.
4727 * elf32-bfin.c: Likewise.
4728 * elf32-frv.c: Likewise.
4729 * elf32-iq2000.c: Likewise.
4730 * elf32-m32c.c: Likewise.
4731 * elf32-microblaze.c: Likewise.
4732 * elf32-nds32.c: Likewise.
4733 * elf32-rl78.c: Likewise.
4734 * elf32-rx.c: Likewise.
4735 * elf32-score.c: Likewise.
4736 * elf32-score7.c: Likewise.
4737 * elf32-sh64.c: Likewise.
4738 * elf32-v850.c: Likewise.
4739 * elf32-vax.c: Likewise.
4740 * elf32-visium.c: Likewise.
4741 * elf64-ia64-vms.c: Likewise.
4742 * elf64-mmix.c: Likewise.
4743 * elf64-sh64.c: Likewise.
4744 * elfcode.h: Likewise.
4745 * elfnn-aarch64.c: Likewise.
4746 * elfnn-ia64.c: Likewise.
4747 * elfxx-mips.c: Likewise.
4748 * hpux-core.c: Likewise.
4749 * ieee.c: Likewise.
4750 * ihex.c: Likewise.
4751 * linker.c: Likewise.
4752 * merge.c: Likewise.
4753 * mmo.c: Likewise.
4754 * oasys.c: Likewise.
4755 * pdp11.c: Likewise.
4756 * peXXigen.c: Likewise.
4757 * rs6000-core.c: Likewise.
4758 * vms-alpha.c: Likewise.
4759 * xcofflink.c: Likewise.
4760
4761 2017-04-13 Alan Modra <amodra@gmail.com>
4762
4763 * bfd.c (PRINT_TYPE): Define.
4764 (_doprnt): New function.
4765 (error_handler_internal): Use _doprnt.
4766 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4767 calls in their natural order, throughout file.
4768 * coff-mcore.c: Likewise.
4769 * coff-ppc.c: Likewise.
4770 * coff-tic80.c: Likewise.
4771 * cofflink.c: Likewise.
4772 * elf-s390-common.c: Likewise.
4773 * elf.c: Likewise.
4774 * elf32-arm.c: Likewise.
4775 * elf32-i386.c: Likewise.
4776 * elf32-m32r.c: Likewise.
4777 * elf32-msp430.c: Likewise.
4778 * elf32-spu.c: Likewise.
4779 * elf64-ia64-vms.c: Likewise.
4780 * elf64-sparc.c: Likewise.
4781 * elf64-x86-64.c: Likewise.
4782 * elflink.c: Likewise.
4783 * elfnn-aarch64.c: Likewise.
4784 * elfnn-ia64.c: Likewise.
4785 * elfxx-mips.c: Likewise.
4786
4787 2017-04-13 Alan Modra <amodra@gmail.com>
4788
4789 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4790 branch veneers" error. Fix double space and format message.
4791 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4792 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4793
4794 2017-04-13 Alan Modra <amodra@gmail.com>
4795
4796 * bfd-in2.h: Regenerate.
4797
4798 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4799
4800 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4801 extra `\n' in warning/error messages.
4802 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4803 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4804
4805 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4806
4807 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4808 processor-specific properties with generic ELF target vector.
4809
4810 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4811
4812 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4813 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4814 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4815 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4816 has_non_got_reloc.
4817 (link_hash_newfunc): Initialize has_got_reloc and
4818 has_non_got_reloc.
4819 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4820 section.
4821 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4822 has_non_got_reloc.
4823 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4824 has_non_got_reloc.
4825 (_bfd_sparc_elf_fixup_symbol): New function.
4826 (allocate_dynrelocs): Don't allocate space for dynamic
4827 relocations and discard relocations against resolved undefined
4828 weak symbols in executable. Don't make resolved undefined weak
4829 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4830 relocation against undefined weak symbols in PIE.
4831 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4832 relocations against resolved undefined weak symbols in PIE
4833 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4834 without ynamic PLT/GOT relocations for resolved undefined weak
4835 symbols.
4836 Don't generate dynamic relocation against resolved undefined
4837 weak symbol in executable.
4838 (pie_finish_undefweak_symbol): New function.
4839 (_bfd_sparc_elf_finish_dynamic_sections): Call
4840 pie_finish_undefweak_symbol on all symbols in PIE.
4841 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4842 (_bfd_sparc_elf_fixup_symbol): New function.
4843
4844 2017-04-10 Nick Clifton <nickc@redhat.com>
4845
4846 * config.bfd: Remove ns32k from obsolete list.
4847
4848 2017-04-10 Alan Modra <amodra@gmail.com>
4849
4850 PR 21287
4851 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4852 (special_sections_i): Likewise for .init_array.
4853 (special_sections_p): Likewise for .preinit_array.
4854
4855 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4856
4857 PR ld/19579
4858 PR ld/21306
4859 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4860 ELF_COMMON_DEF_P for common symbols.
4861 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4862 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4863 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4864 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4865 07492f668d2173da7a2bda3707ff0985e0f460b6.
4866
4867 2017-04-07 Pedro Alves <palves@redhat.com>
4868
4869 * opncls.c (bfd_get_debug_link_info): Rename to...
4870 (bfd_get_debug_link_info_1): ... this. Change type of second
4871 parameter to void pointer. Adjust.
4872 (bfd_get_debug_link_info): Reimplement on top of
4873 bfd_get_debug_link_info_1.
4874 (separate_debug_file_exists, separate_alt_debug_file_exists):
4875 Change type of second parameter to void pointer. Adjust.
4876 (get_func_type, check_func_type): Change type of second parameter
4877 to void pointer.
4878 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4879 the callback functions instead of passing the address of a local.
4880 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4881 find_separate_debug_file.
4882 (get_alt_debug_link_info_shim): Change type of second parameter to
4883 void pointer. Adjust.
4884 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4885 find_separate_debug_file.
4886 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4887 of second parameter to void pointer. Adjust.
4888 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4889 pointer local to find_separate_debug_file.
4890
4891 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4892
4893 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4894 external symbols with a definition.
4895 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4896
4897 2017-04-07 Alan Modra <amodra@gmail.com>
4898
4899 * po/SRC-POTFILES.in: Regenerate.
4900
4901 2017-04-05 Alan Modra <amodra@gmail.com>
4902
4903 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4904 reference counting.
4905
4906 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4907
4908 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4909 numbers for DataDirectory entry indicies passed to
4910 add_data_entry().
4911
4912 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4913
4914 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4915 each GNU_MBIND section and align GNU_MBIND section to page size.
4916 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4917 segment for each GNU_MBIND section.
4918 (_bfd_elf_init_private_section_data): Copy sh_info from input
4919 for GNU_MBIND section.
4920
4921 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4922
4923 * elfnn-riscv.c (GP_NAME): Delete.
4924 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4925 (_bfd_riscv_relax_lui): Likewise.
4926
4927 2017-04-04 Nick Clifton <nickc@redhat.com>
4928
4929 PR binutils/21342
4930 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4931 dereference.
4932 (bfd_elf_final_link): Only initialize the extended symbol index
4933 section if there are extended symbol tables to list.
4934
4935 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4936
4937 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4938 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4939 * configure.ac (elf): Add elf-properties.lo.
4940 * Makefile.in: Regenerated.
4941 * configure: Likewise.
4942 * elf-bfd.h (elf_property_kind): New.
4943 (elf_property): Likewise.
4944 (elf_property_list): Likewise.
4945 (elf_properties): Likewise.
4946 (_bfd_elf_parse_gnu_properties): Likewise.
4947 (_bfd_elf_get_property): Likewise.
4948 (_bfd_elf_link_setup_gnu_properties): Likewise.
4949 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4950 and setup_gnu_properties.
4951 (elf_obj_tdata): Add properties.
4952 * elf-properties.c: New file.
4953 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4954 (elf_i386_merge_gnu_properties): Likewise.
4955 (elf_backend_parse_gnu_properties): Likewise.
4956 (elf_backend_merge_gnu_properties): Likewise.
4957 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4958 (elf_x86_64_merge_gnu_properties): Likewise.
4959 (elf_backend_parse_gnu_properties): Likewise.
4960 (elf_backend_merge_gnu_properties): Likewise.
4961 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4962 (elf_backend_parse_gnu_properties): Likewise.
4963 (elf_backend_setup_gnu_properties): Likewise.
4964 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4965 elf_backend_merge_gnu_properties and
4966 elf_backend_setup_gnu_properties.
4967
4968 2017-03-30 Pip Cet <pipcet@gmail.com>
4969
4970 * elf32-wasm32.c: Add relocation code, two relocs.
4971 * reloc.c: Add wasm32 relocations.
4972 * libbfd.h: Regenerate.
4973 * bfd-in2.h: Regenerate.
4974 * bfd/po/bfd.pot: Regenerate.
4975
4976 2017-03-29 Nick Clifton <nickc@redhat.com>
4977
4978 PR binutils/18025
4979 * coff-bfd.h (struct coff_section_data): Add new fields:
4980 saved_bias and bias.
4981 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4982 computed for PE binaries.
4983 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4984 missing abbrev.
4985
4986 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4987
4988 PR ld/16044
4989 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4990 to handle a local symbol with a hash-symbol-entry; without PLT.
4991 Add BFD_ASSERT for an incidental case with GOT entry present.
4992 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4993 isn't forced-or-set local.
4994
4995 2017-03-27 Pip Cet <pipcet@gmail.com>
4996
4997 * wasm-module.c: New file to support WebAssembly modules.
4998 * wasm-module.h: New file to support WebAssembly modules.
4999 * doc/webassembly.texi: Start documenting wasm-module.c.
5000 * config.bfd: Add wasm_vec.
5001 * targets.c: Likewise.
5002 * configure.ac: Likewise.
5003 * Makefile.am: Add entries for wasm-module.c.
5004 * Makefile.in: Regenerate.
5005 * configure: Regenerate.
5006 * po/SRC-POTFILES.in: Regenerate.
5007
5008 2017-03-27 Pip Cet <pipcet@gmail.com>
5009
5010 * cpu-wasm32.c: New file to support wasm32 architecture.
5011 * elf32-wasm32.c: New file to support wasm32 architecture.
5012 * Makefile.am: Add wasm32 architecture.
5013 * archures.c: Likewise.
5014 * config.bfd: Likewise.
5015 * configure.ac: Likewise.
5016 * targets.c: Likewise.
5017 * Makefile.in: Regenerate.
5018 * bfd-in2.h: Regenerate.
5019 * configure: Regenerate.
5020 * po/SRC-POTFILES.in: Regenerate.
5021
5022 2017-03-20 Alan Modra <amodra@gmail.com>
5023
5024 PR 21266
5025 * elf64-ppc.c (compare_symbols): Stabilize sort.
5026
5027 2017-03-18 Alan Modra <amodra@gmail.com>
5028
5029 * elf64-ppc.c (struct ppc_link_hash_table): Add
5030 local_ifunc_resolver and maybe_local_ifunc_resolver.
5031 (ppc_build_one_stub): Set flags on emitting dynamic
5032 relocation to ifunc.
5033 (ppc64_elf_relocate_section): Likewise.
5034 (ppc64_elf_finish_dynamic_symbol): Likewise.
5035 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
5036 local dynamic relocs to ifuncs.
5037 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
5038 local_ifunc_resolver and maybe_local_ifunc_resolver.
5039 (ppc_elf_relocate_section): Set flag on emitting dynamic
5040 relocation to ifuncs.
5041 (ppc_elf_finish_dynamic_symbol): Likewise.
5042 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
5043 dynamic relocs to ifuncs.
5044
5045 2017-03-13 Nick Clifton <nickc@redhat.com>
5046
5047 PR binutils/21202
5048 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
5049 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
5050 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
5051 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
5052 * bfd-in2.h: Regenerate.
5053 * libbfd.h: Regenerate.
5054 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
5055 names.
5056 (IS_AARCH64_TLSDESC_RELOC): Likewise.
5057 (elfNN_aarch64_howto_table): Likewise.
5058 (aarch64_tls_transition_without_check): Likewise.
5059 (aarch64_reloc_got_type): Likewise.
5060 (elfNN_aarch64_final_link_relocate): Likewise.
5061 (elfNN_aarch64_tls_relax): Likewise.
5062 (elfNN_aarch64_relocate_section): Likewise.
5063 (elfNN_aarch64_gc_sweep_hook): Likewise.
5064 (elfNN_aarch64_check_relocs): Likewise.
5065 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
5066 (_bfd_aarch64_elf_resolve_relocation): Likewise.
5067
5068 2017-03-11 Alan Modra <amodra@gmail.com>
5069
5070 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
5071 parameter is in fact used. Whitespace fixes.
5072 * elf64-ppc.c: Likewise.
5073
5074 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
5075
5076 * rs6000-core.c (CORE_NEW): Simplify macro when
5077 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
5078
5079 2017-03-07 Alan Modra <amodra@gmail.com>
5080
5081 PR 21224
5082 PR 20519
5083 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
5084 dyn_relocs check.
5085
5086 2017-03-05 Alan Modra <amodra@gmail.com>
5087
5088 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
5089 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
5090 (next_cie_fde_offset): New function.
5091 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
5092 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
5093 four bytes. Align CIEs to four or eight bytes depending on
5094 per_encoding_aligned8. Align FDEs according to their encoding.
5095 Pad last FDE to output section alignment.
5096 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
5097 assertion.
5098 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
5099 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
5100 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
5101
5102 2017-03-02 Martin Bickel <binutils@ineranves.de>
5103
5104 PR ld/21212
5105 * elf.c (rewrite_elf_program_header): Do not issue a warning for
5106 empty segments which have a zero filesz, but a non-zero memsz.
5107
5108 2017-03-02 Alan Modra <amodra@gmail.com>
5109
5110 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
5111
5112 2017-02-28 Alan Modra <amodra@gmail.com>
5113
5114 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
5115 (ppc64_elf_relocate_section): Likewise.
5116
5117 2017-02-28 Alan Modra <amodra@gmail.com>
5118
5119 PR 20995
5120 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
5121 rather than elf32_nios2_hash_table or elf_hash_table.
5122 (create_got_section): Likewise.
5123 (nios2_elf32_finish_dynamic_symbol): Likewise.
5124 (nios2_elf32_adjust_dynamic_symbol): Likewise.
5125 (nios2_elf32_size_dynamic_sections): Likewise.
5126 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
5127 vars. Use htab equivalents directly instead. Don't create
5128 all dynamic sections on needing just the GOT. Use a goto
5129 rather than a fall-through with reloc test. Ensure
5130 htab->dynobj is set when making dynamic sreloc section.
5131 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
5132 equivalent directly instead. Don't segfault on looking for
5133 .dynamic when dynamic sections have not been created. Don't
5134 segfault on .got.plt being discarded.
5135 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
5136 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
5137 fixme and another not so relevant comment.
5138 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
5139 already set, set hash table dynobj on creating .sbss.
5140
5141 2017-02-28 Alan Modra <amodra@gmail.com>
5142
5143 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
5144 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
5145 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
5146 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
5147 (ppc64_elf_relocate_section): Likewise.
5148 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
5149 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
5150 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
5151 * libbfd.h: Regenerate.
5152 * bfd-in2.h: Regenerate.
5153
5154 2017-02-28 Alan Modra <amodra@gmail.com>
5155
5156 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
5157 dynamic .data.rel.ro read-only.
5158 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
5159 rather than section flags when deciding where copy reloc goes.
5160 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
5161 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
5162 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
5163 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
5164 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
5165 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
5166 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
5167 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
5168 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
5169 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
5170 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
5171 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
5172 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
5173 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
5174 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
5175 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
5176 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
5177 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
5178 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
5179
5180 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
5181
5182 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
5183 `jalr $0, $25' instruction encoding.
5184
5185 2017-02-27 Nick Clifton <nickc@redhat.com>
5186
5187 PR ld/21180
5188 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
5189 generating a seg-fault when encountering a symbol that has been
5190 deleted by garbage collection.
5191
5192 2017-02-25 Alan Modra <amodra@gmail.com>
5193
5194 * elf32-arc.c (struct dynamic_sections): Delete.
5195 (enum dyn_section_types): Delete.
5196 (dyn_section_names): Delete.
5197 (arc_create_dynamic_sections): Delete.
5198 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
5199 segfault on discarded .rela.plt section.
5200 (elf_arc_size_dynamic_sections): Formatting. Don't call
5201 arc_create_dynamic_sections. Don't allocate memory for sections
5202 handled by the generic linker. Correct code finding relocs in
5203 read-only sections. Set SEC_EXCLUDE on zero size .got,
5204 .got.plt, and .dynbss sections. Do set .interp for pies.
5205
5206 2017-02-24 Andrew Waterman <andrew@sifive.com>
5207
5208 * elfnn-riscv.c (GP_NAME): New macro.
5209 (riscv_global_pointer_value): Use it.
5210 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
5211 output section, consider only that section's alignment.
5212
5213 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
5214
5215 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
5216 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
5217 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
5218 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
5219
5220 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
5221
5222 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
5223 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
5224 or misaligned.
5225
5226 2017-02-23 Alan Modra <amodra@gmail.com>
5227
5228 PR 20744
5229 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
5230 16D relocations.
5231 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
5232 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
5233 relocs.
5234
5235 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
5236
5237 PR ld/20828
5238 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
5239 processing ahead of the call to `elf_gc_sweep_symbol'.
5240
5241 2017-02-22 Nick Clifton <nickc@redhat.com>
5242
5243 PR binutils/21193
5244 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
5245 created section 4-byte alignment.
5246
5247 2017-02-22 Alan Modra <amodra@gmail.com>
5248
5249 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
5250 on .got or .plt output section being discarded by script.
5251 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
5252 vxworks splt temp.
5253
5254 2017-02-21 Alan Modra <amodra@gmail.com>
5255
5256 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
5257 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
5258
5259 2017-02-20 Alan Modra <amodra@gmail.com>
5260
5261 PR 21181
5262 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
5263 if DT_RELSZ/DT_RELASZ is zero.
5264
5265 2017-02-17 Nick Clifton <nickc@redhat.com>
5266
5267 * compress.c (bfd_get_full_section_contents): Remember to reduce
5268 compressed size by the sizeof the compression header when
5269 decompressing the contents.
5270
5271 2017-02-17 Pedro Alves <palves@redhat.com>
5272
5273 * srec.c (Chunk): Rename to ...
5274 (_bfd_srec_len): ... this.
5275 (S3Forced): Rename to ...
5276 (_bfd_srec_forceS3): ... this.
5277 * objcopy.c: Adjust all references.
5278
5279 2017-02-17 Pedro Alves <palves@redhat.com>
5280
5281 * archive.c (bsd_write_armap): Rename to ...
5282 (_bfd_bsd_write_armap): ... this.
5283 (coff_write_armap): Rename to ...
5284 (_bfd_coff_write_armap): ... this.
5285 * libbfd-in.h (bsd_write_armap): Rename to ...
5286 (_bfd_bsd_write_armap): ... this.
5287 (coff_write_armap): Rename to ...
5288 (_bfd_coff_write_armap): ... this.
5289 * aout-target.h, aout-tic30.c: Adjust all users.
5290 * libbfd.h: Regenerate.
5291
5292 2017-02-17 Pedro Alves <palves@redhat.com>
5293
5294 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
5295 (warn_deprecated): Rename to ...
5296 (_bfd_warn_deprecated): ... this.
5297 * libbfd.c (warn_deprecated): Rename to ...
5298 (_bfd_warn_deprecated): ... this.
5299 * bfd-in2.h: Regenerate.
5300
5301 2017-02-17 Pedro Alves <palves@redhat.com>
5302
5303 * bfdio.c (real_ftell): Rename to ...
5304 (_bfd_real_ftell): ... this.
5305 (real_fseek): Rename to ...
5306 (_bfd_real_fseek): ... this.
5307 (real_fopen): Rename to ...
5308 (_bfd_real_fopen): ... this.
5309 * libbfd-in.h (real_ftell): Rename to ...
5310 (_bfd_real_ftell): ... this.
5311 (real_fseek): Rename to ...
5312 (_bfd_real_fseek): ... this.
5313 (real_fopen): Rename to ...
5314 (_bfd_real_fopen): ... this.
5315 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
5316 * libbfd.h: Regenerate.
5317
5318 2017-02-17 Pedro Alves <palves@redhat.com>
5319
5320 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
5321 * libbfd.c (read_unsigned_leb128): Rename to ...
5322 (_bfd_read_unsigned_leb128): ... this.
5323 (read_signed_leb128): Rename to ...
5324 (_bfd_read_signed_leb128): ... this.
5325 (safe_read_leb128): Rename to ...
5326 (_bfd_safe_read_leb128): ... this.
5327 * libbfd-in.h (read_unsigned_leb128): Rename to ...
5328 (_bfd_read_unsigned_leb128): ... this.
5329 (read_signed_leb128): Rename to ...
5330 (_bfd_read_signed_leb128): ... this.
5331 (safe_read_leb128): Rename to ...
5332 (_bfd_safe_read_leb128): ... this.
5333 * libbfd.h: Renegerate.
5334
5335 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
5336
5337 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
5338 before trying to fine matching file and line information.
5339
5340 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
5341
5342 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
5343 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
5344 not match current bfd, then reload debug information. Record bfd
5345 we're loading debug info for in the stash. If we have debug
5346 informatin in the cache then perform section placement before
5347 returning.
5348
5349 2017-02-16 Alan Modra <amodra@gmail.com>
5350
5351 PR 21000
5352 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
5353 * elfxx-target.h (elf_backend_no_page_alias): Define.
5354 (elfNN_bed): Init new field.
5355 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
5356 ensure PT_LOAD segment starts on a new page.
5357 * elf32-hppa.c (elf_backend_no_page_alias): Define.
5358
5359 2017-02-16 Alan Modra <amodra@gmail.com>
5360
5361 PR 21132
5362 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
5363 if pic.
5364
5365 2017-02-16 Jiong Wang <jiong.wang@arm.com>
5366
5367 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
5368 * bfd-in2.h: Regenerated.
5369
5370 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5371
5372 PR ld/21168
5373 * elf32-i386.c (elf_i386_relocate_section): Allow
5374 "lea foo@GOT, %reg" in PIC.
5375
5376 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5377
5378 PR ld/20244
5379 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
5380 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
5381 error against local IFUNC symbol without a base register for
5382 PIC.
5383
5384 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
5385
5386 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
5387 `%P: %H:' with `info->callbacks->einfo'.
5388 (ppc_elf_relocate_section): Likewise.
5389 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
5390 (ppc64_elf_edit_toc): Likewise.
5391 (ppc64_elf_relocate_section): Likewise.
5392
5393 2017-02-14 Alan Modra <amodra@gmail.com>
5394
5395 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
5396 --gc-keep-exported, and test versioned field of sym rather than
5397 looking for @ in name.
5398
5399 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
5400
5401 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
5402 __global_pointer$.
5403
5404 2017-02-13 Nick Clifton <nickc@redhat.com>
5405
5406 PR binutils/21151
5407 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
5408 unit length field.
5409
5410 2017-02-07 Andrew Waterman <andrew@sifive.com>
5411
5412 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
5413 entry size if PLT header is written.
5414
5415 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
5416
5417 Fix sparc64 dynamic relocation processing to use the dynamic
5418 symbol count.
5419 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
5420 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
5421 should be used.
5422
5423 2017-02-03 Nick Clifton <nickc@redhat.com>
5424
5425 PR 21096
5426 * coffcode.h (coff_write_object_contents): Enlarge size of
5427 s_name_buf in order to avoid compile time warning about possible
5428 integer truncation.
5429 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
5430 32-bits of insn value before printing into buffer.
5431
5432 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5433
5434 * elfxx-mips.c (mips_elf_hash_sort_data): Add
5435 `max_local_dynindx'.
5436 (mips_elf_sort_hash_table): Handle it.
5437 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
5438 symbols bump up `max_local_dynindx' rather than
5439 `max_non_got_dynindx'.
5440
5441 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5442
5443 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
5444 `min_got_dynindx', `max_unref_got_dynindx' and
5445 `max_non_got_dynindx' members to the `bfd_size_type' data type.
5446 (mips_elf_sort_hash_table): Adjust accordingly.
5447
5448 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5449
5450 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
5451 to access the hash table.
5452
5453 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5454
5455 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
5456 non-NULL `htab' to the beginning.
5457
5458 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5459
5460 * elflink.c (elf_gc_sweep): Wrap overlong line.
5461
5462 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
5463
5464 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
5465 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
5466 * elfxx-mips.c (mips_elf_link_hash_table): Add
5467 `ignore_branch_isa' member.
5468 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
5469 in branch relocation calculation as an error if
5470 `ignore_branch_isa' has been set.
5471 (_bfd_mips_elf_insn32): Rename to...
5472 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
5473 parameter to `insn32' and add an `ignore_branch_isa' parameter.
5474 Handle the new parameter.
5475
5476 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
5477
5478 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
5479 local variable dynobj.
5480
5481 PR ld/20995
5482 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
5483 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
5484 executable from read-only sections into sdynrelro.
5485 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
5486 dynamic relocs in sdynrelro.
5487 (elf_backend_want_dynrelro): Define.
5488
5489 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5490
5491 * config.bfd (*-*-rtemsaout*): Mark as removed.
5492
5493 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5494
5495 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
5496 (arm-*-rtems*): Move to (arm*-*-eabi*).
5497 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
5498 (m68-*-rtems*): Move to (m68*-*-elf*).
5499
5500 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5501
5502 * config.bfd (*-*-rtemscoff*): Mark as removed.
5503
5504 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5505
5506 PR ld/20828
5507 * elflink.c (bfd_elf_record_link_assignment): Revert last
5508 change and don't ever clear `forced_local'. Set `mark'
5509 unconditionally.
5510 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
5511 file.
5512 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
5513 (bfd_elf_size_dynamic_sections): ... here.
5514 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
5515 and set `mark' instead in `__tls_get_addr_opt' processing.
5516 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
5517
5518 2017-01-24 Alan Modra <amodra@gmail.com>
5519
5520 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
5521 where dynamic relocs are preferable. Allow ifunc too.
5522 (ensure_undefweak_dynamic): New function.
5523 (allocate_dynrelocs): Use it here. Move plt handling last and
5524 don't make symbols dynamic, simplifying loop. Only make undef
5525 weak symbols with GOT entries dynamic. Correct condition
5526 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
5527 comments. Remove goto.
5528 (ppc_elf_relocate_section): Correct test for using dynamic
5529 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5530 to suit. Set up explicit tls_index entries and implicit GOT
5531 tls_index entries resolvable at link time for
5532 __tls_get_addr_opt. Simplify test to clear mem for prelink.
5533 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
5534 (ensure_undefweak_dynamic): New function.
5535 (allocate_dynrelocs): Use it here. Only make undef weak symbols
5536 with GOT entries dynamic. Remove unnecessary test of
5537 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
5538 (ppc64_elf_relocate_section): Correct test for using dynamic
5539 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5540 to suit. Set up explicit tls_index entries and implicit GOT
5541 tls_index entries resolvable at link time for __tls_get_addr_opt.
5542 Simplify expression to clear mem for prelink.
5543
5544 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5545
5546 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5547
5548 2017-01-20 Jiong Wang <jiong.wang@arm.com>
5549
5550 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5551 (elf_backend_hash_symbol): Define.
5552
5553 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5554
5555 PR ld/20828
5556 * elflink.c (bfd_elf_record_link_assignment): Clear any
5557 `forced_local' marking for DSO symbols that are not being
5558 provided.
5559
5560 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5561
5562 * elfnn-riscv.c (riscv_elf_object_p): New function.
5563
5564 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5565
5566 PR ld/21038
5567 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5568 plt_bnd_eh_frame.
5569 (elf_x86_64_check_relocs): Create .eh_frame section for the
5570 .plt.bnd section.
5571 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5572 .eh_frame section for the .plt.bnd section.
5573 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5574 for the .plt.bnd section.
5575
5576 2017-01-12 Nick Clifton <nickc@redhat.com>
5577
5578 PR binutils/20876
5579 * opncls.c (find_separate_debug_file): Add include_dirs
5580 parameter. Only include the directory part of the bfd's filename
5581 in search paths if include_dirs is true. Add a couple of extra
5582 locations for looking for debug files.
5583 ( bfd_follow_gnu_debuglink): Update invocation of
5584 find_separate_debug_file.
5585 (bfd_follow_gnu_debugaltlink): Likewise.
5586 (get_build_id): New function: Finds the build-id of the given bfd.
5587 (get_build_id_name): New function: Computes the name of the
5588 separate debug info file for a bfd, based upon its build-id.
5589 (check_build_id_file): New function: Checks to see if a separate
5590 debug info file exists at the given location, and that its
5591 build-id matches that of the original bfd.
5592 (bfd_follow_build_id_debuglink): New function: Finds a separate
5593 debug info file for a given bfd by using the build-id method.
5594 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5595 method of locating a separate debug info file before using the
5596 debuglink method.
5597 * bfd-in2.h: Regenerate.
5598
5599 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5600
5601 PR ld/21038
5602 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5603 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5604 elf_x86_64_eh_frame_plt_got.
5605 (elf_x86_64_size_dynamic_sections): Get unwind info from
5606 elf_x86_64_bnd_arch_bed for the BND PLT.
5607
5608 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5609
5610 * config.bfd: Add entries for i686-redox and x86_64-redox.
5611
5612 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5613
5614 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5615 to 4 bytes.
5616 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5617 .eh_frame section to 4 bytes for x32.
5618 (elf_x86_64_check_relocs): Likewise.
5619
5620 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5621
5622 PR ld/20830
5623 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5624 (PLT_GOT_FDE_LENGTH): Likewise.
5625 (elf_i386_plt_layout): Add eh_frame_plt_got and
5626 eh_frame_plt_got_size.
5627 (elf_i386_plt): Updated.
5628 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5629 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5630 (elf_i386_size_dynamic_sections): Allocate and initialize
5631 .eh_frame section for .plt.got.
5632 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5633 .plt.got.
5634 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5635 eh_frame_plt_got_size.
5636 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5637 (PLT_GOT_FDE_LENGTH): Likewise.
5638 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5639 eh_frame_plt_got_size.
5640 (elf_x86_64_arch_bed): Updated.
5641 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5642 eh_frame_plt_got_size.
5643 (elf_x86_64_nacl_arch_bed): Likewise.
5644 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5645 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5646 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5647 .eh_frame section for .plt.got.
5648 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5649 for .plt.got.
5650
5651 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5652
5653 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5654 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5655
5656 2017-01-09 Nick Clifton <nickc@redhat.com>
5657
5658 * dwarf2.c (lookup_address_in_function_table): Return early if
5659 there are no functions in the given comp unit, or if the high
5660 address of the last function in the comp unit is less than the
5661 desired address.
5662
5663 2017-01-09 Nick Clifton <nickc@redhat.com>
5664
5665 PR binutils/21013
5666 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5667 message if there are too many symbols to load.
5668
5669 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5670
5671 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5672 if relocs are cached.
5673
5674 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5675
5676 PR ld/21017
5677 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5678 for R_MICROBLAZE_GOTOFF_64.
5679
5680 2017-01-03 Nick Clifton <nickc@redhat.com>
5681
5682 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5683 warning about using a possibly uninitialised variable.
5684
5685 2017-01-02 Alan Modra <amodra@gmail.com>
5686
5687 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5688 (allocate_plt_static, allocate_dynrelocs): Use it.
5689
5690 2017-01-02 Alan Modra <amodra@gmail.com>
5691
5692 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5693 .PARISC.unwind section.
5694
5695 2017-01-02 Alan Modra <amodra@gmail.com>
5696
5697 PR ld/20989
5698 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5699 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5700 indirect to GOT pointer relative code edit.
5701
5702 2017-01-02 Alan Modra <amodra@gmail.com>
5703
5704 Update year range in copyright notice of all files.
5705
5706 For older changes see ChangeLog-2016
5707 \f
5708 Copyright (C) 2017 Free Software Foundation, Inc.
5709
5710 Copying and distribution of this file, with or without modification,
5711 are permitted in any medium without royalty provided the copyright
5712 notice and this notice are preserved.
5713
5714 Local Variables:
5715 mode: change-log
5716 left-margin: 8
5717 fill-column: 74
5718 version-control: never
5719 End:
This page took 0.238151 seconds and 4 git commands to generate.