2001-10-01 14:03:36 +00:00
|
|
|
|
/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
|
2002-08-09 15:38:24 +00:00
|
|
|
|
generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
|
2002-11-16 Klee Dienes <kdienes@apple.com>
* Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo.
(BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c.
(BFD_H_FILES): Add bfdwin.c, bfdio.c.
(LIBBFD_H_FILES): Add bfdwin.c, bfdio.c.
Add dependencies for bfdwin.c, bfdio.c.
* bfd.c: Remove bfd_get_mtime, bfd_get_size.
* libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal,
bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite,
bfd_tell, bfd_flush, bfd_stat, bfd_seek.
* bfdio.c: New file. Contains real_read, bfd_bread, bfd_write,
bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime,
bfd_get_size (moved from libbfd.c and bfd.c).
* bfdwin.c New file. Contains _bfd_window_internal,
bfd_init_window, bfd_free_window, bfd_get_file_window (moved from
libbfd.c and bfd.c).
* po/SRC-POTFILES.in: Regenerate.
* po/bfd.pot: Regenerate.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* aclocal.m4: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
2002-11-16 Klee Dienes <kdienes@apple.com>
* Makefile.am (DOCFILES): Add bfdwin.texi, bfdio.texi.
(PROTOS): Add bfdio.p, bfdwin.p.
(SRCDOC): Add bfdio.c, bfdwin.c.
(SRCPROT): Add bfdio.c, bfdwin.c.
(SRCIPROT): Add bfdio.c, bfdwin.c.
(LIBBFD_H_DEP): Add bfdio.c, bfdwin.c.
(BFD_H_DEP): Add bfdio.c, bfdwin.c.
Add rules for bfdio.texi, bfdwin.text.
* bfd.texinfo: Include bfdio.texi.
2002-11-18 16:37:54 +00:00
|
|
|
|
"bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
|
|
|
|
|
"syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
|
|
|
|
|
"linker.c" and "simple.c".
|
2001-10-01 14:03:36 +00:00
|
|
|
|
Run "make headers" in your build bfd/ to regenerate. */
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* Main header file for the bfd library -- portable access to object files.
|
2001-03-08 21:04:02 +00:00
|
|
|
|
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
2002-01-30 18:12:17 +00:00
|
|
|
|
2000, 2001, 2002
|
1999-05-03 07:29:11 +00:00
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
Contributed by Cygnus Support.
|
|
|
|
|
|
2002-05-29 16:03:04 +00:00
|
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-05-29 16:03:04 +00:00
|
|
|
|
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.
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-05-29 16:03:04 +00:00
|
|
|
|
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.
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-05-29 16:03:04 +00:00
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#ifndef __BFD_H_SEEN__
|
|
|
|
|
#define __BFD_H_SEEN__
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "ansidecl.h"
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#include "symcat.h"
|
|
|
|
|
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
|
|
|
|
|
#ifndef SABER
|
|
|
|
|
/* This 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 XCONCAT2 macro will
|
|
|
|
|
cause the inner CONCAT2 macros to be evaluated first, producing
|
|
|
|
|
still-valid pp-tokens. Then the final concatenation can be done. */
|
|
|
|
|
#undef CONCAT4
|
|
|
|
|
#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-08-17 03:54:53 +00:00
|
|
|
|
/* The word size used by BFD on the host. This may be 64 with a 32
|
|
|
|
|
bit target if the host is 64 bit, or if other 64 bit targets have
|
|
|
|
|
been selected with --enable-targets, or if --enable-64-bit-bfd. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BFD_ARCH_SIZE @wordsize@
|
2001-08-17 03:54:53 +00:00
|
|
|
|
|
|
|
|
|
/* The word size of the default bfd target. */
|
|
|
|
|
#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
#if BFD_ARCH_SIZE >= 64
|
|
|
|
|
#define BFD64
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef INLINE
|
|
|
|
|
#if __GNUC__ >= 2
|
|
|
|
|
#define INLINE __inline__
|
|
|
|
|
#else
|
|
|
|
|
#define INLINE
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Forward declaration. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
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
|
2000-11-08 23:57:04 +00:00
|
|
|
|
force me to change it. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* typedef enum boolean {false, true} boolean; */
|
|
|
|
|
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
|
|
|
|
|
/* It gets worse if the host also defines a true/false enum... -sts */
|
|
|
|
|
/* And even worse if your compiler has built-in boolean types... -law */
|
2002-01-31 04:42:30 +00:00
|
|
|
|
/* And even worse if your compiler provides a stdbool.h that conflicts
|
2002-02-07 22:28:31 +00:00
|
|
|
|
with these definitions... gcc 2.95 and later do. If so, it must
|
|
|
|
|
be included first. -drow */
|
2000-04-29 00:56:29 +00:00
|
|
|
|
#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define TRUE_FALSE_ALREADY_DEFINED
|
2002-01-31 04:42:30 +00:00
|
|
|
|
#else
|
2002-02-07 22:28:31 +00:00
|
|
|
|
#if defined (__bool_true_false_are_defined)
|
|
|
|
|
/* We have <stdbool.h>. */
|
2002-01-31 04:42:30 +00:00
|
|
|
|
#define TRUE_FALSE_ALREADY_DEFINED
|
|
|
|
|
#endif
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifdef MPW
|
2000-11-08 23:57:04 +00:00
|
|
|
|
/* Pre-emptive strike - get the file with the enum. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#include <Types.h>
|
|
|
|
|
#define TRUE_FALSE_ALREADY_DEFINED
|
|
|
|
|
#endif /* MPW */
|
|
|
|
|
#ifndef TRUE_FALSE_ALREADY_DEFINED
|
|
|
|
|
typedef enum bfd_boolean {false, true} boolean;
|
|
|
|
|
#define BFD_TRUE_FALSE
|
|
|
|
|
#else
|
|
|
|
|
/* Use enum names that will appear nowhere else. */
|
|
|
|
|
typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Support for different sizes of target format ints and addresses.
|
|
|
|
|
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
|
|
|
|
|
use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
|
|
|
|
|
defined above. */
|
|
|
|
|
|
|
|
|
|
#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) */
|
|
|
|
|
|
|
|
|
|
#ifdef BFD64
|
|
|
|
|
|
|
|
|
|
#ifndef BFD_HOST_64_BIT
|
|
|
|
|
#error No 64 bit integer type available
|
|
|
|
|
#endif /* ! defined (BFD_HOST_64_BIT) */
|
|
|
|
|
|
|
|
|
|
typedef BFD_HOST_U_64_BIT bfd_vma;
|
|
|
|
|
typedef BFD_HOST_64_BIT bfd_signed_vma;
|
|
|
|
|
typedef BFD_HOST_U_64_BIT bfd_size_type;
|
|
|
|
|
typedef BFD_HOST_U_64_BIT symvalue;
|
|
|
|
|
|
|
|
|
|
#ifndef fprintf_vma
|
|
|
|
|
#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))
|
|
|
|
|
#define fprintf_vma(s,x) \
|
|
|
|
|
fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
|
|
|
|
|
#define sprintf_vma(s,x) \
|
|
|
|
|
sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#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. */
|
2000-11-28 21:42:16 +00:00
|
|
|
|
#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
|
|
|
|
|
#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#endif /* not BFD64 */
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +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 bfd_signed_vma file_ptr;
|
|
|
|
|
typedef bfd_vma ufile_ptr;
|
|
|
|
|
|
2001-08-09 16:00:21 +00:00
|
|
|
|
extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma));
|
|
|
|
|
extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma));
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define printf_vma(x) fprintf_vma(stdout,x)
|
2001-08-09 16:00:21 +00:00
|
|
|
|
#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
typedef unsigned int flagword; /* 32 bits of flags */
|
|
|
|
|
typedef unsigned char bfd_byte;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* File formats. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
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;
|
1999-05-03 07:29:11 +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. */
|
|
|
|
|
#define BFD_NO_FLAGS 0x00
|
|
|
|
|
|
|
|
|
|
/* BFD contains relocation entries. */
|
|
|
|
|
#define HAS_RELOC 0x01
|
|
|
|
|
|
|
|
|
|
/* BFD is directly executable. */
|
|
|
|
|
#define EXEC_P 0x02
|
|
|
|
|
|
|
|
|
|
/* BFD has line number information (basically used for F_LNNO in a
|
|
|
|
|
COFF header). */
|
|
|
|
|
#define HAS_LINENO 0x04
|
|
|
|
|
|
|
|
|
|
/* BFD has debugging information. */
|
|
|
|
|
#define HAS_DEBUG 0x08
|
|
|
|
|
|
|
|
|
|
/* BFD has symbols. */
|
|
|
|
|
#define HAS_SYMS 0x10
|
|
|
|
|
|
|
|
|
|
/* BFD has local symbols (basically used for F_LSYMS in a COFF
|
|
|
|
|
header). */
|
|
|
|
|
#define HAS_LOCALS 0x20
|
|
|
|
|
|
|
|
|
|
/* BFD is a dynamic object. */
|
|
|
|
|
#define DYNAMIC 0x40
|
|
|
|
|
|
|
|
|
|
/* 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). */
|
|
|
|
|
#define WP_TEXT 0x80
|
|
|
|
|
|
|
|
|
|
/* 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). */
|
|
|
|
|
#define D_PAGED 0x100
|
|
|
|
|
|
|
|
|
|
/* BFD is relaxable (this means that bfd_relax_section may be able to
|
|
|
|
|
do something) (sometimes bfd_relax_section can do something even if
|
|
|
|
|
this is not set). */
|
|
|
|
|
#define BFD_IS_RELAXABLE 0x200
|
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
|
|
|
|
|
|
/* 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
|
2002-08-28 10:38:51 +00:00
|
|
|
|
|
2002-08-29 06:49:35 +00:00
|
|
|
|
/* The sections in this BFD specify a memory page. */
|
2002-08-28 10:38:51 +00:00
|
|
|
|
#define HAS_LOAD_PAGE 0x1000
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Symbols and relocation. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
/* A count of carsyms (canonical archive symbols). */
|
|
|
|
|
typedef unsigned long symindex;
|
|
|
|
|
|
|
|
|
|
/* How to perform a relocation. */
|
|
|
|
|
typedef const struct reloc_howto_struct reloc_howto_type;
|
|
|
|
|
|
|
|
|
|
#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
|
|
|
|
|
|
|
|
|
|
/* General purpose part of a symbol X;
|
|
|
|
|
target specific parts are in libcoff.h, libaout.h, etc. */
|
|
|
|
|
|
|
|
|
|
#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)
|
|
|
|
|
|
|
|
|
|
/* A canonical archive symbol. */
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a type pun with struct ranlib on purpose! */
|
|
|
|
|
typedef struct carsym
|
|
|
|
|
{
|
1999-05-03 07:29:11 +00:00
|
|
|
|
char *name;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
file_ptr file_offset; /* Look here to find the file. */
|
|
|
|
|
}
|
|
|
|
|
carsym; /* To make these you call a carsymogen. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
/* Used in generating armaps (archive tables of contents).
|
2002-01-30 18:12:17 +00:00
|
|
|
|
Perhaps just a forward definition would do? */
|
|
|
|
|
struct orl /* Output ranlib. */
|
|
|
|
|
{
|
|
|
|
|
char **name; /* Symbol name. */
|
|
|
|
|
union
|
|
|
|
|
{
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
file_ptr pos;
|
|
|
|
|
bfd *abfd;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
} u; /* bfd* or file position. */
|
|
|
|
|
int namidx; /* Index into string table. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
};
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Linenumber stuff. */
|
|
|
|
|
typedef struct lineno_cache_entry
|
|
|
|
|
{
|
|
|
|
|
unsigned int line_number; /* Linenumber from start of function. */
|
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
struct symbol_cache_entry *sym; /* Function name. */
|
|
|
|
|
bfd_vma offset; /* Offset into section. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
} u;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
}
|
|
|
|
|
alent;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Object and core file sections. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define align_power(addr, align) \
|
2002-08-30 18:36:18 +00:00
|
|
|
|
(((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
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)
|
2002-04-20 03:25:20 +00:00
|
|
|
|
#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#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)
|
|
|
|
|
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
|
|
|
|
|
#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)
|
|
|
|
|
|
* aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to
unsigned int. Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to
unsigned int.
(NAME(aout,final_link)): Cast enum used in assignment.
(aout_link_write_symbols): Cast enums in comparisons, int values to
boolean, enums in assignments to int.
(aout_link_input_section_std): Cast rel->r_index to unsigned int.
(aout_link_input_section_ext): Likewise. Cast enums used in comparisons
with unsigned ints.
(aout_link_reloc_link_order): Cast enum to int in assignment.
* archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr
calls to char *.
* bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in
assignment.
* bfd-in2.h (bfd_set_section_vma): Likewise.
* bfd.c (bfd_record_phdr): Cast enums in assignments.
* binary.c (bfd_alloc): Cast enum to long.
* coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean.
* dwarf2.c (read_abbrevs): Add casts to enum types.
(read_attribute_value): Likewise.
(arange_add): Cast result of bfd_zalloc call.
(comp_unit_contains_address): Return true and false.
(comp_unit_find_nearest_line): Cast return to boolean.
* format.c (bfd_check_format_matches, bfd_set_format): Likewise.
* gen-aout.c: define macro '_' if not defined.
* libbfd.c (bfd_realloc): Cast malloc and realloc to PTR.
(bfd_bwrite): Cast bfd_realloc to bfd_byte *.
(bfd_write_bigendian_4byte_int): Cast return to boolean.
(bfd_seek): Cast bfd_realloc to bfd_byte *.
(bfd_generic_is_local_label_name): Cast return to boolean.
* libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'.
* linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to
struct bfd_hash_entry *.
(_bfd_generic_link_hash_newfunc): likewise.
(_bfd_generic_final_link): Cast enum to unsigned int.
* merge.c (sec_merge_emit): Cast return to boolean.
(merge_strings): Add casts to const unsigned char *.
* reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int.
(bfd_generic_get_relocated_section_content): Cast enum to unsigned int.
* section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result to
struct bfd_hash_entry *.
(bfd_set_section_content): Add cast to PTR in comparison.
* simple.c (simple_dummy_warning, simple_dummy_undefined_symbol,
simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous,
simple_dummy_unattached_reloc,
bfd_simple_get_relocated_section_contents): Add K&R declarations and
function definitions.
* srec.c (S3Forced): Initialize to false.
(srec_get_symtab): Cast return value from bfd_alloc to asymbol *.
* stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons.
(_bfd_discard_section_stabs): Likewise. Also cast return to boolean.
* syms.c (bfd_is_undefined_symclass): Cast return to boolean.
(_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in
comparisons.
2002-10-25 02:45:54 +00:00
|
|
|
|
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (unsigned int)true), true)
|
1999-05-03 07:29:11 +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)
|
|
|
|
|
|
2000-06-19 01:22:44 +00:00
|
|
|
|
typedef struct stat stat_type;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
typedef enum bfd_print_symbol
|
2000-06-19 01:22:44 +00:00
|
|
|
|
{
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_print_symbol_name,
|
|
|
|
|
bfd_print_symbol_more,
|
|
|
|
|
bfd_print_symbol_all
|
|
|
|
|
} bfd_print_symbol_type;
|
2000-06-19 01:22:44 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* Information about a symbol that nm needs. */
|
|
|
|
|
|
|
|
|
|
typedef struct _symbol_info
|
|
|
|
|
{
|
|
|
|
|
symvalue value;
|
|
|
|
|
char type;
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
const char *name; /* Symbol name. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
unsigned char stab_type; /* Stab type. */
|
2000-11-08 23:57:04 +00:00
|
|
|
|
char stab_other; /* Stab other. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
short stab_desc; /* Stab desc. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
const char *stab_name; /* String for stab type. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
} symbol_info;
|
|
|
|
|
|
|
|
|
|
/* Get the name of a stabs type code. */
|
|
|
|
|
|
|
|
|
|
extern const char *bfd_get_stab_name PARAMS ((int));
|
|
|
|
|
|
|
|
|
|
/* 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 *));
|
|
|
|
|
/* 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;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* 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));
|
|
|
|
|
|
|
|
|
|
/* 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));
|
|
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
|
extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *,
|
|
|
|
|
unsigned int));
|
|
|
|
|
|
|
|
|
|
/* 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));
|
|
|
|
|
|
|
|
|
|
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
|
2001-10-02 05:58:41 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* User program access to BFD facilities. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
/* Direct I/O routines, for programs which know more about the object
|
|
|
|
|
file than BFD does. Use higher level routines if possible. */
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *));
|
|
|
|
|
extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *));
|
|
|
|
|
extern int bfd_seek PARAMS ((bfd *, file_ptr, int));
|
|
|
|
|
extern ufile_ptr bfd_tell PARAMS ((bfd *));
|
|
|
|
|
extern int bfd_flush PARAMS ((bfd *));
|
|
|
|
|
extern int bfd_stat PARAMS ((bfd *, struct stat *));
|
|
|
|
|
|
|
|
|
|
/* Deprecated old routines. */
|
|
|
|
|
#if __GNUC__
|
|
|
|
|
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
|
|
|
|
|
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
|
|
|
|
|
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#else
|
|
|
|
|
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
|
|
|
|
|
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
|
|
|
|
|
(warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
|
|
|
|
|
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
|
|
|
|
|
#endif
|
|
|
|
|
extern void warn_deprecated
|
|
|
|
|
PARAMS ((const char *, const char *, int, const char *));
|
1999-05-03 07:29:11 +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)
|
|
|
|
|
#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
|
|
|
|
|
#define bfd_get_format(abfd) ((abfd)->format)
|
|
|
|
|
#define bfd_get_target(abfd) ((abfd)->xvec->name)
|
|
|
|
|
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
|
2000-06-16 20:35:08 +00:00
|
|
|
|
#define bfd_family_coff(abfd) \
|
|
|
|
|
(bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
|
|
|
|
|
bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
|
1999-05-03 07:29:11 +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)
|
|
|
|
|
#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)
|
|
|
|
|
|
2002-09-18 02:39:43 +00:00
|
|
|
|
#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
|
|
|
|
|
2000-11-21 02:24:32 +00:00
|
|
|
|
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-04-25 21:08:02 +00:00
|
|
|
|
extern boolean bfd_cache_close PARAMS ((bfd *abfd));
|
|
|
|
|
/* NB: This declaration should match the autogenerated one in libbfd.h. */
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
extern boolean bfd_record_phdr
|
|
|
|
|
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
|
|
|
|
|
boolean, boolean, unsigned int, struct sec **));
|
|
|
|
|
|
|
|
|
|
/* Byte swapping routines. */
|
|
|
|
|
|
|
|
|
|
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 *));
|
|
|
|
|
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 *));
|
2000-12-21 18:20:04 +00:00
|
|
|
|
|
|
|
|
|
/* Byte swapping routines which take size and endiannes as arguments. */
|
|
|
|
|
|
|
|
|
|
bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean));
|
|
|
|
|
void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
/* Externally visible ECOFF routines. */
|
|
|
|
|
|
|
|
|
|
#if defined(__STDC__) || defined(ALMOST_STDC)
|
|
|
|
|
struct ecoff_debug_info;
|
|
|
|
|
struct ecoff_debug_swap;
|
|
|
|
|
struct ecoff_extr;
|
|
|
|
|
struct symbol_cache_entry;
|
|
|
|
|
struct bfd_link_info;
|
|
|
|
|
struct bfd_link_hash_entry;
|
|
|
|
|
struct bfd_elf_version_tree;
|
|
|
|
|
#endif
|
|
|
|
|
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));
|
|
|
|
|
extern PTR bfd_ecoff_debug_init
|
|
|
|
|
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
|
|
|
|
|
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,
|
|
|
|
|
const struct ecoff_debug_swap *output_swap,
|
|
|
|
|
bfd *input_bfd, struct ecoff_debug_info *input_debug,
|
|
|
|
|
const struct ecoff_debug_swap *input_swap,
|
|
|
|
|
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 *));
|
|
|
|
|
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)));
|
|
|
|
|
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));
|
|
|
|
|
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));
|
|
|
|
|
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));
|
|
|
|
|
extern boolean bfd_mips_ecoff_create_embedded_relocs
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
|
|
|
|
|
char **));
|
|
|
|
|
|
|
|
|
|
/* Externally visible ELF routines. */
|
|
|
|
|
|
|
|
|
|
struct bfd_link_needed_list
|
|
|
|
|
{
|
|
|
|
|
struct bfd_link_needed_list *next;
|
|
|
|
|
bfd *by;
|
|
|
|
|
const char *name;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
extern boolean bfd_elf_get_bfd_needed_list
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_needed_list **));
|
|
|
|
|
extern boolean bfd_elf32_size_dynamic_sections
|
2001-06-18 22:05:10 +00:00
|
|
|
|
PARAMS ((bfd *, const char *, const char *, const char *,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
const char * const *, struct bfd_link_info *, struct sec **,
|
|
|
|
|
struct bfd_elf_version_tree *));
|
|
|
|
|
extern boolean bfd_elf64_size_dynamic_sections
|
2001-06-18 22:05:10 +00:00
|
|
|
|
PARAMS ((bfd *, const char *, const char *, const char *,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
const char * const *, struct bfd_link_info *, struct sec **,
|
|
|
|
|
struct bfd_elf_version_tree *));
|
|
|
|
|
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
|
2000-07-20 03:16:18 +00:00
|
|
|
|
extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
|
2000-08-22 19:33:16 +00:00
|
|
|
|
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
2001-11-15 01:34:12 +00:00
|
|
|
|
extern boolean bfd_elf32_discard_info
|
2001-12-13 11:09:34 +00:00
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
2001-11-15 01:34:12 +00:00
|
|
|
|
extern boolean bfd_elf64_discard_info
|
2001-12-13 11:09:34 +00:00
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-02-13 22:45:29 +00:00
|
|
|
|
/* Return an upper bound on the number of bytes required to store a
|
|
|
|
|
copy of ABFD's program header table entries. Return -1 if an error
|
|
|
|
|
occurs; bfd_get_error will return an appropriate code. */
|
|
|
|
|
extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
/* Copy ABFD's program header table entries to *PHDRS. The entries
|
|
|
|
|
will be stored as an array of Elf_Internal_Phdr structures, as
|
|
|
|
|
defined in include/elf/internal.h. To find out how large the
|
|
|
|
|
buffer needs to be, call bfd_get_elf_phdr_upper_bound.
|
|
|
|
|
|
|
|
|
|
Return the number of program header table entries read, or -1 if an
|
|
|
|
|
error occurs; bfd_get_error will return an appropriate code. */
|
|
|
|
|
extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs));
|
|
|
|
|
|
2000-05-05 18:12:53 +00:00
|
|
|
|
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
|
2000-07-18 19:20:13 +00:00
|
|
|
|
extern int bfd_get_arch_size PARAMS ((bfd *));
|
2000-05-05 18:12:53 +00:00
|
|
|
|
|
2000-11-08 23:57:04 +00:00
|
|
|
|
/* Return true if address "naturally" sign extends, or -1 if not elf. */
|
2000-07-18 19:20:13 +00:00
|
|
|
|
extern int bfd_get_sign_extend_vma PARAMS ((bfd *));
|
2000-07-11 07:28:25 +00:00
|
|
|
|
|
2000-09-15 18:52:52 +00:00
|
|
|
|
extern boolean bfd_m68k_elf32_create_embedded_relocs
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
|
|
|
|
|
char **));
|
2002-01-30 02:19:21 +00:00
|
|
|
|
extern boolean bfd_mips_elf32_create_embedded_relocs
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
|
|
|
|
|
char **));
|
2000-09-15 18:52:52 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* SunOS shared library support routines for the linker. */
|
|
|
|
|
|
|
|
|
|
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
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 **));
|
|
|
|
|
|
|
|
|
|
/* Linux shared library support routines for the linker. */
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_i386linux_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
extern boolean bfd_m68klinux_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
extern boolean bfd_sparclinux_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
|
|
|
|
/* mmap hacks */
|
|
|
|
|
|
|
|
|
|
struct _bfd_window_internal;
|
|
|
|
|
typedef struct _bfd_window_internal bfd_window_internal;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
typedef struct _bfd_window
|
|
|
|
|
{
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* 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;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
}
|
|
|
|
|
bfd_window;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
extern void bfd_init_window PARAMS ((bfd_window *));
|
|
|
|
|
extern void bfd_free_window PARAMS ((bfd_window *));
|
|
|
|
|
extern boolean bfd_get_file_window
|
|
|
|
|
PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean));
|
|
|
|
|
|
|
|
|
|
/* XCOFF support routines for the linker. */
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_xcoff_link_record_set
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
|
|
|
|
|
bfd_size_type));
|
|
|
|
|
extern boolean bfd_xcoff_import_symbol
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
|
2001-09-06 15:20:01 +00:00
|
|
|
|
bfd_vma, const char *, const char *, const char *, unsigned int));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
extern boolean bfd_xcoff_export_symbol
|
2001-09-06 15:20:01 +00:00
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
|
1999-05-03 07:29:11 +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 *));
|
|
|
|
|
extern boolean bfd_xcoff_size_dynamic_sections
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
|
|
|
|
|
unsigned long, unsigned long, unsigned long, boolean,
|
2002-02-19 05:01:40 +00:00
|
|
|
|
int, boolean, boolean, struct sec **, boolean));
|
2001-12-22 17:18:34 +00:00
|
|
|
|
extern boolean bfd_xcoff_link_generate_rtinit
|
2002-02-19 05:01:40 +00:00
|
|
|
|
PARAMS ((bfd *, const char *, const char *, boolean));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-03-21 09:15:18 +00:00
|
|
|
|
/* XCOFF support routines for ar. */
|
|
|
|
|
extern boolean bfd_xcoff_ar_archive_set_magic PARAMS ((bfd *, char *));
|
|
|
|
|
|
1999-05-03 07:29:11 +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 *));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_coff_get_auxent
|
|
|
|
|
PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_coff_set_symbol_class
|
|
|
|
|
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
|
|
|
|
|
|
2000-07-24 17:22:17 +00:00
|
|
|
|
extern boolean bfd_m68k_coff_create_embedded_relocs
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
|
|
|
|
|
char **));
|
|
|
|
|
|
1999-05-03 07:29:11 +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
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, int));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_arm_get_bfd_for_interworking
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
2000-03-01 20:39:07 +00:00
|
|
|
|
/* PE ARM Interworking support. Called from linker. */
|
|
|
|
|
extern boolean bfd_arm_pe_allocate_interworking_sections
|
|
|
|
|
PARAMS ((struct bfd_link_info *));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_arm_pe_process_before_allocation
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, int));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_arm_pe_get_bfd_for_interworking
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* ELF ARM Interworking support. Called from linker. */
|
1999-07-12 11:06:03 +00:00
|
|
|
|
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 *, int));
|
|
|
|
|
|
|
|
|
|
extern boolean bfd_elf32_arm_get_bfd_for_interworking
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-05-29 16:03:04 +00:00
|
|
|
|
extern boolean bfd_elf32_arm_add_glue_sections_to_bfd
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *));
|
|
|
|
|
|
2000-11-08 23:57:04 +00:00
|
|
|
|
/* TI COFF load page support. */
|
2000-04-18 02:21:27 +00:00
|
|
|
|
extern void bfd_ticoff_set_section_load_page
|
|
|
|
|
PARAMS ((struct sec *, int));
|
|
|
|
|
|
|
|
|
|
extern int bfd_ticoff_get_section_load_page
|
|
|
|
|
PARAMS ((struct sec *));
|
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from init.c. */
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_init PARAMS ((void));
|
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from opncls.c. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd *
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_openr PARAMS ((const char *filename, const char *target));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
bfd *
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_fdopenr PARAMS ((const char *filename, const char *target, int fd));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
bfd *
|
|
|
|
|
bfd_openstreamr PARAMS ((const char *, const char *, PTR));
|
|
|
|
|
|
|
|
|
|
bfd *
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_openw PARAMS ((const char *filename, const char *target));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_close PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_close_all_done PARAMS ((bfd *));
|
|
|
|
|
|
|
|
|
|
bfd *
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_create PARAMS ((const char *filename, bfd *templ));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_make_writable PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_make_readable PARAMS ((bfd *abfd));
|
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from libbfd.c. */
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Byte swapping macros for user section data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_put_8(abfd, val, ptr) \
|
2001-01-11 21:20:20 +00:00
|
|
|
|
((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_put_signed_8 \
|
|
|
|
|
bfd_put_8
|
|
|
|
|
#define bfd_get_8(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
(*(unsigned char *) (ptr) & 0xff)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_get_signed_8(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
(((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_put_16(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
|
|
|
|
|
#define bfd_put_signed_16 \
|
|
|
|
|
bfd_put_16
|
|
|
|
|
#define bfd_get_16(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx16, (ptr))
|
|
|
|
|
#define bfd_get_signed_16(abfd, ptr) \
|
|
|
|
|
BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
|
|
|
|
|
|
|
|
|
|
#define bfd_put_32(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
|
|
|
|
|
#define bfd_put_signed_32 \
|
|
|
|
|
bfd_put_32
|
|
|
|
|
#define bfd_get_32(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx32, (ptr))
|
|
|
|
|
#define bfd_get_signed_32(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
|
|
|
|
|
|
|
|
|
|
#define bfd_put_64(abfd, val, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
|
|
|
|
|
#define bfd_put_signed_64 \
|
|
|
|
|
bfd_put_64
|
|
|
|
|
#define bfd_get_64(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx64, (ptr))
|
|
|
|
|
#define bfd_get_signed_64(abfd, ptr) \
|
|
|
|
|
BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
|
|
|
|
|
|
1999-07-07 17:50:56 +00:00
|
|
|
|
#define bfd_get(bits, abfd, ptr) \
|
2001-09-25 16:35:05 +00:00
|
|
|
|
( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
|
1999-07-07 17:50:56 +00:00
|
|
|
|
: (bits) == 16 ? bfd_get_16 (abfd, ptr) \
|
|
|
|
|
: (bits) == 32 ? bfd_get_32 (abfd, ptr) \
|
|
|
|
|
: (bits) == 64 ? bfd_get_64 (abfd, ptr) \
|
2001-09-25 16:35:05 +00:00
|
|
|
|
: (abort (), (bfd_vma) - 1))
|
1999-07-07 17:50:56 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_put(bits, abfd, val, ptr) \
|
2001-09-25 16:35:05 +00:00
|
|
|
|
( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
|
1999-07-07 17:50:56 +00:00
|
|
|
|
: (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
|
|
|
|
|
: (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
|
|
|
|
|
: (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
|
|
|
|
|
: (abort (), (void) 0))
|
|
|
|
|
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Byte swapping macros for file header data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_h_put_8(abfd, val, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_put_8 (abfd, val, ptr)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_put_signed_8(abfd, val, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_put_8 (abfd, val, ptr)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_8(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_get_8 (abfd, ptr)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_signed_8(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_get_signed_8 (abfd, ptr)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_h_put_16(abfd, val, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_put_signed_16 \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_h_put_16
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_16(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_getx16, (ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_signed_16(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_h_put_32(abfd, val, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_put_signed_32 \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_h_put_32
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_32(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_getx32, (ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_signed_32(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_h_put_64(abfd, val, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_put_signed_64 \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_h_put_64
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_64(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_getx64, (ptr))
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_h_get_signed_64(abfd, ptr) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
|
|
|
|
|
|
|
|
|
|
/* Refinements on the above, which should eventually go away. Save
|
|
|
|
|
cluttering the source with (bfd_vma) and (bfd_byte *) casts. */
|
|
|
|
|
|
|
|
|
|
#define H_PUT_64(abfd, val, where) \
|
|
|
|
|
bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_PUT_32(abfd, val, where) \
|
|
|
|
|
bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_PUT_16(abfd, val, where) \
|
|
|
|
|
bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_PUT_8 bfd_h_put_8
|
|
|
|
|
|
|
|
|
|
#define H_PUT_S64(abfd, val, where) \
|
|
|
|
|
bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_PUT_S32(abfd, val, where) \
|
|
|
|
|
bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_PUT_S16(abfd, val, where) \
|
|
|
|
|
bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_PUT_S8 bfd_h_put_signed_8
|
|
|
|
|
|
|
|
|
|
#define H_GET_64(abfd, where) \
|
|
|
|
|
bfd_h_get_64 ((abfd), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_GET_32(abfd, where) \
|
|
|
|
|
bfd_h_get_32 ((abfd), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_GET_16(abfd, where) \
|
|
|
|
|
bfd_h_get_16 ((abfd), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_GET_8 bfd_h_get_8
|
|
|
|
|
|
|
|
|
|
#define H_GET_S64(abfd, where) \
|
|
|
|
|
bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_GET_S32(abfd, where) \
|
|
|
|
|
bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_GET_S16(abfd, where) \
|
|
|
|
|
bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
|
|
|
|
|
|
|
|
|
|
#define H_GET_S8 bfd_h_get_signed_8
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-11-16 Klee Dienes <kdienes@apple.com>
* Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo.
(BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c.
(BFD_H_FILES): Add bfdwin.c, bfdio.c.
(LIBBFD_H_FILES): Add bfdwin.c, bfdio.c.
Add dependencies for bfdwin.c, bfdio.c.
* bfd.c: Remove bfd_get_mtime, bfd_get_size.
* libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal,
bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite,
bfd_tell, bfd_flush, bfd_stat, bfd_seek.
* bfdio.c: New file. Contains real_read, bfd_bread, bfd_write,
bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime,
bfd_get_size (moved from libbfd.c and bfd.c).
* bfdwin.c New file. Contains _bfd_window_internal,
bfd_init_window, bfd_free_window, bfd_get_file_window (moved from
libbfd.c and bfd.c).
* po/SRC-POTFILES.in: Regenerate.
* po/bfd.pot: Regenerate.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* aclocal.m4: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
2002-11-16 Klee Dienes <kdienes@apple.com>
* Makefile.am (DOCFILES): Add bfdwin.texi, bfdio.texi.
(PROTOS): Add bfdio.p, bfdwin.p.
(SRCDOC): Add bfdio.c, bfdwin.c.
(SRCPROT): Add bfdio.c, bfdwin.c.
(SRCIPROT): Add bfdio.c, bfdwin.c.
(LIBBFD_H_DEP): Add bfdio.c, bfdwin.c.
(BFD_H_DEP): Add bfdio.c, bfdwin.c.
Add rules for bfdio.texi, bfdwin.text.
* bfd.texinfo: Include bfdio.texi.
2002-11-18 16:37:54 +00:00
|
|
|
|
/* Extracted from bfdio.c. */
|
|
|
|
|
long
|
|
|
|
|
bfd_get_mtime PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
long
|
|
|
|
|
bfd_get_size PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
/* Extracted from bfdwin.c. */
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from section.c. */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* This structure is used for a comdat section, as in PE. A comdat
|
|
|
|
|
section is associated with a particular symbol. When the linker
|
|
|
|
|
sees a comdat section, it keeps only one of the sections with a
|
|
|
|
|
given name and associated with a given symbol. */
|
1999-09-06 18:34:29 +00:00
|
|
|
|
|
|
|
|
|
struct bfd_comdat_info
|
|
|
|
|
{
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The name of the symbol associated with a comdat section. */
|
1999-09-06 18:34:29 +00:00
|
|
|
|
const char *name;
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The local symbol table index of the symbol associated with a
|
1999-09-06 18:34:29 +00:00
|
|
|
|
comdat section. This is only meaningful to the object file format
|
|
|
|
|
specific code; it is not an index into the list returned by
|
|
|
|
|
bfd_canonicalize_symtab. */
|
|
|
|
|
long symbol;
|
|
|
|
|
};
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
typedef struct sec
|
|
|
|
|
{
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The name of the section; the name isn't a copy, the pointer is
|
|
|
|
|
the same as that passed to bfd_make_section. */
|
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
|
|
/* A unique sequence number. */
|
|
|
|
|
int id;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-10-09 06:05:17 +00:00
|
|
|
|
/* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
int index;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The next section in the list belonging to the BFD, or NULL. */
|
|
|
|
|
struct sec *next;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The field flags contains attributes of the section. Some
|
|
|
|
|
flags are read in from the object file, and some are
|
|
|
|
|
synthesized from other information. */
|
|
|
|
|
flagword flags;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define SEC_NO_FLAGS 0x000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Tells the OS to allocate space for this section when loading.
|
|
|
|
|
This is clear for a section containing debug information only. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_ALLOC 0x001
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Tells the OS to load the section from the file when loading.
|
|
|
|
|
This is clear for a .bss section. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LOAD 0x002
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The section contains data still to be relocated, so there is
|
|
|
|
|
some relocation information too. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_RELOC 0x004
|
|
|
|
|
|
2001-09-28 20:51:15 +00:00
|
|
|
|
/* ELF reserves 4 processor specific bits and 8 operating system
|
|
|
|
|
specific bits in sh_flags; at present we can get away with just
|
|
|
|
|
one in communicating between the assembler and BFD, but this
|
|
|
|
|
isn't a good long-term solution. */
|
|
|
|
|
#define SEC_ARCH_BIT_0 0x008
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* A signal to the OS that the section contains read only data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_READONLY 0x010
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The section contains code only. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_CODE 0x020
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The section contains data only. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_DATA 0x040
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The section will reside in ROM. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_ROM 0x080
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* 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
|
|
|
|
|
section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
|
|
|
|
|
the symbol to it, and builds a relocation. To build the lists
|
|
|
|
|
of constructors, all the linker has to do is catenate all the
|
|
|
|
|
sections called <<__CTOR_LIST__>> and relocate the data
|
|
|
|
|
contained within - exactly the operations it would peform on
|
|
|
|
|
standard data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_CONSTRUCTOR 0x100
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The section has contents - a data section could be
|
|
|
|
|
<<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
|
|
|
|
|
<<SEC_HAS_CONTENTS>> */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_HAS_CONTENTS 0x200
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* An instruction to the linker to not output the section
|
|
|
|
|
even if it has information which would normally be written. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_NEVER_LOAD 0x400
|
|
|
|
|
|
2000-07-08 12:08:43 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_COFF_SHARED_LIBRARY 0x800
|
|
|
|
|
|
* elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
for symbols from SHF_TLS section.
(_bfd_elf_print_private_bfd_data): Add PT_TLS.
(elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
(map_sections_to_segments): Build PT_TLS segment if necessary.
(assign_file_positions_for_segments): Likewise.
(get_program_header_size): Account for PT_TLS segment.
(swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
SEC_THREAD_LOCAL sections to STT_TLS.
* reloc.c: Add 386 and IA-64 TLS relocs.
* section.c (SEC_THREAD_LOCAL): Define.
(SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
Remove.
* elflink.h (elf_link_add_object_symbols): Support .tcommon.
(size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
unconditionally.
(struct elf_final_link_info): Add first_tls_sec.
(elf_bfd_final_link): Set first_tls_sec.
Compute elf_hash_table (info)->tls_segment.
(elf_link_output_extsym): Handle STT_TLS symbols.
(elf_link_input_bfd): Likewise.
* syms.c (BSF_THREAD_LOCAL): Define.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
elf_i386_mkobject, elf_i386_object_p): New functions.
(elf_howto_table): Add TLS relocs.
(elf_i386_reloc_type_lookup): Support TLS relocs.
(elf_i386_info_to_howto_rel): Likewise.
(struct elf_i386_link_hash_entry): Add tls_type.
(struct elf_i386_obj_tdata): New.
(elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
New macros.
(struct elf_i386_link_hash_table): Add tls_ldm_got.
(link_hash_newfunc): Clear tls_type.
(elf_i386_check_relocs): Support TLS relocs.
(elf_i386_gc_sweep_hook): Likewise.
(allocate_dynrelocs): Likewise.
(elf_i386_size_dynamic_sections): Likewise.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(bfd_elf32_mkobject, elf_backend_object_p): Define.
* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
want_tprel, want_dtpmod, want_dtprel.
(elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
(ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
R_IA64_LTOFF_TPREL22.
(elf_code_to_howto_index): Add TLS relocs.
(elfNN_ia64_check_relocs): Support TLS relocs.
(allocate_global_data_got): Account for TLS .got data.
(allocate_dynrel_entries): Account for TLS dynamic relocations.
(elfNN_ia64_install_value): Supprt TLS relocs.
(set_got_entry): Support TLS relocs.
(elfNN_ia64_relocate_section): Likewise.
* config/obj-elf.c (elf_common): Renamed from obj_elf_common.
(obj_elf_common): Call elf_common.
(obj_elf_tls_common): New function.
(elf_pseudo_tab): Support .tls_common.
(special_sections): Add .tdata and .tbss.
(obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS
sections.
(obj_elf_parse_section_letters): Support T in section flags (SHF_TLS).
(obj_elf_parse_section_letters): Include T in error message.
* config/tc-ppc.c (ppc_section_letter): Likewise.
* config/tc-alpha.c (alpha_elf_section_letter): Likewise.
(tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as
SEC_MERGE.
* config/tc-sparc.c (md_apply_fix3): Likewise.
* config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs.
Define them if not BFD_ASSEMBLER.
(lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF
and @NTPOFF.
(md_apply_fix3): Add TLS relocs.
* config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE,
FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE,
FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE.
(pseudo_func): Support @dtpmod(), @dtprel() and @tprel().
(ia64_elf_section_letter): Include T in error message.
(md_begin): Support TLS operators.
(md_operand): Likewise.
(ia64_gen_real_reloc_type): Support TLS relocs.
* testsuite/gas/i386/tlspic.s: New file.
* testsuite/gas/i386/tlsd.s: New file.
* testsuite/gas/i386/tlsnopic.s: New file.
* testsuite/gas/i386/tlsd.d: New file.
* testsuite/gas/i386/tlsnopic.d: New file.
* testsuite/gas/i386/tlspic.d: New file.
* testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests.
* testsuite/gas/ia64/tls.s: New file.
* testsuite/gas/ia64/tls.d: New file.
* testsuite/gas/ia64/ia64.exp: Add tls test.
* write.c (adjust_reloc_syms): Don't change symbols in
SEC_THREAD_LOCAL sections to STT_SECTION + addend.
* elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define.
* elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22.
* elf/i386.h: Add TLS relocs.
* scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
* ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
output section if necessary. Handle .tbss.
(lang_size_sections): Clear _raw_size for .tbss section
(it allocates space in PT_TLS segment only).
* ldwrite.c (build_link_order): Build link order for .tbss too.
* readelf.c (get_segment_type): Add PT_TLS.
(get_elf_section_flags): Add SHF_TLS.
(get_dynamic_flags): Optimize. Add DF_STATIC_TLS.
(process_dynamic_segment): Use puts instead of printf.
(get_symbol_type): Support STT_TLS.
* objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT,
SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS.
Add SEC_THREAD_LOCAL.
2002-05-23 13:12:53 +00:00
|
|
|
|
/* The section contains thread local data. */
|
|
|
|
|
#define SEC_THREAD_LOCAL 0x1000
|
|
|
|
|
|
2000-09-05 02:42:16 +00:00
|
|
|
|
/* The section has GOT references. This flag is only for the
|
|
|
|
|
linker, and is currently only used by the elf32-hppa back end.
|
|
|
|
|
It will be set if global offset table references were detected
|
|
|
|
|
in this section, which indicate to the linker that the section
|
|
|
|
|
contains PIC code, and must be handled specially when doing a
|
|
|
|
|
static link. */
|
|
|
|
|
#define SEC_HAS_GOT_REF 0x4000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The section contains common symbols (symbols may be defined
|
|
|
|
|
multiple times, the value of a symbol is the amount of
|
|
|
|
|
space it requires, and the largest symbol value is the one
|
|
|
|
|
used). Most targets have exactly one of these (which we
|
|
|
|
|
translate to bfd_com_section_ptr), but ECOFF has two. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_IS_COMMON 0x8000
|
|
|
|
|
|
2000-07-08 12:08: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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_DEBUGGING 0x10000
|
|
|
|
|
|
2000-07-08 12:08:43 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_IN_MEMORY 0x20000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The contents of this section are to be excluded by the
|
|
|
|
|
linker for executable and shared objects unless those
|
|
|
|
|
objects are to be further relocated. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_EXCLUDE 0x40000
|
|
|
|
|
|
2001-10-09 06:05:17 +00:00
|
|
|
|
/* The contents of this section are to be sorted based on the sum of
|
|
|
|
|
the symbol and addend values specified by the associated relocation
|
|
|
|
|
entries. Entries without associated relocation entries will be
|
|
|
|
|
appended to the end of the section in an unspecified order. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_SORT_ENTRIES 0x80000
|
|
|
|
|
|
2000-07-08 12:08:43 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LINK_ONCE 0x100000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* If SEC_LINK_ONCE is set, this bitfield describes how the linker
|
|
|
|
|
should handle duplicate sections. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES 0x600000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* This value for SEC_LINK_DUPLICATES means that duplicate
|
|
|
|
|
sections with the same name should simply be discarded. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_DISCARD 0x0
|
|
|
|
|
|
2000-07-08 12:08:43 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* This value for SEC_LINK_DUPLICATES means that the linker
|
|
|
|
|
should warn if any duplicate sections are a different size. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* This value for SEC_LINK_DUPLICATES means that the linker
|
|
|
|
|
should warn if any duplicate sections contain different
|
|
|
|
|
contents. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
|
|
|
|
|
|
2000-07-08 12:08:43 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_LINKER_CREATED 0x800000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* This section should not be subject to garbage collection. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define SEC_KEEP 0x1000000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* This section contains "short" data, and should be placed
|
|
|
|
|
"near" the GP. */
|
1999-08-09 03:20:31 +00:00
|
|
|
|
#define SEC_SMALL_DATA 0x2000000
|
1999-06-15 15:12:23 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* This section contains data which may be shared with other
|
|
|
|
|
executables or shared objects. */
|
1999-08-08 16:50:27 +00:00
|
|
|
|
#define SEC_SHARED 0x4000000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* When a section with this flag is being linked, then if the size of
|
|
|
|
|
the input section is less than a page, it should not cross a page
|
|
|
|
|
boundary. If the size of the input section is one page or more, it
|
|
|
|
|
should be aligned on a page boundary. */
|
2000-04-07 00:58:07 +00:00
|
|
|
|
#define SEC_BLOCK 0x8000000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Conditionally link this section; do not link if there are no
|
|
|
|
|
references found to any symbol in the section. */
|
2000-04-07 00:58:07 +00:00
|
|
|
|
#define SEC_CLINK 0x10000000
|
|
|
|
|
|
2001-04-13 00:34:36 +00:00
|
|
|
|
/* Attempt to merge identical entities in the section.
|
|
|
|
|
Entity size is given in the entsize field. */
|
|
|
|
|
#define SEC_MERGE 0x20000000
|
|
|
|
|
|
2001-04-15 01:02:54 +00:00
|
|
|
|
/* If given with SEC_MERGE, entities to merge are zero terminated
|
|
|
|
|
strings where entsize specifies character size instead of fixed
|
|
|
|
|
size entries. */
|
2001-04-13 00:34:36 +00:00
|
|
|
|
#define SEC_STRINGS 0x40000000
|
|
|
|
|
|
2001-10-09 06:05:17 +00:00
|
|
|
|
/* This section contains data about section groups. */
|
|
|
|
|
#define SEC_GROUP 0x80000000
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* End of section flags. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Some internal packed boolean fields. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* See the vma field. */
|
|
|
|
|
unsigned int user_set_vma : 1;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Whether relocations have been processed. */
|
|
|
|
|
unsigned int reloc_done : 1;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* A mark flag used by some of the linker backends. */
|
|
|
|
|
unsigned int linker_mark : 1;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-05-17 03:58:45 +00:00
|
|
|
|
/* Another mark flag used by some of the linker backends. Set for
|
2001-10-10 12:08:29 +00:00
|
|
|
|
output sections that have an input section. */
|
2001-05-17 03:58:45 +00:00
|
|
|
|
unsigned int linker_has_input : 1;
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* A mark flag used by some linker backends for garbage collection. */
|
|
|
|
|
unsigned int gc_mark : 1;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-10-09 06:05:17 +00:00
|
|
|
|
/* Used by the ELF code to mark sections which have been allocated
|
|
|
|
|
to segments. */
|
2000-08-03 19:40:29 +00:00
|
|
|
|
unsigned int segment_mark : 1;
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* End of internal packed boolean fields. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The virtual memory address of the section - where it will be
|
|
|
|
|
at run time. The symbols are relocated against this. The
|
|
|
|
|
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). */
|
|
|
|
|
bfd_vma vma;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The load address of the section - where it would be in a
|
|
|
|
|
rom image; really only used for writing section header
|
2002-01-30 18:12:17 +00:00
|
|
|
|
information. */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_vma lma;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The size of the section in octets, as it will be output.
|
|
|
|
|
Contains a value even if the section has no contents (e.g., the
|
|
|
|
|
size of <<.bss>>). This will be filled in after relocation. */
|
|
|
|
|
bfd_size_type _cooked_size;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The original size on disk of the section, in octets. Normally this
|
|
|
|
|
value is the same as the size, but if some relaxing has
|
|
|
|
|
been done, then this value will be bigger. */
|
|
|
|
|
bfd_size_type _raw_size;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* If this section is going to be output, then this value is the
|
|
|
|
|
offset in *bytes* into the output section of the first byte in the
|
|
|
|
|
input section (byte ==> smallest addressable unit on the
|
|
|
|
|
target). In most cases, if this was going to start at the
|
|
|
|
|
100th octet (8-bit quantity) in the output section, this value
|
|
|
|
|
would be 100. However, if the target byte size is 16 bits
|
|
|
|
|
(bfd_octets_per_byte is "2"), this value would be 50. */
|
|
|
|
|
bfd_vma output_offset;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The output section through which to map on output. */
|
|
|
|
|
struct sec *output_section;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The alignment requirement of the section, as an exponent of 2 -
|
|
|
|
|
e.g., 3 aligns to 2^3 (or 8). */
|
|
|
|
|
unsigned int alignment_power;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* If an input section, a pointer to a vector of relocation
|
|
|
|
|
records for the data in this section. */
|
|
|
|
|
struct reloc_cache_entry *relocation;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* 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;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The number of relocation records in one of the above. */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
unsigned reloc_count;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Information below is back end specific - and not always used
|
|
|
|
|
or updated. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* File position of section data. */
|
|
|
|
|
file_ptr filepos;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* File position of relocation info. */
|
|
|
|
|
file_ptr rel_filepos;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* File position of line data. */
|
|
|
|
|
file_ptr line_filepos;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Pointer to data for applications. */
|
|
|
|
|
PTR userdata;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* If the SEC_IN_MEMORY flag is set, this points to the actual
|
|
|
|
|
contents. */
|
|
|
|
|
unsigned char *contents;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Attached line number information. */
|
|
|
|
|
alent *lineno;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Number of line number records. */
|
|
|
|
|
unsigned int lineno_count;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-04-13 00:34:36 +00:00
|
|
|
|
/* Entity size for merging purposes. */
|
|
|
|
|
unsigned int entsize;
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Optional information about a COMDAT entry; NULL if not COMDAT. */
|
|
|
|
|
struct bfd_comdat_info *comdat;
|
1999-09-06 18:34:29 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* When a section is being output, this value changes as more
|
|
|
|
|
linenumbers are written out. */
|
|
|
|
|
file_ptr moving_line_filepos;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* What the section number is in the target world. */
|
|
|
|
|
int target_index;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
PTR used_by_bfd;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* 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;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The BFD which owns the section. */
|
|
|
|
|
bfd *owner;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A symbol which points at this section only. */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
struct symbol_cache_entry *symbol;
|
|
|
|
|
struct symbol_cache_entry **symbol_ptr_ptr;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
struct bfd_link_order *link_order_head;
|
|
|
|
|
struct bfd_link_order *link_order_tail;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
} asection;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +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
|
|
|
|
|
these sections. New code should use the section_ptr macros rather
|
|
|
|
|
than referring directly to the const sections. The const sections
|
|
|
|
|
may eventually vanish. */
|
1999-05-03 07:29:11 +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*"
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The absolute section. */
|
1999-05-03 07:29:11 +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)
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Pointer to the undefined section. */
|
1999-05-03 07:29:11 +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)
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Pointer to the common section. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
extern const asection bfd_com_section;
|
|
|
|
|
#define bfd_com_section_ptr ((asection *) &bfd_com_section)
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Pointer to the indirect section. */
|
1999-05-03 07:29:11 +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)
|
|
|
|
|
|
2001-11-19 15:35:38 +00:00
|
|
|
|
#define bfd_is_const_section(SEC) \
|
|
|
|
|
( ((SEC) == bfd_abs_section_ptr) \
|
|
|
|
|
|| ((SEC) == bfd_und_section_ptr) \
|
|
|
|
|
|| ((SEC) == bfd_com_section_ptr) \
|
|
|
|
|
|| ((SEC) == bfd_ind_section_ptr))
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
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;
|
|
|
|
|
#define bfd_get_section_size_before_reloc(section) \
|
2000-02-21 12:01:27 +00:00
|
|
|
|
((section)->reloc_done ? (abort (), (bfd_size_type) 1) \
|
|
|
|
|
: (section)->_raw_size)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_get_section_size_after_reloc(section) \
|
2000-02-21 12:01:27 +00:00
|
|
|
|
((section)->reloc_done ? (section)->_cooked_size \
|
|
|
|
|
: (abort (), (bfd_size_type) 1))
|
2002-01-05 13:11:33 +00:00
|
|
|
|
|
|
|
|
|
/* Macros to handle insertion and deletion of a bfd's sections. These
|
|
|
|
|
only handle the list pointers, ie. do not adjust section_count,
|
|
|
|
|
target_index etc. */
|
|
|
|
|
#define bfd_section_list_remove(ABFD, PS) \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
|
|
|
|
asection **_ps = PS; \
|
|
|
|
|
asection *_s = *_ps; \
|
|
|
|
|
*_ps = _s->next; \
|
|
|
|
|
if (_s->next == NULL) \
|
|
|
|
|
(ABFD)->section_tail = _ps; \
|
|
|
|
|
} \
|
|
|
|
|
while (0)
|
|
|
|
|
#define bfd_section_list_insert(ABFD, PS, S) \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
|
|
|
|
asection **_ps = PS; \
|
|
|
|
|
asection *_s = S; \
|
|
|
|
|
_s->next = *_ps; \
|
|
|
|
|
*_ps = _s; \
|
|
|
|
|
if (_s->next == NULL) \
|
|
|
|
|
(ABFD)->section_tail = &_s->next; \
|
|
|
|
|
} \
|
|
|
|
|
while (0)
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_section_list_clear PARAMS ((bfd *));
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
asection *
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-09-05 02:42:16 +00:00
|
|
|
|
char *
|
|
|
|
|
bfd_get_unique_section_name PARAMS ((bfd *abfd,
|
2000-09-06 00:22:01 +00:00
|
|
|
|
const char *templat,
|
2000-09-05 02:42:16 +00:00
|
|
|
|
int *count));
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
asection *
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_make_section_old_way PARAMS ((bfd *abfd, const char *name));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
asection *
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_make_section_anyway PARAMS ((bfd *abfd, const char *name));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
asection *
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_make_section PARAMS ((bfd *, const char *name));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_map_over_sections PARAMS ((bfd *abfd,
|
2000-12-21 18:20:04 +00:00
|
|
|
|
void (*func) (bfd *abfd,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
asection *sect,
|
|
|
|
|
PTR obj),
|
|
|
|
|
PTR obj));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_set_section_contents PARAMS ((bfd *abfd, asection *section,
|
|
|
|
|
PTR data, file_ptr offset,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_size_type count));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_get_section_contents PARAMS ((bfd *abfd, asection *section,
|
|
|
|
|
PTR location, file_ptr offset,
|
|
|
|
|
bfd_size_type count));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec,
|
|
|
|
|
bfd *obfd, asection *osec));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
|
|
|
|
|
BFD_SEND (obfd, _bfd_copy_private_section_data, \
|
|
|
|
|
(ibfd, isection, obfd, osection))
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
|
|
|
|
_bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group));
|
2002-06-04 01:05:21 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from archures.c. */
|
2000-11-08 23:57:04 +00:00
|
|
|
|
enum bfd_architecture
|
1999-05-03 07:29:11 +00:00
|
|
|
|
{
|
2002-01-31 09:24:16 +00:00
|
|
|
|
bfd_arch_unknown, /* File arch not known. */
|
|
|
|
|
bfd_arch_obscure, /* Arch known, not one of these. */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_m68k, /* Motorola 68xxx */
|
1999-05-03 07:29:11 +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
|
|
|
|
|
#define bfd_mach_cpu32 8
|
2001-03-06 20:15:27 +00:00
|
|
|
|
#define bfd_mach_mcf5200 9
|
|
|
|
|
#define bfd_mach_mcf5206e 10
|
|
|
|
|
#define bfd_mach_mcf5307 11
|
|
|
|
|
#define bfd_mach_mcf5407 12
|
2000-11-08 23:57:04 +00:00
|
|
|
|
bfd_arch_vax, /* DEC Vax */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_i960, /* Intel 960 */
|
|
|
|
|
/* The order of the following is important.
|
2000-11-08 23:57:04 +00:00
|
|
|
|
lower number indicates a machine type that
|
1999-05-03 07:29:11 +00:00
|
|
|
|
only accepts a subset of the instructions
|
|
|
|
|
available to machines with higher numbers.
|
|
|
|
|
The exception is the "ca", which is
|
2000-11-08 23:57:04 +00:00
|
|
|
|
incompatible with all other machines except
|
2002-01-31 09:24:16 +00:00
|
|
|
|
"core". */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
#define bfd_mach_i960_jx 7
|
|
|
|
|
#define bfd_mach_i960_hx 8
|
|
|
|
|
|
2002-01-31 17:33:08 +00:00
|
|
|
|
bfd_arch_or32, /* OpenRISC 32 */
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_a29k, /* AMD 29000 */
|
|
|
|
|
bfd_arch_sparc, /* SPARC */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_sparc 1
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_sparc_sparclet 2
|
|
|
|
|
#define bfd_mach_sparc_sparclite 3
|
|
|
|
|
#define bfd_mach_sparc_v8plus 4
|
2002-01-31 09:24:16 +00:00
|
|
|
|
#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_sparc_sparclite_le 6
|
|
|
|
|
#define bfd_mach_sparc_v9 7
|
2002-01-31 09:24:16 +00:00
|
|
|
|
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
|
|
|
|
|
#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
|
|
|
|
|
#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Nonzero if MACH has the v9 instruction set. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_sparc_v9_p(mach) \
|
2000-11-02 23:03:24 +00:00
|
|
|
|
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
|
2000-10-20 10:38:47 +00:00
|
|
|
|
&& (mach) != bfd_mach_sparc_sparclite_le)
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_mips, /* MIPS Rxxxx */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_mips3000 3000
|
|
|
|
|
#define bfd_mach_mips3900 3900
|
|
|
|
|
#define bfd_mach_mips4000 4000
|
|
|
|
|
#define bfd_mach_mips4010 4010
|
|
|
|
|
#define bfd_mach_mips4100 4100
|
|
|
|
|
#define bfd_mach_mips4111 4111
|
2002-09-30 11:53:56 +00:00
|
|
|
|
#define bfd_mach_mips4120 4120
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_mips4300 4300
|
|
|
|
|
#define bfd_mach_mips4400 4400
|
|
|
|
|
#define bfd_mach_mips4600 4600
|
|
|
|
|
#define bfd_mach_mips4650 4650
|
|
|
|
|
#define bfd_mach_mips5000 5000
|
2002-09-30 11:53:56 +00:00
|
|
|
|
#define bfd_mach_mips5400 5400
|
|
|
|
|
#define bfd_mach_mips5500 5500
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_mips6000 6000
|
|
|
|
|
#define bfd_mach_mips8000 8000
|
|
|
|
|
#define bfd_mach_mips10000 10000
|
2001-05-23 17:26:40 +00:00
|
|
|
|
#define bfd_mach_mips12000 12000
|
2000-09-15 18:52:52 +00:00
|
|
|
|
#define bfd_mach_mips16 16
|
2000-12-02 00:55:22 +00:00
|
|
|
|
#define bfd_mach_mips5 5
|
2000-12-02 01:10:33 +00:00
|
|
|
|
#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
|
2001-08-31 21:24:28 +00:00
|
|
|
|
#define bfd_mach_mipsisa32 32
|
|
|
|
|
#define bfd_mach_mipsisa64 64
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_i386, /* Intel 386 */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_i386_i386 1
|
|
|
|
|
#define bfd_mach_i386_i8086 2
|
|
|
|
|
#define bfd_mach_i386_i386_intel_syntax 3
|
|
|
|
|
#define bfd_mach_x86_64 64
|
|
|
|
|
#define bfd_mach_x86_64_intel_syntax 65
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_we32k, /* AT&T WE32xxx */
|
|
|
|
|
bfd_arch_tahoe, /* CCI/Harris Tahoe */
|
|
|
|
|
bfd_arch_i860, /* Intel 860 */
|
|
|
|
|
bfd_arch_i370, /* IBM 360/370 Mainframes */
|
|
|
|
|
bfd_arch_romp, /* IBM ROMP PC/RT */
|
|
|
|
|
bfd_arch_alliant, /* Alliant */
|
|
|
|
|
bfd_arch_convex, /* Convex */
|
|
|
|
|
bfd_arch_m88k, /* Motorola 88xxx */
|
2002-11-06 13:26:29 +00:00
|
|
|
|
bfd_arch_m98k, /* Motorola 98xxx */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_pyramid, /* Pyramid Technology */
|
|
|
|
|
bfd_arch_h8300, /* Hitachi H8/300 */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_h8300 1
|
|
|
|
|
#define bfd_mach_h8300h 2
|
|
|
|
|
#define bfd_mach_h8300s 3
|
2001-02-18 23:33:11 +00:00
|
|
|
|
bfd_arch_pdp11, /* DEC PDP-11 */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_powerpc, /* PowerPC */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_ppc 32
|
|
|
|
|
#define bfd_mach_ppc64 64
|
2000-06-16 20:45:33 +00:00
|
|
|
|
#define bfd_mach_ppc_403 403
|
|
|
|
|
#define bfd_mach_ppc_403gc 4030
|
|
|
|
|
#define bfd_mach_ppc_505 505
|
|
|
|
|
#define bfd_mach_ppc_601 601
|
|
|
|
|
#define bfd_mach_ppc_602 602
|
|
|
|
|
#define bfd_mach_ppc_603 603
|
|
|
|
|
#define bfd_mach_ppc_ec603e 6031
|
|
|
|
|
#define bfd_mach_ppc_604 604
|
|
|
|
|
#define bfd_mach_ppc_620 620
|
|
|
|
|
#define bfd_mach_ppc_630 630
|
|
|
|
|
#define bfd_mach_ppc_750 750
|
|
|
|
|
#define bfd_mach_ppc_860 860
|
|
|
|
|
#define bfd_mach_ppc_a35 35
|
|
|
|
|
#define bfd_mach_ppc_rs64ii 642
|
|
|
|
|
#define bfd_mach_ppc_rs64iii 643
|
|
|
|
|
#define bfd_mach_ppc_7400 7400
|
2002-08-19 21:12:34 +00:00
|
|
|
|
#define bfd_mach_ppc_e500 500
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_rs6000, /* IBM RS/6000 */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_rs6k 6000
|
2000-06-16 20:45:33 +00:00
|
|
|
|
#define bfd_mach_rs6k_rs1 6001
|
|
|
|
|
#define bfd_mach_rs6k_rsc 6003
|
|
|
|
|
#define bfd_mach_rs6k_rs2 6002
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_hppa, /* HP PA RISC */
|
|
|
|
|
bfd_arch_d10v, /* Mitsubishi D10V */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_d10v 1
|
1999-10-25 13:57:39 +00:00
|
|
|
|
#define bfd_mach_d10v_ts2 2
|
|
|
|
|
#define bfd_mach_d10v_ts3 3
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_d30v, /* Mitsubishi D30V */
|
2002-05-28 14:08:47 +00:00
|
|
|
|
bfd_arch_dlx, /* DLX */
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_m68hc11, /* Motorola 68HC11 */
|
|
|
|
|
bfd_arch_m68hc12, /* Motorola 68HC12 */
|
|
|
|
|
bfd_arch_z8k, /* Zilog Z8000 */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_z8001 1
|
|
|
|
|
#define bfd_mach_z8002 2
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_h8500, /* Hitachi H8/500 */
|
|
|
|
|
bfd_arch_sh, /* Hitachi SH */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_sh 1
|
bfd:
Reinstate bits of sh4 support that got accidentally deleted.
Add sh-dsp support.
bfd:
* archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros.
(bfd_mach_sh3_dsp): Likewise.
(bfd_mach_sh4): Reinstate.
(bfd_default_scan): Recognize 7410, 7708, 7729 and 7750.
* bfd-in2.h: Regenerate.
* coff-sh.c (struct sh_opcode): flags is no longer short.
(USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros.
(sh_opcode41, sh_opcode42): Integrate as sh_opcode41.
(sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes.
(sh_opcode41, sh_opcode4, sh_opcode80): Likewise.
(sh_opcodes): No longer const.
(sh_dsp_opcodef0, sh_dsp_opcodef): New arrays.
(sh_insn_uses_reg): Check for USESAS and USESR8.
(sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS.
(_bfd_sh_align_load_span): Return early for SH4.
Modify sh_opcodes lookup table for sh-dsp / sh3-dsp.
Take into account that field b of a parallel processing insn
could be mistaken for a separate insn.
* cpu-sh.c (arch_info_struct): New array elements for
sh2, sh-dsp and sh3-dsp.
Reinstate element for sh4.
(SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros.
(SH4_NEXT): Reinstate.
(SH3_NEXT, SH3E_NEXT): Adjust.
* elf-bfd.h (_sh_elf_set_mach_from_flags): Declare.
* elf32-sh.c (sh_elf_set_private_flags): New function.
(sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise.
(sh_elf_merge_private_data): New function.
(elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define.
(bfd_elf32_bfd_copy_private_bfd_data): Define.
(bfd_elf32_bfd_merge_private_bfd_data): Change to
sh_elf_merge_private_data.
gas:
* config/tc-sh.c ("elf/sh.h"): Include.
(sh_dsp, valid_arch, reg_x, reg_y, reg_efg): New static variables.
(md.begin): Initialize target_arch.
Only include opcodes in has table that match selected architecture.
(parse_reg): Recognize register names for sh-dsp.
(parse_at): Recognize post-modify addressing.
(get_operands): The leading space is now optional.
(get_specific): Remove FDREG_N support. Add support for sh-dsp
arguments. Update valid_arch.
(build_Mytes): Add support for SDT_REG_N.
(find_cooked_opcode): New function, broken out of md_assemble.
(assemble_ppi, sh_elf_final_processing): New functions.
(md_assemble): Use find_cooked_opcode and assemble_ppi.
(md_longopts, md_parse_option): New option: -dsp.
* config/tc-sh.h (elf_tc_final_processing): Define.
(sh_elf_final_processing): Declare.
include/elf:
* sh.h: (EF_SH_MACH_MASK, EF_SH_UNKNOWN, EF_SH1, EF_SH2): New macros.
(EF_SH3, EF_SH_HAS_DSP, EF_SH_DSP, EF_SH3_DSP): Likewise.
(EF_SH_HAS_FP, EF_SH3E, EF_SH4, EF_SH_MERGE_MACH): Likewise.
opcodes:
* sh-dis.c (print_movxy, print_insn_ddt, print_dsp_reg): New functions.
(print_insn_ppi): Likewise.
(print_insn_shx): Use info->mach to select appropriate insn set.
Add support for sh-dsp. Remove FD_REG_N support.
* sh-opc.h (sh_nibble_type): Add new values for sh-dsp support.
(sh_arg_type): Likewise. Remove FD_REG_N.
(sh_dsp_reg_nums): New enum.
(arch_sh1, arch_sh2, arch_sh3, arch_sh3e, arch_sh4): New macros.
(arch_sh_dsp, arch_sh3_dsp, arch_sh1_up, arch_sh2_up): Likewise.
(arch_sh3_up, arch_sh3e_up, arch_sh4_up, arch_sh_dsp_up): Likewise.
(arch_sh3_dsp_up): Likewise.
(sh_opcode_info): New field: arch.
(sh_table): Split up insn with FD_REG_N into ones with F_REG_N and
D_REG_N. Fill in arch field. Add sh-dsp insns.
2000-02-17 00:33:36 +00:00
|
|
|
|
#define bfd_mach_sh2 0x20
|
|
|
|
|
#define bfd_mach_sh_dsp 0x2d
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_sh3 0x30
|
bfd:
Reinstate bits of sh4 support that got accidentally deleted.
Add sh-dsp support.
bfd:
* archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros.
(bfd_mach_sh3_dsp): Likewise.
(bfd_mach_sh4): Reinstate.
(bfd_default_scan): Recognize 7410, 7708, 7729 and 7750.
* bfd-in2.h: Regenerate.
* coff-sh.c (struct sh_opcode): flags is no longer short.
(USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros.
(sh_opcode41, sh_opcode42): Integrate as sh_opcode41.
(sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes.
(sh_opcode41, sh_opcode4, sh_opcode80): Likewise.
(sh_opcodes): No longer const.
(sh_dsp_opcodef0, sh_dsp_opcodef): New arrays.
(sh_insn_uses_reg): Check for USESAS and USESR8.
(sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS.
(_bfd_sh_align_load_span): Return early for SH4.
Modify sh_opcodes lookup table for sh-dsp / sh3-dsp.
Take into account that field b of a parallel processing insn
could be mistaken for a separate insn.
* cpu-sh.c (arch_info_struct): New array elements for
sh2, sh-dsp and sh3-dsp.
Reinstate element for sh4.
(SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros.
(SH4_NEXT): Reinstate.
(SH3_NEXT, SH3E_NEXT): Adjust.
* elf-bfd.h (_sh_elf_set_mach_from_flags): Declare.
* elf32-sh.c (sh_elf_set_private_flags): New function.
(sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise.
(sh_elf_merge_private_data): New function.
(elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define.
(bfd_elf32_bfd_copy_private_bfd_data): Define.
(bfd_elf32_bfd_merge_private_bfd_data): Change to
sh_elf_merge_private_data.
gas:
* config/tc-sh.c ("elf/sh.h"): Include.
(sh_dsp, valid_arch, reg_x, reg_y, reg_efg): New static variables.
(md.begin): Initialize target_arch.
Only include opcodes in has table that match selected architecture.
(parse_reg): Recognize register names for sh-dsp.
(parse_at): Recognize post-modify addressing.
(get_operands): The leading space is now optional.
(get_specific): Remove FDREG_N support. Add support for sh-dsp
arguments. Update valid_arch.
(build_Mytes): Add support for SDT_REG_N.
(find_cooked_opcode): New function, broken out of md_assemble.
(assemble_ppi, sh_elf_final_processing): New functions.
(md_assemble): Use find_cooked_opcode and assemble_ppi.
(md_longopts, md_parse_option): New option: -dsp.
* config/tc-sh.h (elf_tc_final_processing): Define.
(sh_elf_final_processing): Declare.
include/elf:
* sh.h: (EF_SH_MACH_MASK, EF_SH_UNKNOWN, EF_SH1, EF_SH2): New macros.
(EF_SH3, EF_SH_HAS_DSP, EF_SH_DSP, EF_SH3_DSP): Likewise.
(EF_SH_HAS_FP, EF_SH3E, EF_SH4, EF_SH_MERGE_MACH): Likewise.
opcodes:
* sh-dis.c (print_movxy, print_insn_ddt, print_dsp_reg): New functions.
(print_insn_ppi): Likewise.
(print_insn_shx): Use info->mach to select appropriate insn set.
Add support for sh-dsp. Remove FD_REG_N support.
* sh-opc.h (sh_nibble_type): Add new values for sh-dsp support.
(sh_arg_type): Likewise. Remove FD_REG_N.
(sh_dsp_reg_nums): New enum.
(arch_sh1, arch_sh2, arch_sh3, arch_sh3e, arch_sh4): New macros.
(arch_sh_dsp, arch_sh3_dsp, arch_sh1_up, arch_sh2_up): Likewise.
(arch_sh3_up, arch_sh3e_up, arch_sh4_up, arch_sh_dsp_up): Likewise.
(arch_sh3_dsp_up): Likewise.
(sh_opcode_info): New field: arch.
(sh_table): Split up insn with FD_REG_N into ones with F_REG_N and
D_REG_N. Fill in arch field. Add sh-dsp insns.
2000-02-17 00:33:36 +00:00
|
|
|
|
#define bfd_mach_sh3_dsp 0x3d
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_sh3e 0x3e
|
bfd:
Reinstate bits of sh4 support that got accidentally deleted.
Add sh-dsp support.
bfd:
* archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros.
(bfd_mach_sh3_dsp): Likewise.
(bfd_mach_sh4): Reinstate.
(bfd_default_scan): Recognize 7410, 7708, 7729 and 7750.
* bfd-in2.h: Regenerate.
* coff-sh.c (struct sh_opcode): flags is no longer short.
(USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros.
(sh_opcode41, sh_opcode42): Integrate as sh_opcode41.
(sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes.
(sh_opcode41, sh_opcode4, sh_opcode80): Likewise.
(sh_opcodes): No longer const.
(sh_dsp_opcodef0, sh_dsp_opcodef): New arrays.
(sh_insn_uses_reg): Check for USESAS and USESR8.
(sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS.
(_bfd_sh_align_load_span): Return early for SH4.
Modify sh_opcodes lookup table for sh-dsp / sh3-dsp.
Take into account that field b of a parallel processing insn
could be mistaken for a separate insn.
* cpu-sh.c (arch_info_struct): New array elements for
sh2, sh-dsp and sh3-dsp.
Reinstate element for sh4.
(SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros.
(SH4_NEXT): Reinstate.
(SH3_NEXT, SH3E_NEXT): Adjust.
* elf-bfd.h (_sh_elf_set_mach_from_flags): Declare.
* elf32-sh.c (sh_elf_set_private_flags): New function.
(sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise.
(sh_elf_merge_private_data): New function.
(elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define.
(bfd_elf32_bfd_copy_private_bfd_data): Define.
(bfd_elf32_bfd_merge_private_bfd_data): Change to
sh_elf_merge_private_data.
gas:
* config/tc-sh.c ("elf/sh.h"): Include.
(sh_dsp, valid_arch, reg_x, reg_y, reg_efg): New static variables.
(md.begin): Initialize target_arch.
Only include opcodes in has table that match selected architecture.
(parse_reg): Recognize register names for sh-dsp.
(parse_at): Recognize post-modify addressing.
(get_operands): The leading space is now optional.
(get_specific): Remove FDREG_N support. Add support for sh-dsp
arguments. Update valid_arch.
(build_Mytes): Add support for SDT_REG_N.
(find_cooked_opcode): New function, broken out of md_assemble.
(assemble_ppi, sh_elf_final_processing): New functions.
(md_assemble): Use find_cooked_opcode and assemble_ppi.
(md_longopts, md_parse_option): New option: -dsp.
* config/tc-sh.h (elf_tc_final_processing): Define.
(sh_elf_final_processing): Declare.
include/elf:
* sh.h: (EF_SH_MACH_MASK, EF_SH_UNKNOWN, EF_SH1, EF_SH2): New macros.
(EF_SH3, EF_SH_HAS_DSP, EF_SH_DSP, EF_SH3_DSP): Likewise.
(EF_SH_HAS_FP, EF_SH3E, EF_SH4, EF_SH_MERGE_MACH): Likewise.
opcodes:
* sh-dis.c (print_movxy, print_insn_ddt, print_dsp_reg): New functions.
(print_insn_ppi): Likewise.
(print_insn_shx): Use info->mach to select appropriate insn set.
Add support for sh-dsp. Remove FD_REG_N support.
* sh-opc.h (sh_nibble_type): Add new values for sh-dsp support.
(sh_arg_type): Likewise. Remove FD_REG_N.
(sh_dsp_reg_nums): New enum.
(arch_sh1, arch_sh2, arch_sh3, arch_sh3e, arch_sh4): New macros.
(arch_sh_dsp, arch_sh3_dsp, arch_sh1_up, arch_sh2_up): Likewise.
(arch_sh3_up, arch_sh3e_up, arch_sh4_up, arch_sh_dsp_up): Likewise.
(arch_sh3_dsp_up): Likewise.
(sh_opcode_info): New field: arch.
(sh_table): Split up insn with FD_REG_N into ones with F_REG_N and
D_REG_N. Fill in arch field. Add sh-dsp insns.
2000-02-17 00:33:36 +00:00
|
|
|
|
#define bfd_mach_sh4 0x40
|
Contribute sh64-elf.
2002-01-23 Alexandre Oliva <aoliva@redhat.com>
* reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16,
R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16,
R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16,
R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16,
R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16,
R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16,
R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16,
R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8,
R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64):
New relocs.
* libbfd.h, bfd-in2.h: Rebuilt.
* elf32-sh.c (sh_elf_howto_table): Define new relocs.
(sh_reloc_map): Map them.
(PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be,
elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry,
elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset,
elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset,
movi_shori_putval) [INCLUDE_SHMEDIA]: New.
(elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add
datalabel_got_offset.
(sh_elf_link_hash_newfunc): Initialize it.
(sh_elf_relocate_section): Augment the scope of
seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT,
GOT and GOTOFF handling to new SHmedia relocation types. Support
GOT_BIAS.
(sh_elf_check_relocs): Likewise.
(sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in
PLT entries using movi_shori_putval. Support GOT_BIAS.
(sh_elf_finish_dynamic_sections): Likewise.
* elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to
relocation, it's now done by the caller.
(GOT_BIAS): New.
* elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt,
elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset,
elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset,
elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER,
elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry,
elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse,
sh64_elf64_hash_table): New.
(sh_elf64_howto_table): Introduce new relocs.
(sh_elf64_info_to_howto): Accept new PIC relocs.
(sh_elf64_relocate_section): Augment the scope of
seen_stt_datalabel. Support new PIC relocs.
(sh_elf64_check_relocs): Support new PIC relocs.
(elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le,
elf_sh64_plt_entry_be, elf_sh64_plt_entry_le,
elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le,
elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry,
sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create,
movi_shori_putval, movi_3shori_putval,
sh64_elf64_create_dynamic_sections,
sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies,
sh64_elf64_size_dynamic_sections,
sh64_elf64_finish_dynamic_symbol,
sh64_elf64_finish_dynamic_sections): New.
(elf_backend_create_dynamic-sections,
bfd_elf64_bfd_link_hash_table_create,
elf_backend_adjust_dynamic_symbol,
elf_backend_size_dynamic_sections,
elf_backend_finish_dynamic_symbol,
elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
elf_backend_plt_readonly, elf_backend_want_plt_sym,
elf_backend_got_header_size, elf_backend_plt_header_size):
Define.
2001-05-16 Alexandre Oliva <aoliva@redhat.com>
* elf32-sh.c: Renumbered and renamed some SH5 relocations to
match official numbers and names; moved unmaching ones to the
range 0xf2-0xff.
* elf32-sh64.c, elf64-sh64.c: Likewise.
2001-03-12 DJ Delorie <dj@redhat.com>
* elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia
sections.
2001-03-12 DJ Delorie <dj@redhat.com>
* elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must
be aligned.
* elf64-sh64.c (sh_elf64_relocate_section): Ditto.
2001-01-14 Hans-Peter Nilsson <hpn@cygnus.com>
* elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define.
(sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a
.cranges section with SEC_SORT_ENTRIES set.
(sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an
incoming sorted .cranges section.
(sh64_bfd_elf_copy_private_section_data): New.
(sh64_elf_final_write_processing): Only sort .cranges and modify
start address if called by linker.
2001-01-08 Ben Elliston <bje@redhat.com>
* elf32-sh64.c (sh64_elf_final_write_processing): Activate
Hans-Peter Nilsson's set bit 0 patch from 2001-01-06.
* elf64-sh64.c (sh64_elf64_final_write_processing): Ditto.
2001-01-06 Hans-Peter Nilsson <hpn@cygnus.com>
* elf64-sh64.c (sh_elf64_howto_table): No open brace at start of
line. Add comments before all entries.
<R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct and clarify describing
comment.
(sh_elf64_reloc): Correct head comment.
(sh_elf64_relocate_section): Correct spacing.
<relocating for a local symbol>: Do not honour STO_SH5_ISA32;
instead call reloc_dangerous callback.
<case R_SH_SHMEDIA_CODE>: New case.
(sh_elf64_gc_mark_hook): Correct spacing.
(sh_elf64_check_relocs): Ditto.
* elf32-sh64.c (shmedia_prepare_reloc) <case R_SH_SHMEDIA_CODE>:
New case.
* elf32-sh.c: Correct #endif comments for #ifndef-wrapped
functions.
(sh_elf_howto_table) <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct,
clarify describing comment. Add comments before all entries.
(sh_elf_relocate_section) <relocating for a local symbol>: Do not
honour STO_SH5_ISA32; instead call reloc_dangerous callback.
2001-01-06 Hans-Peter Nilsson <hpn@cygnus.com>
Sort .cranges section in final link. Prepare to set bit 0 on
entry address.
* elf32-sh64.c (struct sh64_find_section_vma_data): New.
(sh64_elf_link_output_symbol_hook): Fix typo in prototype.
(sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming
.cranges section.
(sh64_backend_section_from_shdr): New, to recognize
SHT_SH5_CR_SORTED on incoming .cranges section.
(elf_backend_section_from_shdr): Define.
(sh64_elf_final_write_processing): Sort outgoing .cranges
section. (New, temporarily disabled:) Set bit 0 on entry address
according to ISA type.
(sh64_find_section_for_address): New.
(crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb,
crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c.
(sh64_address_in_cranges): Move here from opcodes/sh64-dis.c. Use
bfd_malloc, not xmalloc.
(sh64_get_contents_type): Move here from opcodes/sh64-dis.c. Make
global.
* elf32-sh64.c (sh64_elf64_final_write_processing): New, (but
temporarily disabled) setting bit 0 on entry address.
(elf_backend_final_write_processing): Define.
2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com>
* elf32-sh.c (sh_elf_howto_table) <R_SH_PT_16>: Adjust fields to
be a proper relocation for PTA and PTB rather than a marker.
<R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2,
R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16,
R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16,
R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL,
R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL>:
Zero src_mask.
* elf64-sh64.c: Ditto.
(sh_elf64_relocate_section) <case R_SH_PT_16>: New case.
* elf32-sh64.c: Include opcodes/sh64-opc.h
(shmedia_prepare_reloc): Take a bfd_link_info pointer as first
argument. Drop const qualifiers from "bfd *" and "bfd_byte *"
parameters. No unused parameters. Caller changed.
<case R_SH_PT_16>: New case.
* Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h.
* Makefile.in: Regenerate.
2000-12-30 Hans-Peter Nilsson <hpn@cygnus.com>
* elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for
all code sections.
(sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
(sh64_elf_merge_private_data): Ditto.
* elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data
to access stored section flags.
(sh64_elf_final_write_processing): Return immediately unless
called by linker. Use sh64_elf_section_data (cranges) to get size
of linker-generated cranges entries.
(sh64_elf_copy_private_data): Add missing "return true".
(sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
(sh_elf64_merge_private_data): Ditto.
2000-12-19 Hans-Peter Nilsson <hpn@cygnus.com>
* elf64-sh64.c (sh64_elf64_fake_sections): New, copy of
elf64-sh64.c:sh64_elf_fake_sections.
(elf_backend_fake_sections): Define as sh64_elf64_fake_sections.
2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com>
* elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete.
(sh64_elf_final_write_processing): New.
(elf_backend_final_write_processing): Define.
(sh64_elf_fake_sections): Get header flags from tdata field.
(sh64_elf_copy_private_data): Do not call
sh64_elf_copy_private_data_internal, just copy e_flags field.
(sh64_elf_merge_private_data): Do not call
sh64_elf_copy_private_data_internal.
2000-12-12 Hans-Peter Nilsson <hpn@cygnus.com>
Remove EF_SH64_ABI64, let ELF size make difference.
Remove SH64-specific BFD section flag.
* elf32-sh64.c (sh64_elf_fake_sections): Recognize section as
containing SHmedia through elf_section_data (asect)->tdata
non-zero, not using a BFD section flag.
(sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64.
(sh64_elf_merge_private_data): Similar.
(elf_backend_section_flags): Don't define.
(sh64_elf_backend_section_flags): Delete.
* elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64,
not EF_SH64_ABI64.
(sh_elf64_merge_private_data): Similar.
* section.c (Section flags definitions): Don't define
SEC_SH_ISA_SHMEDIA.
(bfd-in2.h): Regenerate.
2000-12-09 Hans-Peter Nilsson <hpn@cygnus.com>
Make DataLabel references work with partial linking.
* elf32-sh64.c: Fix formatting.
(sh64_elf_link_output_symbol_hook): New.
(elf_backend_link_output_symbol_hook): Define to
sh64_elf_link_output_symbol_hook.
(sh64_elf_add_symbol_hook): Make DataLabel symbol just global
undefined if partial linking. Adjust sanity check.
* elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New.
(elf_backend_link_output_symbol_hook): Define to
sh64_elf64_link_output_symbol_hook.
(sh64_elf64_add_symbol_hook): Make DataLabel symbol just global
undefined if partial linking. Adjust sanity check.
2000-12-07 Hans-Peter Nilsson <hpn@cygnus.com>
Implement semantics for inter-file DataLabel references.
* elf64-sh64.c (DATALABEL_SUFFIX): Define.
(sh64_elf64_add_symbol_hook): New.
(sh_elf64_relocate_section): If passing an indirect symbol with
st_type STT_DATALABEL on the way to a symbol with st_other
STO_SH5_ISA32, do not bitor 1 to the relocation.
(elf_backend_add_symbol_hook): Define to
sh64_elf64_add_symbol_hook.
* elf64-sh32.c: Tweak comments.
(DATALABEL_SUFFIX): Define.
(sh64_elf_add_symbol_hook): New.
(elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook.
* elf32-sh.c (sh_elf_relocate_section): If passing an indirect
symbol with st_type STT_DATALABEL on the way to a symbol with
st_other STO_SH5_ISA32, do not bitor 1 to the relocation.
2000-12-05 Hans-Peter Nilsson <hpn@cygnus.com>
Pass through STT_DATALABEL.
* elf32-sh64.c (sh64_elf_get_symbol_type): New.
(elf_backend_get_symbol_type): Define.
* elf64-sh64.c (sh64_elf64_get_symbol_type): New.
(elf_backend_get_symbol_type): Define.
2000-11-30 Hans-Peter Nilsson <hpn@cygnus.com>
* elf32-sh64.c: Tweak comments.
(sh64_elf_copy_private_data_internal): Add prototype.
(bfd_elf32_bfd_set_private_flags): Define.
(sh64_elf_copy_private_data_internal): Compare machine name, not
textual BFD target name, to check whether to copy section flag
SHF_SH5_ISA32.
(sh64_elf_merge_private_data): Validize bfd_get_arch_size.
Tweak section-contents-type-mismatch message.
(shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers.
Validize reloc-types.
* elf64-sh64.c: New file.
* targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare.
* Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo.
(BFD64_BACKENDS_CFILES): Add elf64-sh64.c.
Regenerate dependencies.
* Makefile.in: Regenerate.
* config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and
bfd_elf64_sh64l_vec.
* configure.in: Handle bfd_elf64_sh64_vec and
bfd_elf64_sh64l_vec.
* configure: Regenerate.
* po/POTFILES.in: Regenerate.
* po/bfd.pot: Regenerate.
2000-11-29 Hans-Peter Nilsson <hpn@cygnus.com>
* elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize
anything else but EF_SH64 and EF_SH64_ABI64.
(sh64_elf_merge_private_data): Emit error for anything else but
EF_SH64 and EF_SH64_ABI64.
* config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec
from targ_selvecs.
* configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and
bfd_elf32_sh64l_vec as a temporary measure.
* configure: Regenerate.
2000-11-27 Hans-Peter Nilsson <hpn@cygnus.com>
* cpu-sh.c (arch_info_struct): Include sh5 item
unconditionalized.
* config.bfd (sh64-*-elf*): Do not set targ_cflags.
Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec,
bfd_elf32_shblin_vec and bfd_elf32_shlin_vec.
* elf32-sh64.c: Tweak comments.
(sh64_elf_set_mach_from_flags): Recognize all machine flags that
are proper subsets of SH64 as bfd_mach_sh5. Add EF_SH64_ABI64.
(sh64_elf_copy_private_data_internal): Wrap long line.
(sh64_elf_merge_private_data): Rewrite to allow objects from
SH64 subsets to be linked together.
(INCLUDE_SHMEDIA): Define.
* elf32-sh.c (sh_elf_relocate_section) <local symbol>:
Parenthesize plus-expression inside or-expression.
<global symbol>: Ditto.
(sh_elf_set_mach_from_flags): Remove code refusing
deleted EF_SH64_32BIT_ABI flag.
2000-11-26 Hans-Peter Nilsson <hpn@cygnus.com>
* elf32-sh.c (sh_elf_howto_table) <R_SH_IMM_LOW16_PCREL,
R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16_PCREL,
R_SH_IMM_HI16_PCREL, R_SH_64_PCREL>: Set pcrel_offset to true.
(sh_elf_relocate_section) <local symbol>: Or 1 in
calculation of relocation if sym->st_other & STO_SH5_ISA32.
<global symbol>: Ditto if h->other & STO_SH5_ISA32.
* elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to
relocation.
2000-11-24 Hans-Peter Nilsson <hpn@cygnus.com>
* Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo.
(BFD32_BACKENDS_CFILES): Add elf32-sh64.c.
Regenerate dependencies.
* Makefile.in: Regenerate.
* archures.c: Add bfd_mach_sh5.
* config.bfd: Map targ_cpu sh* to bfd_sh_arch.
Handle sh64-*-elf*. Set targ_cflags to -DINCLUDE_SHMEDIA.
* configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec.
* configure: Regenerate.
* reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5,
BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6,
BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2,
BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8,
BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16,
BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16,
BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16,
BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16,
BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations.
* cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link
in item for SH5.
* elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items
for SHmedia relocs.
[INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs.
[INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call
shmedia_prepare_reloc, goto final_link_relocate if it returns
non-zero, else fail as before.
(sh_elf_set_mach_from_flags): Provide function only if not defined
as macro. Do not recognize objects with EF_SH64_32BIT_ABI set.
(sh_elf_set_private_flags): Provide function only if not defined
as a macro.
(sh_elf_copy_private_data): Similar.
(sh_elf_merge_private_data): Similar.
* section.c (SEC_SH_ISA_SHMEDIA): New.
* targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare.
* elf32-sh64.c: New file.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* po/POTFILES.in: Regenerate.
* po/bfd.pot: Regenerate.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
2002-02-08 05:33:27 +00:00
|
|
|
|
#define bfd_mach_sh5 0x50
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_alpha, /* Dec Alpha */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_alpha_ev4 0x10
|
|
|
|
|
#define bfd_mach_alpha_ev5 0x20
|
|
|
|
|
#define bfd_mach_alpha_ev6 0x30
|
2002-01-31 09:24:16 +00:00
|
|
|
|
bfd_arch_arm, /* Advanced Risc Machines ARM. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_arm_2 1
|
1999-07-05 07:28:24 +00:00
|
|
|
|
#define bfd_mach_arm_2a 2
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_arm_3 3
|
|
|
|
|
#define bfd_mach_arm_3M 4
|
1999-07-05 07:28:24 +00:00
|
|
|
|
#define bfd_mach_arm_4 5
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_arm_4T 6
|
1999-07-05 07:28:24 +00:00
|
|
|
|
#define bfd_mach_arm_5 7
|
|
|
|
|
#define bfd_mach_arm_5T 8
|
2000-11-25 00:21:40 +00:00
|
|
|
|
#define bfd_mach_arm_5TE 9
|
|
|
|
|
#define bfd_mach_arm_XScale 10
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_ns32k, /* National Semiconductors ns32000 */
|
|
|
|
|
bfd_arch_w65, /* WDC 65816 */
|
|
|
|
|
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
|
2002-08-28 10:38:51 +00:00
|
|
|
|
bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
|
|
|
|
|
#define bfd_mach_c3x 30
|
|
|
|
|
#define bfd_mach_c4x 40
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
|
|
|
|
|
bfd_arch_tic80, /* TI TMS320c80 (MVP) */
|
|
|
|
|
bfd_arch_v850, /* NEC V850 */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_v850 1
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_v850e 'E'
|
2001-01-11 21:20:20 +00:00
|
|
|
|
bfd_arch_arc, /* ARC Cores */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_arc_5 5
|
|
|
|
|
#define bfd_mach_arc_6 6
|
|
|
|
|
#define bfd_mach_arc_7 7
|
|
|
|
|
#define bfd_mach_arc_8 8
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_m32r, /* Mitsubishi M32R/D */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_m32r 1 /* For backwards compatibility. */
|
1999-10-05 01:14:20 +00:00
|
|
|
|
#define bfd_mach_m32rx 'x'
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_mn10200, /* Matsushita MN10200 */
|
|
|
|
|
bfd_arch_mn10300, /* Matsushita MN10300 */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_mach_mn10300 300
|
2000-02-13 22:45:29 +00:00
|
|
|
|
#define bfd_mach_am33 330
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_arch_fr30,
|
|
|
|
|
#define bfd_mach_fr30 0x46523330
|
2002-06-18 21:10:55 +00:00
|
|
|
|
bfd_arch_frv,
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_frv 1
|
|
|
|
|
#define bfd_mach_frvsimple 2
|
2002-06-18 21:10:55 +00:00
|
|
|
|
#define bfd_mach_fr300 300
|
|
|
|
|
#define bfd_mach_fr400 400
|
|
|
|
|
#define bfd_mach_frvtomcat 499 /* fr500 prototype */
|
|
|
|
|
#define bfd_mach_fr500 500
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_arch_mcore,
|
2000-07-08 12:08:43 +00:00
|
|
|
|
bfd_arch_ia64, /* HP/Intel ia64 */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_ia64_elf64 64
|
|
|
|
|
#define bfd_mach_ia64_elf32 32
|
2002-07-17 14:15:52 +00:00
|
|
|
|
bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_ip2022 1
|
|
|
|
|
#define bfd_mach_ip2022ext 2
|
1999-09-04 17:07:46 +00:00
|
|
|
|
bfd_arch_pj,
|
2002-01-31 09:24:16 +00:00
|
|
|
|
bfd_arch_avr, /* Atmel AVR microcontrollers. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
#define bfd_mach_avr1 1
|
|
|
|
|
#define bfd_mach_avr2 2
|
|
|
|
|
#define bfd_mach_avr3 3
|
|
|
|
|
#define bfd_mach_avr4 4
|
2000-06-27 01:45:30 +00:00
|
|
|
|
#define bfd_mach_avr5 5
|
2000-07-20 16:21:07 +00:00
|
|
|
|
bfd_arch_cris, /* Axis CRIS */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
bfd_arch_s390, /* IBM s390 */
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_s390_31 31
|
|
|
|
|
#define bfd_mach_s390_64 64
|
2001-04-24 15:08:16 +00:00
|
|
|
|
bfd_arch_openrisc, /* OpenRISC */
|
2002-01-31 09:24:16 +00:00
|
|
|
|
bfd_arch_mmix, /* Donald Knuth's educational processor. */
|
2001-12-08 03:46:03 +00:00
|
|
|
|
bfd_arch_xstormy16,
|
* archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
bfd_mach_ip2022, bfd_mach_ip2022ext,
bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
* bfd-in2.h: Regenerate.
2002-10-14 05:16:42 +00:00
|
|
|
|
#define bfd_mach_xstormy16 1
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_arch_last
|
|
|
|
|
};
|
|
|
|
|
|
2000-11-08 23:57:04 +00:00
|
|
|
|
typedef struct bfd_arch_info
|
1999-05-03 07:29:11 +00:00
|
|
|
|
{
|
|
|
|
|
int bits_per_word;
|
|
|
|
|
int bits_per_address;
|
|
|
|
|
int bits_per_byte;
|
|
|
|
|
enum bfd_architecture arch;
|
|
|
|
|
unsigned long mach;
|
|
|
|
|
const char *arch_name;
|
|
|
|
|
const char *printable_name;
|
|
|
|
|
unsigned int section_align_power;
|
2002-04-20 03:25:20 +00:00
|
|
|
|
/* True if this is the default machine for the architecture.
|
|
|
|
|
The default arch should be the first entry for an arch so that
|
|
|
|
|
all the entries for that arch can be accessed via <<next>>. */
|
2000-11-08 23:57:04 +00:00
|
|
|
|
boolean the_default;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
const struct bfd_arch_info * (*compatible)
|
|
|
|
|
PARAMS ((const struct bfd_arch_info *a,
|
|
|
|
|
const struct bfd_arch_info *b));
|
|
|
|
|
|
|
|
|
|
boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
|
|
|
|
|
|
|
|
|
|
const struct bfd_arch_info *next;
|
2002-01-31 17:33:08 +00:00
|
|
|
|
}
|
|
|
|
|
bfd_arch_info_type;
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
const char *
|
|
|
|
|
bfd_printable_name PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
const bfd_arch_info_type *
|
|
|
|
|
bfd_scan_arch PARAMS ((const char *string));
|
|
|
|
|
|
|
|
|
|
const char **
|
|
|
|
|
bfd_arch_list PARAMS ((void));
|
|
|
|
|
|
|
|
|
|
const bfd_arch_info_type *
|
|
|
|
|
bfd_arch_get_compatible PARAMS ((
|
|
|
|
|
const bfd *abfd,
|
|
|
|
|
const bfd *bbfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_arch_info PARAMS ((bfd *abfd, const bfd_arch_info_type *arg));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
enum bfd_architecture
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_get_arch PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
unsigned long
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_get_mach PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
unsigned int
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_arch_bits_per_byte PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
unsigned int
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_arch_bits_per_address PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
const bfd_arch_info_type *
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_get_arch_info PARAMS ((bfd *abfd));
|
|
|
|
|
|
|
|
|
|
const bfd_arch_info_type *
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_lookup_arch PARAMS ((enum bfd_architecture
|
1999-05-03 07:29:11 +00:00
|
|
|
|
arch,
|
|
|
|
|
unsigned long machine));
|
|
|
|
|
|
|
|
|
|
const char *
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_printable_arch_mach PARAMS ((enum bfd_architecture arch, unsigned long machine));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
unsigned int
|
2000-01-13 22:10:36 +00:00
|
|
|
|
bfd_octets_per_byte PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
unsigned int
|
2000-01-13 22:10:36 +00:00
|
|
|
|
bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch,
|
2000-02-13 22:45:29 +00:00
|
|
|
|
unsigned long machine));
|
2000-01-13 22:10:36 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from reloc.c. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
typedef enum bfd_reloc_status
|
|
|
|
|
{
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* No errors detected. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_ok,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The relocation was performed, but there was an overflow. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_overflow,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The address to relocate was not within the section supplied. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_outofrange,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Used by special functions. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_continue,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Unsupported relocation size requested. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_notsupported,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Unused. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_other,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The symbol to relocate against was undefined. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_undefined,
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The relocation was performed, but may not be ok - presently
|
|
|
|
|
generated only when linking i960 coff files with i960 b.out
|
|
|
|
|
symbols. If this type is returned, the error_message argument
|
|
|
|
|
to bfd_perform_relocation will be set. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_dangerous
|
|
|
|
|
}
|
|
|
|
|
bfd_reloc_status_type;
|
|
|
|
|
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
typedef struct reloc_cache_entry
|
|
|
|
|
{
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A pointer into the canonical table of pointers. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
struct symbol_cache_entry **sym_ptr_ptr;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* offset in section. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_size_type address;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* addend for relocation value. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_vma addend;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Pointer to how to perform the required relocation. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
reloc_howto_type *howto;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
}
|
|
|
|
|
arelent;
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
enum complain_overflow
|
|
|
|
|
{
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Do not complain on overflow. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
complain_overflow_dont,
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* Complain if the bitfield overflows, whether it is considered
|
2002-01-30 18:12:17 +00:00
|
|
|
|
as signed or unsigned. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
complain_overflow_bitfield,
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* Complain if the value overflows when considered as signed
|
2002-01-30 18:12:17 +00:00
|
|
|
|
number. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
complain_overflow_signed,
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* Complain if the value overflows when considered as an
|
2002-01-30 18:12:17 +00:00
|
|
|
|
unsigned number. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
complain_overflow_unsigned
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct reloc_howto_struct
|
|
|
|
|
{
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The type field has mainly a documentary use - the back end can
|
|
|
|
|
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
|
|
|
|
|
what the outside world calls a R_PCRWORD reloc. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
unsigned int type;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The value the final relocation is shifted right by. This drops
|
|
|
|
|
unwanted data from the relocation. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
unsigned int rightshift;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
int size;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The number of bits in the item to be relocated. This is used
|
|
|
|
|
when doing overflow checking. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
unsigned int bitsize;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* 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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
boolean pc_relative;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The bit position of the reloc value in the destination.
|
|
|
|
|
The relocated value is left shifted by this amount. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
unsigned int bitpos;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* What type of overflow error should be checked for when
|
|
|
|
|
relocating. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
enum complain_overflow complain_on_overflow;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +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). */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_status_type (*special_function)
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
|
|
|
|
|
bfd *, char **));
|
|
|
|
|
|
|
|
|
|
/* The textual name of the relocation type. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
char *name;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* Some formats record a relocation addend in the section contents
|
|
|
|
|
rather than with the relocation. For ELF formats this is the
|
|
|
|
|
distinction between USE_REL and USE_RELA (though the code checks
|
|
|
|
|
for USE_REL == 1/0). The value of this field is TRUE if the
|
|
|
|
|
addend is recorded with the section contents; when performing a
|
|
|
|
|
partial link (ld -r) the section contents (the data) will be
|
|
|
|
|
modified. The value of this field is FALSE if addends are
|
|
|
|
|
recorded with the relocation (in arelent.addend); when performing
|
|
|
|
|
a partial link the relocation will be modified.
|
|
|
|
|
All relocations for all ELF USE_RELA targets should set this field
|
|
|
|
|
to FALSE (values of TRUE should be looked on with suspicion).
|
|
|
|
|
However, the converse is not true: not all relocations of all ELF
|
|
|
|
|
USE_REL targets set this field to TRUE. Why this is so is peculiar
|
|
|
|
|
to each particular target. For relocs that aren't used in partial
|
|
|
|
|
links (e.g. GOT stuff) it doesn't matter what this is set to. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
boolean partial_inplace;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The src_mask selects which parts of the read in data
|
|
|
|
|
are to be used in the relocation sum. E.g., if this was an 8 bit
|
|
|
|
|
byte 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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_vma src_mask;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The dst_mask selects which parts of the instruction are replaced
|
|
|
|
|
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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_vma dst_mask;
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +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
|
|
|
|
|
empty (e.g., m88k bcs); this flag signals the fact. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
boolean pcrel_offset;
|
|
|
|
|
};
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
|
|
|
|
{ (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
|
|
|
|
|
#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
|
|
|
|
|
HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
|
|
|
|
|
NAME, false, 0, 0, IN)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
1999-07-12 10:30:21 +00:00
|
|
|
|
#define EMPTY_HOWTO(C) \
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \
|
|
|
|
|
NULL, false, 0, 0, false)
|
|
|
|
|
|
|
|
|
|
#define HOWTO_PREPARE(relocation, symbol) \
|
|
|
|
|
{ \
|
|
|
|
|
if (symbol != (asymbol *) NULL) \
|
|
|
|
|
{ \
|
|
|
|
|
if (bfd_is_com_section (symbol->section)) \
|
|
|
|
|
{ \
|
|
|
|
|
relocation = 0; \
|
|
|
|
|
} \
|
|
|
|
|
else \
|
|
|
|
|
{ \
|
|
|
|
|
relocation = symbol->value; \
|
|
|
|
|
} \
|
|
|
|
|
} \
|
|
|
|
|
}
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
unsigned int
|
|
|
|
|
bfd_get_reloc_size PARAMS ((reloc_howto_type *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
typedef struct relent_chain
|
|
|
|
|
{
|
1999-05-03 07:29:11 +00:00
|
|
|
|
arelent relent;
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
struct relent_chain *next;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
}
|
|
|
|
|
arelent_chain;
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_reloc_status_type
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_check_overflow PARAMS ((enum complain_overflow how,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
unsigned int bitsize,
|
|
|
|
|
unsigned int rightshift,
|
|
|
|
|
unsigned int addrsize,
|
|
|
|
|
bfd_vma relocation));
|
|
|
|
|
|
|
|
|
|
bfd_reloc_status_type
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_perform_relocation PARAMS ((bfd *abfd,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
arelent *reloc_entry,
|
|
|
|
|
PTR data,
|
|
|
|
|
asection *input_section,
|
|
|
|
|
bfd *output_bfd,
|
|
|
|
|
char **error_message));
|
|
|
|
|
|
|
|
|
|
bfd_reloc_status_type
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_install_relocation PARAMS ((bfd *abfd,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
arelent *reloc_entry,
|
|
|
|
|
PTR data, bfd_vma data_start,
|
|
|
|
|
asection *input_section,
|
|
|
|
|
char **error_message));
|
|
|
|
|
|
|
|
|
|
enum bfd_reloc_code_real {
|
|
|
|
|
_dummy_first_bfd_reloc_code_real,
|
|
|
|
|
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Basic absolute relocations of N bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_64,
|
|
|
|
|
BFD_RELOC_32,
|
|
|
|
|
BFD_RELOC_26,
|
|
|
|
|
BFD_RELOC_24,
|
|
|
|
|
BFD_RELOC_16,
|
|
|
|
|
BFD_RELOC_14,
|
|
|
|
|
BFD_RELOC_8,
|
|
|
|
|
|
|
|
|
|
/* 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.
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
The 24-bit relocation is used in some Intel 960 configurations. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_64_PCREL,
|
|
|
|
|
BFD_RELOC_32_PCREL,
|
|
|
|
|
BFD_RELOC_24_PCREL,
|
|
|
|
|
BFD_RELOC_16_PCREL,
|
|
|
|
|
BFD_RELOC_12_PCREL,
|
|
|
|
|
BFD_RELOC_8_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* For ELF. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_32_GOT_PCREL,
|
|
|
|
|
BFD_RELOC_16_GOT_PCREL,
|
|
|
|
|
BFD_RELOC_8_GOT_PCREL,
|
|
|
|
|
BFD_RELOC_32_GOTOFF,
|
|
|
|
|
BFD_RELOC_16_GOTOFF,
|
|
|
|
|
BFD_RELOC_LO16_GOTOFF,
|
|
|
|
|
BFD_RELOC_HI16_GOTOFF,
|
|
|
|
|
BFD_RELOC_HI16_S_GOTOFF,
|
|
|
|
|
BFD_RELOC_8_GOTOFF,
|
2001-08-27 10:22:03 +00:00
|
|
|
|
BFD_RELOC_64_PLT_PCREL,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_32_PLT_PCREL,
|
|
|
|
|
BFD_RELOC_24_PLT_PCREL,
|
|
|
|
|
BFD_RELOC_16_PLT_PCREL,
|
|
|
|
|
BFD_RELOC_8_PLT_PCREL,
|
2001-08-27 10:22:03 +00:00
|
|
|
|
BFD_RELOC_64_PLTOFF,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_32_PLTOFF,
|
|
|
|
|
BFD_RELOC_16_PLTOFF,
|
|
|
|
|
BFD_RELOC_LO16_PLTOFF,
|
|
|
|
|
BFD_RELOC_HI16_PLTOFF,
|
|
|
|
|
BFD_RELOC_HI16_S_PLTOFF,
|
|
|
|
|
BFD_RELOC_8_PLTOFF,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Relocations used by 68K ELF. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_68K_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_68K_JMP_SLOT,
|
|
|
|
|
BFD_RELOC_68K_RELATIVE,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Linkage-table relative. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_32_BASEREL,
|
|
|
|
|
BFD_RELOC_16_BASEREL,
|
|
|
|
|
BFD_RELOC_LO16_BASEREL,
|
|
|
|
|
BFD_RELOC_HI16_BASEREL,
|
|
|
|
|
BFD_RELOC_HI16_S_BASEREL,
|
|
|
|
|
BFD_RELOC_8_BASEREL,
|
|
|
|
|
BFD_RELOC_RVA,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_8_FFnn,
|
|
|
|
|
|
|
|
|
|
/* 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
|
2002-01-30 18:12:17 +00:00
|
|
|
|
displacement is used on the Alpha. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_32_PCREL_S2,
|
|
|
|
|
BFD_RELOC_16_PCREL_S2,
|
|
|
|
|
BFD_RELOC_23_PCREL_S2,
|
|
|
|
|
|
|
|
|
|
/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the target word. These are used on the SPARC. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_HI22,
|
|
|
|
|
BFD_RELOC_LO10,
|
|
|
|
|
|
|
|
|
|
/* 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
|
2002-01-30 18:12:17 +00:00
|
|
|
|
decided relatively late. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_GPREL16,
|
|
|
|
|
BFD_RELOC_GPREL32,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Reloc types used for i960/b.out. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_I960_CALLJ,
|
|
|
|
|
|
|
|
|
|
/* SPARC ELF relocations. There is probably some overlap with other
|
2002-01-30 18:12:17 +00:00
|
|
|
|
relocation types already defined. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_NONE,
|
|
|
|
|
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,
|
2001-05-28 09:23:54 +00:00
|
|
|
|
BFD_RELOC_SPARC_UA16,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_SPARC_UA32,
|
2001-05-28 09:23:54 +00:00
|
|
|
|
BFD_RELOC_SPARC_UA64,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* I think these are specific to SPARC a.out (e.g., Sun 4). */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_SPARC_BASE13,
|
|
|
|
|
BFD_RELOC_SPARC_BASE22,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* SPARC64 relocations */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BFD_RELOC_SPARC_64 BFD_RELOC_64
|
|
|
|
|
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,
|
|
|
|
|
BFD_RELOC_SPARC_WDISP19,
|
|
|
|
|
BFD_RELOC_SPARC_7,
|
|
|
|
|
BFD_RELOC_SPARC_6,
|
|
|
|
|
BFD_RELOC_SPARC_5,
|
|
|
|
|
#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
|
2001-12-21 22:35:24 +00:00
|
|
|
|
BFD_RELOC_SPARC_PLT32,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
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,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* SPARC little endian relocation */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_SPARC_REV32,
|
|
|
|
|
|
|
|
|
|
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
|
|
|
|
|
"addend" in some special way.
|
|
|
|
|
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
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the "ldah" instruction (which is at the address of this reloc). */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ALPHA_GPDISP_HI16,
|
|
|
|
|
|
|
|
|
|
/* 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
|
2002-01-30 18:12:17 +00:00
|
|
|
|
reading, for convenience. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ALPHA_GPDISP_LO16,
|
|
|
|
|
|
|
|
|
|
/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
|
|
|
|
|
relocation except that there is no accompanying GPDISP_LO16
|
2002-01-30 18:12:17 +00:00
|
|
|
|
relocation. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ALPHA_GPDISP,
|
|
|
|
|
|
|
|
|
|
/* 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.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
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)
|
2002-01-30 18:12:17 +00:00
|
|
|
|
3 - jsr (target of branch) */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ALPHA_LITERAL,
|
|
|
|
|
BFD_RELOC_ALPHA_ELF_LITERAL,
|
|
|
|
|
BFD_RELOC_ALPHA_LITUSE,
|
|
|
|
|
|
|
|
|
|
/* The HINT relocation indicates a value that should be filled into the
|
|
|
|
|
"hint" field of a jmp/jsr/ret instruction, for possible branch-
|
2002-01-30 18:12:17 +00:00
|
|
|
|
prediction logic which may be provided on some processors. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ALPHA_HINT,
|
|
|
|
|
|
|
|
|
|
/* The LINKAGE relocation outputs a linkage pair in the object file,
|
2002-01-30 18:12:17 +00:00
|
|
|
|
which is filled by the linker. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ALPHA_LINKAGE,
|
|
|
|
|
|
|
|
|
|
/* The CODEADDR relocation outputs a STO_CA in the object file,
|
2002-01-30 18:12:17 +00:00
|
|
|
|
which is filled by the linker. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ALPHA_CODEADDR,
|
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
/* The GPREL_HI/LO relocations together form a 32-bit offset from the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
GP register. */
|
2001-09-05 03:00:14 +00:00
|
|
|
|
BFD_RELOC_ALPHA_GPREL_HI16,
|
|
|
|
|
BFD_RELOC_ALPHA_GPREL_LO16,
|
|
|
|
|
|
2002-02-09 22:53:53 +00:00
|
|
|
|
/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
|
|
|
|
|
share a common GP, and the target address is adjusted for
|
|
|
|
|
STO_ALPHA_STD_GPLOAD. */
|
|
|
|
|
BFD_RELOC_ALPHA_BRSGP,
|
|
|
|
|
|
include/elf/
* alpha.h (R_ALPHA_TLSGD, R_ALPHA_TLSLDM, R_ALPHA_DTPMOD64,
R_ALPHA_GOTDTPREL, R_ALPHA_DTPREL64, R_ALPHA_DTPRELHI,
R_ALPHA_DTPRELLO, R_ALPHA_DTPREL16, R_ALPHA_GOTTPREL, R_ALPHA_TPREL64,
R_ALPHA_TPRELHI, R_ALPHA_TPRELLO, R_ALPHA_TPREL16): New.
bfd/
* elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD,
ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New.
(ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove.
(ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove.
(struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated.
(struct alpha_elf_obj_tdata): Rename total_got_entries and
n_local_got_entries to total_got_size and local_got_size.
(elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs.
(alpha_got_entry_size): New.
(elf64_alpha_relax_with_lituse): Use it.
(elf64_alpha_relax_without_lituse): Likewise.
(MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES.
(get_got_entry): New.
(elf64_alpha_check_relocs): Handle TLS relocs. Reorganize.
(elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask.
(elf64_alpha_merge_ind_symbols): Check gotent->reloc_type.
(elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise.
(elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size.
(elf64_alpha_calc_got_offsets): Likewise.
(alpha_dynamic_entries_for_reloc): New.
(elf64_alpha_calc_dynrel_sizes): Use it.
(elf64_alpha_size_dynamic_sections): Likewise.
(elf64_alpha_relocate_section): Handle TLS relocations.
* reloc.c: Add Alpha TLS relocations.
* bfd-in2.h, libbfd.h: Rebuild.
gas/
* expr.h (operatorT): Add O_md17..O_md32.
* config/tc-alpha.c (O_lituse_tlsgd, O_lituse_tlsldm, O_tlsgd,
O_tlsldm, O_gotdtprel, O_dtprelhi, O_dtprello, O_dtprel, O_gottprel,
O_tprelhi, O_tprello, O_tprel): New.
(USER_RELOC_P, alpha_reloc_op_tag, debug_exp): Include them.
(DUMMY_RELOC_LITUSE_TLSGD, DUMMY_RELOC_LITUSE_TLSLDM): New.
(LITUSE_TLSGD, LITUSE_TLSLDM): New.
(struct alpha_reloc_tag): Add master, saw_tlsgd, saw_tlsld,
saw_lu_tlsgd, saw_lu_tlsldm. Make multi_section_p a bit field.
(md_apply_fix3): Handle TLS relocations.
(alpha_force_relocation, alpha_fix_adjustable): Likewise.
(alpha_adjust_symtab_relocs): Sort LITERAL relocs after the
associated TLS reloc. Check lituse_tls relocs match up.
(emit_insn): Handle TLS relocations.
(ldX_op): Remove.
gas/testsuite/
* gas/alpha/elf-tls-1.s, gas/alpha/elf-tls-1.d: New.
* gas/alpha/elf-tls-2.s, gas/alpha/elf-tls-1.l: New.
* gas/alpha/elf-tls-3.s, gas/alpha/elf-tls-1.l: New.
* gas/alpha/alpha.exp: Run them.
2002-05-30 22:01:38 +00:00
|
|
|
|
/* Alpha thread-local storage relocations. */
|
|
|
|
|
BFD_RELOC_ALPHA_TLSGD,
|
|
|
|
|
BFD_RELOC_ALPHA_TLSLDM,
|
|
|
|
|
BFD_RELOC_ALPHA_DTPMOD64,
|
|
|
|
|
BFD_RELOC_ALPHA_GOTDTPREL16,
|
|
|
|
|
BFD_RELOC_ALPHA_DTPREL64,
|
|
|
|
|
BFD_RELOC_ALPHA_DTPREL_HI16,
|
|
|
|
|
BFD_RELOC_ALPHA_DTPREL_LO16,
|
|
|
|
|
BFD_RELOC_ALPHA_DTPREL16,
|
|
|
|
|
BFD_RELOC_ALPHA_GOTTPREL16,
|
|
|
|
|
BFD_RELOC_ALPHA_TPREL64,
|
|
|
|
|
BFD_RELOC_ALPHA_TPREL_HI16,
|
|
|
|
|
BFD_RELOC_ALPHA_TPREL_LO16,
|
|
|
|
|
BFD_RELOC_ALPHA_TPREL16,
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* Bits 27..2 of the relocation address shifted right 2 bits;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
simple reloc otherwise. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MIPS_JMP,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The MIPS16 jump instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MIPS16_JMP,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* MIPS16 GP relative reloc. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MIPS16_GPREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* High 16 bits of 32-bit value; simple reloc. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_HI16,
|
|
|
|
|
|
|
|
|
|
/* 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
|
2002-01-30 18:12:17 +00:00
|
|
|
|
to compensate for the borrow when the low bits are added. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_HI16_S,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Low 16 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_LO16,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Like BFD_RELOC_HI16_S, but PC relative. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_PCREL_HI16_S,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Like BFD_RELOC_LO16, but PC relative. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_PCREL_LO16,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Relocation against a MIPS literal section. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MIPS_LITERAL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* MIPS ELF relocations. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MIPS_GOT16,
|
|
|
|
|
BFD_RELOC_MIPS_CALL16,
|
|
|
|
|
BFD_RELOC_MIPS_GOT_HI16,
|
|
|
|
|
BFD_RELOC_MIPS_GOT_LO16,
|
|
|
|
|
BFD_RELOC_MIPS_CALL_HI16,
|
|
|
|
|
BFD_RELOC_MIPS_CALL_LO16,
|
1999-06-02 10:20:16 +00:00
|
|
|
|
BFD_RELOC_MIPS_SUB,
|
|
|
|
|
BFD_RELOC_MIPS_GOT_PAGE,
|
|
|
|
|
BFD_RELOC_MIPS_GOT_OFST,
|
|
|
|
|
BFD_RELOC_MIPS_GOT_DISP,
|
2001-05-23 17:36:38 +00:00
|
|
|
|
BFD_RELOC_MIPS_SHIFT5,
|
|
|
|
|
BFD_RELOC_MIPS_SHIFT6,
|
|
|
|
|
BFD_RELOC_MIPS_INSERT_A,
|
|
|
|
|
BFD_RELOC_MIPS_INSERT_B,
|
|
|
|
|
BFD_RELOC_MIPS_DELETE,
|
|
|
|
|
BFD_RELOC_MIPS_HIGHEST,
|
|
|
|
|
BFD_RELOC_MIPS_HIGHER,
|
|
|
|
|
BFD_RELOC_MIPS_SCN_DISP,
|
|
|
|
|
BFD_RELOC_MIPS_REL16,
|
|
|
|
|
BFD_RELOC_MIPS_RELGOT,
|
|
|
|
|
BFD_RELOC_MIPS_JALR,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-06-23 02:09:05 +00:00
|
|
|
|
/* Fujitsu Frv Relocations. */
|
|
|
|
|
BFD_RELOC_FRV_LABEL16,
|
|
|
|
|
BFD_RELOC_FRV_LABEL24,
|
|
|
|
|
BFD_RELOC_FRV_LO16,
|
|
|
|
|
BFD_RELOC_FRV_HI16,
|
|
|
|
|
BFD_RELOC_FRV_GPREL12,
|
|
|
|
|
BFD_RELOC_FRV_GPRELU12,
|
|
|
|
|
BFD_RELOC_FRV_GPREL32,
|
|
|
|
|
BFD_RELOC_FRV_GPRELHI,
|
|
|
|
|
BFD_RELOC_FRV_GPRELLO,
|
|
|
|
|
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* i386/elf relocations */
|
1999-05-03 07:29:11 +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,
|
bfd/
* reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE,
BFD_RELOC_386_TLS_GOTIE): Add.
* bfd-in2.h, libbfd.h: Rebuilt.
* elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE
and R_386_TLS_GOTIE.
(elf_i386_reloc_type_lookup): Handle it.
(struct elf_i386_link_hash_entry): Change tls_type type to unsigned
char instead of enum, change GOT_* into defines.
(GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define.
(elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
(elf_i386_check_relocs): Likewise. Avoid crash if local symbol is
accessed both as normal and TLS symbol. Move R_386_TLS_LDM and
R_386_PLT32 cases so that R_386_TLS_IE can fall through.
Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
(elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
(allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if
tls_type is GOT_TLS_IE_BOTH.
(elf_i386_size_dynamic_sections): Likewise.
(elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
(elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch
all 4 GOT_TLS_* TLS types.
gas/
* config/tc-i386.c (tc_i386_fix_adjustable): Handle
BFD_RELOC_386_TLS_IE and BFD_RELOC_386_TLS_GOTIE.
(BFD_RELOC_386_TLS_IE, BFD_RELOC_386_TLS_GOTIE): Define to 0
if not defined.
(lex_got): Handle @GOTNTPOFF and @INDNTPOFF.
(md_apply_fix3, tc_gen_reloc): Handle BFD_RELOC_386_TLS_IE and
BFD_RELOC_386_TLS_GOTIE.
gas/testsuite/
* gas/i386/tlspic.s: Add tests.
* gas/i386/tlspic.d: Regenerated.
* gas/i386/tlsnopic.s: Add tests.
* gas/i386/tlsnopic.d: Regenerated.
include/
* elf/i386.h (R_386_TLS_TPOFF, R_386_TLS_IE, R_386_TLS_GOTIE):
Define.
ld/testsuite/
* ld-i386/i386.exp: New.
* ld-i386/tlsbin.dd: New test.
* ld-i386/tlsbinpic.s: New test.
* ld-i386/tlsbin.rd: New test.
* ld-i386/tlsbin.s: New test.
* ld-i386/tlsbin.sd: New test.
* ld-i386/tlsbin.td: New test.
* ld-i386/tlslib.s: New test.
* ld-i386/tlsnopic1.s: New test.
* ld-i386/tlsnopic2.s: New test.
* ld-i386/tlsnopic.dd: New test.
* ld-i386/tlsnopic.rd: New test.
* ld-i386/tlsnopic.sd: New test.
* ld-i386/tlspic1.s: New test.
* ld-i386/tlspic2.s: New test.
* ld-i386/tlspic.dd: New test.
* ld-i386/tlspic.rd: New test.
* ld-i386/tlspic.sd: New test.
* ld-i386/tlspic.td: New test.
2002-09-19 19:01:18 +00:00
|
|
|
|
BFD_RELOC_386_TLS_TPOFF,
|
|
|
|
|
BFD_RELOC_386_TLS_IE,
|
|
|
|
|
BFD_RELOC_386_TLS_GOTIE,
|
* elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
for symbols from SHF_TLS section.
(_bfd_elf_print_private_bfd_data): Add PT_TLS.
(elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
(map_sections_to_segments): Build PT_TLS segment if necessary.
(assign_file_positions_for_segments): Likewise.
(get_program_header_size): Account for PT_TLS segment.
(swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
SEC_THREAD_LOCAL sections to STT_TLS.
* reloc.c: Add 386 and IA-64 TLS relocs.
* section.c (SEC_THREAD_LOCAL): Define.
(SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
Remove.
* elflink.h (elf_link_add_object_symbols): Support .tcommon.
(size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
unconditionally.
(struct elf_final_link_info): Add first_tls_sec.
(elf_bfd_final_link): Set first_tls_sec.
Compute elf_hash_table (info)->tls_segment.
(elf_link_output_extsym): Handle STT_TLS symbols.
(elf_link_input_bfd): Likewise.
* syms.c (BSF_THREAD_LOCAL): Define.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
elf_i386_mkobject, elf_i386_object_p): New functions.
(elf_howto_table): Add TLS relocs.
(elf_i386_reloc_type_lookup): Support TLS relocs.
(elf_i386_info_to_howto_rel): Likewise.
(struct elf_i386_link_hash_entry): Add tls_type.
(struct elf_i386_obj_tdata): New.
(elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
New macros.
(struct elf_i386_link_hash_table): Add tls_ldm_got.
(link_hash_newfunc): Clear tls_type.
(elf_i386_check_relocs): Support TLS relocs.
(elf_i386_gc_sweep_hook): Likewise.
(allocate_dynrelocs): Likewise.
(elf_i386_size_dynamic_sections): Likewise.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(bfd_elf32_mkobject, elf_backend_object_p): Define.
* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
want_tprel, want_dtpmod, want_dtprel.
(elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
(ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
R_IA64_LTOFF_TPREL22.
(elf_code_to_howto_index): Add TLS relocs.
(elfNN_ia64_check_relocs): Support TLS relocs.
(allocate_global_data_got): Account for TLS .got data.
(allocate_dynrel_entries): Account for TLS dynamic relocations.
(elfNN_ia64_install_value): Supprt TLS relocs.
(set_got_entry): Support TLS relocs.
(elfNN_ia64_relocate_section): Likewise.
* config/obj-elf.c (elf_common): Renamed from obj_elf_common.
(obj_elf_common): Call elf_common.
(obj_elf_tls_common): New function.
(elf_pseudo_tab): Support .tls_common.
(special_sections): Add .tdata and .tbss.
(obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS
sections.
(obj_elf_parse_section_letters): Support T in section flags (SHF_TLS).
(obj_elf_parse_section_letters): Include T in error message.
* config/tc-ppc.c (ppc_section_letter): Likewise.
* config/tc-alpha.c (alpha_elf_section_letter): Likewise.
(tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as
SEC_MERGE.
* config/tc-sparc.c (md_apply_fix3): Likewise.
* config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs.
Define them if not BFD_ASSEMBLER.
(lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF
and @NTPOFF.
(md_apply_fix3): Add TLS relocs.
* config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE,
FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE,
FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE.
(pseudo_func): Support @dtpmod(), @dtprel() and @tprel().
(ia64_elf_section_letter): Include T in error message.
(md_begin): Support TLS operators.
(md_operand): Likewise.
(ia64_gen_real_reloc_type): Support TLS relocs.
* testsuite/gas/i386/tlspic.s: New file.
* testsuite/gas/i386/tlsd.s: New file.
* testsuite/gas/i386/tlsnopic.s: New file.
* testsuite/gas/i386/tlsd.d: New file.
* testsuite/gas/i386/tlsnopic.d: New file.
* testsuite/gas/i386/tlspic.d: New file.
* testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests.
* testsuite/gas/ia64/tls.s: New file.
* testsuite/gas/ia64/tls.d: New file.
* testsuite/gas/ia64/ia64.exp: Add tls test.
* write.c (adjust_reloc_syms): Don't change symbols in
SEC_THREAD_LOCAL sections to STT_SECTION + addend.
* elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define.
* elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22.
* elf/i386.h: Add TLS relocs.
* scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
* ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
output section if necessary. Handle .tbss.
(lang_size_sections): Clear _raw_size for .tbss section
(it allocates space in PT_TLS segment only).
* ldwrite.c (build_link_order): Build link order for .tbss too.
* readelf.c (get_segment_type): Add PT_TLS.
(get_elf_section_flags): Add SHF_TLS.
(get_dynamic_flags): Optimize. Add DF_STATIC_TLS.
(process_dynamic_segment): Use puts instead of printf.
(get_symbol_type): Support STT_TLS.
* objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT,
SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS.
Add SEC_THREAD_LOCAL.
2002-05-23 13:12:53 +00:00
|
|
|
|
BFD_RELOC_386_TLS_LE,
|
|
|
|
|
BFD_RELOC_386_TLS_GD,
|
|
|
|
|
BFD_RELOC_386_TLS_LDM,
|
|
|
|
|
BFD_RELOC_386_TLS_LDO_32,
|
|
|
|
|
BFD_RELOC_386_TLS_IE_32,
|
|
|
|
|
BFD_RELOC_386_TLS_LE_32,
|
|
|
|
|
BFD_RELOC_386_TLS_DTPMOD32,
|
|
|
|
|
BFD_RELOC_386_TLS_DTPOFF32,
|
|
|
|
|
BFD_RELOC_386_TLS_TPOFF32,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* x86-64/elf relocations */
|
2000-11-30 19:16:54 +00:00
|
|
|
|
BFD_RELOC_X86_64_GOT32,
|
|
|
|
|
BFD_RELOC_X86_64_PLT32,
|
|
|
|
|
BFD_RELOC_X86_64_COPY,
|
|
|
|
|
BFD_RELOC_X86_64_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_X86_64_JUMP_SLOT,
|
|
|
|
|
BFD_RELOC_X86_64_RELATIVE,
|
|
|
|
|
BFD_RELOC_X86_64_GOTPCREL,
|
|
|
|
|
BFD_RELOC_X86_64_32S,
|
bfd/
* reloc.c: Add x86-64 TLS relocs.
* bfd-in2.h, libbfd.h: Rebuilt.
* elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit
relocs. Add TLS relocs.
(x86_64_reloc_map): Add TLS relocs.
(elf64_x86_64_info_to_howto): Adjust for added TLS relocs.
(struct elf64_x86_64_link_hash_entry): Add tls_type field.
(GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define.
(elf64_x86_64_hash_entry): Define.
(struct elf64_x86_64_obj_tdata): New.
(elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define.
(struct elf64_x86_64_link_hash_table): Add tls_ld_got.
(link_hash_newfunc): Initialize tls_type.
(elf64_x86_64_link_hash_table_create): Initialize tls_ld_got.
(elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary.
(elf64_x86_64_mkobject): New.
(elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata.
(elf64_x86_64_tls_transition): New.
(elf64_x86_64_check_relocs): Add r_type variable and use it.
Handle TLS relocs.
(elf64_x86_64_gc_sweep_hook): Handle TLS relocs.
(allocate_dynrelocs): Allocate GOT space for TLS relocs.
(elf64_x86_64_size_dynamic_sections): Likewise.
(dtpoff_base, tpoff): New.
(elf64_x86_64_relocate_section): Handle TLS relocs.
(elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT
entries.
(bfd_elf64_mkobject): Define.
* elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set
DF_STATIC_TLS if shared.
gas/
* config/tc-i386.c (tc_i386_fix_adjustable): Add x86-64 TLS relocs.
Define them if not BFD_ASSEMBLER.
(lex_got): Handle @tlsgd, @dtpoff and @tpoff in 64-bit mode, add
@tlsld.
(md_apply_fix3): No addend for BFD_RELOC_X86_64_TLSGD,
BFD_RELOC_X86_64_TLSLD and BFD_RELOC_X86_64_GOTTPOFF.
(tc_gen_reloc): Handle x86-64 TLS relocs.
include/
* elf/x86-64.h: Add TLS relocs.
ld/testsuite/
* lib/ld-lib.exp (run_ld_link_tests): Add.
* ld-sh/sh64/sh64.exp (run_ld_link_tests, regexp_diff,
file_contents): Remove.
(sh64tests): Add 6th field to the tests array.
* ld-i386/i386.exp (run_ld_link_tests): Remove.
* ld-x86-64/x86-64.exp: New.
* ld-x86-64/tlsbin.dd: New test.
* ld-x86-64/tlsbinpic.s: New test.
* ld-x86-64/tlsbin.rd: New test.
* ld-x86-64/tlsbin.s: New test.
* ld-x86-64/tlsbin.sd: New test.
* ld-x86-64/tlsbin.td: New test.
* ld-x86-64/tlslib.s: New test.
* ld-x86-64/tlspic1.s: New test.
* ld-x86-64/tlspic2.s: New test.
* ld-x86-64/tlspic.dd: New test.
* ld-x86-64/tlspic.rd: New test.
* ld-x86-64/tlspic.sd: New test.
* ld-x86-64/tlspic.td: New test.
2002-09-27 19:29:18 +00:00
|
|
|
|
BFD_RELOC_X86_64_DTPMOD64,
|
|
|
|
|
BFD_RELOC_X86_64_DTPOFF64,
|
|
|
|
|
BFD_RELOC_X86_64_TPOFF64,
|
|
|
|
|
BFD_RELOC_X86_64_TLSGD,
|
|
|
|
|
BFD_RELOC_X86_64_TLSLD,
|
|
|
|
|
BFD_RELOC_X86_64_DTPOFF32,
|
|
|
|
|
BFD_RELOC_X86_64_GOTTPOFF,
|
|
|
|
|
BFD_RELOC_X86_64_TPOFF32,
|
2000-11-30 19:16:54 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* ns32k relocations */
|
1999-05-03 07:29:11 +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,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* PDP11 relocations */
|
2001-02-18 23:33:11 +00:00
|
|
|
|
BFD_RELOC_PDP11_DISP_8_PCREL,
|
|
|
|
|
BFD_RELOC_PDP11_DISP_6_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Picojava relocs. Not all of these appear in object files. */
|
1999-09-04 17:07:46 +00:00
|
|
|
|
BFD_RELOC_PJ_CODE_HI16,
|
|
|
|
|
BFD_RELOC_PJ_CODE_LO16,
|
|
|
|
|
BFD_RELOC_PJ_CODE_DIR16,
|
|
|
|
|
BFD_RELOC_PJ_CODE_DIR32,
|
|
|
|
|
BFD_RELOC_PJ_CODE_REL16,
|
|
|
|
|
BFD_RELOC_PJ_CODE_REL32,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Power(rs6000) and PowerPC relocations. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_PPC_B26,
|
|
|
|
|
BFD_RELOC_PPC_BA26,
|
|
|
|
|
BFD_RELOC_PPC_TOC16,
|
|
|
|
|
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,
|
|
|
|
|
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,
|
2001-08-27 10:22:03 +00:00
|
|
|
|
BFD_RELOC_PPC64_HIGHER,
|
|
|
|
|
BFD_RELOC_PPC64_HIGHER_S,
|
|
|
|
|
BFD_RELOC_PPC64_HIGHEST,
|
|
|
|
|
BFD_RELOC_PPC64_HIGHEST_S,
|
|
|
|
|
BFD_RELOC_PPC64_TOC16_LO,
|
|
|
|
|
BFD_RELOC_PPC64_TOC16_HI,
|
|
|
|
|
BFD_RELOC_PPC64_TOC16_HA,
|
|
|
|
|
BFD_RELOC_PPC64_TOC,
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
BFD_RELOC_PPC64_PLTGOT16,
|
2001-08-27 10:22:03 +00:00
|
|
|
|
BFD_RELOC_PPC64_PLTGOT16_LO,
|
|
|
|
|
BFD_RELOC_PPC64_PLTGOT16_HI,
|
|
|
|
|
BFD_RELOC_PPC64_PLTGOT16_HA,
|
|
|
|
|
BFD_RELOC_PPC64_ADDR16_DS,
|
|
|
|
|
BFD_RELOC_PPC64_ADDR16_LO_DS,
|
|
|
|
|
BFD_RELOC_PPC64_GOT16_DS,
|
|
|
|
|
BFD_RELOC_PPC64_GOT16_LO_DS,
|
|
|
|
|
BFD_RELOC_PPC64_PLT16_LO_DS,
|
|
|
|
|
BFD_RELOC_PPC64_SECTOFF_DS,
|
|
|
|
|
BFD_RELOC_PPC64_SECTOFF_LO_DS,
|
|
|
|
|
BFD_RELOC_PPC64_TOC16_DS,
|
|
|
|
|
BFD_RELOC_PPC64_TOC16_LO_DS,
|
|
|
|
|
BFD_RELOC_PPC64_PLTGOT16_DS,
|
|
|
|
|
BFD_RELOC_PPC64_PLTGOT16_LO_DS,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* IBM 370/390 relocations */
|
2000-02-23 13:52:23 +00:00
|
|
|
|
BFD_RELOC_I370_D12,
|
|
|
|
|
|
1999-05-03 07:29:11 +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.
|
2002-01-30 18:12:17 +00:00
|
|
|
|
It generally does map to one of the other relocation types. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_CTOR,
|
|
|
|
|
|
|
|
|
|
/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
|
2002-01-30 18:12:17 +00:00
|
|
|
|
not stored in the instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ARM_PCREL_BRANCH,
|
|
|
|
|
|
2000-04-08 00:10:49 +00:00
|
|
|
|
/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is
|
|
|
|
|
not stored in the instruction. The 2nd lowest bit comes from a 1 bit
|
2002-01-30 18:12:17 +00:00
|
|
|
|
field in the instruction. */
|
2000-04-08 00:10:49 +00:00
|
|
|
|
BFD_RELOC_ARM_PCREL_BLX,
|
|
|
|
|
|
|
|
|
|
/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is
|
|
|
|
|
not stored in the instruction. The 2nd lowest bit comes from a 1 bit
|
2002-01-30 18:12:17 +00:00
|
|
|
|
field in the instruction. */
|
2000-04-08 00:10:49 +00:00
|
|
|
|
BFD_RELOC_THUMB_PCREL_BLX,
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* These relocs are only used within the ARM assembler. They are not
|
2002-01-30 18:12:17 +00:00
|
|
|
|
(at present) written to any object files. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ARM_IMMEDIATE,
|
1999-07-05 06:29:47 +00:00
|
|
|
|
BFD_RELOC_ARM_ADRL_IMMEDIATE,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ARM_OFFSET_IMM,
|
|
|
|
|
BFD_RELOC_ARM_SHIFT_IMM,
|
|
|
|
|
BFD_RELOC_ARM_SWI,
|
|
|
|
|
BFD_RELOC_ARM_MULTI,
|
|
|
|
|
BFD_RELOC_ARM_CP_OFF_IMM,
|
|
|
|
|
BFD_RELOC_ARM_ADR_IMM,
|
|
|
|
|
BFD_RELOC_ARM_LDR_IMM,
|
|
|
|
|
BFD_RELOC_ARM_LITERAL,
|
|
|
|
|
BFD_RELOC_ARM_IN_POOL,
|
|
|
|
|
BFD_RELOC_ARM_OFFSET_IMM8,
|
|
|
|
|
BFD_RELOC_ARM_HWLITERAL,
|
|
|
|
|
BFD_RELOC_ARM_THUMB_ADD,
|
|
|
|
|
BFD_RELOC_ARM_THUMB_IMM,
|
|
|
|
|
BFD_RELOC_ARM_THUMB_SHIFT,
|
|
|
|
|
BFD_RELOC_ARM_THUMB_OFFSET,
|
|
|
|
|
BFD_RELOC_ARM_GOT12,
|
|
|
|
|
BFD_RELOC_ARM_GOT32,
|
|
|
|
|
BFD_RELOC_ARM_JUMP_SLOT,
|
|
|
|
|
BFD_RELOC_ARM_COPY,
|
|
|
|
|
BFD_RELOC_ARM_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_ARM_PLT32,
|
|
|
|
|
BFD_RELOC_ARM_RELATIVE,
|
|
|
|
|
BFD_RELOC_ARM_GOTOFF,
|
|
|
|
|
BFD_RELOC_ARM_GOTPC,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Hitachi SH relocs. Not all of these appear in object files. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
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,
|
sh-dsp REPEAT support:
opcodes:
* sh-opc.h (sh_nibble_type): Remove DISP_8 and DISP_4.
Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT.
(sh_arg_type): Add A_PC.
(sh_table): Update entries using immediates. Add repeat.
* sh-dis.c (print_insn_shx): Remove DISP_8 and DISP_4.
Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT.
gas:
* config/tc-sh.c (immediate): Delete.
(sh_operand_info): Add immediate member.
(parse_reg): Use A_PC for pc.
(parse_exp): Add second argument 'op'. All callers changed.
(parse_at): Expect pc to be coded as A_PC.
Use immediate field in *op.
(insert): Add fourth argument 'op'. All callers changed.
(build_relax): Add second argument 'op'. All callers changed.
(insert_loop_bounds): New function.
(build_Mytes): Remove DISP_4.
Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT.
(assemble_ppi): Use immediate field in *operand.
(sh_force_relocation): Handle BFD_RELOC_SH_LOOP_{START,END}.
(md_apply_fix): Likewise.
(tc_gen_reloc): Likewise. Check for a pcrel BFD_RELOC_SH_LABEL.
include/coff:
* sh.h (R_SH_LOOP_START, R_SH_LOOP_END): Define.
include/elf:
* sh.h (R_SH_LOOP_START, R_SH_LOOP_END): New RELOC_NUMBERs.
bfd:
* reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and
BFD_RELOC_SH_LOOP_END.
* elf32-sh.c (sh_elf_howto_tab): Change special_func to
sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore.
Add entries for R_SH_LOOP_START and R_SH_LOOP_END.
(sh_elf_reloc_loop): New function.
(sh_elf_reloc): No need to test for always-to-be-ignored relocs
any more.
(sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}.
(sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}.
* bfd-in2.h, libbfd.h: Regenerate.
2000-04-05 21:23:05 +00:00
|
|
|
|
BFD_RELOC_SH_LOOP_START,
|
|
|
|
|
BFD_RELOC_SH_LOOP_END,
|
2000-09-05 02:42:16 +00:00
|
|
|
|
BFD_RELOC_SH_COPY,
|
|
|
|
|
BFD_RELOC_SH_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_SH_JMP_SLOT,
|
|
|
|
|
BFD_RELOC_SH_RELATIVE,
|
|
|
|
|
BFD_RELOC_SH_GOTPC,
|
2002-03-21 09:15:18 +00:00
|
|
|
|
BFD_RELOC_SH_GOT_LOW16,
|
|
|
|
|
BFD_RELOC_SH_GOT_MEDLOW16,
|
|
|
|
|
BFD_RELOC_SH_GOT_MEDHI16,
|
|
|
|
|
BFD_RELOC_SH_GOT_HI16,
|
|
|
|
|
BFD_RELOC_SH_GOTPLT_LOW16,
|
|
|
|
|
BFD_RELOC_SH_GOTPLT_MEDLOW16,
|
|
|
|
|
BFD_RELOC_SH_GOTPLT_MEDHI16,
|
|
|
|
|
BFD_RELOC_SH_GOTPLT_HI16,
|
|
|
|
|
BFD_RELOC_SH_PLT_LOW16,
|
|
|
|
|
BFD_RELOC_SH_PLT_MEDLOW16,
|
|
|
|
|
BFD_RELOC_SH_PLT_MEDHI16,
|
|
|
|
|
BFD_RELOC_SH_PLT_HI16,
|
|
|
|
|
BFD_RELOC_SH_GOTOFF_LOW16,
|
|
|
|
|
BFD_RELOC_SH_GOTOFF_MEDLOW16,
|
|
|
|
|
BFD_RELOC_SH_GOTOFF_MEDHI16,
|
|
|
|
|
BFD_RELOC_SH_GOTOFF_HI16,
|
|
|
|
|
BFD_RELOC_SH_GOTPC_LOW16,
|
|
|
|
|
BFD_RELOC_SH_GOTPC_MEDLOW16,
|
|
|
|
|
BFD_RELOC_SH_GOTPC_MEDHI16,
|
|
|
|
|
BFD_RELOC_SH_GOTPC_HI16,
|
|
|
|
|
BFD_RELOC_SH_COPY64,
|
|
|
|
|
BFD_RELOC_SH_GLOB_DAT64,
|
|
|
|
|
BFD_RELOC_SH_JMP_SLOT64,
|
|
|
|
|
BFD_RELOC_SH_RELATIVE64,
|
|
|
|
|
BFD_RELOC_SH_GOT10BY4,
|
|
|
|
|
BFD_RELOC_SH_GOT10BY8,
|
|
|
|
|
BFD_RELOC_SH_GOTPLT10BY4,
|
|
|
|
|
BFD_RELOC_SH_GOTPLT10BY8,
|
|
|
|
|
BFD_RELOC_SH_GOTPLT32,
|
|
|
|
|
BFD_RELOC_SH_SHMEDIA_CODE,
|
|
|
|
|
BFD_RELOC_SH_IMMU5,
|
|
|
|
|
BFD_RELOC_SH_IMMS6,
|
|
|
|
|
BFD_RELOC_SH_IMMS6BY32,
|
|
|
|
|
BFD_RELOC_SH_IMMU6,
|
|
|
|
|
BFD_RELOC_SH_IMMS10,
|
|
|
|
|
BFD_RELOC_SH_IMMS10BY2,
|
|
|
|
|
BFD_RELOC_SH_IMMS10BY4,
|
|
|
|
|
BFD_RELOC_SH_IMMS10BY8,
|
|
|
|
|
BFD_RELOC_SH_IMMS16,
|
|
|
|
|
BFD_RELOC_SH_IMMU16,
|
|
|
|
|
BFD_RELOC_SH_IMM_LOW16,
|
|
|
|
|
BFD_RELOC_SH_IMM_LOW16_PCREL,
|
|
|
|
|
BFD_RELOC_SH_IMM_MEDLOW16,
|
|
|
|
|
BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
|
|
|
|
|
BFD_RELOC_SH_IMM_MEDHI16,
|
|
|
|
|
BFD_RELOC_SH_IMM_MEDHI16_PCREL,
|
|
|
|
|
BFD_RELOC_SH_IMM_HI16,
|
|
|
|
|
BFD_RELOC_SH_IMM_HI16_PCREL,
|
|
|
|
|
BFD_RELOC_SH_PT_16,
|
2002-10-11 14:28:29 +00:00
|
|
|
|
BFD_RELOC_SH_TLS_GD_32,
|
|
|
|
|
BFD_RELOC_SH_TLS_LD_32,
|
|
|
|
|
BFD_RELOC_SH_TLS_LDO_32,
|
|
|
|
|
BFD_RELOC_SH_TLS_IE_32,
|
|
|
|
|
BFD_RELOC_SH_TLS_LE_32,
|
|
|
|
|
BFD_RELOC_SH_TLS_DTPMOD32,
|
|
|
|
|
BFD_RELOC_SH_TLS_DTPOFF32,
|
|
|
|
|
BFD_RELOC_SH_TLS_TPOFF32,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
|
2002-01-30 18:12:17 +00:00
|
|
|
|
be zero and is not stored in the instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_THUMB_PCREL_BRANCH9,
|
|
|
|
|
BFD_RELOC_THUMB_PCREL_BRANCH12,
|
|
|
|
|
BFD_RELOC_THUMB_PCREL_BRANCH23,
|
|
|
|
|
|
2001-01-11 21:20:20 +00:00
|
|
|
|
/* ARC Cores relocs.
|
1999-05-03 07:29:11 +00:00
|
|
|
|
ARC 22 bit pc-relative branch. The lowest two bits must be zero and are
|
|
|
|
|
not stored in the instruction. The high 20 bits are installed in bits 26
|
2002-01-30 18:12:17 +00:00
|
|
|
|
through 7 of the instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ARC_B22_PCREL,
|
|
|
|
|
|
|
|
|
|
/* 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
|
2002-01-30 18:12:17 +00:00
|
|
|
|
through 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_ARC_B26,
|
|
|
|
|
|
|
|
|
|
/* Mitsubishi D10V relocs.
|
|
|
|
|
This is a 10-bit reloc with the right 2 bits
|
2002-01-30 18:12:17 +00:00
|
|
|
|
assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D10V_10_PCREL_R,
|
|
|
|
|
|
|
|
|
|
/* 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.,
|
2002-01-30 18:12:17 +00:00
|
|
|
|
shifted left 15 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D10V_10_PCREL_L,
|
|
|
|
|
|
|
|
|
|
/* This is an 18-bit reloc with the right 2 bits
|
2002-01-30 18:12:17 +00:00
|
|
|
|
assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D10V_18,
|
|
|
|
|
|
|
|
|
|
/* This is an 18-bit reloc with the right 2 bits
|
2002-01-30 18:12:17 +00:00
|
|
|
|
assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D10V_18_PCREL,
|
|
|
|
|
|
|
|
|
|
/* Mitsubishi D30V relocs.
|
2002-01-30 18:12:17 +00:00
|
|
|
|
This is a 6-bit absolute reloc. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_6,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is a 6-bit pc-relative reloc with
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the right 3 bits assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_9_PCREL,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is a 6-bit pc-relative reloc with
|
1999-05-03 07:29:11 +00:00
|
|
|
|
the right 3 bits assumed to be 0. Same
|
|
|
|
|
as the previous reloc but on the right side
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of the container. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_9_PCREL_R,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is a 12-bit absolute reloc with the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
right 3 bitsassumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_15,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is a 12-bit pc-relative reloc with
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the right 3 bits assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_15_PCREL,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is a 12-bit pc-relative reloc with
|
1999-05-03 07:29:11 +00:00
|
|
|
|
the right 3 bits assumed to be 0. Same
|
|
|
|
|
as the previous reloc but on the right side
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of the container. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_15_PCREL_R,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is an 18-bit absolute reloc with
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the right 3 bits assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_21,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is an 18-bit pc-relative reloc with
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the right 3 bits assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_21_PCREL,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is an 18-bit pc-relative reloc with
|
1999-05-03 07:29:11 +00:00
|
|
|
|
the right 3 bits assumed to be 0. Same
|
|
|
|
|
as the previous reloc but on the right side
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of the container. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_21_PCREL_R,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 32-bit absolute reloc. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_32,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 32-bit pc-relative reloc. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_D30V_32_PCREL,
|
|
|
|
|
|
2002-05-28 14:08:47 +00:00
|
|
|
|
/* DLX relocs */
|
|
|
|
|
BFD_RELOC_DLX_HI16_S,
|
|
|
|
|
|
|
|
|
|
/* DLX relocs */
|
|
|
|
|
BFD_RELOC_DLX_LO16,
|
|
|
|
|
|
|
|
|
|
/* DLX relocs */
|
|
|
|
|
BFD_RELOC_DLX_JMP26,
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* Mitsubishi M32R relocs.
|
2002-01-30 18:12:17 +00:00
|
|
|
|
This is a 24 bit absolute address. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_24,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_10_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_18_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_26_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 16-bit reloc containing the high 16 bits of an address
|
2002-01-30 18:12:17 +00:00
|
|
|
|
used when the lower 16 bits are treated as unsigned. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_HI16_ULO,
|
|
|
|
|
|
|
|
|
|
/* This is a 16-bit reloc containing the high 16 bits of an address
|
2002-01-30 18:12:17 +00:00
|
|
|
|
used when the lower 16 bits are treated as signed. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_HI16_SLO,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 16-bit reloc containing the lower 16 bits of an address. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_LO16,
|
|
|
|
|
|
|
|
|
|
/* This is a 16-bit reloc containing the small data area offset for use in
|
2002-01-30 18:12:17 +00:00
|
|
|
|
add3, load, and store instructions. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_M32R_SDA16,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 9-bit reloc */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_9_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 22-bit reloc */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_22_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 16 bit offset from the short data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_SDA_16_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset (of which only 15 bits are used) from the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
short data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_SDA_15_16_OFFSET,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 16 bit offset from the zero data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_ZDA_16_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset (of which only 15 bits are used) from the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
zero data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_ZDA_15_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is an 8 bit offset (of which only 6 bits are used) from the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
tiny data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_TDA_6_8_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is an 8bit offset (of which only 7 bits are used) from the tiny
|
2002-01-30 18:12:17 +00:00
|
|
|
|
data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_TDA_7_8_OFFSET,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 7 bit offset from the tiny data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_TDA_7_7_OFFSET,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 16 bit offset from the tiny data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_TDA_16_16_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
|
2002-01-30 18:12:17 +00:00
|
|
|
|
data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_TDA_4_5_OFFSET,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 4 bit offset from the tiny data area pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_TDA_4_4_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset from the short data area pointer, with the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
bits placed non-contigously in the instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit offset from the zero data area pointer, with the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
bits placed non-contigously in the instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 6 bit offset from the call table base pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_CALLT_6_7_OFFSET,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 16 bit offset from the call table base pointer. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_V850_CALLT_16_16_OFFSET,
|
|
|
|
|
|
2002-08-29 06:49:35 +00:00
|
|
|
|
/* Used for relaxing indirect function calls. */
|
|
|
|
|
BFD_RELOC_V850_LONGCALL,
|
|
|
|
|
|
|
|
|
|
/* Used for relaxing indirect jumps. */
|
|
|
|
|
BFD_RELOC_V850_LONGJUMP,
|
|
|
|
|
|
|
|
|
|
/* Used to maintain alignment whilst relaxing. */
|
|
|
|
|
BFD_RELOC_V850_ALIGN,
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MN10300_32_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
|
2002-01-30 18:12:17 +00:00
|
|
|
|
instruction. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MN10300_16_PCREL,
|
|
|
|
|
|
|
|
|
|
/* 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
|
2002-01-30 18:12:17 +00:00
|
|
|
|
significant 8 bits of the opcode. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_TIC30_LDP,
|
|
|
|
|
|
2000-04-07 17:06:58 +00:00
|
|
|
|
/* This is a 7bit reloc for the tms320c54x, where the least
|
|
|
|
|
significant 7 bits of a 16 bit word are placed into the least
|
2002-01-30 18:12:17 +00:00
|
|
|
|
significant 7 bits of the opcode. */
|
2000-04-07 17:06:58 +00:00
|
|
|
|
BFD_RELOC_TIC54X_PARTLS7,
|
|
|
|
|
|
|
|
|
|
/* This is a 9bit DP reloc for the tms320c54x, where the most
|
|
|
|
|
significant 9 bits of a 16 bit word are placed into the least
|
2002-01-30 18:12:17 +00:00
|
|
|
|
significant 9 bits of the opcode. */
|
2000-04-07 17:06:58 +00:00
|
|
|
|
BFD_RELOC_TIC54X_PARTMS9,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is an extended address 23-bit reloc for the tms320c54x. */
|
2000-04-07 17:06:58 +00:00
|
|
|
|
BFD_RELOC_TIC54X_23,
|
|
|
|
|
|
2001-01-11 21:20:20 +00:00
|
|
|
|
/* This is a 16-bit reloc for the tms320c54x, where the least
|
|
|
|
|
significant 16 bits of a 23-bit extended address are placed into
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the opcode. */
|
2000-04-07 17:06:58 +00:00
|
|
|
|
BFD_RELOC_TIC54X_16_OF_23,
|
|
|
|
|
|
|
|
|
|
/* This is a reloc for the tms320c54x, where the most
|
2001-01-11 21:20:20 +00:00
|
|
|
|
significant 7 bits of a 23-bit extended address are placed into
|
2002-01-30 18:12:17 +00:00
|
|
|
|
the opcode. */
|
2000-04-07 17:06:58 +00:00
|
|
|
|
BFD_RELOC_TIC54X_MS7_OF_23,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_48,
|
|
|
|
|
|
|
|
|
|
/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
|
2002-01-30 18:12:17 +00:00
|
|
|
|
two sections. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_20,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
|
2002-01-30 18:12:17 +00:00
|
|
|
|
4 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_6_IN_4,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
|
2002-01-30 18:12:17 +00:00
|
|
|
|
into 8 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_8_IN_8,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
|
2002-01-30 18:12:17 +00:00
|
|
|
|
into 8 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_9_IN_8,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
|
2002-01-30 18:12:17 +00:00
|
|
|
|
into 8 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_10_IN_8,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
|
2002-01-30 18:12:17 +00:00
|
|
|
|
short offset into 8 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_9_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
|
2002-01-30 18:12:17 +00:00
|
|
|
|
short offset into 11 bits. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_FR30_12_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Motorola Mcore relocations. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_MCORE_PCREL_IMM8BY4,
|
|
|
|
|
BFD_RELOC_MCORE_PCREL_IMM11BY2,
|
|
|
|
|
BFD_RELOC_MCORE_PCREL_IMM4BY2,
|
|
|
|
|
BFD_RELOC_MCORE_PCREL_32,
|
|
|
|
|
BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
|
1999-05-15 15:38:13 +00:00
|
|
|
|
BFD_RELOC_MCORE_RVA,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* These are relocations for the GETA instruction. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_GETA,
|
|
|
|
|
BFD_RELOC_MMIX_GETA_1,
|
|
|
|
|
BFD_RELOC_MMIX_GETA_2,
|
|
|
|
|
BFD_RELOC_MMIX_GETA_3,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* These are relocations for a conditional branch instruction. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_CBRANCH,
|
|
|
|
|
BFD_RELOC_MMIX_CBRANCH_J,
|
|
|
|
|
BFD_RELOC_MMIX_CBRANCH_1,
|
|
|
|
|
BFD_RELOC_MMIX_CBRANCH_2,
|
|
|
|
|
BFD_RELOC_MMIX_CBRANCH_3,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* These are relocations for the PUSHJ instruction. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_PUSHJ,
|
|
|
|
|
BFD_RELOC_MMIX_PUSHJ_1,
|
|
|
|
|
BFD_RELOC_MMIX_PUSHJ_2,
|
|
|
|
|
BFD_RELOC_MMIX_PUSHJ_3,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* These are relocations for the JMP instruction. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_JMP,
|
|
|
|
|
BFD_RELOC_MMIX_JMP_1,
|
|
|
|
|
BFD_RELOC_MMIX_JMP_2,
|
|
|
|
|
BFD_RELOC_MMIX_JMP_3,
|
|
|
|
|
|
|
|
|
|
/* This is a relocation for a relative address as in a GETA instruction or
|
2002-01-30 18:12:17 +00:00
|
|
|
|
a branch. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_ADDR19,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This is a relocation for a relative address as in a JMP instruction. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_ADDR27,
|
|
|
|
|
|
|
|
|
|
/* This is a relocation for an instruction field that may be a general
|
2002-01-30 18:12:17 +00:00
|
|
|
|
register or a value 0..255. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_REG_OR_BYTE,
|
|
|
|
|
|
|
|
|
|
/* This is a relocation for an instruction field that may be a general
|
2002-01-30 18:12:17 +00:00
|
|
|
|
register. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_REG,
|
|
|
|
|
|
|
|
|
|
/* This is a relocation for two instruction fields holding a register and
|
2002-01-30 18:12:17 +00:00
|
|
|
|
an offset, the equivalent of the relocation. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* This relocation is an assertion that the expression is not allocated as
|
2002-01-30 18:12:17 +00:00
|
|
|
|
a global register. It does not modify contents. */
|
2001-10-30 15:20:14 +00:00
|
|
|
|
BFD_RELOC_MMIX_LOCAL,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
|
2002-01-30 18:12:17 +00:00
|
|
|
|
short offset into 7 bits. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_7_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
|
2002-01-30 18:12:17 +00:00
|
|
|
|
short offset into 12 bits. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_13_PCREL,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
|
2002-01-30 18:12:17 +00:00
|
|
|
|
program memory address) into 16 bits. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_16_PM,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
|
2002-01-30 18:12:17 +00:00
|
|
|
|
data memory address) into 8 bit immediate value of LDI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_LO8_LDI,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of data memory address) into 8 bit immediate value of LDI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HI8_LDI,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of program memory address) into 8 bit immediate value of LDI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HH8_LDI,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
|
2002-01-30 18:12:17 +00:00
|
|
|
|
(usually data memory address) into 8 bit immediate value of SUBI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_LO8_LDI_NEG,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
|
|
|
|
|
(high 8 bit of data memory address) into 8 bit immediate value of
|
2002-01-30 18:12:17 +00:00
|
|
|
|
SUBI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HI8_LDI_NEG,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
|
|
|
|
|
(most high 8 bit of program memory address) into 8 bit immediate value
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of LDI or SUBI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HH8_LDI_NEG,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
|
2002-01-30 18:12:17 +00:00
|
|
|
|
command address) into 8 bit immediate value of LDI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_LO8_LDI_PM,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of command address) into 8 bit immediate value of LDI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HI8_LDI_PM,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of command address) into 8 bit immediate value of LDI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HH8_LDI_PM,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
|
2002-01-30 18:12:17 +00:00
|
|
|
|
(usually command address) into 8 bit immediate value of SUBI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_LO8_LDI_PM_NEG,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
|
|
|
|
|
(high 8 bit of 16 bit command address) into 8 bit immediate value
|
2002-01-30 18:12:17 +00:00
|
|
|
|
of SUBI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HI8_LDI_PM_NEG,
|
|
|
|
|
|
|
|
|
|
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
|
|
|
|
|
(high 6 bit of 22 bit command address) into 8 bit immediate
|
2002-01-30 18:12:17 +00:00
|
|
|
|
value of SUBI insn. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_HH8_LDI_PM_NEG,
|
|
|
|
|
|
|
|
|
|
/* This is a 32 bit reloc for the AVR that stores 23 bit value
|
2002-01-30 18:12:17 +00:00
|
|
|
|
into 22 bits. */
|
2000-03-27 08:39:14 +00:00
|
|
|
|
BFD_RELOC_AVR_CALL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Direct 12 bit. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_12,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 12 bit GOT offset. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_GOT12,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32 bit PC relative PLT address. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_PLT32,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Copy symbol at runtime. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_COPY,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Create GOT entry. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_GLOB_DAT,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Create PLT entry. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_JMP_SLOT,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Adjust by program base. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_RELATIVE,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32 bit PC relative offset to GOT. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_GOTPC,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 16 bit GOT offset. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_GOT16,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* PC relative 16 bit shifted by 1. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_PC16DBL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 16 bit PC rel. PLT shifted by 1. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_PLT16DBL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* PC relative 32 bit shifted by 1. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_PC32DBL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32 bit PC rel. PLT shifted by 1. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_PLT32DBL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32 bit PC rel. GOT shifted by 1. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_GOTPCDBL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 64 bit GOT offset. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_GOT64,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 64 bit PC relative PLT address. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_PLT64,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32 bit rel. offset to GOT entry. */
|
2001-02-10 00:58:38 +00:00
|
|
|
|
BFD_RELOC_390_GOTENT,
|
|
|
|
|
|
2002-07-17 14:15:52 +00:00
|
|
|
|
/* Scenix IP2K - 9-bit register number / data address */
|
|
|
|
|
BFD_RELOC_IP2K_FR9,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - 4-bit register/data bank number */
|
|
|
|
|
BFD_RELOC_IP2K_BANK,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - low 13 bits of instruction word address */
|
|
|
|
|
BFD_RELOC_IP2K_ADDR16CJP,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - high 3 bits of instruction word address */
|
|
|
|
|
BFD_RELOC_IP2K_PAGE3,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - ext/low/high 8 bits of data address */
|
|
|
|
|
BFD_RELOC_IP2K_LO8DATA,
|
|
|
|
|
BFD_RELOC_IP2K_HI8DATA,
|
|
|
|
|
BFD_RELOC_IP2K_EX8DATA,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - low/high 8 bits of instruction word address */
|
|
|
|
|
BFD_RELOC_IP2K_LO8INSN,
|
|
|
|
|
BFD_RELOC_IP2K_HI8INSN,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
|
|
|
|
|
BFD_RELOC_IP2K_PC_SKIP,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - 16 bit word address in text section. */
|
|
|
|
|
BFD_RELOC_IP2K_TEXT,
|
|
|
|
|
|
|
|
|
|
/* Scenix IP2K - 7-bit sp or dp offset */
|
|
|
|
|
BFD_RELOC_IP2K_FR_OFFSET,
|
|
|
|
|
|
|
|
|
|
/* Scenix VPE4K coprocessor - data/insn-space addressing */
|
|
|
|
|
BFD_RELOC_VPE4KMATH_DATA,
|
|
|
|
|
BFD_RELOC_VPE4KMATH_INSN,
|
|
|
|
|
|
2000-03-27 08:39:14 +00:00
|
|
|
|
/* These two relocations are used by the linker to determine which of
|
1999-05-03 07:29:11 +00:00
|
|
|
|
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
|
2000-03-27 08:39:14 +00:00
|
|
|
|
describes the entry that is being used. For Rela hosts, this offset
|
1999-05-03 07:29:11 +00:00
|
|
|
|
is stored in the reloc's addend. For Rel hosts, we are forced to put
|
2002-01-30 18:12:17 +00:00
|
|
|
|
this offset in the reloc's section offset. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_VTABLE_INHERIT,
|
|
|
|
|
BFD_RELOC_VTABLE_ENTRY,
|
2000-04-21 20:22:24 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Intel IA64 Relocations. */
|
2000-04-21 20:22:24 +00:00
|
|
|
|
BFD_RELOC_IA64_IMM14,
|
|
|
|
|
BFD_RELOC_IA64_IMM22,
|
|
|
|
|
BFD_RELOC_IA64_IMM64,
|
|
|
|
|
BFD_RELOC_IA64_DIR32MSB,
|
|
|
|
|
BFD_RELOC_IA64_DIR32LSB,
|
|
|
|
|
BFD_RELOC_IA64_DIR64MSB,
|
|
|
|
|
BFD_RELOC_IA64_DIR64LSB,
|
|
|
|
|
BFD_RELOC_IA64_GPREL22,
|
|
|
|
|
BFD_RELOC_IA64_GPREL64I,
|
|
|
|
|
BFD_RELOC_IA64_GPREL32MSB,
|
|
|
|
|
BFD_RELOC_IA64_GPREL32LSB,
|
|
|
|
|
BFD_RELOC_IA64_GPREL64MSB,
|
|
|
|
|
BFD_RELOC_IA64_GPREL64LSB,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF22,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF64I,
|
|
|
|
|
BFD_RELOC_IA64_PLTOFF22,
|
|
|
|
|
BFD_RELOC_IA64_PLTOFF64I,
|
|
|
|
|
BFD_RELOC_IA64_PLTOFF64MSB,
|
|
|
|
|
BFD_RELOC_IA64_PLTOFF64LSB,
|
|
|
|
|
BFD_RELOC_IA64_FPTR64I,
|
|
|
|
|
BFD_RELOC_IA64_FPTR32MSB,
|
|
|
|
|
BFD_RELOC_IA64_FPTR32LSB,
|
|
|
|
|
BFD_RELOC_IA64_FPTR64MSB,
|
|
|
|
|
BFD_RELOC_IA64_FPTR64LSB,
|
|
|
|
|
BFD_RELOC_IA64_PCREL21B,
|
* elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI,
PCREL22, PCREL64I. Zero size of special relocs.
(elf64_ia64_reloc_type_lookup): Likewise.
(USE_BRL, oor_brl, oor_ip): New.
(elf64_ia64_relax_section): New.
(elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I.
(elf64_ia64_install_value): Likewise, plus PCREL21BI.
(elf64_ia64_relocate_section): Likewise.
(bfd_elf64_bfd_relax_section): New.
* reloc.c (BFD_RELOC_IA64_PCREL21BI): New.
(BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New.
* bfd-in2.h, libbfd.h: Regenerate.
2000-05-23 01:32:28 +00:00
|
|
|
|
BFD_RELOC_IA64_PCREL21BI,
|
2000-04-21 20:22:24 +00:00
|
|
|
|
BFD_RELOC_IA64_PCREL21M,
|
|
|
|
|
BFD_RELOC_IA64_PCREL21F,
|
* elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI,
PCREL22, PCREL64I. Zero size of special relocs.
(elf64_ia64_reloc_type_lookup): Likewise.
(USE_BRL, oor_brl, oor_ip): New.
(elf64_ia64_relax_section): New.
(elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I.
(elf64_ia64_install_value): Likewise, plus PCREL21BI.
(elf64_ia64_relocate_section): Likewise.
(bfd_elf64_bfd_relax_section): New.
* reloc.c (BFD_RELOC_IA64_PCREL21BI): New.
(BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New.
* bfd-in2.h, libbfd.h: Regenerate.
2000-05-23 01:32:28 +00:00
|
|
|
|
BFD_RELOC_IA64_PCREL22,
|
|
|
|
|
BFD_RELOC_IA64_PCREL60B,
|
|
|
|
|
BFD_RELOC_IA64_PCREL64I,
|
2000-04-21 20:22:24 +00:00
|
|
|
|
BFD_RELOC_IA64_PCREL32MSB,
|
|
|
|
|
BFD_RELOC_IA64_PCREL32LSB,
|
|
|
|
|
BFD_RELOC_IA64_PCREL64MSB,
|
|
|
|
|
BFD_RELOC_IA64_PCREL64LSB,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF_FPTR22,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF_FPTR64I,
|
2001-07-12 01:24:14 +00:00
|
|
|
|
BFD_RELOC_IA64_LTOFF_FPTR32MSB,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF_FPTR32LSB,
|
2000-04-21 20:22:24 +00:00
|
|
|
|
BFD_RELOC_IA64_LTOFF_FPTR64MSB,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF_FPTR64LSB,
|
|
|
|
|
BFD_RELOC_IA64_SEGREL32MSB,
|
|
|
|
|
BFD_RELOC_IA64_SEGREL32LSB,
|
|
|
|
|
BFD_RELOC_IA64_SEGREL64MSB,
|
|
|
|
|
BFD_RELOC_IA64_SEGREL64LSB,
|
|
|
|
|
BFD_RELOC_IA64_SECREL32MSB,
|
|
|
|
|
BFD_RELOC_IA64_SECREL32LSB,
|
|
|
|
|
BFD_RELOC_IA64_SECREL64MSB,
|
|
|
|
|
BFD_RELOC_IA64_SECREL64LSB,
|
|
|
|
|
BFD_RELOC_IA64_REL32MSB,
|
|
|
|
|
BFD_RELOC_IA64_REL32LSB,
|
|
|
|
|
BFD_RELOC_IA64_REL64MSB,
|
|
|
|
|
BFD_RELOC_IA64_REL64LSB,
|
|
|
|
|
BFD_RELOC_IA64_LTV32MSB,
|
|
|
|
|
BFD_RELOC_IA64_LTV32LSB,
|
|
|
|
|
BFD_RELOC_IA64_LTV64MSB,
|
|
|
|
|
BFD_RELOC_IA64_LTV64LSB,
|
|
|
|
|
BFD_RELOC_IA64_IPLTMSB,
|
|
|
|
|
BFD_RELOC_IA64_IPLTLSB,
|
|
|
|
|
BFD_RELOC_IA64_COPY,
|
* elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
for symbols from SHF_TLS section.
(_bfd_elf_print_private_bfd_data): Add PT_TLS.
(elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
(map_sections_to_segments): Build PT_TLS segment if necessary.
(assign_file_positions_for_segments): Likewise.
(get_program_header_size): Account for PT_TLS segment.
(swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
SEC_THREAD_LOCAL sections to STT_TLS.
* reloc.c: Add 386 and IA-64 TLS relocs.
* section.c (SEC_THREAD_LOCAL): Define.
(SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
Remove.
* elflink.h (elf_link_add_object_symbols): Support .tcommon.
(size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
unconditionally.
(struct elf_final_link_info): Add first_tls_sec.
(elf_bfd_final_link): Set first_tls_sec.
Compute elf_hash_table (info)->tls_segment.
(elf_link_output_extsym): Handle STT_TLS symbols.
(elf_link_input_bfd): Likewise.
* syms.c (BSF_THREAD_LOCAL): Define.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
elf_i386_mkobject, elf_i386_object_p): New functions.
(elf_howto_table): Add TLS relocs.
(elf_i386_reloc_type_lookup): Support TLS relocs.
(elf_i386_info_to_howto_rel): Likewise.
(struct elf_i386_link_hash_entry): Add tls_type.
(struct elf_i386_obj_tdata): New.
(elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
New macros.
(struct elf_i386_link_hash_table): Add tls_ldm_got.
(link_hash_newfunc): Clear tls_type.
(elf_i386_check_relocs): Support TLS relocs.
(elf_i386_gc_sweep_hook): Likewise.
(allocate_dynrelocs): Likewise.
(elf_i386_size_dynamic_sections): Likewise.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(bfd_elf32_mkobject, elf_backend_object_p): Define.
* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
want_tprel, want_dtpmod, want_dtprel.
(elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
(ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
R_IA64_LTOFF_TPREL22.
(elf_code_to_howto_index): Add TLS relocs.
(elfNN_ia64_check_relocs): Support TLS relocs.
(allocate_global_data_got): Account for TLS .got data.
(allocate_dynrel_entries): Account for TLS dynamic relocations.
(elfNN_ia64_install_value): Supprt TLS relocs.
(set_got_entry): Support TLS relocs.
(elfNN_ia64_relocate_section): Likewise.
* config/obj-elf.c (elf_common): Renamed from obj_elf_common.
(obj_elf_common): Call elf_common.
(obj_elf_tls_common): New function.
(elf_pseudo_tab): Support .tls_common.
(special_sections): Add .tdata and .tbss.
(obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS
sections.
(obj_elf_parse_section_letters): Support T in section flags (SHF_TLS).
(obj_elf_parse_section_letters): Include T in error message.
* config/tc-ppc.c (ppc_section_letter): Likewise.
* config/tc-alpha.c (alpha_elf_section_letter): Likewise.
(tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as
SEC_MERGE.
* config/tc-sparc.c (md_apply_fix3): Likewise.
* config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs.
Define them if not BFD_ASSEMBLER.
(lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF
and @NTPOFF.
(md_apply_fix3): Add TLS relocs.
* config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE,
FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE,
FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE.
(pseudo_func): Support @dtpmod(), @dtprel() and @tprel().
(ia64_elf_section_letter): Include T in error message.
(md_begin): Support TLS operators.
(md_operand): Likewise.
(ia64_gen_real_reloc_type): Support TLS relocs.
* testsuite/gas/i386/tlspic.s: New file.
* testsuite/gas/i386/tlsd.s: New file.
* testsuite/gas/i386/tlsnopic.s: New file.
* testsuite/gas/i386/tlsd.d: New file.
* testsuite/gas/i386/tlsnopic.d: New file.
* testsuite/gas/i386/tlspic.d: New file.
* testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests.
* testsuite/gas/ia64/tls.s: New file.
* testsuite/gas/ia64/tls.d: New file.
* testsuite/gas/ia64/ia64.exp: Add tls test.
* write.c (adjust_reloc_syms): Don't change symbols in
SEC_THREAD_LOCAL sections to STT_SECTION + addend.
* elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define.
* elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22.
* elf/i386.h: Add TLS relocs.
* scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
* ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
output section if necessary. Handle .tbss.
(lang_size_sections): Clear _raw_size for .tbss section
(it allocates space in PT_TLS segment only).
* ldwrite.c (build_link_order): Build link order for .tbss too.
* readelf.c (get_segment_type): Add PT_TLS.
(get_elf_section_flags): Add SHF_TLS.
(get_dynamic_flags): Optimize. Add DF_STATIC_TLS.
(process_dynamic_segment): Use puts instead of printf.
(get_symbol_type): Support STT_TLS.
* objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT,
SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS.
Add SEC_THREAD_LOCAL.
2002-05-23 13:12:53 +00:00
|
|
|
|
BFD_RELOC_IA64_LTOFF22X,
|
|
|
|
|
BFD_RELOC_IA64_LDXMOV,
|
|
|
|
|
BFD_RELOC_IA64_TPREL14,
|
2000-04-21 20:22:24 +00:00
|
|
|
|
BFD_RELOC_IA64_TPREL22,
|
* elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
for symbols from SHF_TLS section.
(_bfd_elf_print_private_bfd_data): Add PT_TLS.
(elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
(map_sections_to_segments): Build PT_TLS segment if necessary.
(assign_file_positions_for_segments): Likewise.
(get_program_header_size): Account for PT_TLS segment.
(swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
SEC_THREAD_LOCAL sections to STT_TLS.
* reloc.c: Add 386 and IA-64 TLS relocs.
* section.c (SEC_THREAD_LOCAL): Define.
(SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
Remove.
* elflink.h (elf_link_add_object_symbols): Support .tcommon.
(size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
unconditionally.
(struct elf_final_link_info): Add first_tls_sec.
(elf_bfd_final_link): Set first_tls_sec.
Compute elf_hash_table (info)->tls_segment.
(elf_link_output_extsym): Handle STT_TLS symbols.
(elf_link_input_bfd): Likewise.
* syms.c (BSF_THREAD_LOCAL): Define.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
elf_i386_mkobject, elf_i386_object_p): New functions.
(elf_howto_table): Add TLS relocs.
(elf_i386_reloc_type_lookup): Support TLS relocs.
(elf_i386_info_to_howto_rel): Likewise.
(struct elf_i386_link_hash_entry): Add tls_type.
(struct elf_i386_obj_tdata): New.
(elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
New macros.
(struct elf_i386_link_hash_table): Add tls_ldm_got.
(link_hash_newfunc): Clear tls_type.
(elf_i386_check_relocs): Support TLS relocs.
(elf_i386_gc_sweep_hook): Likewise.
(allocate_dynrelocs): Likewise.
(elf_i386_size_dynamic_sections): Likewise.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(bfd_elf32_mkobject, elf_backend_object_p): Define.
* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
want_tprel, want_dtpmod, want_dtprel.
(elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
(ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
R_IA64_LTOFF_TPREL22.
(elf_code_to_howto_index): Add TLS relocs.
(elfNN_ia64_check_relocs): Support TLS relocs.
(allocate_global_data_got): Account for TLS .got data.
(allocate_dynrel_entries): Account for TLS dynamic relocations.
(elfNN_ia64_install_value): Supprt TLS relocs.
(set_got_entry): Support TLS relocs.
(elfNN_ia64_relocate_section): Likewise.
* config/obj-elf.c (elf_common): Renamed from obj_elf_common.
(obj_elf_common): Call elf_common.
(obj_elf_tls_common): New function.
(elf_pseudo_tab): Support .tls_common.
(special_sections): Add .tdata and .tbss.
(obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS
sections.
(obj_elf_parse_section_letters): Support T in section flags (SHF_TLS).
(obj_elf_parse_section_letters): Include T in error message.
* config/tc-ppc.c (ppc_section_letter): Likewise.
* config/tc-alpha.c (alpha_elf_section_letter): Likewise.
(tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as
SEC_MERGE.
* config/tc-sparc.c (md_apply_fix3): Likewise.
* config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs.
Define them if not BFD_ASSEMBLER.
(lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF
and @NTPOFF.
(md_apply_fix3): Add TLS relocs.
* config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE,
FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE,
FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE.
(pseudo_func): Support @dtpmod(), @dtprel() and @tprel().
(ia64_elf_section_letter): Include T in error message.
(md_begin): Support TLS operators.
(md_operand): Likewise.
(ia64_gen_real_reloc_type): Support TLS relocs.
* testsuite/gas/i386/tlspic.s: New file.
* testsuite/gas/i386/tlsd.s: New file.
* testsuite/gas/i386/tlsnopic.s: New file.
* testsuite/gas/i386/tlsd.d: New file.
* testsuite/gas/i386/tlsnopic.d: New file.
* testsuite/gas/i386/tlspic.d: New file.
* testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests.
* testsuite/gas/ia64/tls.s: New file.
* testsuite/gas/ia64/tls.d: New file.
* testsuite/gas/ia64/ia64.exp: Add tls test.
* write.c (adjust_reloc_syms): Don't change symbols in
SEC_THREAD_LOCAL sections to STT_SECTION + addend.
* elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define.
* elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22.
* elf/i386.h: Add TLS relocs.
* scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
* ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
output section if necessary. Handle .tbss.
(lang_size_sections): Clear _raw_size for .tbss section
(it allocates space in PT_TLS segment only).
* ldwrite.c (build_link_order): Build link order for .tbss too.
* readelf.c (get_segment_type): Add PT_TLS.
(get_elf_section_flags): Add SHF_TLS.
(get_dynamic_flags): Optimize. Add DF_STATIC_TLS.
(process_dynamic_segment): Use puts instead of printf.
(get_symbol_type): Support STT_TLS.
* objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT,
SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS.
Add SEC_THREAD_LOCAL.
2002-05-23 13:12:53 +00:00
|
|
|
|
BFD_RELOC_IA64_TPREL64I,
|
2000-04-21 20:22:24 +00:00
|
|
|
|
BFD_RELOC_IA64_TPREL64MSB,
|
|
|
|
|
BFD_RELOC_IA64_TPREL64LSB,
|
* elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
for symbols from SHF_TLS section.
(_bfd_elf_print_private_bfd_data): Add PT_TLS.
(elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
(map_sections_to_segments): Build PT_TLS segment if necessary.
(assign_file_positions_for_segments): Likewise.
(get_program_header_size): Account for PT_TLS segment.
(swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
SEC_THREAD_LOCAL sections to STT_TLS.
* reloc.c: Add 386 and IA-64 TLS relocs.
* section.c (SEC_THREAD_LOCAL): Define.
(SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
Remove.
* elflink.h (elf_link_add_object_symbols): Support .tcommon.
(size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
unconditionally.
(struct elf_final_link_info): Add first_tls_sec.
(elf_bfd_final_link): Set first_tls_sec.
Compute elf_hash_table (info)->tls_segment.
(elf_link_output_extsym): Handle STT_TLS symbols.
(elf_link_input_bfd): Likewise.
* syms.c (BSF_THREAD_LOCAL): Define.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
elf_i386_mkobject, elf_i386_object_p): New functions.
(elf_howto_table): Add TLS relocs.
(elf_i386_reloc_type_lookup): Support TLS relocs.
(elf_i386_info_to_howto_rel): Likewise.
(struct elf_i386_link_hash_entry): Add tls_type.
(struct elf_i386_obj_tdata): New.
(elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
New macros.
(struct elf_i386_link_hash_table): Add tls_ldm_got.
(link_hash_newfunc): Clear tls_type.
(elf_i386_check_relocs): Support TLS relocs.
(elf_i386_gc_sweep_hook): Likewise.
(allocate_dynrelocs): Likewise.
(elf_i386_size_dynamic_sections): Likewise.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(bfd_elf32_mkobject, elf_backend_object_p): Define.
* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
want_tprel, want_dtpmod, want_dtprel.
(elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
(ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
R_IA64_LTOFF_TPREL22.
(elf_code_to_howto_index): Add TLS relocs.
(elfNN_ia64_check_relocs): Support TLS relocs.
(allocate_global_data_got): Account for TLS .got data.
(allocate_dynrel_entries): Account for TLS dynamic relocations.
(elfNN_ia64_install_value): Supprt TLS relocs.
(set_got_entry): Support TLS relocs.
(elfNN_ia64_relocate_section): Likewise.
* config/obj-elf.c (elf_common): Renamed from obj_elf_common.
(obj_elf_common): Call elf_common.
(obj_elf_tls_common): New function.
(elf_pseudo_tab): Support .tls_common.
(special_sections): Add .tdata and .tbss.
(obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS
sections.
(obj_elf_parse_section_letters): Support T in section flags (SHF_TLS).
(obj_elf_parse_section_letters): Include T in error message.
* config/tc-ppc.c (ppc_section_letter): Likewise.
* config/tc-alpha.c (alpha_elf_section_letter): Likewise.
(tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as
SEC_MERGE.
* config/tc-sparc.c (md_apply_fix3): Likewise.
* config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs.
Define them if not BFD_ASSEMBLER.
(lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF
and @NTPOFF.
(md_apply_fix3): Add TLS relocs.
* config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE,
FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE,
FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE.
(pseudo_func): Support @dtpmod(), @dtprel() and @tprel().
(ia64_elf_section_letter): Include T in error message.
(md_begin): Support TLS operators.
(md_operand): Likewise.
(ia64_gen_real_reloc_type): Support TLS relocs.
* testsuite/gas/i386/tlspic.s: New file.
* testsuite/gas/i386/tlsd.s: New file.
* testsuite/gas/i386/tlsnopic.s: New file.
* testsuite/gas/i386/tlsd.d: New file.
* testsuite/gas/i386/tlsnopic.d: New file.
* testsuite/gas/i386/tlspic.d: New file.
* testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests.
* testsuite/gas/ia64/tls.s: New file.
* testsuite/gas/ia64/tls.d: New file.
* testsuite/gas/ia64/ia64.exp: Add tls test.
* write.c (adjust_reloc_syms): Don't change symbols in
SEC_THREAD_LOCAL sections to STT_SECTION + addend.
* elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define.
* elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22.
* elf/i386.h: Add TLS relocs.
* scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
* ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
output section if necessary. Handle .tbss.
(lang_size_sections): Clear _raw_size for .tbss section
(it allocates space in PT_TLS segment only).
* ldwrite.c (build_link_order): Build link order for .tbss too.
* readelf.c (get_segment_type): Add PT_TLS.
(get_elf_section_flags): Add SHF_TLS.
(get_dynamic_flags): Optimize. Add DF_STATIC_TLS.
(process_dynamic_segment): Use puts instead of printf.
(get_symbol_type): Support STT_TLS.
* objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT,
SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS.
Add SEC_THREAD_LOCAL.
2002-05-23 13:12:53 +00:00
|
|
|
|
BFD_RELOC_IA64_LTOFF_TPREL22,
|
|
|
|
|
BFD_RELOC_IA64_DTPMOD64MSB,
|
|
|
|
|
BFD_RELOC_IA64_DTPMOD64LSB,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF_DTPMOD22,
|
|
|
|
|
BFD_RELOC_IA64_DTPREL14,
|
|
|
|
|
BFD_RELOC_IA64_DTPREL22,
|
|
|
|
|
BFD_RELOC_IA64_DTPREL64I,
|
|
|
|
|
BFD_RELOC_IA64_DTPREL32MSB,
|
|
|
|
|
BFD_RELOC_IA64_DTPREL32LSB,
|
|
|
|
|
BFD_RELOC_IA64_DTPREL64MSB,
|
|
|
|
|
BFD_RELOC_IA64_DTPREL64LSB,
|
|
|
|
|
BFD_RELOC_IA64_LTOFF_DTPREL22,
|
2000-06-19 01:22:44 +00:00
|
|
|
|
|
|
|
|
|
/* Motorola 68HC11 reloc.
|
2002-08-13 20:08:49 +00:00
|
|
|
|
This is the 8 bit high part of an absolute address. */
|
2000-06-19 01:22:44 +00:00
|
|
|
|
BFD_RELOC_M68HC11_HI8,
|
|
|
|
|
|
|
|
|
|
/* Motorola 68HC11 reloc.
|
2002-08-13 20:08:49 +00:00
|
|
|
|
This is the 8 bit low part of an absolute address. */
|
2000-06-19 01:22:44 +00:00
|
|
|
|
BFD_RELOC_M68HC11_LO8,
|
|
|
|
|
|
|
|
|
|
/* Motorola 68HC11 reloc.
|
2002-08-13 20:08:49 +00:00
|
|
|
|
This is the 3 bit of a value. */
|
2000-06-19 01:22:44 +00:00
|
|
|
|
BFD_RELOC_M68HC11_3B,
|
2000-07-20 16:21:07 +00:00
|
|
|
|
|
2002-08-13 20:08:49 +00:00
|
|
|
|
/* Motorola 68HC11 reloc.
|
|
|
|
|
This reloc marks the beginning of a jump/call instruction.
|
|
|
|
|
It is used for linker relaxation to correctly identify beginning
|
|
|
|
|
of instruction and change some branchs to use PC-relative
|
|
|
|
|
addressing mode. */
|
|
|
|
|
BFD_RELOC_M68HC11_RL_JUMP,
|
|
|
|
|
|
|
|
|
|
/* Motorola 68HC11 reloc.
|
|
|
|
|
This reloc marks a group of several instructions that gcc generates
|
|
|
|
|
and for which the linker relaxation pass can modify and/or remove
|
|
|
|
|
some of them. */
|
|
|
|
|
BFD_RELOC_M68HC11_RL_GROUP,
|
|
|
|
|
|
|
|
|
|
/* Motorola 68HC11 reloc.
|
|
|
|
|
This is the 16-bit lower part of an address. It is used for 'call'
|
|
|
|
|
instruction to specify the symbol address without any special
|
|
|
|
|
transformation (due to memory bank window). */
|
|
|
|
|
BFD_RELOC_M68HC11_LO16,
|
|
|
|
|
|
|
|
|
|
/* Motorola 68HC11 reloc.
|
|
|
|
|
This is a 8-bit reloc that specifies the page number of an address.
|
|
|
|
|
It is used by 'call' instruction to specify the page number of
|
|
|
|
|
the symbol. */
|
|
|
|
|
BFD_RELOC_M68HC11_PAGE,
|
|
|
|
|
|
|
|
|
|
/* Motorola 68HC11 reloc.
|
|
|
|
|
This is a 24-bit reloc that represents the address with a 16-bit
|
|
|
|
|
value and a 8-bit page number. The symbol address is transformed
|
|
|
|
|
to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
|
|
|
|
|
BFD_RELOC_M68HC11_24,
|
|
|
|
|
|
2000-07-20 16:21:07 +00:00
|
|
|
|
/* These relocs are only used within the CRIS assembler. They are not
|
2002-01-30 18:12:17 +00:00
|
|
|
|
(at present) written to any object files. */
|
2000-07-20 16:21:07 +00:00
|
|
|
|
BFD_RELOC_CRIS_BDISP8,
|
|
|
|
|
BFD_RELOC_CRIS_UNSIGNED_5,
|
|
|
|
|
BFD_RELOC_CRIS_SIGNED_6,
|
|
|
|
|
BFD_RELOC_CRIS_UNSIGNED_6,
|
|
|
|
|
BFD_RELOC_CRIS_UNSIGNED_4,
|
2000-08-01 01:45:29 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Relocs used in ELF shared libraries for CRIS. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_COPY,
|
|
|
|
|
BFD_RELOC_CRIS_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_CRIS_JUMP_SLOT,
|
|
|
|
|
BFD_RELOC_CRIS_RELATIVE,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32-bit offset to symbol-entry within GOT. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_32_GOT,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 16-bit offset to symbol-entry within GOT. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_16_GOT,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_32_GOTPLT,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_16_GOTPLT,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32-bit offset to symbol, relative to GOT. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_32_GOTREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32-bit offset to symbol with PLT entry, relative to GOT. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_32_PLT_GOTREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
|
* reloc.c: (BFD_RELOC_CRIS_COPY, BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT, BFD_RELOC_CRIS_RELATIVE,
BFD_RELOC_CRIS_32_GOT, BFD_RELOC_CRIS_16_GOT,
BFD_RELOC_CRIS_32_GOTPLT, BFD_RELOC_CRIS_16_GOTPLT,
BFD_RELOC_CRIS_32_GOTREL, BFD_RELOC_CRIS_32_PLT_GOTREL,
BFD_RELOC_CRIS_32_PLT_PCREL): New relocs.
* bfd-in2.h, libbfd.h: Regenerate.
2001-03-22 11:17:16 +00:00
|
|
|
|
BFD_RELOC_CRIS_32_PLT_PCREL,
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Intel i860 Relocations. */
|
2000-08-01 01:45:29 +00:00
|
|
|
|
BFD_RELOC_860_COPY,
|
|
|
|
|
BFD_RELOC_860_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_860_JUMP_SLOT,
|
|
|
|
|
BFD_RELOC_860_RELATIVE,
|
|
|
|
|
BFD_RELOC_860_PC26,
|
|
|
|
|
BFD_RELOC_860_PLT26,
|
|
|
|
|
BFD_RELOC_860_PC16,
|
|
|
|
|
BFD_RELOC_860_LOW0,
|
|
|
|
|
BFD_RELOC_860_SPLIT0,
|
|
|
|
|
BFD_RELOC_860_LOW1,
|
|
|
|
|
BFD_RELOC_860_SPLIT1,
|
|
|
|
|
BFD_RELOC_860_LOW2,
|
|
|
|
|
BFD_RELOC_860_SPLIT2,
|
|
|
|
|
BFD_RELOC_860_LOW3,
|
|
|
|
|
BFD_RELOC_860_LOGOT0,
|
|
|
|
|
BFD_RELOC_860_SPGOT0,
|
|
|
|
|
BFD_RELOC_860_LOGOT1,
|
|
|
|
|
BFD_RELOC_860_SPGOT1,
|
|
|
|
|
BFD_RELOC_860_LOGOTOFF0,
|
|
|
|
|
BFD_RELOC_860_SPGOTOFF0,
|
|
|
|
|
BFD_RELOC_860_LOGOTOFF1,
|
|
|
|
|
BFD_RELOC_860_SPGOTOFF1,
|
|
|
|
|
BFD_RELOC_860_LOGOTOFF2,
|
|
|
|
|
BFD_RELOC_860_LOGOTOFF3,
|
|
|
|
|
BFD_RELOC_860_LOPC,
|
|
|
|
|
BFD_RELOC_860_HIGHADJ,
|
|
|
|
|
BFD_RELOC_860_HAGOT,
|
|
|
|
|
BFD_RELOC_860_HAGOTOFF,
|
|
|
|
|
BFD_RELOC_860_HAPC,
|
|
|
|
|
BFD_RELOC_860_HIGH,
|
|
|
|
|
BFD_RELOC_860_HIGOT,
|
|
|
|
|
BFD_RELOC_860_HIGOTOFF,
|
2001-04-24 15:08:16 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* OpenRISC Relocations. */
|
2001-04-24 15:08:16 +00:00
|
|
|
|
BFD_RELOC_OPENRISC_ABS_26,
|
|
|
|
|
BFD_RELOC_OPENRISC_REL_26,
|
2001-08-29 01:33:52 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* H8 elf Relocations. */
|
2001-08-29 01:33:52 +00:00
|
|
|
|
BFD_RELOC_H8_DIR16A8,
|
|
|
|
|
BFD_RELOC_H8_DIR16R8,
|
|
|
|
|
BFD_RELOC_H8_DIR24A8,
|
|
|
|
|
BFD_RELOC_H8_DIR24R8,
|
|
|
|
|
BFD_RELOC_H8_DIR32A16,
|
2001-12-08 03:46:03 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Sony Xstormy16 Relocations. */
|
2001-12-08 03:46:03 +00:00
|
|
|
|
BFD_RELOC_XSTORMY16_REL_12,
|
|
|
|
|
BFD_RELOC_XSTORMY16_24,
|
|
|
|
|
BFD_RELOC_XSTORMY16_FPTR16,
|
2002-05-30 02:14:13 +00:00
|
|
|
|
|
|
|
|
|
/* Relocations used by VAX ELF. */
|
|
|
|
|
BFD_RELOC_VAX_GLOB_DAT,
|
|
|
|
|
BFD_RELOC_VAX_JMP_SLOT,
|
|
|
|
|
BFD_RELOC_VAX_RELATIVE,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
BFD_RELOC_UNUSED };
|
|
|
|
|
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
|
|
|
|
|
reloc_howto_type *
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
const char *
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from syms.c. */
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
typedef struct symbol_cache_entry
|
|
|
|
|
{
|
2002-01-30 18:12:17 +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.
|
|
|
|
|
|
|
|
|
|
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. */
|
|
|
|
|
struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
|
|
|
|
|
|
|
|
|
|
/* The text of the symbol. The name is left alone, and not copied; the
|
|
|
|
|
application may not alter it. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
const char *name;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The value of the symbol. This really should be a union of a
|
|
|
|
|
numeric value with a pointer, since some flags indicate that
|
|
|
|
|
a pointer to another symbol is stored here. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
symvalue value;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Attributes of a symbol. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_NO_FLAGS 0x00
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The symbol has local scope; <<static>> in <<C>>. The value
|
|
|
|
|
is the offset into the section of the data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_LOCAL 0x01
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The symbol has global scope; initialized data in <<C>>. The
|
|
|
|
|
value is the offset into the section of the data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_GLOBAL 0x02
|
|
|
|
|
|
2002-01-30 18:12:17 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A normal C symbol would be one of:
|
|
|
|
|
<<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
|
|
|
|
|
<<BSF_GLOBAL>>. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The symbol is a debugging record. The value has an arbitary
|
|
|
|
|
meaning, unless BSF_DEBUGGING_RELOC is also set. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_DEBUGGING 0x08
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The symbol denotes a function entry point. Used in ELF,
|
|
|
|
|
perhaps others someday. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_FUNCTION 0x10
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Used by the linker. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_KEEP 0x20
|
|
|
|
|
#define BSF_KEEP_G 0x40
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A weak global symbol, overridable without warnings by
|
|
|
|
|
a regular global symbol of the same name. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_WEAK 0x80
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This symbol was created to point to a section, e.g. ELF's
|
|
|
|
|
STT_SECTION symbols. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_SECTION_SYM 0x100
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The symbol used to be a common symbol, but now it is
|
|
|
|
|
allocated. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_OLD_COMMON 0x200
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The default value for common data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BFD_FORT_COMM_DEFAULT_VALUE 0
|
|
|
|
|
|
2002-01-30 18:12:17 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_NOT_AT_END 0x400
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Signal that the symbol is the label of constructor section. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_CONSTRUCTOR 0x800
|
|
|
|
|
|
2002-01-30 18:12:17 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_WARNING 0x1000
|
|
|
|
|
|
2002-01-30 18:12:17 +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. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_INDIRECT 0x2000
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* BSF_FILE marks symbols that contain a file name. This is used
|
|
|
|
|
for ELF STT_FILE symbols. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_FILE 0x4000
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Symbol is from dynamic linking information. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_DYNAMIC 0x8000
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The symbol denotes a data object. Used in ELF, and perhaps
|
|
|
|
|
others someday. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BSF_OBJECT 0x10000
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* This symbol is a debugging symbol. The value is the offset
|
|
|
|
|
into the section of the data. BSF_DEBUGGING should be set
|
|
|
|
|
as well. */
|
1999-09-11 14:41:11 +00:00
|
|
|
|
#define BSF_DEBUGGING_RELOC 0x20000
|
|
|
|
|
|
* elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
for symbols from SHF_TLS section.
(_bfd_elf_print_private_bfd_data): Add PT_TLS.
(elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
(map_sections_to_segments): Build PT_TLS segment if necessary.
(assign_file_positions_for_segments): Likewise.
(get_program_header_size): Account for PT_TLS segment.
(swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
SEC_THREAD_LOCAL sections to STT_TLS.
* reloc.c: Add 386 and IA-64 TLS relocs.
* section.c (SEC_THREAD_LOCAL): Define.
(SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
Remove.
* elflink.h (elf_link_add_object_symbols): Support .tcommon.
(size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
unconditionally.
(struct elf_final_link_info): Add first_tls_sec.
(elf_bfd_final_link): Set first_tls_sec.
Compute elf_hash_table (info)->tls_segment.
(elf_link_output_extsym): Handle STT_TLS symbols.
(elf_link_input_bfd): Likewise.
* syms.c (BSF_THREAD_LOCAL): Define.
* bfd-in2.h: Rebuilt.
* libbfd.h: Rebuilt.
* elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
elf_i386_mkobject, elf_i386_object_p): New functions.
(elf_howto_table): Add TLS relocs.
(elf_i386_reloc_type_lookup): Support TLS relocs.
(elf_i386_info_to_howto_rel): Likewise.
(struct elf_i386_link_hash_entry): Add tls_type.
(struct elf_i386_obj_tdata): New.
(elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
New macros.
(struct elf_i386_link_hash_table): Add tls_ldm_got.
(link_hash_newfunc): Clear tls_type.
(elf_i386_check_relocs): Support TLS relocs.
(elf_i386_gc_sweep_hook): Likewise.
(allocate_dynrelocs): Likewise.
(elf_i386_size_dynamic_sections): Likewise.
(elf_i386_relocate_section): Likewise.
(elf_i386_finish_dynamic_symbol): Likewise.
(bfd_elf32_mkobject, elf_backend_object_p): Define.
* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
want_tprel, want_dtpmod, want_dtprel.
(elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
(ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
R_IA64_LTOFF_TPREL22.
(elf_code_to_howto_index): Add TLS relocs.
(elfNN_ia64_check_relocs): Support TLS relocs.
(allocate_global_data_got): Account for TLS .got data.
(allocate_dynrel_entries): Account for TLS dynamic relocations.
(elfNN_ia64_install_value): Supprt TLS relocs.
(set_got_entry): Support TLS relocs.
(elfNN_ia64_relocate_section): Likewise.
* config/obj-elf.c (elf_common): Renamed from obj_elf_common.
(obj_elf_common): Call elf_common.
(obj_elf_tls_common): New function.
(elf_pseudo_tab): Support .tls_common.
(special_sections): Add .tdata and .tbss.
(obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS
sections.
(obj_elf_parse_section_letters): Support T in section flags (SHF_TLS).
(obj_elf_parse_section_letters): Include T in error message.
* config/tc-ppc.c (ppc_section_letter): Likewise.
* config/tc-alpha.c (alpha_elf_section_letter): Likewise.
(tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as
SEC_MERGE.
* config/tc-sparc.c (md_apply_fix3): Likewise.
* config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs.
Define them if not BFD_ASSEMBLER.
(lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF
and @NTPOFF.
(md_apply_fix3): Add TLS relocs.
* config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE,
FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE,
FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE.
(pseudo_func): Support @dtpmod(), @dtprel() and @tprel().
(ia64_elf_section_letter): Include T in error message.
(md_begin): Support TLS operators.
(md_operand): Likewise.
(ia64_gen_real_reloc_type): Support TLS relocs.
* testsuite/gas/i386/tlspic.s: New file.
* testsuite/gas/i386/tlsd.s: New file.
* testsuite/gas/i386/tlsnopic.s: New file.
* testsuite/gas/i386/tlsd.d: New file.
* testsuite/gas/i386/tlsnopic.d: New file.
* testsuite/gas/i386/tlspic.d: New file.
* testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests.
* testsuite/gas/ia64/tls.s: New file.
* testsuite/gas/ia64/tls.d: New file.
* testsuite/gas/ia64/ia64.exp: Add tls test.
* write.c (adjust_reloc_syms): Don't change symbols in
SEC_THREAD_LOCAL sections to STT_SECTION + addend.
* elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define.
* elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22.
* elf/i386.h: Add TLS relocs.
* scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
* ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
output section if necessary. Handle .tbss.
(lang_size_sections): Clear _raw_size for .tbss section
(it allocates space in PT_TLS segment only).
* ldwrite.c (build_link_order): Build link order for .tbss too.
* readelf.c (get_segment_type): Add PT_TLS.
(get_elf_section_flags): Add SHF_TLS.
(get_dynamic_flags): Optimize. Add DF_STATIC_TLS.
(process_dynamic_segment): Use puts instead of printf.
(get_symbol_type): Support STT_TLS.
* objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT,
SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS.
Add SEC_THREAD_LOCAL.
2002-05-23 13:12:53 +00:00
|
|
|
|
/* This symbol is thread local. Used in ELF. */
|
|
|
|
|
#define BSF_THREAD_LOCAL 0x40000
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
flagword flags;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A pointer to the section to which this symbol is
|
|
|
|
|
relative. This will always be non NULL, there are special
|
|
|
|
|
sections for undefined and absolute symbols. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
struct sec *section;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Back end special data. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
PTR p;
|
|
|
|
|
bfd_vma i;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
}
|
|
|
|
|
udata;
|
|
|
|
|
}
|
|
|
|
|
asymbol;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_get_symtab_upper_bound(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
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))
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_canonicalize_symtab(abfd, location) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_canonicalize_symtab,\
|
|
|
|
|
(abfd, location))
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
2001-08-23 15:45:19 +00:00
|
|
|
|
bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#define bfd_make_empty_symbol(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2002-01-06 07:30:35 +00:00
|
|
|
|
asymbol *
|
|
|
|
|
_bfd_generic_make_empty_symbol PARAMS ((bfd *));
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_make_debug_symbol(abfd,ptr,size) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
int
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_decode_symclass PARAMS ((asymbol *symbol));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_is_undefined_symclass PARAMS ((int symclass));
|
2000-01-28 01:06:37 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym));
|
|
|
|
|
|
|
|
|
|
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
|
|
|
|
|
BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
|
|
|
|
|
(ibfd, isymbol, obfd, osymbol))
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from bfd.c. */
|
2000-11-08 23:57:04 +00:00
|
|
|
|
struct _bfd
|
1999-05-03 07:29:11 +00:00
|
|
|
|
{
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The filename the application opened the BFD with. */
|
|
|
|
|
const char *filename;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A pointer to the target jump table. */
|
|
|
|
|
const struct bfd_target *xvec;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +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
|
|
|
|
|
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;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Is the file descriptor being cached? That is, can it be closed as
|
|
|
|
|
needed, and re-opened when accessed later? */
|
|
|
|
|
boolean cacheable;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Marks whether there was a default target specified when the
|
|
|
|
|
BFD was opened. This is used to select which matching algorithm
|
|
|
|
|
to use to choose the back end. */
|
|
|
|
|
boolean target_defaulted;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The caching routines use these to maintain a
|
|
|
|
|
least-recently-used list of BFDs. */
|
|
|
|
|
struct _bfd *lru_prev, *lru_next;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* When a file is closed by the caching routines, BFD retains
|
|
|
|
|
state information on the file here... */
|
|
|
|
|
ufile_ptr where;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* ... and here: (``once'' means at least once). */
|
|
|
|
|
boolean opened_once;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Set if we have a locally maintained mtime value, rather than
|
|
|
|
|
getting it from the file each time. */
|
|
|
|
|
boolean mtime_set;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* File modified time, if mtime_set is true. */
|
|
|
|
|
long mtime;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Reserved for an unimplemented file locking extension. */
|
|
|
|
|
int ifd;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The format which belongs to the BFD. (object, core, etc.) */
|
|
|
|
|
bfd_format format;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The direction with which the BFD was opened. */
|
|
|
|
|
enum bfd_direction
|
|
|
|
|
{
|
|
|
|
|
no_direction = 0,
|
|
|
|
|
read_direction = 1,
|
|
|
|
|
write_direction = 2,
|
|
|
|
|
both_direction = 3
|
|
|
|
|
}
|
|
|
|
|
direction;
|
|
|
|
|
|
|
|
|
|
/* Format_specific flags. */
|
|
|
|
|
flagword flags;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* 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. */
|
|
|
|
|
ufile_ptr origin;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Remember when output has begun, to stop strange things
|
|
|
|
|
from happening. */
|
|
|
|
|
boolean output_has_begun;
|
2001-12-17 00:40:53 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A hash table for section names. */
|
|
|
|
|
struct bfd_hash_table section_htab;
|
2001-12-17 00:40:53 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Pointer to linked list of sections. */
|
|
|
|
|
struct sec *sections;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The place where we add to the section list. */
|
|
|
|
|
struct sec **section_tail;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* The number of sections. */
|
|
|
|
|
unsigned int section_count;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Stuff only useful for object files:
|
|
|
|
|
The start address. */
|
|
|
|
|
bfd_vma start_address;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Used for input and output. */
|
|
|
|
|
unsigned int symcount;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Symbol table for output BFD (with symcount entries). */
|
|
|
|
|
struct symbol_cache_entry **outsymbols;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-09-18 02:39:43 +00:00
|
|
|
|
/* Used for slurped dynamic symbol tables. */
|
|
|
|
|
unsigned int dynsymcount;
|
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Pointer to structure which contains architecture information. */
|
|
|
|
|
const struct bfd_arch_info *arch_info;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Stuff only useful for archives. */
|
|
|
|
|
PTR arelt_data;
|
|
|
|
|
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. */
|
|
|
|
|
boolean has_armap;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A chain of BFD structures involved in a link. */
|
|
|
|
|
struct _bfd *link_next;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* A field used by _bfd_generic_link_add_archive_symbols. This will
|
|
|
|
|
be used only for archive elements. */
|
|
|
|
|
int archive_pass;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Used by the back end to hold private data. */
|
|
|
|
|
union
|
|
|
|
|
{
|
1999-05-03 07:29:11 +00:00
|
|
|
|
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;
|
|
|
|
|
struct pe_tdata *pe_obj_data;
|
|
|
|
|
struct xcoff_tdata *xcoff_obj_data;
|
|
|
|
|
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;
|
|
|
|
|
struct ihex_data_struct *ihex_data;
|
|
|
|
|
struct tekhex_data_struct *tekhex_data;
|
|
|
|
|
struct elf_obj_tdata *elf_obj_data;
|
|
|
|
|
struct nlm_obj_tdata *nlm_obj_data;
|
|
|
|
|
struct bout_data_struct *bout_data;
|
2001-10-30 15:20:14 +00:00
|
|
|
|
struct mmo_data_struct *mmo_data;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
struct sun_core_struct *sun_core_data;
|
|
|
|
|
struct sco5_core_struct *sco5_core_data;
|
|
|
|
|
struct trad_core_struct *trad_core_data;
|
|
|
|
|
struct som_data_struct *som_data;
|
|
|
|
|
struct hpux_core_struct *hpux_core_data;
|
|
|
|
|
struct hppabsd_core_struct *hppabsd_core_data;
|
|
|
|
|
struct sgi_core_struct *sgi_core_data;
|
|
|
|
|
struct lynx_core_struct *lynx_core_data;
|
|
|
|
|
struct osf_core_struct *osf_core_data;
|
|
|
|
|
struct cisco_core_struct *cisco_core_data;
|
|
|
|
|
struct versados_data_struct *versados_data;
|
|
|
|
|
struct netbsd_core_struct *netbsd_core_data;
|
2002-11-06 13:26:29 +00:00
|
|
|
|
struct mach_o_data_struct *mach_o_data;
|
|
|
|
|
struct mach_o_fat_data_struct *mach_o_fat_data;
|
|
|
|
|
struct bfd_pef_data_struct *pef_data;
|
|
|
|
|
struct bfd_pef_xlib_data_struct *pef_xlib_data;
|
|
|
|
|
struct bfd_sym_data_struct *sym_data;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
PTR any;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
}
|
|
|
|
|
tdata;
|
2000-11-08 23:57:04 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Used by the application to hold private data. */
|
|
|
|
|
PTR usrdata;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Where all the allocated stuff under this BFD goes. This is a
|
1999-05-03 07:29:11 +00:00
|
|
|
|
struct objalloc *, but we use PTR to avoid requiring the inclusion of
|
|
|
|
|
objalloc.h. */
|
2002-01-30 18:12:17 +00:00
|
|
|
|
PTR memory;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef enum bfd_error
|
|
|
|
|
{
|
|
|
|
|
bfd_error_no_error = 0,
|
|
|
|
|
bfd_error_system_call,
|
|
|
|
|
bfd_error_invalid_target,
|
|
|
|
|
bfd_error_wrong_format,
|
2001-08-17 03:19:01 +00:00
|
|
|
|
bfd_error_wrong_object_format,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_error_invalid_operation,
|
|
|
|
|
bfd_error_no_memory,
|
|
|
|
|
bfd_error_no_symbols,
|
|
|
|
|
bfd_error_no_armap,
|
|
|
|
|
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,
|
|
|
|
|
bfd_error_file_too_big,
|
|
|
|
|
bfd_error_invalid_error_code
|
2002-01-30 18:12:17 +00:00
|
|
|
|
}
|
|
|
|
|
bfd_error_type;
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_error_type
|
|
|
|
|
bfd_get_error PARAMS ((void));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
|
|
|
|
bfd_set_error PARAMS ((bfd_error_type error_tag));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-08-09 09:09:03 +00:00
|
|
|
|
const char *
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_errmsg PARAMS ((bfd_error_type error_tag));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
2001-08-09 09:09:03 +00:00
|
|
|
|
bfd_perror PARAMS ((const char *message));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_error_handler_type
|
|
|
|
|
bfd_set_error_handler PARAMS ((bfd_error_handler_type));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
|
|
|
|
bfd_set_error_program_name PARAMS ((const char *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_error_handler_type
|
|
|
|
|
bfd_get_error_handler PARAMS ((void));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-09-20 23:30:37 +00:00
|
|
|
|
const char *
|
|
|
|
|
bfd_archive_filename PARAMS ((bfd *));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
long
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
long
|
|
|
|
|
bfd_canonicalize_reloc PARAMS ((bfd *abfd,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
asection *sec,
|
|
|
|
|
arelent **loc,
|
|
|
|
|
asymbol **syms));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
2002-01-30 18:12:17 +00:00
|
|
|
|
bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
int
|
|
|
|
|
bfd_get_arch_size PARAMS ((bfd *abfd));
|
2000-07-18 19:20:13 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
int
|
|
|
|
|
bfd_get_sign_extend_vma PARAMS ((bfd *abfd));
|
2000-07-18 19:20:13 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma));
|
|
|
|
|
|
2001-08-17 15:56:58 +00:00
|
|
|
|
unsigned int
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_get_gp_size PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
void
|
2001-08-17 15:56:58 +00:00
|
|
|
|
bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
bfd_vma
|
2001-08-09 09:09:03 +00:00
|
|
|
|
bfd_scan_vma PARAMS ((const char *string, const char **end, int base));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
|
|
|
|
|
|
|
|
|
|
#define bfd_copy_private_bfd_data(ibfd, obfd) \
|
|
|
|
|
BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
|
|
|
|
|
(ibfd, obfd))
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
|
|
|
|
|
|
|
|
|
|
#define bfd_merge_private_bfd_data(ibfd, obfd) \
|
|
|
|
|
BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
|
|
|
|
|
(ibfd, obfd))
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
|
|
|
|
|
|
|
|
|
|
#define bfd_set_private_flags(abfd, flags) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_set_private_flags, \
|
|
|
|
|
(abfd, flags))
|
|
|
|
|
#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))
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Do these three do anything useful at all, for any back end? */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#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))
|
|
|
|
|
|
2001-01-24 04:56:29 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_stat_arch_elt(abfd, stat) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
|
|
|
|
|
|
|
|
|
|
#define bfd_update_armap_timestamp(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
|
|
|
|
|
|
|
|
|
|
#define bfd_set_arch_mach(abfd, arch, mach)\
|
|
|
|
|
BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
|
|
|
|
|
|
|
|
|
|
#define bfd_relax_section(abfd, section, link_info, again) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
|
|
|
|
|
|
|
|
|
|
#define bfd_gc_sections(abfd, link_info) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
|
|
|
|
|
|
* merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix
fields, change sec into secinfo.
(struct sec_merge_info): Add chain, remove last fields.
(struct sec_merge_sec_info): Add next, sec, psecinfo fields.
(sec_merge_hash_lookup): If lookup could not use a string only
because it has bad alignment, mark the old string for deletion.
(sec_merge_add): Add secinfo argument. Don't compute entry's
position, instead record the section.
(sec_merge_emit): Update for the sec into secinfo change in
struct sec_merge_hash_entry.
(_bfd_merge_section): Only record the section for merging, defer
putting strings into the hash table.
(cmplengthentry, last4_eq, last_eq, record_section, merge_strings,
_bfd_merge_sections): New functions.
(_bfd_merged_section_offset): Update for the sec_merge_hash_entry
changes.
* libbfd-in.h (_bfd_merge_sections): Add prototype.
(_bfd_nolink_bfd_merge_sections): Define.
* libbfd.h: Likewise.
(bfd_generic_merge_sections): Add prototype.
* targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections.
(struct bfd_target): Likewise.
* bfd.c (bfd_merge_sections): Define.
* bfd-in2.h: Rebuilt.
* elf.c (_bfd_elf_merge_sections): New function.
* elf-bfd.h (_bfd_elf_merge_sections): Add prototype.
* elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define.
* reloc.c (bfd_generic_merge_sections): New function.
* vms.c (vms_bfd_merge_sections): New function.
* aout-adobe.c (aout_32_bfd_merge_sections): Define.
* aout-target.h (MY_bfd_merge_sections): Define.
* aout-tic30.c (MY_bfd_merge_sections): Define.
* binary.c (binary_bfd_merge_sections): Define.
* bout.c (b_out_bfd_merge_sections): Define.
* coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define.
* coffcode.c (coff_bfd_merge_sections): Define.
* coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define.
* i386msdos.c (msdos_bfd_merge_sections): Define.
* i386os9k.c (os9k_bfd_merge_sections): Define.
* ieee.c (ieee_bfd_merge_sections): Define.
* ihex.c (ihex_bfd_merge_sections): Define.
* nlm-target.h (nlm_bfd_merge_sections): Define.
* oasys.c (oasys_bfd_merge_sections): Define.
* ppcboot.c (ppcboot_bfd_merge_sections): Define.
* som.c (som_bfd_merge_sections): Define.
* srec.c (srec_bfd_merge_sections): Define.
* tekhex.c (tekhex_bfd_merge_sections): Define.
* versados.c (versados_bfd_merge_sections): Define.
* xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define.
* ldlang.c (lang_process): Call bfd_merge_sections.
2001-05-11 12:23:48 +00:00
|
|
|
|
#define bfd_merge_sections(abfd, link_info) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
|
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
#define bfd_discard_group(abfd, sec) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_link_hash_table_create(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
|
|
|
|
|
|
2002-04-04 19:53:38 +00:00
|
|
|
|
#define bfd_link_hash_table_free(abfd, hash) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_link_add_symbols(abfd, info) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
|
|
|
|
|
|
2002-05-15 00:18:58 +00:00
|
|
|
|
#define bfd_link_just_syms(sec, info) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_final_link(abfd, info) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_final_link, (abfd, info))
|
|
|
|
|
|
|
|
|
|
#define bfd_free_cached_info(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
|
|
|
|
|
|
|
|
|
|
#define bfd_get_dynamic_symtab_upper_bound(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
|
|
|
|
|
|
|
|
|
|
#define bfd_print_private_bfd_data(abfd, file)\
|
|
|
|
|
BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
|
|
|
|
|
|
|
|
|
|
#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
|
|
|
|
|
|
|
|
|
|
#define bfd_get_dynamic_reloc_upper_bound(abfd) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
|
|
|
|
|
|
|
|
|
|
#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
|
|
|
|
|
|
|
|
|
|
extern bfd_byte *bfd_get_relocated_section_contents
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *,
|
|
|
|
|
struct bfd_link_order *, bfd_byte *,
|
|
|
|
|
boolean, asymbol **));
|
|
|
|
|
|
2001-08-24 13:55:55 +00:00
|
|
|
|
boolean
|
2002-07-31 09:38:04 +00:00
|
|
|
|
bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative));
|
2001-08-24 13:55:55 +00:00
|
|
|
|
|
2002-11-12 15:44:24 +00:00
|
|
|
|
struct bfd_preserve
|
|
|
|
|
{
|
|
|
|
|
PTR marker;
|
|
|
|
|
PTR tdata;
|
|
|
|
|
flagword flags;
|
|
|
|
|
const struct bfd_arch_info *arch_info;
|
|
|
|
|
struct sec *sections;
|
|
|
|
|
struct sec **section_tail;
|
|
|
|
|
unsigned int section_count;
|
|
|
|
|
struct bfd_hash_table section_htab;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
boolean
|
|
|
|
|
bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *));
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *));
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *));
|
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from archive.c. */
|
2001-01-25 20:17:45 +00:00
|
|
|
|
symindex
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head));
|
|
|
|
|
|
|
|
|
|
bfd *
|
|
|
|
|
bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous));
|
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from corefile.c. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
const char *
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_core_file_failing_command PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
int
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_core_file_failing_signal PARAMS ((bfd *abfd));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
|
|
|
|
core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from targets.c. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define BFD_SEND(bfd, message, arglist) \
|
|
|
|
|
((*((bfd)->xvec->message)) arglist)
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
#define BFD_SEND_FMT(bfd, message, arglist) \
|
2000-12-21 18:20:04 +00:00
|
|
|
|
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_BFD_SEND
|
|
|
|
|
#undef BFD_SEND_FMT
|
|
|
|
|
#define BFD_SEND_FMT(bfd, message, arglist) \
|
|
|
|
|
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
|
2000-12-21 18:20:04 +00:00
|
|
|
|
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
|
1999-05-03 07:29:11 +00:00
|
|
|
|
(bfd_assert (__FILE__,__LINE__), NULL))
|
|
|
|
|
#endif
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
enum bfd_flavour
|
|
|
|
|
{
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_target_unknown_flavour,
|
|
|
|
|
bfd_target_aout_flavour,
|
|
|
|
|
bfd_target_coff_flavour,
|
|
|
|
|
bfd_target_ecoff_flavour,
|
2000-06-16 20:35:08 +00:00
|
|
|
|
bfd_target_xcoff_flavour,
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_target_elf_flavour,
|
|
|
|
|
bfd_target_ieee_flavour,
|
|
|
|
|
bfd_target_nlm_flavour,
|
|
|
|
|
bfd_target_oasys_flavour,
|
|
|
|
|
bfd_target_tekhex_flavour,
|
|
|
|
|
bfd_target_srec_flavour,
|
|
|
|
|
bfd_target_ihex_flavour,
|
|
|
|
|
bfd_target_som_flavour,
|
|
|
|
|
bfd_target_os9k_flavour,
|
|
|
|
|
bfd_target_versados_flavour,
|
|
|
|
|
bfd_target_msdos_flavour,
|
|
|
|
|
bfd_target_ovax_flavour,
|
2001-10-30 15:20:14 +00:00
|
|
|
|
bfd_target_evax_flavour,
|
2002-11-06 13:26:29 +00:00
|
|
|
|
bfd_target_mmo_flavour,
|
|
|
|
|
bfd_target_mach_o_flavour,
|
|
|
|
|
bfd_target_pef_flavour,
|
|
|
|
|
bfd_target_pef_xlib_flavour,
|
|
|
|
|
bfd_target_sym_flavour
|
1999-05-03 07:29:11 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Forward declaration. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
typedef struct bfd_link_info _bfd_link_info;
|
|
|
|
|
|
|
|
|
|
typedef struct bfd_target
|
|
|
|
|
{
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
char *name;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* The "flavour" of a back end is a general indication about
|
|
|
|
|
the contents of a file. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
enum bfd_flavour flavour;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* The order of bytes within the data area of a file. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
enum bfd_endian byteorder;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* The order of bytes within the header parts of a file. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
enum bfd_endian header_byteorder;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* A mask of all the flags which an executable may have set -
|
|
|
|
|
from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */
|
2000-12-21 18:20:04 +00:00
|
|
|
|
flagword object_flags;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* A mask of all the flags which a section may have set - from
|
|
|
|
|
the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
flagword section_flags;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* The character normally found at the front of a symbol.
|
|
|
|
|
(if any), perhaps `_'. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
char symbol_leading_char;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* The pad character for file names within an archive header. */
|
2000-12-21 18:20:04 +00:00
|
|
|
|
char ar_pad_char;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* The maximum number of characters in an archive header. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
unsigned short ar_max_namelen;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* Entries for byte swapping for data. These are different from the
|
|
|
|
|
other entry points, since they don't take a BFD asthe first argument.
|
|
|
|
|
Certain other handlers could do the same. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
|
|
|
|
bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
|
|
|
|
bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* Byte swapping for the headers. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
|
|
|
|
bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
|
|
|
|
bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* Format dependent routines: these are vectors of entry points
|
|
|
|
|
within the target vector structure, one for each format to check. */
|
|
|
|
|
|
|
|
|
|
/* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* Set the format of a file being written. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
|
|
|
|
/* Write cached information into a file being written, at <<bfd_close>>. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Generic entry points. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_GENERIC(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_close_and_cleanup), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_free_cached_info), \
|
|
|
|
|
CONCAT2 (NAME,_new_section_hook), \
|
|
|
|
|
CONCAT2 (NAME,_get_section_contents), \
|
|
|
|
|
CONCAT2 (NAME,_get_section_contents_in_window)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Called when the BFD is being closed to do any necessary cleanup. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_close_and_cleanup) PARAMS ((bfd *));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Ask the BFD to free all cached information. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Called when a new section is created. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Read the contents of a section. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
|
|
|
|
|
file_ptr, bfd_size_type));
|
|
|
|
|
boolean (*_bfd_get_section_contents_in_window)
|
|
|
|
|
PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Entry points to copy private data. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_COPY(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_bfd_copy_private_bfd_data), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_merge_private_bfd_data), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_copy_private_section_data), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_copy_private_symbol_data), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_set_private_flags), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_print_private_bfd_data) \
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Called to copy BFD general private data from one object file
|
1999-05-03 07:29:11 +00:00
|
|
|
|
to another. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Called to merge BFD general private data from one object file
|
1999-05-03 07:29:11 +00:00
|
|
|
|
to a common output file when linking. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Called to copy BFD private section data from one object file
|
1999-05-03 07:29:11 +00:00
|
|
|
|
to another. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
|
|
|
|
|
bfd *, sec_ptr));
|
2000-12-21 18:20:04 +00:00
|
|
|
|
/* Called to copy BFD private symbol data from one symbol
|
1999-05-03 07:29:11 +00:00
|
|
|
|
to another. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
|
|
|
|
|
bfd *, asymbol *));
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Called to set private backend flags. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Called to print private BFD data. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Core file entry points. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_CORE(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_core_file_failing_command), \
|
|
|
|
|
CONCAT2 (NAME,_core_file_failing_signal), \
|
|
|
|
|
CONCAT2 (NAME,_core_file_matches_executable_p)
|
1999-05-03 07:29:11 +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 *));
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Archive entry points. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_slurp_armap), \
|
|
|
|
|
CONCAT2 (NAME,_slurp_extended_name_table), \
|
|
|
|
|
CONCAT2 (NAME,_construct_extended_name_table), \
|
|
|
|
|
CONCAT2 (NAME,_truncate_arname), \
|
|
|
|
|
CONCAT2 (NAME,_write_armap), \
|
|
|
|
|
CONCAT2 (NAME,_read_ar_hdr), \
|
|
|
|
|
CONCAT2 (NAME,_openr_next_archived_file), \
|
|
|
|
|
CONCAT2 (NAME,_get_elt_at_index), \
|
|
|
|
|
CONCAT2 (NAME,_generic_stat_arch_elt), \
|
|
|
|
|
CONCAT2 (NAME,_update_armap_timestamp)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
|
|
|
|
|
boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
|
|
|
|
|
boolean (*_bfd_construct_extended_name_table)
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
|
|
|
|
|
void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *));
|
|
|
|
|
boolean (*write_armap)
|
|
|
|
|
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
|
|
|
|
|
PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
|
|
|
|
|
bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *));
|
1999-05-03 07:29:11 +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));
|
|
|
|
|
int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
|
|
|
|
|
boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
|
1999-12-10 18:51:35 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Entry points used for symbols. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_get_symtab_upper_bound), \
|
|
|
|
|
CONCAT2 (NAME,_get_symtab), \
|
|
|
|
|
CONCAT2 (NAME,_make_empty_symbol), \
|
|
|
|
|
CONCAT2 (NAME,_print_symbol), \
|
|
|
|
|
CONCAT2 (NAME,_get_symbol_info), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_is_local_label_name), \
|
|
|
|
|
CONCAT2 (NAME,_get_lineno), \
|
|
|
|
|
CONCAT2 (NAME,_find_nearest_line), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_make_debug_symbol), \
|
|
|
|
|
CONCAT2 (NAME,_read_minisymbols), \
|
|
|
|
|
CONCAT2 (NAME,_minisymbol_to_symbol)
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
|
|
|
|
|
long (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
|
|
|
|
|
struct symbol_cache_entry **));
|
|
|
|
|
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));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
void (*_bfd_get_symbol_info) PARAMS ((bfd *,
|
|
|
|
|
struct symbol_cache_entry *,
|
|
|
|
|
symbol_info *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
|
|
|
|
|
boolean (*_bfd_find_nearest_line)
|
|
|
|
|
PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma,
|
|
|
|
|
const char **, const char **, unsigned int *));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Back-door to allow format-aware applications to create debug symbols
|
1999-05-03 07:29:11 +00:00
|
|
|
|
while using BFD for everything else. Currently used by the assembler
|
|
|
|
|
when creating COFF files. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
asymbol *(*_bfd_make_debug_symbol) PARAMS ((bfd *, void *,
|
|
|
|
|
unsigned long size));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#define bfd_read_minisymbols(b, d, m, s) \
|
|
|
|
|
BFD_SEND (b, _read_minisymbols, (b, d, m, s))
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,
|
|
|
|
|
unsigned int *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#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 *));
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Routines for relocs. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_RELOCS(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_get_reloc_upper_bound), \
|
|
|
|
|
CONCAT2 (NAME,_canonicalize_reloc), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_reloc_type_lookup)
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
|
|
|
|
|
long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
|
|
|
|
|
struct symbol_cache_entry **));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* See documentation on reloc types. */
|
1999-05-03 07:29:11 +00:00
|
|
|
|
reloc_howto_type *
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
(*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Routines used when writing an object file. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_WRITE(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_set_arch_mach), \
|
|
|
|
|
CONCAT2 (NAME,_set_section_contents)
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
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));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Routines used by the linker. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_LINK(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_sizeof_headers), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_relax_section), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_link_hash_table_create), \
|
2002-04-04 19:53:38 +00:00
|
|
|
|
CONCAT2 (NAME,_bfd_link_hash_table_free), \
|
2001-10-02 05:58:41 +00:00
|
|
|
|
CONCAT2 (NAME,_bfd_link_add_symbols), \
|
2002-05-15 00:18:58 +00:00
|
|
|
|
CONCAT2 (NAME,_bfd_link_just_syms), \
|
2001-10-02 05:58:41 +00:00
|
|
|
|
CONCAT2 (NAME,_bfd_final_link), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_link_split_section), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_gc_sections), \
|
2002-06-05 03:43:11 +00:00
|
|
|
|
CONCAT2 (NAME,_bfd_merge_sections), \
|
|
|
|
|
CONCAT2 (NAME,_bfd_discard_group)
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
|
|
|
|
|
bfd_byte *(*_bfd_get_relocated_section_contents)
|
|
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
|
|
|
|
|
bfd_byte *, boolean, struct symbol_cache_entry **));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_relax_section)
|
|
|
|
|
PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Create a hash table for the linker. Different backends store
|
1999-05-03 07:29:11 +00:00
|
|
|
|
different information in this table. */
|
|
|
|
|
struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
|
|
|
|
|
|
2002-04-04 19:53:38 +00:00
|
|
|
|
/* Release the memory associated with the linker hash table. */
|
|
|
|
|
void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *));
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Add symbols from this object file into the hash table. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2002-05-15 00:18:58 +00:00
|
|
|
|
/* Indicate that we are only retrieving symbol values from this section. */
|
|
|
|
|
void (*_bfd_link_just_syms) PARAMS ((asection *, struct bfd_link_info *));
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Do a link based on the link_order structures attached to each
|
1999-05-03 07:29:11 +00:00
|
|
|
|
section of the BFD. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Should this section be split up into smaller pieces during linking. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Remove sections that are not referenced from the output. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
* merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix
fields, change sec into secinfo.
(struct sec_merge_info): Add chain, remove last fields.
(struct sec_merge_sec_info): Add next, sec, psecinfo fields.
(sec_merge_hash_lookup): If lookup could not use a string only
because it has bad alignment, mark the old string for deletion.
(sec_merge_add): Add secinfo argument. Don't compute entry's
position, instead record the section.
(sec_merge_emit): Update for the sec into secinfo change in
struct sec_merge_hash_entry.
(_bfd_merge_section): Only record the section for merging, defer
putting strings into the hash table.
(cmplengthentry, last4_eq, last_eq, record_section, merge_strings,
_bfd_merge_sections): New functions.
(_bfd_merged_section_offset): Update for the sec_merge_hash_entry
changes.
* libbfd-in.h (_bfd_merge_sections): Add prototype.
(_bfd_nolink_bfd_merge_sections): Define.
* libbfd.h: Likewise.
(bfd_generic_merge_sections): Add prototype.
* targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections.
(struct bfd_target): Likewise.
* bfd.c (bfd_merge_sections): Define.
* bfd-in2.h: Rebuilt.
* elf.c (_bfd_elf_merge_sections): New function.
* elf-bfd.h (_bfd_elf_merge_sections): Add prototype.
* elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define.
* reloc.c (bfd_generic_merge_sections): New function.
* vms.c (vms_bfd_merge_sections): New function.
* aout-adobe.c (aout_32_bfd_merge_sections): Define.
* aout-target.h (MY_bfd_merge_sections): Define.
* aout-tic30.c (MY_bfd_merge_sections): Define.
* binary.c (binary_bfd_merge_sections): Define.
* bout.c (b_out_bfd_merge_sections): Define.
* coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define.
* coffcode.c (coff_bfd_merge_sections): Define.
* coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define.
* i386msdos.c (msdos_bfd_merge_sections): Define.
* i386os9k.c (os9k_bfd_merge_sections): Define.
* ieee.c (ieee_bfd_merge_sections): Define.
* ihex.c (ihex_bfd_merge_sections): Define.
* nlm-target.h (nlm_bfd_merge_sections): Define.
* oasys.c (oasys_bfd_merge_sections): Define.
* ppcboot.c (ppcboot_bfd_merge_sections): Define.
* som.c (som_bfd_merge_sections): Define.
* srec.c (srec_bfd_merge_sections): Define.
* tekhex.c (tekhex_bfd_merge_sections): Define.
* versados.c (versados_bfd_merge_sections): Define.
* xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define.
* ldlang.c (lang_process): Call bfd_merge_sections.
2001-05-11 12:23:48 +00:00
|
|
|
|
/* Attempt to merge SEC_MERGE sections. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *));
|
* merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix
fields, change sec into secinfo.
(struct sec_merge_info): Add chain, remove last fields.
(struct sec_merge_sec_info): Add next, sec, psecinfo fields.
(sec_merge_hash_lookup): If lookup could not use a string only
because it has bad alignment, mark the old string for deletion.
(sec_merge_add): Add secinfo argument. Don't compute entry's
position, instead record the section.
(sec_merge_emit): Update for the sec into secinfo change in
struct sec_merge_hash_entry.
(_bfd_merge_section): Only record the section for merging, defer
putting strings into the hash table.
(cmplengthentry, last4_eq, last_eq, record_section, merge_strings,
_bfd_merge_sections): New functions.
(_bfd_merged_section_offset): Update for the sec_merge_hash_entry
changes.
* libbfd-in.h (_bfd_merge_sections): Add prototype.
(_bfd_nolink_bfd_merge_sections): Define.
* libbfd.h: Likewise.
(bfd_generic_merge_sections): Add prototype.
* targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections.
(struct bfd_target): Likewise.
* bfd.c (bfd_merge_sections): Define.
* bfd-in2.h: Rebuilt.
* elf.c (_bfd_elf_merge_sections): New function.
* elf-bfd.h (_bfd_elf_merge_sections): Add prototype.
* elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define.
* reloc.c (bfd_generic_merge_sections): New function.
* vms.c (vms_bfd_merge_sections): New function.
* aout-adobe.c (aout_32_bfd_merge_sections): Define.
* aout-target.h (MY_bfd_merge_sections): Define.
* aout-tic30.c (MY_bfd_merge_sections): Define.
* binary.c (binary_bfd_merge_sections): Define.
* bout.c (b_out_bfd_merge_sections): Define.
* coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define.
* coffcode.c (coff_bfd_merge_sections): Define.
* coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define.
* i386msdos.c (msdos_bfd_merge_sections): Define.
* i386os9k.c (os9k_bfd_merge_sections): Define.
* ieee.c (ieee_bfd_merge_sections): Define.
* ihex.c (ihex_bfd_merge_sections): Define.
* nlm-target.h (nlm_bfd_merge_sections): Define.
* oasys.c (oasys_bfd_merge_sections): Define.
* ppcboot.c (ppcboot_bfd_merge_sections): Define.
* som.c (som_bfd_merge_sections): Define.
* srec.c (srec_bfd_merge_sections): Define.
* tekhex.c (tekhex_bfd_merge_sections): Define.
* versados.c (versados_bfd_merge_sections): Define.
* xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define.
* ldlang.c (lang_process): Call bfd_merge_sections.
2001-05-11 12:23:48 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Discard members of a group. */
|
|
|
|
|
boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *));
|
|
|
|
|
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Routines to handle dynamic symbols and relocs. */
|
2001-10-02 05:58:41 +00:00
|
|
|
|
#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
|
|
|
|
|
CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \
|
|
|
|
|
CONCAT2 (NAME,_canonicalize_dynamic_symtab), \
|
|
|
|
|
CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \
|
|
|
|
|
CONCAT2 (NAME,_canonicalize_dynamic_reloc)
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Get the amount of memory required to hold the dynamic symbols. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Read in the dynamic symbols. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
long (*_bfd_canonicalize_dynamic_symtab)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
PARAMS ((bfd *, struct symbol_cache_entry **));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Get the amount of memory required to hold the dynamic relocs. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
|
2000-07-08 12:08:43 +00:00
|
|
|
|
/* Read in the dynamic relocs. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
long (*_bfd_canonicalize_dynamic_reloc)
|
1999-05-03 07:29:11 +00:00
|
|
|
|
PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
|
1999-07-22 00:51:51 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Opposite endian version of this target. */
|
|
|
|
|
const struct bfd_target * alternative_target;
|
2000-12-21 18:20:04 +00:00
|
|
|
|
|
2002-01-30 18:12:17 +00:00
|
|
|
|
/* Data for use by back-end routines, which isn't
|
|
|
|
|
generic enough to belong in this structure. */
|
|
|
|
|
PTR backend_data;
|
2000-12-21 18:20:04 +00:00
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
} bfd_target;
|
2002-01-30 18:12:17 +00:00
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
|
|
|
|
bfd_set_default_target PARAMS ((const char *name));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
const bfd_target *
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
|
|
|
|
bfd_find_target PARAMS ((const char *target_name, bfd *abfd));
|
1999-05-03 07:29:11 +00:00
|
|
|
|
|
|
|
|
|
const char **
|
|
|
|
|
bfd_target_list PARAMS ((void));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
const bfd_target *
|
|
|
|
|
bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *));
|
1999-07-19 14:55:16 +00:00
|
|
|
|
|
2002-06-05 03:43:11 +00:00
|
|
|
|
/* Extracted from format.c. */
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching));
|
|
|
|
|
|
2001-01-25 20:17:45 +00:00
|
|
|
|
boolean
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
|
|
|
|
|
|
2001-08-17 03:19:01 +00:00
|
|
|
|
const char *
|
1999-05-03 07:29:11 +00:00
|
|
|
|
bfd_format_string PARAMS ((bfd_format format));
|
|
|
|
|
|
2002-10-11 13:53:33 +00:00
|
|
|
|
/* Extracted from linker.c. */
|
|
|
|
|
boolean
|
|
|
|
|
bfd_link_split_section PARAMS ((bfd *abfd, asection *sec));
|
|
|
|
|
|
|
|
|
|
#define bfd_link_split_section(abfd, sec) \
|
|
|
|
|
BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
|
|
|
|
|
|
|
|
|
|
/* Extracted from simple.c. */
|
|
|
|
|
bfd_byte *
|
|
|
|
|
bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf));
|
|
|
|
|
|
1999-05-03 07:29:11 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|