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