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