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