mach-o: use a per-target reloc canonicalize function.
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2015-11-18 Alan Modra <amodra@gmail.com>
2
3 PR 19256
4 * archive.c (bfd_generic_openr_next_archived_file): Don't allow
5 backward file movement via "negative" sizes.
6 * coff-alpha.c (alpha_ecoff_openr_next_archived_file): Likewise.
7
8 2015-11-18 Tristan Gingold <gingold@adacore.com>
9
10 * mach-o.h (bfd_mach_o_swap_in_non_scattered_reloc)
11 (bfd_mach_o_canonicalize_non_scattered_reloc)
12 (bfd_mach_o_pre_canonicalize_one_reloc): Declare.
13 (bfd_mach_o_backend_data): Rename field
14 _bfd_mach_o_swap_reloc_in to _bfd_mach_o_canonicalize_one_reloc.
15 * mach-o.c (bfd_mach_o_swap_in_non_scattered_reloc): Now public.
16 (bfd_mach_o_canonicalize_non_scattered_reloc): Renames from
17 bfd_mach_o_canonicalize_one_reloc.
18 (bfd_mach_o_pre_canonicalize_one_reloc): New function.
19 (bfd_mach_o_canonicalize_relocs): Adjust.
20 (bfd_mach_o_canonicalize_relocs): Rename define from
21 bfd_mach_o_swap_reloc_in.
22 * mach-o-target.c (TARGET_NAME_BACKEND): Use
23 bfd_mach_o_canonicalize_one_reloc instead of
24 bfd_mach_o_swap_reloc_in.
25 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Renames
26 from bfd_mach_o_i386_swap_reloc_in and adjust.
27 (bfd_mach_o_canonicalize_one_reloc): Renames from
28 bfd_mach_o_i386_canonicalize_one_reloc.
29 * mach-o-x86_64.c (bfd_mach_o_x86_64_canonicalize_one_reloc): Renames
30 from bfd_mach_o_x86_64_swap_reloc_in and adjust.
31 (bfd_mach_o_canonicalize_one_reloc): Renames from
32 bfd_mach_o_x86_64_canonicalize_one_reloc.
33
34 2015-11-18 Tristan Gingold <gingold@adacore.com>
35
36 * mach-o.h (struct mach_o_data_struct): Add hdr_offset field.
37 (bfd_mach_o_fat_archive_p): Renames prototype.
38 (bfd_mach_o_fat_openr_next_archived_file): Renames.
39 (bfd_mach_o_header_p): Add argument.
40 * mach-o.c (bfd_mach_o_read_header): Add hdr_off argument and
41 use it.
42 (bfd_mach_o_read_section_32, bfd_mach_o_read_section_64)
43 (bfd_mach_o_read_section): Remove offset argument.
44 (bfd_mach_o_read_dylinker): Remove bfd_seek call.
45 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib)
46 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints)
47 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab)
48 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid)
49 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str)
50 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min)
51 (bfd_mach_o_read_encryption_info): Likewise.
52 (bfd_mach_o_read_encryption_info_64): New function.
53 (bfd_mach_o_read_main, bfd_mach_o_read_source_version)
54 (bfd_mach_o_read_segment): Remove call to bfd_seek.
55 (bfd_mach_o_read_command): Use hdr_offset in bfd_seek.
56 Handle BFD_MACH_O_LC_LINKER_OPTIMIZATION_HINT,
57 BFD_MACH_O_LC_ENCRYPTION_INFO_64, BFD_MACH_O_LC_VERSION_MIN_WATCHOS.
58 (bfd_mach_o_header_p): Add hdr_off argument.
59 (bfd_mach_o_gen_object_p, bfd_mach_o_gen_core_p): Adjust calls.
60 (bfd_mach_o_fat_archive_p): Renames.
61 (bfd_mach_o_fat_openr_next_archived_file): Renames.
62 (bfd_mach_o_close_and_cleanup): Remove useless code.
63 (bfd_mach_o_close_and_cleanup): Define.
64 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p)
65 (bfd_mach_o_x86_64_core_p): Adjust calls.
66 * mach-o-target.c: Move defines for archive from mach-o.c.
67 Remove check on TARGET_ARCHIVE.
68 * mach-o-i386.c (bfd_mach_o_i386_object_p)
69 (bfd_mach_o_i386_core_p): Adjust calls.
70
71 2015-11-17 Christophe Lyon <christophe.lyon@linaro.org>
72
73 * elf32-arm.c (elf32_arm_write_section): Force offset output as
74 long (%ld).
75
76 2015-11-13 Tristan Gingold <gingold@adacore.com>
77
78 * version.m4: Bump version to 2.26.51
79 * configure: Regenerate.
80
81 2015-11-11 Alan Modra <amodra@gmail.com>
82 Peter Bergner <bergner@vnet.ibm.com>
83
84 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_REL16DX_HA.
85 (ppc_elf_reloc_type_lookup): Handle R_PPC_REL16DX_HA.
86 (ppc_elf_addr16_ha_reloc): Likewise.
87 (ppc_elf_check_relocs): Likewise.
88 (ppc_elf_relocate_section): Likewise.
89 (is_insn_dq_form): Handle lxv and stxv instructions.
90 * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_REL16DX_HA.
91 (ppc64_elf_reloc_type_lookup): Handle R_PPC64_REL16DX_HA.
92 (ppc64_elf_ha_reloc): Likewise.
93 (ppc64_elf_check_relocs): Likewise.
94 (ppc64_elf_relocate_section): Likewise.
95 * bfd-in2.h: Regenerate.
96 * libbfd.h: Likewise.
97 * reloc.c (BFD_RELOC_PPC_REL16DX_HA): New.
98
99 2015-11-10 H.J. Lu <hongjiu.lu@intel.com>
100
101 * elf32-i386.c (elf_i386_relocate_section): Handle VTINHERIT
102 and VTENTRY relocations when deleting relocations.
103 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
104
105 2015-11-10 H.J. Lu <hongjiu.lu@intel.com>
106
107 * elf32-i386.c (elf_i386_relocate_section): Properly move
108 kept relocations when deleting relocations.
109 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
110
111 2015-11-09 H.J. Lu <hongjiu.lu@intel.com>
112
113 * elf32-i386.c (elf_i386_relocate_section): Use read and write
114 pointers to reloc array, rather than memmove when deleting a
115 reloc. Don't use RELOC_AGAINST_DISCARDED_SECTION. Adjust
116 reloc counts at end of loop.
117 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
118
119 2015-11-10 Alan Modra <amodra@gmail.com>
120
121 * elf64-ppc.c (ppc64_elf_relocate_section): Use read and write
122 pointers to reloc array, rather than memmove when deleting a
123 reloc. Don't use RELOC_AGAINST_DISCARDED_SECTION. Adjust
124 reloc counts at end of loop.
125 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
126
127 2015-11-09 Dominik Vogt <vogt@linux.vnet.ibm.com>
128
129 * elf64-ppc.c (ppc64_elf_size_stubs, ppc64_elf_build_stubs): Fix left
130 shift of negative value.
131 * libbfd.c (safe_read_leb128): Likewise.
132 * dwarf2.c (place_sections): Likewise.
133 * bfd-in.h (align_power): Likewise.
134 * bfd-in2.h (align_power): Likewise.
135
136 2015-10-30 Nick Clifton <nickc@redhat.com>
137
138 * po/zh_CN.po: Updated (simplified) Chinese translation.
139
140 2015-10-29 Catherine Moore <clm@codesourcery.com>
141
142 * elfxx-mips.c (mips_elf_check_mips16_stubs): Set a stub's output
143 section to bfd_abs_section_ptr if the stub is discarded.
144
145 2015-10-29 Ed Schouten <ed@nuxi.nl>
146
147 * config.bfd (targ_defvec): Add support for CloudABI on aarch64.
148 For this target we have to make sure we use ELFOSABI_CLOUDABI
149 instead of ELFOSABI_NONE.
150 * configure.ac (tb): Likewise.
151 * elfnn-aarch64.c: Likewise.
152 * targets.c (_bfd_target_vector): Likewise.
153 * configure: Regenerate.
154
155 2015-10-29 Pedro Alves <palves@redhat.com>
156
157 * libhppa.h (bfd_hppa_insn2fmt): Add cast.
158
159 2015-10-28 H.J. Lu <hongjiu.lu@intel.com>
160
161 * elf32-i386.c (elf_i386_relocate_section): Fix a typo in
162 comment.
163
164 2015-10-28 Nick Clifton <nickc@redhat.com>
165
166 * elf32-arm.c (create_instruction_branch_absolute): Replace
167 pointer parameters with a simple integer parameter.
168 (stm32l4xx_create_replacing_stub_ldmia): Update calls to
169 create_instruction_branch_absolute.
170 (stm32l4xx_create_replacing_stub_ldmdb): Likewise.
171 (stm32l4xx_create_replacing_stub_vldm): Likewise.
172 (elf32_arm_write_section): Use pointer type for veneer addresses.
173
174 2015-10-28 Cupertino Miranda <cmiranda@synopsys.com>
175
176 * reloc.c (BFD_RELOC_ARC_32_PCREL): New entry.
177 * elf32-arc.c (arc_elf_howto_ini): Update formula.
178 (get_middle_endian_relocation): New function.
179 (PDATA): Define.
180 * bfd-in2.h: Regenerate.
181 * libbfd.h: Likewise.
182
183 2015-10-28 Alan Modra <amodra@gmail.com>
184
185 PR ld/19162
186 * elflink.c (_bfd_elf_gc_mark_reloc): Move code iterating over
187 linker input bfds..
188 * section.c (bfd_get_next_section_by_name): ..to here. Add ibfd param.
189 (bfd_get_linker_section): Adjust bfd_get_next_section_by_name call.
190 * tekhex.c (first_phase): Likewise.
191 * elflink.c (bfd_elf_gc_sections): Likewise.
192 * bfd-in2.h: Regenerate.
193
194 2015-10-27 Laurent Alfonsi <laurent.alfonsi@st.com>
195 Christophe Monat <christophe.monat@st.com>
196
197 * bfd-in2.h: Regenerate.
198 * bfd-in.h (bfd_arm_stm32l4xx_fix): New enum. Specify how
199 STM32L4XX instruction scanning should be done.
200 (bfd_elf32_arm_set_stm32l4xx_fix)
201 (bfd_elf32_arm_stm32l4xx_erratum_scan)
202 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Add prototypes.
203 (bfd_elf32_arm_set_target_relocs): Add stm32l4xx fix type argument
204 to prototype.
205 * elf32-arm.c (STM32L4XX_ERRATUM_VENEER_SECTION_NAME)
206 (STM32L4XX_ERRATUM_VENEER_ENTRY_NAME): Define macros.
207 (elf32_stm32l4xx_erratum_type): New enum.
208 (elf32_stm32l4xx_erratum_list): New struct. List of veneers or
209 jumps to veneers.
210 (_arm_elf_section_data): Add stm32l4xx_erratumcount,
211 stm32l4xx_erratumlist.
212 (elf32_arm_link_hash_table): Add stm32l4xx_erratum_glue_size,
213 stm32l4xx_fix and num_stm32l4xx_fixes fields.
214 (ctz): New function.
215 (popcount): New function.
216 (elf32_arm_link_hash_table_create): Initialize stm32l4xx_fix.
217 (put_thumb2_insn): New function.
218 (STM32L4XX_ERRATUM_LDM_VENEER_SIZE): Define. Size of a veneer for
219 LDM instructions.
220 (STM32L4XX_ERRATUM_VLDM_VENEER_SIZE): Define. Size of a veneer for
221 VLDM instructions.
222 (bfd_elf32_arm_allocate_interworking_sections): Initialise erratum
223 glue section.
224 (record_stm32l4xx_erratum_veneer) : New function. Create a single
225 veneer, and its associated symbols.
226 (bfd_elf32_arm_add_glue_sections_to_bfd): Add STM32L4XX erratum glue.
227 (bfd_elf32_arm_set_stm32l4xx_fix): New function. Set the type of
228 erratum workaround required.
229 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): New function. Find
230 out where veneers and branches to veneers have been placed in
231 virtual memory after layout.
232 (is_thumb2_ldmia): New function.
233 (is_thumb2_ldmdb): Likewise.
234 (is_thumb2_vldm ): Likewise.
235 (stm32l4xx_need_create_replacing_stub): New function. Decide if a
236 veneer must be emitted.
237 (bfd_elf32_arm_stm32l4xx_erratum_scan): Scan the sections of an
238 input BFD for potential erratum-triggering insns. Record results.
239 (bfd_elf32_arm_set_target_relocs): Set stm32l4xx_fix field in
240 global hash table.
241 (elf32_arm_size_dynamic_sections): Collect glue information.
242 (create_instruction_branch_absolute): New function.
243 (create_instruction_ldmia): Likewise.
244 (create_instruction_ldmdb): Likewise.
245 (create_instruction_mov): Likewise.
246 (create_instruction_sub): Likewise.
247 (create_instruction_vldmia): Likewise.
248 (create_instruction_vldmdb): Likewise.
249 (create_instruction_udf_w): Likewise.
250 (create_instruction_udf): Likewise.
251 (push_thumb2_insn32): Likewise.
252 (push_thumb2_insn16): Likewise.
253 (stm32l4xx_fill_stub_udf): Likewise.
254 (stm32l4xx_create_replacing_stub_ldmia): New function. Expands the
255 replacing stub for ldmia instructions.
256 (stm32l4xx_create_replacing_stub_ldmdb): Likewise for ldmdb.
257 (stm32l4xx_create_replacing_stub_vldm): Likewise for vldm.
258 (stm32l4xx_create_replacing_stub): New function. Dispatches the
259 stub emission to the appropriate functions.
260 (elf32_arm_write_section): Output veneers, and branches to veneers.
261
262 2015-10-27 Sangamesh Mallayya <nickc@redhat.com>sangamesh.swamy@in.ibm.com>
263
264 * configure.ac (powerpc64-*-aix[5-9].*): Match powerpc64 running
265 aix for core file support.
266 * configure: Regenerate.
267 * rs6000-core.c: Check for __ld_info64 if compiling 64-bit gdb.
268 Added BFD64 check if we are using old core file format for 32-bit gdb.
269 Set sizeof CORE_COMMONSZ appropriately in case of either new or
270 old core file format.
271 (read_hdr): Added BFD64 check for 64-bit support.
272 (rs6000coff_core_p): Likewise.
273 (rs6000coff_core_file_matches_executable_p): Likewise.
274 (rs6000coff_core_file_failing_command): Likewise.
275 (rs6000coff_core_file_failing_signal): Likewise.
276 Add support for debugging core files generated by binaries in
277 Large Memory model.
278 (rs6000coff_core_p): If Large Memory Model is used, then the .data
279 segment should start from BDATAORG which has been defined in the
280 system header files.
281
282 2015-10-26 H.J. Lu <hongjiu.lu@intel.com>
283
284 PR ld/19175
285 * elf32-i386.c (elf_i386_convert_load): Check bfd_link_hash_new
286 instead of calling bfd_link_get_defined_symbol.
287 * elf64-x86-64.c (elf_x86_64_convert_load): Likewise. Skip
288 relocation overflow for bfd_link_hash_new.
289 * linker.c (bfd_link_get_defined_symbol): Removed.
290 * bfd-in2.h: Regenerated.
291
292 2015-10-26 H.J. Lu <hongjiu.lu@intel.com>
293
294 PR ld/19171
295 * elf32-i386.c (elf_i386_convert_load): Call
296 bfd_link_get_defined_symbol to check if a symbol is defined.
297 * elf64-x86-64.c (elf_x86_64_convert_load): Call
298 bfd_link_get_defined_symbol to get defined symbol section and
299 value.
300 * linker.c (bfd_link_get_defined_symbol): New function.
301 * bfd-in2.h: Regenerated.
302
303 2015-10-23 Alan Modra <amodra@gmail.com>
304
305 PR ld/11133
306 PR ld/19161
307 PR ld/19167
308 * elflink.c (_bfd_elf_gc_mark_hook): Delete code handling __start_*
309 and __stop_* symbol refs.
310 (_bfd_elf_gc_mark_rsec): Add start_stop parameter. Handle __start_*
311 and __stop_* symbol refs here..
312 (_bfd_elf_gc_mark_reloc): ..and here.
313 * elf-bfd.h (_bfd_elf_gc_mark_hook): Update prototype.
314 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Update
315 _bfd_elf_gc_mark_rsec call.
316
317 2015-10-23 Alan Modra <amodra@gmail.com>
318
319 PR ld/11133
320 PR ld/19161
321 * elflink.c (elf_gc_sweep): Revert last patch.
322 (_bfd_elf_gc_mark_hook): Don't set SEC_KEEP here.
323
324 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
325
326 PR ld/19161
327 * elflink.c (elf_gc_sweep): Always keep sections marked with
328 SEC_KEEP.
329
330 2015-10-22 Hans-Peter Nilsson <hp@bitrange.com>
331
332 * mmo.c (struct mmo_data_struct): New members
333 symbol_consistency_override_calculated and ignore_symbol_consistency.
334 (mmo_section_has_contents, mmo_ignore_symbol_consistency): New
335 functions.
336 (mmo_create_symbol): Check with mmo_ignore_symbol_consistency if to
337 report an error for unexpected value of Main.
338 (mmo_write_symbols_and_terminator): Similar.
339
340 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
341
342 * elf32-i386.c (elf_i386_convert_load): Use call_nop_byte and
343 check call_nop_as_suffix for 1-byte NOP padding to pad call.
344 * elf64-x86-64.c (elf_x86_64_convert_load): Likewise.
345
346 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
347
348 * elf64-x86-64.c: Include opcode/i386.h.
349 (x86_64_elf_howto_table): Add R_X86_64_GOTPCRELX and
350 R_X86_64_REX_GOTPCRELX.
351 (R_X86_64_standard): Replace R_X86_64_PLT32_BND with
352 R_X86_64_REX_GOTPCRELX.
353 (x86_64_reloc_map): Add BFD_RELOC_X86_64_GOTPCRELX and
354 BFD_RELOC_X86_64_REX_GOTPCRELX.
355 (need_convert_mov_to_lea): Renamed to ...
356 (need_convert_load): This.
357 (elf_x86_64_check_relocs): Handle R_X86_64_GOTPCRELX and
358 R_X86_64_REX_GOTPCRELX. Replace need_convert_mov_to_lea with
359 need_convert_load.
360 (elf_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPCRELX and
361 R_X86_64_REX_GOTPCRELX.
362 (elf_x86_64_size_dynamic_sections): Likewise.
363 (elf_x86_64_relocate_section): Likewise.
364 (elf_x86_64_convert_mov_to_lea): Renamed to ...
365 (elf_x86_64_convert_load): This. Replace need_convert_mov_to_lea
366 with need_convert_load. Support R_X86_64_GOTPCRELX and
367 R_X86_64_REX_GOTPCRELX transformations.
368 * reloc.c (BFD_RELOC_X86_64_GOTPCRELX): New.
369 (BFD_RELOC_X86_64_REX_GOTPCRELX): Likewise.
370 * bfd-in2.h: Regenerated.
371 * libbfd.h: Likewise.
372
373 2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
374
375 * elf32-i386.c: Include opcode/i386.h.
376 (elf_howto_table): Add R_386_GOT32X.
377 (R_386_ext2): Replace R_386_IRELATIVE with R_386_GOT32X.
378 (elf_i386_reloc_type_lookup): Handle BFD_RELOC_386_GOT32X.
379 (need_convert_mov_to_lea): Renamed to ...
380 (need_convert_load): This.
381 (elf_i386_check_relocs): Handle R_386_GOT32X. Replace
382 need_convert_mov_to_lea with need_convert_load.
383 (elf_i386_gc_sweep_hook): Handle R_386_GOT32X.
384 (elf_i386_size_dynamic_sections): Likewise.
385 (elf_i386_relocate_section): Likewise.
386 (elf_i386_convert_mov_to_lea): Renamed to ...
387 (elf_i386_convert_load): This. Replace need_convert_mov_to_lea
388 with need_convert_load. Support R_386_GOT32X transformations.
389 * reloc.c (BFD_RELOC_386_GOT32X): New.
390 * bfd-in2.h: Regenerated.
391 * libbfd.h: Likewise.
392
393 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
394
395 * elf32-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
396 only when linking an executable.
397 (elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
398 slot.
399 * elf64-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
400 only when linking an executable.
401 (elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
402 slot.
403
404 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
405
406 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Set the PLT
407 reference counters for local IFUNC calls.
408 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
409
410 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
411
412 * elf32-s390.c (elf_s390_check_relocs): Fallthrough to the PLT
413 slot allocating code for GOTOFF relocs on ifunc symbols.
414 (elf_s390_gc_sweep_hook): Decrement plt refcount for GOTOFF relocs
415 on ifunc symbols.
416 (elf_s390_relocate_section): Redirect a GOTOFF reloc to an iplt
417 slot.
418
419 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
420
421 PR ld/18841
422 * elf32-s390.c (elf_s390_reloc_type_class): Return
423 reloc_class_ifunc for ifunc symbols.
424 * elf64-s390.c (elf_s390_reloc_type_class): Likewise.
425
426 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
427
428 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Call
429 elf_s390_finish_ifunc_symbol only for actually defined symbols.
430 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
431
432 2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
433
434 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs): Remove
435 `head' parameter.
436 * elf32-s390.c (allocate_dynrelocs): Don't use last parameter.
437 * elf64-s390.c (allocate_dynrelocs): Don't use last parameter.
438
439 2015-10-20 Hans-Peter Nilsson <hp@bitrange.com>
440
441 * mmo.c (mmo_write_symbols_and_terminator): Correct printed value
442 of Main in error message.
443
444 2015-10-18 Doug Evans <xdje42@gmail.com>
445
446 * targets.c (bfd_flavour_name): "MMO" is spelled "mmo".
447
448 2015-10-17 Alan Modra <amodra@gmail.com>
449
450 * elf64-ppc.c (ppc64_elf_size_stubs): Correct __glink_PLTresolve
451 eh_frame FDE for ELFv1.
452
453 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
454
455 * elf32-i386.c (elf_i386_convert_mov_to_lea): Check if symbol
456 is defined.
457 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
458
459 2015-10-16 H.J. Lu <hongjiu.lu@intel.com>
460
461 * elf32-i386.c (elf_i386_convert_mov_to_lea): Don't check
462 def_regular.
463 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
464
465 2015-10-15 H.J. Lu <hongjiu.lu@intel.com>
466
467 * elflink.c (_bfd_elf_merge_symbol): Fix typos in comments
468
469 2015-10-15 Alan Modra <amodra@gmail.com>
470
471 * elf32-v850.c (v850_elf_copy_private_bfd_data): Remove assertion
472 that input and output .note.renesas sections are same size.
473 Instead, only copy input to output if they are.
474
475 2015-10-15 Riku Voipio <riku.voipio@iki.fi>
476
477 PR ld/19123
478 * elfcore.h (elf_core_file_p): Use the file_ptr type to hold the
479 offset for bfd_seek.
480 * elfcode.h (elf_object_p): Likewise.
481
482 2015-10-14 Rich Felker <dalias@libc.org>
483
484 PR ld/19091
485 * elf32-sh.c (sh_elf_size_dynamic_sections): Always emit
486 DT_PLTGOT for FDPIC output.
487
488 2015-10-13 Alan Modra <amodra@gmail.com>
489
490 * elf.c (_bfd_elf_map_sections_to_segments): Don't set
491 PT_GNU_RELRO p_flags.
492 (assign_file_positions_for_non_load_sections): Set PT_GNU_RELRO
493 flags to PF_R here.
494
495 2015-10-12 H.J. Lu <hongjiu.lu@intel.com>
496
497 PR ld/19073
498 * elflink.c (_bfd_elf_add_default_symbol): Skip the unversioned
499 definition after the default version.
500
501 2015-10-12 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
502
503 PR ld/19083
504 * elf32-s390.c (elf_s390_gc_sweep_hook): Do not reduce got
505 refcount for relocs not really requiring a got slot.
506 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
507
508 2015-10-11 John David Anglin <danglin@gcc.gnu.org>
509
510 * elf-hppa.h (elf_hppa_action_discarded): Ignore relocations in
511 .data.rel.ro.local.
512
513 2015-10-07 Cupertino Miranda <cmiranda@synopsys.com>
514
515 * archures.c: Remove support for older ARC. Added support for new
516 ARC cpus (ARC600, ARC601, ARC700, ARCV2).
517 * bfd-in2.h: Likewise.
518 * config.bfd: Likewise.
519 * cpu-arc.c: Likewise.
520 * elf32-arc.c: Totally changed file with a refactored
521 inplementation of the ARC port.
522 * libbfd.h: Added ARC specific relocation types.
523 * reloc.c: Likewise.
524
525 2015-10-06 H.J. Lu <hongjiu.lu@intel.com>
526
527 * bfd.c (bfd_update_compression_header): Clear the ch_reserved
528 field in 64-bit output.
529 (bfd_convert_section_contents): Likewise.
530
531 2015-10-05 H.J. Lu <hongjiu.lu@intel.com>
532
533 PR ld/18914
534 * elflink.c (elf_link_add_object_symbols): Don't re-export a
535 symbol if it isn't undefined.
536
537 2015-10-04 H.J. Lu <hongjiu.lu@intel.com>
538
539 * config.bfd (targ_selvecs, targ64_selvecs): Add iamcu_elf32_vec,
540 i386_pei_vec and x86_64_pei_vec for Solaris2/x86.
541
542 2015-10-02 Renlin Li <renlin.li@arm.com>
543
544 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Add
545 relax transitions for TLSDESC_ADD, TLSDESC_LDR, TLSDESC_OFF_G0_NC,
546 TLSDESC_OFF_G1.
547 (aarch64_tls_transition_without_check): Add relaxation support.
548 (aarch64_reloc_got_type): Add support.
549 (elfNN_aarch64_final_link_relocate): Likewise.
550 (elfNN_aarch64_tls_relax): Likewise.
551 (elfNN_aarch64_relocate_section): Likewise.
552 (elfNN_aarch64_gc_sweep_hook): Likewise.
553 (elfNN_aarch64_check_relocs): Likewise.
554 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
555 (_bfd_aarch64_elf_resolve_relocation): Likewise.
556
557 2015-10-02 Renlin Li <renlin.li@arm.com>
558
559 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Check overflow for
560 BFD_RELOC_AARCH64_TLSDESC_OFF_G1.
561
562 2015-10-02 Renlin Li <renlin.li@arm.com>
563
564 * elfnn-aarch64.c(IS_AARCH64_TLS_RELAX_RELOC):
565 Add relaxation support for TLSGD_MOVW_G0_NC and TLSGD_MOVW_G1.
566 (aarch64_tls_transition_without_check): Likewise
567 (elfNN_aarch64_tls_relax): Likwise.
568
569 2015-10-02 Renlin Li <renlin.li@arm.com>
570
571 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Create GOT section
572 for TLSLE_MOVW_TPREL_G(1, 1_NC, 2) relocation.
573
574 2015-10-02 Renlin Li <renlin.li@arm.com>
575
576 * reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
577 AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
578 * libbfd.h: Regenerate.
579 * bfd-in2.h: Likewise.
580 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
581 TLSIE_MOVW_GOTTPREL_G1 check overflow.
582 (aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
583 and TLSIE_MOVW_GOTTPREL_G0_NC.
584 (elfNN_aarch64_final_link_relocate): Likewise.
585 (elfNN_aarch64_relocate_section): Likewise.
586 (elfNN_aarch64_gc_sweep_hook): Likewise.
587 (elfNN_aarch64_check_relocs): Likewise.
588 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
589 (_bfd_aarch64_elf_resolve_relocation): Likewise.
590
591 2015-10-02 Renlin Li <renlin.li@arm.com>
592
593 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
594 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC support.
595 (elfNN_aarch64_final_link_relocate): Likewise.
596 (elfNN_aarch64_relocate_section): Likewise.
597 (elfNN_aarch64_gc_sweep_hook): Likewise.
598 (elfNN_aarch64_check_relocs): Likewise.
599 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
600 (_bfd_aarch64_elf_resolve_relocation): Likewise.
601
602 2015-10-02 Renlin Li <renlin.li@arm.com>
603
604 * reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC): New entry.
605 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
606 BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC.
607 * libbfd.h: Regenerate.
608 * bfd-in2.h: Likewise
609
610 2015-10-02 Renlin Li <renlin.li@arm.com>
611
612 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
613 BFD_RELOC_AARCH64_TLSGD_MOVW_G1 support.
614 (elfNN_aarch64_final_link_relocate): Likewise.
615 (elfNN_aarch64_relocate_section): Likewise.
616 (elfNN_aarch64_gc_sweep_hook): Likewise.
617 (elfNN_aarch64_check_relocs): Likewise.
618 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
619 (_bfd_aarch64_elf_resolve_relocation): Likewise.
620
621 2015-10-02 Renlin Li <renlin.li@arm.com>
622
623 * reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G1): New entry.
624 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
625 BFD_RELOC_AARCH64_TLSGD_MOVW_G1.
626 * bfd-in2.h: Regenerate.
627 * libbfd.h: Likewise.
628
629 2015-10-02 Renlin Li <renlin.li@arm.com>
630
631 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
632 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC support.
633 (elfNN_aarch64_final_link_relocate): Likewise.
634 (elfNN_aarch64_gc_sweep_hook): Likewise.
635 (elfNN_aarch64_check_relocs): Likewise.
636 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
637 (_bfd_aarch64_elf_resolve_relocation): Likewise.
638
639 2015-10-02 Renlin Li <renlin.li@arm.com>
640
641 * reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC): New.
642 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry
643 MOVW_GOTOFF_G0_NC.
644 * libbfd.h: Regnerate.
645 * bfd-in2.h: Regenerate.
646
647 2015-10-02 Renlin Li <renlin.li@arm.com>
648
649 * elfnn-aarch64.c (aarch64_reloc_got_type): Add support
650 for BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
651 (elfNN_aarch64_gc_sweep_hook): Likewise.
652 (elfNN_aarch64_check_relocs): Likewise
653 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
654 (_bfd_aarch64_elf_resolve_relocation): Likewise
655 (elfNN_aarch64_final_link_relocate): Likewise
656
657 2015-010-02 Renlin Li <renlin.li@arm.com>
658
659 * reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G1): New.
660 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
661 MOVW_GOTOFF_G1.
662 * libbfd.h: Regenerate.
663 * bfd-in2.h: Regenerate.
664
665 2015-10-02 Renlin Li <renlin.li@arm.com>
666
667 * elfnn-aarch64.c (aarch64_reloc_got_type): Add
668 BFD_RELOC_AARCH64_LD_64_GOTOFF_LO15 support.
669 (elfNN_aarch64_gc_sweep_hook): Likewise.
670 (elfNN_aarch64_check_relocs): Likewise
671 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
672 (_bfd_aarch64_elf_resolve_relocation): Likewise
673 (elfNN_aarch64_final_link_relocate): Calculate offset within GOT.
674
675 2015-10-02 Renlin Li <renlin.li@arm.com>
676
677 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Change if to
678 switch statement.
679
680 2015-10-01 H.J. Lu <hongjiu.lu@intel.com>
681
682 PR ld/19031
683 * elf64-x86-64.c (elf_x86_64_check_relocs): Set
684 pointer_equality_needed for R_X86_64_PC32 reloc in non-code
685 sections.
686
687 2015-10-01 Renlin Li <renlin.li@arm.com>
688
689 * elfnn-aarch64.c (elfNN_aarch64_output_plt_map): Remove.
690 (elfNN_aarch64_output_arch_local_syms): Emit AARCH64_MAP_INSN once.
691
692 2015-10-01 Kaz Kojima <kkojima@rr.iij4u.or.jp>
693
694 * config.bfd (targ_selvecs): Remove sh_elf32_vec and
695 sh_elf32_le_vec from sh*-*-linux cases.
696
697 2015-10-01 Alan Modra <amodra@gmail.com>
698
699 PR ld/19013
700 * elflink.c (_bfd_elf_merge_sections): Revert last change.
701
702 2015-09-30 H.J. Lu <hongjiu.lu@intel.com>
703
704 PR ld/19031
705 * elf32-i386.c (elf_i386_check_relocs): Set
706 pointer_equality_needed for R_386_PC32 reloc in non-code
707 sections.
708
709 2015-09-30 H.J. Lu <hongjiu.lu@intel.com>
710
711 PR ld/19013
712 * elflink.c (_bfd_elf_merge_sections): Only merge input bfds
713 that have the compatible ELF machine code with the output bfd.
714
715 2015-09-30 Alan Modra <amodra@gmail.com>
716
717 PR ld/19013
718 * elflink.c (_bfd_elf_merge_sections): Only merge input bfds that
719 will be handled by elf_link_input_bfd. Rename abfd param to obfd.
720
721 2015-09-30 Rich Felker <dalias@libc.org>
722
723 * config.bfd (targ_selvecs): Add fdpic and misc targets
724 for sh*-*-linux*.
725
726 2015-09-29 Andrew Stubbs <ams@codesourcery.com>
727 H.J. Lu <hongjiu.lu@intel.com>
728
729 PR binutils/19020
730 * bfd.c (bfd_convert_section_contents): Add ptr_size parameter.
731 * bfd-in2.h: Regenerated.
732
733 2015-08-11 Peter Zotov <whitequark@whitequark.org>
734
735 PR ld/18759
736 * elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
737 (R_OR1K_16_PCREL): Likewise.
738 (R_OR1K_8_PCREL): Likewise.
739
740 2015-09-23 Nick Clifton <nickc@redhat.com>
741
742 * bout.c (b_out_slurp_reloc_table): Cast constant to unsigned in
743 order to avoid problems with left shifting negative values.
744 (abs32code): Likewise.
745 * mach-o.c (FILE_ALIGN): Likewise.
746 * coff-rs6000.c (xcoff_debug_sections): Delete unused static
747 array.
748 * elf32-visium.c (visium_reloc_map): Likewise.
749 * elf32-arm.c (elf32_arm_final_link_relocate): Remove useless
750 calls to abs function.
751 * elf32-frv.c (_frvfdpic_relax_tls_entries): Likewise.
752 * elf32-score.c (score_elf_final_link_relocate): Likewise.
753 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
754 * elf32-i860.c (i860_howto_pc26_reloc): Use multiplication instead
755 of shifting to create a negative mask.
756 * elf32-msp430.c (elf_backend_special_sections): Define.
757 * elfxx-mips.c (got_ofst_reloc_p): Delete unused function.
758 (got_hi16_reloc_p): Delete unused function.
759 * ppcboot.c (ppcboot_bfd_print_private_bfd_data): Fix test of
760 partition name.
761
762 2015-09-23 Nick Clifton <nickc@redhat.com>
763
764 PR binutils/15835
765 * elf-bfd.h (struct elf_section_list): New structure.
766 (struct elf_obj_tdata): Replace symtab_shndx_hdr with
767 symtab_shndx_list. Delete symtab_shndx_section.
768 (elf_symtab_shndx): Replace macro with elf_symtab_shndx_list.
769 * elf.c (bfd_elf_get_syms): If symtab index sections are present,
770 scan them for the section that matches the provided symbol table.
771 (bfd_section_from_shdr): Record all SHT_SYMTAB_SHNDX sections.
772 (assign_section_numbers): Use the first symtab index table in the
773 list.
774 (_bfd_elf_compute_section_file_positions): Replace use of
775 symtab_shndx_hdr with use of symtab_shndx_list.
776 (find_section_in_list): New function.
777 (assign_file_postions_except_relocs): Use new function.
778 (_bfd_elf_copy_private_symbol_data): Likewise.
779 (swap_out_syms): Handle multiple symbol table index sections.
780 * elf32-m32c.c (m32c_elf_relax_section): Replace use of
781 symtab_shndx_hdr with use of symtab_shndx_list.
782 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
783 * elf32-rx.c (rx_relax_section): Likewise.
784 * elf32-v850.c (v850_elf_relax_delete_bytes): Likewise.
785 * elflink.c (bfd_elf_final_link): Likewise.
786
787 2015-09-21 H.J. Lu <hongjiu.lu@intel.com>
788
789 * bfd.c (bfd_update_compression_header): Use bfd_put_32 on
790 ch_type.
791 (bfd_check_compression_header): Use bfd_get_32 on ch_type.
792 (bfd_convert_section_contents): Use bfd_get_32 and bfd_put_32
793 on ch_type.
794
795 2015-09-20 Rich Felker <dalias@libc.org>
796
797 * elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create
798 .interp when info->nointerp.
799 (bfd_elf_size_dynamic_sections): Adjust assert.
800 * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't size .interp
801 when info->nointerp.
802 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
803 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
804 * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise.
805 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
806 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
807 * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
808 * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
809 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
810 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
811 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
812 * elf32-metag.c (elf_metag_size_dynamic_sections): Likewise.
813 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
814 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
815 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
816 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
817 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
818 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
819 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
820 * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
821 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Likewise.
822 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
823 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
824 * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise.
825 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
826 * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
827 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
828 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
829 * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
830 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
831 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise.
832 * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise.
833 * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
834 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
835 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
836
837 2015-09-18 Doug Evans <xdje42@gmail.com>
838
839 * targets.c (enum bfd_flavour): Add comment.
840 (bfd_flavour_name): New function.
841 * bfd-in2.h: Regenerate.
842
843 2015-09-18 Alan Modra <amodra@gmail.com>
844
845 * elf64-ppc.h (struct ppc64_elf_params <tls_get_addr_opt>): Rename
846 from no_tls_get_addr_opt.
847 * elf64-ppc.c: Update for rename and inversion of tls_get_addr_opt.
848 (ppc64_elf_tls_setup): Set tls_get_addr_opt to 0 only when at
849 default of -1.
850
851 2015-09-17 Alan Modra <amodra@gmail.com>
852
853 PR 18867
854 * elflink.c (elf_link_adjust_relocs): Correct start of insertion
855 sort main loop.
856
857 2015-09-16 Alan Modra <amodra@gmail.com>
858
859 PR 18867
860 * elflink.c (elf_link_adjust_relocs): Modify insertion sort to
861 insert a run. Return status in case of malloc failure.
862 Adjust callers.
863
864 2015-09-15 Max Filippov <jcmvbkbc@gmail.com>
865
866 * elf32-xtensa.c (elf_xtensa_be_plt_entry)
867 (elf_xtensa_le_plt_entry): Emit 'entry' instruction only for
868 windowed ABI.
869 (elf_xtensa_create_plt_entry): Generate 'l32r' offsets and fix
870 up instructions according to ABI.
871
872 2015-09-14 Rich Felker <dalias@libc.org>
873
874 * elf32-sh.c (sh_elf_relocate_section): Set EF_SH_PIC flag
875 instead of clearing it on cross-section relocations.
876 (sh_elf_merge_private_data): Clear EF_SH_PIC flag by default.
877
878 2015-09-12 Helge Deller <deller@gmx.de>
879
880 PR ld/18514
881 * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Set .plt entry
882 size to 0.
883
884 2015-09-09 Jiong Wang <jiong.wang@arm.com>
885
886 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Sort alphabetically.
887
888 2015-09-09 Jiong Wang <jiong.wang@arm.com>
889
890 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Support three
891 TLS local dynamic traditional relocations types.
892 (elfNN_aarch64_tls_relax): Support TLS local dynamic traditional to
893 local executable relaxation.
894
895 2015-09-03 H.J. Lu <hongjiu.lu@intel.com>
896
897 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Remove
898 convert_mov_to_lea.
899
900 2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
901
902 * elf32-i386.c (R_386_irelative): Renamed to ...
903 (R_386_ext2): This.
904 (R_386_vt_offset): Updated.
905 (elf_i386_rtype_to_howto): Likewise.
906 (elf_i386_relocate_section): Likewise.
907
908 2015-09-01 H.J. Lu <hongjiu.lu@intel.com>
909
910 PR ld/18900
911 * elf32-i386.c (elf_i386_link_hash_entry): Add
912 func_pointer_refcount.
913 (elf_i386_link_hash_newfunc): Clear func_pointer_refcount.
914 (elf_i386_get_local_sym_hash): Likewise.
915 (elf_i386_copy_indirect_symbol): Also copy
916 func_pointer_refcount.
917 (elf_i386_check_relocs): Increment func_pointer_refcount.
918 (elf_i386_gc_sweep_hook): Decrement func_pointer_refcount.
919 (elf_i386_allocate_dynrelocs): Don't create the PLT entry if
920 there are only function pointer relocations which can be
921 resolved at run-time. Keep dynanamic relocations for run-time
922 function pointer initialization.
923 (elf_i386_relocate_section): Copy dynamic function pointer
924 relocations.
925 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
926 func_pointer_refcount.
927 (elf_x86_64_link_hash_newfunc): Clear func_pointer_refcount.
928 (elf_x86_64_get_local_sym_hash): Likewise.
929 (elf_x86_64_copy_indirect_symbol): Also copy
930 func_pointer_refcount.
931 (elf_x86_64_check_relocs): Increment func_pointer_refcount.
932 (elf_x86_64_gc_sweep_hook): Decrement func_pointer_refcount.
933 (elf_x86_64_allocate_dynrelocs): Don't create the PLT entry if
934 there are only function pointer relocations which can be
935 resolved at run-time. Keep dynanamic relocations for run-time
936 function pointer initialization.
937 (elf_x86_64_relocate_section): Copy dynamic function pointer
938 relocations.
939
940 2015-09-01 Alan Modra <amodra@gmail.com>
941
942 * elf64-ppc.c (ppc64_elf_maybe_function_sym): Adjust symbol value
943 if .opd section has been edited.
944
945 2015-09-01 Alan Modra <amodra@gmail.com>
946
947 PR 18878
948 * elf64-ppc.c (ARRAY_SIZE): Define. Use throughout.
949 (enum ppc_stub_type): Add ppc_stub_save_res.
950 (struct map_stub): Add "next" and "needs_save_res".
951 (struct ppc_link_hash_entry): Add "save_res" flag.
952 (struct ppc_link_hash_table): Add "group".
953 (sfpr_define): Add stub_sec param. Define symbol in stub_sec if
954 stub_sec is non-null. Set "save_res".
955 (save_res_funcs): Make file scope, rename from funcs. Adjust uses.
956 (ppc64_elf_adjust_dynamic_symbol): Prohibit plt call to save_res syms.
957 (ppc_build_one_stub): Handle ppc_stub_save_res.
958 (ppc_size_one_stub): Set stub type to ppc_size_one_stub on finding
959 stub for linker defined save_res sym.
960 (group_sections): Init new fields of struct map_stub.
961 (ppc64_elf_size_stubs): Reserve space for save/restore func copy.
962 (ppc64_elf_build_stubs): Copy save/restore funcs to groups. Emit
963 alias syms too.
964 (ppc64_elf_relocate_section): Set destination for ppc_stub_save_res.
965
966 2015-08-31 Alan Modra <amodra@gmail.com>
967
968 * elf64-ppc.c (get_r2off): Return -1 on error.
969 (ppc_build_one_stub): Adjust for get_r2off change. Don't emit
970 addi r2,r2,0 on r2off stubs when the low 16-bit delta is zero.
971 (ppc_size_one_stub): Corresponding size changes for r2off stubs.
972 Add condition in test for -R objects.
973
974 2015-08-31 Alan Modra <amodra@gmail.com>
975
976 * section.c (section_id): Make file scope.
977 (bfd_get_next_section_id): New function.
978 * elf64-ppc.c (struct map_stub): Remove toc_off field. Move decl.
979 (struct ppc_stub_hash_entry): Delete stub_sec and id_sec. Add
980 group. Update all uses.
981 (struct ppc_link_hash_table): Delete top_id, top_index, and
982 input_list. Add sec_info_arr_size. Rename stub_group to
983 sec_info, and make group info indirect. Update stub_group refs
984 throughout file.
985 (ppc_add_stub): Don't look for stub_sec on link_sec stub_group
986 entry.
987 (ppc_build_one_stub): Delete FIXME.
988 (ppc64_elf_setup_section_lists): Size htab->sec_info for all
989 sections, not just input sections. Don't create htab->input_list.
990 (ppc64_elf_next_input_section): Update to use sec_info union as
991 list pointer.
992 (PREV_SEC): Delete.
993 (group_sections): Pass "info" param rather than "htab". Iterate
994 over output sections rather than input_list. Use sec_info union
995 as list pointers. Alloc atruct map_stub, and return fail status.
996 * bfd-in2.h: Regenerate.
997
998 2015-08-31 Alan Modra <amodra@gmail.com>
999
1000 * elflink.c (elf_sort_symbol): Use correctly sized type for
1001 calculating signed section->id difference.
1002 (elf_link_add_object_symbols): Likewise.
1003 * pef.c (bfd_pef_scan_start_address): Warning fix.
1004 * vms-alpha.c (vms_new_section_hook): Likewise.
1005
1006 2015-08-31 Alan Modra <amodra@gmail.com>
1007
1008 * elf32-nds32.c (nds32_convert_32_to_16_alu1): Warning fix.
1009 (find_relocs_at_address_addr): Make "reloc_type" an enum.
1010 (nds32_elf_relax_delete_blanks): Warning fix.
1011 (nds32_elf_relax_loadstore): Correct loop bound.
1012
1013 2015-08-31 Alan Modra <amodra@gmail.com>
1014
1015 * section.c (struct bfd_section): Make "id" and "index" unsigned.
1016 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust local var to suit.
1017 * elf.c (elf_map_symbols): Likewise.
1018 * elf64-ppc.c (sym_exists_at): Make "id" param unsigned.
1019 (struct ppc_link_hash_table): Make "top_id" and "top_index" unsigned.
1020 (ppc64_elf_setup_section_lists): Ditto for local vars.
1021 * elf32-arm.c: Similarly to elf64-ppc.c.
1022 * elf32-avr.c: Likewise.
1023 * elf32-hppa.c: Likewise.
1024 * elf32-m68hc1x.c: Likewise.
1025 * elf32-metag.c: Likewise.
1026 * elf32-nios2.c: Likewise.
1027 * elfnn-aarch64.c: Likewise.
1028 * simple.c (struct saved_offsets): Make "section_count" unsigned.
1029 * bfd-in2.h: Regenerate.
1030
1031 2015-08-27 Alan Modra <amodra@gmail.com>
1032
1033 PR 18867
1034 * elf64-alpha.c (elf64_alpha_sort_relocs_p): New function.
1035 (elf_backend_sort_relocs_p): Define.
1036
1037 2015-08-26 Alan Modra <amodra@gmail.com>
1038
1039 PR 18867
1040 * elflink.c (cmp_ext32l_r_offset, cmp_ext32b_r_offset): Delete.
1041 (cmp_ext64l_r_offset, cmp_ext64b_r_offset): Delete.
1042 (ext32l_r_offset, ext32b_r_offset, ext64l_r_offset, ext64b_r_offset):
1043 New functions.
1044 (elf_link_adjust_relocs): Use an insertion sort to sort relocs.
1045
1046 2015-08-26 Matthew Fortune <matthew.fortune@imgtec.com>
1047
1048 PR ld/18401
1049 * elfxx-mips.c (bfd_mips_isa_ext_mach): New function: Converts an
1050 ISA value to a bfd machine number.
1051 (bfd_mips_isa_ext): Update the ISA level and revision if
1052 necessary. Use mips_mach_extends_p to decide if the ISA extension
1053 needs to be set.
1054 (_bfd_mips_elf_merge_private_bfd_data): Allow the ISA extension to
1055 be inferred from the ABI setting. Set the ISA level from the
1056 maximum of the incoming and outgoing ISA levels.
1057
1058 2015-08-25 Nick Clifton <nickc@redhat.com>
1059
1060 PR binutils/18854
1061 * elf.c (bfd_section_from_shdr): Replace assertions with warnings
1062 about multiple symbol tables.
1063
1064 2015-08-25 Renlin Li <renlin.li@arm.com>
1065
1066 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of
1067 ILP64.
1068 * bfd-in2.h: Regenerate.
1069
1070 2015-08-22 Alan Modra <amodra@gmail.com>
1071
1072 * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename.
1073 Don't copy fields not set by _bfd_elf_swap_verdef_in.
1074
1075 2015-08-19 Jiong Wang <jiong.wang@arm.com>
1076
1077 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
1078 types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
1079 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
1080 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
1081 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
1082 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
1083 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
1084 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
1085 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
1086 (elfNN_aarch64_final_link_relocate): Likewise.
1087 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1088 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1089
1090 2015-08-19 Jiong Wang <jiong.wang@arm.com>
1091
1092 * reloc.c (BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
1093 BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
1094 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
1095 BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
1096 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
1097 BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC.
1098 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
1099 BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC): New entries.
1100 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
1101 * bfd-in2.h: Regenerate.
1102 * libbfd.h: Regenerate.
1103
1104 2015-08-19 Jiong Wang <jiong.wang@arm.com>
1105
1106 PR ld/18276
1107 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
1108 types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
1109 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
1110 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
1111 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
1112 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
1113 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
1114 (elfNN_aarch64_final_link_relocate): Likewise.
1115 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1116 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1117
1118 2015-08-19 Jiong Wang <jiong.wang@arm.com>
1119
1120 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
1121 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
1122 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
1123 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
1124 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
1125 BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2): New entries.
1126 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
1127 * bfd-in2.h: Regenerate.
1128 * libbfd.h: Regenerate.
1129
1130 2015-08-19 Jiong Wang <jiong.wang@arm.com>
1131
1132 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1133 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1134 (aarch64_reloc_got_type): Likewise.
1135 (elfNN_aarch64_final_link_relocate): Likewise.
1136 (elfNN_aarch64_relocate_section): Likewise.
1137 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1138 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1139
1140 2015-08-19 Jiong Wang <jiong.wang@arm.com>
1141
1142 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
1143 * bfd-in2.h: Regenerate.
1144 * libbfd.h: Regenerate.
1145 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1146 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
1147
1148 2015-08-19 Alan Modra <amodra@gmail.com>
1149
1150 * elf-s390-common.c: Simplify expressions using
1151 bfd_linke_executable, bfd_link_pie and bfd_link_pic.
1152 * elf32-arm.c: Likewise.
1153 * elf32-bfin.c: Likewise.
1154 * elf32-frv.c: Likewise.
1155 * elf32-m68k.c: Likewise.
1156 * elf32-nios2.c: Likewise.
1157 * elf32-ppc.c: Likewise.
1158 * elf32-s390.c: Likewise.
1159 * elf32-sh.c: Likewise.
1160 * elf64-alpha.c: Likewise.
1161 * elf64-ppc.c: Likewise.
1162 * elf64-s390.c: Likewise.
1163 * elflink.c: Likewise.
1164
1165 2015-08-18 Jiong Wang <jiong.wang@arm.com>
1166
1167 * elfnn-aarch64.c (aarch64_reloc_got_type): Delete useless check.
1168 (elfNN_aarch64_relocate_section): Likewise.
1169 (elfNN_aarch64_gc_sweep_hook): Likewise.
1170 (elfNN_aarch64_check_relocs): Likewise.
1171
1172 2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
1173
1174 PR ld/18841
1175 * elf-bfd.h (elf_link_hash_table): Add dynsym.
1176 * elf32-i386.c (elf_i386_reloc_type_class): Return
1177 reloc_class_ifunc for relocation against STT_GNU_IFUNC symbol.
1178 * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
1179 * elflink.c (_bfd_elf_link_create_dynamic_sections): Set dynsym.
1180 (bfd_elf_size_dynsym_hash_dynstr): Use dynsym.
1181 (elf_final_link_info): Remove dynsym_sec.
1182 (elf_link_output_extsym): Replace dynsym_sec with dynsym.
1183 (bfd_elf_final_link): Remove reference to dynsym_sec. Replace
1184 dynsym_sec with dynsym.
1185
1186 2015-08-18 H.J. Lu <hongjiu.lu@intel.com>
1187
1188 * bfd/aoutx.h: Replace shared, executable, relocatable and pie
1189 fields with bfd_link_executable, bfd_link_dll,
1190 bfd_link_relocatable, bfd_link_pic and bfd_link_pie.
1191 * bfd/bout.c: Likewise.
1192 * bfd/coff-alpha.c: Likewise.
1193 * bfd/coff-arm.c: Likewise.
1194 * bfd/coff-i386.c: Likewise.
1195 * bfd/coff-i960.c: Likewise.
1196 * bfd/coff-m68k.c: Likewise.
1197 * bfd/coff-mcore.c: Likewise.
1198 * bfd/coff-mips.c: Likewise.
1199 * bfd/coff-ppc.c: Likewise.
1200 * bfd/coff-rs6000.c: Likewise.
1201 * bfd/coff-sh.c: Likewise.
1202 * bfd/coff-tic80.c: Likewise.
1203 * bfd/coff-x86_64.c: Likewise.
1204 * bfd/coff64-rs6000.c: Likewise.
1205 * bfd/coffgen.c: Likewise.
1206 * bfd/cofflink.c: Likewise.
1207 * bfd/ecoff.c: Likewise.
1208 * bfd/ecofflink.c: Likewise.
1209 * bfd/elf-bfd.h: Likewise.
1210 * bfd/elf-eh-frame.c: Likewise.
1211 * bfd/elf-ifunc.c: Likewise.
1212 * bfd/elf-m10200.c: Likewise.
1213 * bfd/elf-m10300.c: Likewise.
1214 * bfd/elf-s390-common.c: Likewise.
1215 * bfd/elf-vxworks.c: Likewise.
1216 * bfd/elf.c: Likewise.
1217 * bfd/elf32-arm.c: Likewise.
1218 * bfd/elf32-avr.c: Likewise.
1219 * bfd/elf32-bfin.c: Likewise.
1220 * bfd/elf32-cr16.c: Likewise.
1221 * bfd/elf32-cr16c.c: Likewise.
1222 * bfd/elf32-cris.c: Likewise.
1223 * bfd/elf32-crx.c: Likewise.
1224 * bfd/elf32-d10v.c: Likewise.
1225 * bfd/elf32-dlx.c: Likewise.
1226 * bfd/elf32-epiphany.c: Likewise.
1227 * bfd/elf32-fr30.c: Likewise.
1228 * bfd/elf32-frv.c: Likewise.
1229 * bfd/elf32-ft32.c: Likewise.
1230 * bfd/elf32-h8300.c: Likewise.
1231 * bfd/elf32-hppa.c: Likewise.
1232 * bfd/elf32-i370.c: Likewise.
1233 * bfd/elf32-i386.c: Likewise.
1234 * bfd/elf32-i860.c: Likewise.
1235 * bfd/elf32-ip2k.c: Likewise.
1236 * bfd/elf32-iq2000.c: Likewise.
1237 * bfd/elf32-lm32.c: Likewise.
1238 * bfd/elf32-m32c.c: Likewise.
1239 * bfd/elf32-m32r.c: Likewise.
1240 * bfd/elf32-m68hc11.c: Likewise.
1241 * bfd/elf32-m68hc1x.c: Likewise.
1242 * bfd/elf32-m68k.c: Likewise.
1243 * bfd/elf32-mcore.c: Likewise.
1244 * bfd/elf32-mep.c: Likewise.
1245 * bfd/elf32-metag.c: Likewise.
1246 * bfd/elf32-microblaze.c: Likewise.
1247 * bfd/elf32-moxie.c: Likewise.
1248 * bfd/elf32-msp430.c: Likewise.
1249 * bfd/elf32-mt.c: Likewise.
1250 * bfd/elf32-nds32.c: Likewise.
1251 * bfd/elf32-nios2.c: Likewise.
1252 * bfd/elf32-or1k.c: Likewise.
1253 * bfd/elf32-ppc.c: Likewise.
1254 * bfd/elf32-rl78.c: Likewise.
1255 * bfd/elf32-rx.c: Likewise.
1256 * bfd/elf32-s390.c: Likewise.
1257 * bfd/elf32-score.c: Likewise.
1258 * bfd/elf32-score7.c: Likewise.
1259 * bfd/elf32-sh-symbian.c: Likewise.
1260 * bfd/elf32-sh.c: Likewise.
1261 * bfd/elf32-sh64.c: Likewise.
1262 * bfd/elf32-spu.c: Likewise.
1263 * bfd/elf32-tic6x.c: Likewise.
1264 * bfd/elf32-tilepro.c: Likewise.
1265 * bfd/elf32-v850.c: Likewise.
1266 * bfd/elf32-vax.c: Likewise.
1267 * bfd/elf32-visium.c: Likewise.
1268 * bfd/elf32-xc16x.c: Likewise.
1269 * bfd/elf32-xstormy16.c: Likewise.
1270 * bfd/elf32-xtensa.c: Likewise.
1271 * bfd/elf64-alpha.c: Likewise.
1272 * bfd/elf64-hppa.c: Likewise.
1273 * bfd/elf64-ia64-vms.c: Likewise.
1274 * bfd/elf64-mmix.c: Likewise.
1275 * bfd/elf64-ppc.c: Likewise.
1276 * bfd/elf64-s390.c: Likewise.
1277 * bfd/elf64-sh64.c: Likewise.
1278 * bfd/elf64-x86-64.c: Likewise.
1279 * bfd/elflink.c: Likewise.
1280 * bfd/elfnn-aarch64.c: Likewise.
1281 * bfd/elfnn-ia64.c: Likewise.
1282 * bfd/elfxx-mips.c: Likewise.
1283 * bfd/elfxx-sparc.c: Likewise.
1284 * bfd/elfxx-tilegx.c: Likewise.
1285 * bfd/i386linux.c: Likewise.
1286 * bfd/linker.c: Likewise.
1287 * bfd/m68klinux.c: Likewise.
1288 * bfd/pdp11.c: Likewise.
1289 * bfd/pe-mips.c: Likewise.
1290 * bfd/peXXigen.c: Likewise.
1291 * bfd/reloc.c: Likewise.
1292 * bfd/reloc16.c: Likewise.
1293 * bfd/sparclinux.c: Likewise.
1294 * bfd/sunos.c: Likewise.
1295 * bfd/vms-alpha.c: Likewise.
1296 * bfd/xcofflink.c: Likewise.
1297
1298 2015-08-18 Alan Modra <amodra@gmail.com>
1299
1300 PR 18667
1301 * Makefile.am: Use $(SED) in place of sed throughout.
1302 * Makefile.in: Regenerate.
1303
1304 2015-08-18 Alan Modra <amodra@gmail.com>
1305
1306 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't redefine .TOC.
1307 if already defined, and set linker_def.
1308 (ppc64_elf_set_toc): Use .TOC. value if defined other than by
1309 the backend.
1310
1311 2015-08-14 Alan Modra <amodra@gmail.com>
1312
1313 PR ld/18759
1314 * elf32-or1k.c: Revert 2015-08-11 change.
1315
1316 2015-08-13 H.J. Lu <hongjiu.lu@intel.com>
1317
1318 PR ld/18801
1319 * elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error
1320 for read-only segment with dynamic IFUNC relocations.
1321 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
1322
1323 2015-08-12 Simon Dardis <simon.dardis@imgtec.com>
1324
1325 * elfxx-mips.c (STUB_MOVE): Change to use 'or' only.
1326 (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry,
1327 mips_n64_exec_plt0_entry, micromips_insn32_o32_exec_plt0_entry):
1328 Update to use 'or' instead of 'addu/daddu'.
1329 (_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE.
1330 (move_insns_32): Reorder table.
1331
1332 2015-08-11 H.J. Lu <hongjiu.lu@intel.com>
1333
1334 * elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
1335 relocations in debug sections.
1336 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1337
1338 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1339
1340 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
1341 message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
1342
1343 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1344
1345 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
1346 (aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
1347
1348 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1349
1350 * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
1351 Loose the check for symbol from ABS section.
1352 (elfNN_aarch64_size_stubs): Pass sym_sec.
1353
1354 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1355
1356 PR ld/18668
1357 * elfnn-aarch64.c (aarch64_type_of_stub): Update destination for
1358 calls go through plt stub.
1359 (elfNN_aarch64_final_link_relocate): Adjust code logic for CALL26,
1360 JUMP26 relocation to support inserting veneer for call to plt stub.
1361
1362 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1363
1364 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1365 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
1366 (aarch64_reloc_got_type): Likewise.
1367 (elfNN_aarch64_final_link_relocate): Likewise.
1368 (elfNN_aarch64_relocate_section): Likewise.
1369 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1370 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1371
1372 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1373
1374 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry.
1375 * bfd-in2.h: Regenerate.
1376 * libbfd.h: Regenerate.
1377 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1378 BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
1379
1380 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1381
1382 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1383 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
1384 (aarch64_reloc_got_type): Likewise.
1385 (elfNN_aarch64_final_link_relocate): Likewise.
1386 (elfNN_aarch64_relocate_section): Likewise.
1387 (elfNN_aarch64_gc_sweep_hook): Likewise.
1388 (elfNN_aarch64_check_relocs): Likewise.
1389 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1390 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1391
1392 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1393
1394 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry.
1395 * bfd-in2.h: Regenerate.
1396 * libbfd.h: Regenerate.
1397 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1398 BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
1399
1400 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1401
1402 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1403 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
1404 (aarch64_reloc_got_type): Likewise.
1405 (elfNN_aarch64_final_link_relocate): Likewise.
1406 (elfNN_aarch64_relocate_section): Likewise.
1407 (elfNN_aarch64_gc_sweep_hook): Likewise.
1408 (elfNN_aarch64_check_relocs): Likewise.
1409 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1410 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1411
1412 2015-08-11 Jiong Wang <jiong.wang@arm.com>
1413
1414 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry.
1415 * bfd-in2.h: Regenerate.
1416 * libbfd.h: Regenerate.
1417 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1418 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
1419
1420 2015-08-11 H.J. Lu <hongjiu.lu@intel.com>
1421
1422 PR ld/18808
1423 * elf32-i386.c (elf_i386_relocate_section): Skip IFUNC
1424 relocations in debug sections.
1425 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1426
1427 2015-08-11 Peter Zotov <whitequark@whitequark.org>
1428
1429 PR ld/18759
1430 * elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
1431 (R_OR1K_16_PCREL): Likewise.
1432 (R_OR1K_8_PCREL): Likewise.
1433
1434 2015-08-11 Nick Clifton <nickc@redhat.com>
1435
1436 PR binutils/18747
1437 * coff-sh.c (_bfd_sh_align_load_span): Fix typo when setting
1438 opcode count.
1439
1440 PR binutils/18758
1441 * elf.c (_bfd_elf_setup_sections): Add checks for corrupt section
1442 group information.
1443 * peicode.h (pe_ILF_make_a_section): Ensure alignment of the
1444 used_by_bfd pointer.
1445 (pe_ILF_build_a_bfd): Ensure alignment of vars.data pointer.
1446
1447 2015-08-11 H.J. Lu <hongjiu.lu@intel.com>
1448
1449 * elf.c (_bfd_elf_copy_private_bfd_data): Fix a typo.
1450
1451 2015-08-10 H.J. Lu <hongjiu.lu@intel.com>
1452
1453 * elf-bfd.h (elf_symbol_version): New enum.
1454 (elf_link_hash_entry): Replace hidden with versioned.
1455 * elflink.c (_bfd_elf_merge_symbol): Don't look for symbol
1456 version if the symbol is unversioned. Initialize versioned.
1457 (_bfd_elf_add_default_symbol): Don't look for symbol version
1458 if the symbol is unversioned or hidden. Initialize versioned.
1459 (elf_collect_hash_codes): Don't look for symbol version if the
1460 symbol is unversioned.
1461 (elf_collect_gnu_hash_codes): Likewise.
1462 (bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
1463 (_bfd_elf_link_hash_copy_indirect): Check versioned instead of
1464 hidden.
1465 (elf_link_output_extsym): Likewise.
1466
1467 2015-08-07 H.J. Lu <hongjiu.lu@intel.com>
1468
1469 PR binutils/18785
1470 * elf.c (_bfd_elf_copy_private_bfd_data): When copying the
1471 sh_link and sh_info fields in stripped section headers, we also
1472 check if the sh_type, sh_flags, sh_addralign and sh_entsize
1473 fields of the output section match the output. Since
1474 --only-keep-debug turns all non-debug sections into SHT_NOBITS
1475 sections, the output SHT_NOBITS type matches any input type.
1476
1477 2015-08-07 H.J. Lu <hongjiu.lu@intel.com>
1478
1479 PR ld/18720
1480 * elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate
1481 if the new symbol matches the existing one. The new hidden
1482 versioned symbol matches the existing symbol if they have the
1483 same symbol version. Update the existing symbol only if they
1484 match.
1485 (_bfd_elf_add_default_symbol): Update call to
1486 _bfd_elf_merge_symbol.
1487 (_bfd_elf_link_assign_sym_version): Don't set the hidden field
1488 here.
1489 (elf_link_add_object_symbols): Override a definition only if the
1490 new symbol matches the existing one.
1491 (_bfd_elf_link_hash_copy_indirect): Don't copy any references to
1492 the hidden versioned symbol.
1493 (elf_link_output_extsym): Bind a symbol locally when linking
1494 executable if it is locally defined, hidden versioned, not
1495 referenced by shared library and not exported. Turn on
1496 VERSYM_HIDDEN only if the hidden versioned symbol is defined
1497 locally.
1498
1499 2015-08-05 Nick Clifton <nickc@redhat.com>
1500
1501 * elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
1502 sh_info fields of sections whose type has been changed to
1503 SHT_NOBITS.
1504
1505 2015-08-04 Yuriy M. Kaminskiy" <yumkam@gmail.com>
1506 Tyler Hicks <tyhicks@canonical.com>
1507
1508 PR binutils/18750
1509 * ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
1510 and stack overflow when char is signed and \200-\376 was in place of hex
1511 digit; also fixes \377 was handled as EOF instead of "incorrect character".
1512 (ihex_read_section): Changed for consistency.
1513 (ihex_bad_byte): Prevent (now impossible to trigger) stack
1514 overflow and incorrect escape sequence handling.
1515 * srec.c (srec_bad_byte): Likewise.
1516
1517 2015-08-03 Hans-Peter Nilsson <hp@axis.com>
1518
1519 * elf32-cris.c (cris_elf_relocate_section)
1520 (elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
1521 (elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
1522 just link_info->symbolic, to check if a symbol should be bound
1523 symbolically.
1524
1525 2015-07-30 H.J. Lu <hongjiu.lu@intel.com>
1526
1527 PR ld/18735
1528 * elflink.c (_bfd_elf_add_default_symbol): Add the default
1529 symbol if not performing a relocatable link.
1530 (elf_link_add_object_symbols): Adjust the default symbol if
1531 not performing a relocatable link.
1532
1533 2015-07-29 H.J. Lu <hongjiu.lu@intel.com>
1534
1535 * elflink.c (elf_link_add_object_symbols): Remove
1536 !info->relocatable check for info->executable. Add
1537 !info->relocatable check for !info->executable.
1538 (elf_link_output_extsym): Remove
1539 !info->relocatable check for info->executable.
1540
1541 2015-07-29 Hans-Peter Nilsson <hp@bitrange.com>
1542
1543 * mmo.c (mmo_write_symbols_and_terminator): Skip symbol-type
1544 assignment loop for bfd plugin objects.
1545
1546 2015-07-28 Alan Modra <amodra@gmail.com>
1547
1548 * elf.c (_bfd_elf_map_sections_to_segments): Do not make a new
1549 segment for loaded sections after nonloaded sections if the
1550 sections are on the same page.
1551
1552 2015-07-28 Iain Buclaw <ibuclaw@gdcproject.org>
1553
1554 * configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
1555 * config.in, configure: Regenerate.
1556
1557 2015-07-27 H.J. Lu <hongjiu.lu@intel.com>
1558
1559 * configure: Regenerated.
1560
1561 2015-07-27 Nick Clifton <nickc@redhat.com>
1562
1563 * elf32-msp430.c (uses_large_model): New function.
1564 (msp430_elf_eh_frame_address_size): New function.
1565 (elf_backend_eh_frame_address_size): Define.
1566
1567 2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
1568
1569 PR ld/18705
1570 * elfnn-aarch64.c (elf_backend_extern_protected_data): Define.
1571
1572 2015-07-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
1573
1574 PR ld/18705
1575 * elf32-arm.c (elf_backend_extern_protected_data): Define.
1576
1577 2015-07-25 H.J. Lu <hongjiu.lu@intel.com>
1578
1579 PR ld/18718
1580 * elflink.c (elf_link_output_extsym): Check symbol version
1581 section check only if not linking executable, the symbol is
1582 referenced by shared library or not locally defined.
1583
1584 2015-07-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1585
1586 * elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to
1587 check if a symbol should be bound symbolically.
1588 * elf32-hppa.c (elf32_hppa_check_relocs,
1589 elf32_hppa_adjust_dynamic_symbol, elf32_hppa_relocate_section,
1590 elf32_hppa_finish_dynamic_symbol): Likewise.
1591 * elf32-m68k.c (elf_m68k_check_relocs,
1592 elf_m68k_relocate_section): Likewise.
1593 * elf32-nios2.c (nios2_elf32_relocate_section,
1594 nios2_elf32_check_relocs, allocate_dynrelocs): Likewise.
1595 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol,
1596 elf32_tic6x_relocate_section): Likewise.
1597
1598 2015-07-24 Alan Modra <amodra@gmail.com>
1599
1600 * elf.c (_bfd_elf_assign_file_positions_for_non_load): Use .rela
1601 prefix for reloc section corresponding to rela section associated
1602 with renamed debug section.
1603
1604 2015-07-24 Alan Modra <amodra@gmail.com>
1605
1606 * section.c (bfd_get_section_by_name_if): Iterate over entire hash
1607 chain.
1608
1609 2015-07-23 Joseph Myers <joseph@codesourcery.com>
1610
1611 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
1612 <DT_MIPS_RLD_MAP_REL>: Add target address to host address
1613 difference, not to host pointer.
1614
1615 2015-07-22 Alan Modra <amodra@gmail.com>
1616
1617 * elf64-ppc.c (opd_entry_value): Remove assertion. Instead,
1618 return -1 if symbol referenced is not defined. Tidy.
1619
1620 2015-07-20 Alan Modra <amodra@gmail.com>
1621
1622 * po/SRC-POTFILES.in: Regenerate.
1623
1624 2015-07-17 Jiong Wang <jiong.wang@arm.com>
1625
1626 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Sort alphabetically.
1627 (IS_AARCH64_TLSDESC_RELOC): Sort alphabetically.
1628
1629 2015-07-16 Jiong Wang <jiong.wang@arm.com>
1630
1631 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1632 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1633 (aarch64_reloc_got_type): Ditto.
1634 (elfNN_aarch64_final_link_relocate): Ditto.
1635 (elfNN_aarch64_relocate_section): Ditto.
1636 (elfNN_aarch64_gc_sweep_hook): Ditto.
1637 (elfNN_aarch64_check_relocs): Ditto.
1638 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1639 (_bfd_aarch64_elf_resolve_relocation): Ditto.
1640
1641 2015-07-16 Jiong Wang <jiong.wang@arm.com>
1642
1643 * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PREL21): New entry.
1644 * bfd-in2.h: Regenerate.
1645 * libbfd.h: Regenerate.
1646 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1647 BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1648
1649 2015-07-10 H.J. Lu <hongjiu.lu@intel.com>
1650
1651 PR binutils/18656
1652 * bfd.c (bfd_convert_section_size): New function.
1653 (bfd_convert_section_contents): Likewise.
1654 * bfd-in2.h: Regenerated.
1655
1656 2015-07-09 Catherine Moore <clm@codesourcery.com>
1657
1658 * elflink.c (bfd_elf_size_dynamic_sections): Call to
1659 _bfd_elf_maybe_strip_eh_frame_hdr should be before
1660 bed->elf_backend_size_dynamic_sections.
1661
1662 2015-07-08 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
1663
1664 * elf32-avr.c: Add 32 bit PC relative relocation for AVR target.
1665
1666 2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
1667
1668 * elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value
1669 plus addend rather than the original st_value when looking up
1670 entries in opd->adjust.
1671
1672 2015-07-03 Kai Tietz <ktietz@redhat.com>
1673 Nick Clifton <nickc@redhat.com>
1674
1675 PR ld/11539
1676 * coffcode.h (coff_bfd_gc_sections): Define default
1677 to bfd_coff_gc_sections function.
1678 (coff_gc_mark_hook_fn): New type.
1679 * coffgen.c (init_reloc_cookie): Copy and adjust coff
1680 related code about gc-sections from elflink.c to here.
1681 (fini_reloc_cookie): Likewise.
1682 (init_reloc_cookie_rels): Likewise.
1683 (fini_reloc_cookie_rels): Likewise.
1684 (init_reloc_cookie_for_section): Likewise.
1685 (fini_reloc_cookie_for_section): Likewise.
1686 (_bfd_coff_gc_mark_hook): Likewise.
1687 (_bfd_coff_gc_mark_rsec): Likewise.
1688 (_bfd_coff_gc_mark_reloc): Likewise.
1689 (_bfd_coff_gc_mark): Likewise.
1690 (_bfd_coff_gc_mark_extra_sections): Likewise.
1691 (coff_gc_sweep_symbol_info): Likewise.
1692 (coff_gc_sweep_symbol): Likewise.
1693 (gc_sweep_hook_fn): Likewise.
1694 (coff_gc_sweep): Likewise.
1695 (bfd_coff_gc_sections): Likewise.
1696 (_bfd_coff_gc_keep): Likewise.
1697 * libcoff-in.h (coff_reloc_cookie): New struct.
1698 (bfd_coff_gc_sections): New prototype.
1699 * libcoff.h: Regenerate.
1700
1701 2015-07-01 Sandra Loosemore <sandra@codesourcery.com>
1702 Cesar Philippidis <cesar@codesourcery.com>
1703
1704 * bfd-in2.h: Regenerated.
1705 * elf32-nios2.c (elf_nios2_howto_table_rel): Rename to...
1706 (elf_nios2_r1_howto_table_rel): This.
1707 (elf_nios2_r2_howto_table_rel): New.
1708 (BFD_IS_R2): New.
1709 (lookup_howto): Add ABFD parameter. Adjust to look up in either
1710 the R1 or R2 relocation table, as determined by ABFD.
1711 (nios2_reloc_map): Add R2 relocations.
1712 (nios2_elf32_bfd_reloc_type_lookup): Do lookup using lookup_howto.
1713 Pass it the ABFD parameter.
1714 (nios2_elf32_bfd_reloc_name_lookup): Use ABFD to decide whether to
1715 return an R1 or R2 relocation.
1716 (nios2_elf32_info_to_howto): Do lookup using lookup_howto.
1717 Pass it the ABFD parameter.
1718 (nios2_elf32_do_call26_relocate): Check for alignment on a 4-byte
1719 boundary.
1720 (nios2_elf32_relocate_section): Adjust call to lookup_howto.
1721 * libbfd.h: Regenerated.
1722 * reloc.c (BFD_RELOC_NIOS2_R2_S12): New.
1723 (BFD_RELOC_NIOS2_R2_I10_1_PCREL): New.
1724 (BFD_RELOC_NIOS2_R2_T1I7_1_PCREL): New.
1725 (BFD_RELOC_NIOS2_R2_T1I7_2): New.
1726 (BFD_RELOC_NIOS2_R2_T2I4): New.
1727 (BFD_RELOC_NIOS2_R2_T2I4_1): New.
1728 (BFD_RELOC_NIOS2_R2_T2I4_2): New.
1729 (BFD_RELOC_NIOS2_R2_X1I7_2): New.
1730 (BFD_RELOC_NIOS2_R2_X2L5): New.
1731 (BFD_RELOC_NIOS2_R2_F1I5_2): New.
1732 (BFD_RELOC_NIOS2_R2_L5I4X1): New.
1733 (BFD_RELOC_NIOS2_R2_T1X1I6): New.
1734 (BFD_RELOC_NIOS2_R2_T1X1I6_2): New.
1735
1736 2015-07-01 Sandra Loosemore <sandra@codesourcery.com>
1737 Cesar Philippidis <cesar@codesourcery.com>
1738
1739 * archures.c (bfd_mach_nios2r1, bfd_mach_nios2r2): New.
1740 * bfd-in2.h: Regenerated.
1741 * cpu-nios2.c (nios2_compatible): New.
1742 (N): Use nios2_compatible instead of bfd_default_compatible.
1743 (NIOS2R1_NEXT, NIOS2R2_NEXT): Define.
1744 (arch_info_struct): New.
1745 (bfd_nios2_arch): Chain to NIOS2R1_NEXT.
1746 * elf32-nios2.c (is_nios2_elf): New.
1747 (nios2_elf32_merge_private_bfd_data): New.
1748 (nios2_elf32_object_p): New.
1749 (bfd_elf32_bfd_merge_private_bfd_data): Define.
1750 (elf_backend_object_p): Define.
1751
1752 2015-07-01 H.J. Lu <hongjiu.lu@intel.com>
1753
1754 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Refactor.
1755
1756 2015-06-30 Nick Clifton <nickc@redhat.com>
1757
1758 PR binutils/18570
1759 * elf-attrs.c (obj_attr_size): Use an unsigned int type for the tag.
1760 (write_obj_attribute): Likewise.
1761 (elf_new_obj_attr): Likewise.
1762 (bfd_elf_get_obj_attr_int): Likewise.
1763 (bfd_elf_add_obj_attr_int): Likewise.
1764 (bfd_elf_add_obj_attr_string): Likewise.
1765 (bfd_elf_add_obj_attr_int_string): Likewise.
1766 (gnu_obj_attrs_arg_type): Likewise.
1767 (_bfd_elf_obj_attrs_arg_type): Likewise.
1768 (_bfd_elf_parse_attributes): Likewise.
1769 (_bfd_elf_merge_unknown_attribute_list): Likewise.
1770 * elf-bfd.h (struct obj_attribute_list): Likewise.
1771 Update prototypes.
1772
1773 2015-06-28 H.J. Lu <hongjiu.lu@intel.com>
1774
1775 * bfd-in.h (compressed_debug_section_type): Remove
1776 COMPRESS_DEBUG_ZLIB.
1777 * bfd-in2.h : Regenerated.
1778
1779 2015-06-26 Matthew Fortune <matthew.fortune@imgtec.com>
1780
1781 * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable
1782 instead of !shared to indicate an application vs shared library.
1783 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1784 (_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL.
1785 (_bfd_mips_elf_get_target_dtag): Likewise.
1786
1787 2015-06-25 DJ Delorie <dj@redhat.com>
1788
1789 * elf32-msp430.c (msp430_final_link_relocate): Fix comments. Fix
1790 REL loads to match RELA stores.
1791
1792 2015-06-25 H.J. Lu <hongjiu.lu@intel.com>
1793
1794 * elf.c (_bfd_elf_compute_section_file_positions): Don't
1795 initialize sh_size for .shstrtab here.
1796
1797 2015-06-25 H.J. Lu <hongjiu.lu@intel.com>
1798
1799 PR gas/18451
1800 * elf-bfd.h (elf_sym_strtab): New.
1801 (elf_link_hash_table): Add strtabcount, strtabsize and
1802 strtab.
1803 (_bfd_elf_stringtab_init): Removed.
1804 * elf.c (_bfd_elf_stringtab_init): Removed.
1805 (_bfd_elf_compute_section_file_positions): Replace
1806 bfd_strtab_hash/_bfd_elf_stringtab_init/_bfd_stringtab_free/
1807 _bfd_stringtab_size with
1808 elf_strtab_hash/_bfd_elf_strtab_init/_bfd_elf_strtab_free/
1809 _bfd_elf_strtab_size. Use _bfd_elf_strtab_add,
1810 _bfd_elf_strtab_finalize and _bfd_elf_strtab_offset to get
1811 st_name.
1812 (swap_out_syms): Likewise.
1813 * elflink.c (elf_final_link_info): Replace bfd_strtab_hash
1814 with elf_strtab_hash. Remove symbuf, symbuf_count,
1815 symbuf_size and shndxbuf_size.
1816 (elf_link_flush_output_syms): Removed.
1817 (elf_link_output_sym): Renamed to ...
1818 (elf_link_output_symstrtab): This. Replace _bfd_stringtab_add
1819 with _bfd_elf_strtab_add. Don't flush symbols to the file nor
1820 swap out symbols.
1821 (elf_link_swap_symbols_out): New.
1822 (elf_link_output_extsym): Replace elf_link_output_sym with
1823 elf_link_output_symstrtab.
1824 (elf_link_input_bfd): Likewise.
1825 (elf_final_link_free): Replace _bfd_stringtab_free with
1826 _bfd_elf_strtab_free. Remove symbuf.
1827 (bfd_elf_final_link): Replace _bfd_elf_stringtab_init with
1828 _bfd_elf_strtab_init. Don't set symbuf, symbuf_count,
1829 symbuf_size nor shndxbuf_size. Initialize strtabsize and
1830 strtab. Initialize symshndxbuf to -1 when number of sections
1831 >= 64K. Replace elf_link_output_sym/elf_link_output_sym with
1832 elf_link_output_symstrtab/elf_link_output_symstrtab. Don't
1833 call elf_link_flush_output_syms. Call _bfd_elf_strtab_finalize
1834 and elf_link_swap_symbols_out. Replace _bfd_stringtab_size
1835 and _bfd_stringtab_emit with _bfd_elf_strtab_size and
1836 _bfd_elf_strtab_emit.
1837
1838 2015-06-24 H.J. Lu <hongjiu.lu@intel.com>
1839
1840 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Silence older
1841 GCC warning.
1842
1843 2015-06-24 H.J. Lu <hongjiu.lu@intel.com>
1844
1845 * elf32-i386.c (elf_i386_allocate_dynrelocs): Always allocate
1846 space for the first .plt entry.
1847 (elf_i386_size_dynamic_sections): Always add DT_PLTGOT for .plt
1848 section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1849 there are PLT relocations.
1850 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Always
1851 allocate space for the first .plt entry.
1852 (elf_x86_64_size_dynamic_sections): Always add DT_PLTGOT for
1853 .plt section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1854 there are PLT relocations.
1855
1856 2015-06-24 H.J. Lu <hongjiu.lu@intel.com>
1857
1858 PR ld/18591
1859 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert
1860 R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation
1861 overflow.
1862
1863 2015-06-23 Jiong Wang <jiong.wang@arm.com>
1864
1865 * elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function.
1866 (elfNN_aarch64_size_dynamic_sections): Traverse hash table to check
1867 relocations against read-only sections.
1868
1869 2015-06-18 Nick Clifton <nickc@redhat.com>
1870
1871 PR 18481
1872 * elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.
1873
1874 2015-06-15 Jon Turney <jon.turney@dronecode.org.uk>
1875
1876 * bfd.c: Change struct bfd_build_id to use bfd_size_type.
1877 * bfd-in2.h : Regenerate.
1878
1879 2015-06-16 Alan Modra <amodra@gmail.com>
1880
1881 * elf32-ppc.c (ppc_elf_relocate_section): Correct binary search of
1882 dynamic relocs.
1883
1884 2015-06-10 Jon Turney <jon.turney@dronecode.org.uk>
1885
1886 * elf-bfd.h : Remove struct elf_build_id.
1887 * bfd.c : Add struct bfd_build_id.
1888 * bfd-in2.h: Regenerate.
1889 * elf.c (elfobj_grok_gnu_build_id): Update to use bfd_build_id.
1890 * libpei.h: Add protoype and macros for
1891 bfd_XXi_slurp_codeview_record.
1892 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Make public
1893 * peicode.h (pe_bfd_read_buildid): Add.
1894 (pe_bfd_object_p): Use pe_bfd_read_buildid().
1895
1896 2015-06-15 Renlin Li <renlin.li@arm.com>
1897
1898 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry.
1899 * bfd-in2.h: Regenerate.
1900 * libbfd.h: Regenerate.
1901 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1902 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15.
1903
1904 2015-06-15 Alan Modra <amodra@gmail.com>
1905
1906 * cofflink.c (_bfd_coff_generic_relocate_section): Revert
1907 2014-03-26 change. Call _bfd_clear_contents for relocs against
1908 local and global symbols defined in discarded input sections.
1909
1910 2015-06-05 Nick Clifton <nickc@redhat.com>
1911
1912 * elf32-msp430.c (rl78_sym_diff_handler): New function.
1913 (msp430_howto_table): Use the new function for the SYM_DIFF reloc.
1914 (msp430x_howto_table): Likewise.
1915
1916 2015-06-05 Alan Modra <amodra@gmail.com>
1917
1918 * elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
1919 relocs with insns moved by --ppc476-workaround. Correct
1920 output of REL16 relocs.
1921
1922 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1923
1924 * elfnn-aarch64.c (aarch64_reloc_got_type): Support
1925 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1926 (elfNN_aarch64_final_link_relocate): Ditto.
1927 (elfNN_aarch64_gc_swap_hook): Ditto.
1928 (elfNN_aarch64_check_relocs): Ditto.
1929 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1930
1931 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1932
1933 * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
1934 * bfd-in2.h: Regenerate.
1935 * libbfd.h: Regenerate.
1936 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1937 BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1938
1939 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1940
1941 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
1942 complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1943 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
1944 PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1945
1946 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1947
1948 * elfnn-aarch64.c (aarch64_reloc_got_type): Support
1949 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
1950 (elfNN_aarch64_final_link_relocate): Ditto.
1951 (elfNN_aarch64_gc_swap_hook): Ditto.
1952 (elfNN_aarch64_check_relocs): Ditto.
1953 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1954
1955 2015-06-01 Jiong Wang <jiong.wang@arm.com>
1956
1957 * reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
1958 * bfd-in2.h: Regenerate.
1959 * libbfd.h: Regenerate.
1960 * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1961 BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
1962
1963 2015-05-28 Catherine Moore <clm@codesourcery.com>
1964 Bernd Schmidt <bernds@codesourcery.com>
1965 Paul Brook <paul@codesourcery.com>
1966
1967 bfd/
1968 * bfd-in2.h: Regenerated.
1969 * elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
1970 (COMPACT_EH_CANT_UNWIND_OPCODE): Define.
1971 (dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
1972 eh_frame_hdr_info.
1973 (compact_eh_frame_hdr_info): Declare.
1974 (eh_frame_hdr_info): Redeclare with union for dwarf-specific
1975 fields and compact-eh fields.
1976 (elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
1977 (bfd_elf_section_data): Add eh_frame_entry_field.
1978 (elf_section_eh_frame_entry): Define.
1979 (bfd_elf_parse_eh_frame_entries): Declare.
1980 (_bfd_elf_parse_eh_frame_entry): Declare.
1981 (_bfd_elf_end_eh_frame_parsing): Declare.
1982 (_bfd_elf_write_section_eh_frame_entry): Declare.
1983 (_bfd_elf_eh_frame_entry_present): Declare.
1984 (_bfd_elf_section_for_symbol): Declare.
1985 * elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
1986 (bfd_elf_record_eh_frame_entry): New function.
1987 (_bfd_elf_parse_eh_frame_entry): New function.
1988 (_bfd_elf_parse_eh_frame): Update hdr_info field references.
1989 (cmp_eh_frame_hdr): New function.
1990 (add_eh_frame_hdr_terminator): New function.
1991 (_bfd_elf_end_eh_frame_parsing): New function.
1992 (find_merged_cie): Update hdr_info field references.
1993 (_bfd_elf_discard_section_eh_frame): Likewise.
1994 (_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
1995 (_bfd_elf_eh_frame_entry_present): New function.
1996 (_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
1997 (_bfd_elf_write_section_eh_frame_entry): New function.
1998 (_bfd_elf_write_section_eh_frame): Update hdr_info field references.
1999 (_bfd_elf_fixup_eh_frame_hdr): New function.
2000 (write_compact_eh_frame_hdr): New function.
2001 (write_dwarf_eh_frame_hdr): New function.
2002 (_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
2003 * elflink.c (_bfd_elf_section_for_symbol): New function.
2004 (elf_section_ignore_discarded_relocs): Add Compact EH support.
2005 (elf_link_input_bfd): Likewise.
2006 (bfd_elf_final_link): Likewise.
2007 (_bfd_elf_gc_mark): Likewise.
2008 (bfd_elf_parse_eh_frame_entries): New function.
2009 (bfd_elf_gc_sections): Add Compact EH support.
2010 (bfd_elf_discard_info): Likewise.
2011 * elfxx-mips.c: Include dwarf2.h.
2012 (_bfd_mips_elf_compact_eh_encoding): New function.
2013 (_bfd_mips_elf_cant_unwind_opcode): New function.
2014 * elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
2015 (_bfd_mips_elf_cant_unwind_opcode): Declare.
2016 (elf_backend_compact_eh_encoding): Define.
2017 (elf_backend_cant_unwind_opcode): Define.
2018 * elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
2019 (elf_backend_cant_unwind_opcode): Provide default.
2020 (elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
2021 elf_backend_cant_unwind_opcode.
2022 * section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.
2023
2024 2015-05-27 H.J. Lu <hongjiu.lu@intel.com>
2025
2026 PR binutils/18458
2027 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
2028 for now binding only if pointer equality isn't needed.
2029 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
2030 binding only if pointer equality isn't needed.
2031 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
2032 section for now binding only if pointer equality isn't needed.
2033 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
2034 binding only if pointer equality isn't needed.
2035
2036 2015-05-26 H.J. Lu <hongjiu.lu@intel.com>
2037
2038 PR binutils/18437
2039 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
2040 in .rel.plt/.rela.plt.
2041 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
2042
2043 2015-05-19 Jiong Wang <jiong.wang@arm.com>
2044
2045 * elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
2046 relocation case labels alphabetically.
2047 (elfNN_aarch64_final_link_relocate): Ditto.
2048 (elfNN_aarch64_tls_relax): Ditto.
2049 (elfNN_aarch64_relocate_section): Ditto.
2050 (elfNN_aarch64_gc_sweep_hook): Ditto.
2051 (elfNN_aarch64_check_relocs): Ditto.
2052 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
2053 (_bfd_aarch64_elf_resolve_relocation): Ditto.
2054
2055 2015-05-18 Jiong Wang <jiong.wang@arm.com>
2056
2057 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite
2058 comments.
2059
2060 2015-05-16 H.J. Lu <hongjiu.lu@intel.com>
2061
2062 * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
2063 for now binding.
2064 (elf_i386_allocate_dynrelocs): Use .plt.got section for now
2065 binding.
2066 * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
2067 section for now binding.
2068 (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
2069 binding.
2070
2071 2015-05-14 H.J. Lu <hongjiu.lu@intel.com>
2072
2073 * bfd.c (bfd_update_compression_header): Also write the zlib
2074 header if the SHF_COMPRESSED bit cleared..
2075 (bfd_check_compression_header): Return the uncompressed size.
2076 * compress.c (decompress_contents): Don't skip the zlib header.
2077 (bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
2078 which doesn't have the zlib header.
2079 (bfd_init_section_decompress_status): Likewise.
2080 (bfd_get_full_section_contents): Updated.
2081 (bfd_is_section_compressed): Likewise.
2082 (bfd_is_section_compressed_with_header): Return the uncompressed
2083 size.
2084 * elf.c (_bfd_elf_make_section_from_shdr): Updated.
2085 * bfd-in2.h: Regenerated.
2086
2087 2015-05-14 Jiong Wang <jiong.wang@arm.com>
2088
2089 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow
2090 check restrictions.
2091
2092 2015-05-14 Max Filippov <jcmvbkbc@gmail.com>
2093
2094 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
2095 as GOT reference when plt.refcount is not positive.
2096
2097 2015-05-12 H.J. Lu <hongjiu.lu@intel.com>
2098
2099 * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
2100 for the first .plt entry only if needed.
2101 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2102
2103 2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
2104
2105 * Makefile.am (ALL_MACHINES): Add cpu-iamcu.lo.
2106 (ALL_MACHINES_CFILES): Likewise.
2107 * archures.c (bfd_mach_iamcu): New.
2108 (bfd_mach_i386_iamcu): Likewise.
2109 (bfd_mach_i386_iamcu_intel_syntax): Likewise.
2110 (bfd_iamcu_arch): Likewise.
2111 (bfd_archures_list): Add &bfd_iamcu_arch.
2112 * config.bfd (targ_selvecs): Add iamcu_elf32_vec to
2113 i386_elf32_vec.
2114 (targ_archs): Add bfd_iamcu_arch if needed.
2115 * configure.ac: Support iamcu_elf32_vec.
2116 * cpu-iamcu.c: New file.
2117 * elf32-i386.c (elf32_iamcu_elf_object_p): New function.
2118 Add support for iamcu_elf32_vec and elf32_iamcu_bed.
2119 * targets.c (iamcu_elf32_vec): New.
2120 (_bfd_target_vector): Add iamcu_elf32_vec.
2121 * Makefile.in: Regenerated.
2122 * bfd-in2.h: Likewise.
2123 * configure: Likewise.
2124
2125 2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
2126
2127 * elfcode.h (elf_object_p): Replace EM_486 with EM_IAMCU.
2128
2129 2015-05-10 H.J. Lu <hongjiu.lu@intel.com>
2130
2131 * elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
2132 and output_bfd with abfd.
2133 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
2134
2135 2015-05-06 Toni Spets <toni.spets@iki.fi>
2136
2137 PR ld/18372
2138 * peXXigen.c (rsrc_process_section): Skip discarded resource
2139 sections.
2140
2141 2015-05-01 H.J. Lu <hongjiu.lu@intel.com>
2142
2143 * config.bfd: Support i[3-7]86-*-elf*.
2144
2145 2015-04-30 H.J. Lu <hongjiu.lu@intel.com>
2146
2147 * elf32-i386.c (elf_backend_post_process_headers): Undef for
2148 Solaris 2.
2149
2150 2015-04-30 Nick Clifton <nickc@redhat.com>
2151
2152 PR 18317
2153 * elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
2154 mep_reloc.
2155 (mep_reloc): Delete unused function.
2156
2157 2015-04-29 Nick Clifton <nickc@redhat.com>
2158
2159 PR 17099
2160 * coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
2161 relocs.
2162
2163 2015-04-27 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2164
2165 * elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
2166 * elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
2167 elf_s390_merge_obj_attributes.
2168 * elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.
2169
2170 2015-04-24 Jiong Wang <jiong.wang@arm.com>
2171
2172 PR ld/18270
2173 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
2174 GOT_NORMAL for both sgot/srelgot section.
2175 (elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
2176 and generate necessary runtime relocation for GOT entry.
2177
2178 2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
2179
2180 PR binutils/18209
2181 * archive.c (_bfd_get_elt_at_filepos): Copy is_linker_input.
2182
2183 2015-04-24 Jiong Wang <jiong.wang@arm.com>
2184
2185 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
2186 PC-relative relocation for external symbol.
2187
2188 2015-04-24 Nick Clifton <nickc@redhat.com>
2189
2190 PR 18313
2191 * compress.c (decompress_contents): Zero initialse the z_stream
2192 structure.
2193
2194 2015-04-24 Nick Clifton <nickc@redhat.com>
2195
2196 * elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
2197 local labels to include local labels with a numeric suffix and
2198 fake symbols.
2199
2200 2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
2201
2202 PR binutils/18316
2203 * section.c (SEC_MEP_VLIW): New.
2204 * bfd-in2.h: Regenerated.
2205
2206 2015-04-23 H.J. Lu <hongjiu.lu@intel.com>
2207
2208 PR ld/18277
2209 * compress.c (bfd_compress_section_contents): Remove the
2210 write_compress argument.
2211 (bfd_init_section_compress_status): Updated.
2212 (bfd_compress_section): Likewise.
2213 * elf.c (_bfd_elf_set_reloc_sh_name): New.
2214 (_bfd_elf_init_reloc_shdr): Add delay_st_name_p. Set sh_name
2215 to (unsigned int) -1 if delay_st_name_p is TRUE. Use
2216 _bfd_elf_set_reloc_sh_name.
2217 (elf_fake_sections): Don't rename DWARF debug section for
2218 linker output if it will be compressed. Instead, set
2219 delay_st_name_p to TRUE and pass it to _bfd_elf_init_reloc_shdr.
2220 (assign_section_numbers): Call _bfd_elf_strtab_addref only if
2221 sh_name != (unsigned int) -1. Don't finalize nor assign
2222 shstrtab section here. Delay setting output section names to
2223 _bfd_elf_write_object_contents.
2224 (_bfd_elf_compute_section_file_positions): Update comments on
2225 sh_offset for shstrtab section.
2226 (assign_file_positions_for_non_load_sections): Set sh_offset to
2227 -1 for shstrtab section.
2228 (assign_file_positions_except_relocs): Likewise.
2229 (_bfd_elf_assign_file_positions_for_non_load): Set up sh_name
2230 when compressing DWARF debug sections. Place shstrtab section
2231 after DWARF debug sections have been compressed.
2232 (_bfd_elf_write_object_contents): Setting sh_name for output
2233 sections.
2234
2235 2015-04-23 H.J. Lu <hongjiu.lu@intel.com>
2236
2237 PR binutils/18209
2238 * bfd.c (bfd): Add is_linker_input.
2239 * elf.c (convert_debug_to_zdebug): New.
2240 (convert_zdebug_to_debug): Likewise.
2241 (_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
2242 .zdebug_* here. Use convert_zdebug_to_debug. Set SEC_ELF_RENAME.
2243 (_bfd_elf_init_reloc_shdr): Pass a pointer to section name
2244 instead of a pointer to section.
2245 (elf_fake_sections): Rename the section name if SEC_ELF_RENAME
2246 is set.
2247 * section.c (SEC_ELF_RENAME): New.
2248 * bfd-in2.h: Regenerated.
2249
2250 2015-04-23 Alan Modra <amodra@gmail.com>
2251
2252 * elf64-ppc.c (TOC_BASE_ALIGN): Define.
2253 (ppc64_elf_next_toc_section): Align multi-got toc base.
2254 (ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol.
2255
2256 2015-04-22 H.J. Lu <hongjiu.lu@intel.com>
2257
2258 PR ld/18289
2259 * elf32-i386.c (elf_i386_link_hash_entry): Add gotoff_ref.
2260 (elf_i386_link_hash_newfunc): Initialize gotoff_ref to 0.
2261 (elf_i386_create_dynamic_sections): Always allow copy relocs for
2262 building executables.
2263 (elf_i386_copy_indirect_symbol): Also copy gotoff_ref.
2264 (elf_i386_check_relocs): Set gotoff_ref for R_386_GOTOFF.
2265 (elf_i386_adjust_dynamic_symbol): Also allocate copy relocs for
2266 PIE and R_386_GOTOFF.
2267 (elf_i386_relocate_section): Allow R_386_GOTOFF in executable.
2268
2269 2015-04-20 H.J. Lu <hongjiu.lu@intel.com>
2270
2271 * elf.c (assign_section_numbers): Always set up sh_name.
2272
2273 2015-04-20 H.J. Lu <hongjiu.lu@intel.com>
2274
2275 * elf.c (assign_file_positions_for_non_load_sections): Iterate
2276 sections by pointer.
2277 (_bfd_elf_assign_file_positions_for_non_load): Likewise.
2278
2279 2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
2280
2281 * bfd-in.h (compressed_debug_section_type): New.
2282 * compress.c (bfd_compress_section_contents): Add an argument
2283 for linker write compression and always generate .zdebug_*
2284 section when linking.
2285 (bfd_init_section_compress_status): Pass FALSE to
2286 bfd_compress_section_contents.
2287 (bfd_compress_section): New function.
2288 * elf.c (elf_fake_sections): For linking, set SEC_ELF_COMPRESS
2289 on DWARF debug sections if COMPRESS_DEBUG is set and rename
2290 section if COMPRESS_DEBUG_GABI_ZLIB isn't set.
2291 (assign_file_positions_for_non_load_sections): Set sh_offset
2292 to -1 if SEC_ELF_COMPRESS is set.
2293 (assign_file_positions_except_relocs): Likwise.
2294 (_bfd_elf_assign_file_positions_for_relocs): Renamed to ...
2295 (_bfd_elf_assign_file_positions_for_non_load): This. Change
2296 return time to bfd_boolean. Compress the section if
2297 SEC_ELF_COMPRESS is set.
2298 (_bfd_elf_write_object_contents): Updated.
2299 (_bfd_elf_set_section_contents): Write section contents to
2300 the buffer if SEC_ELF_COMPRESS is set.
2301 * merge.c: Include "elf-bfd.h".
2302 (sec_merge_emit): Add arguments for contents and offset. Write
2303 to contents with offset if contents isn't NULL.
2304 (_bfd_write_merged_section): Write section contents to the
2305 buffer if SEC_ELF_COMPRESS is set. Pass contents and
2306 output_offset to sec_merge_emit.
2307 * elflink.c (bfd_elf_final_link): Allocate the buffer for
2308 output section contents if SEC_ELF_COMPRESS is set.
2309 * section.c (SEC_ELF_COMPRESS): New.
2310 * bfd-in2.h: Regenerated.
2311
2312 2015-04-15 Alan Modra <amodra@gmail.com>
2313
2314 * elf32-rl78.c (rl78_elf_relocate_section): Typo fix.
2315
2316 2015-04-14 Nick Clifton <nickc@redhat.com>
2317
2318 * elf32-rl78.c (RL78_OP_REL): New macro.
2319 (rl78_elf_howto_table): Use it for complex relocs.
2320 (get_symbol_value): Handle the cases when the info or status
2321 arguments are NULL.
2322 (get_romstart): Cache the status returned by get_symbol_value.
2323 (get_ramstart): Likewise.
2324 (RL78_STACK_PUSH): Generate an error message if the stack
2325 overflows.
2326 (RL78_STACK_POP): Likewise for underflows.
2327 (rl78_compute_complex_reloc): New function. Contains the basic
2328 processing code for all RL78 complex relocs.
2329 (rl78_special_reloc): New function. Provides special reloc
2330 handling for complex relocs.
2331 (rl78_elf_relocate_section): Use rl78_compute_complex_reloc.
2332 (rl78_offset_for_reloc): Likewise.
2333
2334 2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
2335
2336 PR ld/pr17709
2337 * elflink.c (_bfd_elf_adjust_dynamic_copy): Check
2338 info->extern_protected_data when warning copy relocs against
2339 protected symbols.
2340 (_bfd_elf_symbol_refs_local_p): Check info->extern_protected_data
2341 when checking protected non-function symbols.
2342
2343 2015-04-13 John Baldwin <jhb@FreeBSD.org>
2344
2345 * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on
2346 FreeBSD.
2347 (elfcore_write_xstatereg): Use correct note name on FreeBSD.
2348
2349 2015-04-13 H.J. Lu <hongjiu.lu@intel.com>
2350
2351 PR ld/18250
2352 * elflink.c (elf_link_is_defined_archive_symbol): Return FALSE
2353 if the object has been claimed by plugin.
2354
2355 2015-04-11 H.J. Lu <hongjiu.lu@intel.com>
2356
2357 * elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
2358 with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
2359 protected data symbol when building shared library.
2360 * elf64-x86-64.c (elf_x86_64_relocate_section): Check
2361 R_X86_64_GOTOFF64 against undefined symbol and replace
2362 SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL when checking
2363 R_X86_64_GOTOFF64 against protected data symbol when building
2364 shared library.
2365
2366 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
2367
2368 PR ld/pr17709
2369 * elf32-i386.c (elf_i386_relocate_section): Also check R_386_GOTOFF
2370 against protected data symbol when building shared library.
2371 * elf64-x86-64.c (elf_x86_64_relocate_section): Also check
2372 R_X86_64_GOTOFF64 against protected data symbol when building
2373 shared library.
2374
2375 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
2376
2377 PR ld/pr15228
2378 PR ld/pr17709
2379 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
2380 * elf32-i386.c (elf_backend_extern_protected_data): New.
2381 Defined to 1.
2382 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2383 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
2384 copy relocs against protected symbols if extern_protected_data
2385 is true.
2386 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
2387 non-function symbols if extern_protected_data is true.
2388 * elfxx-target.h (elf_backend_extern_protected_data): New.
2389 Default to 0.
2390 (elfNN_bed): Initialize extern_protected_data with
2391 elf_backend_extern_protected_data.
2392
2393 2015-04-10 H.J. Lu <hongjiu.lu@intel.com>
2394
2395 * compress.c (bfd_compress_section_contents): Replace bfd_malloc
2396 and free with bfd_alloc and bfd_release on compressed buffer.
2397 Release buffer if compressed section isn't smaller.
2398
2399 2015-04-10 Alan Modra <amodra@gmail.com>
2400
2401 PR ld/18222
2402 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error
2403 on adding a protected visibility variable to .dynbss.
2404
2405 2015-04-10 Alan Modra <amodra@gmail.com>
2406
2407 Revert 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
2408 PR ld/pr15228
2409 PR ld/pr17709
2410 * elf-bfd.h (elf_backend_data): Delete extern_protected_data.
2411 * elf32-i386.c (elf_backend_extern_protected_data): Delete.
2412 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2413 * elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
2414 extern_protected_data test.
2415 (_bfd_elf_symbol_refs_local_p): Likewise.
2416 * elfxx-target.h (elf_backend_extern_protected_data): Delete.
2417 (elfNN_bed): Delete elf_backend_extern_protected_data init.
2418
2419 2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
2420
2421 * compress.c (bfd_compress_section_contents): Update comments.
2422 (bfd_init_section_decompress_status): Likewise.
2423 (bfd_init_section_compress_status): Likewise.
2424
2425 2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
2426
2427 * elfxx-target.h (TARGET_BIG_SYM): Add BFD_COMPRESS_GABI to
2428 object_flags.
2429 (TARGET_LITTLE_SYM): Likewise.
2430
2431 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2432
2433 * elf32-xtensa.c (splay-tree.h): include header.
2434 (text_action_struct): drop next pointer.
2435 (text_action_list_struct): drop head pointer, add count and
2436 tree fields.
2437 (find_fill_action): instead of linear search in text_action_list
2438 search in the tree.
2439 (text_action_compare, action_first, action_next): new functions.
2440 (text_action_add, text_action_add_literal): instead of linear
2441 search and insertion insert new node into the tree.
2442 (removed_by_actions): pass additional parameter: action_list,
2443 use it to traverse the tree.
2444 (offset_with_removed_text): pass additional action_list parameter
2445 to removed_by_actions.
2446 (map_action_fn_context): new typedef.
2447 (map_action_fn_context_struct): new structure.
2448 (map_action_fn): new function.
2449 (map_removal_by_action): use splay_tree_foreach to build map.
2450 (find_insn_action): replace linear search in text_action_list
2451 with series of splay_tree_lookups.
2452 (print_action, print_action_list_fn): new functions.
2453 (print_action_list): use splay_tree_foreach.
2454 (init_xtensa_relax_info): drop action_list.head initialization.
2455 Initialize the tree.
2456 (compute_text_actions): use non-zero action_list_count instead of
2457 non-NULL action list.
2458 (xlate_map_context): new typedef.
2459 (xlate_map_context_struct): new structure.
2460 (xlate_map_fn): new function.
2461 (build_xlate_map): use splay_tree_foreach to build map.
2462 (action_remove_bytes_fn): new function.
2463 (relax_section): use zero action_list_count instead of NULL
2464 action list. Use splay_tree_foreach to count final section size.
2465 Drop unused variable 'removed'.
2466
2467 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2468
2469 * elf32-xtensa.c (removed_literal_map_entry): new typedef.
2470 (removed_literal_map_entry_struct): new structure.
2471 (removed_literal_list_struct): add new fields: n_map and map.
2472 (map_removed_literal, removed_literal_compare): new functions.
2473 (find_removed_literal): build index array for literals ordered
2474 by VMA, use binary search to find removed literal.
2475
2476 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2477
2478 * elf32-xtensa.c (removal_by_action_entry_struct,
2479 removal_by_action_map_struct): new structures.
2480 (removal_by_action_entry, removal_by_action_map): new typedefs.
2481 (text_action_list_struct): add new field: map.
2482 (map_removal_by_action, removed_by_actions_map,
2483 offset_with_removed_text_map): new functions.
2484 (relax_section): replace offset_with_removed_text with
2485 offset_with_removed_text_map.
2486 (translate_reloc, relax_property_section, relax_section_symbols):
2487 replace removed_by_actions with removed_by_actions_map.
2488
2489 2015-04-09 Max Filippov <jcmvbkbc@gmail.com>
2490
2491 * elf32-xtensa.c (reloc_range_list, reloc_range_list_entry,
2492 reloc_range): new typedef.
2493 (reloc_range_list_struct, reloc_range_list_entry_struct,
2494 reloc_range_struct): new structures.
2495 (reloc_range_compare, build_reloc_ranges,
2496 reloc_range_list_append, reloc_range_list_remove,
2497 reloc_range_list_update_range, free_reloc_range_list): new
2498 functions.
2499 (compute_text_actions): precompute relocation opcodes before the
2500 loop. Add relevant_relocs variable, initialize it before the
2501 loop, pass it to the check_section_ebb_pcrels_fit.
2502 (check_section_ebb_pcrels_fit): add new parameter:
2503 relevant_relocs. Update address range in the relevant_relocs if
2504 it's non-NULL and iterate only over relevant relocations.
2505
2506 2015-04-09 Nick Clifton <nickc@redhat.com>
2507
2508 * elf32-rx.c (describe_flags): Report the settings of the string
2509 insn using bits.
2510 (rx_elf_merge_private_bfd_data): Handle merging of the string insn
2511 using bits.
2512
2513 2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
2514
2515 * compress.c (bfd_compress_section_contents): Work around a GCC
2516 uninitialized warning bug fixed in GCC 4.7.
2517
2518 2015-04-08 H.J. Lu <hongjiu.lu@intel.com>
2519
2520 * archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
2521 bit.
2522 * bfd.c (bfd::flags): Increase size to 18 bits.
2523 (BFD_COMPRESS_GABI): New.
2524 (BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
2525 (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
2526 (bfd_update_compression_header): New fuction.
2527 (bfd_check_compression_header): Likewise.
2528 (bfd_get_compression_header_size): Likewise.
2529 (bfd_is_section_compressed_with_header): Likewise.
2530 * compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
2531 (bfd_compress_section_contents): Return the uncompressed size if
2532 the full section contents is compressed successfully. Support
2533 converting from/to .zdebug* sections.
2534 (bfd_get_full_section_contents): Call
2535 bfd_get_compression_header_size to get compression header size.
2536 (bfd_is_section_compressed): Renamed to ...
2537 (bfd_is_section_compressed_with_header): This. Add a pointer
2538 argument to return compression header size.
2539 (bfd_is_section_compressed): Use it.
2540 (bfd_init_section_decompress_status): Call
2541 bfd_get_compression_header_size to get compression header size.
2542 Return FALSE if uncompressed section size is 0.
2543 * elf.c (_bfd_elf_make_section_from_shdr): Support converting
2544 from/to .zdebug* sections.
2545 * bfd-in2.h: Regenerated.
2546
2547 2015-04-07 Alan Modra <amodra@gmail.com>
2548
2549 * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
2550 mapped to output .got section.
2551
2552 2015-04-07 Alan Modra <amodra@gmail.com>
2553
2554 * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
2555 and has_addr16_lo. Make has_sda_refs a bitfield.
2556 (ppc_elf_check_relocs): Set new flags.
2557 (ppc_elf_link_hash_table_create): Update default_params.
2558 (ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
2559 where we won't be making .dynbss entries or editing code. Set
2560 params->pic_fixup when we'll edit code for protected var access.
2561 (allocate_dynrelocs): Allocate got entry for edited code and
2562 discard dyn_relocs.
2563 (struct ppc_elf_relax_info): Add picfixup_size.
2564 (ppc_elf_relax_section): Rename struct one_fixup to struct
2565 one_branch_fixup. Rename fixups to branch_fixups. Size space for
2566 pic fixups.
2567 (ppc_elf_relocate_section): Edit non-PIC accessing protected
2568 visibility variables to PIC. Don't emit dyn_relocs for code
2569 we've edited.
2570 * elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
2571
2572 2015-04-07 Nick Clifton <nickc@redhat.com>
2573
2574 * elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
2575 local labels as local.
2576
2577 2015-04-06 H.J. Lu <hongjiu.lu@intel.com>
2578
2579 * compress.c (get_uncompressed_size): Removed.
2580 (bfd_compress_section_contents): Use bfd_putb64 to write
2581 uncompressed section size.
2582 (bfd_init_section_decompress_status): Replace
2583 get_uncompressed_size with bfd_getb64.
2584
2585 2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
2586
2587 * elf.c (_bfd_elf_init_private_section_data): Also preserve the
2588 SHF_COMPRESSED bit if not decompress.
2589
2590 2015-04-04 H.J. Lu <hongjiu.lu@intel.com>
2591
2592 * compress.c (get_uncompressed_size): New. Extracted from ...
2593 (bfd_init_section_decompress_status): This. Use it.
2594
2595 2015-04-02 Andrew Turner <andrew@freebsd.org>
2596
2597 * config.bfd: Add aarch64-*-freebsd* target triple.
2598
2599 2015-04-02 H.J. Lu <hongjiu.lu@intel.com>
2600
2601 * configure: Regenerated.
2602
2603 2015-04-01 Tejas Belagod <tejas.belagod@arm.com>
2604 Marcus Shawcroft <marcus.shawcroft@arm.com>
2605 Jiong Wang <jiong.wang@arm.com>
2606
2607 * bfd-in.h (bfd_elf64_aarch64_set_options)
2608 (bfd_elf32_aarch64_set_options): Add parameter.
2609 * bfd-in2.h: Regenerated.
2610 * elfnn-aarch64.c (aarch64_erratum_843419_stub)
2611 (_bfd_aarch64_adrp_p, _bfd_aarch64_erratum_843419_sequence_p)
2612 (_bfd_aarch64_erratum_843419_stub_name)
2613 (_bfd_aarch64_erratum_843419_fixup)
2614 (_bfd_aarch64_erratum_843419_scan)
2615 (_bfd_aarch64_erratum_843419_branch_to_stub)
2616 (_bfd_aarch64_erratum_843419_p): Define.
2617 (enum elf_aarch64_stub_type): Define
2618 aarch64_stub_erratum_843419_veneer.
2619 (struct elf_aarch64_stub_hash_entry): Define adrp_offset.
2620 (struct elf_aarch64_link_hash_table): Define fix_erratum_843419
2621 and fix_erratum_843419_adr.
2622 (stub_hash_newfunc): Initialize adrp_offset;
2623 (_bfd_aarch64_add_stub_entry_after): Define.
2624 (aarch64_map_one_stub, aarch64_build_one_stub)
2625 (aarch64_size_one_stub): Handle
2626 aarch64_stub_erratum_843419_veneer.
2627 (_bfd_aarch64_resize_stubs): Round stub section size.
2628 (elfNN_aarch64_size_stubs): Add scan for 843419.
2629 (bfd_elfNN_aarch64_set_options): Add parameter. Initialize
2630 fix_erratum_843419 and fix_erratum_843419_adr.
2631 (struct erratum_835769_branch_to_stub_data): Add info.
2632 (elfNN_aarch64_write_section): Initialise info. Handle 843419.
2633 (elfNN_aarch64_size_dynamic_sections): Handle 843419.
2634 * elfxx-aarch64.c (_bfd_aarch64_decode_adrp_imm)
2635 (_bfd_aarch64_sign_extend): Define.
2636 (reencode_adr_imm): Remove static. Rename to:
2637 (_bfd_aarch64_reencode_adr_imm): Define.
2638 (_bfd_aarch64_elf_put_addend): Call _bfd_aarch64_reencode_adr_imm.
2639 * elfxx-aarch64.h (AARCH64_ADR_OP, AARCH64_ADRP_OP)
2640 (AARCH64_ADRP_OP_MASK, _bfd_aarch64_sign_extend)
2641 (_bfd_aarch64_decode_adrp_imm, _bfd_aarch64_reencode_adr_imm):
2642 Define.
2643
2644 2015-04-01 H.J. Lu <hongjiu.lu@intel.com>
2645
2646 * configure: Regenerated.
2647
2648 2015-03-31 Ed Schouten <ed@nuxi.nl>
2649
2650 * config.bfd (targ_defvec): Set to x86_64_elf64_cloudabi_vec
2651 for x86_64-*-cloudabi*.
2652 * configure.ac: Handle x86_64_elf64_cloudabi_vec.
2653 * configure: Regenerated.
2654 * elf64-x86-64.c (TARGET_LITTLE_SYM): Support x86_64-*-cloudabi*.
2655 (TARGET_LITTLE_NAME): Likewise.
2656 (ELF_OSABI): Likewise.
2657 (elf64_bed): Likewise.
2658 * targets.c (x86_64_elf64_cloudabi_vec): New.
2659 (_bfd_target_vector): Add x86_64_elf64_cloudabi_vec.
2660
2661 2015-03-31 H.J. Lu <hongjiu.lu@intel.com>
2662
2663 * configure.ac: Revert the AM_ZLIB change.
2664 * Makefile.in: Regenerated.
2665 * aclocal.m4: Likewise.
2666 * configure: Likewise.
2667 * doc/Makefile.in: Likewise.
2668
2669 2015-03-30 H.J. Lu <hongjiu.lu@intel.com>
2670
2671 PR ld/18169
2672 * elf-bfd.h (elf_backend_data): Add get_reloc_section.
2673 (_bfd_elf_get_reloc_section): New.
2674 * elf.c (_bfd_elf_get_reloc_section): Likewise.
2675 (assign_section_numbers): Call get_reloc_section to look up the
2676 section the relocs apply.
2677 * elfxx-target.h (elf_backend_get_reloc_section): Likewise.
2678 (elfNN_bed): Initialize get_reloc_section with
2679 elf_backend_get_reloc_section.
2680
2681 2015-03-29 H.J. Lu <hongjiu.lu@intel.com>
2682
2683 * Makefile.am (ZLIB): New.
2684 (ZLIBINC): Likewise.
2685 (AM_CFLAGS): Add $(ZLIBINC).
2686 (libbfd_la_LIBADD): Add $(ZLIB).
2687 * compress.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
2688 (decompress_contents): Don't check HAVE_ZLIB_H.
2689 (bfd_compress_section_contents): Likewise.
2690 (bfd_get_full_section_contents): Likewise.
2691 (bfd_init_section_decompress_status): Likewise.
2692 (bfd_init_section_compress_status): Likewise.
2693 * configure.ac (AM_ZLIB): Removed.
2694 (zlibdir): New. AC_SUBST.
2695 (zlibinc): Likewise.
2696 Add --with-system-zlib.
2697 * Makefile.in: Regenerated.
2698 * acinclude.m4: Likewise.
2699 * config.in: Likewise.
2700 * configure: Likewise.
2701 * doc/Makefile.in: Likewise.
2702
2703 2015-03-27 Alan Modra <amodra@gmail.com>
2704
2705 PR ld/15228
2706 PR ld/18167
2707 * elflink.c (elf_merge_st_other): Add "sec" parameter. Don't set
2708 protected_def when symbol section is read-only. Adjust all calls.
2709 * elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
2710
2711 2015-03-26 Tejas Belagod <tejas.belagod@arm.com>
2712
2713 * elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic
2714 _bfd_final_link_relocate with aarch64_relocate.
2715
2716 2015-03-26 H.J. Lu <hongjiu.lu@intel.com>
2717
2718 PR ld/18160
2719 * elflink.c (elf_gc_sweep): Skip if relocation is incompatible.
2720 (bfd_elf_gc_sections): Likewise.
2721
2722 2015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
2723
2724 * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Adjust stub section
2725 size for initial branch.
2726 (elfNN_aarch64_build_stubs): Write initial branch.
2727 _bfd_aarch64_decode_(elfNN_aarch64_output_arch_local_syms): Write
2728 mapping symbol on initial branch.
2729
2730 2015-03-25 Marcus Shawcroft <marcus.shawcroft@arm.com>
2731
2732 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan):
2733 Update erratum count.
2734
2735 2015-03-25 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2736
2737 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on
2738 first matching debug section.
2739
2740 2015-03-24 H.J. Lu <hongjiu.lu@intel.com>
2741
2742 PR gas/18087
2743 * compress.c (bfd_compress_section_contents): Don't write the
2744 zlib header and set contents as well as compress_status if
2745 compression didn't make the section smaller.
2746 (bfd_init_section_compress_status): Don't check compression
2747 size here.
2748
2749 2015-03-24 Nick Clifton <nickc@redhat.com>
2750
2751 PR binutils/17512
2752 * coffgen.c (coff_get_normalized_symtab): Fix test for out of
2753 range auxillary sections.
2754
2755 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2756
2757 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor
2758 code into:
2759 (_bfd_aarch64_get_stub_for_link_section): Define.
2760
2761 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2762
2763 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
2764 update of section_group[].stub_sec.
2765
2766 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2767
2768 * elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove.
2769 (erratum_835769_scan) Drop fix_table_size_p and fixes_p arguments.
2770 Delete fixes, fix_table_size and associated code. Call
2771 _bfd_aarch64_add_stub_entry_in_group. Rename to...
2772 (bfd_aarch64_erratum_835769_scan): Define.
2773 (elfNN_aarch64_size_stubs): Delete erratum_835769_fixes,
2774 erratum_835769_fix_table_size, i and associated code. Relocate
2775 call to _bfd_aarch64_erratum_835769_scan. Delete adhoc stub size
2776 correction. Delete construction of stub entry from
2777 erratum_835769_fixes array.
2778
2779 2015-03-24 Marcus Shawcroft <marcus.shawcroft@arm.com>
2780
2781 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Use
2782 _bfd_aarch64_add_stub_entry_in_group.
2783
2784 2015-03-24 Alan Modra <amodra@gmail.com>
2785
2786 * elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
2787 stubs, even those for undefined weak symbols. Otherwise, don't
2788 report relocation overflow on branches to undefined strong
2789 symbols. Fix memory leak.
2790 * elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
2791 overflow on branches to undefined strong symbols.
2792
2793 2015-03-23 Keith Seitz <keiths@redhat.com>
2794
2795 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
2796 missing ';'.
2797
2798 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2799
2800 * elfnn-aarch64.c (erratum_835769_scan): Factor stub name
2801 construction into...
2802 (_bfd_aarch64_erratum_835769_stub_name): Define.
2803
2804 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2805
2806 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Factor out
2807 stub resize code into...
2808 (bfd_aarch64_resize_stubs): Define.
2809
2810 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2811
2812 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor stub
2813 creation code into...
2814 (bfd_aarch64_create_stub_section): Define.
2815
2816 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2817
2818 * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Rename
2819 from elf_aarch64_create_or_find_stub_sec.
2820 (_bfd_aarch64_add_stub_entry_in_group): Rename from
2821 elfNN_aarch64_add_stub. Call
2822 _bfd_aarch64_create_or_find_stub_sec.
2823 (elfNN_aarch64_size_stubs, elfNN_aarch64_size_stubs): Call
2824 _bfd_aarch64_add_stub_entry_in_group.
2825
2826 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2827
2828 * elfnn-aarch64.c (erratum_835769_scan) Add comment. Reverse
2829 sense of boolean return.
2830 (elfNN_aarch64_size_stubs): Adjust for above.
2831
2832 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2833
2834 * elfnn-aarch64.c (elf_aarch64_create_or_find_stub_sec):
2835 Remove unused parameter.
2836 (elfNN_aarch64_size_stubs): Adjust for above.
2837
2838 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2839
2840 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Remove bfd_indx.
2841
2842 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2843
2844 * elfnn-aarch64.c (aarch64_erratum_835769_fixes)
2845 (num_aarch64_erratum_835769_fixes): Remove.
2846 (elfNN_aarch64_size_stubs): Remove assignments to above.
2847
2848 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2849
2850 * elfnn-aarch64.c (aarch64_mem_op_p): Update comment. Rename rtn
2851 to rt2.
2852 (aarch64_erratum_seqeunce): Rename rtn to rt2.
2853
2854 2015-03-23 Marcus Shawcroft <marcus.shawcroft@arm.com>
2855
2856 * elfnn-aarch64.c (elfNN_aarch64_write_section): Adjust layout.
2857
2858 2015-03-19 Nick Clifton <nickc@redhat.com>
2859
2860 * elf32-rl78.c (rl78_cpu_name): New function. Prints the name of
2861 the RL78 core based upon the flags.
2862 (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
2863 flags.
2864 (rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
2865 (elf32_rl78_machine): Always return bfd_mach_rl78.
2866
2867 2015-03-19 Nick Clifton <nickc@redhat.com>
2868
2869 PR 18078
2870 * compress.c (bfd_compress_section_contents): Do not define this
2871 function if it is not used.
2872
2873 2015-03-18 H.J. Lu <hongjiu.lu@intel.com>
2874
2875 * compress.c (bfd_compress_section_contents): Make it static.
2876 * bfd/bfd-in2.h: Regenerated.
2877
2878 2015-03-18 Eric Youngdale <eyoungdale@ptc.com>
2879
2880 PR ld/16598
2881 * peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs
2882 suitable for the AMD64.
2883
2884 2015-03-18 Jon Turney <jon.turney@dronecode.org.uk>
2885 Nick Clifton <nickc@redhat.com>
2886
2887 PR binutils/18087
2888 * coffgen.c (make_a_section_from_file): Only prepend a z to a
2889 debug section's name if the section was actually compressed.
2890 * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
2891 * compress.c (bfd_init_section_compress_status): Do not compress
2892 the section if doing so would make it bigger. In such cases leave
2893 the section alone and return COMPRESS_SECTION_NONE.
2894
2895 2015-03-17 Alan Modra <amodra@gmail.com>
2896
2897 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0
2898 on nothing to do, before malloc of returned symbol array.
2899
2900 2015-03-16 Nick Clifton <nickc@redhat.com>
2901
2902 * elf32-rx.c (elf32_rx_relax_delete_bytes): If the relocs are not
2903 stored in the elf_section_data structure then load them as
2904 necessary.
2905
2906 2015-03-14 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2907
2908 * elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
2909 relocs against code sections.
2910 * elf32-s390.c: Define elf_backend_sort_relocs_p.
2911 * elf64-s390.c: Likewise.
2912
2913 2015-03-11 Alan Modra <amodra@gmail.com>
2914
2915 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
2916 reverse order. Account for larger size of __tls_get_addr_opt stub.
2917
2918 2015-03-10 Yuri Gribov <y.gribov@samsung.arm>
2919
2920 PR ld/16572
2921 * elf32-arm.c (elf32_arm_final_link_relocate): Remove support for
2922 ELF_ARM_HASENTRY.
2923 (elf32_arm_print_private_bfd_data): Likewise.
2924
2925 2015-03-06 Nick Clifton <nickc@redhat.com>
2926
2927 PR binutils/17765
2928 * elflink.c (put_value): Like previous delta, but for the 32-bit
2929 case.
2930
2931 2015-03-05 Nick Clifton <nickc@redhat.com>
2932
2933 PR binutils/17765
2934 * elflink.c (put_value): Avoid using an undefined shift
2935 operation.
2936
2937 2015-03-05 H.J. Lu <hongjiu.lu@intel.com>
2938
2939 PR ld/pr15228
2940 PR ld/pr17709
2941 * elf-bfd.h (elf_backend_data): Add extern_protected_data.
2942 * elf32-i386.c (elf_backend_extern_protected_data): New.
2943 Defined to 1.
2944 * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2945 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
2946 copy relocs against protected symbols if extern_protected_data
2947 is true.
2948 (_bfd_elf_symbol_refs_local_p): Don't return true on protected
2949 non-function symbols if extern_protected_data is true.
2950 * elfxx-target.h (elf_backend_extern_protected_data): New.
2951 Default to 0.
2952 (elfNN_bed): Initialize extern_protected_data with
2953 elf_backend_extern_protected_data.
2954
2955 2015-03-05 Nick Clifton <nickc@redhat.com>
2956
2957 PR binutils/18025
2958 * coffgen.c (coff_find_nearest_line_with_names): If the dwarf2
2959 lookup fails, check for an address bias in the dwarf info, and if
2960 one exists, retry the lookup with the biased value.
2961 * dwarf2.c (_bfd_dwarf2_find_symbol_bias): New function.
2962 Determines if a bias exists bewteen the addresses of functions
2963 based on DWARF information vs symbol table information.
2964 * libbfd-in.h (_bfd_dwarf2_find_symbol_bias): Prototype.
2965 * libbfd.h: Regenerate.
2966
2967 2015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
2968
2969 * elfxx-aarch64.c (decode_add_imm, decode_movw_imm)
2970 (decode_tst_branch_ofs_14, decode_ld_lit_ofs_19)
2971 (decode_cond_branch_ofs_19, decode_branch_ofs_26): Remove.
2972
2973 2015-03-04 Marcus Shawcroft <marcus.shawcroft@arm.com>
2974
2975 * elfnn-aarch64.c (aarch64_build_one_stub): Call abort.
2976 (aarch64_size_one_stub): Likewise.
2977 (aarch64_map_one_stub): Likewise.
2978
2979 2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
2980
2981 * cpu-s390.c (N): New macro.
2982 (bfd_s390_31_arch): New. Define only if default target word size
2983 is 64 bits. Otherwise define...
2984 (bfd_390_64_arch): ...this. Make static.
2985 (bfd_s390_arch): Define according to the default target word size.
2986 Let the 'next' field point to the alternate arch.
2987
2988 2015-03-04 Richard Sandiford <richard.sandiford@arm.com>
2989
2990 PR gas/17843
2991 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
2992 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
2993 to be used with MOVK rather than MOVZ.
2994
2995 2015-03-03 DJ Delorie <dj@redhat.com>
2996
2997 * elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
2998 there's a symbol.
2999
3000 2015-02-28 Alan Modra <amodra@gmail.com>
3001
3002 * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
3003 not PLT_NEW.
3004
3005 2015-02-27 H.J. Lu <hongjiu.lu@intel.com>
3006
3007 * elf32-i386.c (need_convert_mov_to_lea): New.
3008 (elf_i386_check_relocs): Set need_convert_mov_to_lea if needed.
3009 (elf_i386_convert_mov_to_lea): Return TRUE if
3010 need_convert_mov_to_lea is unset.
3011 * elf64-x86-64.c (need_convert_mov_to_lea): New.
3012 (elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed.
3013 (elf_x86_64_convert_mov_to_lea): Return TRUE if
3014 need_convert_mov_to_lea is unset.
3015
3016 2015-02-27 Nick Clifton <nickc@redhat.com>
3017
3018 PR binutils/17910
3019 * coffgen.c (_bfd_coff_internal_syment_name): Only check for
3020 string length overflow when the string table length is actually
3021 set.
3022
3023 2015-02-27 Marcus Shawcroft <marcus.shawcroft@arm.com>
3024
3025 * bfd/bfd-in2.h: Regenerate.
3026 * bfd/libbfd.h: Regenerate.
3027
3028 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
3029
3030 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix
3031 TLSDESC_LD_PREL19 field width and masks.
3032 (aarch64_tls_transition_without_check)
3033 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
3034 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
3035 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
3036 BFD_RELOC_AARCH64_TLSDESC_LD_PREL19.
3037 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3038 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3039
3040 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
3041
3042 * elfnn-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Reorder R_TYPE
3043 tests.
3044 (aarch64_tls_transition_without_check)
3045 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
3046 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
3047 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
3048 BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21.
3049 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3050 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3051 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
3052
3053 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
3054
3055 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC)
3056 (elfNN_aarch64_howto_table, aarch64_tls_transition_without_check)
3057 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
3058 (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
3059 (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
3060 BFD_RELOC_AARCH64_TLSGD_ADR_PREL21.
3061 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3062 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3063 * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
3064
3065 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
3066
3067 * elfnn-aarch64.c: (TLSIE_LD_GOTTREL_PREL19): Fix HOWTO bit field width.
3068 (aarch64_tls_transition_without_check, aarch64_reloc_got_type)
3069 (elfNN_aarch64_final_link_relocate, elfNN_aarch64_tls_relax)
3070 (elfNN_aarch64_relocate_section, elfNN_aarch64_gc_sweep_hook)
3071 (elfNN_aarch64_check_relocs): Handle
3072 BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19.
3073
3074 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
3075 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3076
3077 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
3078
3079 * elfnn-aarch64.c: (TLSDESC_CALL): Fix HOWTO bit field width.
3080
3081 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
3082
3083 * elfnn-aarch64.c (TLSLE_MOVW_TPREL_G2)
3084 (TLSLE_MOVW_TPREL_G1, TLSLE_MOVW_TPREL_G1_NC)
3085 (TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC): Fix bit field
3086 width.
3087
3088 2015-02-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
3089
3090 * elfnn-aarch64.c: (TLSIE_MOVW_GOTTPREL_G0_NC): Fix HOWTO bit
3091 field width.
3092
3093 2015-02-26 Nick Clifton <nickc@redhat.com>
3094
3095 PR binutils/17512
3096 * coffcode.h (coff_compute_section_file_positions): Report
3097 negative page sizes.
3098 * elf.c (elf_fake_sections): Handle excessive alignmment powers.
3099 (assign_file_positions_for_non_load_sections): Replace assertion
3100 with an error message.
3101 (rewrite_elf_program_header): Handle excessive segment
3102 alignments.
3103 * mach-o.c (bfd_mach_o_read_section_32): Likewise.
3104 (bfd_mach_o_read_section_64): Likewise.
3105 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Use %B to
3106 print a bfd name, not %A.
3107
3108 2015-02-26 Alan Modra <amodra@gmail.com>
3109
3110 * elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
3111 thread-safe stubs for iplt.
3112 (build_tls_get_addr_stub): Restore r2 immediately after call.
3113
3114 2015-02-26 Terry Guo <terry.guo@arm.com>
3115
3116 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Update how we
3117 merge Tag_ABI_HardFP_use.
3118
3119 2015-02-26 Alan Modra <amodra@gmail.com>
3120
3121 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Heed -z nocopyreloc.
3122 Use text relocs rather than giving an error on trying to use
3123 .dynbss for protected shared lib vars.
3124 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
3125
3126 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
3127
3128 * elf32-avr.c (struct elf_avr_section_data): New structure.
3129 (struct avr_relax_info): New structure.
3130 (elf_avr_new_section_hook): New function.
3131 (struct elf_avr_section_data): Add relax_info.
3132 (get_avr_relax_info): New function.
3133 (init_avr_relax_info): New function.
3134 (elf32_avr_relax_delete_bytes): Find next property record before
3135 deleting bytes. When deleting don't move bytes beyond the next
3136 property record.
3137 (avr_elf32_assign_records_to_section): New function.
3138 (avr_property_record_compare): New function.
3139 (avr_load_all_property_sections): New function.
3140 (elf32_avr_relax_section): Load property data. After relaxing the
3141 section, move any .align directives that have enough deleted bytes
3142 before them.
3143 (bfd_elf32_new_section_hook): Define.
3144
3145 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
3146
3147 * elf32-avr.h (struct avr_property_header): New strucure.
3148 (avr_elf32_load_property_records): Declare.
3149 (avr_elf32_property_record_name): Declare.
3150 * elf32-avr.c: Add bfd_stdint.h include.
3151 (retrieve_local_syms): New function.
3152 (get_elf_r_symndx_section): New function.
3153 (get_elf_r_symndx_offset): New function.
3154 (internal_reloc_compare): New function.
3155 (struct avr_find_section_data): New structure.
3156 (avr_is_section_for_address): New function.
3157 (avr_find_section_for_address): New function.
3158 (avr_elf32_load_records_from_section): New function.
3159 (avr_elf32_load_property_records): New function.
3160 (avr_elf32_property_record_name): New function.
3161
3162 2015-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
3163
3164 * elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
3165 (AVR_PROPERTY_RECORDS_VERSION): Define.
3166 (AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
3167 (struct avr_property_record): New structure.
3168
3169 2015-02-24 Nick Clifton <nickc@redhat.com>
3170
3171 * elf32-v850.c (v850_set_note): New function. Creates a Renesas
3172 style note entry.
3173 (v850_elf_make_note_section): New function. Creates a note
3174 section.
3175 (v850_elf_create_sections): New function. Create a note section
3176 if one is not already present.
3177 (v850_elf_set_note): New function. Adds a note to a bfd.
3178 (v850_elf_copy_private_bfd_data): New function. Copies V850
3179 notes.
3180 (v850_elf_merge_notes): New function. Merges V850 notes.
3181 (print_v850_note): New function. Displays a V850 note.
3182 (v850_elf_print_notes): New function. Displays all notes attached
3183 to a bfd.
3184 (v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
3185 (v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
3186 (v850_elf_fake_sections): Set the type of the V850 note section.
3187 * bfd-in.h (v850_elf_create_sections): Add prototype.
3188 (v850_elf_set_note): Add prototype.
3189 * bfd-in2.h: Regenerate.
3190
3191 2015-02-24 Nick Clifton <nickc@redhat.com>
3192
3193 * configure.ac (AC_CHECK_HEADERS): Add wctype.h.
3194 * configure: Regenerate.
3195 * config.in: Regenerate.
3196 * peXXigen.c: Include wctype.h if HAVE_WCTYPE_H is defined.
3197 (u16_mbtowc): Use wint_t types if HAVE_WCTYPE_H is defined.
3198 (rsrc_cmp): Use towlower instead of wcsncasecmp if HAVE_WCTYPE_H
3199 is defined.
3200
3201 2015-02-24 Nick Clifton <nickc@redhat.com>
3202
3203 * pdp11.c (set_section_contents): Pad the .text and .data sections
3204 to their aligned sizes.
3205
3206 2015-02-23 Yoshinori Sato <ysato@users.sourceforge.jp>
3207
3208 * config.bfd: Add h8300-*-linux.
3209 * configure.ac: Add h8300_elf32_linux_vec.
3210 * configure: Regenerate.
3211 * elf32-h8300.c: Likewise.
3212 * targets.c(_bfd_target_vector): Likewise.
3213
3214 2015-02-23 Nick Clifton <nickc@redhat.com>
3215
3216 PR 17914
3217 * cpu-w65.c: Correct typos in license notice.
3218
3219 PR 17940
3220 * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug
3221 symbols at end of sections. Adjust function sizes.
3222
3223 2015-02-20 Andreas Arnez <arnez@linux.vnet.ibm.com>
3224
3225 * elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
3226 (elfcore_write_s390_vxrs_high): Likewise.
3227 * elf.c (elfcore_grok_s390_vxrs_low): New function.
3228 (elfcore_grok_s390_vxrs_high): New function.
3229 (elfcore_grok_note): Call them.
3230 (elfcore_write_s390_vxrs_low): New function.
3231 (elfcore_write_s390_vxrs_high): New function.
3232 (elfcore_write_register_note): Call them.
3233
3234 2015-02-19 Branko Drevensek <branko.drevensek@gmail.com>
3235
3236 PR 17995
3237 * verilog.c (verilog_write_record): Correct buffer size.
3238
3239 2015-02-19 Alan Modra <amodra@gmail.com>
3240
3241 * elflink.c (_bfd_elf_define_linkage_sym): Set 'bed' earlier.
3242
3243 2015-02-19 Alan Modra <amodra@gmail.com>
3244
3245 PR ld/4317
3246 * elflink.c (elf_link_input_bfd): Drop undefined local syms.
3247 (elf_link_output_extsym): Drop local and global undefined syms.
3248 Tidy. Expand comment.
3249
3250 2015-02-17 Alan Modra <amodra@gmail.com>
3251
3252 PR ld/17975
3253 * elflink.c (struct elf_outext_info): Remove need_second_pass
3254 and second_pass.
3255 (elf_link_output_extsym): Delete code handling second forced
3256 local pass. Move code emitting NULL STT_FILE symbol later, so
3257 that it can be omitted if forced local is stripped. Don't
3258 emit the NULL STT_FILE if no file symbols have been output.
3259 (bfd_elf_final_link): Remove second forced local pass.
3260 * elf32-ppc.c (add_stub_sym): Set linker_def on linker syms.
3261 (ppc_elf_size_dynamic_sections): Likewise.
3262 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3263 (build_global_entry_stubs): Likewise.
3264 (ppc64_elf_build_stubs): Likewise.
3265
3266 2015-02-16 H.J. Lu <hongjiu.lu@intel.com>
3267
3268 PR ld/17975
3269 * elflink.c (elf_link_output_extsym): Only check filesym_count
3270 when outputting a NULL FILE symbol. Set second_pass_sym to
3271 h->forced_local && !h->root.linker_def.
3272
3273 2015-02-15 H.J. Lu <hongjiu.lu@intel.com>
3274
3275 * elf32-i386.c (elf_i386_always_size_sections): Set root.linker_def
3276 on _TLS_MODULE_BASE_.
3277 * elf64-x86-64.c (elf_x86_64_always_size_sections): Likewise.
3278
3279 2015-02-15 Alan Modra <amodra@gmail.com>
3280
3281 * dwarf2.c (read_rangelist): Correct buffer overflow check
3282 Whitespace throughout file.
3283
3284 2015-02-14 Alan Modra <amodra@gmail.com>
3285
3286 PR ld/17973
3287 * bfd.c (struct bfd): Add lto_output.
3288 * linker.c (_bfd_handle_already_linked): Explicitly test for
3289 objects added by the lto plugin.
3290 * opncls.c (_bfd_new_bfd_contained_in): Copy lto_output and
3291 no_export flags from archive.
3292 * archive.c (open_nested_file): New function, setting lto_output
3293 and no_export, extracted from..
3294 (find_nested_archive): ..here. Flip params. Rename from
3295 _bfd_find_nested_archive.
3296 (_bfd_get_elt_at_filepos): Correct var typo. Use open_nested_file.
3297 (_bfd_look_for_bfd_in_cache): Copy no_export.
3298 * elflink.c (elf_link_add_object_symbols): Remove now unnecessary
3299 my_archive->no_export test.
3300 (elf_link_input_bfd): Drop existing lto_output STT_FILE syms.
3301 Don't use the file name when adding lto_output STT_FILE sym.
3302 * bfd-in2.h: Regenerate.
3303
3304 2015-02-13 Alan Modra <amodra@gmail.com>
3305
3306 PR binutils/17512
3307 * elf64-ppc.c (opd_entry_value): Tighten offset check. Remove
3308 now redundant assert.
3309
3310 2015-02-12 Nick Clifton <nickc@redhat.com>
3311
3312 PR binutils/17512
3313 * dwarf.c (read_1_byte, read_1_signed_byte, read_2_bytes)
3314 (read_4_bytes, read_8_bytes, read_n_bytes, read_string)
3315 (read_indirect_string, read_alt_indirect_string)
3316 (read_alt_indirect_ref, read_address, read_abbrevs)
3317 (read_attribute_value, read_attribute, decode_line_info)
3318 (find_abstract_instance_name, read_rangelist)
3319 (scan_unit_for_symbols, parse_comp_unit)
3320 (_bfd_dwarf2_find_nearest_line): Harden DWARF reading code. Pass
3321 end pointers to reading functions and check for offsets taking
3322 pointers out of range. Replace calls to read_*_leb128 with calls
3323 to safe_read_leb128.
3324
3325 (* elf64-ppc.c (opd_entry_value): Add a check for an overlarge
3326 offset.
3327 * syms.c (_bfd_stab_section_find_nearest_line): Add checks for
3328 computed file_name address being before the start of the string
3329 table.
3330
3331 2015-02-11 H.J. Lu <hongjiu.lu@intel.com>
3332
3333 PR ld/17878
3334 * bfd.c (bfd_plugin_format): New.
3335 (bfd): Add plugin_format and plugin_dummy_bfd.
3336 * plugin.c (try_load_plugin): Take a pointer to bfd_boolean
3337 argument to return TRUE if any plugin is found. Set plugin_format.
3338 (has_plugin): New.
3339 (bfd_plugin_target_p): New.
3340 (bfd_plugin_specified_p): Likewise.
3341 (bfd_plugin_target_p): Likewise.
3342 (register_ld_plugin_object_p): Likewise.
3343 (bfd_plugin_set_plugin): Set has_plugin.
3344 (load_plugin): Cache try_load_plugin result.
3345 (bfd_plugin_object_p): Try ld_plugin_object_p first. Check
3346 plugin_format.
3347 * plugin.h (bfd_plugin_target_p): New.
3348 (bfd_plugin_specified_p): Likewise.
3349 (register_ld_plugin_object_p): Likewise.
3350 * bfd-in2.h: Regenerated.
3351
3352 2015-02-11 Pedro Alves <palves@redhat.com>
3353
3354 * libbfd-in.h [__cplusplus]: Open extern "C" scope.
3355 * libcoff-in.h [__cplusplus]: Open extern "C" scope.
3356 * libbfd.h: Regenerate.
3357 * libcoff.h: Regenerate.
3358
3359 * elf-bfd.h [__cplusplus]: Wrap in extern "C".
3360 * mach-o.h [__cplusplus]: Wrap in extern "C".
3361 * som.h [__cplusplus]: Wrap in extern "C".
3362
3363 2015-02-10 Nick Clifton <nickc@redhat.com>
3364
3365 PR binutils/17512
3366 * coffcode.h (styp_to_sec_flags): Use an unsigned long type to
3367 hold the flag bits.
3368 * peXXigen.c (pe_print_reloc): Use unsigned types to hold the
3369 size and number of relocs.
3370 (pe_print_debugdata): Use a 32-bit aligned buffer to store the
3371 codeview record.
3372 * versados.c (process_otr): Check the esdid value before using it
3373 to access the EDATA.
3374
3375 2015-02-09 Ed Maste <emaste@freebsd.org>
3376
3377 * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing
3378 uninitialized and unused variable.
3379 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3380
3381 2015-02-09 Alan Modra <amodra@gmail.com>
3382
3383 * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
3384 tls_sec.
3385 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
3386 * elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.
3387
3388 2015-02-09 Alan Modra <amodra@gmail.com>
3389
3390 * elflink.c: Whitespace, formatting fixes.
3391 (elf_link_input_bfd): Clarify comment.
3392 (elf_link_output_extsym): Exclude symbols in linker created
3393 sections when testing for plugin symbols.
3394
3395 2015-02-07 H.J. Lu <hongjiu.lu@intel.com>
3396
3397 PR ld/17935
3398 * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a
3399 warning for relocation in readonly section for -z text.
3400 (elf_i386_size_dynamic_sections): Likewise.
3401 * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
3402 (elf_x86_64_size_dynamic_sections): Likewise.
3403
3404 2015-02-06 H.J. Lu <hongjiu.lu@intel.com>
3405
3406 PR ld/12365
3407 PR ld/14272
3408 * elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change.
3409 (elf_link_input_bfd): Mark the plugin symbol undefined if it is
3410 referenced from a non-IR file.
3411
3412 2015-02-06 Nick Clifton <nickc@redhat.com>
3413
3414 PR binutils/17512
3415 * peXXigen.c (rsrc_print_resource_entries): Add range check for
3416 addresses that wrap around the address space.
3417 (rsrc_parse_entry): Likewise.
3418
3419 2015-02-03 H.J. Lu <hongjiu.lu@intel.com>
3420
3421 PR ld/12365
3422 PR ld/14272
3423 * elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol
3424 undefined if it is referenced from a non-IR file.
3425
3426 2015-02-03 Nick Clifton <nickc@redhat.com>
3427
3428 PR binutils/17512
3429 * ecoff.c: Use bfd_alloc2 to allocate space for structure arrays.
3430 (_bfd_ecoff_slurp_symbol_table): Check for a negative symbol
3431 index or an out of range fdr index.
3432 * elf-m10300.c (mn10300_info_to_howto): Fix typo in error message.
3433 * elf32-arc.c (arc_info_to_howto_rel): Likewise.
3434 * elf32-avr.c (avr_info_to_howto_rela): Likewise.
3435 * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
3436 * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
3437 * elf32-cris.c (cris_info_to_howto_rela): Likewise.
3438 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
3439 * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
3440 * elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
3441 * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
3442 * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
3443 * elf32-frv.c (frv_info_to_howto_rela): Likewise.
3444 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
3445 * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
3446 * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
3447 * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
3448 * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
3449 * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
3450 * elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
3451 * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
3452 * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
3453 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3454 * elf32-mep.c (mep_info_to_howto_rela): Likewise.
3455 * elf32-metag.c (metag_info_to_howto_rela): Likewise.
3456 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3457 * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
3458 * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
3459 * elf32-mt.c (mt_info_to_howto_rela): Likewise.
3460 * elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
3461 * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
3462 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
3463 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3464 * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
3465 * elf32-rx.c (rx_info_to_howto_rela): Likewise.
3466 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
3467 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
3468 * elf32-v850.c (v850_elf_perform_relocation): Likewise.
3469 * elf32-vax.c (rtype_to_howto): Likewise.
3470 * elf32-visium.c (visium_info_to_howto_rela): Likewise.
3471 * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
3472 * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
3473 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3474 * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
3475 * mach-o.c: Use bfd_alloc2 to allocate space for structure arrays.
3476 (bfd_mach_o_canonicalize_one_reloc): Fix check on out
3477 of range symbol indicies.
3478 (bfd_mach_o_canonicalize_relocs): Check for out of range alloc.
3479 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise.
3480 (bfd_mach_o_build_dysymtab): Likewise.
3481 (bfd_mach_o_write_symtab_content): Set the string table size to
3482 zero upon error.
3483 (bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the
3484 read fails.
3485 * peXXigen.c (pe_print_edata): Check for numeric overflow in edt
3486 fields.
3487 * tekhex.c (first_phase): Check for src pointer reaching end of
3488 buffer.
3489
3490 2015-02-03 Will Newton <will.newton@linaro.org>
3491
3492 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
3493 Set st_value to zero for undefined symbols if the reference
3494 is weak or pointer_equality_needed is FALSE.
3495
3496 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
3497 comment discussing why we clear st_value for some symbols.
3498
3499 2015-02-02 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3500
3501 * elf32-nds32.c (nds32_get_section_contents): Add one more argument.
3502 (nds32_elf_relocate_section): Do not relocate R_NDS32_LONGJUMP7.
3503
3504 2015-01-29 Alan Modra <amodra@gmail.com>
3505
3506 * elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
3507 optimization. Tidy mask for GOT_TLSGD optimization.
3508 * elf32-ppc.c (ppc_elf_relocate_section): Likewise. Correct
3509 location of nop zapping high insn too.
3510
3511 2015-01-28 Alan Modra <amodra@gmail.com>
3512
3513 * elf64-ppc.h (struct ppc64_elf_params): Add "object_in_toc".
3514 * elf64-ppc.c (ppc64_elf_add_symbol_hook): Assume that global symbols
3515 in .toc indicate xlc compiled code that might require a rw .toc.
3516
3517 2015-01-28 James Bowman <james.bowman@ftdichip.com>
3518
3519 * Makefile.am: Add FT32 files.
3520 * archures.c (enum bfd_architecture): Add bfd_arch_ft32.
3521 (bfd_mach_ft32): Define.
3522 (bfd_ft32_arch): Declare.
3523 (bfd_archures_list): Add bfd_ft32_arch.
3524 * config.bfd: Handle FT32.
3525 * configure.ac: Likewise.
3526 * cpu-ft32.c: New file.
3527 * elf32-ft32.c: New file.
3528 * reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
3529 BFD_RELOC_FT32_18): Define.
3530 * targets.c (_bfd_target_vector): Add ft32_elf32_vec.
3531 * bfd-in2.h: Regenerate.
3532 * libbfd.h: Regenerate.
3533 * Makefile.in: Regenerate.
3534 * configure: Regenerate.
3535 * po/SRC-POTFILES.in: Regenerate.
3536
3537 2015-01-27 Nick Clifton <nickc@redhat.com>
3538
3539 PR binutils/17512
3540 * pdp11.c (aout_get_external_symbols): Return false if there are
3541 no symbols.
3542
3543 * dwarf2.c (concat_filename): Check for an empty directory table.
3544 (scan_unit_for_symbols): Check for reading off the end of the
3545 unit.
3546 (parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
3547 non-string form.
3548 * elf64-ppc.c (opd_entry_value): Fail if there are no relocs
3549 available.
3550
3551 2015-01-26 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3552
3553 * elf32-nds32.c (nds32_elf_pick_relax): Fix again setting.
3554
3555 2015-01-22 DJ Delorie <dj@redhat.com>
3556
3557 * elf32-m32c.c (m32c_apply_reloc_24): New.
3558 (m32c_elf_howto_table): Use it for R_M32C_24.
3559 (m32c_elf_relocate_section): Handle R_M32C_24 specially.
3560
3561 2015-01-22 Nick Clifton <nickc@redhat.com>
3562
3563 PR binutils/17512
3564 * coffcode.h (handle_COMDAT): When searching for the section
3565 symbol, make sure that there is space left in the symbol table.
3566 * vms-alpha.c (_bfd_vms_slurp_ehdr): Add range checks.
3567
3568 2015-01-21 Nick Clifton <nickc@redhat.com>
3569
3570 PR binutils/17512
3571 * coffcode.h (coff_set_arch_mach_hook): Check return value from
3572 bfd_malloc.
3573 (coff_slurp_line_table): Return FALSE if the line number
3574 information was corrupt.
3575 (coff_slurp_symbol_table): Return FALSE if the symbol information
3576 was corrupt.
3577 * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
3578 initialise the fields of the dyld_info structure.
3579 (bfd_mach_o_build_exec_seg_command): Replace assertion with an
3580 error message and a return value.
3581 (bfd_mach_o_layout_commands): Change the function to boolean.
3582 Return FALSE if the function fails.
3583 (bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
3584 fails.
3585 (bfd_mach_o_read_command): Fail if an unrecognised command is
3586 encountered.
3587 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
3588 read fails.
3589 (slurp_symtab): Check the return from bfd_malloc.
3590 (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
3591 encountered an error.
3592 (_bfd_XXi_final_link_postscript): Fail if a section could not be
3593 copied.
3594 * peicode.h (pe_bfd_object_p): Fail if the header could not be
3595 swapped in.
3596 * tekhex.c (first_phase): Fail if the section is too big.
3597 * versados.c (struct esdid): Add content_size field.
3598 (process_otr): Use and check the new field.
3599 (versados_get_section_contents): Check that the section exists and
3600 that the requested data is available.
3601
3602 2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
3603
3604 * elf32-nios2.c (elf_backend_default_execstack): Define as 0.
3605
3606 2015-01-20 Alan Modra <amodra@gmail.com>
3607
3608 PR ld/17615
3609 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
3610 ELF_COMMON_DEF syms.
3611
3612 2015-01-19 Alan Modra <amodra@gmail.com>
3613
3614 PR ld/17615
3615 * elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
3616 linker script assignments too.
3617 * elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
3618 (bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
3619
3620 2015-01-19 Alan Modra <amodra@gmail.com>
3621
3622 * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Correct loop iteration
3623 to allow return of first howto.
3624 * elf32-fr30.c (fr30_reloc_type_lookup): Likewise.
3625 * elf32-m32c.c (m32c_reloc_type_lookup): Likewise.
3626 * elf32-moxie.c (moxie_reloc_type_lookup): Likewise.
3627 * elf32-or1k.c (or1k_reloc_type_lookup): Likewise.
3628 * elf32-rl78.c (rl78_reloc_type_lookup): Likewise.
3629 * elf32-rx.c (rx_reloc_type_lookup): Likewise.
3630 * elf32-tilepro.c (tilepro_reloc_type_lookup): Likewise.
3631 * elf32-xstormy16.c (xstormy16_reloc_type_lookup): Likewise.
3632 * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
3633 * elf32-nios2.c (nios2_reloc_map): Add mapping for R_NIOS2_NONE.
3634 * elf32-spu.c (spu_elf_bfd_to_reloc_type): Allow return of R_SPU_NONE.
3635 (spu_elf_reloc_type_lookup): Adjust to suit.
3636
3637 2015-01-19 Alan Modra <amodra@gmail.com>
3638
3639 * bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
3640 (bfd_get_section_limit): ..here.
3641 * reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
3642 (bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
3643 * elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
3644 * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
3645 bfd_reloc_outofrange check.
3646 * bfd-in2.h: Regenerate.
3647
3648 * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
3649 on zero size relocs.
3650 * ecoff.c (ecoff_reloc_link_order): Likewise.
3651 * elf32-nds32.c (nds32_relocate_contents): Likewise.
3652 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3653
3654 * reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
3655 (_bfd_clear_contents): Likewise.
3656 * elfxx-mips.c (mips_elf_obtain_contents): Likewise.
3657 (mips_elf_perform_relocation): Likewise.
3658
3659 * aoutx.h (aout_link_reloc_link_order): Allow for NULL return
3660 from malloc on zero size alloc.
3661 * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
3662 * elflink.c (elf_reloc_link_order): Likewise.
3663 * linker.c (_bfd_generic_reloc_link_order): Likewise.
3664 * pdp11.c (aout_link_reloc_link_order): Likewise.
3665 * xcofflink.c (xcoff_reloc_link_order): Likewise.
3666
3667 * aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
3668 bitsize 0, and complain_overflow_dont.
3669 * coff-sparc.c (coff_sparc_howto_table): Likewise.
3670 * elf-hppa.h (elf_hppa_howto_table): Likewise.
3671 * elf-m10200.c (elf_mn10200_howto_table): Likewise.
3672 * elf-m10300.c (elf_mn10300_howto_table): Likewise.
3673 * elf32-arc.c (elf_arc_howto_table): Likewise.
3674 * elf32-arm.c (elf32_arm_howto_table_1): Likewise.
3675 * elf32-avr.c (elf_avr_howto_table): Likewise.
3676 * elf32-bfin.c (bfin_howto_table): Likewise.
3677 * elf32-cr16.c (cr16_elf_howto_table): Likewise.
3678 * elf32-cris.c (cris_elf_howto_table): Likewise.
3679 * elf32-crx.c (crx_elf_howto_table): Likewise.
3680 * elf32-d10v.c (elf_d10v_howto_table): Likewise.
3681 * elf32-d30v.c (elf_d30v_howto_table): Likewise.
3682 * elf32-dlx.c (dlx_elf_howto_table): Likewise.
3683 * elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
3684 * elf32-fr30.c (fr30_elf_howto_table): Likewise.
3685 * elf32-frv.c (elf32_frv_howto_table): Likewise.
3686 * elf32-h8300.c (h8_elf_howto_table): Likewise.
3687 * elf32-i370.c (i370_elf_howto_raw): Likewise.
3688 * elf32-i386.c (elf_howto_table): Likewise.
3689 * elf32-i860.c (elf32_i860_howto_table): Likewise.
3690 * elf32-i960.c (elf32_i960_relocate): Likewise.
3691 * elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
3692 * elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
3693 * elf32-lm32.c (lm32_elf_howto_table): Likewise.
3694 * elf32-m32c.c (m32c_elf_howto_table): Likewise.
3695 * elf32-m32r.c (m32r_elf_howto_table): Likewise.
3696 * elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
3697 * elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
3698 * elf32-m68k.c (howto_table): Likewise.
3699 * elf32-mcore.c (mcore_elf_howto_raw): Likewise.
3700 * elf32-mep.c (mep_elf_howto_table): Likewise.
3701 * elf32-metag.c (elf_metag_howto_table): Likewise.
3702 * elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
3703 * elf32-mips.c (elf_mips_howto_table_rel): Likewise.
3704 * elf32-moxie.c (moxie_elf_howto_table): Likewise.
3705 * elf32-msp430.c (elf_msp430_howto_table): Likewise.
3706 * elf32-mt.c (mt_elf_howto_table): Likewise.
3707 * elf32-nds32.c (nds32_elf_howto_table): Likewise.
3708 * elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
3709 * elf32-or1k.c (or1k_elf_howto_table): Likewise.
3710 * elf32-pj.c (pj_elf_howto_table): Likewise.
3711 * elf32-ppc.c (ppc_elf_howto_raw): Likewise.
3712 * elf32-rl78.c (rl78_elf_howto_table): Likewise.
3713 * elf32-rx.c (rx_elf_howto_table): Likewise.
3714 * elf32-s390.c (elf_howto_table): Likewise.
3715 * elf32-score.c (elf32_score_howto_table): Likewise.
3716 * elf32-score7.c (elf32_score_howto_table): Likewise.
3717 * elf32-sh-relocs.h (R_SH_NONE): Likewise.
3718 * elf32-spu.c (elf_howto_table): Likewise.
3719 * elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
3720 * elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
3721 * elf32-v850.c (v850_elf_howto_table): Likewise.
3722 * elf32-vax.c (howto_table): Likewise.
3723 * elf32-visium.c (visium_elf_howto_table): Likewise.
3724 * elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
3725 * elf32-xgate.c (elf_xgate_howto_table): Likewise.
3726 * elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
3727 * elf32-xtensa.c (elf_howto_table): Likewise.
3728 * elf64-alpha.c (elf64_alpha_howto_table): Likewise.
3729 * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
3730 * elf64-mmix.c (elf_mmix_howto_table): Likewise.
3731 * elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
3732 * elf64-s390.c (elf_howto_table): Likewise.
3733 * elf64-sh64.c (sh_elf64_howto_table): Likewise.
3734 * elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
3735 * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
3736 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
3737 (elfNN_aarch64_howto_none): Likewise.
3738 * elfxx-ia64.c (ia64_howto_table): Likewise.
3739 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
3740 * elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
3741 * nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
3742
3743 2015-01-15 H.J. Lu <hongjiu.lu@intel.com>
3744
3745 PR ld/17847
3746 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't complain
3747 about -fPIC if the symbol is undefined when building executable.
3748
3749 2015-01-15 Nick Clifton <nickc@redhat.com>
3750
3751 PR binutils/17512
3752 * elf-m10300.c (mn10300_info_to_howto): Replace assertion with an
3753 error message. Never return an invalid howto pointer.
3754 * elf32-cr16.c (cr16_info_to_howto): Likewise.
3755 * elf32-crx.c (elf_crx_info_to_howto): Likewise.
3756 * elf32-i370.c (i370_elf_info_to_howto): Likewise.
3757 * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3758 * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3759 * elf32-mips.c (mips_elf32_rtype_to_howto): Likewise.
3760 * elf32-pj.c (pj_elf_info_to_howto): Likewise.
3761 * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3762 * elf32-spu.c (spu_elf_info_to_howto): Likewise.
3763 * elf32-v850.c (v850_elf_info_to_howto_rela): Likewise.
3764 * elf32-vax.c (rtype_to_howto): Likewise.
3765 * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3766 * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
3767 * elfn32-mips.c (sh_elf_info_to_howto): Likewise.
3768 * elf32-sh.c (sh_elf_info_to_howto): Likewise.
3769 (sh_elf_reloc): Check that the reloc is in range.
3770 * reloc.c (bfd_perform_relocation): Check that the section is big
3771 enough for the entire reloc.
3772 (bfd_generic_get_relocated_section_contents): Report unexpected
3773 return values from perform_reloc.
3774
3775 2015-01-15 Nick Clifton <nickc@redhat.com>
3776
3777 * elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
3778 relocs. Include PC-relative adjustment for R_MSP430X_ABS16
3779 relaxation.
3780
3781 2015-01-15 Alan Modra <amodra@gmail.com>
3782
3783 * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
3784 any output section matching a linker created dynobj section.
3785
3786 2015-01-15 Alan Modra <amodra@gmail.com>
3787
3788 PR 17842
3789 * elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
3790 (bfd_elf_final_link): Always create a symbol table when emit_relocs.
3791 Don't assign symtab file position unless symbols will be output.
3792 Merge blocks with condition in common. Don't call
3793 elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
3794 unless other symbols are output. Move assignment of symtab_shndx
3795 file position. Localize variable.
3796
3797 2015-01-14 Jiong Wang <jiong.wang@arm.com>
3798
3799 * elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when
3800 trying to defer them to runtime.
3801
3802 2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
3803
3804 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
3805 to check if a symbol should be bound symbolically.
3806
3807 2015-01-13 Jiong Wang <jiong.wang@arm.com>
3808
3809 * elfnn-aarch64.c: (elfNN_aarch64_howto_table): Enable overflow check
3810 for TLSLE_MOVW_TPREL_G2.
3811
3812 2015-01-13 Jiong Wang <jiong.wang@arm.com>
3813
3814 PR ld/17415
3815 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark
3816 R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned.
3817 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the
3818 bit mask.
3819
3820 2015-01-12 Terry Guo <terry.guo@arm.com>
3821
3822 * elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New
3823 function.
3824 (_bfd_elf_gc_mark_extra_sections): Use it.
3825
3826 2015-01-11 H.J. Lu <hongjiu.lu@intel.com>
3827
3828 PR ld/17827
3829 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
3830 only discard space for pc-relative relocs symbols which turn
3831 out to need copy relocs.
3832
3833 2015-01-09 Nick Clifton <nickc@redhat.com>
3834
3835 * tekhex.c (getvalue): Fix thinko in test for correct extraction
3836 of value.
3837 (getsym): Return false if there was not enough data to extract the
3838 symbol.
3839
3840 2015-01-09 Anthony Green <green@moxielogic.com>
3841
3842 * elf32-moxie.c (ELF_MACHINE_ALT1): Define.
3843
3844 2015-01-08 Nick Clifton <nickc@redhat.com>
3845
3846 * elf32-msp430.c (msp430_elf_relax_section): Add relaxation of
3847 16-bit absolute BR instructions to 10-bit pc-relative JMP
3848 instructions.
3849
3850 2015-01-08 Nick Clifton <nickc@redhat.com>
3851
3852 PR binutils/17512
3853 * coffcode.h (coff_slurp_symbol_table): Return false if we failed
3854 to load the line table.
3855 * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum
3856 maxpagesize of 1.
3857 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if
3858 the Data Directory Size is too large.
3859
3860 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
3861
3862 PR binutils/17512
3863 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation.
3864 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3865
3866 2015-01-06 Nick Clifton <nickc@redhat.com>
3867
3868 PR binutils/17512
3869 * mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the
3870 string table.
3871
3872 * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
3873 (bfd_perform_relocation): Include the size of the reloc in the
3874 test for an out of range relocation.
3875 (bfd_generic_get_relocated_section_contents): Remove reloc range
3876 test.
3877
3878 * coff-i860.c (CALC_ADDEND): Always set an addend value.
3879 * tekhex.c (getvalue): Add an end pointer parameter. Use it to
3880 avoid reading off the end of the buffer.
3881 (getsym): Likewise.
3882 (first_phase): Likewise.
3883 (pass_over): Pass an end pointer to the invoked function.
3884
3885 2015-01-05 H.J. Lu <hongjiu.lu@intel.com>
3886
3887 PR binutils/17512
3888 * elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt
3889 input.
3890 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3891
3892 2015-01-05 Nick Clifton <nickc@redhat.com>
3893
3894 PR binutils/17512
3895 * archive.c (do_slurp_bsd_armap): Make sure that the parsed sized
3896 is at least big enough for the header to be read.
3897 * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocs.
3898 * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks.
3899 (bfd_mach_o_read_command): Prevetn duplicate error messages about
3900 unrecognized commands.
3901 * syms.c (_bfd_stab_section_find_nearest_line): Add range checks
3902 when indexing into the string table.
3903
3904 2015-01-01 Alan Modra <amodra@gmail.com>
3905
3906 Update year range in copyright notice of all files.
3907
3908 For older changes see ChangeLog-2014
3909 \f
3910 Copyright (C) 2015 Free Software Foundation, Inc.
3911
3912 Copying and distribution of this file, with or without modification,
3913 are permitted in any medium without royalty provided the copyright
3914 notice and this notice are preserved.
3915
3916 Local Variables:
3917 mode: change-log
3918 left-margin: 8
3919 fill-column: 74
3920 version-control: never
3921 End:
This page took 0.110724 seconds and 4 git commands to generate.