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