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