binutils-gdb/bfd/bfd-in2.h

4396 lines
144 KiB
C
Raw Normal View History

/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
"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".
Run "make headers" in your build bfd/ to regenerate. */
1999-05-03 15:29:11 +08:00
/* Main header file for the bfd library -- portable access to object files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
1999-05-03 15:29:11 +08:00
Contributed by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
1999-05-03 15:29:11 +08: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 15:29:11 +08: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 15:29:11 +08: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 15:29:11 +08:00
#ifndef __BFD_H_SEEN__
#define __BFD_H_SEEN__
#ifdef __cplusplus
extern "C" {
#endif
#include "ansidecl.h"
2001-10-02 13:58:41 +08: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 15:29:11 +08: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 15:29:11 +08:00
#define BFD_ARCH_SIZE @wordsize@
/* The word size of the default bfd target. */
#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
1999-05-03 15:29:11 +08:00
#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@
1999-05-03 15:29:11 +08:00
#if @BFD_HOST_64_BIT_DEFINED@
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
#endif
#if BFD_ARCH_SIZE >= 64
#define BFD64
#endif
#ifndef INLINE
#if __GNUC__ >= 2
#define INLINE __inline__
#else
#define INLINE
#endif
#endif
2002-01-31 02:12:17 +08:00
/* Forward declaration. */
typedef struct bfd bfd;
1999-05-03 15:29:11 +08:00
/* Boolean type used in bfd. Too many systems define their own
versions of "boolean" for us to safely typedef a "boolean" of
our own. Using an enum for "bfd_boolean" has its own set of
problems, with strange looking casts required to avoid warnings
on some older compilers. Thus we just use an int.
General rule: Functions which are bfd_boolean return TRUE on
success and FALSE on failure (unless they're a predicate). */
typedef int bfd_boolean;
#undef FALSE
#undef TRUE
#define FALSE 0
#define TRUE 1
#if 0
/* Poison. */
#undef false
#undef true
#define false dont_use_false_in_bfd
#define true dont_use_true_in_bfd
1999-05-03 15:29:11 +08:00
#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 the host compiler used during
configuration supports long long, this code will use it.
Otherwise, BFD_HOST_64_BIT must be defined above. */
1999-05-03 15:29:11 +08:00
#ifndef BFD_HOST_64_BIT
# if BFD_HOST_64BIT_LONG
# define BFD_HOST_64_BIT long
# define BFD_HOST_U_64_BIT unsigned long
# else
# if BFD_HOST_LONG_LONG
1999-05-03 15:29:11 +08:00
# define BFD_HOST_64_BIT long long
# define BFD_HOST_U_64_BIT unsigned long long
# endif /* ! BFD_HOST_LONG_LONG */
1999-05-03 15:29:11 +08:00
# 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. */
#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
1999-05-03 15:29:11 +08:00
#endif /* not BFD64 */
/* 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;
2003-06-29 18:06:40 +08:00
extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
1999-05-03 15:29:11 +08:00
#define printf_vma(x) fprintf_vma(stdout,x)
#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
1999-05-03 15:29:11 +08:00
typedef unsigned int flagword; /* 32 bits of flags */
typedef unsigned char bfd_byte;
2002-01-31 02:12:17 +08:00
/* File formats. */
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08: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 15:29:11 +08: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
/* The sections in this BFD specify a memory page. */
2002-08-28 18:38:51 +08:00
#define HAS_LOAD_PAGE 0x1000
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Symbols and relocation. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
/* This is a type pun with struct ranlib on purpose! */
typedef struct carsym
{
1999-05-03 15:29:11 +08:00
char *name;
2002-01-31 02:12:17 +08:00
file_ptr file_offset; /* Look here to find the file. */
}
carsym; /* To make these you call a carsymogen. */
1999-05-03 15:29:11 +08:00
/* Used in generating armaps (archive tables of contents).
2002-01-31 02:12:17 +08:00
Perhaps just a forward definition would do? */
struct orl /* Output ranlib. */
{
char **name; /* Symbol name. */
union
{
file_ptr pos;
bfd *abfd;
2002-01-31 02:12:17 +08:00
} u; /* bfd* or file position. */
int namidx; /* Index into string table. */
1999-05-03 15:29:11 +08:00
};
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
} u;
2002-01-31 02:12:17 +08:00
}
alent;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Object and core file sections. */
1999-05-03 15:29:11 +08:00
#define align_power(addr, align) \
(((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
1999-05-03 15:29:11 +08: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)
#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
1999-05-03 15:29:11 +08: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)
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
#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)
1999-05-03 15:29:11 +08:00
typedef struct stat stat_type;
1999-05-03 15:29:11 +08:00
typedef enum bfd_print_symbol
{
1999-05-03 15:29:11 +08:00
bfd_print_symbol_name,
bfd_print_symbol_more,
bfd_print_symbol_all
} bfd_print_symbol_type;
1999-05-03 15:29:11 +08:00
/* Information about a symbol that nm needs. */
typedef struct _symbol_info
{
symvalue value;
char type;
const char *name; /* Symbol name. */
1999-05-03 15:29:11 +08:00
unsigned char stab_type; /* Stab type. */
char stab_other; /* Stab other. */
1999-05-03 15:29:11 +08:00
short stab_desc; /* Stab desc. */
const char *stab_name; /* String for stab type. */
1999-05-03 15:29:11 +08:00
} symbol_info;
/* Get the name of a stabs type code. */
2003-06-29 18:06:40 +08:00
extern const char *bfd_get_stab_name (int);
1999-05-03 15:29:11 +08:00
/* Hash table routines. There is no way to free up a hash table. */
/* An element in the hash table. Most uses will actually use a larger
structure, and an instance of this will be the first field. */
struct bfd_hash_entry
{
/* Next entry for this hash code. */
struct bfd_hash_entry *next;
/* String being hashed. */
const char *string;
/* Hash code. This is the full hash code, not the index into the
table. */
unsigned long hash;
};
/* A hash table. */
struct bfd_hash_table
{
/* The hash array. */
struct bfd_hash_entry **table;
/* The number of slots in the hash table. */
unsigned int size;
/* A function used to create new elements in the hash table. The
first entry is itself a pointer to an element. When this
function is first invoked, this pointer will be NULL. However,
having the pointer permits a hierarchy of method functions to be
built each of which calls the function in the superclass. Thus
each function should be written to allocate a new block of memory
only if the argument is NULL. */
struct bfd_hash_entry *(*newfunc)
2003-06-29 18:06:40 +08:00
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
1999-05-03 15:29:11 +08:00
/* An objalloc for this hash table. This is a struct objalloc *,
2003-06-29 18:06:40 +08:00
but we use void * to avoid requiring the inclusion of objalloc.h. */
void *memory;
1999-05-03 15:29:11 +08:00
};
/* Initialize a hash table. */
extern bfd_boolean bfd_hash_table_init
2003-06-29 18:06:40 +08:00
(struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
1999-05-03 15:29:11 +08:00
/* Initialize a hash table specifying a size. */
extern bfd_boolean bfd_hash_table_init_n
2003-06-29 18:06:40 +08:00
(struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int size);
1999-05-03 15:29:11 +08:00
/* Free up a hash table. */
extern void bfd_hash_table_free
2003-06-29 18:06:40 +08:00
(struct bfd_hash_table *);
1999-05-03 15:29:11 +08:00
/* Look up a string in a hash table. If CREATE is TRUE, a new entry
1999-05-03 15:29:11 +08:00
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
1999-05-03 15:29:11 +08:00
into newly allocated memory when adding an entry. */
extern struct bfd_hash_entry *bfd_hash_lookup
2003-06-29 18:06:40 +08:00
(struct bfd_hash_table *, const char *, bfd_boolean create,
bfd_boolean copy);
1999-05-03 15:29:11 +08:00
/* Replace an entry in a hash table. */
extern void bfd_hash_replace
2003-06-29 18:06:40 +08:00
(struct bfd_hash_table *, struct bfd_hash_entry *old,
struct bfd_hash_entry *nw);
1999-05-03 15:29:11 +08:00
/* Base method for creating a hash table entry. */
extern struct bfd_hash_entry *bfd_hash_newfunc
2003-06-29 18:06:40 +08:00
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
1999-05-03 15:29:11 +08:00
/* Grab some space for a hash table entry. */
2003-06-29 18:06:40 +08:00
extern void *bfd_hash_allocate
(struct bfd_hash_table *, unsigned int);
1999-05-03 15:29:11 +08:00
/* Traverse a hash table in a random order, calling a function on each
element. If the function returns FALSE, the traversal stops. The
1999-05-03 15:29:11 +08:00
INFO argument is passed to the function. */
extern void bfd_hash_traverse
2003-06-29 18:06:40 +08:00
(struct bfd_hash_table *,
bfd_boolean (*) (struct bfd_hash_entry *, void *),
void *info);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
2001-10-02 13:58:41 +08:00
2002-01-31 02:12:17 +08:00
/* User program access to BFD facilities. */
1999-05-03 15:29:11 +08:00
/* Direct I/O routines, for programs which know more about the object
file than BFD does. Use higher level routines if possible. */
2003-06-29 18:06:40 +08:00
extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
extern int bfd_seek (bfd *, file_ptr, int);
extern ufile_ptr bfd_tell (bfd *);
extern int bfd_flush (bfd *);
extern int bfd_stat (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
2003-06-29 18:06:40 +08:00
extern void warn_deprecated (const char *, const char *, int, const char *);
1999-05-03 15:29:11 +08: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)
#define bfd_family_coff(abfd) \
(bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
1999-05-03 15:29:11 +08: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)
#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
1999-05-03 15:29:11 +08:00
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
1999-05-03 15:29:11 +08:00
extern bfd_boolean bfd_cache_close
2003-06-29 18:06:40 +08:00
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
extern bfd_boolean bfd_record_phdr
2003-06-29 18:06:40 +08:00
(bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
bfd_boolean, bfd_boolean, unsigned int, struct sec **);
1999-05-03 15:29:11 +08:00
/* Byte swapping routines. */
2003-06-29 18:06:40 +08:00
bfd_vma bfd_getb64 (const unsigned char *);
bfd_vma bfd_getl64 (const unsigned char *);
bfd_signed_vma bfd_getb_signed_64 (const unsigned char *);
bfd_signed_vma bfd_getl_signed_64 (const unsigned char *);
bfd_vma bfd_getb32 (const unsigned char *);
bfd_vma bfd_getl32 (const unsigned char *);
bfd_signed_vma bfd_getb_signed_32 (const unsigned char *);
bfd_signed_vma bfd_getl_signed_32 (const unsigned char *);
bfd_vma bfd_getb16 (const unsigned char *);
bfd_vma bfd_getl16 (const unsigned char *);
bfd_signed_vma bfd_getb_signed_16 (const unsigned char *);
bfd_signed_vma bfd_getl_signed_16 (const unsigned char *);
void bfd_putb64 (bfd_vma, unsigned char *);
void bfd_putl64 (bfd_vma, unsigned char *);
void bfd_putb32 (bfd_vma, unsigned char *);
void bfd_putl32 (bfd_vma, unsigned char *);
void bfd_putb16 (bfd_vma, unsigned char *);
void bfd_putl16 (bfd_vma, unsigned char *);
2000-12-22 02:20:04 +08:00
/* Byte swapping routines which take size and endiannes as arguments. */
2003-06-29 18:06:40 +08:00
bfd_vma bfd_get_bits (bfd_byte *, int, bfd_boolean);
void bfd_put_bits (bfd_vma, bfd_byte *, int, bfd_boolean);
1999-05-03 15:29:11 +08: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
2003-06-29 18:06:40 +08:00
(bfd * abfd);
extern bfd_boolean bfd_ecoff_set_gp_value
2003-06-29 18:06:40 +08:00
(bfd *abfd, bfd_vma gp_value);
extern bfd_boolean bfd_ecoff_set_regmasks
2003-06-29 18:06:40 +08:00
(bfd *abfd, unsigned long gprmask, unsigned long fprmask,
unsigned long *cprmask);
extern void *bfd_ecoff_debug_init
(bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
1999-05-03 15:29:11 +08:00
extern void bfd_ecoff_debug_free
2003-06-29 18:06:40 +08:00
(void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
extern bfd_boolean bfd_ecoff_debug_accumulate
2003-06-29 18:06:40 +08:00
(void *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 bfd_boolean bfd_ecoff_debug_accumulate_other
2003-06-29 18:06:40 +08:00
(void *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 bfd_boolean bfd_ecoff_debug_externals
2003-06-29 18:06:40 +08:00
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
bfd_boolean (*get_extr) (struct symbol_cache_entry *, struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *, bfd_size_type));
extern bfd_boolean bfd_ecoff_debug_one_external
2003-06-29 18:06:40 +08:00
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, const char *name,
struct ecoff_extr *esym);
1999-05-03 15:29:11 +08:00
extern bfd_size_type bfd_ecoff_debug_size
2003-06-29 18:06:40 +08:00
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap);
extern bfd_boolean bfd_ecoff_write_debug
2003-06-29 18:06:40 +08:00
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, file_ptr where);
extern bfd_boolean bfd_ecoff_write_accumulated_debug
2003-06-29 18:06:40 +08:00
(void *handle, bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
struct bfd_link_info *info, file_ptr where);
extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
1999-05-03 15:29:11 +08:00
/* Externally visible ELF routines. */
struct bfd_link_needed_list
{
struct bfd_link_needed_list *next;
bfd *by;
const char *name;
};
* elflink.c (_bfd_elf_link_create_dynamic_sections): Move from elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. (bfd_elf_record_link_assignment): Move from elflink.h. (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_add_default_symbol): Likewise. (_bfd_elf_export_symbol): Likewise. (_bfd_elf_link_find_version_dependencies): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. (_bfd_elf_link_read_relocs): Likewise. (_bfd_elf_link_size_reloc_section): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. (_bfd_elf_adjust_dynamic_symbol): Likewise. (_bfd_elf_link_sec_merge_syms): Likewise. (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel and bed->s->sizeof_rela. (_bfd_elf_link_output_relocs): Likewise. * elf-bfd.h (struct elf_size_info): Rename file_align to log_file_align. (struct elf_info_failed): Move from elflink.h. (struct elf_assign_sym_version_info): Likewise. (struct elf_find_verdep_info): Likewise. (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms): Declare. (bfd_elf32_link_create_dynamic_sections): Don't declare. (_bfd_elf32_link_read_relocs): Likewise. (bfd_elf64_link_create_dynamic_sections): Likewise. (_bfd_elf64_link_read_relocs): Likewise. * elflink.h: Move lots o' stuff elsewhere. * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. (bfd_elf64_record_link_assignment): Likewise. (bfd_elf_record_link_assignment): Declare. * bfd-in2.h: Regenerate. * elfcode.h (elf_link_create_dynamic_sections): Don't declare. (NAME(_bfd_elf,size_info)): Adjust for log_file_align. * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. (assign_file_positions_for_segments): Likewise. (assign_file_positions_except_relocs): Likewise. (swap_out_syms, elfcore_write_note): Likewise. * elf-m10200.c: Adjust for changed function names. * elf-m10300.c: Likewise. * elf32-arm.h: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-sh.c: Likewise. * elf32-v850.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sh64.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-mips.c (mips_elf64_size_info): Likewise. * elf64-s390.c (s390_elf64_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2003-05-09 10:27:11 +08:00
extern bfd_boolean bfd_elf_record_link_assignment
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, const char *, bfd_boolean);
1999-05-03 15:29:11 +08:00
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_get_bfd_needed_list
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_needed_list **);
extern bfd_boolean bfd_elf32_size_dynamic_sections
2003-06-29 18:06:40 +08:00
(bfd *, const char *, const char *, const char *, const char * const *,
struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *);
extern bfd_boolean bfd_elf64_size_dynamic_sections
2003-06-29 18:06:40 +08:00
(bfd *, const char *, const char *, const char *, const char * const *,
struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *);
extern void bfd_elf_set_dt_needed_name
2003-06-29 18:06:40 +08:00
(bfd *, const char *);
extern void bfd_elf_set_dt_needed_soname
2003-06-29 18:06:40 +08:00
(bfd *, const char *);
extern const char *bfd_elf_get_dt_soname
2003-06-29 18:06:40 +08:00
(bfd *);
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf32_discard_info
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf64_discard_info
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
1999-05-03 15:29:11 +08: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
2003-06-29 18:06:40 +08:00
(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
2003-06-29 18:06:40 +08:00
(bfd *abfd, void *phdrs);
/* Create a new BFD as if by bfd_openr. Rather than opening a file,
reconstruct an ELF file by reading the segments out of remote memory
based on the ELF file header at EHDR_VMA and the ELF program headers it
points to. If not null, *LOADBASEP is filled in with the difference
between the VMAs from which the segments were read, and the VMAs the
file headers (and hence BFD's idea of each section's VMA) put them at.
The function TARGET_READ_MEMORY is called to copy LEN bytes from the
remote memory at target address VMA into the local buffer at MYADDR; it
should return zero on success or an `errno' code on failure. TEMPL must
be a BFD for an ELF target with the word size and byte order found in
the remote memory. */
extern bfd *bfd_elf_bfd_from_remote_memory
2003-06-29 18:06:40 +08:00
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
extern int bfd_get_arch_size
2003-06-29 18:06:40 +08:00
(bfd *);
/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */
extern int bfd_get_sign_extend_vma
2003-06-29 18:06:40 +08:00
(bfd *);
extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
extern bfd_boolean bfd_mips_elf32_create_embedded_relocs
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
1999-05-03 15:29:11 +08:00
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_sunos_record_link_assignment
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, const char *);
extern bfd_boolean bfd_sunos_size_dynamic_sections
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct sec **, struct sec **, struct sec **);
1999-05-03 15:29:11 +08:00
/* Linux shared library support routines for the linker. */
extern bfd_boolean bfd_i386linux_size_dynamic_sections
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_m68klinux_size_dynamic_sections
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_sparclinux_size_dynamic_sections
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
1999-05-03 15:29:11 +08:00
/* mmap hacks */
struct _bfd_window_internal;
typedef struct _bfd_window_internal bfd_window_internal;
2002-01-31 02:12:17 +08:00
typedef struct _bfd_window
{
1999-05-03 15:29:11 +08:00
/* What the user asked for. */
2003-06-29 18:06:40 +08:00
void *data;
1999-05-03 15:29:11 +08:00
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-31 02:12:17 +08:00
}
bfd_window;
1999-05-03 15:29:11 +08:00
extern void bfd_init_window
2003-06-29 18:06:40 +08:00
(bfd_window *);
extern void bfd_free_window
2003-06-29 18:06:40 +08:00
(bfd_window *);
extern bfd_boolean bfd_get_file_window
2003-06-29 18:06:40 +08:00
(bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
1999-05-03 15:29:11 +08:00
/* XCOFF support routines for the linker. */
extern bfd_boolean bfd_xcoff_link_record_set
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
extern bfd_boolean bfd_xcoff_import_symbol
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
const char *, const char *, const char *, unsigned int);
extern bfd_boolean bfd_xcoff_export_symbol
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
extern bfd_boolean bfd_xcoff_link_count_reloc
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, const char *);
extern bfd_boolean bfd_xcoff_record_link_assignment
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, const char *);
extern bfd_boolean bfd_xcoff_size_dynamic_sections
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, const char *, const char *,
unsigned long, unsigned long, unsigned long, bfd_boolean,
int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean);
extern bfd_boolean bfd_xcoff_link_generate_rtinit
2003-06-29 18:06:40 +08:00
(bfd *, const char *, const char *, bfd_boolean);
1999-05-03 15:29:11 +08:00
/* XCOFF support routines for ar. */
extern bfd_boolean bfd_xcoff_ar_archive_set_magic
2003-06-29 18:06:40 +08:00
(bfd *, char *);
1999-05-03 15:29:11 +08:00
/* Externally visible COFF routines. */
#if defined(__STDC__) || defined(ALMOST_STDC)
struct internal_syment;
union internal_auxent;
#endif
extern bfd_boolean bfd_coff_get_syment
2003-06-29 18:06:40 +08:00
(bfd *, struct symbol_cache_entry *, struct internal_syment *);
1999-05-03 15:29:11 +08:00
extern bfd_boolean bfd_coff_get_auxent
2003-06-29 18:06:40 +08:00
(bfd *, struct symbol_cache_entry *, int, union internal_auxent *);
1999-05-03 15:29:11 +08:00
extern bfd_boolean bfd_coff_set_symbol_class
2003-06-29 18:06:40 +08:00
(bfd *, struct symbol_cache_entry *, unsigned int);
1999-05-03 15:29:11 +08:00
extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
2000-07-25 01:22:17 +08:00
1999-05-03 15:29:11 +08:00
/* ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_arm_allocate_interworking_sections
2003-06-29 18:06:40 +08:00
(struct bfd_link_info *);
1999-05-03 15:29:11 +08:00
extern bfd_boolean bfd_arm_process_before_allocation
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, int);
1999-05-03 15:29:11 +08:00
extern bfd_boolean bfd_arm_get_bfd_for_interworking
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
1999-05-03 15:29:11 +08:00
2000-03-02 04:39:07 +08:00
/* PE ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
2003-06-29 18:06:40 +08:00
(struct bfd_link_info *);
2000-03-02 04:39:07 +08:00
extern bfd_boolean bfd_arm_pe_process_before_allocation
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, int);
2000-03-02 04:39:07 +08:00
extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
2000-03-02 04:39:07 +08:00
1999-05-03 15:29:11 +08:00
/* ELF ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
2003-06-29 18:06:40 +08:00
(struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_process_before_allocation
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
1999-05-03 15:29:11 +08:00
extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *);
2003-04-01 21:08:06 +08:00
/* ARM Note section processing. */
extern bfd_boolean bfd_arm_merge_machines
2003-06-29 18:06:40 +08:00
(bfd *, bfd *);
2003-04-01 21:08:06 +08:00
extern bfd_boolean bfd_arm_update_notes
2003-06-29 18:06:40 +08:00
(bfd *, const char *);
2003-04-01 21:08:06 +08:00
extern unsigned int bfd_arm_get_mach_from_notes
2003-06-29 18:06:40 +08:00
(bfd *, const char *);
2003-04-01 21:08:06 +08:00
/* TI COFF load page support. */
2000-04-18 10:21:27 +08:00
extern void bfd_ticoff_set_section_load_page
2003-06-29 18:06:40 +08:00
(struct sec *, int);
2000-04-18 10:21:27 +08:00
extern int bfd_ticoff_get_section_load_page
2003-06-29 18:06:40 +08:00
(struct sec *);
2000-04-18 10:21:27 +08:00
/* H8/300 functions. */
extern bfd_vma bfd_h8300_pad_address
(bfd *, bfd_vma);
/* IA64 Itanium code generation. Called from linker. */
extern void bfd_elf32_ia64_after_parse
(int);
extern void bfd_elf64_ia64_after_parse
(int);
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from init.c. */
2003-06-29 18:06:40 +08:00
void bfd_init (void);
1999-05-03 15:29:11 +08:00
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from opncls.c. */
2003-06-29 18:06:40 +08:00
bfd *bfd_openr (const char *filename, const char *target);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd *bfd_openstreamr (const char *, const char *, void *);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd *bfd_openw (const char *filename, const char *target);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_close (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_close_all_done (bfd *);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd *bfd_create (const char *filename, bfd *templ);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_make_writable (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_make_readable (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
unsigned long bfd_calc_gnu_debuglink_crc32
(unsigned long crc, const unsigned char *buf, bfd_size_type len);
2003-06-29 18:06:40 +08:00
char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
2003-06-29 18:06:40 +08:00
struct sec *bfd_create_gnu_debuglink_section
(bfd *abfd, const char *filename);
2003-06-27 16:01:28 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_fill_in_gnu_debuglink_section
(bfd *abfd, struct sec *sect, const char *filename);
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from libbfd.c. */
/* Byte swapping macros for user section data. */
1999-05-03 15:29:11 +08:00
#define bfd_put_8(abfd, val, ptr) \
2003-06-29 18:06:40 +08:00
((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
1999-05-03 15:29:11 +08:00
#define bfd_put_signed_8 \
2003-06-29 18:06:40 +08:00
bfd_put_8
1999-05-03 15:29:11 +08:00
#define bfd_get_8(abfd, ptr) \
2003-06-29 18:06:40 +08:00
(*(unsigned char *) (ptr) & 0xff)
1999-05-03 15:29:11 +08:00
#define bfd_get_signed_8(abfd, ptr) \
2003-06-29 18:06:40 +08:00
(((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
1999-05-03 15:29:11 +08:00
#define bfd_put_16(abfd, val, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
1999-05-03 15:29:11 +08:00
#define bfd_put_signed_16 \
2003-06-29 18:06:40 +08:00
bfd_put_16
1999-05-03 15:29:11 +08:00
#define bfd_get_16(abfd, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_getx16, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_get_signed_16(abfd, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_put_32(abfd, val, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
1999-05-03 15:29:11 +08:00
#define bfd_put_signed_32 \
2003-06-29 18:06:40 +08:00
bfd_put_32
1999-05-03 15:29:11 +08:00
#define bfd_get_32(abfd, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_getx32, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_get_signed_32(abfd, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_put_64(abfd, val, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
1999-05-03 15:29:11 +08:00
#define bfd_put_signed_64 \
2003-06-29 18:06:40 +08:00
bfd_put_64
1999-05-03 15:29:11 +08:00
#define bfd_get_64(abfd, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_getx64, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_get_signed_64(abfd, ptr) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
#define bfd_get(bits, abfd, ptr) \
((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
: (bits) == 16 ? bfd_get_16 (abfd, ptr) \
: (bits) == 32 ? bfd_get_32 (abfd, ptr) \
: (bits) == 64 ? bfd_get_64 (abfd, ptr) \
: (abort (), (bfd_vma) - 1))
2003-06-29 18:06:40 +08:00
#define bfd_put(bits, abfd, val, ptr) \
((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
: (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))
/* Byte swapping macros for file header data. */
1999-05-03 15:29:11 +08:00
#define bfd_h_put_8(abfd, val, ptr) \
bfd_put_8 (abfd, val, ptr)
1999-05-03 15:29:11 +08:00
#define bfd_h_put_signed_8(abfd, val, ptr) \
bfd_put_8 (abfd, val, ptr)
1999-05-03 15:29:11 +08:00
#define bfd_h_get_8(abfd, ptr) \
bfd_get_8 (abfd, ptr)
1999-05-03 15:29:11 +08:00
#define bfd_h_get_signed_8(abfd, ptr) \
bfd_get_signed_8 (abfd, ptr)
1999-05-03 15:29:11 +08:00
#define bfd_h_put_16(abfd, val, ptr) \
BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_put_signed_16 \
bfd_h_put_16
1999-05-03 15:29:11 +08:00
#define bfd_h_get_16(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx16, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_get_signed_16(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_put_32(abfd, val, ptr) \
BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_put_signed_32 \
bfd_h_put_32
1999-05-03 15:29:11 +08:00
#define bfd_h_get_32(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx32, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_get_signed_32(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_put_64(abfd, val, ptr) \
BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_put_signed_64 \
bfd_h_put_64
1999-05-03 15:29:11 +08:00
#define bfd_h_get_64(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx64, (ptr))
1999-05-03 15:29:11 +08:00
#define bfd_h_get_signed_64(abfd, ptr) \
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 15:29:11 +08:00
/* Extracted from bfdio.c. */
2003-06-29 18:06:40 +08:00
long bfd_get_mtime (bfd *abfd);
2003-06-29 18:06:40 +08:00
long bfd_get_size (bfd *abfd);
/* Extracted from bfdwin.c. */
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from section.c. */
/* 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. */
struct bfd_comdat_info
{
/* The name of the symbol associated with a comdat section. */
const char *name;
/* The local symbol table index of the symbol associated with a
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 15:29:11 +08:00
typedef struct sec
{
/* 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 15:29:11 +08:00
/* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
int index;
1999-05-03 15:29:11 +08:00
/* The next section in the list belonging to the BFD, or NULL. */
struct sec *next;
1999-05-03 15:29:11 +08: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 15:29:11 +08:00
#define SEC_NO_FLAGS 0x000
/* Tells the OS to allocate space for this section when loading.
This is clear for a section containing debug information only. */
1999-05-03 15:29:11 +08:00
#define SEC_ALLOC 0x001
/* Tells the OS to load the section from the file when loading.
This is clear for a .bss section. */
1999-05-03 15:29:11 +08:00
#define SEC_LOAD 0x002
/* The section contains data still to be relocated, so there is
some relocation information too. */
1999-05-03 15:29:11 +08:00
#define SEC_RELOC 0x004
/* 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 15:29:11 +08:00
/* A signal to the OS that the section contains read only data. */
1999-05-03 15:29:11 +08:00
#define SEC_READONLY 0x010
/* The section contains code only. */
1999-05-03 15:29:11 +08:00
#define SEC_CODE 0x020
/* The section contains data only. */
1999-05-03 15:29:11 +08:00
#define SEC_DATA 0x040
/* The section will reside in ROM. */
1999-05-03 15:29:11 +08:00
#define SEC_ROM 0x080
/* The section contains constructor information. This section
type is used by the linker to create lists of constructors and
destructors used by <<g++>>. When a back end sees a symbol
which should be used in a constructor list, it creates a new
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 15:29:11 +08:00
#define SEC_CONSTRUCTOR 0x100
/* 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 15:29:11 +08:00
#define SEC_HAS_CONTENTS 0x200
/* An instruction to the linker to not output the section
even if it has information which would normally be written. */
1999-05-03 15:29:11 +08:00
#define SEC_NEVER_LOAD 0x400
/* 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 15:29:11 +08: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 21:12:53 +08:00
/* The section contains thread local data. */
#define SEC_THREAD_LOCAL 0x1000
/* 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
/* 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 15:29:11 +08:00
#define SEC_IS_COMMON 0x8000
/* 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 15:29:11 +08:00
#define SEC_DEBUGGING 0x10000
/* 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 15:29:11 +08:00
#define SEC_IN_MEMORY 0x20000
/* 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 15:29:11 +08:00
#define SEC_EXCLUDE 0x40000
/* 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 15:29:11 +08:00
#define SEC_SORT_ENTRIES 0x80000
/* 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 15:29:11 +08:00
#define SEC_LINK_ONCE 0x100000
/* If SEC_LINK_ONCE is set, this bitfield describes how the linker
should handle duplicate sections. */
1999-05-03 15:29:11 +08:00
#define SEC_LINK_DUPLICATES 0x600000
/* This value for SEC_LINK_DUPLICATES means that duplicate
sections with the same name should simply be discarded. */
1999-05-03 15:29:11 +08:00
#define SEC_LINK_DUPLICATES_DISCARD 0x0
/* 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 15:29:11 +08:00
#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if any duplicate sections are a different size. */
1999-05-03 15:29:11 +08:00
#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if any duplicate sections contain different
contents. */
1999-05-03 15:29:11 +08:00
#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
/* 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 15:29:11 +08:00
#define SEC_LINKER_CREATED 0x800000
/* This section should not be subject to garbage collection. */
1999-05-03 15:29:11 +08:00
#define SEC_KEEP 0x1000000
/* This section contains "short" data, and should be placed
"near" the GP. */
#define SEC_SMALL_DATA 0x2000000
/* This section contains data which may be shared with other
executables or shared objects. */
#define SEC_SHARED 0x4000000
/* 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. */
#define SEC_BLOCK 0x8000000
/* Conditionally link this section; do not link if there are no
references found to any symbol in the section. */
#define SEC_CLINK 0x10000000
bfd/ * libbfd-in.h (_bfd_merge_section): New. (_bfd_write_merged_section): New. (_bfd_merged_section_offset): New. * libbfd.h: Rebuilt. * linker.c (_bfd_generic_link_output_symbols): Handle discard_sec_merge. * aoutx.h (aout_link_write_symbols): Likewise. * pdp11.c (aout_link_write_symbols): Likewise. * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section. (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE sections. (elf_link_sec_merge_syms): New. (elf_link_input_bfd): Call _bfd_merged_section_offset and _bfd_write_merged_section. Handle discard_sec_merge. * elf-bfd.h (struct elf_link_hash_table): Add merge_info field. (struct bfd_elf_section_data): Likewise. * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and SEC_STRINGS section flags and entsize from their ELF counterparts. (_bfd_elf_link_hash_table_init): Initialize merge_info. (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize from their BFD counterparts. * merge.c: New file. * Makefile.am: Add strtab.lo. * Makefile.in: Rebuilt. include/ * bfdlink.h (bfd_link_discard): Add discard_sec_merge. gas/ * config/obj-elf.c (obj_elf_change_section): Add entsize argument, handle SHF_MERGE and SHF_STRINGS. (obj_elf_parse_section_letters): Set SHF_MERGE and SHF_STRINGS. (obj_elf_section): Allow additional argument specifying entity size. * write.c (adjust_reloc_syms): Keep relocations against local symbols in SEC_MERGE sections. ld/ * ldmain.c (main): Default to discard_sec_merge. * lexsup.c (OPTION_DISCARD_NONE): Define. (ld_options): Add --discard-none. (parse_args): Handle OPTION_DISCARD_NONE. * ldlang.c (wild_doit): SEC_MERGE should be set in the output section only if SEC_MERGE and SEC_STRINGS flags and entsize of all its input sections match.
2001-04-13 08:34:36 +08:00
/* Attempt to merge identical entities in the section.
Entity size is given in the entsize field. */
#define SEC_MERGE 0x20000000
/* If given with SEC_MERGE, entities to merge are zero terminated
strings where entsize specifies character size instead of fixed
size entries. */
bfd/ * libbfd-in.h (_bfd_merge_section): New. (_bfd_write_merged_section): New. (_bfd_merged_section_offset): New. * libbfd.h: Rebuilt. * linker.c (_bfd_generic_link_output_symbols): Handle discard_sec_merge. * aoutx.h (aout_link_write_symbols): Likewise. * pdp11.c (aout_link_write_symbols): Likewise. * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section. (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE sections. (elf_link_sec_merge_syms): New. (elf_link_input_bfd): Call _bfd_merged_section_offset and _bfd_write_merged_section. Handle discard_sec_merge. * elf-bfd.h (struct elf_link_hash_table): Add merge_info field. (struct bfd_elf_section_data): Likewise. * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and SEC_STRINGS section flags and entsize from their ELF counterparts. (_bfd_elf_link_hash_table_init): Initialize merge_info. (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize from their BFD counterparts. * merge.c: New file. * Makefile.am: Add strtab.lo. * Makefile.in: Rebuilt. include/ * bfdlink.h (bfd_link_discard): Add discard_sec_merge. gas/ * config/obj-elf.c (obj_elf_change_section): Add entsize argument, handle SHF_MERGE and SHF_STRINGS. (obj_elf_parse_section_letters): Set SHF_MERGE and SHF_STRINGS. (obj_elf_section): Allow additional argument specifying entity size. * write.c (adjust_reloc_syms): Keep relocations against local symbols in SEC_MERGE sections. ld/ * ldmain.c (main): Default to discard_sec_merge. * lexsup.c (OPTION_DISCARD_NONE): Define. (ld_options): Add --discard-none. (parse_args): Handle OPTION_DISCARD_NONE. * ldlang.c (wild_doit): SEC_MERGE should be set in the output section only if SEC_MERGE and SEC_STRINGS flags and entsize of all its input sections match.
2001-04-13 08:34:36 +08:00
#define SEC_STRINGS 0x40000000
/* This section contains data about section groups. */
#define SEC_GROUP 0x80000000
/* End of section flags. */
1999-05-03 15:29:11 +08:00
/* Some internal packed boolean fields. */
1999-05-03 15:29:11 +08:00
/* See the vma field. */
unsigned int user_set_vma : 1;
1999-05-03 15:29:11 +08:00
/* Whether relocations have been processed. */
unsigned int reloc_done : 1;
1999-05-03 15:29:11 +08:00
/* A mark flag used by some of the linker backends. */
unsigned int linker_mark : 1;
1999-05-03 15:29:11 +08:00
/* Another mark flag used by some of the linker backends. Set for
output sections that have an input section. */
unsigned int linker_has_input : 1;
/* A mark flag used by some linker backends for garbage collection. */
unsigned int gc_mark : 1;
1999-05-03 15:29:11 +08:00
bfd * elf-bfd.h (enum elf_link_info_type): Remove. (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields to struct sec. Remove linkonce_p field. (elf_linkonce_p): Delete. (elf_discarded_section): Update for sec_info_type change. * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc, flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24. (ELF_INFO_TYPE_NONE): Define. (ELF_INFO_TYPE_STABS): Define. (ELF_INFO_TYPE_MERGE): Define. (ELF_INFO_TYPE_EH_FRAME): Define. (ELF_INFO_TYPE_JUST_SYMS): Define. (STD_SECTION): Update struct sec initializer. * ecoff.c (bfd_debug_section): Likewise. * elf.c: Likewise. Update occurrences of sec_info_type and use_rela_p. * elflink.h: Likewise. * elf-eh-frame.c: Likewise. * elf64-alpha.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * bfd-in2.h: Regenerate. * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than referring to used_by_bfd. * elf64-sparc.c (sec_do_relax): Likewise. * elf64-mmix.c (mmix_elf_section_data): Likewise. * elfxx-mips.c (mips_elf_section_data): Likewise. * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro. (ieee_get_section_contents): Likewise. (ieee_new_section_hook): Formatting. (ieee_canonicalize_reloc): Remove commented out code. * mmo.c (mmo_section_data): Define. Use throughout file. * oasys.c (oasys_get_section_contents): Use oasys_per_section macro. gas * config/obj-elf.c (obj_elf_change_section): Set SEC_LINK_ONCE and SEC_LINK_DUPLICATES_DISCARD directly rather than using elf_linkonce_p.
2003-02-04 20:34:08 +08:00
/* The following flags are used by the ELF linker. */
/* Mark sections which have been allocated to segments. */
unsigned int segment_mark : 1;
bfd * elf-bfd.h (enum elf_link_info_type): Remove. (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields to struct sec. Remove linkonce_p field. (elf_linkonce_p): Delete. (elf_discarded_section): Update for sec_info_type change. * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc, flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24. (ELF_INFO_TYPE_NONE): Define. (ELF_INFO_TYPE_STABS): Define. (ELF_INFO_TYPE_MERGE): Define. (ELF_INFO_TYPE_EH_FRAME): Define. (ELF_INFO_TYPE_JUST_SYMS): Define. (STD_SECTION): Update struct sec initializer. * ecoff.c (bfd_debug_section): Likewise. * elf.c: Likewise. Update occurrences of sec_info_type and use_rela_p. * elflink.h: Likewise. * elf-eh-frame.c: Likewise. * elf64-alpha.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * bfd-in2.h: Regenerate. * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than referring to used_by_bfd. * elf64-sparc.c (sec_do_relax): Likewise. * elf64-mmix.c (mmix_elf_section_data): Likewise. * elfxx-mips.c (mips_elf_section_data): Likewise. * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro. (ieee_get_section_contents): Likewise. (ieee_new_section_hook): Formatting. (ieee_canonicalize_reloc): Remove commented out code. * mmo.c (mmo_section_data): Define. Use throughout file. * oasys.c (oasys_get_section_contents): Use oasys_per_section macro. gas * config/obj-elf.c (obj_elf_change_section): Set SEC_LINK_ONCE and SEC_LINK_DUPLICATES_DISCARD directly rather than using elf_linkonce_p.
2003-02-04 20:34:08 +08:00
/* Type of sec_info information. */
unsigned int sec_info_type:3;
#define ELF_INFO_TYPE_NONE 0
#define ELF_INFO_TYPE_STABS 1
#define ELF_INFO_TYPE_MERGE 2
#define ELF_INFO_TYPE_EH_FRAME 3
#define ELF_INFO_TYPE_JUST_SYMS 4
/* Nonzero if this section uses RELA relocations, rather than REL. */
unsigned int use_rela_p:1;
/* Bits used by various backends. */
unsigned int has_tls_reloc:1;
/* Nonzero if this section needs the relax finalize pass. */
unsigned int need_finalize_relax:1;
* elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by elfxx-target.h so that we can use elf_backend_got_header_size. (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete. (GLINK_CALL_STUB_SIZE): Modify. Define new glink call stub and associated macros. (ppc64_elf_howto_raw <GOT_TPREL16_DS, GOT_TPREL16_LO_DS>): Correct dst_mask. (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and ppc_stub_plt_branch_r2off. (struct ppc_stub_hash_entry): Reorganize. (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed, toc_curr, toc_off and emit_stub_syms. (ppc64_elf_link_hash_table_create): Init them. (ppc_stub_name): Correct string size. (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs. (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries used. (ppc_type_of_stub): Tweak root.type test. (build_plt_stub): Remove glink code. Adjust for insn macro changes. (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and ppc_stub_plt_branch_r2off. (ppc_build_one_stub): Likewise. Fix var shadowing. Correct addis,addi range test. Use toc_off to calculte r2 values. Handle emit_stub_syms. (ppc64_elf_setup_section_lists): Remove htab creator flavour test. Initialize elf_gp and toc_curr. (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions. (ppc64_elf_next_input_section): Set toc_off. (group_sections): Ensure groups have the same TOC. (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub. (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab. Build new glink stub. (ppc64_elf_relocate_section): Handle multiple TOCs. Fix comments. (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK. * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype. (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare. * section.c (struct sec): Rename flag12 to has_gp_reloc. (STD_SECTION): Update. * ecoff.c (bfd_debug_section): Update comment. * bfd-in2.h: Regenerate.
2003-06-08 22:06:38 +08:00
/* Nonzero if this section has a gp reloc. */
unsigned int has_gp_reloc:1;
bfd * elf-bfd.h (enum elf_link_info_type): Remove. (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields to struct sec. Remove linkonce_p field. (elf_linkonce_p): Delete. (elf_discarded_section): Update for sec_info_type change. * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc, flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24. (ELF_INFO_TYPE_NONE): Define. (ELF_INFO_TYPE_STABS): Define. (ELF_INFO_TYPE_MERGE): Define. (ELF_INFO_TYPE_EH_FRAME): Define. (ELF_INFO_TYPE_JUST_SYMS): Define. (STD_SECTION): Update struct sec initializer. * ecoff.c (bfd_debug_section): Likewise. * elf.c: Likewise. Update occurrences of sec_info_type and use_rela_p. * elflink.h: Likewise. * elf-eh-frame.c: Likewise. * elf64-alpha.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * bfd-in2.h: Regenerate. * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than referring to used_by_bfd. * elf64-sparc.c (sec_do_relax): Likewise. * elf64-mmix.c (mmix_elf_section_data): Likewise. * elfxx-mips.c (mips_elf_section_data): Likewise. * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro. (ieee_get_section_contents): Likewise. (ieee_new_section_hook): Formatting. (ieee_canonicalize_reloc): Remove commented out code. * mmo.c (mmo_section_data): Define. Use throughout file. * oasys.c (oasys_get_section_contents): Use oasys_per_section macro. gas * config/obj-elf.c (obj_elf_change_section): Set SEC_LINK_ONCE and SEC_LINK_DUPLICATES_DISCARD directly rather than using elf_linkonce_p.
2003-02-04 20:34:08 +08:00
/* Usused bits. */
unsigned int flag13:1;
unsigned int flag14:1;
unsigned int flag15:1;
unsigned int flag16:4;
unsigned int flag20:4;
unsigned int flag24:8;
/* End of internal packed boolean fields. */
1999-05-03 15:29:11 +08: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 15:29:11 +08:00
/* The load address of the section - where it would be in a
rom image; really only used for writing section header
2002-01-31 02:12:17 +08:00
information. */
bfd_vma lma;
1999-05-03 15:29:11 +08: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 15:29:11 +08: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 15:29:11 +08: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 15:29:11 +08:00
/* The output section through which to map on output. */
struct sec *output_section;
1999-05-03 15:29:11 +08: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 15:29:11 +08: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 15:29:11 +08: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 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* The number of relocation records in one of the above. */
unsigned reloc_count;
1999-05-03 15:29:11 +08:00
/* Information below is back end specific - and not always used
or updated. */
1999-05-03 15:29:11 +08:00
/* File position of section data. */
file_ptr filepos;
1999-05-03 15:29:11 +08:00
/* File position of relocation info. */
file_ptr rel_filepos;
1999-05-03 15:29:11 +08:00
/* File position of line data. */
file_ptr line_filepos;
1999-05-03 15:29:11 +08:00
/* Pointer to data for applications. */
2003-06-29 18:06:40 +08:00
void *userdata;
1999-05-03 15:29:11 +08:00
/* If the SEC_IN_MEMORY flag is set, this points to the actual
contents. */
unsigned char *contents;
1999-05-03 15:29:11 +08:00
/* Attached line number information. */
alent *lineno;
1999-05-03 15:29:11 +08:00
/* Number of line number records. */
unsigned int lineno_count;
1999-05-03 15:29:11 +08:00
bfd/ * libbfd-in.h (_bfd_merge_section): New. (_bfd_write_merged_section): New. (_bfd_merged_section_offset): New. * libbfd.h: Rebuilt. * linker.c (_bfd_generic_link_output_symbols): Handle discard_sec_merge. * aoutx.h (aout_link_write_symbols): Likewise. * pdp11.c (aout_link_write_symbols): Likewise. * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section. (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE sections. (elf_link_sec_merge_syms): New. (elf_link_input_bfd): Call _bfd_merged_section_offset and _bfd_write_merged_section. Handle discard_sec_merge. * elf-bfd.h (struct elf_link_hash_table): Add merge_info field. (struct bfd_elf_section_data): Likewise. * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and SEC_STRINGS section flags and entsize from their ELF counterparts. (_bfd_elf_link_hash_table_init): Initialize merge_info. (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize from their BFD counterparts. * merge.c: New file. * Makefile.am: Add strtab.lo. * Makefile.in: Rebuilt. include/ * bfdlink.h (bfd_link_discard): Add discard_sec_merge. gas/ * config/obj-elf.c (obj_elf_change_section): Add entsize argument, handle SHF_MERGE and SHF_STRINGS. (obj_elf_parse_section_letters): Set SHF_MERGE and SHF_STRINGS. (obj_elf_section): Allow additional argument specifying entity size. * write.c (adjust_reloc_syms): Keep relocations against local symbols in SEC_MERGE sections. ld/ * ldmain.c (main): Default to discard_sec_merge. * lexsup.c (OPTION_DISCARD_NONE): Define. (ld_options): Add --discard-none. (parse_args): Handle OPTION_DISCARD_NONE. * ldlang.c (wild_doit): SEC_MERGE should be set in the output section only if SEC_MERGE and SEC_STRINGS flags and entsize of all its input sections match.
2001-04-13 08:34:36 +08:00
/* Entity size for merging purposes. */
unsigned int entsize;
/* Optional information about a COMDAT entry; NULL if not COMDAT. */
struct bfd_comdat_info *comdat;
/* Points to the kept section if this section is a link-once section,
and is discarded. */
struct sec *kept_section;
/* When a section is being output, this value changes as more
linenumbers are written out. */
file_ptr moving_line_filepos;
1999-05-03 15:29:11 +08:00
/* What the section number is in the target world. */
int target_index;
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void *used_by_bfd;
1999-05-03 15:29:11 +08: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 15:29:11 +08:00
/* The BFD which owns the section. */
bfd *owner;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* A symbol which points at this section only. */
struct symbol_cache_entry *symbol;
struct symbol_cache_entry **symbol_ptr_ptr;
1999-05-03 15:29:11 +08:00
struct bfd_link_order *link_order_head;
struct bfd_link_order *link_order_tail;
2002-01-31 02:12:17 +08:00
} asection;
1999-05-03 15:29:11 +08: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 15:29:11 +08: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-31 02:12:17 +08:00
/* The absolute section. */
extern asection bfd_abs_section;
1999-05-03 15:29:11 +08:00
#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
2002-01-31 02:12:17 +08:00
/* Pointer to the undefined section. */
extern asection bfd_und_section;
1999-05-03 15:29:11 +08:00
#define bfd_und_section_ptr ((asection *) &bfd_und_section)
#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
2002-01-31 02:12:17 +08:00
/* Pointer to the common section. */
extern asection bfd_com_section;
1999-05-03 15:29:11 +08:00
#define bfd_com_section_ptr ((asection *) &bfd_com_section)
2002-01-31 02:12:17 +08:00
/* Pointer to the indirect section. */
extern asection bfd_ind_section;
1999-05-03 15:29:11 +08:00
#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
2001-11-19 23:35:38 +08: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 15:29:11 +08: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) \
((section)->_raw_size)
1999-05-03 15:29:11 +08:00
#define bfd_get_section_size_after_reloc(section) \
((section)->reloc_done ? (section)->_cooked_size \
: (abort (), (bfd_size_type) 1))
/* 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)
2003-06-29 18:06:40 +08:00
void bfd_section_list_clear (bfd *);
2003-06-29 18:06:40 +08:00
asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
char *bfd_get_unique_section_name
(bfd *abfd, const char *templat, int *count);
2003-06-29 18:06:40 +08:00
asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
asection *bfd_make_section (bfd *, const char *name);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_section_flags
(bfd *abfd, asection *sec, flagword flags);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_map_over_sections
(bfd *abfd,
void (*func) (bfd *abfd, asection *sect, void *obj),
void *obj);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_section_size
(bfd *abfd, asection *sec, bfd_size_type val);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_section_contents
(bfd *abfd, asection *section, void *data, file_ptr offset,
bfd_size_type count);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_get_section_contents
(bfd *abfd, asection *section, void *location, file_ptr offset,
bfd_size_type count);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_copy_private_section_data
(bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1999-05-03 15:29:11 +08:00
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
BFD_SEND (obfd, _bfd_copy_private_section_data, \
(ibfd, isection, obfd, osection))
2003-06-29 18:06:40 +08:00
void _bfd_strip_section_from_output
(struct bfd_link_info *info, asection *section);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from archures.c. */
enum bfd_architecture
1999-05-03 15:29:11 +08:00
{
2002-01-31 17:24:16 +08:00
bfd_arch_unknown, /* File arch not known. */
bfd_arch_obscure, /* Arch known, not one of these. */
bfd_arch_m68k, /* Motorola 68xxx */
1999-05-03 15:29:11 +08: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-07 04:15:27 +08:00
#define bfd_mach_mcf5200 9
#define bfd_mach_mcf5206e 10
#define bfd_mach_mcf5307 11
#define bfd_mach_mcf5407 12
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
lower number indicates a machine type that
1999-05-03 15:29:11 +08:00
only accepts a subset of the instructions
available to machines with higher numbers.
The exception is the "ca", which is
incompatible with all other machines except
2002-01-31 17:24:16 +08:00
"core". */
1999-05-03 15:29:11 +08: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
bfd_arch_or32, /* OpenRISC 32 */
bfd_arch_a29k, /* AMD 29000 */
bfd_arch_sparc, /* SPARC */
1999-05-03 15:29:11 +08:00
#define bfd_mach_sparc 1
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
1999-05-03 15:29:11 +08:00
#define bfd_mach_sparc_sparclet 2
#define bfd_mach_sparc_sparclite 3
#define bfd_mach_sparc_v8plus 4
2002-01-31 17:24:16 +08:00
#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
1999-05-03 15:29:11 +08:00
#define bfd_mach_sparc_sparclite_le 6
#define bfd_mach_sparc_v9 7
2002-01-31 17:24:16 +08: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. */
/* Nonzero if MACH has the v9 instruction set. */
1999-05-03 15:29:11 +08:00
#define bfd_mach_sparc_v9_p(mach) \
2000-11-03 07:03:24 +08:00
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
&& (mach) != bfd_mach_sparc_sparclite_le)
bfd_arch_mips, /* MIPS Rxxxx */
1999-05-03 15:29:11 +08: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
#define bfd_mach_mips4120 4120
1999-05-03 15:29:11 +08: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
#define bfd_mach_mips5400 5400
#define bfd_mach_mips5500 5500
1999-05-03 15:29:11 +08:00
#define bfd_mach_mips6000 6000
#define bfd_mach_mips7000 7000
1999-05-03 15:29:11 +08:00
#define bfd_mach_mips8000 8000
#define bfd_mach_mips10000 10000
2001-05-24 01:26:40 +08:00
#define bfd_mach_mips12000 12000
#define bfd_mach_mips16 16
2000-12-02 08:55:22 +08:00
#define bfd_mach_mips5 5
2000-12-02 09:10:33 +08:00
#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
#define bfd_mach_mipsisa32 32
[ bfd/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case. * archures.c (bfd_mach_mipsisa32r2): New define. * bfd-in2.h: Regenerate. * cpu-mips.c (I_mipsisa32r2): New enum value. (arch_info_struct): Add entry for I_mipsisa32r2. * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach) (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2. (_bfd_mips_elf_final_write_processing): Add bfd_mach_mipsisa32r2 case. (_bfd_mips_elf_merge_private_bfd_data): Handle merging of binaries marked as using MIPS32 Release 2. [ binutils/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * doc/binutils.texi (objdump): Note MIPS HWR (Hardware Register) changes in MIPS -M options. [ gas/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * configure.in: Recognize mipsisa32r2, mipsisa32r2el, and CPU variants. * configure: Regenerate. * config/tc-mips.c (ISA_HAS_DROR, ISA_HAS_ROR): New defines. (macro_build): Handle "K" operand. (macro2): Use ISA_HAS_DROR and ISA_HAS_ROR in the places where CPU_HAS_DROR and CPU_HAS_ROR are currently used. (mips_ip): New variable "lastpos", and implement "+A", "+B", and "+C" operands for MIPS32 Release 2 ins/ext instructions. Implement "K" operand for MIPS32 Release 2 rdhwr instruction. (validate_mips_insn): Implement "+" as a way to extend the allowed operands, and implement "K", "+A", "+B", and "+C" operands. (OPTION_MIPS32R2): New define. (md_longopts): Add entry for OPTION_MIPS32R2. (OPTION_ELF_BASE): Adjust to accomodate OPTIONS_MIPS32R2. (md_parse_option): Handle OPTION_MIPS32R2. (s_mipsset): Reimplement handling of ".set mipsN" options and add support for ".set mips32r2". (mips_cpu_info_table): Add entry for "mips32r2" (MIPS32 Release 2). (md_show_usage): Document "-mips32r2" option. * doc/as.texinfo: Document "-mips32r2" option. * doc/c-mips.texi: Likewise. [ gas/testsuite/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * gas/mips/cp0-names-mips32r2.d: New test. * gas/mips/hwr-names-mips32r2.d: New test. * gas/mips/hwr-names-numeric.d: New test. * gas/mips/hwr-names.s: New test source file. * gas/mips/mips32r2.d: New test. * gas/mips/mips32r2.s: New test source file. * gas/mips/mips32r2-ill.l: New test. * gas/mips/mips32r2-ill.s: New test source file. * gas/mips/mips.exp: Add mips32r2 architecture data array entry. Run new tests mentioned above. [ include/elf/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips.h (E_MIPS_ARCH_32R2): New define. [ include/opcode/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips.h: Document "+" as the start of two-character operand type names, and add new "K", "+A", "+B", and "+C" operand types. (OP_MASK_INSMSB, OP_SH_INSMSB, OP_MASK_EXTMSB) (OP_SH_EXTMSB, INSN_ISA32R2, ISA_MIPS32R2, CPU_MIPS32R2): New defines. [ opcodes/ChangeLog ] 2002-12-30 Chris Demetriou <cgd@broadcom.com> * mips-dis.c (mips_cp0_names_mips3264r2, mips_hwr_names_numeric) (mips_hwr_names_mips3264r2): New arrays. (mips_arch_choice): New "hwr_names" member. (mips_arch_choices): Adjust for structure change, and add a new entry for "mips32r2" ISA. (mips_hwr_names): New variable. (set_default_mips_dis_options): Set mips_hwr_names. (parse_mips_dis_option): New "hwr-names" option which sets mips_hwr_names, and adjust "reg-names=ARCH" to set mips_hwr_names. (print_insn_arg): Change return type to "int" and use that to indicate number of characters consumed. Add support for "+" operand extension character, "+A", "+B", "+C", and "K" operands. (print_insn_mips): Adjust for changes to print_insn_arg. (print_mips_disassembler_options): Adjust for "hwr-names" addition and "reg-names" change. * mips-opc (I33): New define (shorthand for INSN_ISA32R2). (mips_builtin_opcodes): Note that "nop" and "ssnop" are special forms of "sll". Add new MIPS32 Release 2 instructions: ehb, di, ei, ext, ins, jr.hb, jalr.hb, mfhc1, mfhc2, mthc1, mthc2, rdhwr, rdpgpr, seb, seh, synci, wrpgpr, wsbh. Note that hardware rotate instructions (ror, rorv) can be used on MIPS32 Release 2, and add the official mnemonics for them (rotr, rotrv) and the similar "rotl" mnemonic for left-rotate.
2002-12-31 15:29:29 +08:00
#define bfd_mach_mipsisa32r2 33
#define bfd_mach_mipsisa64 64
[ bfd/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * archures.c (bfd_mach_mipsisa64r2): New define. * bfd-in2.h: Regenerate. * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2. * cpu-mips.c (I_mipsisa64r2): New enum value. (arch_info_struct): Add entry for I_mipsisa64r2. * elfxx-mips.c (_bfd_elf_mips_mach) (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2. (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case. (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2. [ binutils/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * readelf.c (get_machine_flags): Handle E_MIPS_ARCH_64R2. [ gas/Changelog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * configure.in (mipsisa64r2, mipsisa64r2el, mipsisa64r2*): New CPUs. * configure: Regenerate. * config/tc-mips.c (imm2_expr): New variable. (md_assemble, mips16_ip): Initialize imm2_expr. (ISA_HAS_64BIT_REGS, ISA_HAS_DROR, ISA_HAS_ROR): Add ISA_MIPS64R2. (macro_build): Handle +A, +B, +C, +E, +F, +G, and +H format operands. (macro): Handle M_DEXT and M_DINS. (validate_mips_insn): Handle +E, +F, +G, +H, and +I format operands. (mips_ip): Likewise. (OPTION_MIPS64R2): New define. (md_longopts): New entry for -mips64r2 (OPTION_MIPS64R2). OPTION_ASE_BASE): Increase to compensate for OPTION_MIPS64R2. (md_parse_option): Handle OPTION_MIPS64R2. (s_mipsset): Handle setting "mips64r2" ISA. (mips_cpu_info_table): Add mips64r2. (md_show_usage): Document -mips64r2 option. * doc/as.texinfo: Docuemnt -mips64r2 option. * doc/c-mips.texi: Likewise. [ gas/testsuite/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * gas/mips/cp0-names-mips64r2.d: New file. * gas/mips/cp0sel-names-mips64r2.d: New file. * gas/mips/elf_arch_mips64r2.d: New file. * gas/mips/hwr-names-mips64r2.d: New file. * gas/mips/mips32r2-ill-fp64.l: New file. * gas/mips/mips32r2-ill-fp64.s: New file. * gas/mips/mips64r2-ill.l: New file. * gas/mips/mips64r2-ill.s: New file. * gas/mips/mips64r2.d: New file. * gas/mips/mips64r2.s: New file. * gas/mips/mips.exp: Define "mips64r2" arch, and run new tests. [ include/elf/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips.h (E_MIPS_ARCH_64R2): New define. [ include/opcode/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips.h: Document +E, +F, +G, +H, and +I operand types. Update documentation of I, +B and +C operand types. (INSN_ISA64R2, ISA_MIPS64R2, CPU_MIPS64R2): New defines. (M_DEXT, M_DINS): New enum values. [ ld/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * ldmain.c (get_emulation): Ignore "-mips64r2". [ ld/testsuite/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * ld-mips-elf/mips-elf-flags.exp: Add tests for combinations with MIPS64r2. [ opcodes/ChangeLog ] 2003-09-30 Chris Demetriou <cgd@broadcom.com> * mips-dis.c (mips_arch_choices): Add entry for "mips64r2" (print_insn_args): Add handing for +E, +F, +G, and +H. * mips-opc.c (I65): New define for MIPS64r2. (mips_builtin_opcodes): Add "dext", "dextm", "dextu", "dins", "dinsm", "dinsu", "drotl", "drotr", "drotr32", "drotrv", "dsbh", and "dshd" for MIPS64r2. Adjust "dror", "dror32", and "drorv" to be supported on MIPS64r2.
2003-10-01 00:17:15 +08:00
#define bfd_mach_mipsisa64r2 65
bfd_arch_i386, /* Intel 386 */
#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
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 21:26:29 +08:00
bfd_arch_m98k, /* Motorola 98xxx */
bfd_arch_pyramid, /* Pyramid Technology */
bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
2003-04-24 20:36:08 +08:00
#define bfd_mach_h8300 1
#define bfd_mach_h8300h 2
#define bfd_mach_h8300s 3
#define bfd_mach_h8300hn 4
#define bfd_mach_h8300sn 5
#define bfd_mach_h8300sx 6
#define bfd_mach_h8300sxn 7
2001-02-19 07:33:11 +08:00
bfd_arch_pdp11, /* DEC PDP-11 */
bfd_arch_powerpc, /* PowerPC */
#define bfd_mach_ppc 32
#define bfd_mach_ppc64 64
#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
#define bfd_mach_ppc_e500 500
bfd_arch_rs6000, /* IBM RS/6000 */
#define bfd_mach_rs6k 6000
#define bfd_mach_rs6k_rs1 6001
#define bfd_mach_rs6k_rsc 6003
#define bfd_mach_rs6k_rs2 6002
bfd_arch_hppa, /* HP PA RISC */
#define bfd_mach_hppa10 10
#define bfd_mach_hppa11 11
#define bfd_mach_hppa20 20
#define bfd_mach_hppa20w 25
bfd_arch_d10v, /* Mitsubishi D10V */
#define bfd_mach_d10v 1
1999-10-25 21:57:39 +08:00
#define bfd_mach_d10v_ts2 2
#define bfd_mach_d10v_ts3 3
bfd_arch_d30v, /* Mitsubishi D30V */
2002-05-28 22:08:47 +08:00
bfd_arch_dlx, /* DLX */
bfd_arch_m68hc11, /* Motorola 68HC11 */
bfd_arch_m68hc12, /* Motorola 68HC12 */
#define bfd_mach_m6812_default 0
#define bfd_mach_m6812 1
#define bfd_mach_m6812s 2
bfd_arch_z8k, /* Zilog Z8000 */
1999-05-03 15:29:11 +08:00
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
#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 08:33:36 +08:00
#define bfd_mach_sh2 0x20
#define bfd_mach_sh_dsp 0x2d
2003-01-24 02:50:57 +08:00
#define bfd_mach_sh2e 0x2e
1999-05-03 15:29:11 +08: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 08:33:36 +08:00
#define bfd_mach_sh3_dsp 0x3d
1999-05-03 15:29:11 +08: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 08:33:36 +08: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 13:33:27 +08:00
#define bfd_mach_sh5 0x50
bfd_arch_alpha, /* Dec Alpha */
1999-05-03 15:29:11 +08:00
#define bfd_mach_alpha_ev4 0x10
#define bfd_mach_alpha_ev5 0x20
#define bfd_mach_alpha_ev6 0x30
2002-01-31 17:24:16 +08:00
bfd_arch_arm, /* Advanced Risc Machines ARM. */
2003-04-01 21:08:06 +08:00
#define bfd_mach_arm_unknown 0
1999-05-03 15:29:11 +08:00
#define bfd_mach_arm_2 1
1999-07-05 15:28:24 +08:00
#define bfd_mach_arm_2a 2
1999-05-03 15:29:11 +08:00
#define bfd_mach_arm_3 3
#define bfd_mach_arm_3M 4
1999-07-05 15:28:24 +08:00
#define bfd_mach_arm_4 5
1999-05-03 15:29:11 +08:00
#define bfd_mach_arm_4T 6
1999-07-05 15:28:24 +08:00
#define bfd_mach_arm_5 7
#define bfd_mach_arm_5T 8
2000-11-25 08:21:40 +08:00
#define bfd_mach_arm_5TE 9
#define bfd_mach_arm_XScale 10
#define bfd_mach_arm_ep9312 11
2003-03-26 04:56:01 +08:00
#define bfd_mach_arm_iWMMXt 12
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
2002-08-28 18:38:51 +08:00
bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
#define bfd_mach_tic3x 30
#define bfd_mach_tic4x 40
bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
bfd_arch_tic80, /* TI TMS320c80 (MVP) */
bfd_arch_v850, /* NEC V850 */
#define bfd_mach_v850 1
1999-05-03 15:29:11 +08:00
#define bfd_mach_v850e 'E'
#define bfd_mach_v850e1 '1'
bfd_arch_arc, /* ARC Cores */
#define bfd_mach_arc_5 5
#define bfd_mach_arc_6 6
#define bfd_mach_arc_7 7
#define bfd_mach_arc_8 8
bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
#define bfd_mach_m32r 1 /* For backwards compatibility. */
#define bfd_mach_m32rx 'x'
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
1999-05-03 15:29:11 +08:00
#define bfd_mach_mn10300 300
#define bfd_mach_am33 330
#define bfd_mach_am33_2 332
1999-05-03 15:29:11 +08:00
bfd_arch_fr30,
#define bfd_mach_fr30 0x46523330
bfd_arch_frv,
#define bfd_mach_frv 1
#define bfd_mach_frvsimple 2
#define bfd_mach_fr300 300
#define bfd_mach_fr400 400
#define bfd_mach_frvtomcat 499 /* fr500 prototype */
#define bfd_mach_fr500 500
#define bfd_mach_fr550 550
1999-05-03 15:29:11 +08:00
bfd_arch_mcore,
bfd_arch_ia64, /* HP/Intel ia64 */
#define bfd_mach_ia64_elf64 64
#define bfd_mach_ia64_elf32 32
2002-07-17 22:15:52 +08:00
bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
#define bfd_mach_ip2022 1
#define bfd_mach_ip2022ext 2
bfd_arch_iq2000, /* Vitesse IQ2000. */
#define bfd_mach_iq2000 1
#define bfd_mach_iq10 2
bfd_arch_pj,
2002-01-31 17:24:16 +08:00
bfd_arch_avr, /* Atmel AVR microcontrollers. */
2000-03-27 16:39:14 +08:00
#define bfd_mach_avr1 1
#define bfd_mach_avr2 2
#define bfd_mach_avr3 3
#define bfd_mach_avr4 4
#define bfd_mach_avr5 5
bfd_arch_cris, /* Axis CRIS */
2001-02-10 08:58:38 +08:00
bfd_arch_s390, /* IBM s390 */
#define bfd_mach_s390_31 31
#define bfd_mach_s390_64 64
2001-04-24 23:08:16 +08:00
bfd_arch_openrisc, /* OpenRISC */
2002-01-31 17:24:16 +08:00
bfd_arch_mmix, /* Donald Knuth's educational processor. */
Index: bfd/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> Corinna Vinschen <vinschen@redhat.com> * Makefile.am: Add support for xstormy16. * archures.c: Add support for xstormy16. * config.bfd: Add support for xstormy16. * configure.in: Add support for xstormy16. * reloc.c: Add support for xstormy16. * targets.c: Add support for xstormy16. * cpu-xstormy16.c: New file. * elf32-xstormy16.c: New file. * Makefile.in: Regenerated. * bfd-in2.h: Regenerated. * configure: Regenerated. * libbfd.h: Regenerated. Index: binutils/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * readelf.c (guess_is_rela): Add support for stormy16. (dump_relocations): Likewise. (get_machine_name): Likewise. Index: gas/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * configure.in: Add support for xstormy16. * configure: Regenerated. * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerated. * config/tc-xstormy16.c: New file. * config/tc-xstormy16.h: New file. Index: gas/testsuite/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> matthew green <mrg@redhat.com> * gas/xstormy16/allinsn.d: New file. * gas/xstormy16/allinsn.exp: New file. * gas/xstormy16/allinsn.s: New file. * gas/xstormy16/allinsn.sh: New file. * gas/xstormy16/gcc.d: New file. * gas/xstormy16/gcc.s: New file. * gas/xstormy16/gcc.sh: New file. * gas/xstormy16/reloc-1.d: New file. * gas/xstormy16/reloc-1.s: New file. * gas/xstormy16/reloc-2.d: New file. * gas/xstormy16/reloc-2.s: New file. Index: ld/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * Makefile.am: Add support for xstormy16. * configure.tgt: Add support for xstormy16. * Makefile.in: Regenerate. * emulparams/elf32xstormy16.sh: New file. * scripttempl/xstormy16.sc: New file. Index: opcodes/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerate. * configure.in: Add support for xstormy16. * configure: Regenerate. * disassemble.c: Add support for xstormy16. * xstormy16-asm.c: New generated file. * xstormy16-desc.c: New generated file. * xstormy16-desc.h: New generated file. * xstormy16-dis.c: New generated file. * xstormy16-ibld.c: New generated file. * xstormy16-opc.c: New generated file. * xstormy16-opc.h: New generated file. Index: include/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * dis-asm.h (print_insn_xstormy16): Declare. Index: include/elf/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * common.h (EM_XSTORMY16): Define. * xstormy16.h: New file.
2001-12-08 11:46:03 +08:00
bfd_arch_xstormy16,
#define bfd_mach_xstormy16 1
2002-12-31 03:25:13 +08:00
bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
#define bfd_mach_msp11 11
2003-08-08 18:14:52 +08:00
#define bfd_mach_msp110 110
2002-12-31 03:25:13 +08:00
#define bfd_mach_msp12 12
#define bfd_mach_msp13 13
#define bfd_mach_msp14 14
2003-08-08 18:14:52 +08:00
#define bfd_mach_msp15 15
#define bfd_mach_msp16 16
2002-12-31 03:25:13 +08:00
#define bfd_mach_msp31 31
#define bfd_mach_msp32 32
#define bfd_mach_msp33 33
2003-08-08 18:14:52 +08:00
#define bfd_mach_msp41 41
#define bfd_mach_msp42 42
2002-12-31 03:25:13 +08:00
#define bfd_mach_msp43 43
#define bfd_mach_msp44 44
2003-04-01 23:50:31 +08:00
bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
#define bfd_mach_xtensa 1
1999-05-03 15:29:11 +08:00
bfd_arch_last
};
typedef struct bfd_arch_info
1999-05-03 15:29:11 +08: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;
/* 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>>. */
bfd_boolean the_default;
1999-05-03 15:29:11 +08:00
const struct bfd_arch_info * (*compatible)
2003-06-29 18:06:40 +08:00
(const struct bfd_arch_info *a, const struct bfd_arch_info *b);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
1999-05-03 15:29:11 +08:00
const struct bfd_arch_info *next;
}
bfd_arch_info_type;
2003-06-29 18:06:40 +08:00
const char *bfd_printable_name (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const bfd_arch_info_type *bfd_scan_arch (const char *string);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const char **bfd_arch_list (void);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const bfd_arch_info_type *bfd_arch_get_compatible
(const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
enum bfd_architecture bfd_get_arch (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
unsigned long bfd_get_mach (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
unsigned int bfd_arch_bits_per_byte (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
unsigned int bfd_arch_bits_per_address (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const bfd_arch_info_type *bfd_lookup_arch
(enum bfd_architecture arch, unsigned long machine);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const char *bfd_printable_arch_mach
(enum bfd_architecture arch, unsigned long machine);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
unsigned int bfd_octets_per_byte (bfd *abfd);
2000-01-14 06:10:36 +08:00
2003-06-29 18:06:40 +08:00
unsigned int bfd_arch_mach_octets_per_byte
(enum bfd_architecture arch, unsigned long machine);
2000-01-14 06:10:36 +08:00
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from reloc.c. */
1999-05-03 15:29:11 +08:00
typedef enum bfd_reloc_status
{
2002-01-31 02:12:17 +08:00
/* No errors detected. */
1999-05-03 15:29:11 +08:00
bfd_reloc_ok,
2002-01-31 02:12:17 +08:00
/* The relocation was performed, but there was an overflow. */
1999-05-03 15:29:11 +08:00
bfd_reloc_overflow,
2002-01-31 02:12:17 +08:00
/* The address to relocate was not within the section supplied. */
1999-05-03 15:29:11 +08:00
bfd_reloc_outofrange,
2002-01-31 02:12:17 +08:00
/* Used by special functions. */
1999-05-03 15:29:11 +08:00
bfd_reloc_continue,
2002-01-31 02:12:17 +08:00
/* Unsupported relocation size requested. */
1999-05-03 15:29:11 +08:00
bfd_reloc_notsupported,
2002-01-31 02:12:17 +08:00
/* Unused. */
1999-05-03 15:29:11 +08:00
bfd_reloc_other,
2002-01-31 02:12:17 +08:00
/* The symbol to relocate against was undefined. */
1999-05-03 15:29:11 +08:00
bfd_reloc_undefined,
/* 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 15:29:11 +08:00
bfd_reloc_dangerous
}
bfd_reloc_status_type;
1999-05-03 15:29:11 +08:00
typedef struct reloc_cache_entry
{
2002-01-31 02:12:17 +08:00
/* A pointer into the canonical table of pointers. */
1999-05-03 15:29:11 +08:00
struct symbol_cache_entry **sym_ptr_ptr;
2002-01-31 02:12:17 +08:00
/* offset in section. */
1999-05-03 15:29:11 +08:00
bfd_size_type address;
2002-01-31 02:12:17 +08:00
/* addend for relocation value. */
1999-05-03 15:29:11 +08:00
bfd_vma addend;
2002-01-31 02:12:17 +08:00
/* Pointer to how to perform the required relocation. */
1999-05-03 15:29:11 +08:00
reloc_howto_type *howto;
2002-01-31 02:12:17 +08:00
}
arelent;
1999-05-03 15:29:11 +08:00
enum complain_overflow
{
2002-01-31 02:12:17 +08:00
/* Do not complain on overflow. */
1999-05-03 15:29:11 +08:00
complain_overflow_dont,
/* Complain if the bitfield overflows, whether it is considered
2002-01-31 02:12:17 +08:00
as signed or unsigned. */
1999-05-03 15:29:11 +08:00
complain_overflow_bitfield,
/* Complain if the value overflows when considered as signed
2002-01-31 02:12:17 +08:00
number. */
1999-05-03 15:29:11 +08:00
complain_overflow_signed,
/* Complain if the value overflows when considered as an
2002-01-31 02:12:17 +08:00
unsigned number. */
1999-05-03 15:29:11 +08:00
complain_overflow_unsigned
};
struct reloc_howto_struct
{
/* 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 15:29:11 +08:00
unsigned int type;
/* The value the final relocation is shifted right by. This drops
unwanted data from the relocation. */
1999-05-03 15:29:11 +08:00
unsigned int rightshift;
/* 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 15:29:11 +08:00
int size;
/* The number of bits in the item to be relocated. This is used
when doing overflow checking. */
1999-05-03 15:29:11 +08:00
unsigned int bitsize;
/* Notes that the relocation is relative to the location in the
data section of the addend. The relocation function will
subtract from the relocation value the address of the location
being relocated. */
bfd_boolean pc_relative;
1999-05-03 15:29:11 +08:00
/* The bit position of the reloc value in the destination.
The relocated value is left shifted by this amount. */
1999-05-03 15:29:11 +08:00
unsigned int bitpos;
/* What type of overflow error should be checked for when
relocating. */
1999-05-03 15:29:11 +08:00
enum complain_overflow complain_on_overflow;
/* 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 15:29:11 +08:00
bfd_reloc_status_type (*special_function)
2003-06-29 18:06:40 +08:00
(bfd *, arelent *, struct symbol_cache_entry *, void *, asection *,
bfd *, char **);
/* The textual name of the relocation type. */
1999-05-03 15:29:11 +08:00
char *name;
/* 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. */
bfd_boolean partial_inplace;
1999-05-03 15:29:11 +08:00
/* src_mask selects the part of the instruction (or data) to be used
in the relocation sum. If the target relocations don't have an
addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
dst_mask to extract the addend from the section contents. If
relocations do have an addend in the reloc, eg. ELF USE_RELA, this
field should be zero. Non-zero values for ELF USE_RELA targets are
bogus as in those cases the value in the dst_mask part of the
section contents should be treated as garbage. */
1999-05-03 15:29:11 +08:00
bfd_vma src_mask;
/* dst_mask selects which parts of the instruction (or data) are
replaced with a relocated value. */
1999-05-03 15:29:11 +08:00
bfd_vma dst_mask;
/* 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. */
bfd_boolean pcrel_offset;
1999-05-03 15:29:11 +08:00
};
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
#define EMPTY_HOWTO(C) \
HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
NULL, FALSE, 0, 0, FALSE)
#define HOWTO_PREPARE(relocation, symbol) \
{ \
2003-06-29 18:06:40 +08:00
if (symbol != NULL) \
{ \
if (bfd_is_com_section (symbol->section)) \
{ \
relocation = 0; \
} \
else \
{ \
relocation = symbol->value; \
} \
} \
}
2002-01-31 02:12:17 +08:00
2003-06-29 18:06:40 +08:00
unsigned int bfd_get_reloc_size (reloc_howto_type *);
1999-05-03 15:29:11 +08:00
typedef struct relent_chain
{
1999-05-03 15:29:11 +08:00
arelent relent;
struct relent_chain *next;
2002-01-31 02:12:17 +08:00
}
arelent_chain;
2003-06-29 18:06:40 +08:00
bfd_reloc_status_type bfd_check_overflow
(enum complain_overflow how,
1999-05-03 15:29:11 +08:00
unsigned int bitsize,
unsigned int rightshift,
unsigned int addrsize,
2003-06-29 18:06:40 +08:00
bfd_vma relocation);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_reloc_status_type bfd_perform_relocation
(bfd *abfd,
1999-05-03 15:29:11 +08:00
arelent *reloc_entry,
2003-06-29 18:06:40 +08:00
void *data,
1999-05-03 15:29:11 +08:00
asection *input_section,
bfd *output_bfd,
2003-06-29 18:06:40 +08:00
char **error_message);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_reloc_status_type bfd_install_relocation
(bfd *abfd,
1999-05-03 15:29:11 +08:00
arelent *reloc_entry,
2003-06-29 18:06:40 +08:00
void *data, bfd_vma data_start,
1999-05-03 15:29:11 +08:00
asection *input_section,
2003-06-29 18:06:40 +08:00
char **error_message);
1999-05-03 15:29:11 +08:00
enum bfd_reloc_code_real {
_dummy_first_bfd_reloc_code_real,
2002-01-31 02:12:17 +08:00
/* Basic absolute relocations of N bits. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
The 24-bit relocation is used in some Intel 960 configurations. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
/* For ELF. */
1999-05-03 15:29:11 +08: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,
BFD_RELOC_64_PLT_PCREL,
1999-05-03 15:29:11 +08:00
BFD_RELOC_32_PLT_PCREL,
BFD_RELOC_24_PLT_PCREL,
BFD_RELOC_16_PLT_PCREL,
BFD_RELOC_8_PLT_PCREL,
BFD_RELOC_64_PLTOFF,
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
/* Relocations used by 68K ELF. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_68K_GLOB_DAT,
BFD_RELOC_68K_JMP_SLOT,
BFD_RELOC_68K_RELATIVE,
2002-01-31 02:12:17 +08:00
/* Linkage-table relative. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
displacement is used on the Alpha. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
the target word. These are used on the SPARC. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
decided relatively late. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_GPREL16,
BFD_RELOC_GPREL32,
2002-01-31 02:12:17 +08:00
/* Reloc types used for i960/b.out. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_I960_CALLJ,
/* SPARC ELF relocations. There is probably some overlap with other
2002-01-31 02:12:17 +08:00
relocation types already defined. */
1999-05-03 15:29:11 +08: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,
BFD_RELOC_SPARC_UA16,
1999-05-03 15:29:11 +08:00
BFD_RELOC_SPARC_UA32,
BFD_RELOC_SPARC_UA64,
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* I think these are specific to SPARC a.out (e.g., Sun 4). */
1999-05-03 15:29:11 +08:00
BFD_RELOC_SPARC_BASE13,
BFD_RELOC_SPARC_BASE22,
2002-01-31 02:12:17 +08:00
/* SPARC64 relocations */
1999-05-03 15:29:11 +08: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
* elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix dst_mask for R_SPARC_DISP32. Support R_SPARC_PLT32. (sparc_reloc_map): Add BFD_RELOC_16_PCREL and BFD_RELOC_SPARC_PLT32. (elf32_sparc_check_relocs): Handle R_SPARC_PLT32. (elf32_sparc_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_howto_table): Fix dst_mask for R_SPARC_DISP32. Support R_SPARC_PLT32 and R_SPARC_PLT64. (sparc_reloc_map): Add BFD_RELOC_16_PCREL, BFD_RELOC_64_PCREL and BFD_RELOC_SPARC_PLT32. (sparc64_elf_check_relocs): Handle R_SPARC_PLT32 and R_SPARC_PLT64. (sparc64_elf_relocate_section): Likewise. * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SPARC_PLT32. * bfd-in2.h, libbfd.h: Rebuilt. * config/tc-sparc.h (TC_PARSE_CONS_EXPRESSION): Define. (sparc_cons): Provide prototype. * config/tc-sparc.c (tc_gen_reloc): Handle BFD_RELOC_*_PCREL and BFD_RELOC_SPARC_PLT{32,64}. Enumerate for which relocs reloc->addend = fixp->fx_addnumber shouldn't be done instead of enumarating for which pc relative ones it should be done. (sparc_cons_special_reloc): New variable. (sparc_cons): New function. (cons_fix_new_sparc): Use sparc_cons_special_reloc. * testsuite/gas/sparc/pcrel.s: New test. * testsuite/gas/sparc/pcrel.d: Expected output. * testsuite/gas/sparc/pcrel64.s: New test. * testsuite/gas/sparc/pcrel64.d: Expected output. * testsuite/gas/sparc/plt.s: New test. * testsuite/gas/sparc/plt.d: Expected output. * testsuite/gas/sparc/plt64.s: New test. * testsuite/gas/sparc/plt64.d: Expected output. * testsuite/gas/sparc/sparc.exp: Add pcrel, pcrel64, plt and plt64 tests.
2001-12-22 06:35:24 +08:00
BFD_RELOC_SPARC_PLT32,
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
/* SPARC little endian relocation */
1999-05-03 15:29:11 +08:00
BFD_RELOC_SPARC_REV32,
bfd/ * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs. (elf32_sparc_rev32_howto): New variable. (sparc_reloc_map): Add TLS relocs. (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto): Handle REV32. (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject): New functions. (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry, struct elf32_sparc_link_hash_table): New structures. (elf32_sparc_tdata, elf32_sparc_local_got_tls_type, elf32_sparc_hash_table): Define. (link_hash_newfunc, elf32_sparc_link_hash_table_create, create_got_section, elf32_sparc_create_dynamic_sections, elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New functions. (elf32_sparc_check_relocs): Handle TLS relocs. Add dynamic reloc reference counting. (elf32_sparc_gc_sweep_hook): Likewise. (elf32_sparc_adjust_dynamic_symbol): Likewise. (elf32_sparc_size_dynamic_sections): Likewise. (elf32_sparc_relocate_section): Likewise. (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff): New functions. (elf32_sparc_object_p): Allocate backend private object data. (bfd_elf32_bfd_link_hash_table_create, elf_backend_copy_indirect_symbol, bfd_elf32_mkobject, elf_backend_can_refcount): Define. (elf_backend_create_dynamic_sections): Define to elf32_sparc_create_dynamic_sections. * reloc.c: Add SPARC TLS relocs. * bfd-in2.h, libbfd.h: Rebuilt. * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs. (sparc_reloc_map): Likewise. gas/ * config/tc-sparc.c (sparc_ip): Handle TLS % operators. (tc_gen_reloc): Handle TLS relocs. (sparc_cons, cons_fix_new_sparc): Handle %r_tls_dtpoff. * config/tc-sparc.h (tc_fix_adjustable): Don't adjust TLS relocs. * config/obj-elf.c (obj_elf_section_word): Handle tls. (obj_elf_type): Handle tls_object. include/ * elf/sparc.h: Add TLS relocs. Move R_SPARC_REV32 to 252. ld/testsuite/ * ld-sparc/sparc.exp: New. * ld-sparc/tlsg32.s: New test. * ld-sparc/tlsg32.sd: Likewise. * ld-sparc/tlsg64.s: Likewise. * ld-sparc/tlsg64.sd: Likewise. * ld-sparc/tlslib.s: Likewise. * ld-sparc/tlsnopic.s: Likewise. * ld-sparc/tlspic.s: Likewise. * ld-sparc/tlssunbin32.dd: Likewise. * ld-sparc/tlssunbin32.rd: Likewise. * ld-sparc/tlssunbin32.s: Likewise. * ld-sparc/tlssunbin32.sd: Likewise. * ld-sparc/tlssunbin32.td: Likewise. * ld-sparc/tlssunbin64.dd: Likewise. * ld-sparc/tlssunbin64.rd: Likewise. * ld-sparc/tlssunbin64.s: Likewise. * ld-sparc/tlssunbin64.sd: Likewise. * ld-sparc/tlssunbin64.td: Likewise. * ld-sparc/tlssunbinpic32.s: Likewise. * ld-sparc/tlssunbinpic64.s: Likewise. * ld-sparc/tlssunnopic32.dd: Likewise. * ld-sparc/tlssunnopic32.rd: Likewise. * ld-sparc/tlssunnopic32.s: Likewise. * ld-sparc/tlssunnopic32.sd: Likewise. * ld-sparc/tlssunnopic64.dd: Likewise. * ld-sparc/tlssunnopic64.rd: Likewise. * ld-sparc/tlssunnopic64.s: Likewise. * ld-sparc/tlssunnopic64.sd: Likewise. * ld-sparc/tlssunpic32.dd: Likewise. * ld-sparc/tlssunpic32.rd: Likewise. * ld-sparc/tlssunpic32.s: Likewise. * ld-sparc/tlssunpic32.sd: Likewise. * ld-sparc/tlssunpic32.td: Likewise. * ld-sparc/tlssunpic64.dd: Likewise. * ld-sparc/tlssunpic64.rd: Likewise. * ld-sparc/tlssunpic64.s: Likewise. * ld-sparc/tlssunpic64.sd: Likewise. * ld-sparc/tlssunpic64.td: Likewise.
2003-01-25 07:44:45 +08:00
/* SPARC TLS relocations */
BFD_RELOC_SPARC_TLS_GD_HI22,
BFD_RELOC_SPARC_TLS_GD_LO10,
BFD_RELOC_SPARC_TLS_GD_ADD,
BFD_RELOC_SPARC_TLS_GD_CALL,
BFD_RELOC_SPARC_TLS_LDM_HI22,
BFD_RELOC_SPARC_TLS_LDM_LO10,
BFD_RELOC_SPARC_TLS_LDM_ADD,
BFD_RELOC_SPARC_TLS_LDM_CALL,
BFD_RELOC_SPARC_TLS_LDO_HIX22,
BFD_RELOC_SPARC_TLS_LDO_LOX10,
BFD_RELOC_SPARC_TLS_LDO_ADD,
BFD_RELOC_SPARC_TLS_IE_HI22,
BFD_RELOC_SPARC_TLS_IE_LO10,
BFD_RELOC_SPARC_TLS_IE_LD,
BFD_RELOC_SPARC_TLS_IE_LDX,
BFD_RELOC_SPARC_TLS_IE_ADD,
BFD_RELOC_SPARC_TLS_LE_HIX22,
BFD_RELOC_SPARC_TLS_LE_LOX10,
BFD_RELOC_SPARC_TLS_DTPMOD32,
BFD_RELOC_SPARC_TLS_DTPMOD64,
BFD_RELOC_SPARC_TLS_DTPOFF32,
BFD_RELOC_SPARC_TLS_DTPOFF64,
BFD_RELOC_SPARC_TLS_TPOFF32,
BFD_RELOC_SPARC_TLS_TPOFF64,
1999-05-03 15:29:11 +08:00
/* 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-31 02:12:17 +08:00
the "ldah" instruction (which is at the address of this reloc). */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
reading, for convenience. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
relocation. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
3 - jsr (target of branch) */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
prediction logic which may be provided on some processors. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_ALPHA_HINT,
/* The LINKAGE relocation outputs a linkage pair in the object file,
2002-01-31 02:12:17 +08:00
which is filled by the linker. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_ALPHA_LINKAGE,
/* The CODEADDR relocation outputs a STO_CA in the object file,
2002-01-31 02:12:17 +08:00
which is filled by the linker. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_ALPHA_CODEADDR,
/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2002-01-31 02:12:17 +08:00
GP register. */
BFD_RELOC_ALPHA_GPREL_HI16,
BFD_RELOC_ALPHA_GPREL_LO16,
/* 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-31 06:01:38 +08: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 15:29:11 +08:00
/* Bits 27..2 of the relocation address shifted right 2 bits;
2002-01-31 02:12:17 +08:00
simple reloc otherwise. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_MIPS_JMP,
2002-01-31 02:12:17 +08:00
/* The MIPS16 jump instruction. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_MIPS16_JMP,
2002-01-31 02:12:17 +08:00
/* MIPS16 GP relative reloc. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_MIPS16_GPREL,
2002-01-31 02:12:17 +08:00
/* High 16 bits of 32-bit value; simple reloc. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
to compensate for the borrow when the low bits are added. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_HI16_S,
2002-01-31 02:12:17 +08:00
/* Low 16 bits. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_LO16,
2002-01-31 02:12:17 +08:00
/* Like BFD_RELOC_HI16_S, but PC relative. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_PCREL_HI16_S,
2002-01-31 02:12:17 +08:00
/* Like BFD_RELOC_LO16, but PC relative. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_PCREL_LO16,
2002-01-31 02:12:17 +08:00
/* Relocation against a MIPS literal section. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_MIPS_LITERAL,
2002-01-31 02:12:17 +08:00
/* MIPS ELF relocations. */
1999-05-03 15:29:11 +08: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,
BFD_RELOC_MIPS_SUB,
BFD_RELOC_MIPS_GOT_PAGE,
BFD_RELOC_MIPS_GOT_OFST,
BFD_RELOC_MIPS_GOT_DISP,
2001-05-24 01:36:38 +08: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 15:29:11 +08: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,
2002-12-12 Alexandre Oliva <aoliva@redhat.com> * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Initialize pcrel_relocs_copied. 2001-12-13 Alexandre Oliva <aoliva@redhat.com> * elf-m10300.c (ELF_DYNAMIC_INTERPRETER): Renamed from ld-linux.so.2 to ld.so.1. 2001-10-10 Alexandre Oliva <aoliva@redhat.com> * elf-m10300.c (elf_mn10300_sizeof_plt0): New macro. (_bfd_mn10300_elf_adjust_dynamic_symbol): Use it. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Allocate .rela.* section contents with bfd_zalloc. 2001-09-25 Alexandre Oliva <aoliva@redhat.com> * elf-m10300.c: Added declarations for functions missing them. Merge some shared-library changes from the i386 back-end. Use R_MN10300_RELATIVE instead of R_MN10300_PCREL32 and R_MN10300_GLOB_DAT instead of R_MN10300_32 where appropriate. (struct elf32_mn10300_link_hash_entry): Remove duplicates of members of elf_link_hash_entry. Adjusted references. (mn10300_elf_final_link_relocate): dynobj was already loaded into a local variable, use it. 2001-09-21 Nick Clifton <nickc@cambridge.redhat.com> * elf-m10300.c: Add missing function prototypes. 2001-08-24 Alexandre Oliva <aoliva@redhat.com> * elf-m10300.c (mn10300_elf_relocate_section): Don't compute relocation for dynamic relocations. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * reloc.c (BFD_RELOC_MN10300_GOTOFF24): New. * elf-m10300.c: Introduce GOTPC16, GOTOFF24, GOTOFF16 and PLT16, and rename GOTPC to GOTPC32 and GOTOFF to GOTOFF32. (_bfd_mn10300_elf_create_dynamic_sections): Move creation ot PLT... (_bfd_mn10300_elf_create_got_section): ... here, so that its adress is already known at the time we compute relaxations. (mn10300_elf_relax_section): Relax GOTPC32, GOTOFF32, GOT32 and PLT32 to narrower relocations. * libbfd.h, bfd-in2.h: Rebuilt. 2001-04-12 Alexandre Oliva <aoliva@redhat.com> * reloc.c (BFD_RELOC_MN10300_GOT32, BFD_RELOC_MN10300_GOT24, BFD_RELOC_MN10300_GOT16, BFD_RELOC_MN10300_COPY, BFD_RELOC_MN10300_GLOB_DAT, BFD_RELOC_MN10300_JMP_SLOT, BFD_RELOC_MN10300_RELATIVE): New relocs. * libbfd.h, bfd-in2.h: Rebuilt. * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): New. (struct elf32_mn10300_link_hash_entry): Added DSO-related fields. (elf_mn10300_howto): Defined new relocation types. (mn10300_reloc_map): Map them. (_bfd_mn10300_elf_create_got_section): New fn. (mn10300_elf_check_relocs): Handle PIC relocs. (mn10300_elf_final_link_relocate): Likewise. (mn10300_elf_relocate_section): Handle DSOs. (PLT0_ENTRY_SIZE, PLT_ENTRY_SIZE, PIC_PLT_ENTRY_SIZE): New macros. (elf_mn10300_plt0_entry, elf_mn10300_plt_entry, elf_mn10300_pic_plt_entry): New. (elf_mn10300_sizeof_plt, elf_mn10300_plt_plt0_offset, elf_mn10300_plt0_linker_offset, elf_mn10300_plt0_gotid_offset, elf_mn10300_plt_temp_offset, elf_mn10300_plt_symbol_offset, elf_mn10300_plt_reloc_offset: New macros. (ELF_DYNAMIC_INTERPRETER): Likewise. (_bfd_mn10300_elf_create_dynamic_sections): New function. (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. (_bfd_mn10300_elf_discard_copies): Likewise. (_bfd_mn10300_elf_size_dynamic_sections): Likewise. (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. (elf_backend_can_gc_sections, elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_sections, 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): New macros.
2003-07-10 11:20:00 +08:00
/* This is a 24bit GOT-relative reloc for the mn10300. */
BFD_RELOC_MN10300_GOTOFF24,
/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
in the instruction. */
BFD_RELOC_MN10300_GOT32,
/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
in the instruction. */
BFD_RELOC_MN10300_GOT24,
/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
in the instruction. */
BFD_RELOC_MN10300_GOT16,
/* Copy symbol at runtime. */
BFD_RELOC_MN10300_COPY,
/* Create GOT entry. */
BFD_RELOC_MN10300_GLOB_DAT,
/* Create PLT entry. */
BFD_RELOC_MN10300_JMP_SLOT,
/* Adjust by program base. */
BFD_RELOC_MN10300_RELATIVE,
2002-01-31 02:12:17 +08:00
/* i386/elf relocations */
1999-05-03 15:29:11 +08: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-20 03:01:18 +08: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 21:12:53 +08: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 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* x86-64/elf relocations */
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-28 03:29:18 +08: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,
2002-01-31 02:12:17 +08:00
/* ns32k relocations */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
/* PDP11 relocations */
2001-02-19 07:33:11 +08:00
BFD_RELOC_PDP11_DISP_8_PCREL,
BFD_RELOC_PDP11_DISP_6_PCREL,
2002-01-31 02:12:17 +08:00
/* Picojava relocs. Not all of these appear in object files. */
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-31 02:12:17 +08:00
/* Power(rs6000) and PowerPC relocations. */
1999-05-03 15:29:11 +08: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,
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,
BFD_RELOC_PPC64_PLTGOT16,
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 15:29:11 +08:00
* reloc.c: Add PPC and PPC64 TLS relocs. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare. (ppc64_elf_howto_raw): Add TLS howto's. Adjust R_PPC64_NONE to be against a 32 bit field. (ppc64_elf_reloc_type_lookup): Handle TLS relocs. (_ppc64_elf_section_data): Add t_symndx and comments. (ppc64_elf_section_data): Use elf_section_data macro. (ppc64_elf_new_section_hook): American spelling. (struct got_entry, struct plt_entry): New. (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC. (struct ppc_stub_hash_entry): Add "addend" field. (struct ppc_link_hash_entry): Add "tls_type". (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_EXPLICIT): Define. (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got. (link_hash_newfunc): Init new fields. (ppc64_elf_link_hash_table_create): Likewise. Set init_relcount and init_offset to NULL. (ppc64_elf_copy_indirect_symbol): Copy got and plt info. Don't call _bfd_elf_link_hash_copy_indirect, rather insert relevant code from there. (update_local_sym_info, update_plt_info): New functions. (ppc64_elf_check_relocs): Use them. Handle TLS relocs. Adjust GOT handling to use got.glist rather than got.refcount. Likewise for PLT. (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists. (func_desc_adjust): Adjust for new PLT list. (ppc64_elf_adjust_dynamic_symbol): Likewise. (get_sym_h, get_tls_type): New functions. (ppc64_elf_edit_opd): Remove unused variable. Use get_sym_h. (ppc64_elf_tls_optimize): New function. (allocate_dynrelocs): Adjust for new PLT and GOT lists. Allocate TLS relocs. (ppc64_elf_size_dynamic_sections): Likewise. (ppc_type_of_stub): Adjust for new PLT list. (ppc_build_one_stub): Likewise. (ppc64_elf_size_stubs): Likewise. Use get_sym_h. Treat __tls_get_addr calls specially. (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists. Handle TLS relocs. Report local syms using bfd_elf_local_sym_name. Don't init GOT entries that have a reloc. Generate GOT relocs here.. (ppc64_elf_finish_dynamic_symbol): ..not here. Adjust for PLT list. * elf64-ppc.h (ppc64_elf_tls_optimize): Declare.
2003-02-04 22:50:50 +08:00
/* PowerPC and PowerPC64 thread-local storage relocations. */
BFD_RELOC_PPC_TLS,
BFD_RELOC_PPC_DTPMOD,
BFD_RELOC_PPC_TPREL16,
BFD_RELOC_PPC_TPREL16_LO,
BFD_RELOC_PPC_TPREL16_HI,
BFD_RELOC_PPC_TPREL16_HA,
BFD_RELOC_PPC_TPREL,
BFD_RELOC_PPC_DTPREL16,
BFD_RELOC_PPC_DTPREL16_LO,
BFD_RELOC_PPC_DTPREL16_HI,
BFD_RELOC_PPC_DTPREL16_HA,
BFD_RELOC_PPC_DTPREL,
BFD_RELOC_PPC_GOT_TLSGD16,
BFD_RELOC_PPC_GOT_TLSGD16_LO,
BFD_RELOC_PPC_GOT_TLSGD16_HI,
BFD_RELOC_PPC_GOT_TLSGD16_HA,
BFD_RELOC_PPC_GOT_TLSLD16,
BFD_RELOC_PPC_GOT_TLSLD16_LO,
BFD_RELOC_PPC_GOT_TLSLD16_HI,
BFD_RELOC_PPC_GOT_TLSLD16_HA,
BFD_RELOC_PPC_GOT_TPREL16,
BFD_RELOC_PPC_GOT_TPREL16_LO,
BFD_RELOC_PPC_GOT_TPREL16_HI,
BFD_RELOC_PPC_GOT_TPREL16_HA,
BFD_RELOC_PPC_GOT_DTPREL16,
BFD_RELOC_PPC_GOT_DTPREL16_LO,
BFD_RELOC_PPC_GOT_DTPREL16_HI,
BFD_RELOC_PPC_GOT_DTPREL16_HA,
BFD_RELOC_PPC64_TPREL16_DS,
BFD_RELOC_PPC64_TPREL16_LO_DS,
BFD_RELOC_PPC64_TPREL16_HIGHER,
BFD_RELOC_PPC64_TPREL16_HIGHERA,
BFD_RELOC_PPC64_TPREL16_HIGHEST,
BFD_RELOC_PPC64_TPREL16_HIGHESTA,
BFD_RELOC_PPC64_DTPREL16_DS,
BFD_RELOC_PPC64_DTPREL16_LO_DS,
BFD_RELOC_PPC64_DTPREL16_HIGHER,
BFD_RELOC_PPC64_DTPREL16_HIGHERA,
BFD_RELOC_PPC64_DTPREL16_HIGHEST,
BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
2002-01-31 02:12:17 +08:00
/* IBM 370/390 relocations */
2000-02-23 21:52:23 +08:00
BFD_RELOC_I370_D12,
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
It generally does map to one of the other relocation types. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_CTOR,
/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
2002-01-31 02:12:17 +08:00
not stored in the instruction. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_ARM_PCREL_BRANCH,
/* 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-31 02:12:17 +08:00
field in the instruction. */
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-31 02:12:17 +08:00
field in the instruction. */
BFD_RELOC_THUMB_PCREL_BLX,
1999-05-03 15:29:11 +08:00
/* These relocs are only used within the ARM assembler. They are not
2002-01-31 02:12:17 +08:00
(at present) written to any object files. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_ARM_IMMEDIATE,
1999-07-05 14:29:47 +08:00
BFD_RELOC_ARM_ADRL_IMMEDIATE,
1999-05-03 15:29:11 +08: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,
2003-03-26 04:56:01 +08:00
BFD_RELOC_ARM_CP_OFF_IMM_S2,
1999-05-03 15:29:11 +08:00
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,
/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
1999-05-03 15:29:11 +08: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-06 05:23:05 +08:00
BFD_RELOC_SH_LOOP_START,
BFD_RELOC_SH_LOOP_END,
BFD_RELOC_SH_COPY,
BFD_RELOC_SH_GLOB_DAT,
BFD_RELOC_SH_JMP_SLOT,
BFD_RELOC_SH_RELATIVE,
BFD_RELOC_SH_GOTPC,
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 22:28:29 +08: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 15:29:11 +08:00
/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
2002-01-31 02:12:17 +08:00
be zero and is not stored in the instruction. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_THUMB_PCREL_BRANCH9,
BFD_RELOC_THUMB_PCREL_BRANCH12,
BFD_RELOC_THUMB_PCREL_BRANCH23,
/* ARC Cores relocs.
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
through 7 of the instruction. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
through 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_ARC_B26,
/* Mitsubishi D10V relocs.
This is a 10-bit reloc with the right 2 bits
2002-01-31 02:12:17 +08:00
assumed to be 0. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
shifted left 15 bits. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D10V_10_PCREL_L,
/* This is an 18-bit reloc with the right 2 bits
2002-01-31 02:12:17 +08:00
assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D10V_18,
/* This is an 18-bit reloc with the right 2 bits
2002-01-31 02:12:17 +08:00
assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D10V_18_PCREL,
/* Mitsubishi D30V relocs.
2002-01-31 02:12:17 +08:00
This is a 6-bit absolute reloc. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_6,
2000-03-27 16:39:14 +08:00
/* This is a 6-bit pc-relative reloc with
2002-01-31 02:12:17 +08:00
the right 3 bits assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_9_PCREL,
2000-03-27 16:39:14 +08:00
/* This is a 6-bit pc-relative reloc with
1999-05-03 15:29:11 +08:00
the right 3 bits assumed to be 0. Same
as the previous reloc but on the right side
2002-01-31 02:12:17 +08:00
of the container. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_9_PCREL_R,
2000-03-27 16:39:14 +08:00
/* This is a 12-bit absolute reloc with the
2002-01-31 02:12:17 +08:00
right 3 bitsassumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_15,
2000-03-27 16:39:14 +08:00
/* This is a 12-bit pc-relative reloc with
2002-01-31 02:12:17 +08:00
the right 3 bits assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_15_PCREL,
2000-03-27 16:39:14 +08:00
/* This is a 12-bit pc-relative reloc with
1999-05-03 15:29:11 +08:00
the right 3 bits assumed to be 0. Same
as the previous reloc but on the right side
2002-01-31 02:12:17 +08:00
of the container. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_15_PCREL_R,
2000-03-27 16:39:14 +08:00
/* This is an 18-bit absolute reloc with
2002-01-31 02:12:17 +08:00
the right 3 bits assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_21,
2000-03-27 16:39:14 +08:00
/* This is an 18-bit pc-relative reloc with
2002-01-31 02:12:17 +08:00
the right 3 bits assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_21_PCREL,
2000-03-27 16:39:14 +08:00
/* This is an 18-bit pc-relative reloc with
1999-05-03 15:29:11 +08:00
the right 3 bits assumed to be 0. Same
as the previous reloc but on the right side
2002-01-31 02:12:17 +08:00
of the container. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_21_PCREL_R,
2002-01-31 02:12:17 +08:00
/* This is a 32-bit absolute reloc. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_32,
2002-01-31 02:12:17 +08:00
/* This is a 32-bit pc-relative reloc. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_D30V_32_PCREL,
2002-05-28 22:08:47 +08:00
/* DLX relocs */
BFD_RELOC_DLX_HI16_S,
/* DLX relocs */
BFD_RELOC_DLX_LO16,
/* DLX relocs */
BFD_RELOC_DLX_JMP26,
/* Renesas M32R (formerly Mitsubishi M32R) relocs.
2002-01-31 02:12:17 +08:00
This is a 24 bit absolute address. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_24,
2002-01-31 02:12:17 +08:00
/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_10_PCREL,
2002-01-31 02:12:17 +08:00
/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_18_PCREL,
2002-01-31 02:12:17 +08:00
/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_26_PCREL,
/* This is a 16-bit reloc containing the high 16 bits of an address
2002-01-31 02:12:17 +08:00
used when the lower 16 bits are treated as unsigned. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_HI16_ULO,
/* This is a 16-bit reloc containing the high 16 bits of an address
2002-01-31 02:12:17 +08:00
used when the lower 16 bits are treated as signed. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_HI16_SLO,
2002-01-31 02:12:17 +08:00
/* This is a 16-bit reloc containing the lower 16 bits of an address. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_LO16,
/* This is a 16-bit reloc containing the small data area offset for use in
2002-01-31 02:12:17 +08:00
add3, load, and store instructions. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_M32R_SDA16,
2002-01-31 02:12:17 +08:00
/* This is a 9-bit reloc */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_9_PCREL,
2002-01-31 02:12:17 +08:00
/* This is a 22-bit reloc */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_22_PCREL,
2002-01-31 02:12:17 +08:00
/* This is a 16 bit offset from the short data area pointer. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
short data area pointer. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_SDA_15_16_OFFSET,
2002-01-31 02:12:17 +08:00
/* This is a 16 bit offset from the zero data area pointer. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
zero data area pointer. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
tiny data area pointer. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
data area pointer. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_TDA_7_8_OFFSET,
2002-01-31 02:12:17 +08:00
/* This is a 7 bit offset from the tiny data area pointer. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_TDA_7_7_OFFSET,
2002-01-31 02:12:17 +08:00
/* This is a 16 bit offset from the tiny data area pointer. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
data area pointer. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_TDA_4_5_OFFSET,
2002-01-31 02:12:17 +08:00
/* This is a 4 bit offset from the tiny data area pointer. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_TDA_4_4_OFFSET,
/* This is a 16 bit offset from the short data area pointer, with the
2002-01-31 02:12:17 +08:00
bits placed non-contigously in the instruction. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
bits placed non-contigously in the instruction. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
2002-01-31 02:12:17 +08:00
/* This is a 6 bit offset from the call table base pointer. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_CALLT_6_7_OFFSET,
2002-01-31 02:12:17 +08:00
/* This is a 16 bit offset from the call table base pointer. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_V850_CALLT_16_16_OFFSET,
/* 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,
1999-05-03 15:29:11 +08:00
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
2002-01-31 02:12:17 +08:00
instruction. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_MN10300_32_PCREL,
/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
2002-01-31 02:12:17 +08:00
instruction. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
significant 8 bits of the opcode. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_TIC30_LDP,
/* 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-31 02:12:17 +08:00
significant 7 bits of the opcode. */
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-31 02:12:17 +08:00
significant 9 bits of the opcode. */
BFD_RELOC_TIC54X_PARTMS9,
2002-01-31 02:12:17 +08:00
/* This is an extended address 23-bit reloc for the tms320c54x. */
BFD_RELOC_TIC54X_23,
/* 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-31 02:12:17 +08:00
the opcode. */
BFD_RELOC_TIC54X_16_OF_23,
/* This is a reloc for the tms320c54x, where the most
significant 7 bits of a 23-bit extended address are placed into
2002-01-31 02:12:17 +08:00
the opcode. */
BFD_RELOC_TIC54X_MS7_OF_23,
2002-01-31 02:12:17 +08:00
/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_FR30_48,
/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
2002-01-31 02:12:17 +08:00
two sections. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_FR30_20,
/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
2002-01-31 02:12:17 +08:00
4 bits. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
into 8 bits. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
into 8 bits. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
into 8 bits. */
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
short offset into 8 bits. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_FR30_9_PCREL,
/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
2002-01-31 02:12:17 +08:00
short offset into 11 bits. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_FR30_12_PCREL,
2002-01-31 02:12:17 +08:00
/* Motorola Mcore relocations. */
1999-05-03 15:29:11 +08: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 23:38:13 +08:00
BFD_RELOC_MCORE_RVA,
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* These are relocations for the GETA instruction. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_GETA,
BFD_RELOC_MMIX_GETA_1,
BFD_RELOC_MMIX_GETA_2,
BFD_RELOC_MMIX_GETA_3,
2002-01-31 02:12:17 +08:00
/* These are relocations for a conditional branch instruction. */
2001-10-30 23:20:14 +08: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-31 02:12:17 +08:00
/* These are relocations for the PUSHJ instruction. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_PUSHJ,
BFD_RELOC_MMIX_PUSHJ_1,
BFD_RELOC_MMIX_PUSHJ_2,
BFD_RELOC_MMIX_PUSHJ_3,
BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
2001-10-30 23:20:14 +08:00
2002-01-31 02:12:17 +08:00
/* These are relocations for the JMP instruction. */
2001-10-30 23:20:14 +08: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-31 02:12:17 +08:00
a branch. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_ADDR19,
2002-01-31 02:12:17 +08:00
/* This is a relocation for a relative address as in a JMP instruction. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_ADDR27,
/* This is a relocation for an instruction field that may be a general
2002-01-31 02:12:17 +08:00
register or a value 0..255. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_REG_OR_BYTE,
/* This is a relocation for an instruction field that may be a general
2002-01-31 02:12:17 +08:00
register. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_REG,
/* This is a relocation for two instruction fields holding a register and
2002-01-31 02:12:17 +08:00
an offset, the equivalent of the relocation. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
/* This relocation is an assertion that the expression is not allocated as
2002-01-31 02:12:17 +08:00
a global register. It does not modify contents. */
2001-10-30 23:20:14 +08:00
BFD_RELOC_MMIX_LOCAL,
2000-03-27 16:39:14 +08:00
/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
2002-01-31 02:12:17 +08:00
short offset into 7 bits. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_7_PCREL,
/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
2002-01-31 02:12:17 +08:00
short offset into 12 bits. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_13_PCREL,
/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
2002-01-31 02:12:17 +08:00
program memory address) into 16 bits. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_16_PM,
/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
2002-01-31 02:12:17 +08:00
data memory address) into 8 bit immediate value of LDI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
of data memory address) into 8 bit immediate value of LDI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
of program memory address) into 8 bit immediate value of LDI insn. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_HH8_LDI,
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
2002-01-31 02:12:17 +08:00
(usually data memory address) into 8 bit immediate value of SUBI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
SUBI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
of LDI or SUBI insn. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_HH8_LDI_NEG,
/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
2002-01-31 02:12:17 +08:00
command address) into 8 bit immediate value of LDI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
of command address) into 8 bit immediate value of LDI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
of command address) into 8 bit immediate value of LDI insn. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_HH8_LDI_PM,
/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
2002-01-31 02:12:17 +08:00
(usually command address) into 8 bit immediate value of SUBI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
of SUBI insn. */
2000-03-27 16:39:14 +08: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-31 02:12:17 +08:00
value of SUBI insn. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_HH8_LDI_PM_NEG,
/* This is a 32 bit reloc for the AVR that stores 23 bit value
2002-01-31 02:12:17 +08:00
into 22 bits. */
2000-03-27 16:39:14 +08:00
BFD_RELOC_AVR_CALL,
2002-01-31 02:12:17 +08:00
/* Direct 12 bit. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_12,
2002-01-31 02:12:17 +08:00
/* 12 bit GOT offset. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_GOT12,
2002-01-31 02:12:17 +08:00
/* 32 bit PC relative PLT address. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_PLT32,
2002-01-31 02:12:17 +08:00
/* Copy symbol at runtime. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_COPY,
2002-01-31 02:12:17 +08:00
/* Create GOT entry. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_GLOB_DAT,
2002-01-31 02:12:17 +08:00
/* Create PLT entry. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_JMP_SLOT,
2002-01-31 02:12:17 +08:00
/* Adjust by program base. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_RELATIVE,
2002-01-31 02:12:17 +08:00
/* 32 bit PC relative offset to GOT. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_GOTPC,
2002-01-31 02:12:17 +08:00
/* 16 bit GOT offset. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_GOT16,
2002-01-31 02:12:17 +08:00
/* PC relative 16 bit shifted by 1. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_PC16DBL,
2002-01-31 02:12:17 +08:00
/* 16 bit PC rel. PLT shifted by 1. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_PLT16DBL,
2002-01-31 02:12:17 +08:00
/* PC relative 32 bit shifted by 1. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_PC32DBL,
2002-01-31 02:12:17 +08:00
/* 32 bit PC rel. PLT shifted by 1. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_PLT32DBL,
2002-01-31 02:12:17 +08:00
/* 32 bit PC rel. GOT shifted by 1. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_GOTPCDBL,
2002-01-31 02:12:17 +08:00
/* 64 bit GOT offset. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_GOT64,
2002-01-31 02:12:17 +08:00
/* 64 bit PC relative PLT address. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_PLT64,
2002-01-31 02:12:17 +08:00
/* 32 bit rel. offset to GOT entry. */
2001-02-10 08:58:38 +08:00
BFD_RELOC_390_GOTENT,
/* 64 bit offset to GOT. */
BFD_RELOC_390_GOTOFF64,
/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_390_GOTPLT12,
/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_390_GOTPLT16,
/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_390_GOTPLT32,
/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_390_GOTPLT64,
/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_390_GOTPLTENT,
/* 16-bit rel. offset from the GOT to a PLT entry. */
BFD_RELOC_390_PLTOFF16,
/* 32-bit rel. offset from the GOT to a PLT entry. */
BFD_RELOC_390_PLTOFF32,
/* 64-bit rel. offset from the GOT to a PLT entry. */
BFD_RELOC_390_PLTOFF64,
/* s390 tls relocations. */
BFD_RELOC_390_TLS_LOAD,
BFD_RELOC_390_TLS_GDCALL,
BFD_RELOC_390_TLS_LDCALL,
BFD_RELOC_390_TLS_GD32,
BFD_RELOC_390_TLS_GD64,
BFD_RELOC_390_TLS_GOTIE12,
BFD_RELOC_390_TLS_GOTIE32,
BFD_RELOC_390_TLS_GOTIE64,
BFD_RELOC_390_TLS_LDM32,
BFD_RELOC_390_TLS_LDM64,
BFD_RELOC_390_TLS_IE32,
BFD_RELOC_390_TLS_IE64,
BFD_RELOC_390_TLS_IEENT,
BFD_RELOC_390_TLS_LE32,
BFD_RELOC_390_TLS_LE64,
BFD_RELOC_390_TLS_LDO32,
BFD_RELOC_390_TLS_LDO64,
BFD_RELOC_390_TLS_DTPMOD,
BFD_RELOC_390_TLS_DTPOFF,
BFD_RELOC_390_TLS_TPOFF,
/* Long displacement extension. */
BFD_RELOC_390_20,
BFD_RELOC_390_GOT20,
BFD_RELOC_390_GOTPLT20,
BFD_RELOC_390_TLS_GOTIE20,
2002-07-17 22:15:52 +08: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 16:39:14 +08:00
/* These two relocations are used by the linker to determine which of
1999-05-03 15:29:11 +08: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 16:39:14 +08:00
describes the entry that is being used. For Rela hosts, this offset
1999-05-03 15:29:11 +08:00
is stored in the reloc's addend. For Rel hosts, we are forced to put
2002-01-31 02:12:17 +08:00
this offset in the reloc's section offset. */
1999-05-03 15:29:11 +08:00
BFD_RELOC_VTABLE_INHERIT,
BFD_RELOC_VTABLE_ENTRY,
2000-04-22 04:22:24 +08:00
2002-01-31 02:12:17 +08:00
/* Intel IA64 Relocations. */
2000-04-22 04:22:24 +08: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,
BFD_RELOC_IA64_PCREL21BI,
2000-04-22 04:22:24 +08:00
BFD_RELOC_IA64_PCREL21M,
BFD_RELOC_IA64_PCREL21F,
BFD_RELOC_IA64_PCREL22,
BFD_RELOC_IA64_PCREL60B,
BFD_RELOC_IA64_PCREL64I,
2000-04-22 04:22:24 +08: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,
BFD_RELOC_IA64_LTOFF_FPTR32MSB,
BFD_RELOC_IA64_LTOFF_FPTR32LSB,
2000-04-22 04:22:24 +08: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 21:12:53 +08:00
BFD_RELOC_IA64_LTOFF22X,
BFD_RELOC_IA64_LDXMOV,
BFD_RELOC_IA64_TPREL14,
2000-04-22 04:22:24 +08: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 21:12:53 +08:00
BFD_RELOC_IA64_TPREL64I,
2000-04-22 04:22:24 +08: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 21:12:53 +08: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,
/* Motorola 68HC11 reloc.
This is the 8 bit high part of an absolute address. */
BFD_RELOC_M68HC11_HI8,
/* Motorola 68HC11 reloc.
This is the 8 bit low part of an absolute address. */
BFD_RELOC_M68HC11_LO8,
/* Motorola 68HC11 reloc.
This is the 3 bit of a value. */
BFD_RELOC_M68HC11_3B,
/* 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,
/* These relocs are only used within the CRIS assembler. They are not
2002-01-31 02:12:17 +08:00
(at present) written to any object files. */
BFD_RELOC_CRIS_BDISP8,
BFD_RELOC_CRIS_UNSIGNED_5,
BFD_RELOC_CRIS_SIGNED_6,
BFD_RELOC_CRIS_UNSIGNED_6,
BFD_RELOC_CRIS_UNSIGNED_4,
2002-01-31 02:12:17 +08:00
/* Relocs used in ELF shared libraries for CRIS. */
BFD_RELOC_CRIS_COPY,
BFD_RELOC_CRIS_GLOB_DAT,
BFD_RELOC_CRIS_JUMP_SLOT,
BFD_RELOC_CRIS_RELATIVE,
2002-01-31 02:12:17 +08:00
/* 32-bit offset to symbol-entry within GOT. */
BFD_RELOC_CRIS_32_GOT,
2002-01-31 02:12:17 +08:00
/* 16-bit offset to symbol-entry within GOT. */
BFD_RELOC_CRIS_16_GOT,
2002-01-31 02:12:17 +08:00
/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_CRIS_32_GOTPLT,
2002-01-31 02:12:17 +08:00
/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
BFD_RELOC_CRIS_16_GOTPLT,
2002-01-31 02:12:17 +08:00
/* 32-bit offset to symbol, relative to GOT. */
BFD_RELOC_CRIS_32_GOTREL,
2002-01-31 02:12:17 +08:00
/* 32-bit offset to symbol with PLT entry, relative to GOT. */
BFD_RELOC_CRIS_32_PLT_GOTREL,
2002-01-31 02:12:17 +08:00
/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
BFD_RELOC_CRIS_32_PLT_PCREL,
2002-01-31 02:12:17 +08:00
/* Intel i860 Relocations. */
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 23:08:16 +08:00
2002-01-31 02:12:17 +08:00
/* OpenRISC Relocations. */
2001-04-24 23:08:16 +08:00
BFD_RELOC_OPENRISC_ABS_26,
BFD_RELOC_OPENRISC_REL_26,
2002-01-31 02:12:17 +08:00
/* H8 elf Relocations. */
BFD_RELOC_H8_DIR16A8,
BFD_RELOC_H8_DIR16R8,
BFD_RELOC_H8_DIR24A8,
BFD_RELOC_H8_DIR24R8,
BFD_RELOC_H8_DIR32A16,
Index: bfd/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> Corinna Vinschen <vinschen@redhat.com> * Makefile.am: Add support for xstormy16. * archures.c: Add support for xstormy16. * config.bfd: Add support for xstormy16. * configure.in: Add support for xstormy16. * reloc.c: Add support for xstormy16. * targets.c: Add support for xstormy16. * cpu-xstormy16.c: New file. * elf32-xstormy16.c: New file. * Makefile.in: Regenerated. * bfd-in2.h: Regenerated. * configure: Regenerated. * libbfd.h: Regenerated. Index: binutils/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * readelf.c (guess_is_rela): Add support for stormy16. (dump_relocations): Likewise. (get_machine_name): Likewise. Index: gas/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * configure.in: Add support for xstormy16. * configure: Regenerated. * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerated. * config/tc-xstormy16.c: New file. * config/tc-xstormy16.h: New file. Index: gas/testsuite/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> matthew green <mrg@redhat.com> * gas/xstormy16/allinsn.d: New file. * gas/xstormy16/allinsn.exp: New file. * gas/xstormy16/allinsn.s: New file. * gas/xstormy16/allinsn.sh: New file. * gas/xstormy16/gcc.d: New file. * gas/xstormy16/gcc.s: New file. * gas/xstormy16/gcc.sh: New file. * gas/xstormy16/reloc-1.d: New file. * gas/xstormy16/reloc-1.s: New file. * gas/xstormy16/reloc-2.d: New file. * gas/xstormy16/reloc-2.s: New file. Index: ld/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * Makefile.am: Add support for xstormy16. * configure.tgt: Add support for xstormy16. * Makefile.in: Regenerate. * emulparams/elf32xstormy16.sh: New file. * scripttempl/xstormy16.sc: New file. Index: opcodes/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerate. * configure.in: Add support for xstormy16. * configure: Regenerate. * disassemble.c: Add support for xstormy16. * xstormy16-asm.c: New generated file. * xstormy16-desc.c: New generated file. * xstormy16-desc.h: New generated file. * xstormy16-dis.c: New generated file. * xstormy16-ibld.c: New generated file. * xstormy16-opc.c: New generated file. * xstormy16-opc.h: New generated file. Index: include/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * dis-asm.h (print_insn_xstormy16): Declare. Index: include/elf/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * common.h (EM_XSTORMY16): Define. * xstormy16.h: New file.
2001-12-08 11:46:03 +08:00
2002-01-31 02:12:17 +08:00
/* Sony Xstormy16 Relocations. */
Index: bfd/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> Corinna Vinschen <vinschen@redhat.com> * Makefile.am: Add support for xstormy16. * archures.c: Add support for xstormy16. * config.bfd: Add support for xstormy16. * configure.in: Add support for xstormy16. * reloc.c: Add support for xstormy16. * targets.c: Add support for xstormy16. * cpu-xstormy16.c: New file. * elf32-xstormy16.c: New file. * Makefile.in: Regenerated. * bfd-in2.h: Regenerated. * configure: Regenerated. * libbfd.h: Regenerated. Index: binutils/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * readelf.c (guess_is_rela): Add support for stormy16. (dump_relocations): Likewise. (get_machine_name): Likewise. Index: gas/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * configure.in: Add support for xstormy16. * configure: Regenerated. * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerated. * config/tc-xstormy16.c: New file. * config/tc-xstormy16.h: New file. Index: gas/testsuite/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> matthew green <mrg@redhat.com> * gas/xstormy16/allinsn.d: New file. * gas/xstormy16/allinsn.exp: New file. * gas/xstormy16/allinsn.s: New file. * gas/xstormy16/allinsn.sh: New file. * gas/xstormy16/gcc.d: New file. * gas/xstormy16/gcc.s: New file. * gas/xstormy16/gcc.sh: New file. * gas/xstormy16/reloc-1.d: New file. * gas/xstormy16/reloc-1.s: New file. * gas/xstormy16/reloc-2.d: New file. * gas/xstormy16/reloc-2.s: New file. Index: ld/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * Makefile.am: Add support for xstormy16. * configure.tgt: Add support for xstormy16. * Makefile.in: Regenerate. * emulparams/elf32xstormy16.sh: New file. * scripttempl/xstormy16.sc: New file. Index: opcodes/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerate. * configure.in: Add support for xstormy16. * configure: Regenerate. * disassemble.c: Add support for xstormy16. * xstormy16-asm.c: New generated file. * xstormy16-desc.c: New generated file. * xstormy16-desc.h: New generated file. * xstormy16-dis.c: New generated file. * xstormy16-ibld.c: New generated file. * xstormy16-opc.c: New generated file. * xstormy16-opc.h: New generated file. Index: include/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * dis-asm.h (print_insn_xstormy16): Declare. Index: include/elf/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * common.h (EM_XSTORMY16): Define. * xstormy16.h: New file.
2001-12-08 11:46:03 +08:00
BFD_RELOC_XSTORMY16_REL_12,
BFD_RELOC_XSTORMY16_12,
Index: bfd/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> Corinna Vinschen <vinschen@redhat.com> * Makefile.am: Add support for xstormy16. * archures.c: Add support for xstormy16. * config.bfd: Add support for xstormy16. * configure.in: Add support for xstormy16. * reloc.c: Add support for xstormy16. * targets.c: Add support for xstormy16. * cpu-xstormy16.c: New file. * elf32-xstormy16.c: New file. * Makefile.in: Regenerated. * bfd-in2.h: Regenerated. * configure: Regenerated. * libbfd.h: Regenerated. Index: binutils/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * readelf.c (guess_is_rela): Add support for stormy16. (dump_relocations): Likewise. (get_machine_name): Likewise. Index: gas/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * configure.in: Add support for xstormy16. * configure: Regenerated. * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerated. * config/tc-xstormy16.c: New file. * config/tc-xstormy16.h: New file. Index: gas/testsuite/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> matthew green <mrg@redhat.com> * gas/xstormy16/allinsn.d: New file. * gas/xstormy16/allinsn.exp: New file. * gas/xstormy16/allinsn.s: New file. * gas/xstormy16/allinsn.sh: New file. * gas/xstormy16/gcc.d: New file. * gas/xstormy16/gcc.s: New file. * gas/xstormy16/gcc.sh: New file. * gas/xstormy16/reloc-1.d: New file. * gas/xstormy16/reloc-1.s: New file. * gas/xstormy16/reloc-2.d: New file. * gas/xstormy16/reloc-2.s: New file. Index: ld/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * Makefile.am: Add support for xstormy16. * configure.tgt: Add support for xstormy16. * Makefile.in: Regenerate. * emulparams/elf32xstormy16.sh: New file. * scripttempl/xstormy16.sc: New file. Index: opcodes/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * Makefile.am: Add support for xstormy16. * Makefile.in: Regenerate. * configure.in: Add support for xstormy16. * configure: Regenerate. * disassemble.c: Add support for xstormy16. * xstormy16-asm.c: New generated file. * xstormy16-desc.c: New generated file. * xstormy16-desc.h: New generated file. * xstormy16-dis.c: New generated file. * xstormy16-ibld.c: New generated file. * xstormy16-opc.c: New generated file. * xstormy16-opc.h: New generated file. Index: include/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> * dis-asm.h (print_insn_xstormy16): Declare. Index: include/elf/ChangeLog 2001-12-07 Geoffrey Keating <geoffk@redhat.com> Richard Henderson <rth@redhat.com> * common.h (EM_XSTORMY16): Define. * xstormy16.h: New file.
2001-12-08 11:46:03 +08:00
BFD_RELOC_XSTORMY16_24,
BFD_RELOC_XSTORMY16_FPTR16,
/* Relocations used by VAX ELF. */
BFD_RELOC_VAX_GLOB_DAT,
BFD_RELOC_VAX_JMP_SLOT,
BFD_RELOC_VAX_RELATIVE,
2002-12-31 03:25:13 +08:00
/* msp430 specific relocation codes */
BFD_RELOC_MSP430_10_PCREL,
BFD_RELOC_MSP430_16_PCREL,
BFD_RELOC_MSP430_16,
BFD_RELOC_MSP430_16_PCREL_BYTE,
BFD_RELOC_MSP430_16_BYTE,
/* IQ2000 Relocations. */
BFD_RELOC_IQ2000_OFFSET_16,
BFD_RELOC_IQ2000_OFFSET_21,
BFD_RELOC_IQ2000_UHI16,
2003-04-01 23:50:31 +08:00
/* Special Xtensa relocation used only by PLT entries in ELF shared
objects to indicate that the runtime linker should set the value
to one of its own internal functions or data structures. */
BFD_RELOC_XTENSA_RTLD,
/* Xtensa relocations for ELF shared objects. */
BFD_RELOC_XTENSA_GLOB_DAT,
BFD_RELOC_XTENSA_JMP_SLOT,
BFD_RELOC_XTENSA_RELATIVE,
/* Xtensa relocation used in ELF object files for symbols that may require
PLT entries. Otherwise, this is just a generic 32-bit relocation. */
BFD_RELOC_XTENSA_PLT,
/* Generic Xtensa relocations. Only the operand number is encoded
in the relocation. The details are determined by extracting the
instruction opcode. */
BFD_RELOC_XTENSA_OP0,
BFD_RELOC_XTENSA_OP1,
BFD_RELOC_XTENSA_OP2,
/* Xtensa relocation to mark that the assembler expanded the
2003-04-01 23:50:31 +08:00
instructions from an original target. The expansion size is
encoded in the reloc size. */
BFD_RELOC_XTENSA_ASM_EXPAND,
/* Xtensa relocation to mark that the linker should simplify
assembler-expanded instructions. This is commonly used
internally by the linker after analysis of a
2003-04-01 23:50:31 +08:00
BFD_RELOC_XTENSA_ASM_EXPAND. */
BFD_RELOC_XTENSA_ASM_SIMPLIFY,
1999-05-03 15:29:11 +08:00
BFD_RELOC_UNUSED };
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
2003-06-29 18:06:40 +08:00
reloc_howto_type *bfd_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
1999-05-03 15:29:11 +08:00
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from syms.c. */
1999-05-03 15:29:11 +08:00
typedef struct symbol_cache_entry
{
2002-01-31 02:12:17 +08: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. */
2002-01-31 02:12:17 +08:00
/* The text of the symbol. The name is left alone, and not copied; the
application may not alter it. */
const char *name;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
symvalue value;
2002-01-31 02:12:17 +08:00
/* Attributes of a symbol. */
1999-05-03 15:29:11 +08:00
#define BSF_NO_FLAGS 0x00
2002-01-31 02:12:17 +08:00
/* The symbol has local scope; <<static>> in <<C>>. The value
is the offset into the section of the data. */
1999-05-03 15:29:11 +08:00
#define BSF_LOCAL 0x01
2002-01-31 02:12:17 +08:00
/* The symbol has global scope; initialized data in <<C>>. The
value is the offset into the section of the data. */
1999-05-03 15:29:11 +08:00
#define BSF_GLOBAL 0x02
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* A normal C symbol would be one of:
<<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
<<BSF_GLOBAL>>. */
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* The symbol is a debugging record. The value has an arbitary
meaning, unless BSF_DEBUGGING_RELOC is also set. */
1999-05-03 15:29:11 +08:00
#define BSF_DEBUGGING 0x08
2002-01-31 02:12:17 +08:00
/* The symbol denotes a function entry point. Used in ELF,
perhaps others someday. */
1999-05-03 15:29:11 +08:00
#define BSF_FUNCTION 0x10
2002-01-31 02:12:17 +08:00
/* Used by the linker. */
1999-05-03 15:29:11 +08:00
#define BSF_KEEP 0x20
#define BSF_KEEP_G 0x40
2002-01-31 02:12:17 +08:00
/* A weak global symbol, overridable without warnings by
a regular global symbol of the same name. */
1999-05-03 15:29:11 +08:00
#define BSF_WEAK 0x80
2002-01-31 02:12:17 +08:00
/* This symbol was created to point to a section, e.g. ELF's
STT_SECTION symbols. */
1999-05-03 15:29:11 +08:00
#define BSF_SECTION_SYM 0x100
2002-01-31 02:12:17 +08:00
/* The symbol used to be a common symbol, but now it is
allocated. */
1999-05-03 15:29:11 +08:00
#define BSF_OLD_COMMON 0x200
2002-01-31 02:12:17 +08:00
/* The default value for common data. */
1999-05-03 15:29:11 +08:00
#define BFD_FORT_COMM_DEFAULT_VALUE 0
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
#define BSF_NOT_AT_END 0x400
2002-01-31 02:12:17 +08:00
/* Signal that the symbol is the label of constructor section. */
1999-05-03 15:29:11 +08:00
#define BSF_CONSTRUCTOR 0x800
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
#define BSF_WARNING 0x1000
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
#define BSF_INDIRECT 0x2000
2002-01-31 02:12:17 +08:00
/* BSF_FILE marks symbols that contain a file name. This is used
for ELF STT_FILE symbols. */
1999-05-03 15:29:11 +08:00
#define BSF_FILE 0x4000
2002-01-31 02:12:17 +08:00
/* Symbol is from dynamic linking information. */
1999-05-03 15:29:11 +08:00
#define BSF_DYNAMIC 0x8000
2002-01-31 02:12:17 +08:00
/* The symbol denotes a data object. Used in ELF, and perhaps
others someday. */
1999-05-03 15:29:11 +08:00
#define BSF_OBJECT 0x10000
2002-01-31 02:12:17 +08: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. */
#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 21:12:53 +08:00
/* This symbol is thread local. Used in ELF. */
#define BSF_THREAD_LOCAL 0x40000
1999-05-03 15:29:11 +08:00
flagword flags;
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
struct sec *section;
2002-01-31 02:12:17 +08:00
/* Back end special data. */
1999-05-03 15:29:11 +08:00
union
{
2003-06-29 18:06:40 +08:00
void *p;
1999-05-03 15:29:11 +08:00
bfd_vma i;
2002-01-31 02:12:17 +08:00
}
udata;
}
asymbol;
1999-05-03 15:29:11 +08:00
#define bfd_get_symtab_upper_bound(abfd) \
BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
2002-01-31 02:12:17 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
1999-05-03 15:29:11 +08:00
#define bfd_is_local_label_name(abfd, name) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
2002-01-31 02:12:17 +08:00
1999-05-03 15:29:11 +08:00
#define bfd_canonicalize_symtab(abfd, location) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
2002-01-31 02:12:17 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_symtab
(bfd *abfd, asymbol **location, unsigned int count);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
1999-05-03 15:29:11 +08:00
#define bfd_make_empty_symbol(abfd) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
2002-01-31 02:12:17 +08:00
2003-06-29 18:06:40 +08:00
asymbol *_bfd_generic_make_empty_symbol (bfd *);
2002-01-06 15:30:35 +08:00
1999-05-03 15:29:11 +08:00
#define bfd_make_debug_symbol(abfd,ptr,size) \
2003-06-29 18:06:40 +08:00
BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
2002-01-31 02:12:17 +08:00
2003-06-29 18:06:40 +08:00
int bfd_decode_symclass (asymbol *symbol);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_is_undefined_symclass (int symclass);
2003-06-29 18:06:40 +08:00
void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_copy_private_symbol_data
(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
1999-05-03 15:29:11 +08:00
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
2003-06-29 18:06:40 +08:00
BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
(ibfd, isymbol, obfd, osymbol))
2002-01-31 02:12:17 +08:00
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from bfd.c. */
struct bfd
1999-05-03 15:29:11 +08:00
{
/* A unique identifier of the BFD */
unsigned int id;
2002-01-31 02:12:17 +08:00
/* The filename the application opened the BFD with. */
const char *filename;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* A pointer to the target jump table. */
const struct bfd_target *xvec;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08: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. */
2003-06-29 18:06:40 +08:00
void *iostream;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Is the file descriptor being cached? That is, can it be closed as
needed, and re-opened when accessed later? */
bfd_boolean cacheable;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08: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. */
bfd_boolean target_defaulted;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* The caching routines use these to maintain a
least-recently-used list of BFDs. */
struct bfd *lru_prev, *lru_next;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* When a file is closed by the caching routines, BFD retains
state information on the file here... */
ufile_ptr where;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* ... and here: (``once'' means at least once). */
bfd_boolean opened_once;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Set if we have a locally maintained mtime value, rather than
getting it from the file each time. */
bfd_boolean mtime_set;
1999-05-03 15:29:11 +08:00
/* File modified time, if mtime_set is TRUE. */
2002-01-31 02:12:17 +08:00
long mtime;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Reserved for an unimplemented file locking extension. */
int ifd;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* The format which belongs to the BFD. (object, core, etc.) */
bfd_format format;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Remember when output has begun, to stop strange things
from happening. */
bfd_boolean output_has_begun;
hash bfd sections for fast lookup and create. bfd/ChangeLog * bfd.c (struct _bfd): Add section_htab, section_tail. * libbfd-in.h (_bfd_delete_bfd): Declare. (bfd_section_hash_newfunc): Declare. * opncls.c (_bfd_new_bfd): Free memory on failure. Init section_htab and section_tail. (_bfd_delete_bfd): New function. (bfd_openr): Use it. (bfd_fdopenr): Likewise. (bfd_openstreamr): Likewise. (bfd_openw): Likewise. (bfd_close): Likewise. (bfd_close_all_done): Likewise. (bfd_release): Comment. * section.c (struct section_hash_entry): New. (bfd_section_hash_newfunc): New function. (section_hash_lookup): Define. (bfd_section_init): New function, split out from bfd_make_section_anyway. (bfd_get_section_by_name): Lookup via hash table. (bfd_get_unique_section_name): Likewise. (bfd_make_section_old_way): Rewrite to use hash table. (bfd_make_section_anyway): Likewise. (bfd_make_section): Likewise. Return NULL for attempts to make BFD_{ABS,COM,UND,IND}_SECTION_NAME. (_bfd_strip_section_from_output): Adjust section_tail if needed. * configure.in: Bump bfd version. * configure: Regenerate. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. ld/ChangeLog * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust section_tail when fiddling with section list. (gld${EMULATION_NAME}_list_options): Ensure sentences aren't broken into separate strings to make translation easier. * emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when fiddling with section list. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
2001-12-17 08:40:53 +08:00
2002-01-31 02:12:17 +08:00
/* A hash table for section names. */
struct bfd_hash_table section_htab;
hash bfd sections for fast lookup and create. bfd/ChangeLog * bfd.c (struct _bfd): Add section_htab, section_tail. * libbfd-in.h (_bfd_delete_bfd): Declare. (bfd_section_hash_newfunc): Declare. * opncls.c (_bfd_new_bfd): Free memory on failure. Init section_htab and section_tail. (_bfd_delete_bfd): New function. (bfd_openr): Use it. (bfd_fdopenr): Likewise. (bfd_openstreamr): Likewise. (bfd_openw): Likewise. (bfd_close): Likewise. (bfd_close_all_done): Likewise. (bfd_release): Comment. * section.c (struct section_hash_entry): New. (bfd_section_hash_newfunc): New function. (section_hash_lookup): Define. (bfd_section_init): New function, split out from bfd_make_section_anyway. (bfd_get_section_by_name): Lookup via hash table. (bfd_get_unique_section_name): Likewise. (bfd_make_section_old_way): Rewrite to use hash table. (bfd_make_section_anyway): Likewise. (bfd_make_section): Likewise. Return NULL for attempts to make BFD_{ABS,COM,UND,IND}_SECTION_NAME. (_bfd_strip_section_from_output): Adjust section_tail if needed. * configure.in: Bump bfd version. * configure: Regenerate. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. ld/ChangeLog * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust section_tail when fiddling with section list. (gld${EMULATION_NAME}_list_options): Ensure sentences aren't broken into separate strings to make translation easier. * emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when fiddling with section list. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
2001-12-17 08:40:53 +08:00
2002-01-31 02:12:17 +08:00
/* Pointer to linked list of sections. */
struct sec *sections;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* The place where we add to the section list. */
struct sec **section_tail;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* The number of sections. */
unsigned int section_count;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Stuff only useful for object files:
The start address. */
bfd_vma start_address;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Used for input and output. */
unsigned int symcount;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Symbol table for output BFD (with symcount entries). */
struct symbol_cache_entry **outsymbols;
1999-05-03 15:29:11 +08:00
/* Used for slurped dynamic symbol tables. */
unsigned int dynsymcount;
2002-01-31 02:12:17 +08:00
/* Pointer to structure which contains architecture information. */
const struct bfd_arch_info *arch_info;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Stuff only useful for archives. */
2003-06-29 18:06:40 +08:00
void *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. */
bfd_boolean has_armap;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* A chain of BFD structures involved in a link. */
struct bfd *link_next;
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Used by the back end to hold private data. */
union
{
1999-05-03 15:29:11 +08: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 23:20:14 +08:00
struct mmo_data_struct *mmo_data;
1999-05-03 15:29:11 +08: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 21:26:29 +08: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;
2003-06-29 18:06:40 +08:00
void *any;
2002-01-31 02:12:17 +08:00
}
tdata;
2002-01-31 02:12:17 +08:00
/* Used by the application to hold private data. */
2003-06-29 18:06:40 +08:00
void *usrdata;
1999-05-03 15:29:11 +08:00
/* Where all the allocated stuff under this BFD goes. This is a
2003-06-29 18:06:40 +08:00
struct objalloc *, but we use void * to avoid requiring the inclusion
of objalloc.h. */
void *memory;
1999-05-03 15:29:11 +08:00
};
typedef enum bfd_error
{
bfd_error_no_error = 0,
bfd_error_system_call,
bfd_error_invalid_target,
bfd_error_wrong_format,
bfd_error_wrong_object_format,
1999-05-03 15:29:11 +08: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-31 02:12:17 +08:00
}
bfd_error_type;
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_error_type bfd_get_error (void);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_set_error (bfd_error_type error_tag);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const char *bfd_errmsg (bfd_error_type error_tag);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_perror (const char *message);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
typedef void (*bfd_error_handler_type) (const char *, ...);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_set_error_program_name (const char *);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_error_handler_type bfd_get_error_handler (void);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const char *bfd_archive_filename (bfd *);
* bfd.c (bfd_archive_filename): New function. * bfd-in2.h: Regenerate. * aout-adobe.c: Replace bfd_get_filename with bfd_archive_filename in error messages where the bfd is an input bfd. * aout-cris.c: Likewise. * coff-arm.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * ecofflink.c: Likewise. * elf-hppa.h: Likewise. * elf.c: Likewise. * elf32-arm.h: Likewise. * elf32-cris.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-sparc.c: Likewise. * elf32-v850.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.h: Likewise. * elfxx-ia64.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peicode.h: Likewise. * srec.c: Likewise. * xcofflink.c: Likewise. * elf32-arm.h: Make _bfd_error_handler calls K&R compatible. * elflink.c (_bfd_elf_create_linker_section): Better grammar for error message. * coff-mcore.c (coff_mcore_relocate_section): Internalionalise error message. * elf64-sparc.c (sparc64_elf_add_symbol_hook): Constify stt_types. Consolidate error messages, and split long messages to two lines.
2001-09-21 07:30:37 +08:00
2003-06-29 18:06:40 +08:00
long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
long bfd_canonicalize_reloc
(bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_set_reloc
(bfd *abfd, asection *sec, arelent **rel, unsigned int count);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
int bfd_get_arch_size (bfd *abfd);
2003-06-29 18:06:40 +08:00
int bfd_get_sign_extend_vma (bfd *abfd);
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
unsigned int bfd_get_gp_size (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
void bfd_set_gp_size (bfd *abfd, unsigned int i);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
1999-05-03 15:29:11 +08:00
#define bfd_copy_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
(ibfd, obfd))
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
1999-05-03 15:29:11 +08:00
#define bfd_merge_private_bfd_data(ibfd, obfd) \
BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
(ibfd, obfd))
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
1999-05-03 15:29:11 +08:00
#define bfd_set_private_flags(abfd, flags) \
BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
1999-05-03 15:29:11 +08:00
#define bfd_sizeof_headers(abfd, reloc) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
1999-05-03 15:29:11 +08:00
#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))
1999-05-03 15:29:11 +08:00
#define bfd_debug_info_start(abfd) \
BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
1999-05-03 15:29:11 +08:00
#define bfd_debug_info_end(abfd) \
BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
1999-05-03 15:29:11 +08:00
#define bfd_debug_info_accumulate(abfd, section) \
BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
1999-05-03 15:29:11 +08:00
#define bfd_stat_arch_elt(abfd, stat) \
BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
1999-05-03 15:29:11 +08:00
#define bfd_update_armap_timestamp(abfd) \
BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
1999-05-03 15:29:11 +08:00
#define bfd_set_arch_mach(abfd, arch, mach)\
BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
1999-05-03 15:29:11 +08:00
#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 20:23:48 +08:00
#define bfd_merge_sections(abfd, link_info) \
BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
#define bfd_discard_group(abfd, sec) \
BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
1999-05-03 15:29:11 +08:00
#define bfd_link_hash_table_create(abfd) \
BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
2002-04-04 Daniel Jacobowitz <drow@mvista.com> * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define. * aout-target.h (MY_bfd_link_hash_table_free): Conditionally define. * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise. * bfd.c (bfd_link_hash_table_free): Define. * binary.c (binary_bfd_link_hash_table_free): Define. * bout.c (b_out_bfd_link_hash_table_free): Define. * coff-rs6000.c (rs6000coff_vec): Include _bfd_generic_link_hash_table_free. (pmac_xcoff_vec): Likewise. * coff64-rs6000.c (rs6000coff64_vec): Likewise. (aix5coff64_vec): Likewise. * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define. * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally define. * i386msdos.c (msdos_bfd_link_hash_table_free): Define. * i386os9k.c (os9k_bfd_link_hash_table_free): Define. * ieee.c (ieee_bfd_link_hash_table_free): Define. * ihex.c (ihex_bfd_link_hash_table_free): Define. * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define. (_bfd_generic_link_hash_table_free): Add prototype. * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype. * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define. * linker.c (_bfd_generic_link_hash_table_free): New function. * mmo.c (mmo_bfd_link_hash_table_free): Define. * nlm-target.h (nlm_bfd_link_hash_table_free): Define. * oasys.c (oasys_bfd_link_hash_table_free): Define. * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define. * som.c (som_bfd_link_hash_table_free): Define. * srec.c (srec_bfd_link_hash_table_free): Define. * tekhex.c (tekhex_bfd_link_hash_table_free): Define. * versados.c (versados_bfd_link_hash_table_free): Define. * vms.c (vms_bfd_link_hash_table_free): New function. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function. * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc instead of bfd_alloc. * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise. * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise. * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. * elf.c (_bfd_elf_link_hash_table_create): Likewise. * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise. * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. * elf32-sh.c (sh_elf_link_hash_table_create): Likewise. * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise. * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise. * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. * linker.c (_bfd_generic_link_hash_table_create): Likewise. * m68klinux.c (linux_link_hash_table_create): Likewise. * sparclinux.c (linux_link_hash_table_create): Likewise. * sunos.c (sunos_link_hash_table_create): Likewise. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. * targets.c: Add _bfd_link_hash_table_free to xvec. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate.
2002-04-05 03:53:38 +08:00
#define bfd_link_hash_table_free(abfd, hash) \
BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
1999-05-03 15:29:11 +08:00
#define bfd_link_add_symbols(abfd, info) \
BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
Fix ld --just-symbols * aix5ppc-core.c: Warning fixes. * aout-adobe.c (aout_32_bfd_link_just_syms): Define. * aout-target.h (MY_bfd_link_just_syms): Define. * aout-tic30.c (MY_bfd_link_just_syms): Define. * bfd.c (bfd_link_just_syms): Define. * binary.c (binary_bfd_link_just_syms): Define. * bout.c (b_out_bfd_link_just_syms): Define. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer. * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. * coffcode.h (coff_bfd_link_just_syms): Define. * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS. (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS. (_bfd_elf_link_just_syms): Declare. * elf.c (_bfd_elf_link_just_syms): New function. * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that sections haven't already been discarded by the linker. * elflink.h (elf_link_add_object_symbols): Likewise for stab sections and SEC_MERGE sections. (elf_bfd_discard_info): Similarly here. * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define. * i386msdos.c (msdos_bfd_link_just_syms): Define. * i386os9k.c (os9k_bfd_link_just_syms): Define. * ieee.c (ieee_bfd_link_just_syms): Define. * ihex.c (ihex_bfd_link_just_syms): Define. * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define. (_bfd_generic_link_just_syms): Declare. * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define. * linker.c (_bfd_generic_link_just_syms): New function. * mmo.c (mmo_bfd_link_just_syms): Define. * nlm-target.h (nlm_bfd_link_just_syms): Define. * oasys.c (oasys_bfd_link_just_syms): Define. * ppcboot.c (ppcboot_bfd_link_just_syms): Define. * som.c (som_bfd_link_just_syms): Define. * srec.c (srec_bfd_link_just_syms): Define. * targets.c (struct bfd_target): Add _bfd_link_just_syms. (BFD_JUMP_TABLE_LINK): And here. * tekhex.c (tekhex_bfd_link_just_syms): Define. * versados.c (versados_bfd_link_just_syms): Define. * vms.c (vms_bfd_link_just_syms): Define. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate.
2002-05-15 08:18:58 +08:00
#define bfd_link_just_syms(sec, info) \
BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
1999-05-03 15:29:11 +08: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
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
bfd_boolean, asymbol **);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
struct bfd_preserve
{
2003-06-29 18:06:40 +08:00
void *marker;
void *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;
};
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
2003-06-29 18:06:40 +08:00
void bfd_preserve_restore (bfd *, struct bfd_preserve *);
2003-06-29 18:06:40 +08:00
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from archive.c. */
2003-06-29 18:06:40 +08:00
symindex bfd_get_next_mapent
(bfd *abfd, symindex previous, carsym **sym);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
1999-05-03 15:29:11 +08:00
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from corefile.c. */
2003-06-29 18:06:40 +08:00
const char *bfd_core_file_failing_command (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
int bfd_core_file_failing_signal (bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
1999-05-03 15:29:11 +08:00
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from targets.c. */
1999-05-03 15:29:11 +08:00
#define BFD_SEND(bfd, message, arglist) \
2003-06-29 18:06:40 +08:00
((*((bfd)->xvec->message)) arglist)
1999-05-03 15:29:11 +08:00
#ifdef DEBUG_BFD_SEND
#undef BFD_SEND
#define BFD_SEND(bfd, message, arglist) \
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
((*((bfd)->xvec->message)) arglist) : \
(bfd_assert (__FILE__,__LINE__), NULL))
#endif
#define BFD_SEND_FMT(bfd, message, arglist) \
2003-06-29 18:06:40 +08:00
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
1999-05-03 15:29:11 +08:00
#ifdef DEBUG_BFD_SEND
#undef BFD_SEND_FMT
#define BFD_SEND_FMT(bfd, message, arglist) \
(((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
2000-12-22 02:20:04 +08:00
(((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
1999-05-03 15:29:11 +08:00
(bfd_assert (__FILE__,__LINE__), NULL))
#endif
2002-01-31 02:12:17 +08:00
enum bfd_flavour
{
1999-05-03 15:29:11 +08:00
bfd_target_unknown_flavour,
bfd_target_aout_flavour,
bfd_target_coff_flavour,
bfd_target_ecoff_flavour,
bfd_target_xcoff_flavour,
1999-05-03 15:29:11 +08: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 23:20:14 +08:00
bfd_target_evax_flavour,
2002-11-06 21:26:29 +08: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 15:29:11 +08:00
};
enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
/* Forward declaration. */
1999-05-03 15:29:11 +08:00
typedef struct bfd_link_info _bfd_link_info;
typedef struct bfd_target
{
2002-01-31 02:12:17 +08:00
/* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */
1999-05-03 15:29:11 +08:00
char *name;
2002-01-31 02:12:17 +08:00
/* The "flavour" of a back end is a general indication about
the contents of a file. */
1999-05-03 15:29:11 +08:00
enum bfd_flavour flavour;
2002-01-31 02:12:17 +08:00
/* The order of bytes within the data area of a file. */
1999-05-03 15:29:11 +08:00
enum bfd_endian byteorder;
2002-01-31 02:12:17 +08:00
/* The order of bytes within the header parts of a file. */
1999-05-03 15:29:11 +08:00
enum bfd_endian header_byteorder;
2002-01-31 02:12:17 +08: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-22 02:20:04 +08:00
flagword object_flags;
2002-01-31 02:12:17 +08: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 15:29:11 +08:00
flagword section_flags;
2002-01-31 02:12:17 +08:00
/* The character normally found at the front of a symbol.
(if any), perhaps `_'. */
1999-05-03 15:29:11 +08:00
char symbol_leading_char;
2002-01-31 02:12:17 +08:00
/* The pad character for file names within an archive header. */
2000-12-22 02:20:04 +08:00
char ar_pad_char;
2002-01-31 02:12:17 +08:00
/* The maximum number of characters in an archive header. */
1999-05-03 15:29:11 +08:00
unsigned short ar_max_namelen;
2002-01-31 02:12:17 +08: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. */
2003-06-29 18:06:40 +08:00
bfd_vma (*bfd_getx64) (const bfd_byte *);
bfd_signed_vma (*bfd_getx_signed_64) (const bfd_byte *);
void (*bfd_putx64) (bfd_vma, bfd_byte *);
bfd_vma (*bfd_getx32) (const bfd_byte *);
bfd_signed_vma (*bfd_getx_signed_32) (const bfd_byte *);
void (*bfd_putx32) (bfd_vma, bfd_byte *);
bfd_vma (*bfd_getx16) (const bfd_byte *);
bfd_signed_vma (*bfd_getx_signed_16) (const bfd_byte *);
void (*bfd_putx16) (bfd_vma, bfd_byte *);
2002-01-31 02:12:17 +08:00
/* Byte swapping for the headers. */
2003-06-29 18:06:40 +08:00
bfd_vma (*bfd_h_getx64) (const bfd_byte *);
bfd_signed_vma (*bfd_h_getx_signed_64) (const bfd_byte *);
void (*bfd_h_putx64) (bfd_vma, bfd_byte *);
bfd_vma (*bfd_h_getx32) (const bfd_byte *);
bfd_signed_vma (*bfd_h_getx_signed_32) (const bfd_byte *);
void (*bfd_h_putx32) (bfd_vma, bfd_byte *);
bfd_vma (*bfd_h_getx16) (const bfd_byte *);
bfd_signed_vma (*bfd_h_getx_signed_16) (const bfd_byte *);
void (*bfd_h_putx16) (bfd_vma, bfd_byte *);
2002-01-31 02:12:17 +08: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. */
2003-06-29 18:06:40 +08:00
const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
2002-01-31 02:12:17 +08:00
/* Set the format of a file being written. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
2002-01-31 02:12:17 +08:00
/* Write cached information into a file being written, at <<bfd_close>>. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Generic entry points. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_GENERIC(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_close_and_cleanup, \
NAME##_bfd_free_cached_info, \
NAME##_new_section_hook, \
NAME##_get_section_contents, \
NAME##_get_section_contents_in_window
1999-05-03 15:29:11 +08:00
/* Called when the BFD is being closed to do any necessary cleanup. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_close_and_cleanup) (bfd *);
/* Ask the BFD to free all cached information. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_free_cached_info) (bfd *);
/* Called when a new section is created. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
/* Read the contents of a section. */
bfd_boolean (*_bfd_get_section_contents)
2003-06-29 18:06:40 +08:00
(bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
bfd_boolean (*_bfd_get_section_contents_in_window)
2003-06-29 18:06:40 +08:00
(bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
1999-05-03 15:29:11 +08:00
/* Entry points to copy private data. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_COPY(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_bfd_copy_private_bfd_data, \
NAME##_bfd_merge_private_bfd_data, \
NAME##_bfd_copy_private_section_data, \
NAME##_bfd_copy_private_symbol_data, \
NAME##_bfd_set_private_flags, \
NAME##_bfd_print_private_bfd_data
/* Called to copy BFD general private data from one object file
1999-05-03 15:29:11 +08:00
to another. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
/* Called to merge BFD general private data from one object file
1999-05-03 15:29:11 +08:00
to a common output file when linking. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
/* Called to copy BFD private section data from one object file
1999-05-03 15:29:11 +08:00
to another. */
bfd_boolean (*_bfd_copy_private_section_data)
2003-06-29 18:06:40 +08:00
(bfd *, sec_ptr, bfd *, sec_ptr);
2000-12-22 02:20:04 +08:00
/* Called to copy BFD private symbol data from one symbol
1999-05-03 15:29:11 +08:00
to another. */
bfd_boolean (*_bfd_copy_private_symbol_data)
2003-06-29 18:06:40 +08:00
(bfd *, asymbol *, bfd *, asymbol *);
2002-01-31 02:12:17 +08:00
/* Called to set private backend flags. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
1999-05-03 15:29:11 +08:00
2002-01-31 02:12:17 +08:00
/* Called to print private BFD data. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
1999-05-03 15:29:11 +08:00
/* Core file entry points. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_CORE(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_core_file_failing_command, \
NAME##_core_file_failing_signal, \
NAME##_core_file_matches_executable_p
char * (*_core_file_failing_command) (bfd *);
int (*_core_file_failing_signal) (bfd *);
bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
1999-05-03 15:29:11 +08:00
/* Archive entry points. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_slurp_armap, \
NAME##_slurp_extended_name_table, \
NAME##_construct_extended_name_table, \
NAME##_truncate_arname, \
NAME##_write_armap, \
NAME##_read_ar_hdr, \
NAME##_openr_next_archived_file, \
NAME##_get_elt_at_index, \
NAME##_generic_stat_arch_elt, \
NAME##_update_armap_timestamp
bfd_boolean (*_bfd_slurp_armap) (bfd *);
bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
bfd_boolean (*_bfd_construct_extended_name_table)
2003-06-29 18:06:40 +08:00
(bfd *, char **, bfd_size_type *, const char **);
void (*_bfd_truncate_arname) (bfd *, const char *, char *);
bfd_boolean (*write_armap)
2003-06-29 18:06:40 +08:00
(bfd *, unsigned int, struct orl *, unsigned int, int);
void * (*_bfd_read_ar_hdr_fn) (bfd *);
bfd * (*openr_next_archived_file) (bfd *, bfd *);
#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
1999-12-11 02:51:35 +08:00
/* Entry points used for symbols. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_get_symtab_upper_bound, \
Index: doc/ChangeLog 2003-10-15 Andrew Cagney <cagney@redhat.com> * bfdint.texi (BFD target vector symbols): Rename _get_symtab to _canonicalize_symtab. 2003-10-15 Andrew Cagney <cagney@redhat.com> * targets.c (BFD_JUMP_TABLE_SYMBOLS): Replace NAME##_get_symtab with NAME##_canonicalize_symtab. * libcoff-in.h (coff_canonicalize_symtab): Update. * xsym.h (bfd_sym_canonicalize_symtab): Update. * elf-bfd.h (_bfd_elf_canonicalize_symtab): Update. * coffgen.c (coff_canonicalize_symtab): Update. * libbfd-in.h (_bfd_nosymbols_canonicalize_symtab): Update. * libnlm.h (nlmNAME(canonicalize_symtab)): Update. * ieee.c (ieee_vec): Update comment. * libecoff.h (_bfd_ecoff_canonicalize_symtab): Update. * mmo.c (mmo_canonicalize_symtab): Update. * nlm-target.h (nlm_canonicalize_symtab): Update. * nlmcode.h (nlm_canonicalize_symtab): Update. * i386msdos.c (msdos_canonicalize_symtab): Update. * hp300hpux.c (MY (canonicalize_symtab)): Update. * oasys.c (oasys_canonicalize_symtab): Update. * som.c (som_canonicalize_symtab): Update. * pef.c (bfd_pef_canonicalize_symtab): Update. * nlmcode.h (nlm_canonicalize_symtab): Update. * xsym.c (bfd_sym_canonicalize_symtab): Update. * vms.c (vms_canonicalize_symtab): Update. * versados.c (versados_canonicalize_symtab): Update. * mach-o.c (bfd_mach_o_canonicalize_symtab): Update. * ieee.c (ieee_canonicalize_symtab): Update. * pdp11.c (NAME(aout,canonicalize_symtab)): Update. * reloc.c: Update comment. * libaout.h (NAME(aout,canonicalize_symtab)): Update. * coff64-rs6000.c (aix5coff64_vec): Update. * coff64-rs6000.c (bfd_xcoff_aix5_backend_data): Update. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update. * aoutx.h (NAME(aout,canonicalize_symtab)): Update. * elfxx-target.h (bfd_elfNN_canonicalize_symtab): Update. * hp300hpux.c (MY_canonicalize_symtab): Update. * ecoff.c (_bfd_ecoff_canonicalize_symtab): Update. * aout-tic30.c (MY_canonicalize_symtab): Update. * aout-target.h (MY_canonicalize_symtab): Update. * ppcboot.c (ppcboot_canonicalize_symtab): Update. * elf.c (_bfd_elf_canonicalize_symtab): Update. * elfcode.h (elf_canonicalize_symtab): Update. * ihex.c (ihex_canonicalize_symtab): Update. * tekhex.c (tekhex_canonicalize_symtab): Update. * binary.c (binary_canonicalize_symtab): Update. * srec.c (srec_canonicalize_symtab): Update.
2003-10-16 12:11:10 +08:00
NAME##_canonicalize_symtab, \
2003-06-29 18:06:40 +08:00
NAME##_make_empty_symbol, \
NAME##_print_symbol, \
NAME##_get_symbol_info, \
NAME##_bfd_is_local_label_name, \
NAME##_get_lineno, \
NAME##_find_nearest_line, \
NAME##_bfd_make_debug_symbol, \
NAME##_read_minisymbols, \
NAME##_minisymbol_to_symbol
long (*_bfd_get_symtab_upper_bound) (bfd *);
long (*_bfd_canonicalize_symtab)
(bfd *, struct symbol_cache_entry **);
struct symbol_cache_entry *
2003-06-29 18:06:40 +08:00
(*_bfd_make_empty_symbol) (bfd *);
void (*_bfd_print_symbol)
2003-06-29 18:06:40 +08:00
(bfd *, void *, struct symbol_cache_entry *, bfd_print_symbol_type);
#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
void (*_bfd_get_symbol_info)
2003-06-29 18:06:40 +08:00
(bfd *, struct symbol_cache_entry *, symbol_info *);
#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
alent * (*_get_lineno) (bfd *, struct symbol_cache_entry *);
bfd_boolean (*_bfd_find_nearest_line)
2003-06-29 18:06:40 +08:00
(bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma,
const char **, const char **, unsigned int *);
/* Back-door to allow format-aware applications to create debug symbols
1999-05-03 15:29:11 +08:00
while using BFD for everything else. Currently used by the assembler
when creating COFF files. */
asymbol * (*_bfd_make_debug_symbol)
2003-06-29 18:06:40 +08:00
(bfd *, void *, unsigned long size);
1999-05-03 15:29:11 +08:00
#define bfd_read_minisymbols(b, d, m, s) \
BFD_SEND (b, _read_minisymbols, (b, d, m, s))
long (*_read_minisymbols)
2003-06-29 18:06:40 +08:00
(bfd *, bfd_boolean, void **, unsigned int *);
1999-05-03 15:29:11 +08:00
#define bfd_minisymbol_to_symbol(b, d, m, f) \
BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
asymbol * (*_minisymbol_to_symbol)
2003-06-29 18:06:40 +08:00
(bfd *, bfd_boolean, const void *, asymbol *);
1999-05-03 15:29:11 +08:00
/* Routines for relocs. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_RELOCS(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_get_reloc_upper_bound, \
NAME##_canonicalize_reloc, \
NAME##_bfd_reloc_type_lookup
long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
long (*_bfd_canonicalize_reloc)
2003-06-29 18:06:40 +08:00
(bfd *, sec_ptr, arelent **, struct symbol_cache_entry **);
/* See documentation on reloc types. */
1999-05-03 15:29:11 +08:00
reloc_howto_type *
2003-06-29 18:06:40 +08:00
(*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
1999-05-03 15:29:11 +08:00
/* Routines used when writing an object file. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_WRITE(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_set_arch_mach, \
NAME##_set_section_contents
bfd_boolean (*_bfd_set_arch_mach)
2003-06-29 18:06:40 +08:00
(bfd *, enum bfd_architecture, unsigned long);
bfd_boolean (*_bfd_set_section_contents)
2003-06-29 18:06:40 +08:00
(bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
1999-05-03 15:29:11 +08:00
/* Routines used by the linker. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_LINK(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_sizeof_headers, \
NAME##_bfd_get_relocated_section_contents, \
NAME##_bfd_relax_section, \
NAME##_bfd_link_hash_table_create, \
NAME##_bfd_link_hash_table_free, \
NAME##_bfd_link_add_symbols, \
NAME##_bfd_link_just_syms, \
NAME##_bfd_final_link, \
NAME##_bfd_link_split_section, \
NAME##_bfd_gc_sections, \
NAME##_bfd_merge_sections, \
NAME##_bfd_discard_group
int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
bfd_byte * (*_bfd_get_relocated_section_contents)
2003-06-29 18:06:40 +08:00
(bfd *, struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *, bfd_boolean, struct symbol_cache_entry **);
1999-05-03 15:29:11 +08:00
bfd_boolean (*_bfd_relax_section)
2003-06-29 18:06:40 +08:00
(bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *);
1999-05-03 15:29:11 +08:00
/* Create a hash table for the linker. Different backends store
1999-05-03 15:29:11 +08:00
different information in this table. */
struct bfd_link_hash_table *
2003-06-29 18:06:40 +08:00
(*_bfd_link_hash_table_create) (bfd *);
1999-05-03 15:29:11 +08:00
2002-04-04 Daniel Jacobowitz <drow@mvista.com> * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define. * aout-target.h (MY_bfd_link_hash_table_free): Conditionally define. * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise. * bfd.c (bfd_link_hash_table_free): Define. * binary.c (binary_bfd_link_hash_table_free): Define. * bout.c (b_out_bfd_link_hash_table_free): Define. * coff-rs6000.c (rs6000coff_vec): Include _bfd_generic_link_hash_table_free. (pmac_xcoff_vec): Likewise. * coff64-rs6000.c (rs6000coff64_vec): Likewise. (aix5coff64_vec): Likewise. * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define. * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally define. * i386msdos.c (msdos_bfd_link_hash_table_free): Define. * i386os9k.c (os9k_bfd_link_hash_table_free): Define. * ieee.c (ieee_bfd_link_hash_table_free): Define. * ihex.c (ihex_bfd_link_hash_table_free): Define. * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define. (_bfd_generic_link_hash_table_free): Add prototype. * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype. * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define. * linker.c (_bfd_generic_link_hash_table_free): New function. * mmo.c (mmo_bfd_link_hash_table_free): Define. * nlm-target.h (nlm_bfd_link_hash_table_free): Define. * oasys.c (oasys_bfd_link_hash_table_free): Define. * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define. * som.c (som_bfd_link_hash_table_free): Define. * srec.c (srec_bfd_link_hash_table_free): Define. * tekhex.c (tekhex_bfd_link_hash_table_free): Define. * versados.c (versados_bfd_link_hash_table_free): Define. * vms.c (vms_bfd_link_hash_table_free): New function. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function. * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc instead of bfd_alloc. * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise. * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise. * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. * elf.c (_bfd_elf_link_hash_table_create): Likewise. * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise. * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. * elf32-sh.c (sh_elf_link_hash_table_create): Likewise. * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise. * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise. * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. * linker.c (_bfd_generic_link_hash_table_create): Likewise. * m68klinux.c (linux_link_hash_table_create): Likewise. * sparclinux.c (linux_link_hash_table_create): Likewise. * sunos.c (sunos_link_hash_table_create): Likewise. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. * targets.c: Add _bfd_link_hash_table_free to xvec. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate.
2002-04-05 03:53:38 +08:00
/* Release the memory associated with the linker hash table. */
2003-06-29 18:06:40 +08:00
void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
2002-04-04 Daniel Jacobowitz <drow@mvista.com> * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define. * aout-target.h (MY_bfd_link_hash_table_free): Conditionally define. * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise. * bfd.c (bfd_link_hash_table_free): Define. * binary.c (binary_bfd_link_hash_table_free): Define. * bout.c (b_out_bfd_link_hash_table_free): Define. * coff-rs6000.c (rs6000coff_vec): Include _bfd_generic_link_hash_table_free. (pmac_xcoff_vec): Likewise. * coff64-rs6000.c (rs6000coff64_vec): Likewise. (aix5coff64_vec): Likewise. * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define. * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally define. * i386msdos.c (msdos_bfd_link_hash_table_free): Define. * i386os9k.c (os9k_bfd_link_hash_table_free): Define. * ieee.c (ieee_bfd_link_hash_table_free): Define. * ihex.c (ihex_bfd_link_hash_table_free): Define. * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define. (_bfd_generic_link_hash_table_free): Add prototype. * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype. * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define. * linker.c (_bfd_generic_link_hash_table_free): New function. * mmo.c (mmo_bfd_link_hash_table_free): Define. * nlm-target.h (nlm_bfd_link_hash_table_free): Define. * oasys.c (oasys_bfd_link_hash_table_free): Define. * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define. * som.c (som_bfd_link_hash_table_free): Define. * srec.c (srec_bfd_link_hash_table_free): Define. * tekhex.c (tekhex_bfd_link_hash_table_free): Define. * versados.c (versados_bfd_link_hash_table_free): Define. * vms.c (vms_bfd_link_hash_table_free): New function. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function. * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc instead of bfd_alloc. * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise. * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise. * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. * elf.c (_bfd_elf_link_hash_table_create): Likewise. * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise. * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. * elf32-sh.c (sh_elf_link_hash_table_create): Likewise. * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise. * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise. * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. * linker.c (_bfd_generic_link_hash_table_create): Likewise. * m68klinux.c (linux_link_hash_table_create): Likewise. * sparclinux.c (linux_link_hash_table_create): Likewise. * sunos.c (sunos_link_hash_table_create): Likewise. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. * targets.c: Add _bfd_link_hash_table_free to xvec. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate.
2002-04-05 03:53:38 +08:00
/* Add symbols from this object file into the hash table. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
1999-05-03 15:29:11 +08:00
Fix ld --just-symbols * aix5ppc-core.c: Warning fixes. * aout-adobe.c (aout_32_bfd_link_just_syms): Define. * aout-target.h (MY_bfd_link_just_syms): Define. * aout-tic30.c (MY_bfd_link_just_syms): Define. * bfd.c (bfd_link_just_syms): Define. * binary.c (binary_bfd_link_just_syms): Define. * bout.c (b_out_bfd_link_just_syms): Define. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer. * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. * coffcode.h (coff_bfd_link_just_syms): Define. * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS. (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS. (_bfd_elf_link_just_syms): Declare. * elf.c (_bfd_elf_link_just_syms): New function. * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that sections haven't already been discarded by the linker. * elflink.h (elf_link_add_object_symbols): Likewise for stab sections and SEC_MERGE sections. (elf_bfd_discard_info): Similarly here. * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define. * i386msdos.c (msdos_bfd_link_just_syms): Define. * i386os9k.c (os9k_bfd_link_just_syms): Define. * ieee.c (ieee_bfd_link_just_syms): Define. * ihex.c (ihex_bfd_link_just_syms): Define. * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define. (_bfd_generic_link_just_syms): Declare. * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define. * linker.c (_bfd_generic_link_just_syms): New function. * mmo.c (mmo_bfd_link_just_syms): Define. * nlm-target.h (nlm_bfd_link_just_syms): Define. * oasys.c (oasys_bfd_link_just_syms): Define. * ppcboot.c (ppcboot_bfd_link_just_syms): Define. * som.c (som_bfd_link_just_syms): Define. * srec.c (srec_bfd_link_just_syms): Define. * targets.c (struct bfd_target): Add _bfd_link_just_syms. (BFD_JUMP_TABLE_LINK): And here. * tekhex.c (tekhex_bfd_link_just_syms): Define. * versados.c (versados_bfd_link_just_syms): Define. * vms.c (vms_bfd_link_just_syms): Define. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate.
2002-05-15 08:18:58 +08:00
/* Indicate that we are only retrieving symbol values from this section. */
2003-06-29 18:06:40 +08:00
void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
Fix ld --just-symbols * aix5ppc-core.c: Warning fixes. * aout-adobe.c (aout_32_bfd_link_just_syms): Define. * aout-target.h (MY_bfd_link_just_syms): Define. * aout-tic30.c (MY_bfd_link_just_syms): Define. * bfd.c (bfd_link_just_syms): Define. * binary.c (binary_bfd_link_just_syms): Define. * bout.c (b_out_bfd_link_just_syms): Define. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer. * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. * coffcode.h (coff_bfd_link_just_syms): Define. * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS. (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS. (_bfd_elf_link_just_syms): Declare. * elf.c (_bfd_elf_link_just_syms): New function. * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that sections haven't already been discarded by the linker. * elflink.h (elf_link_add_object_symbols): Likewise for stab sections and SEC_MERGE sections. (elf_bfd_discard_info): Similarly here. * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define. * i386msdos.c (msdos_bfd_link_just_syms): Define. * i386os9k.c (os9k_bfd_link_just_syms): Define. * ieee.c (ieee_bfd_link_just_syms): Define. * ihex.c (ihex_bfd_link_just_syms): Define. * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define. (_bfd_generic_link_just_syms): Declare. * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define. * linker.c (_bfd_generic_link_just_syms): New function. * mmo.c (mmo_bfd_link_just_syms): Define. * nlm-target.h (nlm_bfd_link_just_syms): Define. * oasys.c (oasys_bfd_link_just_syms): Define. * ppcboot.c (ppcboot_bfd_link_just_syms): Define. * som.c (som_bfd_link_just_syms): Define. * srec.c (srec_bfd_link_just_syms): Define. * targets.c (struct bfd_target): Add _bfd_link_just_syms. (BFD_JUMP_TABLE_LINK): And here. * tekhex.c (tekhex_bfd_link_just_syms): Define. * versados.c (versados_bfd_link_just_syms): Define. * vms.c (vms_bfd_link_just_syms): Define. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate.
2002-05-15 08:18:58 +08:00
/* Do a link based on the link_order structures attached to each
1999-05-03 15:29:11 +08:00
section of the BFD. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
1999-05-03 15:29:11 +08:00
/* Should this section be split up into smaller pieces during linking. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_link_split_section) (bfd *, struct sec *);
1999-05-03 15:29:11 +08:00
/* Remove sections that are not referenced from the output. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
1999-05-03 15:29:11 +08: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 20:23:48 +08:00
/* Attempt to merge SEC_MERGE sections. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_merge_sections) (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 20:23:48 +08:00
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Discard members of a group. */
2003-06-29 18:06:40 +08:00
bfd_boolean (*_bfd_discard_group) (bfd *, struct sec *);
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Routines to handle dynamic symbols and relocs. */
2001-10-02 13:58:41 +08:00
#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
2003-06-29 18:06:40 +08:00
NAME##_get_dynamic_symtab_upper_bound, \
NAME##_canonicalize_dynamic_symtab, \
NAME##_get_dynamic_reloc_upper_bound, \
NAME##_canonicalize_dynamic_reloc
2002-01-31 02:12:17 +08:00
/* Get the amount of memory required to hold the dynamic symbols. */
2003-06-29 18:06:40 +08:00
long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
/* Read in the dynamic symbols. */
long (*_bfd_canonicalize_dynamic_symtab)
2003-06-29 18:06:40 +08:00
(bfd *, struct symbol_cache_entry **);
/* Get the amount of memory required to hold the dynamic relocs. */
2003-06-29 18:06:40 +08:00
long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
/* Read in the dynamic relocs. */
long (*_bfd_canonicalize_dynamic_reloc)
2003-06-29 18:06:40 +08:00
(bfd *, arelent **, struct symbol_cache_entry **);
1999-07-22 08:51:51 +08:00
2002-01-31 02:12:17 +08:00
/* Opposite endian version of this target. */
const struct bfd_target * alternative_target;
2000-12-22 02:20:04 +08:00
2002-01-31 02:12:17 +08:00
/* Data for use by back-end routines, which isn't
generic enough to belong in this structure. */
const void *backend_data;
2000-12-22 02:20:04 +08:00
1999-05-03 15:29:11 +08:00
} bfd_target;
2002-01-31 02:12:17 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_default_target (const char *name);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const char ** bfd_target_list (void);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const bfd_target *bfd_search_for_target
(int (*search_func) (const bfd_target *, void *),
void *);
* bfd-in.h: Remove "taken from the source" comment. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. * elf.c (bfd_elf_discard_group): Return true. * elf-bfd.h (bfd_elf_discard_group): Declare. * bfd-in.h (bfd_elf_discard_group): Don't declare here. * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. * bfd.c (bfd_discard_group): Define. * targets.c (struct bfd_target): Add _bfd_discard_group. (BFD_JUMP_TABLE_LINK): Here too. * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. * aout-adobe.c (aout_32_bfd_discard_group): Define. * aout-target.h (MY_bfd_discard_group): Define. * aout-tic30.c (MY_bfd_discard_group): Define. * binary.c (binary_bfd_discard_group): Define. * bout.c (b_out_bfd_discard_group): Define. * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. * coffcode.h (coff_bfd_discard_group): Define. * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. * i386msdos.c (msdos_bfd_discard_group): Define. * i386os9k.c (os9k_bfd_discard_group): Define. * ieee.c (ieee_bfd_discard_group): Define. * ihex.c (ihex_bfd_discard_group): Define. * mmo.c (mmo_bfd_discard_group): Define. * nlm-target.h (nlm_bfd_discard_group): Define. * oasys.c (oasys_bfd_discard_group): Define. * ppcboot.c (ppcboot_bfd_discard_group): Define. * som.c (som_bfd_discard_group): Define. * srec.c (srec_bfd_discard_group): Define. * tekhex.c (tekhex_bfd_discard_group): Define. * versados.c (versados_bfd_discard_group): Define. * vms.c (vms_bfd_discard_group): Define. * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. (aix5coff64_vec): Likewise. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 11:43:11 +08:00
/* Extracted from format.c. */
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_check_format_matches
(bfd *abfd, bfd_format format, char ***matching);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
1999-05-03 15:29:11 +08:00
2003-06-29 18:06:40 +08:00
const char *bfd_format_string (bfd_format format);
1999-05-03 15:29:11 +08:00
/* Extracted from linker.c. */
2003-06-29 18:06:40 +08:00
bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
#define bfd_link_split_section(abfd, sec) \
BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
/* Extracted from simple.c. */
2003-06-29 18:06:40 +08:00
bfd_byte *bfd_simple_get_relocated_section_contents
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
1999-05-03 15:29:11 +08:00
#ifdef __cplusplus
}
#endif
#endif