Commit Graph

2092 Commits

Author SHA1 Message Date
Jeff Law
7b0af209eb * elf32-v850.c (bfd_elf3_v850_reloc): New function for
handling V850 specific relocs.
        (elf_v850_howto_table): Use the new function for some
        relocations.  Twiddle masks & shifts for some relocs.
        Set partial_inplace where needed.
Fixing more stuff.
1996-09-03 08:14:53 +00:00
Mark Alexander
b5ef63c4fc * .Sanitize: Remove reloc.c from v850_files. 1996-09-01 22:25:50 +00:00
Ian Lance Taylor
bde9d87544 * rs6000-core.c (rs6000coff_core_file_matches_executable_p):
Rewrite to use BFD file read routines and to avoid using a fixed
	length for the file name.
1996-09-01 19:44:40 +00:00
Jeff Law
237b5c4c9a * elf32-v850.c (enum reloc_type): Add R_V850_{32,16,8}.
(elf_v850_howto_table): Add support for R_V850_{32,16,8}.
        (v850_reloc_map): Add translation from BFD_RELOC_{32,16,8}
        to R_V850_{32,16,8}.
So we don't get "reloc XXX not supported" messages anymore.
1996-08-31 16:24:18 +00:00
J.T. Conklin
01b49cb35b * elf32-v850.c (reloc_type): Add R_V850_HI16_S.
(elf_v850_howto_table): Add info for HI16_S reloc.
(v850_reloc_map): Add HI_16_S reloc.
* reloc.c: Define BFD_RELOC_V850_* relocs.
1996-08-31 01:32:13 +00:00
Ian Lance Taylor
c86158e591 Add SH ELF support.
* elf32-sh.c: New file.
	* elf.c (prep_headers): Handle bfd_arch_sh.
	* elfcode.h (write_relocs): Handle absolute symbol.
	* elf-bfd.h (_bfd_elf32_link_read_relocs): Declare.
	(_bfd_elf64_link_read_relocs): Declare.
	* elflink.h (NAME(_bfd_elf,link_read_relocs)): Rename from
	elf_link_read_relocs.  Make globally visible.  Change all
	callers.
	(elf_link_input_bfd): Get external symbols from cache in
	symtab_hdr->contents.  Get contents from cache in
	elf_section_data.
	* elfxx-target.h (bfD_elfNN_bfd_relax_section): Only define if not
	already defined.
	* reloc.c: Define BFD_RELOC_SH_* relocs.
	* libbfd-in.h (_bfd_sh_align_load_span): Declare.
	* coff-sh.c (sh_insns_conflict): Fix a return value.
	(_bfd_sh_align_load_span): New globally visible function, broken
	out of sh_align_load.
	(sh_align_load): Call _bfd_sh_align_load_span.
	(sh_swap_insns): Change relocs parameter to PTR.
	* bfd-in2.h, libbfd.h: Rebuild.
	* targets.c (bfd_elf32_sh_vec): Declare.
	(bfd_elf32_shl_vec): Declare.
	* config.bfd (sh-*-elf*): New target.
	* configure.in (bfd_elf32_sh_vec): New target vector.
	(bfd_elf32_shl_vec): New target vector.
	* configure: Rebuild.
	* Makefile.in: Rebuild dependencies.
 	(BFD32_BACKENDS): Add elf32-sh.o.
	(BFD32_BACKENDS_CFILES): Add elf32-sh.c.

	* elf.c (map_sections_to_segments): Check that LMA does not skip a
	page before checking D_PAGED.
1996-08-30 22:09:51 +00:00
Ian Lance Taylor
492cfc71b8 * ihex.c (ihex_scan): Removed unnecessary extbase variable.
(ihex_write_object_contents): Remove extbase; always use segbase
	instead.
1996-08-30 15:52:40 +00:00
Michael Meissner
f7954d868f Recognize i686-*-* for pentium pro 1996-08-29 21:16:27 +00:00
Ian Lance Taylor
4da624ddb3 * elf32-mips.c (mips_elf_check_relocs): Set dynobj if needed for
R_MIPS_32 and R_MIPS_REL32.  Set sgot and g as soon as possible.
	(mips_elf_size_dynamic_sections): Don't require .got to exist.
	(mips_elf_finish_dynamic_sections): Likewise.
