Commit Graph

2803 Commits

Author SHA1 Message Date
Kaz Kojima 2558b9a9f0 * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section
and DT_DEBUG dynamic tag even for position independent executables.
	* elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize.
2003-06-03 04:50:20 +00:00
Daniel Jacobowitz f15398ef83 * config.bfd: Move obsolete entries out of the range of the
targmatch sed script.
2003-06-02 19:25:51 +00:00
Daniel Jacobowitz cad2898553 * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete. 2003-06-02 18:59:49 +00:00
Alan Modra 12be538b0b daily update 2003-06-02 00:00:05 +00:00
Alan Modra e8898e69f1 daily update 2003-06-01 00:00:05 +00:00
Jakub Jelinek f2c822e386 * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192
plt entries, not just 8191.
2003-05-31 07:55:10 +00:00
Alan Modra 081933c009 daily update 2003-05-31 00:57:55 +00:00
Daniel Jacobowitz c9c27aad54 * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index.
Reported by Ken Faiczak <kfaiczak@SANDVINE.com>.
2003-05-30 19:13:36 +00:00
Jakub Jelinek 36af4a4e51 bfd/
* elflink.h (elf_link_add_object_symbols): Use !info->executable
	instead of info->shared where appropriate.
	(bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise.
	* elflink.c (_bfd_elf_create_got_section): Likewise.
	(_bfd_elf_link_create_dynamic_sections): Likewise.
	(_bfd_elf_link_assign_sym_version): Likewise.
	* elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section
	and DT_DEBUG dynamic tag even for position independent executables.
	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
	* elf32-s390.c (elf_s390_size_dynamic_sections: Likewise.
	* elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise.
	* elf64-s390.c (elf_s390_size_dynamic_sections: Likewise.
	* elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise.
	* elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise.
	* elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise.
	* elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise.
	* elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise.
include/
	* bfdlink.h (struct bfd_link_info): Add pie and executable
	bits.
ld/
	* lexsup.c (OPTION_PIE): Define.
	(ld_options): Add -pie and --pic-executable options.
	(parse_args): Handle OPTION_PIE.
	* ldmain.c (main): Initialize link_info.pie and
	link_info.executable.
	* genscripts.sh: Generate PIE scripts.
	* ld.texinfo: Document -pie and --pic-executable options.
	* emultempl/elf32.em (gld${EMULATION_NAME}_after_open):
	(gld${EMULATION_NAME}_place_orphan): Likewise.
	(gld${EMULATION_NAME}_get_script): Include PIE scripts.
	* scripttempl/elf.sc: In PIE scripts set . the same way as in
	shared scripts.
	* emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes.
	* emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise.
	* emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
2003-05-30 15:50:12 +00:00
Alan Modra 027e4eea9c daily update 2003-05-30 00:00:04 +00:00
Alan Modra f8843e8713 * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
signalled thread.
	(elfcore_grok_nto_gregs): Only make .reg section for the active thread.
2003-05-29 23:50:04 +00:00
Nick Clifton 29e1a6e4ca Replace <ctype.h> with "safe-ctype.h" 2003-05-29 15:05:41 +00:00
Thiemo Seufer 4b55507088 * elfxx-mips.c: Don't force symbols local unconditionally. 2003-05-29 02:28:32 +00:00
Alan Modra 7bd7a2abff daily update 2003-05-29 00:00:05 +00:00
H.J. Lu 0236e03ee7 2003-05-28 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus
	undefined_symbol call.
2003-05-28 20:27:51 +00:00
Richard Sandiford 9e4aeb9307 * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting.
(mips_elf_link_hash_table): Likewise.
2003-05-27 08:04:12 +00:00
Alan Modra 0b4ffb6c40 daily update 2003-05-23 00:00:06 +00:00
Thiemo Seufer d0c728db63 * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
R_MIPS_GNU_REL16_S2 support.
	(bfd_elf64_bfd_reloc_type_lookup): Use it.
	(mips_elf64_rtype_to_howto): Use it.
	* elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used
	R_MIPS_GNU_REL16_S2 support.
	(bfd_elf32_bfd_reloc_type_lookup): Use it.
	(mips_elf_n32_rtype_to_howto): Use it.
2003-05-22 09:27:52 +00:00
Dave Anglin 759ebd765d * som.h: Define PA_2_0 before including a.out.h 2003-05-22 03:34:52 +00:00
Alan Modra 2e7b6c08fd daily update 2003-05-22 00:00:06 +00:00
Eric Christopher 143d77c5e9 2003-05-07 Eric Christopher <echristo@redhat.com>
Alexandre Oliva   <aoliva@redhat.com>

	* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
	pic tests, change to warning.
	(_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.

2003-05-07  Eric Christopher  <echristo@redhat.com>

        * config/tc-mips.c (mips_abicalls): New variable.
        (md_parse_option): Use.
        (s_option): Ditto.
        (s_abicalls): Ditto.
        (mips_elf_final_processing): Set EF_MIPS_PIC and
        EF_MIPS_CPIC dependent on above.
2003-05-21 21:53:33 +00:00
Nick Clifton cea3d58d02 Check for a target triplet of shl-...-netbsdelf as well as shle-...-netbsdelf. 2003-05-21 13:06:30 +00:00
Nick Clifton 60e424089f Fix dst_mask for X_STORMY16_REL_12 reloc. 2003-05-21 12:36:46 +00:00
Nick Clifton 385a4c14f3 USe is_elf_hash_table() to check for the presence of an elf_link_hash_table 2003-05-21 09:23:07 +00:00
Roland McGrath 129b8c20a8 . 2003-05-21 00:57:35 +00:00
Roland McGrath a05758dd2d 2003-05-19 Roland McGrath <roland@redhat.com>
* elf.c (bfd_elf_bfd_from_remote_memory): New function.
	* bfd-in.h: Declare it.
	* bfd-in2.h: Regenerated.
	* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
	* elf-bfd.h (struct elf_backend_data): New function pointer member
	elf_backend_bfd_from_remote_memory.
	(_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
	Declare them.
	* elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
	(elfNN_bed): Add that to the initializer.
2003-05-21 00:57:20 +00:00
Roland McGrath 8d6337feeb 2003-05-19 Roland McGrath <roland@redhat.com>
* elf.c (bfd_elf_bfd_from_remote_memory): New function.
	* bfd-in.h: Declare it.
	* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
	* elf-bfd.h (struct elf_backend_data): New function pointer member
	elf_backend_bfd_from_remote_memory.
	(_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
	Declare them.
	* elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
	(elfNN_bed): Add that to the initializer.
2003-05-21 00:56:05 +00:00
Roland McGrath 3333a7c339 2003-05-19 Roland McGrath <roland@redhat.com>
* elf.c (bfd_elf_bfd_from_remote_memory): New function.
	* bfd-in.h: Declare it.
	* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
	* elf-bfd.h (struct elf_backend_data): New function pointer member
	elf_backend_bfd_from_remote_memory.
	(_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
	Declare them.
	* elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
	(elfNN_bed): Add that to the initializer.
2003-05-15  Roland McGrath  <roland@redhat.com>

	* elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section.
2003-05-21 00:56:00 +00:00
Alan Modra 758949787c daily update 2003-05-21 00:00:06 +00:00
H.J. Lu 22d5e33918 bfd/
2003-05-20  Jakub Jelinek  <jakub@redhat.com>

	* elflink.h (elf_link_output_extsym): Only issue error about !=
	STV_DEFAULT symbols if they are bfd_link_hash_undefined.

2003-05-20  H.J. Lu <hongjiu.lu@intel.com>

	* elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF
	when removing the old definition for symbols with non-default
	visibility.

ld/testsuite/

2003-05-20  Jakub Jelinek  <jakub@redhat.com>

	* ld-elfvsb/common.c: New file.
	* ld-elfvsb/elfvsb.exp: Add common.

2003-05-20  H.J. Lu <hongjiu.lu@intel.com>

	* ld-elfvsb/sh3.c: New file.
	* ld-elfvsb/test.c: Likewise.

	* ld-elfvsb/elfvsb.exp: Add new weak hidden symbol tests.
2003-05-20 14:35:01 +00:00
Alan Modra 56fdfaa153 daily update 2003-05-20 00:00:37 +00:00
Jason Eckhardt b645cb1726 2003-05-18 Jason Eckhardt <jle@rice.edu>
gas:
        * config/tc-i860.c (i860_process_insn): Initialize fc after
        each opcode mismatch.

include/opcode:
        * i860.h (form, pform): Add missing .dd suffix.

opcodes:
        * i860-dis.c (print_insn_i860): Instruction shrd has a dual bit,
        print it.

bfd:
        * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation.
2003-05-18 21:24:33 +00:00
Andreas Schwab d2ff124f90 * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in
elf_section_data during processing of pc-relative and absolute
	relocations.
	(elf_m68k_relocate_section): Use the cached reloc section instead
	of computing it again.  Fix handling of visibility.  Don't modify
	addend when copying over a relocation into the output.
2003-05-17 19:40:36 +00:00
Alan Modra 9c7a29a32e * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
to trim plt entries.  Move undefweak non-default visibility test..
	(allocate_dynrelocs): ..from here.
	* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test
	dynamic_sections_created here.  Update comment.  Move undefweak
	non-default visibility test..
	(allocate_dynrelocs): ..from here.  Fix comment.
	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
	to trim plt entries.  Move undefweak non-default visibility test..
	(allocate_dynrelocs): ..from here.  Fix comment.
	* elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with
	STV_DEFAULT rather than comparing with zero.
	* elflink.c (_bfd_elf_merge_symbol): Likewise.
	(_bfd_elf_fix_symbol_flags): Likewise.  Format comment.
2003-05-17 06:16:03 +00:00
Thiemo Seufer 9bcf4de0de * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
pointers.
	(_bfd_set_gp_value): Likewise.
2003-05-17 00:41:45 +00:00
Alan Modra c580a37263 daily update 2003-05-17 00:00:06 +00:00
Michael Snyder 5d1db417ca 2003-05-16 Michael Snyder <msnyder@redhat.com>
From Bernd Schmidt  <bernds@redhat.com>
	* archures.c (bfd_mach_h8300sx): New.
	* bfd-in2.h: Regenerate.
	* cpu-h8300.c (h8300_scan)): Add support for h8300sx.
	(h8300sx_info_struct): New.
	(h8300s_info_struct): Link to it.
	* elf32-h8300.c (elf32_h8_mach): Add support for h8300sx.
	(elf32_h8_final_write_processing): Likewise.
	(elf32_h8_relax_section): Likewise.
2003-05-16 23:39:24 +00:00
Nick Clifton 80c7c40aef Replace i[3456]86 with i[3-7]86 2003-05-16 16:30:27 +00:00
Alan Modra 73e7296b30 daily update 2003-05-16 00:00:06 +00:00
H.J. Lu c1be741f92 2003-05-15 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
	symbol.
2003-05-15 14:54:47 +00:00
H.J. Lu a15d9d3a98 2003-05-14 H.J. Lu <hongjiu.lu@intel.com>
* elflink.h (elf_link_check_versioned_symbol): Also allow
	the base version.
2003-05-15 13:48:53 +00:00
Alan Modra 09695f5689 * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
(elf_i386_relocate_section): Likewise.
	* elf32-ppc.c (allocate_dynrelocs): Likewise.
	(ppc_elf_relocate_section): Likewise.
	* elf64-ppc.c (allocate_dynrelocs): Likewise.
	(ppc64_elf_relocate_section): Likewise.
2003-05-15 06:35:43 +00:00
Thiemo Seufer 40f62fa0b5 * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case. 2003-05-15 00:04:34 +00:00
Alan Modra 7f44fa07f0 daily update 2003-05-15 00:00:14 +00:00
Stephane Carrez 47247ced96 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for
processor capability, allow merge of HC12 and HCS12 in some cases.
	(m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc.
	* cpu-m68hc12.c (bfd_m68hc12s_arch): New struct.
	(bfd_m68hc12_arch): Link it.
	(scan_mach): New function.
2003-05-13 18:54:25 +00:00
Andrew Haley 32dfa85d90 2003-05-13 Andrew Haley <aph@redhat.com>
* elf.c (bfd_elf_hash): Mask lower 32 bits of hash.
2003-05-13 15:32:19 +00:00
Alan Modra 586119b38f * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from
elf32-ppc.c.  Add ELF_LINK_FORCED_LOCAL check.
	* elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete.
	(allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check.
	(ppc_elf_relocate_section): Likewise.
	* elf64-ppc.c (allocate_dynrelocs): Likewise.
	(ppc64_elf_relocate_section): Likewise.  Use for .got relocs too.
	(ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt
	relocs need no other types.
	* elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for
	dynreloc check.
	(elf_i386_relocate_section): Likewise.  Use for .got relocs too.
	(elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for
	.got relocs.
2003-05-13 14:09:51 +00:00
Kaz Kojima 04e534c39a * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols,
copy ELF_LINK_NON_GOT_REF from weakdef.
	(allocate_dynrelocs):  For undef weak syms with non-default
	visibility, a) don't allocate plt entries, b) don't allocate
	.got relocs, c) discard dyn rel space
        (sh_elf_relocate_section): d) don't generate .got relocs, e)
        don't generate dynamic relocs.
	(sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF
	for weakdefs when symbol already adjusted.
2003-05-13 12:13:37 +00:00
Alan Modra 03e2bd2f1f daily update 2003-05-13 00:00:06 +00:00
Nick Clifton 0afb2dc078 Use "bitfield" overflow detection for R_XSTORMY16_16 reloc. 2003-05-12 09:12:48 +00:00