Commit Graph

11931 Commits

Author SHA1 Message Date
H.J. Lu
8ded2ddc8b Convert PLT reloc only if pointer equality isn't needed
When pointer equality needed, we can't replace PLT relocations with
GOT relocations for -z now.  This patch checks if pointer equality is
needed before converting PLT relocations to GOT relocations.

bfd/

	PR binutils/18458
	* elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
	for now binding only if pointer equality isn't needed.
	(elf_i386_allocate_dynrelocs): Use .plt.got section for now
	binding only if pointer equality isn't needed.
	* elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
	section for now binding only if pointer equality isn't needed.
	(elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
	binding only if pointer equality isn't needed.

ld/testsuite/

	PR binutils/18458
	* ld-elf/shared.exp (build_tests): Build libpr18458a.so and
	libpr18458b.so.
	(run_tests): Run pr18458 test.
	* ld-elf/pr18458a.c: New file.
	* ld-elf/pr18458b.c: Likewise.
	* ld-elf/pr18458c.c: Likewise.
2015-05-27 14:32:24 -07:00
GDB Administrator
04e40a033b Automatic date update in version.in 2015-05-27 00:00:09 +00:00
GDB Administrator
8f2fd309e0 Automatic date update in version.in 2015-05-26 00:00:08 +00:00
GDB Administrator
f51064fe14 Automatic date update in version.in 2015-05-25 00:00:08 +00:00
GDB Administrator
c8ab67d1a6 Automatic date update in version.in 2015-05-24 00:00:08 +00:00
GDB Administrator
6b3f41b5c1 Automatic date update in version.in 2015-05-23 00:00:08 +00:00
GDB Administrator
36b0313f2f Automatic date update in version.in 2015-05-22 00:00:08 +00:00
GDB Administrator
d8e6bc5290 Automatic date update in version.in 2015-05-21 00:00:08 +00:00
H.J. Lu
fca6ae69c4 Skip extra relocations in .rel.plt/.rela.plt
Extra relocations may be added to the .rel.plt/.rela.plt section, which
are unrelated to PLT.  We should skip them when retrieving PLT entry
symbol values.

	PR binutils/18437
	* elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
	in .rel.plt/.rela.plt.
	* elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
2015-05-20 07:55:45 -07:00
Jiong Wang
ce33678882 [AArch64/BFD] Sort relocation case labels alphabetically
2015-05-19  Jiong Wang  <jiong.wang@arm.com>

    bfd/
	* elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
	relocation case labels alphabetically.
	(elfNN_aarch64_final_link_relocate): Ditto.
	(elfNN_aarch64_tls_relax): Ditto.
	(elfNN_aarch64_relocate_section): Ditto.
	(elfNN_aarch64_gc_sweep_hook): Ditto.
	(elfNN_aarch64_check_relocs): Ditto.
	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
	(_bfd_aarch64_elf_resolve_relocation): Ditto.
2015-05-20 10:58:43 +01:00
GDB Administrator
fa0b40e5c4 Automatic date update in version.in 2015-05-20 00:00:08 +00:00
GDB Administrator
8f8a1b36a0 Automatic date update in version.in 2015-05-19 00:00:08 +00:00
Jiong Wang
80de0c6d61 [AArch64] Remove X86-64 comments
bfd/
  * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite comments.
2015-05-18 10:46:34 +01:00
GDB Administrator
df4227e4c6 Automatic date update in version.in 2015-05-18 00:00:07 +00:00
GDB Administrator
20ef91414e Automatic date update in version.in 2015-05-17 00:00:08 +00:00
H.J. Lu
25070364b0 Don't generate PLT relocations for now binding
There is no need for PLT relocations with -z now. We can use GOT
relocations, which take less space, instead and replace 16-byte .plt
entres with 8-byte .plt.got entries.

bfd/

	* elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
	for now binding.
	(elf_i386_allocate_dynrelocs): Use .plt.got section for now
	binding.
	* elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
	section for now binding.
	(elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
	binding.

ld/testsuite/

	* ld-i386/i386.exp: Run PR ld/17689 tests with -z now.
	* ld-x86-64/x86-64.exp: Likewise
	* ld-i386/pr17689now.rd: New file.
	* ld-x86-64/pr17689now.rd: Likewise
2015-05-16 07:00:55 -07:00
GDB Administrator
24da9638e2 Automatic date update in version.in 2015-05-16 00:00:08 +00:00
GDB Administrator
49a84e1373 Automatic date update in version.in 2015-05-15 00:00:08 +00:00
H.J. Lu
dab394de9e Don't add the zlib header to SHF_COMPRESSED section
In a SHF_COMPRESSED compressed section, the raw compressed data should
begin immediately after the compression header.  This patch removes the
extra zlib header from the SHF_COMPRESSED section.

bfd/

	* bfd.c (bfd_update_compression_header): Also write the zlib
	header if the SHF_COMPRESSED bit cleared..
	(bfd_check_compression_header): Return the uncompressed size.
	* compress.c (decompress_contents): Don't skip the zlib header.
	(bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
	which doesn't have the zlib header.
	(bfd_init_section_decompress_status): Likewise.
	(bfd_get_full_section_contents): Updated.
	(bfd_is_section_compressed): Likewise.
	(bfd_is_section_compressed_with_header): Return the uncompressed
	size.
	* elf.c (_bfd_elf_make_section_from_shdr): Updated.
	* bfd-in2.h: Regenerated.

binutils/

	* readelf.c (uncompress_section_contents): Add a parameter for
	uncompressed size.  Don't check the zlib header.
	(load_specific_debug_section): Updated.

binutils/testsuite/

	* binutils-all/compress.exp: Replace "$OBJDUMP -s -j .debug_info"
	with "$OBJDUMP -W".
	* binutils-all/libdw2-compressedgabi.out: Updated.

gas/

2015-05-14  H.J. Lu  <hongjiu.lu@intel.com>

	* write.c (compress_debug): Don't write the zlib header, which
	is handled by bfd_update_compression_header.
2015-05-14 16:02:08 -07:00
Jiong Wang
fdc3b1b1ef [AArch64] Remove BFD overflow check restrictions
bfd/
  * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow
  check restriction.
2015-05-14 12:46:31 +01:00
Max Filippov
e6c9a083ec xtensa: fix localized symbol refcounting with --gc-sections
elf_xtensa_gc_sweep_hook doesn't correctly unreference symbols that were
made local, that results in link failure with the following message:

  BFD (GNU Binutils) 2.24 internal error, aborting at elf32-xtensa.c line
  3372 in elf_xtensa_finish_dynamic_sections

elf_xtensa_gc_sweep_hook determines symbol reference type (PLT or GOT) by
relocation type. Relocation types are not changed when symbol becomes
local, but its PLT references are added to GOT references and
plt.refcount is set to 0. Such symbol cannot be unreferences in the
elf_xtensa_gc_sweep_hook and its extra references make calculated GOT
relocations section size not match number of GOT relocations.

Fix it by treating PLT reference as GOT reference when plt.refcount is
not positive.

2015-05-14  Max Filippov  <jcmvbkbc@gmail.com>
bfd/
	* elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
	as GOT reference when plt.refcount is not positive.
2015-05-14 07:07:27 +03:00
GDB Administrator
d121800b7f Automatic date update in version.in 2015-05-14 00:00:07 +00:00
GDB Administrator
5c0bbc5231 Automatic date update in version.in 2015-05-13 00:00:07 +00:00
H.J. Lu
a3747075ae Allocate the first .plt entry space only if needed
Commit dd7e64d45b may optimize out
i386/x86-64 JUMP_SLOT relocation.  If there is no JUMP_SLOT relocation
left, we don't need to the first .plt entry.  This patch allocates
space for the first .plt entry only if we also reserve space for a PLT
slot for JUMP_SLOT relocation.

bfd/

	* elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
	for the first .plt entry only if needed.
	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.

ld/testsuite/

	* ld-i386/i386.exp: Run pltgot-1 for Linux targets.
	* ld-x86-64/x86-64.exp: Likewise.
	* ld-i386/pltgot-1.d: New file.
	* ld-i386/pltgot-1.s: Likewise.
	* ld-x86-64/pltgot-1.d: Likewise.
	* ld-x86-64/pltgot-1.s: Likewise.
2015-05-12 13:11:48 -07:00
GDB Administrator
fb4048adf7 Automatic date update in version.in 2015-05-12 00:00:07 +00:00
H.J. Lu
bf64a9511f Add Intel MCU support to bfd
bfd/

	* Makefile.am (ALL_MACHINES): Add cpu-iamcu.lo.
	(ALL_MACHINES_CFILES): Likewise.
	* archures.c (bfd_mach_iamcu): New.
	(bfd_mach_i386_iamcu): Likewise.
	(bfd_mach_i386_iamcu_intel_syntax): Likewise.
	(bfd_iamcu_arch): Likewise.
	(bfd_archures_list): Add &bfd_iamcu_arch.
	* config.bfd (targ_selvecs): Add iamcu_elf32_vec to
	i386_elf32_vec.
	(targ_archs): Add bfd_iamcu_arch if needed.
	* configure.ac: Support iamcu_elf32_vec.
	* cpu-iamcu.c: New file.
	* elf32-i386.c (elf32_iamcu_elf_object_p): New function.
	Add support for iamcu_elf32_vec and elf32_iamcu_bed.
	* targets.c (iamcu_elf32_vec): New.
	(_bfd_target_vector): Add iamcu_elf32_vec.
	* Makefile.in: Regenerated.
	* bfd-in2.h: Likewise.
	* configure: Likewise.

binutils/testsuite/

	* binutils-all/objdump.exp (cpus_expected): Append iamcu.
2015-05-11 10:31:00 -07:00
H.J. Lu
22abe5566a Rename EM_486 to EM_IAMCU
bfd/

	* elfcode.h (elf_object_p): Replace EM_486 with EM_IAMCU.

binutils/

	* dwarf.c (init_dwarf_regnames): Replace EM_486 with EM_IAMCU.
	* readelf.c (guess_is_rela): Likewise.
	(dump_relocations): Likewise.
	(get_machine_name): Likewise.
	(get_elf_section_flags): Likewise.
	(process_section_headers): Likewise.
	(is_32bit_abs_reloc): Likewise.
	(is_32bit_pcrel_reloc): Likewise.

include/elf/

	* common.h (EM_486): Renamed to ...
	(EM_IAMCU): This.
2015-05-11 08:53:05 -07:00
GDB Administrator
415158ef39 Automatic date update in version.in 2015-05-11 00:00:08 +00:00
H.J. Lu
4b71eec627 Replace input_bfd and output_bfd with abfd
The first argument to bfd_get_8/bfd_put_8 isn't used.  But we should
use something real.  Replace input_bfd and output_bfd with abfd.

	* elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
	and output_bfd with abfd.
	* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
2015-05-10 06:44:12 -07:00
GDB Administrator
10a52f094e Automatic date update in version.in 2015-05-10 00:00:08 +00:00
GDB Administrator
504374b503 Automatic date update in version.in 2015-05-09 00:00:08 +00:00
GDB Administrator
7a261c91c8 Automatic date update in version.in 2015-05-08 00:00:08 +00:00
GDB Administrator
187032dbb8 Automatic date update in version.in 2015-05-07 00:00:08 +00:00
Toni Spets
9ac47a43ff Skip discarded resource sections when building a PE resource table.
PR ld/18372
	* peXXigen.c (rsrc_process_section): Skip discarded resource
	sections.
2015-05-06 14:18:34 +01:00
GDB Administrator
03bbcd1c7a Automatic date update in version.in 2015-05-06 00:00:09 +00:00
GDB Administrator
e1765cdae2 Automatic date update in version.in 2015-05-05 00:00:07 +00:00
GDB Administrator
44b3de870e Automatic date update in version.in 2015-05-04 00:00:08 +00:00
GDB Administrator
01a97082d0 Automatic date update in version.in 2015-05-03 00:00:07 +00:00
GDB Administrator
0138c3463d Automatic date update in version.in 2015-05-02 00:00:08 +00:00
H.J. Lu
b633b7258d Support ix86-*-elf*
bfd/

	* config.bfd: Support i[3-7]86-*-elf*.

gas/

	* configure.tgt: Support i386-*-elf*.
2015-05-01 05:02:30 -07:00
GDB Administrator
d6ad735147 Automatic date update in version.in 2015-05-01 00:00:08 +00:00
Nick Clifton
153a27763c Fix handling of relocs for the MeP target.
bfd	PR 18317
	* elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
	mep_reloc.
	(mep_reloc): Delete unused function.

bin	* readelf.c (get_machine_flags): Add description of MeP flags.

tests	* binutils-all/objdump.exp (cpus_expected): Add MeP CPU names.
2015-04-30 15:57:41 +01:00
H.J. Lu
914082d11b Undef elf_backend_post_process_headers for Solaris
* elf32-i386.c (elf_backend_post_process_headers): Undef for
	Solaris 2.
2015-04-30 06:52:34 -07:00
GDB Administrator
97bf273d5d Automatic date update in version.in 2015-04-30 00:00:08 +00:00
Nick Clifton
a93d5cb197 Add support for absolute PE/x86 relocations.
PR 17099
	* coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
	relocs.
2015-04-29 12:26:46 +01:00
GDB Administrator
521f2feb98 Automatic date update in version.in 2015-04-29 00:00:08 +00:00
GDB Administrator
d84f2dd325 Automatic date update in version.in 2015-04-28 00:00:08 +00:00
Andreas Krebbel
643f7afb0d S/390: z13 use GNU attribute to indicate vector ABI
bfd/
	* elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
	* elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
	elf_s390_merge_obj_attributes.
	* elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.

binutils/
	* readelf.c (display_s390_gnu_attribute): New function.
	(process_s390_specific): New function.
	(process_arch_specific): Call process_s390_specific.

gas/
	* doc/as.texinfo: Document Tag_GNU_S390_ABI_Vector.

include/elf/
	* s390.h: Define Tag_GNU_S390_ABI_Vector.
2015-04-27 10:32:23 +02:00
GDB Administrator
4b9bfa2be0 Automatic date update in version.in 2015-04-27 00:00:07 +00:00
GDB Administrator
36cca014bb Automatic date update in version.in 2015-04-26 00:00:07 +00:00