1996-08-27 04:14:13 +00:00
Ian Lance Taylor
1c952df609 * configure.host (HLDENV): New variable to set. Set it for
*-*-sysv4*, since those linkers may not support -R but they always
	support LD_RUN_PATH.
1996-08-23 00:07:59 +00:00
Ian Lance Taylor
9461513b04 * libieee.h (NSECTIONS): Don't define.
(ieee_data_struct): Change section_table to asection **.  Add
	section_table_size.
	* ieee.c (get_section_entry): If the table isn't big enough, make
	it bigger.
	(ieee_slurp_sections): Remove assertion about number of sections.
	(ieee_object_p): Adjust initialization of ieee to match changes to
	the structure.
PR 10377.
1996-08-23 00:02:55 +00:00
J.T. Conklin
0c1d95c791 * Makefile.in (ALL_MACHINES): Add cpu-v850.o.
(BFD32_BACKENDS) Add elf32-v850.o.
* archures.c: Add bfd_v850_arch.
* bfd-in2.h: Add bfd_v850_arch.
* config.bfd (v850-*-*): New target.
* configure: (bfd_elf32_v850_vec) New vector.
* configure.in: (bfd_elf32_v850_vec) New vector.
* cpu-v850.c: New file.
* elf.c (prep_headers): Added case bfd_arch_v850.
* elf32-v850.c: New file.
* targets.c (bfd_elf32_v850_vec): New vector.
1996-08-20 22:09:25 +00:00
Stan Shebs
22edd54732 * mpw-config.in: Update editing of autoconf vars to reflect
Jul 18 configure.in change.
	* mpw-make.sed: Update editing of include pathnames to be
	more general, add @DASH_C_FLAG@ to explicit compile rule edit.
1996-08-15 19:41:17 +00:00
Jackie Smith Cashion
53ef6e6076 Thu Aug 15 16:40:30 1996 James G. Smith <jsmith@cygnus.co.uk>
* reloc.c: (BFD_RELOC_ARM_THUMB_ADD, BFD_RELOC_ARM_THUMB_IMM,
	BFD_RELOC_ARM_THUMB_SHIFT, BFD_RELOC_ARM_THUMB_OFFSET):
 	Added, for internal use by the ARM gas.
	* libbfd.h: Rebuilt
	* bfd-in2.h: Rebuilt
1996-08-15 15:58:35 +00:00
Ian Lance Taylor
37d7888d03 Wed Aug 14 17:02:09 1996 Richard Henderson <rth@tamu.edu>
* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Correct typo
	in section dynidx start.
1996-08-15 00:03:50 +00:00
Ian Lance Taylor
e38d6d362f * elf.c (_bfd_elf_make_section_from_shdr): Treat sections whose
name begins with .gnu.linkonce as SEC_LINK_ONCE.  This is an
	optimization for g++.
1996-08-13 21:39:37 +00:00
Michael Meissner
ae20860e9d If one module has -mrelocatable-lib and the other doesn't, clear the -mrelocatable-lib bit 1996-08-13 21:09:06 +00:00
Ian Lance Taylor
4596421b67 * elflink.h (elf_link_add_object_symbols): Do not resolve a common
symbol against a STT_FUNC symbol in a shared library.
1996-08-11 03:39:46 +00:00
Ian Lance Taylor
410bc61d0c * xcofflink.c (xcoff_link_add_dynamic_symbols): If a descriptor
symbol is found, automatically define the corresponding function
 	code.
PR 10299.
1996-08-10 00:15:30 +00:00
Ian Lance Taylor
d92099f198 * cofflink.c (coff_link_add_symbols): Only set (*sym_hash)->numaux
if sym.n_numaux is not zero.
	(_bfd_coff_link_input_bfd): Permit the symbol and the hash table
	entry to disagree about the number of aux entries if the symbol
	has zero.
1996-08-09 18:46:54 +00:00
Ian Lance Taylor
f11e3f6278 * elf32-mips.c (mips_elf_check_relocs): Create the .rel.dyn
section if it might be needed, not just if info->shared.
	(mips_elf_adjust_dynamic_symbol): Make room for a null element at
	the start of .rel.dyn if we are going to use it.
	(mips_elf_finish_dynamic_sections): Only clear the first element
	of .rel.dyn if the size is greater than zero.
