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