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