Fix this case from c-torture:
extern int abort();
typedef int (*frob)();
frob f[] = {abort};
main()
{
  exit(0);
}
1996-08-09 16:47:15 +00:00
Ian Lance Taylor
b2a05baf21 * xcofflink.c (xcoff_link_input_bfd): If we already called the
undefined_symbol callback for a symbol, then don't issue any more
	warnings about loader relocs.
	(_bfd_ppc_xcoff_relocate_section): Don't do any further processing
	after calling the undefined_symbol callback.
1996-08-08 21:15:32 +00:00
Ian Lance Taylor
fbc4ed7ded * xcofflink.c (XCOFF_MULTIPLY_DEFINED): Define.
(xcoff_link_add_symbols): Permit multiple definitions of a symbol
	as the AIX linker seems to do.
PR 10304.
1996-08-08 20:33:39 +00:00
Ian Lance Taylor
8612a388f7 Thu Aug 8 12:21:56 1996 Klaus Kaempf <kkaempf@progis.de>
* evax-alpha.c (evax_alpha_vec): Corrected flags, cleanup.
	(evax_initialize): Remove evax_reloc_table.
	(evax_close_and_cleanup): Ditto.
	(reloc_nil): Ditto.
	(alpha_howto_table): Remove ALPHA_R_SWREL32 and ALPHA_R_SWREL64
	entries.
	(evax_bfd_reloc_type_lookup): Ditto.
	* evax-egsd.c (_bfd_evax_slurp_egsd): Add a few casts; set
	cooked_size == raw_size.
	* evax-emh.c (_bfd_evax_register_filename): Remove.
	* evax-etir.c (etir_stc): Allow ETIR_S_C_STC_xx commands.
	* evax-misc.c (add_new_contents): Malloc section at full size.
	(_bfd_save_evax_section): Memcpy section contents directly.
	* evax.h (ALPHA_R_SWREL32, ALPHA_R_SWREL64): Remove.
	(evax_reloc_table): Remove.

	* hosts/alphavms.h (O_ACCMODE): Define if needed.

	* makefile.vms: Add better support for DEC C compilation
	Add evax.h dependencies

	* reloc.c (bfd_get_reloc_size): Add case for 16 byte reloc.
	(BFD_RELOC_SWREL32,BFD_RELOC_SWREL64): Remove.
	(BFD_RELOC_ALPHA_BASEREG): Remove.
	* bfd-in2.h, libbfd.h: Rebuild.
1996-08-08 16:27:21 +00:00
Stu Grossman
320a5c6b18 * archive.c (bsd_write_armap): Ifdef around calls to getuid and
getgid if _WIN32 is defined.
	* opncls.c (bfd_fdopenr):  Remove unnecessary WINGDB ifdef.
1996-08-08 15:23:01 +00:00
Stu Grossman
2055bf857d * aoutx.h bfd-in.h bfd-in2.h opncls.c riscix.c som.c targets.c:
Change NO_FLAGS to BFD_NO_FLAGS to avoid conflict with an HPUX
	include file.
	* libbfd.c:  Create dummy getpagesize() macro if HAVE_GETPAGESIZE
	isn't defined.
1996-08-08 06:27:01 +00:00
Ian Lance Taylor
cc425b5558 * cpu-i386.c (i8086_arch): Architecture info for the i8086. 1996-08-07 20:10:14 +00:00
Ian Lance Taylor
85fe9d3e46 Wed Aug 7 14:11:44 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* configure.in: Call BFD_NEEDED_DECLARATION on strstr and
	realloc.
	* acconfig.h (NEED_DECLARATION_STRSTR): New macro.
	(NEED_DECLARATION_REALLOC): New macro.
	* configure, config.in: Rebuild.
	* sysdep.h (strstr): Declare if NEED_DECLARATION_STRSTR.
	(realloc): Declare if NEED_DECLARATION_REALLOC.
1996-08-07 18:17:22 +00:00
Ian Lance Taylor
9b3307b0a0 Based on patches from Eric Valette <valette@crf.canon.fr>:
* elf32-i386.c (enum reloc_type): Add FIRST_INVALID_RELOC,
	LAST_INVALID_RELOC, R_386_16, R_386_PC16, R_386_8, R_386_PC8.
	(elf_howto_table): Add entries for new relocs.
	(elf_i386_reloc_type_lookup): Handle new relocs.
	(elf_i386_info_to_howto): Just call abort.
	(elf_i386_info_to_howto_rel): Check that the reloc type is valid.
	(elf_i386_relocate_section): Likewise.
