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