1993-06-16 02:25:53 +00:00
|
|
|
|
/* Main header file for the bfd library -- portable access to object files.
|
1998-04-22 16:54:08 +00:00
|
|
|
|
Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
|
|
|
|
|
Free Software Foundation, Inc.
|
1993-06-16 02:25:53 +00:00
|
|
|
|
Contributed by Cygnus Support.
|
|
|
|
|
|
1993-08-05 18:36:19 +00:00
|
|
|
|
** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
|
|
|
|
|
** instead, change bfd-in.h or the other BFD source files processed to
|
|
|
|
|
** generate these files.
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
1995-08-22 01:02:23 +00:00
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* bfd.h -- The only header file required by users of the bfd library
|
|
|
|
|
|
|
|
|
|
The bfd.h file is generated from bfd-in.h and various .c files; if you
|
|
|
|
|
change it, your changes will probably be lost.
|
|
|
|
|
|
|
|
|
|
All the prototypes and definitions following the comment "THE FOLLOWING
|
|
|
|
|
IS EXTRACTED FROM THE SOURCE" are extracted from the source files for
|
|
|
|
|
BFD. If you change it, someone oneday will extract it from the source
|
|
|
|
|
again, and your changes will be lost. To save yourself from this bind,
|
|
|
|
|
change the definitions in the source in the bfd directory. Type "make
|
|
|
|
|
docs" and then "make headers" in that directory, and magically this file
|
|
|
|
|
will change to reflect your changes.
|
|
|
|
|
|
|
|
|
|
If you don't have the tools to perform the extraction, then you are
|
|
|
|
|
safe from someone on your system trampling over your header files.
|
|
|
|
|
You should still maintain the equivalence between the source and this
|
|
|
|
|
file though; every change you make to the .c file should be reflected
|
|
|
|
|
here. */
|
|
|
|
|
|
|
|
|
|
#ifndef __BFD_H_SEEN__
|
|
|
|
|
#define __BFD_H_SEEN__
|
|
|
|
|
|
1995-08-31 16:23:02 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#include "ansidecl.h"
|
|
|
|
|
|
1994-03-17 23:47:00 +00:00
|
|
|
|
/* These two lines get substitutions done by commands in Makefile.in. */
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
#define BFD_VERSION "@VERSION@"
|
1996-07-19 00:48:20 +00:00
|
|
|
|
#define BFD_ARCH_SIZE @wordsize@
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
|
1996-07-19 00:48:20 +00:00
|
|
|
|
#if @BFD_HOST_64_BIT_DEFINED@
|
|
|
|
|
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
|
|
|
|
|
#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
|
|
|
|
|
#endif
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#if BFD_ARCH_SIZE >= 64
|
|
|
|
|
#define BFD64
|
|
|
|
|
#endif
|
|
|
|
|
|
* configure.in (*-*-netware, i[34]86-*-netware): New configs.
* Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o.
* Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o.
* Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c.
* Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets.
* bfd-in2.h (INLINE): Defines moved here.
* {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h.
* libelf.h (CAT4): Move define to bfd-in2.h.
* bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros.
* bfd-in2.h (union tdata): Add nlm_obj_data.
* bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour.
* targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes.
* targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec.
* (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c,
nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files
for NLM support.
1993-07-20 04:45:13 +00:00
|
|
|
|
#ifndef INLINE
|
|
|
|
|
#if __GNUC__ >= 2
|
|
|
|
|
#define INLINE __inline__
|
|
|
|
|
#else
|
|
|
|
|
#define INLINE
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* forward declaration */
|
|
|
|
|
typedef struct _bfd bfd;
|
|
|
|
|
|
|
|
|
|
/* To squelch erroneous compiler warnings ("illegal pointer
|
|
|
|
|
combination") from the SVR3 compiler, we would like to typedef
|
|
|
|
|
boolean to int (it doesn't like functions which return boolean.
|
|
|
|
|
Making sure they are never implicitly declared to return int
|
|
|
|
|
doesn't seem to help). But this file is not configured based on
|
|
|
|
|
the host. */
|
|
|
|
|
/* General rules: functions which are boolean return true on success
|
|
|
|
|
and false on failure (unless they're a predicate). -- bfd.doc */
|
|
|
|
|
/* I'm sure this is going to break something and someone is going to
|
|
|
|
|
force me to change it. */
|
|
|
|
|
/* typedef enum boolean {false, true} boolean; */
|
|
|
|
|
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
|
1994-01-07 19:03:10 +00:00
|
|
|
|
/* It gets worse if the host also defines a true/false enum... -sts */
|
1995-06-09 19:16:33 +00:00
|
|
|
|
/* And even worse if your compiler has built-in boolean types... -law */
|
|
|
|
|
#if defined (__GNUG__) && (__GNUC_MINOR__ > 5)
|
|
|
|
|
#define TRUE_FALSE_ALREADY_DEFINED
|
|
|
|
|
#endif
|
1995-10-06 16:15:35 +00:00
|
|
|
|
#ifdef MPW
|
|
|
|
|
/* Pre-emptive strike - get the file with the enum. */
|
|
|
|
|
#include <Types.h>
|
|
|
|
|
#define TRUE_FALSE_ALREADY_DEFINED
|
|
|
|
|
#endif /* MPW */
|
1994-01-07 19:03:10 +00:00
|
|
|
|
#ifndef TRUE_FALSE_ALREADY_DEFINED
|
1993-06-16 02:25:53 +00:00
|
|
|
|
typedef enum bfd_boolean {false, true} boolean;
|
1994-01-07 19:03:10 +00:00
|
|
|
|
#define BFD_TRUE_FALSE
|
|
|
|
|
#else
|
1995-06-15 21:18:17 +00:00
|
|
|
|
/* Use enum names that will appear nowhere else. */
|
|
|
|
|
typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
|
1994-01-07 19:03:10 +00:00
|
|
|
|
#endif
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* A pointer to a position in a file. */
|
|
|
|
|
/* FIXME: This should be using off_t from <sys/types.h>.
|
|
|
|
|
For now, try to avoid breaking stuff by not including <sys/types.h> here.
|
|
|
|
|
This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
|
|
|
|
|
Probably the best long-term answer is to avoid using file_ptr AND off_t
|
|
|
|
|
in this header file, and to handle this in the BFD implementation
|
|
|
|
|
rather than in its interface. */
|
|
|
|
|
/* typedef off_t file_ptr; */
|
|
|
|
|
typedef long int file_ptr;
|
|
|
|
|
|
1994-08-30 16:04:40 +00:00
|
|
|
|
/* Support for different sizes of target format ints and addresses.
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
|
|
|
|
|
set to 1 above. Otherwise, if gcc is being used, this code will
|
1996-07-19 00:48:20 +00:00
|
|
|
|
use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
|
|
|
|
|
defined above. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-12-06 22:14:30 +00:00
|
|
|
|
#ifndef BFD_HOST_64_BIT
|
|
|
|
|
# if BFD_HOST_64BIT_LONG
|
|
|
|
|
# define BFD_HOST_64_BIT long
|
|
|
|
|
# define BFD_HOST_U_64_BIT unsigned long
|
|
|
|
|
# else
|
|
|
|
|
# ifdef __GNUC__
|
|
|
|
|
# if __GNUC__ >= 2
|
|
|
|
|
# define BFD_HOST_64_BIT long long
|
|
|
|
|
# define BFD_HOST_U_64_BIT unsigned long long
|
|
|
|
|
# endif /* __GNUC__ >= 2 */
|
|
|
|
|
# endif /* ! defined (__GNUC__) */
|
|
|
|
|
# endif /* ! BFD_HOST_64BIT_LONG */
|
|
|
|
|
#endif /* ! defined (BFD_HOST_64_BIT) */
|
|
|
|
|
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
#ifdef BFD64
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
#ifndef BFD_HOST_64_BIT
|
Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
Added support for Alpha OpenVMS:
* evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
* evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
* config.h-vms, makefile.vms: New files.
* config.bfd (alpha-*-*vms*): New target.
* configure.in (evax_alpha_vec): New target vector.
* configure: Rebuild.
* reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
(BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
* targets.c (bfd_target_evax_flavour): Define.
(evax_alpha_vec): Declare.
(bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
if BFD64 is defined.
* bfd-in2.h, libbfd.h: Rebuild.
* Makefile.in: Rebuild dependencies.
(BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
evax-emh.o, and evax-misc.o.
(BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
evax-etir.c, evax-emh.c, and evax-misc.c.
(HFILES): Add evax.h.
1996-06-18 19:07:51 +00:00
|
|
|
|
#error No 64 bit integer type available
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
#endif /* ! defined (BFD_HOST_64_BIT) */
|
1993-07-06 20:46:32 +00:00
|
|
|
|
|
1996-07-19 00:48:20 +00:00
|
|
|
|
typedef BFD_HOST_U_64_BIT bfd_vma;
|
1994-02-03 03:33:20 +00:00
|
|
|
|
typedef BFD_HOST_64_BIT bfd_signed_vma;
|
1996-07-19 00:48:20 +00:00
|
|
|
|
typedef BFD_HOST_U_64_BIT bfd_size_type;
|
|
|
|
|
typedef BFD_HOST_U_64_BIT symvalue;
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
|
1994-01-20 00:07:58 +00:00
|
|
|
|
#ifndef fprintf_vma
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
#if BFD_HOST_64BIT_LONG
|
|
|
|
|
#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
|
|
|
|
|
#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
|
|
|
|
|
#else
|
|
|
|
|
#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
|
|
|
|
|
#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define fprintf_vma(s,x) \
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
|
1993-07-06 20:46:32 +00:00
|
|
|
|
#define sprintf_vma(s,x) \
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
|
1994-01-20 00:07:58 +00:00
|
|
|
|
#endif
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#else /* not BFD64 */
|
|
|
|
|
|
|
|
|
|
/* Represent a target address. Also used as a generic unsigned type
|
|
|
|
|
which is guaranteed to be big enough to hold any arithmetic types
|
|
|
|
|
we need to deal with. */
|
|
|
|
|
typedef unsigned long bfd_vma;
|
|
|
|
|
|
|
|
|
|
/* A generic signed type which is guaranteed to be big enough to hold any
|
|
|
|
|
arithmetic types we need to deal with. Can be assumed to be compatible
|
|
|
|
|
with bfd_vma in the same way that signed and unsigned ints are compatible
|
|
|
|
|
(as parameters, in assignment, etc). */
|
|
|
|
|
typedef long bfd_signed_vma;
|
|
|
|
|
|
|
|
|
|
typedef unsigned long symvalue;
|
|
|
|
|
typedef unsigned long bfd_size_type;
|
|
|
|
|
|
|
|
|
|
/* Print a bfd_vma x on stream s. */
|
|
|
|
|
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
|
1993-07-06 20:46:32 +00:00
|
|
|
|
#define sprintf_vma(s,x) sprintf(s, "%08lx", x)
|
1998-12-06 22:14:30 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#endif /* not BFD64 */
|
1998-12-06 22:14:30 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define printf_vma(x) fprintf_vma(stdout,x)
|
|
|
|
|
|
|
|
|
|
typedef unsigned int flagword; /* 32 bits of flags */
|
1995-02-06 08:31:27 +00:00
|
|
|
|
typedef unsigned char bfd_byte;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/** File formats */
|
|
|
|
|
|
|
|
|
|
typedef enum bfd_format {
|
|
|
|
|
bfd_unknown = 0, /* file format is unknown */
|
|
|
|
|
bfd_object, /* linker/assember/compiler output */
|
|
|
|
|
bfd_archive, /* object archive file */
|
|
|
|
|
bfd_core, /* core dump */
|
|
|
|
|
bfd_type_end} /* marks the end; don't use it! */
|
|
|
|
|
bfd_format;
|
|
|
|
|
|
1993-10-31 18:59:59 +00:00
|
|
|
|
/* Values that may appear in the flags field of a BFD. These also
|
|
|
|
|
appear in the object_flags field of the bfd_target structure, where
|
|
|
|
|
they indicate the set of flags used by that backend (not all flags
|
|
|
|
|
are meaningful for all object file formats) (FIXME: at the moment,
|
|
|
|
|
the object_flags values have mostly just been copied from backend
|
|
|
|
|
to another, and are not necessarily correct). */
|
|
|
|
|
|
|
|
|
|
/* No flags. */
|
1996-08-08 06:27:01 +00:00
|
|
|
|
#define BFD_NO_FLAGS 0x00
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD contains relocation entries. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define HAS_RELOC 0x01
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD is directly executable. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define EXEC_P 0x02
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD has line number information (basically used for F_LNNO in a
|
|
|
|
|
COFF header). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define HAS_LINENO 0x04
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD has debugging information. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define HAS_DEBUG 0x08
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD has symbols. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define HAS_SYMS 0x10
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD has local symbols (basically used for F_LSYMS in a COFF
|
|
|
|
|
header). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define HAS_LOCALS 0x20
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD is a dynamic object. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define DYNAMIC 0x40
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* Text section is write protected (if D_PAGED is not set, this is
|
|
|
|
|
like an a.out NMAGIC file) (the linker sets this by default, but
|
|
|
|
|
clears it for -r or -N). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define WP_TEXT 0x80
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
|
|
|
|
|
linker sets this by default, but clears it for -r or -n or -N). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define D_PAGED 0x100
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
|
|
|
|
/* BFD is relaxable (this means that bfd_relax_section may be able to
|
1994-08-30 16:04:40 +00:00
|
|
|
|
do something) (sometimes bfd_relax_section can do something even if
|
|
|
|
|
this is not set). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BFD_IS_RELAXABLE 0x200
|
1994-06-15 05:46:46 +00:00
|
|
|
|
|
|
|
|
|
/* This may be set before writing out a BFD to request using a
|
|
|
|
|
traditional format. For example, this is used to request that when
|
|
|
|
|
writing out an a.out object the symbols not be hashed to eliminate
|
|
|
|
|
duplicates. */
|
|
|
|
|
#define BFD_TRADITIONAL_FORMAT 0x400
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
|
|
|
|
|
/* This flag indicates that the BFD contents are actually cached in
|
|
|
|
|
memory. If this is set, iostream points to a bfd_in_memory struct. */
|
|
|
|
|
#define BFD_IN_MEMORY 0x800
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* symbols and relocation */
|
|
|
|
|
|
1994-01-22 02:18:02 +00:00
|
|
|
|
/* A count of carsyms (canonical archive symbols). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
typedef unsigned long symindex;
|
|
|
|
|
|
1995-02-06 08:31:27 +00:00
|
|
|
|
/* How to perform a relocation. */
|
|
|
|
|
typedef const struct reloc_howto_struct reloc_howto_type;
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
|
|
|
|
|
|
1994-01-22 02:18:02 +00:00
|
|
|
|
/* General purpose part of a symbol X;
|
|
|
|
|
target specific parts are in libcoff.h, libaout.h, etc. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_get_section(x) ((x)->section)
|
|
|
|
|
#define bfd_get_output_section(x) ((x)->section->output_section)
|
|
|
|
|
#define bfd_set_section(x,y) ((x)->section) = (y)
|
|
|
|
|
#define bfd_asymbol_base(x) ((x)->section->vma)
|
|
|
|
|
#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
|
|
|
|
|
#define bfd_asymbol_name(x) ((x)->name)
|
|
|
|
|
/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
|
|
|
|
|
#define bfd_asymbol_bfd(x) ((x)->the_bfd)
|
|
|
|
|
#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
|
|
|
|
|
|
1994-01-22 02:18:02 +00:00
|
|
|
|
/* A canonical archive symbol. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* This is a type pun with struct ranlib on purpose! */
|
|
|
|
|
typedef struct carsym {
|
|
|
|
|
char *name;
|
|
|
|
|
file_ptr file_offset; /* look here to find the file */
|
|
|
|
|
} carsym; /* to make these you call a carsymogen */
|
|
|
|
|
|
|
|
|
|
|
1994-01-22 02:18:02 +00:00
|
|
|
|
/* Used in generating armaps (archive tables of contents).
|
|
|
|
|
Perhaps just a forward definition would do? */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct orl { /* output ranlib */
|
|
|
|
|
char **name; /* symbol name */
|
|
|
|
|
file_ptr pos; /* bfd* or file position */
|
|
|
|
|
int namidx; /* index into string table */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Linenumber stuff */
|
|
|
|
|
typedef struct lineno_cache_entry {
|
|
|
|
|
unsigned int line_number; /* Linenumber from start of function*/
|
|
|
|
|
union {
|
1994-01-22 02:18:02 +00:00
|
|
|
|
struct symbol_cache_entry *sym; /* Function name */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
unsigned long offset; /* Offset into section */
|
|
|
|
|
} u;
|
|
|
|
|
} alent;
|
|
|
|
|
|
|
|
|
|
/* object and core file sections */
|
|
|
|
|
|
|
|
|
|
#define align_power(addr, align) \
|
|
|
|
|
( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
|
|
|
|
|
|
|
|
|
|
typedef struct sec *sec_ptr;
|
|
|
|
|
|
|
|
|
|
#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
|
|
|
|
|
#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
|
|
|
|
|
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
|
|
|
|
|
#define bfd_section_name(bfd, ptr) ((ptr)->name)
|
|
|
|
|
#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
|
|
|
|
|
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
|
1997-06-04 00:07:07 +00:00
|
|
|
|
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
|
|
|
|
|
#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
|
|
|
|
|
#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
|
|
|
|
|
|
|
|
|
|
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
|
|
|
|
|
1995-06-15 21:18:17 +00:00
|
|
|
|
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma= (val)), ((ptr)->user_set_vma = (boolean)true), true)
|
1995-06-10 00:05:51 +00:00
|
|
|
|
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
|
|
|
|
|
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
typedef struct stat stat_type;
|
|
|
|
|
|
|
|
|
|
typedef enum bfd_print_symbol
|
|
|
|
|
{
|
|
|
|
|
bfd_print_symbol_name,
|
|
|
|
|
bfd_print_symbol_more,
|
|
|
|
|
bfd_print_symbol_all
|
|
|
|
|
} bfd_print_symbol_type;
|
|
|
|
|
|
|
|
|
|
/* Information about a symbol that nm needs. */
|
|
|
|
|
|
|
|
|
|
typedef struct _symbol_info
|
|
|
|
|
{
|
|
|
|
|
symvalue value;
|
1994-01-22 02:18:02 +00:00
|
|
|
|
char type;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
CONST char *name; /* Symbol name. */
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
unsigned char stab_type; /* Stab type. */
|
|
|
|
|
char stab_other; /* Stab other. */
|
|
|
|
|
short stab_desc; /* Stab desc. */
|
|
|
|
|
CONST char *stab_name; /* String for stab type. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
} symbol_info;
|
1996-03-27 19:21:19 +00:00
|
|
|
|
|
|
|
|
|
/* Get the name of a stabs type code. */
|
|
|
|
|
|
|
|
|
|
extern const char *bfd_get_stab_name PARAMS ((int));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
/* Hash table routines. There is no way to free up a hash table. */
|
|
|
|
|
|
|
|
|
|
/* An element in the hash table. Most uses will actually use a larger
|
|
|
|
|
structure, and an instance of this will be the first field. */
|
|
|
|
|
|
|
|
|
|
struct bfd_hash_entry
|
|
|
|
|
{
|
|
|
|
|
/* Next entry for this hash code. */
|
|
|
|
|
struct bfd_hash_entry *next;
|
|
|
|
|
/* String being hashed. */
|
|
|
|
|
const char *string;
|
|
|
|
|
/* Hash code. This is the full hash code, not the index into the
|
|
|
|
|
table. */
|
|
|
|
|
unsigned long hash;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* A hash table. */
|
|
|
|
|
|
|
|
|
|
struct bfd_hash_table
|
|
|
|
|
{
|
|
|
|
|
/* The hash array. */
|
|
|
|
|
struct bfd_hash_entry **table;
|
|
|
|
|
/* The number of slots in the hash table. */
|
|
|
|
|
unsigned int size;
|
|
|
|
|
/* A function used to create new elements in the hash table. The
|
|
|
|
|
first entry is itself a pointer to an element. When this
|
|
|
|
|
function is first invoked, this pointer will be NULL. However,
|
|
|
|
|
having the pointer permits a hierarchy of method functions to be
|
|
|
|
|
built each of which calls the function in the superclass. Thus
|
|
|
|
|
each function should be written to allocate a new block of memory
|
|
|
|
|
only if the argument is NULL. */
|
|
|
|
|
struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
|
|
|
|
|
struct bfd_hash_table *,
|
|
|
|
|
const char *));
|
1997-03-18 00:47:04 +00:00
|
|
|
|
/* An objalloc for this hash table. This is a struct objalloc *,
|
|
|
|
|
but we use PTR to avoid requiring the inclusion of objalloc.h. */
|
|
|
|
|
PTR memory;
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Initialize a hash table. */
|
|
|
|
|
extern boolean bfd_hash_table_init
|
|
|
|
|
PARAMS ((struct bfd_hash_table *,
|
|
|
|
|
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
|
|
|
|
|
struct bfd_hash_table *,
|
|
|
|
|
const char *)));
|
|
|
|
|
|
|
|
|
|
/* Initialize a hash table specifying a size. */
|
|
|
|
|
extern boolean bfd_hash_table_init_n
|
|
|
|
|
PARAMS ((struct bfd_hash_table *,
|
|
|
|
|
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
|
|
|
|
|
struct bfd_hash_table *,
|
|
|
|
|
const char *),
|
|
|
|
|
unsigned int size));
|
|
|
|
|
|
|
|
|
|
/* Free up a hash table. */
|
|
|
|
|
extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *));
|
|
|
|
|
|
|
|
|
|
/* Look up a string in a hash table. If CREATE is true, a new entry
|
|
|
|
|
will be created for this string if one does not already exist. The
|
|
|
|
|
COPY argument must be true if this routine should copy the string
|
|
|
|
|
into newly allocated memory when adding an entry. */
|
|
|
|
|
extern struct bfd_hash_entry *bfd_hash_lookup
|
|
|
|
|
PARAMS ((struct bfd_hash_table *, const char *, boolean create,
|
|
|
|
|
boolean copy));
|
|
|
|
|
|
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
|
|
|
|
/* Replace an entry in a hash table. */
|
|
|
|
|
extern void bfd_hash_replace
|
|
|
|
|
PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old,
|
|
|
|
|
struct bfd_hash_entry *nw));
|
|
|
|
|
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
/* Base method for creating a hash table entry. */
|
|
|
|
|
extern struct bfd_hash_entry *bfd_hash_newfunc
|
|
|
|
|
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
|
|
|
|
|
const char *));
|
|
|
|
|
|
|
|
|
|
/* Grab some space for a hash table entry. */
|
1994-01-06 20:04:43 +00:00
|
|
|
|
extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *,
|
|
|
|
|
unsigned int));
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
|
|
|
|
|
/* Traverse a hash table in a random order, calling a function on each
|
|
|
|
|
element. If the function returns false, the traversal stops. The
|
|
|
|
|
INFO argument is passed to the function. */
|
|
|
|
|
extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
|
|
|
|
|
boolean (*) (struct bfd_hash_entry *,
|
|
|
|
|
PTR),
|
|
|
|
|
PTR info));
|
|
|
|
|
|
* configure.in (*-*-netware, i[34]86-*-netware): New configs.
* Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o.
* Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o.
* Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c.
* Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets.
* bfd-in2.h (INLINE): Defines moved here.
* {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h.
* libelf.h (CAT4): Move define to bfd-in2.h.
* bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros.
* bfd-in2.h (union tdata): Add nlm_obj_data.
* bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour.
* targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes.
* targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec.
* (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c,
nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files
for NLM support.
1993-07-20 04:45:13 +00:00
|
|
|
|
/* Semi-portable string concatenation in cpp.
|
|
|
|
|
The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
|
|
|
|
|
The problem is, "32_" is not a valid preprocessing token, and we don't
|
|
|
|
|
want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the
|
|
|
|
|
inner CAT macros to be evaluated first, producing still-valid pp-tokens.
|
|
|
|
|
Then the final concatenation can be done. (Sigh.) */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#ifndef CAT
|
* configure.in (*-*-netware, i[34]86-*-netware): New configs.
* Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o.
* Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o.
* Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c.
* Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets.
* bfd-in2.h (INLINE): Defines moved here.
* {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h.
* libelf.h (CAT4): Move define to bfd-in2.h.
* bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros.
* bfd-in2.h (union tdata): Add nlm_obj_data.
* bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour.
* targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes.
* targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec.
* (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c,
nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files
for NLM support.
1993-07-20 04:45:13 +00:00
|
|
|
|
#ifdef SABER
|
|
|
|
|
#define CAT(a,b) a##b
|
|
|
|
|
#define CAT3(a,b,c) a##b##c
|
|
|
|
|
#define CAT4(a,b,c,d) a##b##c##d
|
|
|
|
|
#else
|
1994-01-07 19:03:10 +00:00
|
|
|
|
#if defined(__STDC__) || defined(ALMOST_STDC)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define CAT(a,b) a##b
|
|
|
|
|
#define CAT3(a,b,c) a##b##c
|
* configure.in (*-*-netware, i[34]86-*-netware): New configs.
* Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o.
* Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o.
* Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c.
* Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets.
* bfd-in2.h (INLINE): Defines moved here.
* {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h.
* libelf.h (CAT4): Move define to bfd-in2.h.
* bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros.
* bfd-in2.h (union tdata): Add nlm_obj_data.
* bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour.
* targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes.
* targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec.
* (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c,
nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files
for NLM support.
1993-07-20 04:45:13 +00:00
|
|
|
|
#define XCAT2(a,b) CAT(a,b)
|
|
|
|
|
#define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#else
|
|
|
|
|
#define CAT(a,b) a/**/b
|
|
|
|
|
#define CAT3(a,b,c) a/**/b/**/c
|
* configure.in (*-*-netware, i[34]86-*-netware): New configs.
* Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o.
* Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o.
* Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c.
* Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets.
* bfd-in2.h (INLINE): Defines moved here.
* {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h.
* libelf.h (CAT4): Move define to bfd-in2.h.
* bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros.
* bfd-in2.h (union tdata): Add nlm_obj_data.
* bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour.
* targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes.
* targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec.
* (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c,
nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files
for NLM support.
1993-07-20 04:45:13 +00:00
|
|
|
|
#define CAT4(a,b,c,d) a/**/b/**/c/**/d
|
|
|
|
|
#endif
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
|
|
|
|
|
|
|
|
|
|
/* User program access to BFD facilities */
|
|
|
|
|
|
1994-08-30 16:04:40 +00:00
|
|
|
|
/* Direct I/O routines, for programs which know more about the object
|
|
|
|
|
file than BFD does. Use higher level routines if possible. */
|
|
|
|
|
|
|
|
|
|
extern bfd_size_type bfd_read
|
|
|
|
|
PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
|
|
|
|
|
extern bfd_size_type bfd_write
|
|
|
|
|
PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
|
1994-09-26 15:01:59 +00:00
|
|
|
|
extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction));
|
1994-08-30 16:04:40 +00:00
|
|
|
|
extern long bfd_tell PARAMS ((bfd *abfd));
|
|
|
|
|
extern int bfd_flush PARAMS ((bfd *abfd));
|
|
|
|
|
extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
|
|
|
|
|
|
1995-06-16 22:08:26 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* Cast from const char * to char * so that caller can assign to
|
|
|
|
|
a char * without a warning. */
|
|
|
|
|
#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
|
1993-11-05 08:34:09 +00:00
|
|
|
|
#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_get_format(abfd) ((abfd)->format)
|
|
|
|
|
#define bfd_get_target(abfd) ((abfd)->xvec->name)
|
1993-10-31 18:59:59 +00:00
|
|
|
|
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
|
|
|
|
|
#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
|
|
|
|
|
#define bfd_header_big_endian(abfd) \
|
|
|
|
|
((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
|
|
|
|
|
#define bfd_header_little_endian(abfd) \
|
|
|
|
|
((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_get_file_flags(abfd) ((abfd)->flags)
|
|
|
|
|
#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
|
|
|
|
|
#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
|
|
|
|
|
#define bfd_my_archive(abfd) ((abfd)->my_archive)
|
|
|
|
|
#define bfd_has_map(abfd) ((abfd)->has_armap)
|
|
|
|
|
|
|
|
|
|
#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
|
|
|
|
|
#define bfd_usrdata(abfd) ((abfd)->usrdata)
|
|
|
|
|
|
|
|
|
|
#define bfd_get_start_address(abfd) ((abfd)->start_address)
|
|
|
|
|
#define bfd_get_symcount(abfd) ((abfd)->symcount)
|
|
|
|
|
#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
|
|
|
|
|
#define bfd_count_sections(abfd) ((abfd)->section_count)
|
|
|
|
|
|
|
|
|
|
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
|
|
|
|
|
1995-06-15 21:18:17 +00:00
|
|
|
|
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean)(bool)), true)
|
1993-11-05 08:34:09 +00:00
|
|
|
|
|
1995-12-01 21:45:33 +00:00
|
|
|
|
extern boolean bfd_record_phdr
|
|
|
|
|
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
|
|
|
|
|
boolean, boolean, unsigned int, struct sec **));
|
|
|
|
|
|
1993-09-22 14:54:50 +00:00
|
|
|
|
/* Byte swapping routines. */
|
|
|
|
|
|
* bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* bfd-in2.h: Rebuilt.
* libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* targets.c (bfd_target): Change swap function pointers
accordingly.
* archive.c (do_slurp_coff_armap): Change swap accordingly.
* aix386-core.c: Change NO_GET and NO_GETS accordingly.
* hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
accordingly.
1994-01-03 21:28:43 +00:00
|
|
|
|
bfd_vma bfd_getb64 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_vma bfd_getl64 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_vma bfd_getb32 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_vma bfd_getl32 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_vma bfd_getb16 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_vma bfd_getl16 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *));
|
|
|
|
|
bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *));
|
1993-09-22 14:54:50 +00:00
|
|
|
|
void bfd_putb64 PARAMS ((bfd_vma, unsigned char *));
|
|
|
|
|
void bfd_putl64 PARAMS ((bfd_vma, unsigned char *));
|
|
|
|
|
void bfd_putb32 PARAMS ((bfd_vma, unsigned char *));
|
|
|
|
|
void bfd_putl32 PARAMS ((bfd_vma, unsigned char *));
|
|
|
|
|
void bfd_putb16 PARAMS ((bfd_vma, unsigned char *));
|
|
|
|
|
void bfd_putl16 PARAMS ((bfd_vma, unsigned char *));
|
1994-05-10 18:29:19 +00:00
|
|
|
|
|
|
|
|
|
/* Externally visible ECOFF routines. */
|
1993-09-22 14:54:50 +00:00
|
|
|
|
|
1994-01-07 19:03:10 +00:00
|
|
|
|
#if defined(__STDC__) || defined(ALMOST_STDC)
|
1993-11-24 07:21:28 +00:00
|
|
|
|
struct ecoff_debug_info;
|
|
|
|
|
struct ecoff_debug_swap;
|
|
|
|
|
struct ecoff_extr;
|
|
|
|
|
struct symbol_cache_entry;
|
1994-01-20 00:07:58 +00:00
|
|
|
|
struct bfd_link_info;
|
1995-10-25 15:37:47 +00:00
|
|
|
|
struct bfd_link_hash_entry;
|
1997-02-28 02:07:54 +00:00
|
|
|
|
struct bfd_elf_version_tree;
|
1993-11-24 07:21:28 +00:00
|
|
|
|
#endif
|
1994-05-10 18:29:19 +00:00
|
|
|
|
extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd));
|
|
|
|
|
extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value));
|
|
|
|
|
extern boolean bfd_ecoff_set_regmasks
|
|
|
|
|
PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask,
|
|
|
|
|
unsigned long *cprmask));
|
1994-01-20 00:07:58 +00:00
|
|
|
|
extern PTR bfd_ecoff_debug_init
|
1993-11-24 07:21:28 +00:00
|
|
|
|
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
1994-01-20 00:07:58 +00:00
|
|
|
|
const struct ecoff_debug_swap *output_swap,
|
|
|
|
|
struct bfd_link_info *));
|
|
|
|
|
extern void bfd_ecoff_debug_free
|
|
|
|
|
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
|
|
|
|
const struct ecoff_debug_swap *output_swap,
|
|
|
|
|
struct bfd_link_info *));
|
|
|
|
|
extern boolean bfd_ecoff_debug_accumulate
|
|
|
|
|
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
1993-11-24 07:21:28 +00:00
|
|
|
|
const struct ecoff_debug_swap *output_swap,
|
|
|
|
|
bfd *input_bfd, struct ecoff_debug_info *input_debug,
|
|
|
|
|
const struct ecoff_debug_swap *input_swap,
|
1994-01-20 00:07:58 +00:00
|
|
|
|
struct bfd_link_info *));
|
|
|
|
|
extern boolean bfd_ecoff_debug_accumulate_other
|
|
|
|
|
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
|
|
|
|
const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
|
|
|
|
|
struct bfd_link_info *));
|
1993-11-24 07:21:28 +00:00
|
|
|
|
extern boolean bfd_ecoff_debug_externals
|
|
|
|
|
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap,
|
|
|
|
|
boolean relocateable,
|
|
|
|
|
boolean (*get_extr) (struct symbol_cache_entry *,
|
|
|
|
|
struct ecoff_extr *),
|
|
|
|
|
void (*set_index) (struct symbol_cache_entry *,
|
|
|
|
|
bfd_size_type)));
|
1994-01-06 20:04:43 +00:00
|
|
|
|
extern boolean bfd_ecoff_debug_one_external
|
|
|
|
|
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap,
|
|
|
|
|
const char *name, struct ecoff_extr *esym));
|
1993-11-24 07:21:28 +00:00
|
|
|
|
extern bfd_size_type bfd_ecoff_debug_size
|
|
|
|
|
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap));
|
|
|
|
|
extern boolean bfd_ecoff_write_debug
|
|
|
|
|
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap, file_ptr where));
|
1994-01-20 00:07:58 +00:00
|
|
|
|
extern boolean bfd_ecoff_write_accumulated_debug
|
|
|
|
|
PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug,
|
|
|
|
|
const struct ecoff_debug_swap *swap,
|
|
|
|
|
struct bfd_link_info *info, file_ptr where));
|
1995-01-12 02:41:04 +00:00
|
|
|
|
extern boolean bfd_mips_ecoff_create_embedded_relocs
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
|
|
|
|
|
char **));
|
1993-11-24 07:21:28 +00:00
|
|
|
|
|
Add support for ELF shared libraries. Loosely based on work by
Eric Youngdale <ericy@cais.com>.
* libelf.h (struct elf_backend_data): Add new fields for dynamic
linking: elf_backend_create_dynamic_sections,
elf_backend_adjust_dynamic_symbol,
elf_backend_size_dynamic_sections,
elf_backend_finish_dynamic_symbol,
elf_backend_finish_dynamic_sections.
(struct elf_link_hash_entry): Change type of align field to
bfd_size_type. Add fields dynindx, dynstr_index, weakdef,
elf_link_hash_flags.
(struct elf_link_hash_table): Add fields dynobj, dynsymcount,
dynstr, bucketcount.
(bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
(bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
(bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
(bfd_elf32_add_dynamic_entry): Declare.
(bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
(bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
(bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
(bfd_elf64_add_dynamic_entry): Declare.
* elfcode.h (Elf_External_Dyn): Define.
(elf_swap_reloc_in): Define as macro using NAME. Make externally
visible.
(elf_swap_reloc_out): Likewise.
(elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
(elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
and as new externally visible function.
(elf_fake_sections): Set section type of dynamic sections based on
section names.
(elf_write_phdrs): Remove.
(assign_file_position_for_section): Add new align argument.
Change all callers.
(get_program_header_size): New static function.
(struct seg_info): Remove.
(map_program_segments): Completely rewrite.
(assign_file_positions_except_relocs): Completely rewrite.
(assign_file_positions_for_relocs): Don't set a file position for
sections which already have one. Don't bother to align the file
position here.
(section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
section types.
(elf_section_from_bfd_section): Likewise.
(elf_slurp_symbol_table): If section_from_elf_index fails, just
use bfd_abs_section rather than returning an error.
(elf_sizeof_headers): Make useful.
(elf_link_record_dynamic_symbol): New static function.
(elf_link_add_object_symbols): Handle dynamic objects.
(elf_link_create_dynamic_sections): New static function.
(elf_add_dynamic_entry): Define as macro using NAME and as new
externally visible function.
(NAME(bfd_elf,record_link_assignment)): New function.
(elf_buckets): New static variable.
(NAME(bfd_elf,size_dynamic_sections)): New function.
(struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
(elf_bfd_final_link): Handle dynamic linking. Create a section
symbol for all ELF sections, not all BFD sections. Store section
symbol index in target_index field, not index field. Traverse
over global symbols even if stripping.
(elf_link_output_extsym): Output dynamic symbols. Mark symbols
defined by dynamic objects as undefined.
(elf_link_input_bfd): Ignore dynamic objects. Use target_index
field for section relocs, and make sure it is set.
(elf_reloc_link_order): Use target_index field for section relocs,
and make sure it is set.
* elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
weakdef and elf_link_hash_flags fields.
(_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
dynstr and bucketcount fields.
* elf32-target.h: Initialize new dynamic linking fields.
* elf64-target.h: Likewise.
* elf32-i386.c: New functions for dynamic linking support.
* elf32-sparc.c: Likewise.
* bfd-in.h (bfd_elf32_record_link_assignment): Declare.
(bfd_elf64_record_link_assignment): Declare.
(bfd_elf32_size_dynamic_sections): Declare.
(bfd_elf64_size_dynamic_sections): Declare.
* bfd-in2.h: Rebuilt.
1994-05-19 18:23:40 +00:00
|
|
|
|
/* Externally visible ELF routines. */
|
|
|
|
|
|
1995-10-16 23:10:56 +00:00
|
|
|
|
struct bfd_link_needed_list
|
1995-07-04 16:54:49 +00:00
|
|
|
|
{
|
1995-10-16 23:10:56 +00:00
|
|
|
|
struct bfd_link_needed_list *next;
|
1995-07-04 16:54:49 +00:00
|
|
|
|
bfd *by;
|
|
|
|
|
const char *name;
|
|
|
|
|
};
|
1995-10-16 23:10:56 +00:00
|
|
|
|
|
|
|
|
|
extern boolean bfd_elf32_record_link_assignment
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
|
|
|
|
|
extern boolean bfd_elf64_record_link_assignment
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
|
|
|
|
|
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
|
1995-07-04 16:54:49 +00:00
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
1998-05-14 21:29:28 +00:00
|
|
|
|
extern boolean bfd_elf_get_bfd_needed_list
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_needed_list **));
|
Add support for ELF shared libraries. Loosely based on work by
Eric Youngdale <ericy@cais.com>.
* libelf.h (struct elf_backend_data): Add new fields for dynamic
linking: elf_backend_create_dynamic_sections,
elf_backend_adjust_dynamic_symbol,
elf_backend_size_dynamic_sections,
elf_backend_finish_dynamic_symbol,
elf_backend_finish_dynamic_sections.
(struct elf_link_hash_entry): Change type of align field to
bfd_size_type. Add fields dynindx, dynstr_index, weakdef,
elf_link_hash_flags.
(struct elf_link_hash_table): Add fields dynobj, dynsymcount,
dynstr, bucketcount.
(bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
(bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
(bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
(bfd_elf32_add_dynamic_entry): Declare.
(bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
(bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
(bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
(bfd_elf64_add_dynamic_entry): Declare.
* elfcode.h (Elf_External_Dyn): Define.
(elf_swap_reloc_in): Define as macro using NAME. Make externally
visible.
(elf_swap_reloc_out): Likewise.
(elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
(elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
and as new externally visible function.
(elf_fake_sections): Set section type of dynamic sections based on
section names.
(elf_write_phdrs): Remove.
(assign_file_position_for_section): Add new align argument.
Change all callers.
(get_program_header_size): New static function.
(struct seg_info): Remove.
(map_program_segments): Completely rewrite.
(assign_file_positions_except_relocs): Completely rewrite.
(assign_file_positions_for_relocs): Don't set a file position for
sections which already have one. Don't bother to align the file
position here.
(section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
section types.
(elf_section_from_bfd_section): Likewise.
(elf_slurp_symbol_table): If section_from_elf_index fails, just
use bfd_abs_section rather than returning an error.
(elf_sizeof_headers): Make useful.
(elf_link_record_dynamic_symbol): New static function.
(elf_link_add_object_symbols): Handle dynamic objects.
(elf_link_create_dynamic_sections): New static function.
(elf_add_dynamic_entry): Define as macro using NAME and as new
externally visible function.
(NAME(bfd_elf,record_link_assignment)): New function.
(elf_buckets): New static variable.
(NAME(bfd_elf,size_dynamic_sections)): New function.
(struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
(elf_bfd_final_link): Handle dynamic linking. Create a section
symbol for all ELF sections, not all BFD sections. Store section
symbol index in target_index field, not index field. Traverse
over global symbols even if stripping.
(elf_link_output_extsym): Output dynamic symbols. Mark symbols
defined by dynamic objects as undefined.
(elf_link_input_bfd): Ignore dynamic objects. Use target_index
field for section relocs, and make sure it is set.
(elf_reloc_link_order): Use target_index field for section relocs,
and make sure it is set.
* elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
weakdef and elf_link_hash_flags fields.
(_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
dynstr and bucketcount fields.
* elf32-target.h: Initialize new dynamic linking fields.
* elf64-target.h: Likewise.
* elf32-i386.c: New functions for dynamic linking support.
* elf32-sparc.c: Likewise.
* bfd-in.h (bfd_elf32_record_link_assignment): Declare.
(bfd_elf64_record_link_assignment): Declare.
(bfd_elf32_size_dynamic_sections): Declare.
(bfd_elf64_size_dynamic_sections): Declare.
* bfd-in2.h: Rebuilt.
1994-05-19 18:23:40 +00:00
|
|
|
|
extern boolean bfd_elf32_size_dynamic_sections
|
1996-12-31 19:46:37 +00:00
|
|
|
|
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
|
1997-02-28 02:07:54 +00:00
|
|
|
|
const char * const *, struct bfd_link_info *, struct sec **,
|
|
|
|
|
struct bfd_elf_version_tree *));
|
Add support for ELF shared libraries. Loosely based on work by
Eric Youngdale <ericy@cais.com>.
* libelf.h (struct elf_backend_data): Add new fields for dynamic
linking: elf_backend_create_dynamic_sections,
elf_backend_adjust_dynamic_symbol,
elf_backend_size_dynamic_sections,
elf_backend_finish_dynamic_symbol,
elf_backend_finish_dynamic_sections.
(struct elf_link_hash_entry): Change type of align field to
bfd_size_type. Add fields dynindx, dynstr_index, weakdef,
elf_link_hash_flags.
(struct elf_link_hash_table): Add fields dynobj, dynsymcount,
dynstr, bucketcount.
(bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
(bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
(bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
(bfd_elf32_add_dynamic_entry): Declare.
(bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
(bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
(bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
(bfd_elf64_add_dynamic_entry): Declare.
* elfcode.h (Elf_External_Dyn): Define.
(elf_swap_reloc_in): Define as macro using NAME. Make externally
visible.
(elf_swap_reloc_out): Likewise.
(elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
(elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
and as new externally visible function.
(elf_fake_sections): Set section type of dynamic sections based on
section names.
(elf_write_phdrs): Remove.
(assign_file_position_for_section): Add new align argument.
Change all callers.
(get_program_header_size): New static function.
(struct seg_info): Remove.
(map_program_segments): Completely rewrite.
(assign_file_positions_except_relocs): Completely rewrite.
(assign_file_positions_for_relocs): Don't set a file position for
sections which already have one. Don't bother to align the file
position here.
(section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
section types.
(elf_section_from_bfd_section): Likewise.
(elf_slurp_symbol_table): If section_from_elf_index fails, just
use bfd_abs_section rather than returning an error.
(elf_sizeof_headers): Make useful.
(elf_link_record_dynamic_symbol): New static function.
(elf_link_add_object_symbols): Handle dynamic objects.
(elf_link_create_dynamic_sections): New static function.
(elf_add_dynamic_entry): Define as macro using NAME and as new
externally visible function.
(NAME(bfd_elf,record_link_assignment)): New function.
(elf_buckets): New static variable.
(NAME(bfd_elf,size_dynamic_sections)): New function.
(struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
(elf_bfd_final_link): Handle dynamic linking. Create a section
symbol for all ELF sections, not all BFD sections. Store section
symbol index in target_index field, not index field. Traverse
over global symbols even if stripping.
(elf_link_output_extsym): Output dynamic symbols. Mark symbols
defined by dynamic objects as undefined.
(elf_link_input_bfd): Ignore dynamic objects. Use target_index
field for section relocs, and make sure it is set.
(elf_reloc_link_order): Use target_index field for section relocs,
and make sure it is set.
* elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
weakdef and elf_link_hash_flags fields.
(_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
dynstr and bucketcount fields.
* elf32-target.h: Initialize new dynamic linking fields.
* elf64-target.h: Likewise.
* elf32-i386.c: New functions for dynamic linking support.
* elf32-sparc.c: Likewise.
* bfd-in.h (bfd_elf32_record_link_assignment): Declare.
(bfd_elf64_record_link_assignment): Declare.
(bfd_elf32_size_dynamic_sections): Declare.
(bfd_elf64_size_dynamic_sections): Declare.
* bfd-in2.h: Rebuilt.
1994-05-19 18:23:40 +00:00
|
|
|
|
extern boolean bfd_elf64_size_dynamic_sections
|
1996-12-31 19:46:37 +00:00
|
|
|
|
PARAMS ((bfd *, const char *, const char *, boolean, const char *,
|
1997-02-28 02:07:54 +00:00
|
|
|
|
const char * const *, struct bfd_link_info *, struct sec **,
|
|
|
|
|
struct bfd_elf_version_tree *));
|
1994-06-16 00:01:32 +00:00
|
|
|
|
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
|
1996-02-21 00:29:38 +00:00
|
|
|
|
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
|
Add support for ELF shared libraries. Loosely based on work by
Eric Youngdale <ericy@cais.com>.
* libelf.h (struct elf_backend_data): Add new fields for dynamic
linking: elf_backend_create_dynamic_sections,
elf_backend_adjust_dynamic_symbol,
elf_backend_size_dynamic_sections,
elf_backend_finish_dynamic_symbol,
elf_backend_finish_dynamic_sections.
(struct elf_link_hash_entry): Change type of align field to
bfd_size_type. Add fields dynindx, dynstr_index, weakdef,
elf_link_hash_flags.
(struct elf_link_hash_table): Add fields dynobj, dynsymcount,
dynstr, bucketcount.
(bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
(bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
(bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
(bfd_elf32_add_dynamic_entry): Declare.
(bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
(bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
(bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
(bfd_elf64_add_dynamic_entry): Declare.
* elfcode.h (Elf_External_Dyn): Define.
(elf_swap_reloc_in): Define as macro using NAME. Make externally
visible.
(elf_swap_reloc_out): Likewise.
(elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
(elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
and as new externally visible function.
(elf_fake_sections): Set section type of dynamic sections based on
section names.
(elf_write_phdrs): Remove.
(assign_file_position_for_section): Add new align argument.
Change all callers.
(get_program_header_size): New static function.
(struct seg_info): Remove.
(map_program_segments): Completely rewrite.
(assign_file_positions_except_relocs): Completely rewrite.
(assign_file_positions_for_relocs): Don't set a file position for
sections which already have one. Don't bother to align the file
position here.
(section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
section types.
(elf_section_from_bfd_section): Likewise.
(elf_slurp_symbol_table): If section_from_elf_index fails, just
use bfd_abs_section rather than returning an error.
(elf_sizeof_headers): Make useful.
(elf_link_record_dynamic_symbol): New static function.
(elf_link_add_object_symbols): Handle dynamic objects.
(elf_link_create_dynamic_sections): New static function.
(elf_add_dynamic_entry): Define as macro using NAME and as new
externally visible function.
(NAME(bfd_elf,record_link_assignment)): New function.
(elf_buckets): New static variable.
(NAME(bfd_elf,size_dynamic_sections)): New function.
(struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
(elf_bfd_final_link): Handle dynamic linking. Create a section
symbol for all ELF sections, not all BFD sections. Store section
symbol index in target_index field, not index field. Traverse
over global symbols even if stripping.
(elf_link_output_extsym): Output dynamic symbols. Mark symbols
defined by dynamic objects as undefined.
(elf_link_input_bfd): Ignore dynamic objects. Use target_index
field for section relocs, and make sure it is set.
(elf_reloc_link_order): Use target_index field for section relocs,
and make sure it is set.
* elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
weakdef and elf_link_hash_flags fields.
(_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
dynstr and bucketcount fields.
* elf32-target.h: Initialize new dynamic linking fields.
* elf64-target.h: Likewise.
* elf32-i386.c: New functions for dynamic linking support.
* elf32-sparc.c: Likewise.
* bfd-in.h (bfd_elf32_record_link_assignment): Declare.
(bfd_elf64_record_link_assignment): Declare.
(bfd_elf32_size_dynamic_sections): Declare.
(bfd_elf64_size_dynamic_sections): Declare.
* bfd-in2.h: Rebuilt.
1994-05-19 18:23:40 +00:00
|
|
|
|
|
1994-06-15 05:46:46 +00:00
|
|
|
|
/* SunOS shared library support routines for the linker. */
|
|
|
|
|
|
1995-10-25 15:37:47 +00:00
|
|
|
|
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
1994-06-15 05:46:46 +00:00
|
|
|
|
extern boolean bfd_sunos_record_link_assignment
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, const char *));
|
|
|
|
|
extern boolean bfd_sunos_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **,
|
|
|
|
|
struct sec **));
|
|
|
|
|
|
1994-06-16 18:29:21 +00:00
|
|
|
|
/* Linux shared library support routines for the linker. */
|
|
|
|
|
|
1996-03-27 19:21:19 +00:00
|
|
|
|
extern boolean bfd_i386linux_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
extern boolean bfd_m68klinux_size_dynamic_sections
|
1994-06-16 18:29:21 +00:00
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
1997-06-04 00:07:07 +00:00
|
|
|
|
extern boolean bfd_sparclinux_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
1994-06-16 18:29:21 +00:00
|
|
|
|
|
1995-11-06 10:08:03 +00:00
|
|
|
|
/* mmap hacks */
|
|
|
|
|
|
|
|
|
|
struct _bfd_window_internal;
|
|
|
|
|
typedef struct _bfd_window_internal bfd_window_internal;
|
|
|
|
|
|
|
|
|
|
typedef struct _bfd_window {
|
|
|
|
|
/* What the user asked for. */
|
|
|
|
|
PTR data;
|
|
|
|
|
bfd_size_type size;
|
|
|
|
|
/* The actual window used by BFD. Small user-requested read-only
|
|
|
|
|
regions sharing a page may share a single window into the object
|
|
|
|
|
file. Read-write versions shouldn't until I've fixed things to
|
|
|
|
|
keep track of which portions have been claimed by the
|
|
|
|
|
application; don't want to give the same region back when the
|
|
|
|
|
application wants two writable copies! */
|
|
|
|
|
struct _bfd_window_internal *i;
|
|
|
|
|
} bfd_window;
|
|
|
|
|
|
1995-11-08 16:32:40 +00:00
|
|
|
|
extern void bfd_init_window PARAMS ((bfd_window *));
|
|
|
|
|
extern void bfd_free_window PARAMS ((bfd_window *));
|
|
|
|
|
extern boolean bfd_get_file_window
|
1995-11-08 21:24:33 +00:00
|
|
|
|
PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean));
|
1995-11-06 10:08:03 +00:00
|
|
|
|
|
1995-10-25 15:37:47 +00:00
|
|
|
|
/* XCOFF support routines for the linker. */
|
|
|
|
|
|
1995-10-27 22:20:19 +00:00
|
|
|
|
extern boolean bfd_xcoff_link_record_set
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
|
|
|
|
|
bfd_size_type));
|
1995-10-25 15:37:47 +00:00
|
|
|
|
extern boolean bfd_xcoff_import_symbol
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
|
|
|
|
|
bfd_vma, const char *, const char *, const char *));
|
|
|
|
|
extern boolean bfd_xcoff_export_symbol
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
|
|
|
|
|
boolean));
|
1995-10-27 22:20:19 +00:00
|
|
|
|
extern boolean bfd_xcoff_link_count_reloc
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, const char *));
|
|
|
|
|
extern boolean bfd_xcoff_record_link_assignment
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, const char *));
|
1995-10-25 15:37:47 +00:00
|
|
|
|
extern boolean bfd_xcoff_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
|
|
|
|
|
unsigned long, unsigned long, unsigned long, boolean,
|
1995-12-07 01:08:54 +00:00
|
|
|
|
int, boolean, boolean, struct sec **));
|
1995-10-25 15:37:47 +00:00
|
|
|
|
|
Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
Added support for Alpha OpenVMS:
* evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
* evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
* config.h-vms, makefile.vms: New files.
* config.bfd (alpha-*-*vms*): New target.
* configure.in (evax_alpha_vec): New target vector.
* configure: Rebuild.
* reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
(BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
* targets.c (bfd_target_evax_flavour): Define.
(evax_alpha_vec): Declare.
(bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
if BFD64 is defined.
* bfd-in2.h, libbfd.h: Rebuild.
* Makefile.in: Rebuild dependencies.
(BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
evax-emh.o, and evax-misc.o.
(BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
evax-etir.c, evax-emh.c, and evax-misc.c.
(HFILES): Add evax.h.
1996-06-18 19:07:51 +00:00
|
|
|
|
/* Externally visible COFF routines. */
|
|
|
|
|
|
|
|
|
|
#if defined(__STDC__) || defined(ALMOST_STDC)
|
|
|
|
|
struct internal_syment;
|
|
|
|
|
union internal_auxent;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_coff_get_syment
|
|
|
|
|
PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
|
1998-05-14 21:29:28 +00:00
|
|
|
|
|
Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
Added support for Alpha OpenVMS:
* evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
* evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
* config.h-vms, makefile.vms: New files.
* config.bfd (alpha-*-*vms*): New target.
* configure.in (evax_alpha_vec): New target vector.
* configure: Rebuild.
* reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
(BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
* targets.c (bfd_target_evax_flavour): Define.
(evax_alpha_vec): Declare.
(bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
if BFD64 is defined.
* bfd-in2.h, libbfd.h: Rebuild.
* Makefile.in: Rebuild dependencies.
(BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
evax-emh.o, and evax-misc.o.
(BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
evax-etir.c, evax-emh.c, and evax-misc.c.
(HFILES): Add evax.h.
1996-06-18 19:07:51 +00:00
|
|
|
|
extern boolean bfd_coff_get_auxent
|
|
|
|
|
PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
|
|
|
|
|
|
1998-05-14 21:29:28 +00:00
|
|
|
|
extern boolean bfd_coff_set_symbol_class
|
1998-07-22 20:58:50 +00:00
|
|
|
|
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
|
1998-05-14 21:29:28 +00:00
|
|
|
|
|
1998-04-22 16:54:08 +00:00
|
|
|
|
/* ARM Interworking support. Called from linker. */
|
|
|
|
|
extern boolean bfd_arm_allocate_interworking_sections
|
|
|
|
|
PARAMS ((struct bfd_link_info *));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_arm_process_before_allocation
|
1998-05-14 21:29:28 +00:00
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, int));
|
1998-04-22 16:54:08 +00:00
|
|
|
|
|
|
|
|
|
extern boolean bfd_arm_get_bfd_for_interworking
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
1998-10-27 21:20:35 +00:00
|
|
|
|
/* ELF ARM Interworking support. Called from linker. */
|
|
|
|
|
extern boolean bfd_elf32_arm_allocate_interworking_sections
|
|
|
|
|
PARAMS ((struct bfd_link_info *));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_elf32_arm_process_before_allocation
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_elf32_arm_get_bfd_for_interworking
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* And more from the source. */
|
|
|
|
|
void
|
|
|
|
|
bfd_init PARAMS ((void));
|
|
|
|
|
|
|
|
|
|
bfd *
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_openr PARAMS ((CONST char *filename, CONST char *target));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
bfd *
|
|
|
|
|
bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
|
|
|
|
|
|
1995-01-17 19:26:56 +00:00
|
|
|
|
bfd *
|
1997-06-04 00:07:07 +00:00
|
|
|
|
bfd_openstreamr PARAMS ((const char *, const char *, PTR));
|
1995-01-17 19:26:56 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd *
|
|
|
|
|
bfd_openw PARAMS ((CONST char *filename, CONST char *target));
|
|
|
|
|
|
|
|
|
|
boolean
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_close PARAMS ((bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
bfd_close_all_done PARAMS ((bfd *));
|
|
|
|
|
|
|
|
|
|
bfd *
|
1993-07-22 01:08:25 +00:00
|
|
|
|
bfd_create PARAMS ((CONST char *filename, bfd *templ));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-12-06 21:37:41 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_make_writable PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
bfd_make_readable PARAMS ((bfd *abfd));
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* Byte swapping macros for user section data. */
|
|
|
|
|
|
|
|
|
|
#define bfd_put_8(abfd, val, ptr) \
|
1993-11-08 23:22:49 +00:00
|
|
|
|
(*((unsigned char *)(ptr)) = (unsigned char)(val))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_put_signed_8 \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_put_8
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_get_8(abfd, ptr) \
|
|
|
|
|
(*(unsigned char *)(ptr))
|
|
|
|
|
#define bfd_get_signed_8(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_put_16(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
|
|
|
|
|
#define bfd_put_signed_16 \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_put_16
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_get_16(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx16, (ptr))
|
|
|
|
|
#define bfd_get_signed_16(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_put_32(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
|
|
|
|
|
#define bfd_put_signed_32 \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_put_32
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_get_32(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx32, (ptr))
|
|
|
|
|
#define bfd_get_signed_32(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_put_64(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
|
|
|
|
|
#define bfd_put_signed_64 \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_put_64
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_get_64(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx64, (ptr))
|
|
|
|
|
#define bfd_get_signed_64(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Byte swapping macros for file header data. */
|
|
|
|
|
|
|
|
|
|
#define bfd_h_put_8(abfd, val, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_put_8 (abfd, val, ptr)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_h_put_signed_8(abfd, val, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_put_8 (abfd, val, ptr)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_h_get_8(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_get_8 (abfd, ptr)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_h_get_signed_8(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_get_signed_8 (abfd, ptr)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_h_put_16(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
|
|
|
|
|
#define bfd_h_put_signed_16 \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_h_put_16
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_h_get_16(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_h_getx16,(ptr))
|
|
|
|
|
#define bfd_h_get_signed_16(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_h_put_32(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
|
|
|
|
|
#define bfd_h_put_signed_32 \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_h_put_32
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_h_get_32(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_h_getx32,(ptr))
|
|
|
|
|
#define bfd_h_get_signed_32(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_h_put_64(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
|
|
|
|
|
#define bfd_h_put_signed_64 \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd_h_put_64
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_h_get_64(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_h_getx64,(ptr))
|
|
|
|
|
#define bfd_h_get_signed_64(abfd, ptr) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
typedef struct sec
|
1993-06-16 02:25:53 +00:00
|
|
|
|
{
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The name of the section; the name isn't a copy, the pointer is
|
1993-06-16 02:25:53 +00:00
|
|
|
|
the same as that passed to bfd_make_section. */
|
|
|
|
|
|
|
|
|
|
CONST char *name;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* Which section is it; 0..nth. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
int index;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* The next section in the list belonging to the BFD, or NULL. */
|
|
|
|
|
|
|
|
|
|
struct sec *next;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The field flags contains attributes of the section. Some
|
1993-06-16 02:25:53 +00:00
|
|
|
|
flags are read in from the object file, and some are
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
synthesized from other information. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
flagword flags;
|
|
|
|
|
|
|
|
|
|
#define SEC_NO_FLAGS 0x000
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* Tells the OS to allocate space for this section when loading.
|
|
|
|
|
This is clear for a section containing debug information
|
1993-06-16 02:25:53 +00:00
|
|
|
|
only. */
|
|
|
|
|
#define SEC_ALLOC 0x001
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* Tells the OS to load the section from the file when loading.
|
1993-11-05 19:51:52 +00:00
|
|
|
|
This is clear for a .bss section. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define SEC_LOAD 0x002
|
1993-08-09 19:25:56 +00:00
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The section contains data still to be relocated, so there is
|
|
|
|
|
some relocation information too. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define SEC_RELOC 0x004
|
|
|
|
|
|
1993-08-28 00:35:56 +00:00
|
|
|
|
#if 0 /* Obsolete ? */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define SEC_BALIGN 0x008
|
1993-08-28 00:35:56 +00:00
|
|
|
|
#endif
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* A signal to the OS that the section contains read only
|
|
|
|
|
data. */
|
|
|
|
|
#define SEC_READONLY 0x010
|
|
|
|
|
|
|
|
|
|
/* The section contains code only. */
|
|
|
|
|
#define SEC_CODE 0x020
|
|
|
|
|
|
|
|
|
|
/* The section contains data only. */
|
1993-08-28 00:35:56 +00:00
|
|
|
|
#define SEC_DATA 0x040
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* The section will reside in ROM. */
|
|
|
|
|
#define SEC_ROM 0x080
|
|
|
|
|
|
|
|
|
|
/* The section contains constructor information. This section
|
|
|
|
|
type is used by the linker to create lists of constructors and
|
|
|
|
|
destructors used by <<g++>>. When a back end sees a symbol
|
|
|
|
|
which should be used in a constructor list, it creates a new
|
1993-11-05 19:51:52 +00:00
|
|
|
|
section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
|
|
|
|
|
the symbol to it, and builds a relocation. To build the lists
|
1993-09-03 20:09:31 +00:00
|
|
|
|
of constructors, all the linker has to do is catenate all the
|
1993-11-05 19:51:52 +00:00
|
|
|
|
sections called <<__CTOR_LIST__>> and relocate the data
|
1993-06-16 02:25:53 +00:00
|
|
|
|
contained within - exactly the operations it would peform on
|
|
|
|
|
standard data. */
|
|
|
|
|
#define SEC_CONSTRUCTOR 0x100
|
|
|
|
|
|
1998-06-26 16:59:08 +00:00
|
|
|
|
/* The section is a constructor, and should be placed at the
|
1993-08-28 00:35:56 +00:00
|
|
|
|
end of the text, data, or bss section(?). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define SEC_CONSTRUCTOR_TEXT 0x1100
|
|
|
|
|
#define SEC_CONSTRUCTOR_DATA 0x2100
|
|
|
|
|
#define SEC_CONSTRUCTOR_BSS 0x3100
|
|
|
|
|
|
|
|
|
|
/* The section has contents - a data section could be
|
1993-11-05 19:51:52 +00:00
|
|
|
|
<<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
|
1993-06-16 02:25:53 +00:00
|
|
|
|
<<SEC_HAS_CONTENTS>> */
|
|
|
|
|
#define SEC_HAS_CONTENTS 0x200
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* An instruction to the linker to not output the section
|
1994-05-10 18:29:19 +00:00
|
|
|
|
even if it has information which would normally be written. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define SEC_NEVER_LOAD 0x400
|
|
|
|
|
|
1994-05-10 18:29:19 +00:00
|
|
|
|
/* The section is a COFF shared library section. This flag is
|
|
|
|
|
only for the linker. If this type of section appears in
|
|
|
|
|
the input file, the linker must copy it to the output file
|
|
|
|
|
without changing the vma or size. FIXME: Although this
|
|
|
|
|
was originally intended to be general, it really is COFF
|
|
|
|
|
specific (and the flag was renamed to indicate this). It
|
|
|
|
|
might be cleaner to have some more general mechanism to
|
|
|
|
|
allow the back end to control what the linker does with
|
|
|
|
|
sections. */
|
|
|
|
|
#define SEC_COFF_SHARED_LIBRARY 0x800
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1996-03-29 21:33:59 +00:00
|
|
|
|
/* The section contains common symbols (symbols may be defined
|
1993-06-16 02:25:53 +00:00
|
|
|
|
multiple times, the value of a symbol is the amount of
|
|
|
|
|
space it requires, and the largest symbol value is the one
|
1993-08-28 00:35:56 +00:00
|
|
|
|
used). Most targets have exactly one of these (which we
|
1998-01-26 20:43:50 +00:00
|
|
|
|
translate to bfd_com_section_ptr), but ECOFF has two. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define SEC_IS_COMMON 0x8000
|
|
|
|
|
|
1993-09-28 20:44:43 +00:00
|
|
|
|
/* The section contains only debugging information. For
|
|
|
|
|
example, this is set for ELF .debug and .stab sections.
|
|
|
|
|
strip tests this flag to see if a section can be
|
|
|
|
|
discarded. */
|
|
|
|
|
#define SEC_DEBUGGING 0x10000
|
|
|
|
|
|
1994-02-27 23:45:18 +00:00
|
|
|
|
/* The contents of this section are held in memory pointed to
|
|
|
|
|
by the contents field. This is checked by
|
|
|
|
|
bfd_get_section_contents, and the data is retrieved from
|
|
|
|
|
memory if appropriate. */
|
|
|
|
|
#define SEC_IN_MEMORY 0x20000
|
|
|
|
|
|
1996-01-11 22:47:04 +00:00
|
|
|
|
/* The contents of this section are to be excluded by the
|
1998-01-26 20:43:50 +00:00
|
|
|
|
linker for executable and shared objects unless those
|
|
|
|
|
objects are to be further relocated. */
|
1996-01-11 22:47:04 +00:00
|
|
|
|
#define SEC_EXCLUDE 0x40000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The contents of this section are to be sorted by the
|
|
|
|
|
based on the address specified in the associated symbol
|
|
|
|
|
table. */
|
1996-01-11 22:47:04 +00:00
|
|
|
|
#define SEC_SORT_ENTRIES 0x80000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* When linking, duplicate sections of the same name should be
|
|
|
|
|
discarded, rather than being combined into a single section as
|
|
|
|
|
is usually done. This is similar to how common symbols are
|
|
|
|
|
handled. See SEC_LINK_DUPLICATES below. */
|
1996-03-29 21:33:59 +00:00
|
|
|
|
#define SEC_LINK_ONCE 0x100000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* If SEC_LINK_ONCE is set, this bitfield describes how the linker
|
|
|
|
|
should handle duplicate sections. */
|
1996-03-29 21:33:59 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES 0x600000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* This value for SEC_LINK_DUPLICATES means that duplicate
|
|
|
|
|
sections with the same name should simply be discarded. */
|
1996-03-29 21:33:59 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_DISCARD 0x0
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* This value for SEC_LINK_DUPLICATES means that the linker
|
|
|
|
|
should warn if there are any duplicate sections, although
|
|
|
|
|
it should still only link one copy. */
|
1996-03-29 21:33:59 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* This value for SEC_LINK_DUPLICATES means that the linker
|
|
|
|
|
should warn if any duplicate sections are a different size. */
|
1996-03-29 21:33:59 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* This value for SEC_LINK_DUPLICATES means that the linker
|
|
|
|
|
should warn if any duplicate sections contain different
|
|
|
|
|
contents. */
|
1996-03-29 21:33:59 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* This section was created by the linker as part of dynamic
|
|
|
|
|
relocation or other arcane processing. It is skipped when
|
|
|
|
|
going through the first-pass output, trusting that someone
|
|
|
|
|
else up the line will take care of it later. */
|
Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>
elf64-alpha multiple .got rewrite:
* elf-bfd.h (struct elf_backend_data): Add always_size_sections entry.
(bfd_elf*_mkobject): Don't define here ...
* elfxx-target.h: ... but rather here. Default always_size_sections
hook to NULL.
* elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was
what the #defines in elf-bfd.h transmuted it to anyway.
* section.c: Add SEC_LINKER_CREATED flag.
* bfd-in2.h: Rebuild.
* elf32-i386.c (elf_i386_check_relocs): Add SEC_LINKER_CREATED to
relocation section flags.
(elf_i386_size_dynamic_sections): Use SEC_LINKER_CREATED instead of
SEC_IN_MEMORY to recognize generated bits.
* elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_size_dynamic_sections):
Likewise.
* elf32-mips.c (mips_elf_final_link, mips_elf_create_dynamic_sections,
mips_elf_create_compact_rel_section, mips_elf_create_got_section,
mips_elf_check_relocs, mips_elf_size_dynamic_sections): Likewise.
* elf32-ppc.c (ppc_elf_create_linker_section,
ppc_elf_size_dynamic_sections): Likewise.
* elf32-sparc.c (elf32_sparc_check_relocs,
elf32_sparc_size_dynamic_sections): Likewise.
* elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to
section flags.
(_bfd_elf_create_dynamic_sections): Likewise.
(_bfd_elf_make_linker_section_rela): Likewise.
* elflink.h (elf_link_create_dynamic_sections): Likewise.
(bfd_elf,size_dynamic_sections): Call the always_size_sections hook.
(elf_bfd_final_link): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY
to identify generated bits.
(elf_link_input_bfd): Likewise.
* elf64-alpha.c: Rewrite everything touching relocations.
1997-01-03 22:09:40 +00:00
|
|
|
|
#define SEC_LINKER_CREATED 0x800000
|
|
|
|
|
|
1998-06-30 10:02:22 +00:00
|
|
|
|
/* This section should not be subject to garbage collection. */
|
|
|
|
|
#define SEC_KEEP 0x1000000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* End of section flags. */
|
1993-08-28 00:35:56 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Some internal packed boolean fields. */
|
1996-03-27 22:23:18 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* See the vma field. */
|
|
|
|
|
unsigned int user_set_vma : 1;
|
1996-03-27 22:23:18 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Whether relocations have been processed. */
|
|
|
|
|
unsigned int reloc_done : 1;
|
1996-03-27 22:23:18 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* A mark flag used by some of the linker backends. */
|
|
|
|
|
unsigned int linker_mark : 1;
|
1996-03-27 22:23:18 +00:00
|
|
|
|
|
1998-06-30 10:02:22 +00:00
|
|
|
|
/* A mark flag used by some linker backends for garbage collection. */
|
|
|
|
|
unsigned int gc_mark : 1;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* End of internal packed boolean fields. */
|
1996-03-27 22:23:18 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* The virtual memory address of the section - where it will be
|
1993-08-28 00:35:56 +00:00
|
|
|
|
at run time. The symbols are relocated against this. The
|
1998-01-26 20:43:50 +00:00
|
|
|
|
user_set_vma flag is maintained by bfd; if it's not set, the
|
|
|
|
|
backend can assign addresses (for example, in <<a.out>>, where
|
|
|
|
|
the default address for <<.data>> is dependent on the specific
|
|
|
|
|
target and various flags). */
|
1993-08-09 19:25:56 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_vma vma;
|
|
|
|
|
|
|
|
|
|
/* The load address of the section - where it would be in a
|
1993-11-05 19:51:52 +00:00
|
|
|
|
rom image; really only used for writing section header
|
1998-01-26 20:43:50 +00:00
|
|
|
|
information. */
|
1993-08-09 19:25:56 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_vma lma;
|
|
|
|
|
|
|
|
|
|
/* The size of the section in bytes, as it will be output.
|
1993-11-05 19:51:52 +00:00
|
|
|
|
contains a value even if the section has no contents (e.g., the
|
1993-06-16 02:25:53 +00:00
|
|
|
|
size of <<.bss>>). This will be filled in after relocation */
|
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
bfd_size_type _cooked_size;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The original size on disk of the section, in bytes. Normally this
|
1998-01-26 20:43:50 +00:00
|
|
|
|
value is the same as the size, but if some relaxing has
|
|
|
|
|
been done, then this value will be bigger. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
bfd_size_type _raw_size;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* If this section is going to be output, then this value is the
|
|
|
|
|
offset into the output section of the first byte in the input
|
1993-11-05 19:51:52 +00:00
|
|
|
|
section. E.g., if this was going to start at the 100th byte in
|
1993-06-16 02:25:53 +00:00
|
|
|
|
the output section, this value would be 100. */
|
|
|
|
|
|
|
|
|
|
bfd_vma output_offset;
|
|
|
|
|
|
|
|
|
|
/* The output section through which to map on output. */
|
|
|
|
|
|
|
|
|
|
struct sec *output_section;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The alignment requirement of the section, as an exponent of 2 -
|
|
|
|
|
e.g., 3 aligns to 2^3 (or 8). */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
unsigned int alignment_power;
|
|
|
|
|
|
|
|
|
|
/* If an input section, a pointer to a vector of relocation
|
|
|
|
|
records for the data in this section. */
|
|
|
|
|
|
|
|
|
|
struct reloc_cache_entry *relocation;
|
|
|
|
|
|
|
|
|
|
/* If an output section, a pointer to a vector of pointers to
|
|
|
|
|
relocation records for the data in this section. */
|
|
|
|
|
|
|
|
|
|
struct reloc_cache_entry **orelocation;
|
|
|
|
|
|
|
|
|
|
/* The number of relocation records in one of the above */
|
|
|
|
|
|
|
|
|
|
unsigned reloc_count;
|
|
|
|
|
|
|
|
|
|
/* Information below is back end specific - and not always used
|
1993-08-09 19:25:56 +00:00
|
|
|
|
or updated. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1993-08-09 19:25:56 +00:00
|
|
|
|
/* File position of section data */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
file_ptr filepos;
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* File position of relocation info */
|
|
|
|
|
|
|
|
|
|
file_ptr rel_filepos;
|
|
|
|
|
|
|
|
|
|
/* File position of line data */
|
|
|
|
|
|
|
|
|
|
file_ptr line_filepos;
|
|
|
|
|
|
|
|
|
|
/* Pointer to data for applications */
|
|
|
|
|
|
|
|
|
|
PTR userdata;
|
|
|
|
|
|
1994-02-27 23:45:18 +00:00
|
|
|
|
/* If the SEC_IN_MEMORY flag is set, this points to the actual
|
|
|
|
|
contents. */
|
|
|
|
|
unsigned char *contents;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* Attached line number information */
|
|
|
|
|
|
|
|
|
|
alent *lineno;
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* Number of line number records */
|
|
|
|
|
|
|
|
|
|
unsigned int lineno_count;
|
|
|
|
|
|
|
|
|
|
/* When a section is being output, this value changes as more
|
|
|
|
|
linenumbers are written out */
|
|
|
|
|
|
|
|
|
|
file_ptr moving_line_filepos;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* What the section number is in the target world */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
int target_index;
|
|
|
|
|
|
|
|
|
|
PTR used_by_bfd;
|
|
|
|
|
|
|
|
|
|
/* If this is a constructor section then here is a list of the
|
|
|
|
|
relocations created to relocate items within it. */
|
|
|
|
|
|
|
|
|
|
struct relent_chain *constructor_chain;
|
|
|
|
|
|
|
|
|
|
/* The BFD which owns the section. */
|
|
|
|
|
|
|
|
|
|
bfd *owner;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* A symbol which points at this section only */
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
struct symbol_cache_entry *symbol;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct symbol_cache_entry **symbol_ptr_ptr;
|
1993-08-09 19:25:56 +00:00
|
|
|
|
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
struct bfd_link_order *link_order_head;
|
|
|
|
|
struct bfd_link_order *link_order_tail;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
} asection ;
|
|
|
|
|
|
1993-08-28 00:35:56 +00:00
|
|
|
|
/* These sections are global, and are managed by BFD. The application
|
|
|
|
|
and target back end are not permitted to change the values in
|
1998-01-26 20:43:50 +00:00
|
|
|
|
these sections. New code should use the section_ptr macros rather
|
1994-07-14 21:35:54 +00:00
|
|
|
|
than referring directly to the const sections. The const sections
|
|
|
|
|
may eventually vanish. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BFD_ABS_SECTION_NAME "*ABS*"
|
|
|
|
|
#define BFD_UND_SECTION_NAME "*UND*"
|
|
|
|
|
#define BFD_COM_SECTION_NAME "*COM*"
|
|
|
|
|
#define BFD_IND_SECTION_NAME "*IND*"
|
|
|
|
|
|
|
|
|
|
/* the absolute section */
|
1994-07-14 21:35:54 +00:00
|
|
|
|
extern const asection bfd_abs_section;
|
|
|
|
|
#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
|
|
|
|
|
#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* Pointer to the undefined section */
|
1994-07-14 21:35:54 +00:00
|
|
|
|
extern const asection bfd_und_section;
|
|
|
|
|
#define bfd_und_section_ptr ((asection *) &bfd_und_section)
|
|
|
|
|
#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* Pointer to the common section */
|
1994-07-14 21:35:54 +00:00
|
|
|
|
extern const asection bfd_com_section;
|
|
|
|
|
#define bfd_com_section_ptr ((asection *) &bfd_com_section)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* Pointer to the indirect section */
|
1994-07-14 21:35:54 +00:00
|
|
|
|
extern const asection bfd_ind_section;
|
|
|
|
|
#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
|
|
|
|
|
#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
|
|
|
|
|
|
|
|
|
|
extern const struct symbol_cache_entry * const bfd_abs_symbol;
|
|
|
|
|
extern const struct symbol_cache_entry * const bfd_com_symbol;
|
|
|
|
|
extern const struct symbol_cache_entry * const bfd_und_symbol;
|
|
|
|
|
extern const struct symbol_cache_entry * const bfd_ind_symbol;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_get_section_size_before_reloc(section) \
|
|
|
|
|
(section->reloc_done ? (abort(),1): (section)->_raw_size)
|
|
|
|
|
#define bfd_get_section_size_after_reloc(section) \
|
|
|
|
|
((section->reloc_done) ? (section)->_cooked_size: (abort(),1))
|
|
|
|
|
asection *
|
|
|
|
|
bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name));
|
|
|
|
|
|
|
|
|
|
asection *
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_make_section_old_way PARAMS ((bfd *abfd, CONST char *name));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1993-09-28 20:44:43 +00:00
|
|
|
|
asection *
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_make_section_anyway PARAMS ((bfd *abfd, CONST char *name));
|
1993-09-28 20:44:43 +00:00
|
|
|
|
|
|
|
|
|
asection *
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_make_section PARAMS ((bfd *, CONST char *name));
|
|
|
|
|
|
|
|
|
|
boolean
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_map_over_sections PARAMS ((bfd *abfd,
|
|
|
|
|
void (*func)(bfd *abfd,
|
|
|
|
|
asection *sect,
|
|
|
|
|
PTR obj),
|
|
|
|
|
PTR obj));
|
|
|
|
|
|
|
|
|
|
boolean
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
bfd_set_section_contents
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
PARAMS ((bfd *abfd,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
asection *section,
|
|
|
|
|
PTR data,
|
|
|
|
|
file_ptr offset,
|
|
|
|
|
bfd_size_type count));
|
|
|
|
|
|
|
|
|
|
boolean
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
bfd_get_section_contents
|
1993-06-16 02:25:53 +00:00
|
|
|
|
PARAMS ((bfd *abfd, asection *section, PTR location,
|
|
|
|
|
file_ptr offset, bfd_size_type count));
|
|
|
|
|
|
1994-03-17 23:47:00 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec));
|
|
|
|
|
|
|
|
|
|
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
|
1996-10-03 03:56:20 +00:00
|
|
|
|
BFD_SEND (obfd, _bfd_copy_private_section_data, \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
(ibfd, isection, obfd, osection))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
enum bfd_architecture
|
|
|
|
|
{
|
|
|
|
|
bfd_arch_unknown, /* File arch not known */
|
|
|
|
|
bfd_arch_obscure, /* Arch known, not one of these */
|
|
|
|
|
bfd_arch_m68k, /* Motorola 68xxx */
|
1998-04-22 16:54:08 +00:00
|
|
|
|
#define bfd_mach_m68000 1
|
|
|
|
|
#define bfd_mach_m68008 2
|
|
|
|
|
#define bfd_mach_m68010 3
|
|
|
|
|
#define bfd_mach_m68020 4
|
|
|
|
|
#define bfd_mach_m68030 5
|
|
|
|
|
#define bfd_mach_m68040 6
|
|
|
|
|
#define bfd_mach_m68060 7
|
1998-06-26 16:59:08 +00:00
|
|
|
|
#define bfd_mach_cpu32 8
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_vax, /* DEC Vax */
|
|
|
|
|
bfd_arch_i960, /* Intel 960 */
|
|
|
|
|
/* The order of the following is important.
|
|
|
|
|
lower number indicates a machine type that
|
|
|
|
|
only accepts a subset of the instructions
|
|
|
|
|
available to machines with higher numbers.
|
|
|
|
|
The exception is the "ca", which is
|
|
|
|
|
incompatible with all other machines except
|
|
|
|
|
"core". */
|
|
|
|
|
|
|
|
|
|
#define bfd_mach_i960_core 1
|
|
|
|
|
#define bfd_mach_i960_ka_sa 2
|
|
|
|
|
#define bfd_mach_i960_kb_sb 3
|
|
|
|
|
#define bfd_mach_i960_mc 4
|
|
|
|
|
#define bfd_mach_i960_xa 5
|
|
|
|
|
#define bfd_mach_i960_ca 6
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_i960_jx 7
|
1996-02-05 23:57:39 +00:00
|
|
|
|
#define bfd_mach_i960_hx 8
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
bfd_arch_a29k, /* AMD 29000 */
|
|
|
|
|
bfd_arch_sparc, /* SPARC */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_sparc 1
|
1996-02-05 23:57:39 +00:00
|
|
|
|
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_sparc_sparclet 2
|
|
|
|
|
#define bfd_mach_sparc_sparclite 3
|
|
|
|
|
#define bfd_mach_sparc_v8plus 4
|
|
|
|
|
#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
|
1998-05-27 15:41:27 +00:00
|
|
|
|
#define bfd_mach_sparc_sparclite_le 6
|
|
|
|
|
#define bfd_mach_sparc_v9 7
|
|
|
|
|
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */
|
1996-01-23 00:44:17 +00:00
|
|
|
|
/* Nonzero if MACH has the v9 instruction set. */
|
1996-04-02 21:28:33 +00:00
|
|
|
|
#define bfd_mach_sparc_v9_p(mach) \
|
|
|
|
|
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
|
1998-01-28 18:42:55 +00:00
|
|
|
|
bfd_arch_mips, /* MIPS Rxxxx */
|
1998-01-28 04:45:04 +00:00
|
|
|
|
/* start-sanitize-tx19 */
|
|
|
|
|
#define bfd_mach_mips1900 1900
|
|
|
|
|
/* end-sanitize-tx19 */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_mips3000 3000
|
1998-01-28 04:45:04 +00:00
|
|
|
|
#define bfd_mach_mips3900 3900
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_mips4000 4000
|
1998-01-28 04:45:04 +00:00
|
|
|
|
#define bfd_mach_mips4010 4010
|
|
|
|
|
#define bfd_mach_mips4100 4100
|
|
|
|
|
#define bfd_mach_mips4300 4300
|
|
|
|
|
#define bfd_mach_mips4400 4400
|
|
|
|
|
#define bfd_mach_mips4600 4600
|
|
|
|
|
#define bfd_mach_mips4650 4650
|
1998-03-03 16:31:21 +00:00
|
|
|
|
/* start-sanitize-vr4320 */
|
|
|
|
|
#define bfd_mach_mips4320 4320
|
1998-03-04 21:14:50 +00:00
|
|
|
|
/* end-sanitize-vr4320 */
|
1998-01-28 04:45:04 +00:00
|
|
|
|
/* start-sanitize-tx49 */
|
|
|
|
|
#define bfd_mach_mips4900 4900
|
|
|
|
|
/* end-sanitize-tx49 */
|
|
|
|
|
#define bfd_mach_mips5000 5000
|
1998-10-27 21:20:35 +00:00
|
|
|
|
/* start-sanitize-cygnus */
|
1998-01-28 04:45:04 +00:00
|
|
|
|
#define bfd_mach_mips5400 5400
|
1998-08-12 02:18:03 +00:00
|
|
|
|
/* end-sanitize-cygnus */
|
1998-01-28 04:45:04 +00:00
|
|
|
|
/* start-sanitize-r5900 */
|
|
|
|
|
#define bfd_mach_mips5900 5900
|
|
|
|
|
/* end-sanitize-r5900 */
|
|
|
|
|
#define bfd_mach_mips6000 6000
|
|
|
|
|
#define bfd_mach_mips8000 8000
|
|
|
|
|
#define bfd_mach_mips10000 10000
|
|
|
|
|
#define bfd_mach_mips16 16
|
1998-01-28 18:42:55 +00:00
|
|
|
|
/* start-sanitize-sky */
|
|
|
|
|
/* The DVP is a machine within the mips architecture. */
|
|
|
|
|
#define bfd_mach_dvp_dma 42000
|
1998-03-03 16:31:21 +00:00
|
|
|
|
#define bfd_mach_dvp_vif 42001
|
1998-01-28 18:42:55 +00:00
|
|
|
|
#define bfd_mach_dvp_vu 42002
|
1998-03-03 16:31:21 +00:00
|
|
|
|
#define bfd_mach_dvp_gif 42003
|
1998-01-28 18:42:55 +00:00
|
|
|
|
#define bfd_mach_dvp_p(mach) ((mach) >= 42000 && (mach) <= 42003)
|
|
|
|
|
/* end-sanitize-sky */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_i386, /* Intel 386 */
|
1996-07-15 23:41:21 +00:00
|
|
|
|
#define bfd_mach_i386_i386 0
|
|
|
|
|
#define bfd_mach_i386_i8086 1
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_we32k, /* AT&T WE32xxx */
|
|
|
|
|
bfd_arch_tahoe, /* CCI/Harris Tahoe */
|
|
|
|
|
bfd_arch_i860, /* Intel 860 */
|
|
|
|
|
bfd_arch_romp, /* IBM ROMP PC/RT */
|
|
|
|
|
bfd_arch_alliant, /* Alliant */
|
|
|
|
|
bfd_arch_convex, /* Convex */
|
|
|
|
|
bfd_arch_m88k, /* Motorola 88xxx */
|
|
|
|
|
bfd_arch_pyramid, /* Pyramid Technology */
|
|
|
|
|
bfd_arch_h8300, /* Hitachi H8/300 */
|
|
|
|
|
#define bfd_mach_h8300 1
|
|
|
|
|
#define bfd_mach_h8300h 2
|
1996-07-05 18:30:03 +00:00
|
|
|
|
#define bfd_mach_h8300s 3
|
* bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
(bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
all values.
* bfd-in2.h: Regenerated.
* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
aoutf1.h, aoutx.h, archive.c, archures.c,
bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
srec.c, sunos.c, syms.c, targets.c, tekhex.c,
trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
|
|
|
|
bfd_arch_powerpc, /* PowerPC */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_rs6000, /* IBM RS/6000 */
|
|
|
|
|
bfd_arch_hppa, /* HP PA RISC */
|
1996-07-18 00:47:05 +00:00
|
|
|
|
bfd_arch_d10v, /* Mitsubishi D10V */
|
Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
reloc.c, targets.c: New target, elf-*-D30V.
* bfd-in2.h, configure, libbfd.h: Rebuilt.
* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
|
|
|
|
bfd_arch_d30v, /* Mitsubishi D30V */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_z8k, /* Zilog Z8000 */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_z8001 1
|
|
|
|
|
#define bfd_mach_z8002 2
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_h8500, /* Hitachi H8/500 */
|
|
|
|
|
bfd_arch_sh, /* Hitachi SH */
|
1997-08-28 10:01:33 +00:00
|
|
|
|
#define bfd_mach_sh 0
|
|
|
|
|
#define bfd_mach_sh3 0x30
|
|
|
|
|
#define bfd_mach_sh3e 0x3e
|
|
|
|
|
#define bfd_mach_sh4 0x40
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_alpha, /* Dec Alpha */
|
1998-10-27 21:20:35 +00:00
|
|
|
|
#define bfd_mach_alpha_ev4 0x10
|
|
|
|
|
#define bfd_mach_alpha_ev5 0x20
|
|
|
|
|
#define bfd_mach_alpha_ev6 0x30
|
1994-09-26 15:01:59 +00:00
|
|
|
|
bfd_arch_arm, /* Advanced Risc Machines ARM */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_arm_2 1
|
|
|
|
|
#define bfd_mach_arm_2a 2
|
|
|
|
|
#define bfd_mach_arm_3 3
|
|
|
|
|
#define bfd_mach_arm_3M 4
|
|
|
|
|
#define bfd_mach_arm_4 5
|
|
|
|
|
#define bfd_mach_arm_4T 6
|
1994-07-14 21:35:54 +00:00
|
|
|
|
bfd_arch_ns32k, /* National Semiconductors ns32000 */
|
1995-01-16 05:44:00 +00:00
|
|
|
|
bfd_arch_w65, /* WDC 65816 */
|
1998-03-03 16:31:21 +00:00
|
|
|
|
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
|
1996-12-30 23:25:26 +00:00
|
|
|
|
/* start-sanitize-tic80 */
|
|
|
|
|
bfd_arch_tic80, /* TI TMS320c80 (MVP) */
|
|
|
|
|
/* end-sanitize-tic80 */
|
1996-08-30 22:09:51 +00:00
|
|
|
|
bfd_arch_v850, /* NEC V850 */
|
1997-08-28 10:01:33 +00:00
|
|
|
|
#define bfd_mach_v850 0
|
1997-08-25 23:00:29 +00:00
|
|
|
|
/* start-sanitize-v850e */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_v850e 'E'
|
|
|
|
|
#define bfd_mach_v850ea 'A'
|
1997-09-30 21:33:19 +00:00
|
|
|
|
/* end-sanitize-v850e */
|
1994-11-30 01:29:26 +00:00
|
|
|
|
bfd_arch_arc, /* Argonaut RISC Core */
|
1995-02-10 01:41:57 +00:00
|
|
|
|
#define bfd_mach_arc_base 0
|
1997-12-22 10:23:57 +00:00
|
|
|
|
bfd_arch_m32r, /* Mitsubishi M32R/D */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_m32r 0 /* backwards compatibility */
|
1997-12-22 10:23:57 +00:00
|
|
|
|
/* start-sanitize-m32rx */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define bfd_mach_m32rx 'x'
|
1997-12-22 10:23:57 +00:00
|
|
|
|
/* end-sanitize-m32rx */
|
1996-10-03 16:42:22 +00:00
|
|
|
|
bfd_arch_mn10200, /* Matsushita MN10200 */
|
|
|
|
|
bfd_arch_mn10300, /* Matsushita MN10300 */
|
1998-06-26 16:59:08 +00:00
|
|
|
|
#define bfd_mach_mn10300 300
|
|
|
|
|
/* start-sanitize-am33 */
|
|
|
|
|
#define bfd_mach_am33 330
|
|
|
|
|
/* end-sanitize-am33 */
|
1998-11-05 00:05:50 +00:00
|
|
|
|
bfd_arch_fr30,
|
|
|
|
|
#define bfd_mach_fr30 0x46523330
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_last
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct bfd_arch_info
|
|
|
|
|
{
|
|
|
|
|
int bits_per_word;
|
|
|
|
|
int bits_per_address;
|
|
|
|
|
int bits_per_byte;
|
|
|
|
|
enum bfd_architecture arch;
|
1995-09-12 16:23:25 +00:00
|
|
|
|
unsigned long mach;
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const char *arch_name;
|
|
|
|
|
const char *printable_name;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
unsigned int section_align_power;
|
|
|
|
|
/* true if this is the default machine for the architecture */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
boolean the_default;
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const struct bfd_arch_info * (*compatible)
|
1998-01-26 20:43:50 +00:00
|
|
|
|
PARAMS ((const struct bfd_arch_info *a,
|
|
|
|
|
const struct bfd_arch_info *b));
|
1995-09-22 22:06:51 +00:00
|
|
|
|
|
|
|
|
|
boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
|
|
|
|
|
|
|
|
|
|
const struct bfd_arch_info *next;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
} bfd_arch_info_type;
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const char *
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_printable_name PARAMS ((bfd *abfd));
|
|
|
|
|
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const bfd_arch_info_type *
|
|
|
|
|
bfd_scan_arch PARAMS ((const char *string));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1997-09-10 05:55:15 +00:00
|
|
|
|
const char **
|
|
|
|
|
bfd_arch_list PARAMS ((void));
|
|
|
|
|
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const bfd_arch_info_type *
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_arch_get_compatible PARAMS ((
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const bfd *abfd,
|
|
|
|
|
const bfd *bbfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
void
|
1995-09-22 22:06:51 +00:00
|
|
|
|
bfd_set_arch_info PARAMS ((bfd *abfd, const bfd_arch_info_type *arg));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
enum bfd_architecture
|
|
|
|
|
bfd_get_arch PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
unsigned long
|
|
|
|
|
bfd_get_mach PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
|
bfd_arch_bits_per_byte PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
|
bfd_arch_bits_per_address PARAMS ((bfd *abfd));
|
|
|
|
|
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const bfd_arch_info_type *
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_get_arch_info PARAMS ((bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const bfd_arch_info_type *
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_lookup_arch
|
|
|
|
|
PARAMS ((enum bfd_architecture
|
|
|
|
|
arch,
|
1995-09-12 16:23:25 +00:00
|
|
|
|
unsigned long machine));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const char *
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_printable_arch_mach
|
|
|
|
|
PARAMS ((enum bfd_architecture arch, unsigned long machine));
|
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
typedef enum bfd_reloc_status
|
1993-06-16 02:25:53 +00:00
|
|
|
|
{
|
|
|
|
|
/* No errors detected */
|
|
|
|
|
bfd_reloc_ok,
|
|
|
|
|
|
|
|
|
|
/* The relocation was performed, but there was an overflow. */
|
|
|
|
|
bfd_reloc_overflow,
|
|
|
|
|
|
|
|
|
|
/* The address to relocate was not within the section supplied. */
|
|
|
|
|
bfd_reloc_outofrange,
|
|
|
|
|
|
|
|
|
|
/* Used by special functions */
|
|
|
|
|
bfd_reloc_continue,
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* Unsupported relocation size requested. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_reloc_notsupported,
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* Unused */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_reloc_other,
|
|
|
|
|
|
|
|
|
|
/* The symbol to relocate against was undefined. */
|
|
|
|
|
bfd_reloc_undefined,
|
|
|
|
|
|
|
|
|
|
/* The relocation was performed, but may not be ok - presently
|
|
|
|
|
generated only when linking i960 coff files with i960 b.out
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
symbols. If this type is returned, the error_message argument
|
|
|
|
|
to bfd_perform_relocation will be set. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_reloc_dangerous
|
|
|
|
|
}
|
|
|
|
|
bfd_reloc_status_type;
|
|
|
|
|
|
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
typedef struct reloc_cache_entry
|
1993-06-16 02:25:53 +00:00
|
|
|
|
{
|
|
|
|
|
/* A pointer into the canonical table of pointers */
|
|
|
|
|
struct symbol_cache_entry **sym_ptr_ptr;
|
|
|
|
|
|
|
|
|
|
/* offset in section */
|
|
|
|
|
bfd_size_type address;
|
|
|
|
|
|
|
|
|
|
/* addend for relocation value */
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
bfd_vma addend;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* Pointer to how to perform the required relocation */
|
1995-02-06 08:31:27 +00:00
|
|
|
|
reloc_howto_type *howto;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
} arelent;
|
1993-07-22 18:03:51 +00:00
|
|
|
|
enum complain_overflow
|
|
|
|
|
{
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Do not complain on overflow. */
|
1993-07-22 18:03:51 +00:00
|
|
|
|
complain_overflow_dont,
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Complain if the bitfield overflows, whether it is considered
|
|
|
|
|
as signed or unsigned. */
|
1993-07-22 18:03:51 +00:00
|
|
|
|
complain_overflow_bitfield,
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Complain if the value overflows when considered as signed
|
|
|
|
|
number. */
|
1993-07-22 18:03:51 +00:00
|
|
|
|
complain_overflow_signed,
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Complain if the value overflows when considered as an
|
|
|
|
|
unsigned number. */
|
1993-07-22 18:03:51 +00:00
|
|
|
|
complain_overflow_unsigned
|
|
|
|
|
};
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-07-14 21:35:54 +00:00
|
|
|
|
struct reloc_howto_struct
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
{
|
1997-02-18 23:01:02 +00:00
|
|
|
|
/* The type field has mainly a documentary use - the back end can
|
1993-11-05 19:51:52 +00:00
|
|
|
|
do what it wants with it, though normally the back end's
|
|
|
|
|
external idea of what a reloc number is stored
|
|
|
|
|
in this field. For example, a PC relative word relocation
|
|
|
|
|
in a coff environment has the type 023 - because that's
|
1993-06-16 02:25:53 +00:00
|
|
|
|
what the outside world calls a R_PCRWORD reloc. */
|
|
|
|
|
unsigned int type;
|
|
|
|
|
|
|
|
|
|
/* The value the final relocation is shifted right by. This drops
|
|
|
|
|
unwanted data from the relocation. */
|
|
|
|
|
unsigned int rightshift;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The size of the item to be relocated. This is *not* a
|
|
|
|
|
power-of-two measure. To get the number of bytes operated
|
|
|
|
|
on by a type of relocation, use bfd_get_reloc_size. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
int size;
|
|
|
|
|
|
1993-07-22 18:03:51 +00:00
|
|
|
|
/* The number of bits in the item to be relocated. This is used
|
1998-01-26 20:43:50 +00:00
|
|
|
|
when doing overflow checking. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
unsigned int bitsize;
|
|
|
|
|
|
|
|
|
|
/* Notes that the relocation is relative to the location in the
|
|
|
|
|
data section of the addend. The relocation function will
|
|
|
|
|
subtract from the relocation value the address of the location
|
|
|
|
|
being relocated. */
|
|
|
|
|
boolean pc_relative;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The bit position of the reloc value in the destination.
|
|
|
|
|
The relocated value is left shifted by this amount. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
unsigned int bitpos;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* What type of overflow error should be checked for when
|
|
|
|
|
relocating. */
|
1993-07-22 18:03:51 +00:00
|
|
|
|
enum complain_overflow complain_on_overflow;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* If this field is non null, then the supplied function is
|
|
|
|
|
called rather than the normal function. This allows really
|
|
|
|
|
strange relocation methods to be accomodated (e.g., i960 callj
|
|
|
|
|
instructions). */
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
bfd_reloc_status_type (*special_function)
|
1998-01-26 20:43:50 +00:00
|
|
|
|
PARAMS ((bfd *abfd,
|
|
|
|
|
arelent *reloc_entry,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct symbol_cache_entry *symbol,
|
|
|
|
|
PTR data,
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
asection *input_section,
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
bfd *output_bfd,
|
|
|
|
|
char **error_message));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* The textual name of the relocation type. */
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
/* When performing a partial link, some formats must modify the
|
|
|
|
|
relocations rather than the data - this flag signals this.*/
|
|
|
|
|
boolean partial_inplace;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The src_mask selects which parts of the read in data
|
1993-06-16 02:25:53 +00:00
|
|
|
|
are to be used in the relocation sum. E.g., if this was an 8 bit
|
|
|
|
|
bit of data which we read and relocated, this would be
|
|
|
|
|
0x000000ff. When we have relocs which have an addend, such as
|
|
|
|
|
sun4 extended relocs, the value in the offset part of a
|
|
|
|
|
relocating field is garbage so we never use it. In this case
|
|
|
|
|
the mask would be 0x00000000. */
|
|
|
|
|
bfd_vma src_mask;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The dst_mask selects which parts of the instruction are replaced
|
1993-06-16 02:25:53 +00:00
|
|
|
|
into the instruction. In most cases src_mask == dst_mask,
|
|
|
|
|
except in the above special case, where dst_mask would be
|
|
|
|
|
0x000000ff, and src_mask would be 0x00000000. */
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
bfd_vma dst_mask;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* When some formats create PC relative instructions, they leave
|
|
|
|
|
the value of the pc of the place being relocated in the offset
|
|
|
|
|
slot of the instruction, so that a PC relative relocation can
|
|
|
|
|
be made just by adding in an ordinary offset (e.g., sun3 a.out).
|
|
|
|
|
Some formats leave the displacement part of an instruction
|
1993-11-05 19:51:52 +00:00
|
|
|
|
empty (e.g., m88k bcs); this flag signals the fact.*/
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean pcrel_offset;
|
|
|
|
|
|
1994-07-14 21:35:54 +00:00
|
|
|
|
};
|
1993-07-22 18:03:51 +00:00
|
|
|
|
#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
1994-07-27 00:21:43 +00:00
|
|
|
|
{(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
|
1993-07-22 18:03:51 +00:00
|
|
|
|
#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define HOWTO_PREPARE(relocation, symbol) \
|
|
|
|
|
{ \
|
|
|
|
|
if (symbol != (asymbol *)NULL) { \
|
|
|
|
|
if (bfd_is_com_section (symbol->section)) { \
|
|
|
|
|
relocation = 0; \
|
|
|
|
|
} \
|
|
|
|
|
else { \
|
|
|
|
|
relocation = symbol->value; \
|
|
|
|
|
} \
|
|
|
|
|
} \
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
}
|
1998-04-22 16:54:08 +00:00
|
|
|
|
unsigned int
|
1995-01-12 02:41:04 +00:00
|
|
|
|
bfd_get_reloc_size PARAMS ((reloc_howto_type *));
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
typedef struct relent_chain {
|
|
|
|
|
arelent relent;
|
|
|
|
|
struct relent_chain *next;
|
|
|
|
|
} arelent_chain;
|
|
|
|
|
bfd_reloc_status_type
|
|
|
|
|
|
1997-10-02 23:55:22 +00:00
|
|
|
|
bfd_check_overflow
|
|
|
|
|
PARAMS ((enum complain_overflow how,
|
|
|
|
|
unsigned int bitsize,
|
|
|
|
|
unsigned int rightshift,
|
1997-12-12 19:05:07 +00:00
|
|
|
|
bfd_vma relocation));
|
1997-10-02 23:55:22 +00:00
|
|
|
|
|
|
|
|
|
bfd_reloc_status_type
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_perform_relocation
|
1993-11-05 19:51:52 +00:00
|
|
|
|
PARAMS ((bfd *abfd,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
arelent *reloc_entry,
|
|
|
|
|
PTR data,
|
|
|
|
|
asection *input_section,
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
bfd *output_bfd,
|
|
|
|
|
char **error_message));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-11-17 22:46:22 +00:00
|
|
|
|
bfd_reloc_status_type
|
|
|
|
|
|
|
|
|
|
bfd_install_relocation
|
|
|
|
|
PARAMS ((bfd *abfd,
|
|
|
|
|
arelent *reloc_entry,
|
|
|
|
|
PTR data, bfd_vma data_start,
|
|
|
|
|
asection *input_section,
|
|
|
|
|
char **error_message));
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
enum bfd_reloc_code_real {
|
|
|
|
|
_dummy_first_bfd_reloc_code_real,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Basic absolute relocations of N bits. */
|
1993-07-06 20:46:32 +00:00
|
|
|
|
BFD_RELOC_64,
|
|
|
|
|
BFD_RELOC_32,
|
1994-03-31 19:08:22 +00:00
|
|
|
|
BFD_RELOC_26,
|
1997-01-16 22:48:57 +00:00
|
|
|
|
BFD_RELOC_24,
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
BFD_RELOC_16,
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_14,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_8,
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* PC-relative relocations. Sometimes these are relative to the address
|
|
|
|
|
of the relocation itself; sometimes they are relative to the start of
|
|
|
|
|
the section containing the relocation. It depends on the specific target.
|
|
|
|
|
|
|
|
|
|
The 24-bit relocation is used in some Intel 960 configurations. */
|
1993-10-31 18:59:59 +00:00
|
|
|
|
BFD_RELOC_64_PCREL,
|
|
|
|
|
BFD_RELOC_32_PCREL,
|
1994-09-02 18:21:41 +00:00
|
|
|
|
BFD_RELOC_24_PCREL,
|
1993-10-31 18:59:59 +00:00
|
|
|
|
BFD_RELOC_16_PCREL,
|
1994-11-17 22:46:22 +00:00
|
|
|
|
BFD_RELOC_12_PCREL,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_8_PCREL,
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
1995-06-09 19:16:33 +00:00
|
|
|
|
/* For ELF. */
|
|
|
|
|
BFD_RELOC_32_GOT_PCREL,
|
|
|
|
|
BFD_RELOC_16_GOT_PCREL,
|
|
|
|
|
BFD_RELOC_8_GOT_PCREL,
|
|
|
|
|
BFD_RELOC_32_GOTOFF,
|
|
|
|
|
BFD_RELOC_16_GOTOFF,
|
1995-09-22 20:30:18 +00:00
|
|
|
|
BFD_RELOC_LO16_GOTOFF,
|
|
|
|
|
BFD_RELOC_HI16_GOTOFF,
|
|
|
|
|
BFD_RELOC_HI16_S_GOTOFF,
|
1995-06-09 19:16:33 +00:00
|
|
|
|
BFD_RELOC_8_GOTOFF,
|
|
|
|
|
BFD_RELOC_32_PLT_PCREL,
|
1995-09-22 20:30:18 +00:00
|
|
|
|
BFD_RELOC_24_PLT_PCREL,
|
1995-06-09 19:16:33 +00:00
|
|
|
|
BFD_RELOC_16_PLT_PCREL,
|
|
|
|
|
BFD_RELOC_8_PLT_PCREL,
|
|
|
|
|
BFD_RELOC_32_PLTOFF,
|
|
|
|
|
BFD_RELOC_16_PLTOFF,
|
1995-09-22 20:30:18 +00:00
|
|
|
|
BFD_RELOC_LO16_PLTOFF,
|
|
|
|
|
BFD_RELOC_HI16_PLTOFF,
|
|
|
|
|
BFD_RELOC_HI16_S_PLTOFF,
|
1995-06-09 19:16:33 +00:00
|
|
|
|
BFD_RELOC_8_PLTOFF,
|
|
|
|
|
|
|
|
|
|
/* Relocations used by 68K ELF. */
|
|
|
|
|
BFD_RELOC_68K_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_68K_JMP_SLOT,
|
|
|
|
|
BFD_RELOC_68K_RELATIVE,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* Linkage-table relative. */
|
1993-10-31 18:59:59 +00:00
|
|
|
|
BFD_RELOC_32_BASEREL,
|
|
|
|
|
BFD_RELOC_16_BASEREL,
|
1995-09-22 20:30:18 +00:00
|
|
|
|
BFD_RELOC_LO16_BASEREL,
|
|
|
|
|
BFD_RELOC_HI16_BASEREL,
|
|
|
|
|
BFD_RELOC_HI16_S_BASEREL,
|
1993-10-31 18:59:59 +00:00
|
|
|
|
BFD_RELOC_8_BASEREL,
|
1995-08-31 16:23:02 +00:00
|
|
|
|
BFD_RELOC_RVA,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
|
1993-10-31 18:59:59 +00:00
|
|
|
|
BFD_RELOC_8_FFnn,
|
|
|
|
|
|
1994-11-17 22:46:22 +00:00
|
|
|
|
/* These PC-relative relocations are stored as word displacements --
|
|
|
|
|
i.e., byte displacements shifted right two bits. The 30-bit word
|
|
|
|
|
displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
|
|
|
|
|
SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The
|
|
|
|
|
signed 16-bit displacement is used on the MIPS, and the 23-bit
|
|
|
|
|
displacement is used on the Alpha. */
|
1993-10-31 18:59:59 +00:00
|
|
|
|
BFD_RELOC_32_PCREL_S2,
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_16_PCREL_S2,
|
|
|
|
|
BFD_RELOC_23_PCREL_S2,
|
1993-10-31 18:59:59 +00:00
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
|
|
|
|
|
the target word. These are used on the SPARC. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_HI22,
|
|
|
|
|
BFD_RELOC_LO10,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* For systems that allocate a Global Pointer register, these are
|
|
|
|
|
displacements off that register. These relocation types are
|
|
|
|
|
handled specially, because the value the register will have is
|
|
|
|
|
decided relatively late. */
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_GPREL16,
|
|
|
|
|
BFD_RELOC_GPREL32,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* Reloc types used for i960/b.out. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_I960_CALLJ,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* SPARC ELF relocations. There is probably some overlap with other
|
|
|
|
|
relocation types already defined. */
|
|
|
|
|
BFD_RELOC_NONE,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_SPARC_WDISP22,
|
|
|
|
|
BFD_RELOC_SPARC22,
|
|
|
|
|
BFD_RELOC_SPARC13,
|
|
|
|
|
BFD_RELOC_SPARC_GOT10,
|
|
|
|
|
BFD_RELOC_SPARC_GOT13,
|
|
|
|
|
BFD_RELOC_SPARC_GOT22,
|
|
|
|
|
BFD_RELOC_SPARC_PC10,
|
|
|
|
|
BFD_RELOC_SPARC_PC22,
|
|
|
|
|
BFD_RELOC_SPARC_WPLT30,
|
|
|
|
|
BFD_RELOC_SPARC_COPY,
|
|
|
|
|
BFD_RELOC_SPARC_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_SPARC_JMP_SLOT,
|
|
|
|
|
BFD_RELOC_SPARC_RELATIVE,
|
|
|
|
|
BFD_RELOC_SPARC_UA32,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* I think these are specific to SPARC a.out (e.g., Sun 4). */
|
1993-07-12 14:48:13 +00:00
|
|
|
|
BFD_RELOC_SPARC_BASE13,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_SPARC_BASE22,
|
|
|
|
|
|
1997-10-02 23:55:22 +00:00
|
|
|
|
/* SPARC64 relocations */
|
1994-09-02 18:21:41 +00:00
|
|
|
|
#define BFD_RELOC_SPARC_64 BFD_RELOC_64
|
1993-07-06 20:46:32 +00:00
|
|
|
|
BFD_RELOC_SPARC_10,
|
|
|
|
|
BFD_RELOC_SPARC_11,
|
|
|
|
|
BFD_RELOC_SPARC_OLO10,
|
|
|
|
|
BFD_RELOC_SPARC_HH22,
|
|
|
|
|
BFD_RELOC_SPARC_HM10,
|
|
|
|
|
BFD_RELOC_SPARC_LM22,
|
|
|
|
|
BFD_RELOC_SPARC_PC_HH22,
|
|
|
|
|
BFD_RELOC_SPARC_PC_HM10,
|
|
|
|
|
BFD_RELOC_SPARC_PC_LM22,
|
|
|
|
|
BFD_RELOC_SPARC_WDISP16,
|
1993-07-12 14:48:13 +00:00
|
|
|
|
BFD_RELOC_SPARC_WDISP19,
|
1996-02-13 22:08:52 +00:00
|
|
|
|
BFD_RELOC_SPARC_7,
|
|
|
|
|
BFD_RELOC_SPARC_6,
|
|
|
|
|
BFD_RELOC_SPARC_5,
|
1997-10-02 23:55:22 +00:00
|
|
|
|
#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
|
|
|
|
|
BFD_RELOC_SPARC_PLT64,
|
|
|
|
|
BFD_RELOC_SPARC_HIX22,
|
|
|
|
|
BFD_RELOC_SPARC_LOX10,
|
|
|
|
|
BFD_RELOC_SPARC_H44,
|
|
|
|
|
BFD_RELOC_SPARC_M44,
|
|
|
|
|
BFD_RELOC_SPARC_L44,
|
|
|
|
|
BFD_RELOC_SPARC_REGISTER,
|
1993-07-12 14:48:13 +00:00
|
|
|
|
|
1998-05-27 15:41:27 +00:00
|
|
|
|
/* SPARC little endian relocation */
|
1998-08-12 02:18:03 +00:00
|
|
|
|
BFD_RELOC_SPARC_REV32,
|
1998-05-27 15:41:27 +00:00
|
|
|
|
|
1996-07-05 18:30:03 +00:00
|
|
|
|
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
|
|
|
|
|
"addend" in some special way.
|
1994-09-02 18:21:41 +00:00
|
|
|
|
For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
|
|
|
|
|
writing; when reading, it will be the absolute section symbol. The
|
|
|
|
|
addend is the displacement in bytes of the "lda" instruction from
|
|
|
|
|
the "ldah" instruction (which is at the address of this reloc). */
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_ALPHA_GPDISP_HI16,
|
1994-09-02 18:21:41 +00:00
|
|
|
|
|
|
|
|
|
/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
|
|
|
|
|
with GPDISP_HI16 relocs. The addend is ignored when writing the
|
|
|
|
|
relocations out, and is filled in with the file's GP value on
|
|
|
|
|
reading, for convenience. */
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_ALPHA_GPDISP_LO16,
|
|
|
|
|
|
1996-07-05 18:30:03 +00:00
|
|
|
|
/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
|
|
|
|
|
relocation except that there is no accompanying GPDISP_LO16
|
|
|
|
|
relocation. */
|
|
|
|
|
BFD_RELOC_ALPHA_GPDISP,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
|
|
|
|
|
the assembler turns it into a LDQ instruction to load the address of
|
|
|
|
|
the symbol, and then fills in a register in the real instruction.
|
|
|
|
|
|
|
|
|
|
The LITERAL reloc, at the LDQ instruction, refers to the .lita
|
|
|
|
|
section symbol. The addend is ignored when writing, but is filled
|
|
|
|
|
in with the file's GP value on reading, for convenience, as with the
|
|
|
|
|
GPDISP_LO16 reloc.
|
|
|
|
|
|
1996-10-14 15:21:54 +00:00
|
|
|
|
The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
|
|
|
|
|
It should refer to the symbol to be referenced, as with 16_GOTOFF,
|
|
|
|
|
but it generates output not based on the position within the .got
|
|
|
|
|
section, but relative to the GP value chosen for the file during the
|
|
|
|
|
final link stage.
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
The LITUSE reloc, on the instruction using the loaded address, gives
|
|
|
|
|
information to the linker that it might be able to use to optimize
|
|
|
|
|
away some literal section references. The symbol is ignored (read
|
|
|
|
|
as the absolute section symbol), and the "addend" indicates the type
|
|
|
|
|
of instruction using the register:
|
|
|
|
|
1 - "memory" fmt insn
|
|
|
|
|
2 - byte-manipulation (byte offset reg)
|
|
|
|
|
3 - jsr (target of branch)
|
|
|
|
|
|
|
|
|
|
The GNU linker currently doesn't do any of this optimizing. */
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_ALPHA_LITERAL,
|
1996-10-14 15:21:54 +00:00
|
|
|
|
BFD_RELOC_ALPHA_ELF_LITERAL,
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_ALPHA_LITUSE,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* The HINT relocation indicates a value that should be filled into the
|
|
|
|
|
"hint" field of a jmp/jsr/ret instruction, for possible branch-
|
|
|
|
|
prediction logic which may be provided on some processors. */
|
1994-01-20 00:07:58 +00:00
|
|
|
|
BFD_RELOC_ALPHA_HINT,
|
|
|
|
|
|
1996-08-08 16:27:21 +00:00
|
|
|
|
/* The LINKAGE relocation outputs a linkage pair in the object file,
|
|
|
|
|
which is filled by the linker. */
|
Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
Added support for Alpha OpenVMS:
* evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
* evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
* config.h-vms, makefile.vms: New files.
* config.bfd (alpha-*-*vms*): New target.
* configure.in (evax_alpha_vec): New target vector.
* configure: Rebuild.
* reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
(BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
* targets.c (bfd_target_evax_flavour): Define.
(evax_alpha_vec): Declare.
(bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
if BFD64 is defined.
* bfd-in2.h, libbfd.h: Rebuild.
* Makefile.in: Rebuild dependencies.
(BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
evax-emh.o, and evax-misc.o.
(BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
evax-etir.c, evax-emh.c, and evax-misc.c.
(HFILES): Add evax.h.
1996-06-18 19:07:51 +00:00
|
|
|
|
BFD_RELOC_ALPHA_LINKAGE,
|
|
|
|
|
|
1997-02-18 23:01:02 +00:00
|
|
|
|
/* The CODEADDR relocation outputs a STO_CA in the object file,
|
|
|
|
|
which is filled by the linker. */
|
|
|
|
|
BFD_RELOC_ALPHA_CODEADDR,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* Bits 27..2 of the relocation address shifted right 2 bits;
|
|
|
|
|
simple reloc otherwise. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_MIPS_JMP,
|
|
|
|
|
|
1996-12-28 04:09:34 +00:00
|
|
|
|
/* The MIPS16 jump instruction. */
|
|
|
|
|
BFD_RELOC_MIPS16_JMP,
|
|
|
|
|
|
1997-02-11 20:30:12 +00:00
|
|
|
|
/* MIPS16 GP relative reloc. */
|
|
|
|
|
BFD_RELOC_MIPS16_GPREL,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* High 16 bits of 32-bit value; simple reloc. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_HI16,
|
1994-09-02 18:21:41 +00:00
|
|
|
|
|
|
|
|
|
/* High 16 bits of 32-bit value but the low 16 bits will be sign
|
|
|
|
|
extended and added to form the final result. If the low 16
|
|
|
|
|
bits form a negative number, we need to add one to the high value
|
|
|
|
|
to compensate for the borrow when the low bits are added. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_HI16_S,
|
1994-09-02 18:21:41 +00:00
|
|
|
|
|
|
|
|
|
/* Low 16 bits. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
BFD_RELOC_LO16,
|
1994-09-02 18:21:41 +00:00
|
|
|
|
|
|
|
|
|
/* Like BFD_RELOC_HI16_S, but PC relative. */
|
1994-04-14 17:08:31 +00:00
|
|
|
|
BFD_RELOC_PCREL_HI16_S,
|
1994-09-02 18:21:41 +00:00
|
|
|
|
|
|
|
|
|
/* Like BFD_RELOC_LO16, but PC relative. */
|
1994-04-14 17:08:31 +00:00
|
|
|
|
BFD_RELOC_PCREL_LO16,
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* Relocation relative to the global pointer. */
|
1994-01-20 00:07:58 +00:00
|
|
|
|
#define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* Relocation against a MIPS literal section. */
|
1993-11-05 08:34:09 +00:00
|
|
|
|
BFD_RELOC_MIPS_LITERAL,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* MIPS ELF relocations. */
|
1993-11-05 08:34:09 +00:00
|
|
|
|
BFD_RELOC_MIPS_GOT16,
|
|
|
|
|
BFD_RELOC_MIPS_CALL16,
|
1994-01-20 00:07:58 +00:00
|
|
|
|
#define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL32
|
1996-02-13 22:08:52 +00:00
|
|
|
|
BFD_RELOC_MIPS_GOT_HI16,
|
|
|
|
|
BFD_RELOC_MIPS_GOT_LO16,
|
1996-02-14 01:36:01 +00:00
|
|
|
|
BFD_RELOC_MIPS_CALL_HI16,
|
|
|
|
|
BFD_RELOC_MIPS_CALL_LO16,
|
1998-04-22 16:54:08 +00:00
|
|
|
|
/* start-sanitize-r5900 */
|
|
|
|
|
BFD_RELOC_MIPS15_S3,
|
|
|
|
|
/* end-sanitize-r5900 */
|
1998-01-28 18:42:55 +00:00
|
|
|
|
/* start-sanitize-sky */
|
|
|
|
|
|
|
|
|
|
/* MIPS DVP Relocations.
|
|
|
|
|
This is an 11-bit pc relative reloc. The recorded address is for the
|
|
|
|
|
lower instruction word, and the value is in 128 bit units. */
|
|
|
|
|
BFD_RELOC_MIPS_DVP_11_PCREL,
|
1998-03-03 16:31:21 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 27 bit address left shifted by 4. */
|
|
|
|
|
BFD_RELOC_MIPS_DVP_27_S4,
|
1998-07-01 20:14:12 +00:00
|
|
|
|
|
|
|
|
|
/* This is the 11 bit offset operand of ilw/stw instructions
|
|
|
|
|
left shifted by 4. */
|
|
|
|
|
BFD_RELOC_MIPS_DVP_11_S4,
|
|
|
|
|
|
|
|
|
|
/* This is the 15 bit unsigned immediate operand of the iaddiu instruction
|
|
|
|
|
left shifted by 3. */
|
|
|
|
|
BFD_RELOC_MIPS_DVP_U15_S3,
|
1998-01-28 18:42:55 +00:00
|
|
|
|
/* end-sanitize-sky */
|
|
|
|
|
|
1993-11-05 08:34:09 +00:00
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* i386/elf relocations */
|
1993-08-05 18:36:19 +00:00
|
|
|
|
BFD_RELOC_386_GOT32,
|
|
|
|
|
BFD_RELOC_386_PLT32,
|
|
|
|
|
BFD_RELOC_386_COPY,
|
|
|
|
|
BFD_RELOC_386_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_386_JUMP_SLOT,
|
|
|
|
|
BFD_RELOC_386_RELATIVE,
|
|
|
|
|
BFD_RELOC_386_GOTOFF,
|
|
|
|
|
BFD_RELOC_386_GOTPC,
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* ns32k relocations */
|
1994-07-14 21:35:54 +00:00
|
|
|
|
BFD_RELOC_NS32K_IMM_8,
|
|
|
|
|
BFD_RELOC_NS32K_IMM_16,
|
|
|
|
|
BFD_RELOC_NS32K_IMM_32,
|
|
|
|
|
BFD_RELOC_NS32K_IMM_8_PCREL,
|
|
|
|
|
BFD_RELOC_NS32K_IMM_16_PCREL,
|
|
|
|
|
BFD_RELOC_NS32K_IMM_32_PCREL,
|
|
|
|
|
BFD_RELOC_NS32K_DISP_8,
|
|
|
|
|
BFD_RELOC_NS32K_DISP_16,
|
|
|
|
|
BFD_RELOC_NS32K_DISP_32,
|
|
|
|
|
BFD_RELOC_NS32K_DISP_8_PCREL,
|
|
|
|
|
BFD_RELOC_NS32K_DISP_16_PCREL,
|
|
|
|
|
BFD_RELOC_NS32K_DISP_32_PCREL,
|
|
|
|
|
|
1995-09-22 20:30:18 +00:00
|
|
|
|
/* Power(rs6000) and PowerPC relocations. */
|
* bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
(bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
all values.
* bfd-in2.h: Regenerated.
* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
aoutf1.h, aoutx.h, archive.c, archures.c,
bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
srec.c, sunos.c, syms.c, targets.c, tekhex.c,
trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
|
|
|
|
BFD_RELOC_PPC_B26,
|
|
|
|
|
BFD_RELOC_PPC_BA26,
|
|
|
|
|
BFD_RELOC_PPC_TOC16,
|
1995-09-22 20:30:18 +00:00
|
|
|
|
BFD_RELOC_PPC_B16,
|
|
|
|
|
BFD_RELOC_PPC_B16_BRTAKEN,
|
|
|
|
|
BFD_RELOC_PPC_B16_BRNTAKEN,
|
|
|
|
|
BFD_RELOC_PPC_BA16,
|
|
|
|
|
BFD_RELOC_PPC_BA16_BRTAKEN,
|
|
|
|
|
BFD_RELOC_PPC_BA16_BRNTAKEN,
|
|
|
|
|
BFD_RELOC_PPC_COPY,
|
|
|
|
|
BFD_RELOC_PPC_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_PPC_JMP_SLOT,
|
|
|
|
|
BFD_RELOC_PPC_RELATIVE,
|
|
|
|
|
BFD_RELOC_PPC_LOCAL24PC,
|
1996-01-15 22:50:07 +00:00
|
|
|
|
BFD_RELOC_PPC_EMB_NADDR32,
|
|
|
|
|
BFD_RELOC_PPC_EMB_NADDR16,
|
|
|
|
|
BFD_RELOC_PPC_EMB_NADDR16_LO,
|
|
|
|
|
BFD_RELOC_PPC_EMB_NADDR16_HI,
|
|
|
|
|
BFD_RELOC_PPC_EMB_NADDR16_HA,
|
|
|
|
|
BFD_RELOC_PPC_EMB_SDAI16,
|
|
|
|
|
BFD_RELOC_PPC_EMB_SDA2I16,
|
|
|
|
|
BFD_RELOC_PPC_EMB_SDA2REL,
|
|
|
|
|
BFD_RELOC_PPC_EMB_SDA21,
|
|
|
|
|
BFD_RELOC_PPC_EMB_MRKREF,
|
|
|
|
|
BFD_RELOC_PPC_EMB_RELSEC16,
|
|
|
|
|
BFD_RELOC_PPC_EMB_RELST_LO,
|
|
|
|
|
BFD_RELOC_PPC_EMB_RELST_HI,
|
|
|
|
|
BFD_RELOC_PPC_EMB_RELST_HA,
|
|
|
|
|
BFD_RELOC_PPC_EMB_BIT_FLD,
|
|
|
|
|
BFD_RELOC_PPC_EMB_RELSDA,
|
* bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
(bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
all values.
* bfd-in2.h: Regenerated.
* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
aoutf1.h, aoutx.h, archive.c, archures.c,
bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
srec.c, sunos.c, syms.c, targets.c, tekhex.c,
trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
/* The type of reloc used to build a contructor table - at the moment
|
|
|
|
|
probably a 32 bit wide absolute relocation, but the target can choose.
|
|
|
|
|
It generally does map to one of the other relocation types. */
|
|
|
|
|
BFD_RELOC_CTOR,
|
1994-09-26 15:01:59 +00:00
|
|
|
|
|
|
|
|
|
/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
|
|
|
|
|
not stored in the instruction. */
|
|
|
|
|
BFD_RELOC_ARM_PCREL_BRANCH,
|
|
|
|
|
|
|
|
|
|
/* These relocs are only used within the ARM assembler. They are not
|
|
|
|
|
(at present) written to any object files. */
|
|
|
|
|
BFD_RELOC_ARM_IMMEDIATE,
|
|
|
|
|
BFD_RELOC_ARM_OFFSET_IMM,
|
|
|
|
|
BFD_RELOC_ARM_SHIFT_IMM,
|
|
|
|
|
BFD_RELOC_ARM_SWI,
|
|
|
|
|
BFD_RELOC_ARM_MULTI,
|
|
|
|
|
BFD_RELOC_ARM_CP_OFF_IMM,
|
1995-06-09 19:16:33 +00:00
|
|
|
|
BFD_RELOC_ARM_ADR_IMM,
|
|
|
|
|
BFD_RELOC_ARM_LDR_IMM,
|
|
|
|
|
BFD_RELOC_ARM_LITERAL,
|
|
|
|
|
BFD_RELOC_ARM_IN_POOL,
|
1996-07-31 14:34:21 +00:00
|
|
|
|
BFD_RELOC_ARM_OFFSET_IMM8,
|
|
|
|
|
BFD_RELOC_ARM_HWLITERAL,
|
1996-08-30 22:09:51 +00:00
|
|
|
|
BFD_RELOC_ARM_THUMB_ADD,
|
|
|
|
|
BFD_RELOC_ARM_THUMB_IMM,
|
|
|
|
|
BFD_RELOC_ARM_THUMB_SHIFT,
|
|
|
|
|
BFD_RELOC_ARM_THUMB_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* Hitachi SH relocs. Not all of these appear in object files. */
|
|
|
|
|
BFD_RELOC_SH_PCDISP8BY2,
|
|
|
|
|
BFD_RELOC_SH_PCDISP12BY2,
|
|
|
|
|
BFD_RELOC_SH_IMM4,
|
|
|
|
|
BFD_RELOC_SH_IMM4BY2,
|
|
|
|
|
BFD_RELOC_SH_IMM4BY4,
|
|
|
|
|
BFD_RELOC_SH_IMM8,
|
|
|
|
|
BFD_RELOC_SH_IMM8BY2,
|
|
|
|
|
BFD_RELOC_SH_IMM8BY4,
|
|
|
|
|
BFD_RELOC_SH_PCRELIMM8BY2,
|
|
|
|
|
BFD_RELOC_SH_PCRELIMM8BY4,
|
|
|
|
|
BFD_RELOC_SH_SWITCH16,
|
|
|
|
|
BFD_RELOC_SH_SWITCH32,
|
|
|
|
|
BFD_RELOC_SH_USES,
|
|
|
|
|
BFD_RELOC_SH_COUNT,
|
|
|
|
|
BFD_RELOC_SH_ALIGN,
|
|
|
|
|
BFD_RELOC_SH_CODE,
|
|
|
|
|
BFD_RELOC_SH_DATA,
|
|
|
|
|
BFD_RELOC_SH_LABEL,
|
1997-08-15 12:08:52 +00:00
|
|
|
|
|
|
|
|
|
/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
|
|
|
|
|
be zero and is not stored in the instruction. */
|
|
|
|
|
BFD_RELOC_THUMB_PCREL_BRANCH9,
|
|
|
|
|
BFD_RELOC_THUMB_PCREL_BRANCH12,
|
|
|
|
|
BFD_RELOC_THUMB_PCREL_BRANCH23,
|
1994-11-30 01:29:26 +00:00
|
|
|
|
|
|
|
|
|
/* Argonaut RISC Core (ARC) relocs.
|
|
|
|
|
ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
|
1995-06-09 19:16:33 +00:00
|
|
|
|
not stored in the instruction. The high 20 bits are installed in bits 26
|
|
|
|
|
through 7 of the instruction. */
|
1994-11-30 01:29:26 +00:00
|
|
|
|
BFD_RELOC_ARC_B22_PCREL,
|
1995-06-09 19:16:33 +00:00
|
|
|
|
|
|
|
|
|
/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not
|
|
|
|
|
stored in the instruction. The high 24 bits are installed in bits 23
|
|
|
|
|
through 0. */
|
|
|
|
|
BFD_RELOC_ARC_B26,
|
1997-02-20 22:49:40 +00:00
|
|
|
|
|
1996-07-18 00:47:05 +00:00
|
|
|
|
/* Mitsubishi D10V relocs.
|
|
|
|
|
This is a 10-bit reloc with the right 2 bits
|
|
|
|
|
assumed to be 0. */
|
|
|
|
|
BFD_RELOC_D10V_10_PCREL_R,
|
|
|
|
|
|
1996-07-19 00:48:20 +00:00
|
|
|
|
/* Mitsubishi D10V relocs.
|
|
|
|
|
This is a 10-bit reloc with the right 2 bits
|
|
|
|
|
assumed to be 0. This is the same as the previous reloc
|
|
|
|
|
except it is in the left container, i.e.,
|
|
|
|
|
shifted left 15 bits. */
|
|
|
|
|
BFD_RELOC_D10V_10_PCREL_L,
|
|
|
|
|
|
1996-07-18 00:47:05 +00:00
|
|
|
|
/* This is an 18-bit reloc with the right 2 bits
|
|
|
|
|
assumed to be 0. */
|
|
|
|
|
BFD_RELOC_D10V_18,
|
|
|
|
|
|
|
|
|
|
/* This is an 18-bit reloc with the right 2 bits
|
|
|
|
|
assumed to be 0. */
|
|
|
|
|
BFD_RELOC_D10V_18_PCREL,
|
|
|
|
|
|
Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
reloc.c, targets.c: New target, elf-*-D30V.
* bfd-in2.h, configure, libbfd.h: Rebuilt.
* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
|
|
|
|
/* Mitsubishi D30V relocs.
|
|
|
|
|
This is a 6-bit absolute reloc. */
|
|
|
|
|
BFD_RELOC_D30V_6,
|
|
|
|
|
|
1997-09-15 16:43:43 +00:00
|
|
|
|
/* This is a 6-bit pc-relative reloc with
|
|
|
|
|
the right 3 bits assumed to be 0. */
|
|
|
|
|
BFD_RELOC_D30V_9_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 6-bit pc-relative reloc with
|
|
|
|
|
the right 3 bits assumed to be 0. Same
|
|
|
|
|
as the previous reloc but on the right side
|
|
|
|
|
of the container. */
|
|
|
|
|
BFD_RELOC_D30V_9_PCREL_R,
|
|
|
|
|
|
|
|
|
|
/* This is a 12-bit absolute reloc with the
|
Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
reloc.c, targets.c: New target, elf-*-D30V.
* bfd-in2.h, configure, libbfd.h: Rebuilt.
* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
|
|
|
|
right 3 bitsassumed to be 0. */
|
|
|
|
|
BFD_RELOC_D30V_15,
|
|
|
|
|
|
1997-09-15 16:43:43 +00:00
|
|
|
|
/* This is a 12-bit pc-relative reloc with
|
Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
reloc.c, targets.c: New target, elf-*-D30V.
* bfd-in2.h, configure, libbfd.h: Rebuilt.
* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
|
|
|
|
the right 3 bits assumed to be 0. */
|
|
|
|
|
BFD_RELOC_D30V_15_PCREL,
|
|
|
|
|
|
1997-09-15 16:43:43 +00:00
|
|
|
|
/* This is a 12-bit pc-relative reloc with
|
|
|
|
|
the right 3 bits assumed to be 0. Same
|
|
|
|
|
as the previous reloc but on the right side
|
|
|
|
|
of the container. */
|
|
|
|
|
BFD_RELOC_D30V_15_PCREL_R,
|
|
|
|
|
|
Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
reloc.c, targets.c: New target, elf-*-D30V.
* bfd-in2.h, configure, libbfd.h: Rebuilt.
* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
|
|
|
|
/* This is an 18-bit absolute reloc with
|
|
|
|
|
the right 3 bits assumed to be 0. */
|
|
|
|
|
BFD_RELOC_D30V_21,
|
|
|
|
|
|
|
|
|
|
/* This is an 18-bit pc-relative reloc with
|
|
|
|
|
the right 3 bits assumed to be 0. */
|
|
|
|
|
BFD_RELOC_D30V_21_PCREL,
|
|
|
|
|
|
1997-09-15 16:43:43 +00:00
|
|
|
|
/* This is an 18-bit pc-relative reloc with
|
|
|
|
|
the right 3 bits assumed to be 0. Same
|
|
|
|
|
as the previous reloc but on the right side
|
|
|
|
|
of the container. */
|
|
|
|
|
BFD_RELOC_D30V_21_PCREL_R,
|
|
|
|
|
|
Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, archures.c, config.bfd, configure.in, elf.c,
reloc.c, targets.c: New target, elf-*-D30V.
* bfd-in2.h, configure, libbfd.h: Rebuilt.
* cpu-d30v.c, elf32-d30v.c: New files.
1997-02-19 01:29:29 +00:00
|
|
|
|
/* This is a 32-bit absolute reloc. */
|
|
|
|
|
BFD_RELOC_D30V_32,
|
|
|
|
|
|
|
|
|
|
/* This is a 32-bit pc-relative reloc. */
|
|
|
|
|
BFD_RELOC_D30V_32_PCREL,
|
1996-09-12 18:56:14 +00:00
|
|
|
|
|
|
|
|
|
/* Mitsubishi M32R relocs.
|
1996-12-28 04:09:34 +00:00
|
|
|
|
This is a 24 bit absolute address. */
|
|
|
|
|
BFD_RELOC_M32R_24,
|
1996-10-03 03:56:20 +00:00
|
|
|
|
|
1996-12-28 04:09:34 +00:00
|
|
|
|
/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
|
|
|
|
|
BFD_RELOC_M32R_10_PCREL,
|
1996-09-12 18:56:14 +00:00
|
|
|
|
|
|
|
|
|
/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
|
1996-12-28 04:09:34 +00:00
|
|
|
|
BFD_RELOC_M32R_18_PCREL,
|
1996-09-12 18:56:14 +00:00
|
|
|
|
|
1997-01-27 20:35:24 +00:00
|
|
|
|
/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
|
1996-12-28 04:09:34 +00:00
|
|
|
|
BFD_RELOC_M32R_26_PCREL,
|
1997-01-27 20:35:24 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 16-bit reloc containing the high 16 bits of an address
|
|
|
|
|
used when the lower 16 bits are treated as unsigned. */
|
|
|
|
|
BFD_RELOC_M32R_HI16_ULO,
|
|
|
|
|
|
|
|
|
|
/* This is a 16-bit reloc containing the high 16 bits of an address
|
|
|
|
|
used when the lower 16 bits are treated as signed. */
|
|
|
|
|
BFD_RELOC_M32R_HI16_SLO,
|
|
|
|
|
|
|
|
|
|
/* This is a 16-bit reloc containing the lower 16 bits of an address. */
|
|
|
|
|
BFD_RELOC_M32R_LO16,
|
1997-02-21 22:09:40 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 16-bit reloc containing the small data area offset for use in
|
|
|
|
|
add3, load, and store instructions. */
|
|
|
|
|
BFD_RELOC_M32R_SDA16,
|
1996-09-10 04:35:48 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 9-bit reloc */
|
1996-08-30 22:09:51 +00:00
|
|
|
|
BFD_RELOC_V850_9_PCREL,
|
1996-09-10 04:35:48 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 22-bit reloc */
|
1996-08-30 22:09:51 +00:00
|
|
|
|
BFD_RELOC_V850_22_PCREL,
|
1996-10-17 04:45:29 +00:00
|
|
|
|
|
1997-09-04 17:51:12 +00:00
|
|
|
|
/* This is a 16 bit offset from the short data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_SDA_16_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset (of which only 15 bits are used) from the
|
|
|
|
|
short data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_SDA_15_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset from the zero data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_ZDA_16_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset (of which only 15 bits are used) from the
|
|
|
|
|
zero data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_ZDA_15_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is an 8 bit offset (of which only 6 bits are used) from the
|
|
|
|
|
tiny data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_TDA_6_8_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is an 8bit offset (of which only 7 bits are used) from the tiny
|
|
|
|
|
data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_TDA_7_8_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 7 bit offset from the tiny data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_TDA_7_7_OFFSET,
|
1997-09-16 21:21:30 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset from the tiny data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_TDA_16_16_OFFSET,
|
1997-09-02 22:53:31 +00:00
|
|
|
|
/* start-sanitize-v850e */
|
1997-09-04 17:51:12 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
|
|
|
|
|
data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_TDA_4_5_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 4 bit offset from the tiny data area pointer. */
|
|
|
|
|
BFD_RELOC_V850_TDA_4_4_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset from the short data area pointer, with the
|
|
|
|
|
bits placed non-contigously in the instruction. */
|
|
|
|
|
BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset from the zero data area pointer, with the
|
|
|
|
|
bits placed non-contigously in the instruction. */
|
|
|
|
|
BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
|
1997-09-17 23:50:21 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 6 bit offset from the call table base pointer. */
|
|
|
|
|
BFD_RELOC_V850_CALLT_6_7_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset from the call table base pointer. */
|
|
|
|
|
BFD_RELOC_V850_CALLT_16_16_OFFSET,
|
1997-09-03 22:50:06 +00:00
|
|
|
|
/* end-sanitize-v850e */
|
1996-12-28 04:09:34 +00:00
|
|
|
|
|
1997-09-04 17:51:12 +00:00
|
|
|
|
|
1996-12-28 04:09:34 +00:00
|
|
|
|
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
|
|
|
|
|
instruction. */
|
|
|
|
|
BFD_RELOC_MN10300_32_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
|
|
|
|
|
instruction. */
|
|
|
|
|
BFD_RELOC_MN10300_16_PCREL,
|
1998-03-03 16:31:21 +00:00
|
|
|
|
|
|
|
|
|
/* This is a 8bit DP reloc for the tms320c30, where the most
|
|
|
|
|
significant 8 bits of a 24 bit word are placed into the least
|
|
|
|
|
significant 8 bits of the opcode. */
|
|
|
|
|
BFD_RELOC_TIC30_LDP,
|
1998-06-30 10:02:22 +00:00
|
|
|
|
|
1998-12-06 21:37:41 +00:00
|
|
|
|
/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
|
|
|
|
|
BFD_RELOC_FR30_48,
|
|
|
|
|
|
1998-11-05 00:05:50 +00:00
|
|
|
|
/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
|
|
|
|
|
two sections. */
|
|
|
|
|
BFD_RELOC_FR30_20,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
|
|
|
|
|
4 bits. */
|
|
|
|
|
BFD_RELOC_FR30_6_IN_4,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
|
|
|
|
|
into 8 bits. */
|
|
|
|
|
BFD_RELOC_FR30_8_IN_8,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
|
|
|
|
|
into 8 bits. */
|
|
|
|
|
BFD_RELOC_FR30_9_IN_8,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
|
|
|
|
|
into 8 bits. */
|
|
|
|
|
BFD_RELOC_FR30_10_IN_8,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
|
|
|
|
|
short offset into 8 bits. */
|
|
|
|
|
BFD_RELOC_FR30_9_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
|
|
|
|
|
short offset into 11 bits. */
|
|
|
|
|
BFD_RELOC_FR30_12_PCREL,
|
|
|
|
|
|
1998-06-30 10:02:22 +00:00
|
|
|
|
/* These two relocations are used by the linker to determine which of
|
|
|
|
|
the entries in a C++ virtual function table are actually used. When
|
|
|
|
|
the --gc-sections option is given, the linker will zero out the entries
|
|
|
|
|
that are not used, so that the code for those functions need not be
|
|
|
|
|
included in the output.
|
|
|
|
|
|
|
|
|
|
VTABLE_INHERIT is a zero-space relocation used to describe to the
|
|
|
|
|
linker the inheritence tree of a C++ virtual function table. The
|
|
|
|
|
relocation's symbol should be the parent class' vtable, and the
|
|
|
|
|
relocation should be located at the child vtable.
|
|
|
|
|
|
|
|
|
|
VTABLE_ENTRY is a zero-space relocation that describes the use of a
|
|
|
|
|
virtual function table entry. The reloc's symbol should refer to the
|
|
|
|
|
table of the class mentioned in the code. Off of that base, an offset
|
|
|
|
|
describes the entry that is being used. For Rela hosts, this offset
|
|
|
|
|
is stored in the reloc's addend. For Rel hosts, we are forced to put
|
|
|
|
|
this offset in the reloc's section offset. */
|
|
|
|
|
BFD_RELOC_VTABLE_INHERIT,
|
|
|
|
|
BFD_RELOC_VTABLE_ENTRY,
|
1994-09-02 18:21:41 +00:00
|
|
|
|
BFD_RELOC_UNUSED };
|
|
|
|
|
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
|
1995-02-06 08:31:27 +00:00
|
|
|
|
reloc_howto_type *
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
|
|
|
|
|
|
1994-09-02 18:21:41 +00:00
|
|
|
|
const char *
|
|
|
|
|
bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
|
|
|
|
|
|
1993-08-09 19:25:56 +00:00
|
|
|
|
|
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
1994-03-15 15:13:13 +00:00
|
|
|
|
typedef struct symbol_cache_entry
|
1993-06-16 02:25:53 +00:00
|
|
|
|
{
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* A pointer to the BFD which owns the symbol. This information
|
|
|
|
|
is necessary so that a back end can work out what additional
|
|
|
|
|
information (invisible to the application writer) is carried
|
|
|
|
|
with the symbol.
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
This field is *almost* redundant, since you can use section->owner
|
|
|
|
|
instead, except that some symbols point to the global sections
|
|
|
|
|
bfd_{abs,com,und}_section. This could be fixed by making
|
|
|
|
|
these globals be per-bfd (or per-target-flavor). FIXME. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The text of the symbol. The name is left alone, and not copied; the
|
|
|
|
|
application may not alter it. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
CONST char *name;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The value of the symbol. This really should be a union of a
|
1993-06-16 02:25:53 +00:00
|
|
|
|
numeric value with a pointer, since some flags indicate that
|
|
|
|
|
a pointer to another symbol is stored here. */
|
|
|
|
|
symvalue value;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Attributes of a symbol: */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define BSF_NO_FLAGS 0x00
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The symbol has local scope; <<static>> in <<C>>. The value
|
|
|
|
|
is the offset into the section of the data. */
|
|
|
|
|
#define BSF_LOCAL 0x01
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The symbol has global scope; initialized data in <<C>>. The
|
|
|
|
|
value is the offset into the section of the data. */
|
|
|
|
|
#define BSF_GLOBAL 0x02
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The symbol has global scope and is exported. The value is
|
|
|
|
|
the offset into the section of the data. */
|
|
|
|
|
#define BSF_EXPORT BSF_GLOBAL /* no real difference */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* A normal C symbol would be one of:
|
|
|
|
|
<<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
|
|
|
|
|
<<BSF_GLOBAL>> */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The symbol is a debugging record. The value has an arbitary
|
|
|
|
|
meaning. */
|
|
|
|
|
#define BSF_DEBUGGING 0x08
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The symbol denotes a function entry point. Used in ELF,
|
|
|
|
|
perhaps others someday. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_FUNCTION 0x10
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Used by the linker. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_KEEP 0x20
|
|
|
|
|
#define BSF_KEEP_G 0x40
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* A weak global symbol, overridable without warnings by
|
|
|
|
|
a regular global symbol of the same name. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_WEAK 0x80
|
|
|
|
|
|
|
|
|
|
/* This symbol was created to point to a section, e.g. ELF's
|
1998-01-26 20:43:50 +00:00
|
|
|
|
STT_SECTION symbols. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_SECTION_SYM 0x100
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The symbol used to be a common symbol, but now it is
|
|
|
|
|
allocated. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_OLD_COMMON 0x200
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* The default value for common data. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BFD_FORT_COMM_DEFAULT_VALUE 0
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* In some files the type of a symbol sometimes alters its
|
|
|
|
|
location in an output file - ie in coff a <<ISFCN>> symbol
|
|
|
|
|
which is also <<C_EXT>> symbol appears where it was
|
|
|
|
|
declared and not at the end of a section. This bit is set
|
|
|
|
|
by the target BFD part to convey this information. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
#define BSF_NOT_AT_END 0x400
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Signal that the symbol is the label of constructor section. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_CONSTRUCTOR 0x800
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Signal that the symbol is a warning symbol. The name is a
|
|
|
|
|
warning. The name of the next symbol is the one to warn about;
|
|
|
|
|
if a reference is made to a symbol with the same name as the next
|
|
|
|
|
symbol, a warning is issued by the linker. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_WARNING 0x1000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Signal that the symbol is indirect. This symbol is an indirect
|
|
|
|
|
pointer to the symbol with the same name as the next symbol. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_INDIRECT 0x2000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* BSF_FILE marks symbols that contain a file name. This is used
|
|
|
|
|
for ELF STT_FILE symbols. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BSF_FILE 0x4000
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Symbol is from dynamic linking information. */
|
|
|
|
|
#define BSF_DYNAMIC 0x8000
|
* syms.c (BSF_DYNAMIC): New symbol flag.
(bfd_print_symbol_vandf): Print it.
* bfd-in2.h: Rebuilt.
* libaout.h (struct aout_backend_data): New read_dynamic_symbols
and read_dynamic_relocs fields.
(struct aoutdata): New dynamic_info field.
(obj_aout_dynamic_info): New accessor macro.
* sunos.c (struct sunos_dynamic_info): New structure.
(sunos_read_dynamic_info, MY(read_dynamic_symbols),
MY(read_dynamic_relocs)): New functions to read dynamic symbols
and relocs.
* aoutx.h (NAME(aout,some_aout_object_p)): If the object is
dynamically linked, set SEC_RELOC for both the .text and .data
sections.
(translate_from_native_sym_flags): Don't set BSF_LOCAL for an
undefined symbol.
(translate_symbol_table): New function, split out of
slurp_symbol_table; set the BSF_DYNAMIC flag appropriately.
(NAME(aout,slurp_symbol_table)): Read dynamic symbols, if any.
(NAME(aout,slurp_reloc_table)): Read dynamic relocs, if any.
(NAME(aout,get_reloc_upper_bound)): Include dynamic reloc count in
return value.
* aoutf1.h (NAME(aout,sunos4_write_object_contents)): Don't write
out dynamic symbols or relocs against reloc symbols, since they
are already in the .text section and we wouldn't know where to
write them anyhow.
(sunos4_aout_backend): Initialize read_dynamic_symbols and
read_dynamic_relocs fields.
* aout-target.h (MY(backend_data)): Initialize
read_dynamic_symbols and read_dynamic_relocs fields.
1994-01-21 06:29:21 +00:00
|
|
|
|
|
1996-02-05 23:57:39 +00:00
|
|
|
|
/* The symbol denotes a data object. Used in ELF, and perhaps
|
|
|
|
|
others someday. */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
#define BSF_OBJECT 0x10000
|
1996-02-05 23:57:39 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
flagword flags;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* A pointer to the section to which this symbol is
|
|
|
|
|
relative. This will always be non NULL, there are special
|
1994-11-17 22:46:22 +00:00
|
|
|
|
sections for undefined and absolute symbols. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct sec *section;
|
|
|
|
|
|
1998-01-26 20:43:50 +00:00
|
|
|
|
/* Back end special data. */
|
1994-11-17 22:46:22 +00:00
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
PTR p;
|
|
|
|
|
bfd_vma i;
|
|
|
|
|
} udata;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
} asymbol;
|
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
get_symtab_upper_bound, bfd_canonicalize_symtab,
bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now
return long instead of unsigned int, and use -1 to indicate an
error. Along the way, rename get_symtab_upper_bound to
bfd_get_symtab_upper_bound.
* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
errors.
(bfd_canonicalize_reloc): Likewise.
* syms.c (bfd_get_symtab_upper_bound): Renamed from
get_symtab_upper_bound.
* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
_bfd_get_symtab_upper_bound, and changed it and
_bfd_canonicalize_symtab and _get_reloc_upper_bound and
_bfd_canonicalize_reloc to all return long.
* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
(NAME(aout,get_symtab_upper_bound)): Likewise.
* bout.c (b_out_canonicalize_reloc): Likewise.
(b_out_get_reloc_upper_bound): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* coffgen.c (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_get_symtab_upper_bound): Likewise.
(elf_get_reloc_upper_bound): Likewise.
(elf_canonicalize_reloc): Likewise.
(elf_get_symtab): Likewise.
* hp300hpux.c (MY(get_symtab)): Likewise.
(MY(get_symtab_upper_bound)): Likewise.
(MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* ieee.c (ieee_slurp_external_symbols): Change return type to
boolean. Check for errors from get_symbol.
(ieee_slurp_symbol_table): Change return type to boolean. Check
for errors from ieee_slurp_external_symbols.
(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
(ieee_get_symtab): Likewise.
(ieee_get_reloc_upper_bound): Likewise.
(ieee_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
(nlm_get_symtab): Likewise.
(nlm_get_reloc_upper_bound): Likewise.
(nlm_canonicalize_reloc): Likewise.
* oasys.c (oasys_get_symtab_upper_bound): Likewise.
(oasys_get_symtab): Likewise.
(oasys_get_reloc_upper_bound): Likewise.
(oasys_canonicalize_reloc): Likewise.
* som.c (som_get_symtab_upper_bound): Likewise.
(som_get_symtab): Likewise.
(som_get_reloc_upper_bound): Likewise.
(som_canonicalize_reloc): Likewise.
* srec.c (srec_get_symtab_upper_bound): Likewise.
(srec_get_symtab): Likewise.
(srec_get_reloc_upper_bound): Define as bfd_0l.
(srec_canonicalize_reloc): Likewise.
* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
(tekhex_get_symtab_upper_bound): Likewise.
(tekhex_get_reloc_upper_bound): Define as bfd_0l.
(tekhex_canonicalize_reloc): Likewise.
* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
declaration to return long.
(NAME(aout,get_symtab)): Likewise.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
(bfd_elf32_get_symtab): Likewise.
(bfd_elf32_get_reloc_upper_bound): Likewise.
(bfd_elf32_canonicalize_reloc): Likewise.
(bfd_elf64_get_symtab_upper_bound): Likewise.
(bfd_elf64_get_symtab): Likewise.
(bfd_elf64_get_reloc_upper_bound): Likewise.
(bfd_elf64_canonicalize_reloc): Likewise.
* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
(nlmNAME(get_symtab)): Likewise.
(nlmNAME(get_reloc_upper_bound)): Likewise.
(nlmNAME(canonicalize_reloc)): Likewise.
* archive.c (compute_and_write_armap): Use error_return and
no_memory_return labels rather than freeing information in various
places. Change storage, symcount and src_count to long. Check
errors from bfd_get_symtab_upper_bound and
bfd_canonicalize_symtab.
* bout.c (b_out_relax_section): Change reloc_size to long. Check
for errors from bfd_get_reloc_upper_bound and
bfd_canonicalize_reloc.
(b_out_get_relocated_section_contents): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
Likewise.
* elf32-mips.c: Likewise.
* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
(hppa_look_for_stubs_in_section): Check for errors from
bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
bfd_canonicalize_reloc.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
* linker.c (generic_link_read_symbols): Likewise.
(_bfd_generic_final_link): Check for errors from
bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
* libbfd.c (bfd_0l): New function.
* libbfd-in.h (bfd_0l): Declare.
* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
than bfd_0u.
* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* libcoff.h: Rebuilt.
* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
temp and name.
1994-03-30 22:15:07 +00:00
|
|
|
|
#define bfd_get_symtab_upper_bound(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
|
1994-03-17 23:47:00 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym));
|
|
|
|
|
|
1997-02-28 02:07:54 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name));
|
|
|
|
|
|
|
|
|
|
#define bfd_is_local_label_name(abfd, name) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_canonicalize_symtab(abfd, location) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_canonicalize_symtab,\
|
|
|
|
|
(abfd, location))
|
|
|
|
|
boolean
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol));
|
|
|
|
|
|
|
|
|
|
#define bfd_make_empty_symbol(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
|
|
|
|
|
#define bfd_make_debug_symbol(abfd,ptr,size) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
|
|
|
|
|
int
|
|
|
|
|
bfd_decode_symclass PARAMS ((asymbol *symbol));
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
|
|
|
|
|
|
1995-06-10 00:05:51 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym));
|
|
|
|
|
|
|
|
|
|
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
|
1996-10-03 03:56:20 +00:00
|
|
|
|
BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
(ibfd, isymbol, obfd, osymbol))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct _bfd
|
|
|
|
|
{
|
|
|
|
|
/* The filename the application opened the BFD with. */
|
|
|
|
|
CONST char *filename;
|
|
|
|
|
|
|
|
|
|
/* A pointer to the target jump table. */
|
1994-06-20 21:55:45 +00:00
|
|
|
|
const struct bfd_target *xvec;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* To avoid dragging too many header files into every file that
|
|
|
|
|
includes `<<bfd.h>>', IOSTREAM has been declared as a "char
|
|
|
|
|
*", and MTIME as a "long". Their correct types, to which they
|
|
|
|
|
are cast when used, are "FILE *" and "time_t". The iostream
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
is the result of an fopen on the filename. However, if the
|
|
|
|
|
BFD_IN_MEMORY flag is set, then iostream is actually a pointer
|
|
|
|
|
to a bfd_in_memory struct. */
|
|
|
|
|
PTR iostream;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1993-11-05 08:34:09 +00:00
|
|
|
|
/* Is the file descriptor being cached? That is, can it be closed as
|
|
|
|
|
needed, and re-opened when accessed later? */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean cacheable;
|
|
|
|
|
|
|
|
|
|
/* Marks whether there was a default target specified when the
|
1993-11-05 19:51:52 +00:00
|
|
|
|
BFD was opened. This is used to select which matching algorithm
|
|
|
|
|
to use to choose the back end. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean target_defaulted;
|
|
|
|
|
|
|
|
|
|
/* The caching routines use these to maintain a
|
|
|
|
|
least-recently-used list of BFDs */
|
|
|
|
|
|
|
|
|
|
struct _bfd *lru_prev, *lru_next;
|
|
|
|
|
|
|
|
|
|
/* When a file is closed by the caching routines, BFD retains
|
1993-11-05 19:51:52 +00:00
|
|
|
|
state information on the file here: */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
file_ptr where;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* and here: (``once'' means at least once) */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean opened_once;
|
|
|
|
|
|
|
|
|
|
/* Set if we have a locally maintained mtime value, rather than
|
|
|
|
|
getting it from the file each time: */
|
|
|
|
|
|
|
|
|
|
boolean mtime_set;
|
|
|
|
|
|
|
|
|
|
/* File modified time, if mtime_set is true: */
|
|
|
|
|
|
|
|
|
|
long mtime;
|
|
|
|
|
|
|
|
|
|
/* Reserved for an unimplemented file locking extension.*/
|
|
|
|
|
|
|
|
|
|
int ifd;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* The format which belongs to the BFD. (object, core, etc.) */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
bfd_format format;
|
|
|
|
|
|
|
|
|
|
/* The direction the BFD was opened with*/
|
|
|
|
|
|
|
|
|
|
enum bfd_direction {no_direction = 0,
|
|
|
|
|
read_direction = 1,
|
|
|
|
|
write_direction = 2,
|
|
|
|
|
both_direction = 3} direction;
|
|
|
|
|
|
|
|
|
|
/* Format_specific flags*/
|
|
|
|
|
|
|
|
|
|
flagword flags;
|
|
|
|
|
|
|
|
|
|
/* Currently my_archive is tested before adding origin to
|
|
|
|
|
anything. I believe that this can become always an add of
|
|
|
|
|
origin, with origin set to 0 for non archive files. */
|
|
|
|
|
|
|
|
|
|
file_ptr origin;
|
|
|
|
|
|
|
|
|
|
/* Remember when output has begun, to stop strange things
|
1993-11-05 19:51:52 +00:00
|
|
|
|
from happening. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean output_has_begun;
|
|
|
|
|
|
|
|
|
|
/* Pointer to linked list of sections*/
|
|
|
|
|
struct sec *sections;
|
|
|
|
|
|
|
|
|
|
/* The number of sections */
|
|
|
|
|
unsigned int section_count;
|
|
|
|
|
|
|
|
|
|
/* Stuff only useful for object files:
|
|
|
|
|
The start address. */
|
|
|
|
|
bfd_vma start_address;
|
|
|
|
|
|
|
|
|
|
/* Used for input and output*/
|
|
|
|
|
unsigned int symcount;
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
/* Symbol table for output BFD (with symcount entries) */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct symbol_cache_entry **outsymbols;
|
|
|
|
|
|
|
|
|
|
/* Pointer to structure which contains architecture information*/
|
1995-09-22 22:06:51 +00:00
|
|
|
|
const struct bfd_arch_info *arch_info;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
/* Stuff only useful for archives:*/
|
|
|
|
|
PTR arelt_data;
|
1993-11-05 19:51:52 +00:00
|
|
|
|
struct _bfd *my_archive; /* The containing archive BFD. */
|
|
|
|
|
struct _bfd *next; /* The next BFD in the archive. */
|
|
|
|
|
struct _bfd *archive_head; /* The first BFD in the archive. */
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean has_armap;
|
|
|
|
|
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
/* A chain of BFD structures involved in a link. */
|
|
|
|
|
struct _bfd *link_next;
|
|
|
|
|
|
|
|
|
|
/* A field used by _bfd_generic_link_add_archive_symbols. This will
|
|
|
|
|
be used only for archive elements. */
|
|
|
|
|
int archive_pass;
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
/* Used by the back end to hold private data. */
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
struct aout_data_struct *aout_data;
|
|
|
|
|
struct artdata *aout_ar_data;
|
|
|
|
|
struct _oasys_data *oasys_obj_data;
|
|
|
|
|
struct _oasys_ar_data *oasys_ar_data;
|
|
|
|
|
struct coff_tdata *coff_obj_data;
|
1995-08-31 23:33:37 +00:00
|
|
|
|
struct pe_tdata *pe_obj_data;
|
1995-10-16 23:10:56 +00:00
|
|
|
|
struct xcoff_tdata *xcoff_obj_data;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct ecoff_tdata *ecoff_obj_data;
|
|
|
|
|
struct ieee_data_struct *ieee_data;
|
|
|
|
|
struct ieee_ar_data_struct *ieee_ar_data;
|
|
|
|
|
struct srec_data_struct *srec_data;
|
1995-12-02 02:00:08 +00:00
|
|
|
|
struct ihex_data_struct *ihex_data;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct tekhex_data_struct *tekhex_data;
|
|
|
|
|
struct elf_obj_tdata *elf_obj_data;
|
* configure.in (*-*-netware, i[34]86-*-netware): New configs.
* Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o.
* Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o.
* Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c.
* Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets.
* bfd-in2.h (INLINE): Defines moved here.
* {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h.
* libelf.h (CAT4): Move define to bfd-in2.h.
* bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros.
* bfd-in2.h (union tdata): Add nlm_obj_data.
* bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour.
* targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes.
* targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec.
* (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c,
nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files
for NLM support.
1993-07-20 04:45:13 +00:00
|
|
|
|
struct nlm_obj_tdata *nlm_obj_data;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct bout_data_struct *bout_data;
|
|
|
|
|
struct sun_core_struct *sun_core_data;
|
1998-12-09 03:23:25 +00:00
|
|
|
|
struct sco5_core_struct *sco5_core_data;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct trad_core_struct *trad_core_data;
|
1993-10-31 18:59:59 +00:00
|
|
|
|
struct som_data_struct *som_data;
|
1993-08-05 18:36:19 +00:00
|
|
|
|
struct hpux_core_struct *hpux_core_data;
|
1993-11-24 07:21:28 +00:00
|
|
|
|
struct hppabsd_core_struct *hppabsd_core_data;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct sgi_core_struct *sgi_core_data;
|
1993-09-22 14:54:50 +00:00
|
|
|
|
struct lynx_core_struct *lynx_core_data;
|
1993-09-28 20:44:43 +00:00
|
|
|
|
struct osf_core_struct *osf_core_data;
|
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
get_symtab_upper_bound, bfd_canonicalize_symtab,
bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now
return long instead of unsigned int, and use -1 to indicate an
error. Along the way, rename get_symtab_upper_bound to
bfd_get_symtab_upper_bound.
* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
errors.
(bfd_canonicalize_reloc): Likewise.
* syms.c (bfd_get_symtab_upper_bound): Renamed from
get_symtab_upper_bound.
* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
_bfd_get_symtab_upper_bound, and changed it and
_bfd_canonicalize_symtab and _get_reloc_upper_bound and
_bfd_canonicalize_reloc to all return long.
* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
(NAME(aout,get_symtab_upper_bound)): Likewise.
* bout.c (b_out_canonicalize_reloc): Likewise.
(b_out_get_reloc_upper_bound): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* coffgen.c (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_get_symtab_upper_bound): Likewise.
(elf_get_reloc_upper_bound): Likewise.
(elf_canonicalize_reloc): Likewise.
(elf_get_symtab): Likewise.
* hp300hpux.c (MY(get_symtab)): Likewise.
(MY(get_symtab_upper_bound)): Likewise.
(MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* ieee.c (ieee_slurp_external_symbols): Change return type to
boolean. Check for errors from get_symbol.
(ieee_slurp_symbol_table): Change return type to boolean. Check
for errors from ieee_slurp_external_symbols.
(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
(ieee_get_symtab): Likewise.
(ieee_get_reloc_upper_bound): Likewise.
(ieee_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
(nlm_get_symtab): Likewise.
(nlm_get_reloc_upper_bound): Likewise.
(nlm_canonicalize_reloc): Likewise.
* oasys.c (oasys_get_symtab_upper_bound): Likewise.
(oasys_get_symtab): Likewise.
(oasys_get_reloc_upper_bound): Likewise.
(oasys_canonicalize_reloc): Likewise.
* som.c (som_get_symtab_upper_bound): Likewise.
(som_get_symtab): Likewise.
(som_get_reloc_upper_bound): Likewise.
(som_canonicalize_reloc): Likewise.
* srec.c (srec_get_symtab_upper_bound): Likewise.
(srec_get_symtab): Likewise.
(srec_get_reloc_upper_bound): Define as bfd_0l.
(srec_canonicalize_reloc): Likewise.
* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
(tekhex_get_symtab_upper_bound): Likewise.
(tekhex_get_reloc_upper_bound): Define as bfd_0l.
(tekhex_canonicalize_reloc): Likewise.
* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
declaration to return long.
(NAME(aout,get_symtab)): Likewise.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
(bfd_elf32_get_symtab): Likewise.
(bfd_elf32_get_reloc_upper_bound): Likewise.
(bfd_elf32_canonicalize_reloc): Likewise.
(bfd_elf64_get_symtab_upper_bound): Likewise.
(bfd_elf64_get_symtab): Likewise.
(bfd_elf64_get_reloc_upper_bound): Likewise.
(bfd_elf64_canonicalize_reloc): Likewise.
* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
(nlmNAME(get_symtab)): Likewise.
(nlmNAME(get_reloc_upper_bound)): Likewise.
(nlmNAME(canonicalize_reloc)): Likewise.
* archive.c (compute_and_write_armap): Use error_return and
no_memory_return labels rather than freeing information in various
places. Change storage, symcount and src_count to long. Check
errors from bfd_get_symtab_upper_bound and
bfd_canonicalize_symtab.
* bout.c (b_out_relax_section): Change reloc_size to long. Check
for errors from bfd_get_reloc_upper_bound and
bfd_canonicalize_reloc.
(b_out_get_relocated_section_contents): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
Likewise.
* elf32-mips.c: Likewise.
* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
(hppa_look_for_stubs_in_section): Check for errors from
bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
bfd_canonicalize_reloc.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
* linker.c (generic_link_read_symbols): Likewise.
(_bfd_generic_final_link): Check for errors from
bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
* libbfd.c (bfd_0l): New function.
* libbfd-in.h (bfd_0l): Declare.
* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
than bfd_0u.
* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* libcoff.h: Rebuilt.
* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
temp and name.
1994-03-30 22:15:07 +00:00
|
|
|
|
struct cisco_core_struct *cisco_core_data;
|
1995-06-09 19:16:33 +00:00
|
|
|
|
struct versados_data_struct *versados_data;
|
1996-02-21 00:29:38 +00:00
|
|
|
|
struct netbsd_core_struct *netbsd_core_data;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
PTR any;
|
|
|
|
|
} tdata;
|
|
|
|
|
|
|
|
|
|
/* Used by the application to hold private data*/
|
|
|
|
|
PTR usrdata;
|
|
|
|
|
|
1997-03-18 00:47:04 +00:00
|
|
|
|
/* Where all the allocated stuff under this BFD goes. This is a
|
|
|
|
|
struct objalloc *, but we use PTR to avoid requiring the inclusion of
|
|
|
|
|
objalloc.h. */
|
|
|
|
|
PTR memory;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
};
|
|
|
|
|
|
1994-01-22 02:18:02 +00:00
|
|
|
|
typedef enum bfd_error
|
|
|
|
|
{
|
* bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
(bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
all values.
* bfd-in2.h: Regenerated.
* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
aoutf1.h, aoutx.h, archive.c, archures.c,
bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
srec.c, sunos.c, syms.c, targets.c, tekhex.c,
trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
|
|
|
|
bfd_error_no_error = 0,
|
|
|
|
|
bfd_error_system_call,
|
|
|
|
|
bfd_error_invalid_target,
|
|
|
|
|
bfd_error_wrong_format,
|
|
|
|
|
bfd_error_invalid_operation,
|
|
|
|
|
bfd_error_no_memory,
|
|
|
|
|
bfd_error_no_symbols,
|
1995-07-03 22:16:40 +00:00
|
|
|
|
bfd_error_no_armap,
|
* bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
(bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
all values.
* bfd-in2.h: Regenerated.
* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
aoutf1.h, aoutx.h, archive.c, archures.c,
bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
srec.c, sunos.c, syms.c, targets.c, tekhex.c,
trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
|
|
|
|
bfd_error_no_more_archived_files,
|
|
|
|
|
bfd_error_malformed_archive,
|
|
|
|
|
bfd_error_file_not_recognized,
|
|
|
|
|
bfd_error_file_ambiguously_recognized,
|
|
|
|
|
bfd_error_no_contents,
|
|
|
|
|
bfd_error_nonrepresentable_section,
|
|
|
|
|
bfd_error_no_debug_section,
|
|
|
|
|
bfd_error_bad_value,
|
|
|
|
|
bfd_error_file_truncated,
|
1995-02-06 08:31:27 +00:00
|
|
|
|
bfd_error_file_too_big,
|
* bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
(bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
all values.
* bfd-in2.h: Regenerated.
* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
aoutf1.h, aoutx.h, archive.c, archures.c,
bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
srec.c, sunos.c, syms.c, targets.c, tekhex.c,
trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
|
|
|
|
bfd_error_invalid_error_code
|
|
|
|
|
} bfd_error_type;
|
|
|
|
|
|
|
|
|
|
bfd_error_type
|
|
|
|
|
bfd_get_error PARAMS ((void));
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_set_error PARAMS ((bfd_error_type error_tag));
|
1994-01-22 02:18:02 +00:00
|
|
|
|
|
|
|
|
|
CONST char *
|
* bfd.c (bfd_get_error, bfd_set_error): New functions.
(bfd_error): Make static.
(bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
all values.
* bfd-in2.h: Regenerated.
* aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
aoutf1.h, aoutx.h, archive.c, archures.c,
bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
srec.c, sunos.c, syms.c, targets.c, tekhex.c,
trad-core.c: Change callers.
1994-02-17 18:08:41 +00:00
|
|
|
|
bfd_errmsg PARAMS ((bfd_error_type error_tag));
|
1994-01-22 02:18:02 +00:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_perror PARAMS ((CONST char *message));
|
|
|
|
|
|
1995-06-09 19:16:33 +00:00
|
|
|
|
typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
|
|
|
|
|
|
|
|
|
|
bfd_error_handler_type
|
|
|
|
|
bfd_set_error_handler PARAMS ((bfd_error_handler_type));
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_set_error_program_name PARAMS ((const char *));
|
|
|
|
|
|
1998-01-23 05:27:42 +00:00
|
|
|
|
bfd_error_handler_type
|
|
|
|
|
bfd_get_error_handler PARAMS ((void));
|
|
|
|
|
|
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
get_symtab_upper_bound, bfd_canonicalize_symtab,
bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now
return long instead of unsigned int, and use -1 to indicate an
error. Along the way, rename get_symtab_upper_bound to
bfd_get_symtab_upper_bound.
* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
errors.
(bfd_canonicalize_reloc): Likewise.
* syms.c (bfd_get_symtab_upper_bound): Renamed from
get_symtab_upper_bound.
* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
_bfd_get_symtab_upper_bound, and changed it and
_bfd_canonicalize_symtab and _get_reloc_upper_bound and
_bfd_canonicalize_reloc to all return long.
* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
(NAME(aout,get_symtab_upper_bound)): Likewise.
* bout.c (b_out_canonicalize_reloc): Likewise.
(b_out_get_reloc_upper_bound): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* coffgen.c (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_get_symtab_upper_bound): Likewise.
(elf_get_reloc_upper_bound): Likewise.
(elf_canonicalize_reloc): Likewise.
(elf_get_symtab): Likewise.
* hp300hpux.c (MY(get_symtab)): Likewise.
(MY(get_symtab_upper_bound)): Likewise.
(MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* ieee.c (ieee_slurp_external_symbols): Change return type to
boolean. Check for errors from get_symbol.
(ieee_slurp_symbol_table): Change return type to boolean. Check
for errors from ieee_slurp_external_symbols.
(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
(ieee_get_symtab): Likewise.
(ieee_get_reloc_upper_bound): Likewise.
(ieee_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
(nlm_get_symtab): Likewise.
(nlm_get_reloc_upper_bound): Likewise.
(nlm_canonicalize_reloc): Likewise.
* oasys.c (oasys_get_symtab_upper_bound): Likewise.
(oasys_get_symtab): Likewise.
(oasys_get_reloc_upper_bound): Likewise.
(oasys_canonicalize_reloc): Likewise.
* som.c (som_get_symtab_upper_bound): Likewise.
(som_get_symtab): Likewise.
(som_get_reloc_upper_bound): Likewise.
(som_canonicalize_reloc): Likewise.
* srec.c (srec_get_symtab_upper_bound): Likewise.
(srec_get_symtab): Likewise.
(srec_get_reloc_upper_bound): Define as bfd_0l.
(srec_canonicalize_reloc): Likewise.
* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
(tekhex_get_symtab_upper_bound): Likewise.
(tekhex_get_reloc_upper_bound): Define as bfd_0l.
(tekhex_canonicalize_reloc): Likewise.
* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
declaration to return long.
(NAME(aout,get_symtab)): Likewise.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
(bfd_elf32_get_symtab): Likewise.
(bfd_elf32_get_reloc_upper_bound): Likewise.
(bfd_elf32_canonicalize_reloc): Likewise.
(bfd_elf64_get_symtab_upper_bound): Likewise.
(bfd_elf64_get_symtab): Likewise.
(bfd_elf64_get_reloc_upper_bound): Likewise.
(bfd_elf64_canonicalize_reloc): Likewise.
* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
(nlmNAME(get_symtab)): Likewise.
(nlmNAME(get_reloc_upper_bound)): Likewise.
(nlmNAME(canonicalize_reloc)): Likewise.
* archive.c (compute_and_write_armap): Use error_return and
no_memory_return labels rather than freeing information in various
places. Change storage, symcount and src_count to long. Check
errors from bfd_get_symtab_upper_bound and
bfd_canonicalize_symtab.
* bout.c (b_out_relax_section): Change reloc_size to long. Check
for errors from bfd_get_reloc_upper_bound and
bfd_canonicalize_reloc.
(b_out_get_relocated_section_contents): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
Likewise.
* elf32-mips.c: Likewise.
* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
(hppa_look_for_stubs_in_section): Check for errors from
bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
bfd_canonicalize_reloc.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
* linker.c (generic_link_read_symbols): Likewise.
(_bfd_generic_final_link): Check for errors from
bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
* libbfd.c (bfd_0l): New function.
* libbfd-in.h (bfd_0l): Declare.
* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
than bfd_0u.
* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* libcoff.h: Rebuilt.
* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
temp and name.
1994-03-30 22:15:07 +00:00
|
|
|
|
long
|
1993-11-08 23:22:49 +00:00
|
|
|
|
bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
|
|
|
|
|
|
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
get_symtab_upper_bound, bfd_canonicalize_symtab,
bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now
return long instead of unsigned int, and use -1 to indicate an
error. Along the way, rename get_symtab_upper_bound to
bfd_get_symtab_upper_bound.
* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
errors.
(bfd_canonicalize_reloc): Likewise.
* syms.c (bfd_get_symtab_upper_bound): Renamed from
get_symtab_upper_bound.
* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
_bfd_get_symtab_upper_bound, and changed it and
_bfd_canonicalize_symtab and _get_reloc_upper_bound and
_bfd_canonicalize_reloc to all return long.
* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
(NAME(aout,get_symtab_upper_bound)): Likewise.
* bout.c (b_out_canonicalize_reloc): Likewise.
(b_out_get_reloc_upper_bound): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* coffgen.c (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_get_symtab_upper_bound): Likewise.
(elf_get_reloc_upper_bound): Likewise.
(elf_canonicalize_reloc): Likewise.
(elf_get_symtab): Likewise.
* hp300hpux.c (MY(get_symtab)): Likewise.
(MY(get_symtab_upper_bound)): Likewise.
(MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* ieee.c (ieee_slurp_external_symbols): Change return type to
boolean. Check for errors from get_symbol.
(ieee_slurp_symbol_table): Change return type to boolean. Check
for errors from ieee_slurp_external_symbols.
(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
(ieee_get_symtab): Likewise.
(ieee_get_reloc_upper_bound): Likewise.
(ieee_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
(nlm_get_symtab): Likewise.
(nlm_get_reloc_upper_bound): Likewise.
(nlm_canonicalize_reloc): Likewise.
* oasys.c (oasys_get_symtab_upper_bound): Likewise.
(oasys_get_symtab): Likewise.
(oasys_get_reloc_upper_bound): Likewise.
(oasys_canonicalize_reloc): Likewise.
* som.c (som_get_symtab_upper_bound): Likewise.
(som_get_symtab): Likewise.
(som_get_reloc_upper_bound): Likewise.
(som_canonicalize_reloc): Likewise.
* srec.c (srec_get_symtab_upper_bound): Likewise.
(srec_get_symtab): Likewise.
(srec_get_reloc_upper_bound): Define as bfd_0l.
(srec_canonicalize_reloc): Likewise.
* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
(tekhex_get_symtab_upper_bound): Likewise.
(tekhex_get_reloc_upper_bound): Define as bfd_0l.
(tekhex_canonicalize_reloc): Likewise.
* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
declaration to return long.
(NAME(aout,get_symtab)): Likewise.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
(bfd_elf32_get_symtab): Likewise.
(bfd_elf32_get_reloc_upper_bound): Likewise.
(bfd_elf32_canonicalize_reloc): Likewise.
(bfd_elf64_get_symtab_upper_bound): Likewise.
(bfd_elf64_get_symtab): Likewise.
(bfd_elf64_get_reloc_upper_bound): Likewise.
(bfd_elf64_canonicalize_reloc): Likewise.
* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
(nlmNAME(get_symtab)): Likewise.
(nlmNAME(get_reloc_upper_bound)): Likewise.
(nlmNAME(canonicalize_reloc)): Likewise.
* archive.c (compute_and_write_armap): Use error_return and
no_memory_return labels rather than freeing information in various
places. Change storage, symcount and src_count to long. Check
errors from bfd_get_symtab_upper_bound and
bfd_canonicalize_symtab.
* bout.c (b_out_relax_section): Change reloc_size to long. Check
for errors from bfd_get_reloc_upper_bound and
bfd_canonicalize_reloc.
(b_out_get_relocated_section_contents): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
Likewise.
* elf32-mips.c: Likewise.
* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
(hppa_look_for_stubs_in_section): Check for errors from
bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
bfd_canonicalize_reloc.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
* linker.c (generic_link_read_symbols): Likewise.
(_bfd_generic_final_link): Check for errors from
bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
* libbfd.c (bfd_0l): New function.
* libbfd-in.h (bfd_0l): Declare.
* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
than bfd_0u.
* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* libcoff.h: Rebuilt.
* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
temp and name.
1994-03-30 22:15:07 +00:00
|
|
|
|
long
|
1993-11-08 23:22:49 +00:00
|
|
|
|
bfd_canonicalize_reloc
|
|
|
|
|
PARAMS ((bfd *abfd,
|
|
|
|
|
asection *sec,
|
|
|
|
|
arelent **loc,
|
1998-01-26 20:43:50 +00:00
|
|
|
|
asymbol **syms));
|
1993-11-08 23:22:49 +00:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_set_reloc
|
|
|
|
|
PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags));
|
|
|
|
|
|
|
|
|
|
boolean
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
long
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_get_mtime PARAMS ((bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
long
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_get_size PARAMS ((bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
int
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_get_gp_size PARAMS ((bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
void
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_set_gp_size PARAMS ((bfd *abfd, int i));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1993-08-09 19:25:56 +00:00
|
|
|
|
bfd_vma
|
|
|
|
|
bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
|
|
|
|
|
|
1994-03-17 23:47:00 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
|
|
|
|
|
|
|
|
|
|
#define bfd_copy_private_bfd_data(ibfd, obfd) \
|
1996-10-03 03:56:20 +00:00
|
|
|
|
BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
(ibfd, obfd))
|
1995-06-09 19:16:33 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
|
|
|
|
|
|
|
|
|
|
#define bfd_merge_private_bfd_data(ibfd, obfd) \
|
1996-10-03 03:56:20 +00:00
|
|
|
|
BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
(ibfd, obfd))
|
1995-06-09 19:16:33 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
|
|
|
|
|
|
|
|
|
|
#define bfd_set_private_flags(abfd, flags) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_set_private_flags, \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
(abfd, flags))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_sizeof_headers(abfd, reloc) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
|
|
|
|
|
|
|
|
|
|
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
|
|
|
|
|
|
|
|
|
|
/* Do these three do anything useful at all, for any back end? */
|
|
|
|
|
#define bfd_debug_info_start(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
|
|
|
|
|
|
|
|
|
|
#define bfd_debug_info_end(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
|
|
|
|
|
|
|
|
|
|
#define bfd_debug_info_accumulate(abfd, section) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define bfd_stat_arch_elt(abfd, stat) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
|
|
|
|
|
|
1994-08-30 16:04:40 +00:00
|
|
|
|
#define bfd_update_armap_timestamp(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define bfd_set_arch_mach(abfd, arch, mach)\
|
|
|
|
|
BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
|
|
|
|
|
|
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
get_symtab_upper_bound, bfd_canonicalize_symtab,
bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now
return long instead of unsigned int, and use -1 to indicate an
error. Along the way, rename get_symtab_upper_bound to
bfd_get_symtab_upper_bound.
* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
errors.
(bfd_canonicalize_reloc): Likewise.
* syms.c (bfd_get_symtab_upper_bound): Renamed from
get_symtab_upper_bound.
* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
_bfd_get_symtab_upper_bound, and changed it and
_bfd_canonicalize_symtab and _get_reloc_upper_bound and
_bfd_canonicalize_reloc to all return long.
* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
(NAME(aout,get_symtab_upper_bound)): Likewise.
* bout.c (b_out_canonicalize_reloc): Likewise.
(b_out_get_reloc_upper_bound): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* coffgen.c (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_get_symtab_upper_bound): Likewise.
(elf_get_reloc_upper_bound): Likewise.
(elf_canonicalize_reloc): Likewise.
(elf_get_symtab): Likewise.
* hp300hpux.c (MY(get_symtab)): Likewise.
(MY(get_symtab_upper_bound)): Likewise.
(MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* ieee.c (ieee_slurp_external_symbols): Change return type to
boolean. Check for errors from get_symbol.
(ieee_slurp_symbol_table): Change return type to boolean. Check
for errors from ieee_slurp_external_symbols.
(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
(ieee_get_symtab): Likewise.
(ieee_get_reloc_upper_bound): Likewise.
(ieee_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
(nlm_get_symtab): Likewise.
(nlm_get_reloc_upper_bound): Likewise.
(nlm_canonicalize_reloc): Likewise.
* oasys.c (oasys_get_symtab_upper_bound): Likewise.
(oasys_get_symtab): Likewise.
(oasys_get_reloc_upper_bound): Likewise.
(oasys_canonicalize_reloc): Likewise.
* som.c (som_get_symtab_upper_bound): Likewise.
(som_get_symtab): Likewise.
(som_get_reloc_upper_bound): Likewise.
(som_canonicalize_reloc): Likewise.
* srec.c (srec_get_symtab_upper_bound): Likewise.
(srec_get_symtab): Likewise.
(srec_get_reloc_upper_bound): Define as bfd_0l.
(srec_canonicalize_reloc): Likewise.
* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
(tekhex_get_symtab_upper_bound): Likewise.
(tekhex_get_reloc_upper_bound): Define as bfd_0l.
(tekhex_canonicalize_reloc): Likewise.
* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
declaration to return long.
(NAME(aout,get_symtab)): Likewise.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
(bfd_elf32_get_symtab): Likewise.
(bfd_elf32_get_reloc_upper_bound): Likewise.
(bfd_elf32_canonicalize_reloc): Likewise.
(bfd_elf64_get_symtab_upper_bound): Likewise.
(bfd_elf64_get_symtab): Likewise.
(bfd_elf64_get_reloc_upper_bound): Likewise.
(bfd_elf64_canonicalize_reloc): Likewise.
* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
(nlmNAME(get_symtab)): Likewise.
(nlmNAME(get_reloc_upper_bound)): Likewise.
(nlmNAME(canonicalize_reloc)): Likewise.
* archive.c (compute_and_write_armap): Use error_return and
no_memory_return labels rather than freeing information in various
places. Change storage, symcount and src_count to long. Check
errors from bfd_get_symtab_upper_bound and
bfd_canonicalize_symtab.
* bout.c (b_out_relax_section): Change reloc_size to long. Check
for errors from bfd_get_reloc_upper_bound and
bfd_canonicalize_reloc.
(b_out_get_relocated_section_contents): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
Likewise.
* elf32-mips.c: Likewise.
* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
(hppa_look_for_stubs_in_section): Check for errors from
bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
bfd_canonicalize_reloc.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
* linker.c (generic_link_read_symbols): Likewise.
(_bfd_generic_final_link): Check for errors from
bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
* libbfd.c (bfd_0l): New function.
* libbfd-in.h (bfd_0l): Declare.
* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
than bfd_0u.
* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* libcoff.h: Rebuilt.
* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
temp and name.
1994-03-30 22:15:07 +00:00
|
|
|
|
#define bfd_relax_section(abfd, section, link_info, again) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
|
1998-06-30 10:02:22 +00:00
|
|
|
|
#define bfd_gc_sections(abfd, link_info) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
|
|
|
|
|
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
#define bfd_link_hash_table_create(abfd) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_link_add_symbols(abfd, info) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_final_link(abfd, info) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_final_link, (abfd, info))
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-04-01 17:55:47 +00:00
|
|
|
|
#define bfd_free_cached_info(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
|
|
|
|
|
|
1994-04-07 01:48:51 +00:00
|
|
|
|
#define bfd_get_dynamic_symtab_upper_bound(abfd) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
|
1994-04-07 01:48:51 +00:00
|
|
|
|
|
1995-08-31 23:33:37 +00:00
|
|
|
|
#define bfd_print_private_bfd_data(abfd, file)\
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
|
1995-08-31 23:33:37 +00:00
|
|
|
|
|
1994-04-07 01:48:51 +00:00
|
|
|
|
#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
|
1994-04-07 01:48:51 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_get_dynamic_reloc_upper_bound(abfd) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
|
1994-04-07 01:48:51 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
|
1998-01-26 20:43:50 +00:00
|
|
|
|
BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
|
1994-04-07 01:48:51 +00:00
|
|
|
|
|
1995-06-09 19:16:33 +00:00
|
|
|
|
extern bfd_byte *bfd_get_relocated_section_contents
|
1998-01-26 20:43:50 +00:00
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *,
|
|
|
|
|
struct bfd_link_order *, bfd_byte *,
|
|
|
|
|
boolean, asymbol **));
|
1995-06-09 19:16:33 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
symindex
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head));
|
|
|
|
|
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd *
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous));
|
|
|
|
|
|
|
|
|
|
CONST char *
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_core_file_failing_command PARAMS ((bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
int
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_core_file_failing_signal PARAMS ((bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
core_file_matches_executable_p
|
|
|
|
|
PARAMS ((bfd *core_bfd, bfd *exec_bfd));
|
|
|
|
|
|
|
|
|
|
#define BFD_SEND(bfd, message, arglist) \
|
|
|
|
|
((*((bfd)->xvec->message)) arglist)
|
1994-02-27 23:45:18 +00:00
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_BFD_SEND
|
|
|
|
|
#undef BFD_SEND
|
|
|
|
|
#define BFD_SEND(bfd, message, arglist) \
|
|
|
|
|
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
|
|
|
|
|
((*((bfd)->xvec->message)) arglist) : \
|
|
|
|
|
(bfd_assert (__FILE__,__LINE__), NULL))
|
|
|
|
|
#endif
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#define BFD_SEND_FMT(bfd, message, arglist) \
|
|
|
|
|
(((bfd)->xvec->message[(int)((bfd)->format)]) arglist)
|
1994-02-27 23:45:18 +00:00
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_BFD_SEND
|
|
|
|
|
#undef BFD_SEND_FMT
|
|
|
|
|
#define BFD_SEND_FMT(bfd, message, arglist) \
|
|
|
|
|
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
|
|
|
|
|
(((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \
|
|
|
|
|
(bfd_assert (__FILE__,__LINE__), NULL))
|
|
|
|
|
#endif
|
1993-10-31 18:59:59 +00:00
|
|
|
|
enum bfd_flavour {
|
|
|
|
|
bfd_target_unknown_flavour,
|
|
|
|
|
bfd_target_aout_flavour,
|
|
|
|
|
bfd_target_coff_flavour,
|
|
|
|
|
bfd_target_ecoff_flavour,
|
|
|
|
|
bfd_target_elf_flavour,
|
|
|
|
|
bfd_target_ieee_flavour,
|
|
|
|
|
bfd_target_nlm_flavour,
|
|
|
|
|
bfd_target_oasys_flavour,
|
|
|
|
|
bfd_target_tekhex_flavour,
|
|
|
|
|
bfd_target_srec_flavour,
|
1995-12-02 02:00:08 +00:00
|
|
|
|
bfd_target_ihex_flavour,
|
1994-03-02 02:36:07 +00:00
|
|
|
|
bfd_target_som_flavour,
|
1995-02-06 08:31:27 +00:00
|
|
|
|
bfd_target_os9k_flavour,
|
1995-07-03 22:16:40 +00:00
|
|
|
|
bfd_target_versados_flavour,
|
Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
Added support for Alpha OpenVMS:
* evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
* evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
* config.h-vms, makefile.vms: New files.
* config.bfd (alpha-*-*vms*): New target.
* configure.in (evax_alpha_vec): New target vector.
* configure: Rebuild.
* reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
(BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
* targets.c (bfd_target_evax_flavour): Define.
(evax_alpha_vec): Declare.
(bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
if BFD64 is defined.
* bfd-in2.h, libbfd.h: Rebuild.
* Makefile.in: Rebuild dependencies.
(BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
evax-emh.o, and evax-misc.o.
(BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
evax-etir.c, evax-emh.c, and evax-misc.c.
(HFILES): Add evax.h.
1996-06-18 19:07:51 +00:00
|
|
|
|
bfd_target_msdos_flavour,
|
1998-07-22 20:58:50 +00:00
|
|
|
|
bfd_target_ovax_flavour,
|
Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
Added support for Alpha OpenVMS:
* evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
* evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
* config.h-vms, makefile.vms: New files.
* config.bfd (alpha-*-*vms*): New target.
* configure.in (evax_alpha_vec): New target vector.
* configure: Rebuild.
* reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
(BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
* targets.c (bfd_target_evax_flavour): Define.
(evax_alpha_vec): Declare.
(bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
if BFD64 is defined.
* bfd-in2.h, libbfd.h: Rebuild.
* Makefile.in: Rebuild dependencies.
(BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
evax-emh.o, and evax-misc.o.
(BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
evax-etir.c, evax-emh.c, and evax-misc.c.
(HFILES): Add evax.h.
1996-06-18 19:07:51 +00:00
|
|
|
|
bfd_target_evax_flavour
|
1995-02-06 08:31:27 +00:00
|
|
|
|
};
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
|
|
|
|
|
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
/* Forward declaration. */
|
|
|
|
|
typedef struct bfd_link_info _bfd_link_info;
|
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
typedef struct bfd_target
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
1993-10-31 18:59:59 +00:00
|
|
|
|
enum bfd_flavour flavour;
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
enum bfd_endian byteorder;
|
|
|
|
|
enum bfd_endian header_byteorder;
|
1993-06-16 02:25:53 +00:00
|
|
|
|
flagword object_flags;
|
|
|
|
|
flagword section_flags;
|
|
|
|
|
char symbol_leading_char;
|
|
|
|
|
char ar_pad_char;
|
|
|
|
|
unsigned short ar_max_namelen;
|
* bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* bfd-in2.h: Rebuilt.
* libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* targets.c (bfd_target): Change swap function pointers
accordingly.
* archive.c (do_slurp_coff_armap): Change swap accordingly.
* aix386-core.c: Change NO_GET and NO_GETS accordingly.
* hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
accordingly.
1994-01-03 21:28:43 +00:00
|
|
|
|
bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *));
|
|
|
|
|
bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
* bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* bfd-in2.h: Rebuilt.
* libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* targets.c (bfd_target): Change swap function pointers
accordingly.
* archive.c (do_slurp_coff_armap): Change swap accordingly.
* aix386-core.c: Change NO_GET and NO_GETS accordingly.
* hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
accordingly.
1994-01-03 21:28:43 +00:00
|
|
|
|
bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));
|
|
|
|
|
bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
* bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* bfd-in2.h: Rebuilt.
* libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* targets.c (bfd_target): Change swap function pointers
accordingly.
* archive.c (do_slurp_coff_armap): Change swap accordingly.
* aix386-core.c: Change NO_GET and NO_GETS accordingly.
* hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
accordingly.
1994-01-03 21:28:43 +00:00
|
|
|
|
bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));
|
|
|
|
|
bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
* bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* bfd-in2.h: Rebuilt.
* libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* targets.c (bfd_target): Change swap function pointers
accordingly.
* archive.c (do_slurp_coff_armap): Change swap accordingly.
* aix386-core.c: Change NO_GET and NO_GETS accordingly.
* hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
accordingly.
1994-01-03 21:28:43 +00:00
|
|
|
|
bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *));
|
|
|
|
|
bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
* bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* bfd-in2.h: Rebuilt.
* libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* targets.c (bfd_target): Change swap function pointers
accordingly.
* archive.c (do_slurp_coff_armap): Change swap accordingly.
* aix386-core.c: Change NO_GET and NO_GETS accordingly.
* hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
accordingly.
1994-01-03 21:28:43 +00:00
|
|
|
|
bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));
|
|
|
|
|
bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
* bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* bfd-in2.h: Rebuilt.
* libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
be a const pointer.
* targets.c (bfd_target): Change swap function pointers
accordingly.
* archive.c (do_slurp_coff_armap): Change swap accordingly.
* aix386-core.c: Change NO_GET and NO_GETS accordingly.
* hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
accordingly.
1994-01-03 21:28:43 +00:00
|
|
|
|
bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));
|
|
|
|
|
bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
1994-06-20 21:55:45 +00:00
|
|
|
|
const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
|
|
|
|
|
boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
|
|
|
|
|
/* Generic entry points. */
|
|
|
|
|
#define BFD_JUMP_TABLE_GENERIC(NAME)\
|
|
|
|
|
CAT(NAME,_close_and_cleanup),\
|
|
|
|
|
CAT(NAME,_bfd_free_cached_info),\
|
|
|
|
|
CAT(NAME,_new_section_hook),\
|
1995-11-06 10:08:03 +00:00
|
|
|
|
CAT(NAME,_get_section_contents),\
|
|
|
|
|
CAT(NAME,_get_section_contents_in_window)
|
|
|
|
|
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Called when the BFD is being closed to do any necessary cleanup. */
|
|
|
|
|
boolean (*_close_and_cleanup) PARAMS ((bfd *));
|
|
|
|
|
/* Ask the BFD to free all cached information. */
|
|
|
|
|
boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
|
|
|
|
|
/* Called when a new section is created. */
|
|
|
|
|
boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
|
|
|
|
|
/* Read the contents of a section. */
|
|
|
|
|
boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
|
|
|
|
|
file_ptr, bfd_size_type));
|
1995-11-06 10:08:03 +00:00
|
|
|
|
boolean (*_bfd_get_section_contents_in_window)
|
|
|
|
|
PARAMS ((bfd *, sec_ptr, bfd_window *,
|
|
|
|
|
file_ptr, bfd_size_type));
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
|
|
|
|
|
/* Entry points to copy private data. */
|
|
|
|
|
#define BFD_JUMP_TABLE_COPY(NAME)\
|
|
|
|
|
CAT(NAME,_bfd_copy_private_bfd_data),\
|
1995-06-09 19:16:33 +00:00
|
|
|
|
CAT(NAME,_bfd_merge_private_bfd_data),\
|
|
|
|
|
CAT(NAME,_bfd_copy_private_section_data),\
|
1995-06-10 00:05:51 +00:00
|
|
|
|
CAT(NAME,_bfd_copy_private_symbol_data),\
|
1995-08-31 23:33:37 +00:00
|
|
|
|
CAT(NAME,_bfd_set_private_flags),\
|
|
|
|
|
CAT(NAME,_bfd_print_private_bfd_data)\
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Called to copy BFD general private data from one object file
|
|
|
|
|
to another. */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
|
1995-06-09 19:16:33 +00:00
|
|
|
|
/* Called to merge BFD general private data from one object file
|
|
|
|
|
to a common output file when linking. */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Called to copy BFD private section data from one object file
|
|
|
|
|
to another. */
|
|
|
|
|
boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
|
|
|
|
|
bfd *, sec_ptr));
|
1995-06-10 00:05:51 +00:00
|
|
|
|
/* Called to copy BFD private symbol data from one symbol
|
|
|
|
|
to another. */
|
|
|
|
|
boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
|
1998-01-26 20:43:50 +00:00
|
|
|
|
bfd *, asymbol *));
|
1995-06-09 19:16:33 +00:00
|
|
|
|
/* Called to set private backend flags */
|
1998-01-26 20:43:50 +00:00
|
|
|
|
boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
|
1995-08-31 23:33:37 +00:00
|
|
|
|
/* Called to print private BFD data */
|
1995-12-01 21:45:33 +00:00
|
|
|
|
boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
|
1995-08-31 23:33:37 +00:00
|
|
|
|
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Core file entry points. */
|
|
|
|
|
#define BFD_JUMP_TABLE_CORE(NAME)\
|
|
|
|
|
CAT(NAME,_core_file_failing_command),\
|
|
|
|
|
CAT(NAME,_core_file_failing_signal),\
|
|
|
|
|
CAT(NAME,_core_file_matches_executable_p)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
char * (*_core_file_failing_command) PARAMS ((bfd *));
|
|
|
|
|
int (*_core_file_failing_signal) PARAMS ((bfd *));
|
|
|
|
|
boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
|
|
|
|
|
/* Archive entry points. */
|
|
|
|
|
#define BFD_JUMP_TABLE_ARCHIVE(NAME)\
|
|
|
|
|
CAT(NAME,_slurp_armap),\
|
|
|
|
|
CAT(NAME,_slurp_extended_name_table),\
|
1994-11-17 22:46:22 +00:00
|
|
|
|
CAT(NAME,_construct_extended_name_table),\
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
CAT(NAME,_truncate_arname),\
|
|
|
|
|
CAT(NAME,_write_armap),\
|
1995-10-06 16:15:35 +00:00
|
|
|
|
CAT(NAME,_read_ar_hdr),\
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
CAT(NAME,_openr_next_archived_file),\
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
CAT(NAME,_get_elt_at_index),\
|
1994-08-30 16:04:40 +00:00
|
|
|
|
CAT(NAME,_generic_stat_arch_elt),\
|
|
|
|
|
CAT(NAME,_update_armap_timestamp)
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
|
|
|
|
|
boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
|
1994-11-17 22:46:22 +00:00
|
|
|
|
boolean (*_bfd_construct_extended_name_table)
|
|
|
|
|
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
|
|
|
|
|
boolean (*write_armap) PARAMS ((bfd *arch,
|
|
|
|
|
unsigned int elength,
|
|
|
|
|
struct orl *map,
|
|
|
|
|
unsigned int orl_count,
|
|
|
|
|
int stridx));
|
1995-10-09 15:29:04 +00:00
|
|
|
|
PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
|
1994-08-30 16:04:40 +00:00
|
|
|
|
bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
|
Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* coff-alpha.c (alpha_relocate_section): During final link, allow
output .lita section to be bigger than 64k by adjusting gp value
on a per-input section basis.
* libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
field.
(struct ecoff_section_tdata): Add gp field.
Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
Handle Alpha ECOFF changes in OSF/1 3.2.
* libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
field.
* coff-alpha.c: Include "aout/ar.h".
(alpha_ecoff_get_relocated_section_contents): Don't require an
ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
3.2 doesn't generate one.
(alpha_relocate_section): Likewise.
(alpha_ecoff_slurp_armap): Define.
(alpha_ecoff_slurp_extended_name_table): Define.
(alpha_ecoff_construct_extended_name_table): Define.
(alpha_ecoff_truncate_arname): Define.
(alpha_ecoff_write_armap): Define.
(alpha_ecoff_generic_stat_arch_elt): Define.
(alpha_ecoff_update_armap_timestamp): Define.
(ARFZMAG): Define.
(alpha_ecoff_read_ar_hdr): New static function.
(alpha_ecoff_get_elt_at_filepos): New static function.
(alpha_ecoff_openr_next_archived_file): New static function.
(alpha_ecoff_get_elt_at_index): New static function.
(alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
(ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
_bfd_ecoff to alpha_ecoff.
* ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
field from backend structure, rather than always calling
_bfd_get_elt_at_filepos.
* coff-mips.c (mips_ecoff_backend_data): Initialize
get_elt_at_filepos field.
* archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
from _bfd_generic_read_ar_hdr with minor changes.
(_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
* libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
* libbfd.h: Rebuild.
* bfd-in.h (BFD_IN_MEMORY): Define.
* libbfd-in.h (struct bfd_in_memory): Define.
* libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
(bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
(bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
(bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
* bfd.c (struct _bfd): Change iostream field from char * to PTR.
(bfd_get_size): Handle BFD_IN_MEMORY flag.
* cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
(bfd_open_file): Cast to PTR, not char *, when setting iostream.
(bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
* opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
iostream.
(bfd_openstreamr): Likewise.
* aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
BFD_IN_MEMORY is not set.
* riscix.c (riscix_some_aout_object_p): Likewise.
* bfd-in2.h, libbfd.h: Rebuild.
* targets.c (bfd_target): Add _bfd_get_elt_at_index field.
(BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
(bfd_get_elt_at_index): Define.
* archive.c (_bfd_generic_get_elt_at_index): Rename from
bfd_get_elt_at_index. Change index parameter from int to
symindex.
* libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
(_bfd_noarchive_get_elt_at_index): Define.
(_bfd_archive_bsd_get_elt_at_index): Define.
(_bfd_archive_coff_get_elt_at_index): Define.
* bfd-in2.h, libbfd.h: Rebuild.
* aout-target.h (MY_get_elt_at_index): Define if not defined.
* coff-rs6000.c (xcoff_get_elt_at_index): Define.
* ieee.c (ieee_get_elt_at_index): Define.
* libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
* oasys.c (oasys_get_elt_at_index): Define.
* som.c (som_get_elt_at_index): Define.
1996-01-09 20:40:39 +00:00
|
|
|
|
#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))
|
|
|
|
|
bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
|
1994-08-30 16:04:40 +00:00
|
|
|
|
int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
|
|
|
|
|
boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
|
|
|
|
|
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Entry points used for symbols. */
|
|
|
|
|
#define BFD_JUMP_TABLE_SYMBOLS(NAME)\
|
|
|
|
|
CAT(NAME,_get_symtab_upper_bound),\
|
|
|
|
|
CAT(NAME,_get_symtab),\
|
|
|
|
|
CAT(NAME,_make_empty_symbol),\
|
|
|
|
|
CAT(NAME,_print_symbol),\
|
|
|
|
|
CAT(NAME,_get_symbol_info),\
|
1997-02-28 02:07:54 +00:00
|
|
|
|
CAT(NAME,_bfd_is_local_label_name),\
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
CAT(NAME,_get_lineno),\
|
|
|
|
|
CAT(NAME,_find_nearest_line),\
|
1995-08-22 01:02:23 +00:00
|
|
|
|
CAT(NAME,_bfd_make_debug_symbol),\
|
|
|
|
|
CAT(NAME,_read_minisymbols),\
|
|
|
|
|
CAT(NAME,_minisymbol_to_symbol)
|
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
get_symtab_upper_bound, bfd_canonicalize_symtab,
bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now
return long instead of unsigned int, and use -1 to indicate an
error. Along the way, rename get_symtab_upper_bound to
bfd_get_symtab_upper_bound.
* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
errors.
(bfd_canonicalize_reloc): Likewise.
* syms.c (bfd_get_symtab_upper_bound): Renamed from
get_symtab_upper_bound.
* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
_bfd_get_symtab_upper_bound, and changed it and
_bfd_canonicalize_symtab and _get_reloc_upper_bound and
_bfd_canonicalize_reloc to all return long.
* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
(NAME(aout,get_symtab_upper_bound)): Likewise.
* bout.c (b_out_canonicalize_reloc): Likewise.
(b_out_get_reloc_upper_bound): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* coffgen.c (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_get_symtab_upper_bound): Likewise.
(elf_get_reloc_upper_bound): Likewise.
(elf_canonicalize_reloc): Likewise.
(elf_get_symtab): Likewise.
* hp300hpux.c (MY(get_symtab)): Likewise.
(MY(get_symtab_upper_bound)): Likewise.
(MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* ieee.c (ieee_slurp_external_symbols): Change return type to
boolean. Check for errors from get_symbol.
(ieee_slurp_symbol_table): Change return type to boolean. Check
for errors from ieee_slurp_external_symbols.
(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
(ieee_get_symtab): Likewise.
(ieee_get_reloc_upper_bound): Likewise.
(ieee_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
(nlm_get_symtab): Likewise.
(nlm_get_reloc_upper_bound): Likewise.
(nlm_canonicalize_reloc): Likewise.
* oasys.c (oasys_get_symtab_upper_bound): Likewise.
(oasys_get_symtab): Likewise.
(oasys_get_reloc_upper_bound): Likewise.
(oasys_canonicalize_reloc): Likewise.
* som.c (som_get_symtab_upper_bound): Likewise.
(som_get_symtab): Likewise.
(som_get_reloc_upper_bound): Likewise.
(som_canonicalize_reloc): Likewise.
* srec.c (srec_get_symtab_upper_bound): Likewise.
(srec_get_symtab): Likewise.
(srec_get_reloc_upper_bound): Define as bfd_0l.
(srec_canonicalize_reloc): Likewise.
* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
(tekhex_get_symtab_upper_bound): Likewise.
(tekhex_get_reloc_upper_bound): Define as bfd_0l.
(tekhex_canonicalize_reloc): Likewise.
* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
declaration to return long.
(NAME(aout,get_symtab)): Likewise.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
(bfd_elf32_get_symtab): Likewise.
(bfd_elf32_get_reloc_upper_bound): Likewise.
(bfd_elf32_canonicalize_reloc): Likewise.
(bfd_elf64_get_symtab_upper_bound): Likewise.
(bfd_elf64_get_symtab): Likewise.
(bfd_elf64_get_reloc_upper_bound): Likewise.
(bfd_elf64_canonicalize_reloc): Likewise.
* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
(nlmNAME(get_symtab)): Likewise.
(nlmNAME(get_reloc_upper_bound)): Likewise.
(nlmNAME(canonicalize_reloc)): Likewise.
* archive.c (compute_and_write_armap): Use error_return and
no_memory_return labels rather than freeing information in various
places. Change storage, symcount and src_count to long. Check
errors from bfd_get_symtab_upper_bound and
bfd_canonicalize_symtab.
* bout.c (b_out_relax_section): Change reloc_size to long. Check
for errors from bfd_get_reloc_upper_bound and
bfd_canonicalize_reloc.
(b_out_get_relocated_section_contents): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
Likewise.
* elf32-mips.c: Likewise.
* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
(hppa_look_for_stubs_in_section): Check for errors from
bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
bfd_canonicalize_reloc.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
* linker.c (generic_link_read_symbols): Likewise.
(_bfd_generic_final_link): Check for errors from
bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
* libbfd.c (bfd_0l): New function.
* libbfd-in.h (bfd_0l): Declare.
* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
than bfd_0u.
* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* libcoff.h: Rebuilt.
* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
temp and name.
1994-03-30 22:15:07 +00:00
|
|
|
|
long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
|
|
|
|
|
long (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
|
|
|
|
|
struct symbol_cache_entry **));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
struct symbol_cache_entry *
|
|
|
|
|
(*_bfd_make_empty_symbol) PARAMS ((bfd *));
|
|
|
|
|
void (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
|
|
|
|
|
struct symbol_cache_entry *,
|
|
|
|
|
bfd_print_symbol_type));
|
|
|
|
|
#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
|
|
|
|
|
void (*_bfd_get_symbol_info) PARAMS ((bfd *,
|
|
|
|
|
struct symbol_cache_entry *,
|
|
|
|
|
symbol_info *));
|
|
|
|
|
#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
|
1998-01-26 20:43:50 +00:00
|
|
|
|
boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
|
|
|
|
|
struct sec *section, struct symbol_cache_entry **symbols,
|
|
|
|
|
bfd_vma offset, CONST char **file, CONST char **func,
|
|
|
|
|
unsigned int *line));
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Back-door to allow format-aware applications to create debug symbols
|
|
|
|
|
while using BFD for everything else. Currently used by the assembler
|
|
|
|
|
when creating COFF files. */
|
1995-08-22 01:02:23 +00:00
|
|
|
|
asymbol * (*_bfd_make_debug_symbol) PARAMS ((
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
bfd *abfd,
|
|
|
|
|
void *ptr,
|
|
|
|
|
unsigned long size));
|
1995-08-22 01:02:23 +00:00
|
|
|
|
#define bfd_read_minisymbols(b, d, m, s) \
|
|
|
|
|
BFD_SEND (b, _read_minisymbols, (b, d, m, s))
|
|
|
|
|
long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,
|
|
|
|
|
unsigned int *));
|
|
|
|
|
#define bfd_minisymbol_to_symbol(b, d, m, f) \
|
|
|
|
|
BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
|
|
|
|
|
asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
|
|
|
|
|
asymbol *));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Routines for relocs. */
|
|
|
|
|
#define BFD_JUMP_TABLE_RELOCS(NAME)\
|
|
|
|
|
CAT(NAME,_get_reloc_upper_bound),\
|
|
|
|
|
CAT(NAME,_canonicalize_reloc),\
|
|
|
|
|
CAT(NAME,_bfd_reloc_type_lookup)
|
|
|
|
|
long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
|
|
|
|
|
long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
|
|
|
|
|
struct symbol_cache_entry **));
|
|
|
|
|
/* See documentation on reloc types. */
|
1995-02-06 08:31:27 +00:00
|
|
|
|
reloc_howto_type *
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
(*reloc_type_lookup) PARAMS ((bfd *abfd,
|
|
|
|
|
bfd_reloc_code_real_type code));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Routines used when writing an object file. */
|
|
|
|
|
#define BFD_JUMP_TABLE_WRITE(NAME)\
|
|
|
|
|
CAT(NAME,_set_arch_mach),\
|
|
|
|
|
CAT(NAME,_set_section_contents)
|
|
|
|
|
boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
|
|
|
|
|
unsigned long));
|
|
|
|
|
boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
|
|
|
|
|
file_ptr, bfd_size_type));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
/* Routines used by the linker. */
|
|
|
|
|
#define BFD_JUMP_TABLE_LINK(NAME)\
|
|
|
|
|
CAT(NAME,_sizeof_headers),\
|
|
|
|
|
CAT(NAME,_bfd_get_relocated_section_contents),\
|
|
|
|
|
CAT(NAME,_bfd_relax_section),\
|
|
|
|
|
CAT(NAME,_bfd_link_hash_table_create),\
|
|
|
|
|
CAT(NAME,_bfd_link_add_symbols),\
|
1995-06-10 00:05:51 +00:00
|
|
|
|
CAT(NAME,_bfd_final_link),\
|
1998-06-30 10:02:22 +00:00
|
|
|
|
CAT(NAME,_bfd_link_split_section),\
|
|
|
|
|
CAT(NAME,_bfd_gc_sections)
|
* targets.c (bfd_target): Rearranged fields in target vector.
Removed _bfd_debug_info_start, _bfd_debug_info_end and
_bfd_debug_info_accumulate, which were never used.
(BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
(BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
(BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
(BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
* All backends: Changed to use the new BFD_JUMP_TABLE_* macros
rather than the single JUMP_TABLE macro. Removed many of the
weird macro definitions needed to support the monolithic
JUMP_TABLE.
* bfd-in.h (JUMP_TABLE): Removed.
* libbfd-in.h: Define a bunch of macros, and declare a few
functions, for use with the new BFD_JUMP_TABLE_* macros.
* libbfd.c (_bfd_dummy_new_section_hook): Removed.
(bfd_false): Set bfd_error_invalid_operation.
(bfd_nullvoidptr): Likewise.
(bfd_n1): New function.
(_bfd_nocore_core_file_matches_executable_p): Renamed from
_bfd_dummy_core_file_matches_executable_p.
(_bfd_nocore_core_file_failing_command): Similar rename. Set
bfd_error_invalid_operation.
(_bfd_nocore_core_file_failing_signal): Likewise.
(_bfd_generic_get_section_contents): Renamed from
bfd_generic_get_section_contents. Changed all callers.
(_bfd_generic_set_section_contents): Similar rename.
* ieee.c: #if 0 out ieee_bfd_debug_info_start,
ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They
were never called.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
1994-04-06 22:00:40 +00:00
|
|
|
|
int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
struct bfd_link_info *, struct bfd_link_order *,
|
|
|
|
|
bfd_byte *data, boolean relocateable,
|
|
|
|
|
struct symbol_cache_entry **));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
|
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
get_symtab_upper_bound, bfd_canonicalize_symtab,
bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now
return long instead of unsigned int, and use -1 to indicate an
error. Along the way, rename get_symtab_upper_bound to
bfd_get_symtab_upper_bound.
* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
errors.
(bfd_canonicalize_reloc): Likewise.
* syms.c (bfd_get_symtab_upper_bound): Renamed from
get_symtab_upper_bound.
* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
_bfd_get_symtab_upper_bound, and changed it and
_bfd_canonicalize_symtab and _get_reloc_upper_bound and
_bfd_canonicalize_reloc to all return long.
* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
(NAME(aout,get_symtab_upper_bound)): Likewise.
* bout.c (b_out_canonicalize_reloc): Likewise.
(b_out_get_reloc_upper_bound): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* coffgen.c (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_get_symtab_upper_bound): Likewise.
(elf_get_reloc_upper_bound): Likewise.
(elf_canonicalize_reloc): Likewise.
(elf_get_symtab): Likewise.
* hp300hpux.c (MY(get_symtab)): Likewise.
(MY(get_symtab_upper_bound)): Likewise.
(MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* ieee.c (ieee_slurp_external_symbols): Change return type to
boolean. Check for errors from get_symbol.
(ieee_slurp_symbol_table): Change return type to boolean. Check
for errors from ieee_slurp_external_symbols.
(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
(ieee_get_symtab): Likewise.
(ieee_get_reloc_upper_bound): Likewise.
(ieee_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
(nlm_get_symtab): Likewise.
(nlm_get_reloc_upper_bound): Likewise.
(nlm_canonicalize_reloc): Likewise.
* oasys.c (oasys_get_symtab_upper_bound): Likewise.
(oasys_get_symtab): Likewise.
(oasys_get_reloc_upper_bound): Likewise.
(oasys_canonicalize_reloc): Likewise.
* som.c (som_get_symtab_upper_bound): Likewise.
(som_get_symtab): Likewise.
(som_get_reloc_upper_bound): Likewise.
(som_canonicalize_reloc): Likewise.
* srec.c (srec_get_symtab_upper_bound): Likewise.
(srec_get_symtab): Likewise.
(srec_get_reloc_upper_bound): Define as bfd_0l.
(srec_canonicalize_reloc): Likewise.
* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
(tekhex_get_symtab_upper_bound): Likewise.
(tekhex_get_reloc_upper_bound): Define as bfd_0l.
(tekhex_canonicalize_reloc): Likewise.
* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
declaration to return long.
(NAME(aout,get_symtab)): Likewise.
(NAME(aout,canonicalize_reloc)): Likewise.
(NAME(aout,get_reloc_upper_bound)): Likewise.
* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
(coff_get_symtab): Likewise.
(coff_get_reloc_upper_bound): Likewise.
* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
(ecoff_get_symtab): Likewise.
(ecoff_canonicalize_reloc): Likewise.
* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
(bfd_elf32_get_symtab): Likewise.
(bfd_elf32_get_reloc_upper_bound): Likewise.
(bfd_elf32_canonicalize_reloc): Likewise.
(bfd_elf64_get_symtab_upper_bound): Likewise.
(bfd_elf64_get_symtab): Likewise.
(bfd_elf64_get_reloc_upper_bound): Likewise.
(bfd_elf64_canonicalize_reloc): Likewise.
* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
(nlmNAME(get_symtab)): Likewise.
(nlmNAME(get_reloc_upper_bound)): Likewise.
(nlmNAME(canonicalize_reloc)): Likewise.
* archive.c (compute_and_write_armap): Use error_return and
no_memory_return labels rather than freeing information in various
places. Change storage, symcount and src_count to long. Check
errors from bfd_get_symtab_upper_bound and
bfd_canonicalize_symtab.
* bout.c (b_out_relax_section): Change reloc_size to long. Check
for errors from bfd_get_reloc_upper_bound and
bfd_canonicalize_reloc.
(b_out_get_relocated_section_contents): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
Likewise.
* elf32-mips.c: Likewise.
* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
(hppa_look_for_stubs_in_section): Check for errors from
bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
bfd_canonicalize_reloc.
* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
* linker.c (generic_link_read_symbols): Likewise.
(_bfd_generic_final_link): Check for errors from
bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
* libbfd.c (bfd_0l): New function.
* libbfd-in.h (bfd_0l): Declare.
* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
than bfd_0u.
* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* libcoff.h: Rebuilt.
* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
temp and name.
1994-03-30 22:15:07 +00:00
|
|
|
|
struct bfd_link_info *, boolean *again));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-04-07 01:48:51 +00:00
|
|
|
|
/* Create a hash table for the linker. Different backends store
|
|
|
|
|
different information in this table. */
|
|
|
|
|
struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
|
|
|
|
|
|
|
|
|
|
/* Add symbols from this object file into the hash table. */
|
|
|
|
|
boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
|
|
|
|
/* Do a link based on the link_order structures attached to each
|
|
|
|
|
section of the BFD. */
|
|
|
|
|
boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
1995-06-10 00:05:51 +00:00
|
|
|
|
/* Should this section be split up into smaller pieces during linking. */
|
|
|
|
|
boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
|
|
|
|
|
|
1998-06-30 10:02:22 +00:00
|
|
|
|
/* Remove sections that are not referenced from the output. */
|
|
|
|
|
boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
|
|
|
|
/* Routines to handle dynamic symbols and relocs. */
|
1994-04-07 01:48:51 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
|
|
|
|
|
CAT(NAME,_get_dynamic_symtab_upper_bound),\
|
|
|
|
|
CAT(NAME,_canonicalize_dynamic_symtab),\
|
|
|
|
|
CAT(NAME,_get_dynamic_reloc_upper_bound),\
|
|
|
|
|
CAT(NAME,_canonicalize_dynamic_reloc)
|
|
|
|
|
/* Get the amount of memory required to hold the dynamic symbols. */
|
|
|
|
|
long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
|
|
|
|
|
/* Read in the dynamic symbols. */
|
|
|
|
|
long (*_bfd_canonicalize_dynamic_symtab)
|
|
|
|
|
PARAMS ((bfd *, struct symbol_cache_entry **));
|
|
|
|
|
/* Get the amount of memory required to hold the dynamic relocs. */
|
|
|
|
|
long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
|
|
|
|
|
/* Read in the dynamic relocs. */
|
|
|
|
|
long (*_bfd_canonicalize_dynamic_reloc)
|
|
|
|
|
PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
|
Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
files. Only existing efficient backend is a.out.
* seclet.c, seclet.h: Removed.
* hash.c, linker.c, genlink.h: New files.
* bfd-in.h: Removed bfd_error_vector. Declared hash table
structures and functions.
(JUMP_TABLE): Removed bfd_seclet_link, added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* All backends: Changed accordingly.
* bfd-in2.h: Rebuilt.
* bfd.c (struct _bfd): Added link_next and archive_pass fields.
Removed ld_symbols field.
(bfd_nonrepresentable_section, bfd_undefined_symbol,
bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
bfd_error_vector): Removed.
(bfd_default_error_trap, bfd_error_trap,
bfd_error_nonrepresentabltrap): Removed.
(bfd_get_relocated_section_contents): Pass link_info. Pass
link_order instead of seclet. Pass symbols.
(bfd_relax_section): Pass link_info.
(bfd_seclet_link): Removed.
(bfd_link_hash_table_create, bfd_link_add_symbols,
bfd_final_link): New macros.
* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
alloca as __builtin_alloca. Declare internal linking functions.
* libbfd.h: Rebuilt.
* libbfd.c (bfd_seek): Comment out fseek assertion. It's worked
for months.
* reloc.c (reloc_howto_type): Added error_message argument to
special_function field. Changed all callers and all definitions.
(bfd_get_reloc_size): Make argument a const pointer.
(bfd_perform_relocation): Add error_message argument to hold
string set if return value if bfd_reloc_dangerous. Changed all
callers.
(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
* section.c (asection): Renamed seclets_head and seclets_tail to
link_order_head and link_order_tail.
* targets.c (bfd_target): Replaced seclet argument with link_info
and link_order and symbols arguments in
bfd_get_relocated_section_contents. Added symbols argument to
bfd_relax_section. Removed bfd_seclet_link. Added
bfd_link_hash_table_create, bfd_link_add_symbols and
bfd_final_link.
* libaout.h (struct aoutdata): Added external_syms,
external_sym_count, external_strings, sym_hashes fields.
(obj_aout_external_syms, obj_aout_external_sym_count,
obj_aout_external_strings, obj_aout_sym_hashes): New accessor
macros.
(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
* aoutx.h: Wrote new back end linker routines.
(translate_to_native_sym_flags): Return boolean value. Don't use
bfd_error_vector.
(NAME(aout,write_syms)): Return boolean value. Check return value
of translate_to_native_sym_flags and bfd_write.
* aout-target.h (final_link_callback): New function.
(MY_bfd_final_link): New function.
* aout-adobe.c (aout_adobe_write_object_contents): Check return
value of aout_32_write_syms.
* hp300hpux.c (MY(write_object_contents)): Likewise.
* i386lynx.c (WRITE_HEADERS): Likewise.
* libaout.h (WRITE_HEADERS): Likewise.
* bout.c: Changed functions to use link_info->callbacks rather
than bfd_error_vector, and link_orders rather than seclets.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-sh.c: Likewise.
* coff-z8k.c: Likewise.
* elf32-hppa.c: Likewise.
* reloc16.c: Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
up _gp in the hash table rather than in outsymbols.
* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
argument rather than printing them.
* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
link_order arguments rather than seclet. Changed all uses and
definitions.
(bfd_coff_reloc16_estimate): Pass link_info arguments. Changed
all uses and definitions.
* libcoff.h: Rebuilt.
* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
not by ECOFF, make it scAbs.
(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
rewritten.
* elf32-mips.c (mips_elf_final_link): Renamed from
mips_elf_seclet_link and rewritten.
* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
field.
(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
Added link_info arguments. Changed all callers.
* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
not NULL.
* oasys.c (oasys_write_sections): Return boolean value rather than
using bfd_error_vector.
(oasys_write_object_contents): Check return value of
oasys_write_sections.
* hosts/std-host.h: Don't declare qsort or strtol.
* Makefile.in: Rebuild dependencies.
(BFD_LIBS): Removed seclet.o. Added hash.o and linker.o.
(CFILES): Removed seclet.c. Added hash.c and linker.c.
(HFILES): Removed seclet.h. Added genlink.h.
1993-12-30 19:56:50 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
PTR backend_data;
|
|
|
|
|
} bfd_target;
|
1997-03-18 00:47:04 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_set_default_target PARAMS ((const char *name));
|
|
|
|
|
|
1994-06-20 21:55:45 +00:00
|
|
|
|
const bfd_target *
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1994-06-20 21:55:45 +00:00
|
|
|
|
const char **
|
1993-06-16 02:25:53 +00:00
|
|
|
|
bfd_target_list PARAMS ((void));
|
|
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
|
|
|
|
|
|
1994-01-24 23:33:23 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching));
|
1994-01-22 04:28:17 +00:00
|
|
|
|
|
1993-06-16 02:25:53 +00:00
|
|
|
|
boolean
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
|
|
|
|
CONST char *
|
1993-11-05 19:51:52 +00:00
|
|
|
|
bfd_format_string PARAMS ((bfd_format format));
|
1993-06-16 02:25:53 +00:00
|
|
|
|
|
1995-08-31 16:23:02 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
1993-06-16 02:25:53 +00:00
|
|
|
|
#endif
|