1996-08-07 16:14:09 +00:00
Martin Hunt
75e3a45a0d Tue Aug 6 12:54:56 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* elf32-d10v.c (elf_d10v_howto_table): Added R_D10V_32.
1996-08-06 19:56:21 +00:00
Ian Lance Taylor
b944e7e855 * elf.c (_bfd_elf_make_section_from_shdr): For a loadable section,
only get the LMA from the phdr if they are in the same part of the
	file.
1996-08-05 20:45:55 +00:00
Ian Lance Taylor
191d910cb9 * elf.c (map_sections_to_segments): Rewrite tests for starting a
new segment to make them more comprehensible.  If the relationship
	between the LMA and the VMA changed, start a new segment.  Don't
	check dynsec when deciding whether to start a new segment for a
	writeable section; -N will now handle this.
1996-08-05 17:45:58 +00:00
Jeff Law
e751d5068f * libhppa.h: Remove "esel" changes. Not the right approach.
* som.c: Corresponding changes.
        (som_bfd_derive_misc_symbol_info): Use ST_DATA for symbols
        which don't have a SOM symbol type associated with them.
        Reverses a 1994 change.
More PA EH tweakage (to get exception handling tables properly relocated
in shared libraries).
1996-08-02 04:50:08 +00:00
Ian Lance Taylor
cdb88e8764 Make ld -N more reasonable for ELF:
* elf.c (map_sections_to_segments): If D_PAGED is not set, set
	phdr_in_section to false, and always use a single load segment.
	(elf_sort_sections): Sort sections by LMA after VMA.
	(assign_file_positions_for_segments): If D_PAGED is not set, don't
	align to maxpagesize.
	(assign_file_positions_except_relocs): Likewise.
	* elfcode.h (elf_object_p): If a section is loaded but not page
	aligned, clear D_PAGED.
1996-07-31 19:58:05 +00:00
Jackie Smith Cashion
d1b40d8eeb Wed Jul 31 15:00:12 1996 James G. Smith <jsmith@cygnus.co.uk>
* reloc.c: (BFD_RELOC_ARM_OFFSETIMM8, BFD_RELOC_ARM_HWLITERAL):
 	Added, for internal use by the ARM gas.
	* libbfd.h: Rebuilt
	* bfd-in2.h: Rebuilt
1996-07-31 14:34:21 +00:00
Jeff Law
ad240a8289 * libhppa.h (R_HPPA_ESEL): New field selector.
(e_esel): Similarly.
        * som.c (hppa_som_gen_reloc_type): If we encounter an e_esel,
        then generate R_COMP2 (PUSH_SYM), R_DATA_EXPR fixup stream.
        (som_write_fixups): Handle R_DATA_EXPR just like R_CODE_EXPR.
Making another stab at EH support on the PA.
1996-07-30 20:16:27 +00:00
Ian Lance Taylor
fb4dc1eb5f * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Do the regular
archive search before looking for stripped dynamic objects.
PR 10187.
1996-07-30 17:39:33 +00:00
Ian Lance Taylor
b223f95038 * xcofflink.c (xcoff_build_ldsyms): Make exporting an undefined
symbol a warning rather than an error.
PR 10208.
1996-07-26 21:53:08 +00:00
Ian Lance Taylor
64f808f92b * elf.c (assign_file_positions_for_segments): Track the virtual
memory position separately from the file position, and use it to
	compute the alignment adjustment.
PR 10039.
1996-07-24 16:05:32 +00:00
Martin Hunt
11609502f0 start-sanitize-d10v
Tue Jul 23 10:43:31 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>

	* elf32-d10v.c (elf_d10v_howto_table): Changed all relocs to "long"
 	and fixed mask on R_D10V_10_PCREL_L.

