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