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