end-sanitize-d10v
1996-07-23 17:54:21 +00:00
Ian Lance Taylor
bf9884d41d * elf64-mips.c: Include "aout/ar.h".
(mips_elf64_slurp_armap): New static function.
	(mips_elf64_write_armap): New static function.
	(bfd_elf64_archive_*): Define.
	* elfxx-target.h (bfd_elfNN_archive_p): Define if not defined.
	Use instead of bfd_generic_archive_p.
	(bfd_elfNN_write_archive_contents): Define if not defined.  Use
	instead of _bfd_write_archive_contents.
	(bfd_elfNN_mkdarchive): Define if not defined.  Use instead of
	_bfd_generic_mkarchive.
	(TARGET_BIG_SYM): If bfd_elfNN_archive_functions is defined, use
	bfd_elfNN_archive in BFD_JUMP_TABLE_ARCHIVE rather than
	_bfd_archive_coff.
	(TARGET_LITTLE_SYM): Likewise.
	* archive.c (bfd_slurp_armap): Check for and reject an archive map
	name of /SYM64/.
	* Makefile.in: Rebuild dependencies.
1996-07-22 23:02:35 +00:00
Ian Lance Taylor
9bd65136af * libecoff.h (ecoff_data_type): Add rdata_in_text field.
* ecoff.c (ecoff_compute_section_file_positions): Copy
	rdata_in_text from backend info to tdata.  Clear it if any data
	section comes before .rdata.
	(_bfd_ecoff_write_object_contents): Use rdata_in_text field in
	tdata rather than backend info.
1996-07-22 19:38:23 +00:00
Ian Lance Taylor
194141a9b8 * configure.in: Fix test for whether a compiler has a 64 bit
type.  From Jim Wilson <wilson@cygnus.com>.
VS: ----------------------------------------------------------------------
1996-07-19 22:16:50 +00:00
Ian Lance Taylor
f4e14cb901 * configure.in: Set and substitute VERSION, BFD_HOST_64BIT_LONG
(replacing HOST_64BITLONG), BFD_HOST_64_BIT_DEFINED,
	BFD_HOST_64_BIT, and BFD_HOST_U_64_BIT.  Add bfd-in2.h:bfd-in2.h
	to AC_OUTPUT call.
	* configure: Rebuild.
	* bfd-in.h (BFD_ARCH_SIZE): Define as @wordsize@, not @WORDSIZE@.
	(BFD_HOST_64_BIT): Define conditionally.
	(BFD_HOST_U_64_BIT): Define when BFD_HOST_64_BIT is defined.
	(bfd_vma): Typedef as BFD_HOST_U_64_BIT.
	(symvalue, bfd_size_type): Likewise.
	* bfd-in2.h: Rebuild.
	* Makefile.in (do_clean): Remove bfd-tmp.h.
	(do_distclean): Remove bfd-in3.h.
	(stmp-bfd.h): Just do copy-if-change bfd-in3.h bfd.h.
	(bfd-in3.h): New target.
1996-07-19 00:48:20 +00:00
Ian Lance Taylor
74556b94ff * config.bfd (sparc-*-sysv4*): Don't build sunos_big_vec. From
Andrew Gierth <ANDREWG@microlise.co.uk>.
1996-07-18 21:36:21 +00:00
Ian Lance Taylor
ab659fd6de * configure.host: Set INSTALL_SHLIB.
* configure.in: Call AC_SUBST (INSTALL_SHLIB).
	* configure: Rebuild.
	* Makefile.in (install): Use @INSTALL_SHLIB@.
1996-07-18 21:19:11 +00:00
Ian Lance Taylor
e8c249cb2c * config.bfd (mips*-*-irix6*): New target.
* configure.host: Handle Irix 6 shared library like Irix 5.
1996-07-18 20:33:22 +00:00
Ian Lance Taylor
a8a3d83af0 * xcofflink.c (xcoff_link_add_symbols): Don't check an XMC_TD
symbol for a magic name.
	(xcoff_link_input_bfd): Don't change the reloc symbol for an
	XMC_TD symbol.
	(_bfd_ppc_xcoff_relocate_section): Don't get the TOC offset for an
	XMC_TD symbol.
1996-07-18 19:41:35 +00:00
Stan Shebs
b576c7b3d2 * mpw-config.in: Add ELF support to mips config, create the
elf32-target.h file in the object dir.
	* mpw-make.sed: Edit elfXX-target.h refs at beginnings of lines.
1996-07-18 18:42:06 +00:00
Kim Knuttila
2ba0d82d52 Removed debug, fixed diagnostics, etc 1996-07-18 01:04:14 +00:00