merge binutils 2.15 cornflakes.

XXX: some info files are not yet totally fixed up..will fix.
This commit is contained in:
mrg 2004-12-08 13:38:11 +00:00
parent adc74f2444
commit 67891deae5
53 changed files with 2217 additions and 8940 deletions

View File

@ -1,14 +0,0 @@
ARCH=msp:13
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xe000
ROM_SIZE=0x1fe0
RAM_START=0x0200
RAM_SIZE=256
STACK=0x300

View File

@ -1,14 +0,0 @@
ARCH=msp:13
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xc000
ROM_SIZE=0x3fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:13
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xc000
ROM_SIZE=0x3fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:14
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x8000
ROM_SIZE=0x7fe0
RAM_START=0x0200
RAM_SIZE=1K
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:14
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x4000
ROM_SIZE=0xbef0
RAM_START=0x0200
RAM_SIZE=0x07ff
STACK=0xa00

View File

@ -1,14 +0,0 @@
ARCH=msp:14
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x1100
ROM_SIZE=0xeee0
RAM_START=0x0200
RAM_SIZE=0x07ff
STACK=0xa00

View File

@ -1,14 +0,0 @@
ARCH=msp:15
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xc000
ROM_SIZE=0x3fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:15
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xa000
ROM_SIZE=0x5fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:15
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x8000
ROM_SIZE=0x7fe0
RAM_START=0x0200
RAM_SIZE=1K
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:16
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x8000
ROM_SIZE=0x7fe0
RAM_START=0x0200
RAM_SIZE=1K
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:16
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x4000
ROM_SIZE=0xbef0
RAM_START=0x0200
RAM_SIZE=0x07ff
STACK=0xa00

View File

@ -1,14 +0,0 @@
ARCH=msp:16
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x1100
ROM_SIZE=0xeee0
RAM_START=0x0200
RAM_SIZE=0x07ff
STACK=0xa00

View File

@ -1,14 +0,0 @@
ARCH=msp:31
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xf800
ROM_SIZE=0x07e0
RAM_START=0x0200
RAM_SIZE=128
STACK=0x280

View File

@ -1,14 +0,0 @@
ARCH=msp:31
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xf000
ROM_SIZE=0x0fe0
RAM_START=0x0200
RAM_SIZE=256
STACK=0x300

View File

@ -1,14 +0,0 @@
ARCH=msp:31
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xe000
ROM_SIZE=0x1fe0
RAM_START=0x0200
RAM_SIZE=256
STACK=0x300

View File

@ -1,14 +0,0 @@
ARCH=msp:31
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xd000
ROM_SIZE=0x2fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:31
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xc000
ROM_SIZE=0x3fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:32
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xe000
ROM_SIZE=0x1fe0
RAM_START=0x0200
RAM_SIZE=256
STACK=0x300

View File

@ -1,14 +0,0 @@
ARCH=msp:32
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xc000
ROM_SIZE=0x3fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:33
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xa000
ROM_SIZE=0x5fe0
RAM_START=0x0200
RAM_SIZE=1024
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:33
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x8000
ROM_SIZE=0x7fe0
RAM_START=0x0200
RAM_SIZE=1024
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:41
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xf000
ROM_SIZE=0x0fe0
RAM_START=0x0200
RAM_SIZE=256
STACK=0x300

View File

@ -1,14 +0,0 @@
ARCH=msp:41
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xe000
ROM_SIZE=0x1fe0
RAM_START=0x0200
RAM_SIZE=256
STACK=0x300

View File

@ -1,14 +0,0 @@
ARCH=msp:43
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xc000
ROM_SIZE=0x3fe0
RAM_START=0x0200
RAM_SIZE=512
STACK=0x400

View File

@ -1,14 +0,0 @@
ARCH=msp:43
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xa000
ROM_SIZE=0x5fe0
RAM_START=0x0200
RAM_SIZE=1024
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:43
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x8000
ROM_SIZE=0x7fe0
RAM_START=0x0200
RAM_SIZE=1024
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:44
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x8000
ROM_SIZE=0x7fe0
RAM_START=0x0200
RAM_SIZE=1K
STACK=0x600

View File

@ -1,14 +0,0 @@
ARCH=msp:44
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x4000
ROM_SIZE=0xbef0
RAM_START=0x0200
RAM_SIZE=0x07ff
STACK=0xa00

View File

@ -1,14 +0,0 @@
ARCH=msp:44
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0x1100
ROM_SIZE=0xeee0
RAM_START=0x0200
RAM_SIZE=0x07ff
STACK=0xa00

View File

@ -13,7 +13,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003 Free Software Foundation, Inc.
2002, 2003, 2004 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@ -53,38 +53,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <ldgram.h>
#include "elf/common.h"
static void gld${EMULATION_NAME}_before_parse
PARAMS ((void));
static void gld${EMULATION_NAME}_vercheck
PARAMS ((lang_input_statement_type *));
static void gld${EMULATION_NAME}_stat_needed
PARAMS ((lang_input_statement_type *));
static bfd_boolean gld${EMULATION_NAME}_try_needed
PARAMS ((const char *, int));
static bfd_boolean gld${EMULATION_NAME}_search_needed
PARAMS ((const char *, const char *, int));
static void gld${EMULATION_NAME}_check_needed
PARAMS ((lang_input_statement_type *));
static void gld${EMULATION_NAME}_after_open
PARAMS ((void));
static void gld${EMULATION_NAME}_find_exp_assignment
PARAMS ((etree_type *));
static void gld${EMULATION_NAME}_find_statement_assignment
PARAMS ((lang_statement_union_type *));
static void gld${EMULATION_NAME}_before_allocation
PARAMS ((void));
static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive
PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
static lang_output_section_statement_type *output_rel_find
PARAMS ((asection *));
static asection *output_prev_sec_find
PARAMS ((lang_output_section_statement_type *));
/* Declare functions used by various EXTRA_EM_FILEs. */
static void gld${EMULATION_NAME}_before_parse (void);
static void gld${EMULATION_NAME}_after_open (void);
static void gld${EMULATION_NAME}_before_allocation (void);
static bfd_boolean gld${EMULATION_NAME}_place_orphan
PARAMS ((lang_input_statement_type *, asection *));
static void gld${EMULATION_NAME}_finish
PARAMS ((void));
static char *gld${EMULATION_NAME}_get_script
PARAMS ((int *isfile));
(lang_input_statement_type *file, asection *s);
static void gld${EMULATION_NAME}_finish (void);
EOF
@ -104,17 +79,9 @@ if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
cat >>e${EMULATION_NAME}.c <<EOF
static void
gld${EMULATION_NAME}_before_parse ()
gld${EMULATION_NAME}_before_parse (void)
{
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
if (arch)
{
ldfile_output_architecture = arch->arch;
ldfile_output_machine = arch->mach;
ldfile_output_machine_name = arch->printable_name;
}
else
ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`;
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
config.dynamic_link = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
}
@ -122,6 +89,28 @@ gld${EMULATION_NAME}_before_parse ()
EOF
fi
if test x"$LDEMUL_RECOGNIZED_FILE" != xgld"${EMULATION_NAME}"_load_symbols; then
cat >>e${EMULATION_NAME}.c <<EOF
/* Handle as_needed DT_NEEDED. */
static bfd_boolean
gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *entry)
{
if (!entry->as_needed
|| (bfd_get_file_flags (entry->the_bfd) & DYNAMIC) == 0)
return FALSE;
/* Tell the ELF linker that we don't want the output file to have a
DT_NEEDED entry for this file, unless it is used to resolve
references in a regular object. */
bfd_elf_set_dyn_lib_class (entry->the_bfd, DYN_AS_NEEDED);
/* Continue on with normal load_symbols processing. */
return FALSE;
}
EOF
fi
cat >>e${EMULATION_NAME}.c <<EOF
/* These variables are required to pass information back and forth
@ -152,8 +141,7 @@ static bfd_boolean global_vercheck_failed;
a conflicting version. */
static void
gld${EMULATION_NAME}_vercheck (s)
lang_input_statement_type *s;
gld${EMULATION_NAME}_vercheck (lang_input_statement_type *s)
{
const char *soname;
struct bfd_link_needed_list *l;
@ -190,10 +178,10 @@ gld${EMULATION_NAME}_vercheck (s)
if (strncmp (soname, l->name, suffix - l->name) == 0)
{
/* Here we know that S is a dynamic object FOO.SO.VER1, and
the object we are considering needs a dynamic object
FOO.SO.VER2, and VER1 and VER2 are different. This
appears to be a version mismatch, so we tell the caller
to try a different version of this library. */
the object we are considering needs a dynamic object
FOO.SO.VER2, and VER1 and VER2 are different. This
appears to be a version mismatch, so we tell the caller
to try a different version of this library. */
global_vercheck_failed = TRUE;
return;
}
@ -205,8 +193,7 @@ gld${EMULATION_NAME}_vercheck (s)
the file. */
static void
gld${EMULATION_NAME}_stat_needed (s)
lang_input_statement_type *s;
gld${EMULATION_NAME}_stat_needed (lang_input_statement_type *s)
{
struct stat st;
const char *suffix;
@ -261,9 +248,7 @@ gld${EMULATION_NAME}_stat_needed (s)
to skip the check for a conflicting version. */
static bfd_boolean
gld${EMULATION_NAME}_try_needed (name, force)
const char *name;
int force;
gld${EMULATION_NAME}_try_needed (const char *name, int force)
{
bfd *abfd;
const char *soname;
@ -310,16 +295,16 @@ gld${EMULATION_NAME}_try_needed (name, force)
{
bfd_close (abfd);
/* Return FALSE to force the caller to move on to try
another file on the search path. */
another file on the search path. */
return FALSE;
}
/* But wait! It gets much worse. On Linux, if a shared
library does not use libc at all, we are supposed to skip
it the first time around in case we encounter a shared
library later on with the same name which does use the
version of libc that we want. This is much too horrible
to use on any system other than Linux. */
library does not use libc at all, we are supposed to skip
it the first time around in case we encounter a shared
library later on with the same name which does use the
version of libc that we want. This is much too horrible
to use on any system other than Linux. */
EOF
case ${target} in
@ -369,18 +354,17 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (global_found)
{
/* Return TRUE to indicate that we found the file, even though
we aren't going to do anything with it. */
we aren't going to do anything with it. */
return TRUE;
}
/* Tell the ELF backend that we don't want the output file to have a
DT_NEEDED entry for this file. */
bfd_elf_set_dt_needed_name (abfd, "");
/* Specify the soname to use. */
bfd_elf_set_dt_needed_name (abfd, soname);
/* Tell the ELF backend that the output file needs a DT_NEEDED
entry for this file if it is used to resolve the reference in
a regular object. */
bfd_elf_set_dt_needed_soname (abfd, soname);
/* Tell the ELF linker that we don't want the output file to have a
DT_NEEDED entry for this file, unless it is used to resolve
references in a regular object. */
bfd_elf_set_dyn_lib_class (abfd, DYN_DT_NEEDED);
/* Add this file into the symbol table. */
if (! bfd_link_add_symbols (abfd, &link_info))
@ -393,10 +377,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* Search for a needed file in a path. */
static bfd_boolean
gld${EMULATION_NAME}_search_needed (path, name, force)
const char *path;
const char *name;
int force;
gld${EMULATION_NAME}_search_needed (const char *path, const char *name, int force)
{
const char *s;
size_t len;
@ -445,11 +426,8 @@ if [ "x${USE_LIBPATH}" = xyes ] ; then
/* Add the sysroot to every entry in a colon-separated path. */
static char * gld${EMULATION_NAME}_add_sysroot PARAMS ((const char *));
static char *
gld${EMULATION_NAME}_add_sysroot (path)
const char *path;
gld${EMULATION_NAME}_add_sysroot (const char *path)
{
int len, colons, i;
char *ret, *p;
@ -472,7 +450,7 @@ gld${EMULATION_NAME}_add_sysroot (path)
while (path[i])
if (path[i] == ':')
{
*p++ = path[i++];
*p++ = path[i++];
strcpy (p, ld_sysroot);
p = p + strlen (p);
}
@ -491,13 +469,8 @@ EOF
in which we may find shared libraries. /etc/ld.so.conf is really
only meaningful on Linux. */
static bfd_boolean gld${EMULATION_NAME}_check_ld_so_conf
PARAMS ((const char *, int));
static bfd_boolean
gld${EMULATION_NAME}_check_ld_so_conf (name, force)
const char *name;
int force;
gld${EMULATION_NAME}_check_ld_so_conf (const char *name, int force)
{
static bfd_boolean initialized;
static char *ld_so_conf;
@ -588,8 +561,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* See if an input file matches a DT_NEEDED entry by name. */
static void
gld${EMULATION_NAME}_check_needed (s)
lang_input_statement_type *s;
gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
{
if (global_found)
return;
@ -638,12 +610,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* This is called after all the input files have been opened. */
static void
gld${EMULATION_NAME}_after_open ()
gld${EMULATION_NAME}_after_open (void)
{
struct bfd_link_needed_list *needed, *l;
/* We only need to worry about this when doing a final link. */
if (link_info.relocateable || link_info.shared)
if (link_info.relocatable || !link_info.executable)
return;
/* Get the list of files which appear in DT_NEEDED entries in
@ -794,8 +766,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* Look through an expression for an assignment statement. */
static void
gld${EMULATION_NAME}_find_exp_assignment (exp)
etree_type *exp;
gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
{
struct bfd_link_hash_entry *h;
@ -819,7 +790,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
case etree_assign:
if (strcmp (exp->assign.dst, ".") != 0)
{
if (! (bfd_elf${ELFSIZE}_record_link_assignment
if (! (bfd_elf_record_link_assignment
(output_bfd, &link_info, exp->assign.dst,
exp->type.node_class == etree_provide ? TRUE : FALSE)))
einfo ("%P%F: failed to record assignment to %s: %E\n",
@ -855,8 +826,7 @@ gld${EMULATION_NAME}_find_exp_assignment (exp)
symbols which are referred to by dynamic objects. */
static void
gld${EMULATION_NAME}_find_statement_assignment (s)
lang_statement_union_type *s;
gld${EMULATION_NAME}_find_statement_assignment (lang_statement_union_type *s)
{
if (s->header.type == lang_assignment_statement_enum)
gld${EMULATION_NAME}_find_exp_assignment (s->assignment_statement.exp);
@ -883,11 +853,14 @@ cat >>e${EMULATION_NAME}.c <<EOF
sections, but before any sizes or addresses have been set. */
static void
gld${EMULATION_NAME}_before_allocation ()
gld${EMULATION_NAME}_before_allocation (void)
{
const char *rpath;
asection *sinterp;
if (link_info.hash->type == bfd_link_elf_hash_table)
_bfd_elf_tls_setup (output_bfd, &link_info);
/* If we are going to make any variable assignments, we need to let
the ELF backend know about them in case the variables are
referred to by dynamic objects. */
@ -898,8 +871,8 @@ gld${EMULATION_NAME}_before_allocation ()
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
(output_bfd, command_line.soname, rpath,
if (! (bfd_elf_size_dynamic_sections
(output_bfd, command_line.soname, rpath,
command_line.filter_shlib,
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
@ -923,8 +896,10 @@ ${ELF_INTERPRETER_SET_DEFAULT}
{
asection *s;
bfd_size_type sz;
bfd_size_type prefix_len;
char *msg;
bfd_boolean ret;
const char * gnu_warning_prefix = _("warning: ");
if (is->just_syms_flag)
continue;
@ -934,11 +909,14 @@ ${ELF_INTERPRETER_SET_DEFAULT}
continue;
sz = bfd_section_size (is->the_bfd, s);
msg = xmalloc ((size_t) sz + 1);
if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz))
prefix_len = strlen (gnu_warning_prefix);
msg = xmalloc ((size_t) (prefix_len + sz + 1));
strcpy (msg, gnu_warning_prefix);
if (! bfd_get_section_contents (is->the_bfd, s, msg + prefix_len,
(file_ptr) 0, sz))
einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
is->the_bfd);
msg[sz] = '\0';
msg[prefix_len + sz] = '\0';
ret = link_info.callbacks->warning (&link_info, msg,
(const char *) NULL,
is->the_bfd, (asection *) NULL,
@ -964,10 +942,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
like hpux). */
static bfd_boolean
gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
const char *arch;
search_dirs_type *search;
lang_input_statement_type *entry;
gld${EMULATION_NAME}_open_dynamic_archive
(const char *arch, search_dirs_type *search, lang_input_statement_type *entry)
{
const char *filename;
char *string;
@ -1043,12 +1019,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* A variant of lang_output_section_find. Used by place_orphan. */
static lang_output_section_statement_type *
output_rel_find (sec)
asection *sec;
output_rel_find (asection *sec, int isdyn)
{
lang_statement_union_type *u;
lang_output_section_statement_type *lookup;
lang_output_section_statement_type *last = NULL;
lang_output_section_statement_type *last_alloc = NULL;
lang_output_section_statement_type *last_rel = NULL;
lang_output_section_statement_type *last_rel_alloc = NULL;
int rela = sec->name[4] == 'a';
@ -1058,22 +1034,30 @@ output_rel_find (sec)
lookup = &u->output_section_statement;
if (strncmp (".rel", lookup->name, 4) == 0)
{
/* Don't place after .rel.plt as doing so results in wrong
dynamic tags. Also, place allocated reloc sections before
non-allocated. */
int lookrela = lookup->name[4] == 'a';
if (strcmp (".plt", lookup->name + 4 + lookrela) == 0
|| (lookup->bfd_section != NULL
&& (lookup->bfd_section->flags & SEC_ALLOC) == 0))
/* .rel.dyn must come before all other reloc sections, to suit
GNU ld.so. */
if (isdyn)
break;
last = lookup;
if (rela == lookrela)
/* Don't place after .rel.plt as doing so results in wrong
dynamic tags. */
if (strcmp (".plt", lookup->name + 4 + lookrela) == 0)
break;
if (rela == lookrela || last_rel == NULL)
last_rel = lookup;
if (lookup->bfd_section != NULL
if ((rela == lookrela || last_rel_alloc == NULL)
&& lookup->bfd_section != NULL
&& (lookup->bfd_section->flags & SEC_ALLOC) != 0)
last_rel_alloc = lookup;
}
last = lookup;
if (lookup->bfd_section != NULL
&& (lookup->bfd_section->flags & SEC_ALLOC) != 0)
last_alloc = lookup;
}
if (last_rel_alloc)
@ -1082,6 +1066,9 @@ output_rel_find (sec)
if (last_rel)
return last_rel;
if (last_alloc)
return last_alloc;
return last;
}
@ -1089,8 +1076,7 @@ output_rel_find (sec)
Used by place_orphan. */
static asection *
output_prev_sec_find (os)
lang_output_section_statement_type *os;
output_prev_sec_find (lang_output_section_statement_type *os)
{
asection *s = (asection *) NULL;
lang_statement_union_type *u;
@ -1122,9 +1108,7 @@ struct orphan_save {
};
static bfd_boolean
gld${EMULATION_NAME}_place_orphan (file, s)
lang_input_statement_type *file;
asection *s;
gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
{
static struct orphan_save hold_text;
static struct orphan_save hold_rodata;
@ -1146,7 +1130,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
int isdyn = 0;
secname = bfd_get_section_name (s->owner, s);
if (! link_info.relocateable
if (! link_info.relocatable
&& link_info.combreloc
&& (s->flags & SEC_ALLOC)
&& strncmp (secname, ".rel", 4) == 0)
@ -1180,8 +1164,8 @@ gld${EMULATION_NAME}_place_orphan (file, s)
/* If this is a final link, then always put .gnu.warning.SYMBOL
sections into the .text section to get them out of the way. */
if (! link_info.shared
&& ! link_info.relocateable
if (link_info.executable
&& ! link_info.relocatable
&& strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
&& hold_text.os != NULL)
{
@ -1197,7 +1181,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
#define HAVE_SECTION(hold, name) \
(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocateable)
if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocatable)
{
if (s->output_section == NULL)
s->output_section = bfd_abs_section_ptr;
@ -1223,7 +1207,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
else if (strncmp (secname, ".rel", 4) == 0
&& (s->flags & SEC_LOAD) != 0
&& (hold_rel.os != NULL
|| (hold_rel.os = output_rel_find (s)) != NULL))
|| (hold_rel.os = output_rel_find (s, isdyn)) != NULL))
place = &hold_rel;
else if ((s->flags & (SEC_CODE | SEC_READONLY)) == SEC_READONLY
&& HAVE_SECTION (hold_rodata, ".rodata"))
@ -1278,7 +1262,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
}
address = NULL;
if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
address = exp_intop ((bfd_vma) 0);
load_base = NULL;
@ -1293,7 +1277,6 @@ gld${EMULATION_NAME}_place_orphan (file, s)
os_tail = lang_output_section_statement.tail;
os = lang_enter_output_section_statement (secname, address, 0,
(bfd_vma) 0,
(etree_type *) NULL,
(etree_type *) NULL,
load_base);
@ -1422,9 +1405,9 @@ if test x"$LDEMUL_FINISH" != xgld"$EMULATION_NAME"_finish; then
cat >>e${EMULATION_NAME}.c <<EOF
static void
gld${EMULATION_NAME}_finish ()
gld${EMULATION_NAME}_finish (void)
{
if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
if (bfd_elf_discard_info (output_bfd, &link_info))
{
lang_reset_memory_regions ();
@ -1447,8 +1430,7 @@ if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
cat >>e${EMULATION_NAME}.c <<EOF
static char *
gld${EMULATION_NAME}_get_script (isfile)
int *isfile;
gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
@ -1462,11 +1444,11 @@ cat >>e${EMULATION_NAME}.c <<EOF
{
*isfile = 0;
if (link_info.relocateable && config.build_constructors)
if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
@ -1474,6 +1456,14 @@ if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then : ;
echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
fi
if test -n "$GENERATE_PIE_SCRIPT" ; then
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
echo ' ; else if (link_info.pie && link_info.combreloc) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xdc >> e${EMULATION_NAME}.c
fi
echo ' ; else if (link_info.pie) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xd >> e${EMULATION_NAME}.c
fi
if test -n "$GENERATE_SHLIB_SCRIPT" ; then
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
echo ' ; else if (link_info.shared && link_info.combreloc) return' >> e${EMULATION_NAME}.c
@ -1497,9 +1487,9 @@ cat >>e${EMULATION_NAME}.c <<EOF
{
*isfile = 1;
if (link_info.relocateable && config.build_constructors)
if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
else if (link_info.relocateable)
else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
@ -1511,6 +1501,18 @@ cat >>e${EMULATION_NAME}.c <<EOF
return "ldscripts/${EMULATION_NAME}.xn";
EOF
fi
if test -n "$GENERATE_PIE_SCRIPT" ; then
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
cat >>e${EMULATION_NAME}.c <<EOF
else if (link_info.pie && link_info.combreloc)
return "ldscripts/${EMULATION_NAME}.xdc";
EOF
fi
cat >>e${EMULATION_NAME}.c <<EOF
else if (link_info.pie)
return "ldscripts/${EMULATION_NAME}.xd";
EOF
fi
if test -n "$GENERATE_SHLIB_SCRIPT" ; then
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
cat >>e${EMULATION_NAME}.c <<EOF
@ -1553,17 +1555,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
#define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1)
#define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1)
static void gld${EMULATION_NAME}_add_options
PARAMS ((int, char **, int, struct option **, int, struct option **));
static void
gld${EMULATION_NAME}_add_options (ns, shortopts, nl, longopts, nrl, really_longopts)
int ns;
char **shortopts;
int nl;
struct option **longopts;
int nrl ATTRIBUTE_UNUSED;
struct option **really_longopts ATTRIBUTE_UNUSED;
gld${EMULATION_NAME}_add_options
(int ns, char **shortopts, int nl, struct option **longopts,
int nrl ATTRIBUTE_UNUSED, struct option **really_longopts ATTRIBUTE_UNUSED)
{
static const char xtra_short[] = "${PARSE_AND_LIST_SHORTOPTS}z:";
static const struct option xtra_long[] = {
@ -1595,12 +1590,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
}
static bfd_boolean gld${EMULATION_NAME}_handle_option
PARAMS ((int));
static bfd_boolean
gld${EMULATION_NAME}_handle_option (optc)
int optc;
gld${EMULATION_NAME}_handle_option (int optc)
{
switch (optc)
{
@ -1626,7 +1617,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
case OPTION_GROUP:
link_info.flags_1 |= (bfd_vma) DF_1_GROUP;
/* Groups must be self-contained. */
link_info.no_undefined = TRUE;
link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR;
break;
case 'z':
@ -1655,7 +1647,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN;
}
else if (strcmp (optarg, "defs") == 0)
link_info.no_undefined = TRUE;
link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
else if (strcmp (optarg, "muldefs") == 0)
link_info.allow_multiple_definition = TRUE;
else if (strcmp (optarg, "combreloc") == 0)
@ -1663,7 +1655,17 @@ cat >>e${EMULATION_NAME}.c <<EOF
else if (strcmp (optarg, "nocombreloc") == 0)
link_info.combreloc = FALSE;
else if (strcmp (optarg, "nocopyreloc") == 0)
link_info.nocopyreloc = TRUE;
link_info.nocopyreloc = TRUE;
else if (strcmp (optarg, "execstack") == 0)
{
link_info.execstack = TRUE;
link_info.noexecstack = FALSE;
}
else if (strcmp (optarg, "noexecstack") == 0)
{
link_info.noexecstack = TRUE;
link_info.execstack = FALSE;
}
/* What about the other Solaris -z options? FIXME. */
break;
EOF
@ -1686,11 +1688,8 @@ EOF
if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
cat >>e${EMULATION_NAME}.c <<EOF
static void gld${EMULATION_NAME}_list_options PARAMS ((FILE * file));
static void
gld${EMULATION_NAME}_list_options (file)
FILE * file;
gld${EMULATION_NAME}_list_options (FILE * file)
{
EOF
@ -1701,7 +1700,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n"));
fprintf (file, _(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n"));
fprintf (file, _(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n"));
fprintf (file, _(" -z defs\t\tDisallows undefined symbols\n"));
fprintf (file, _(" -z defs\t\tReport unresolved symbols in object files.\n"));
fprintf (file, _(" -z execstack\t\tMark executable as requiring executable stack\n"));
fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n"));
fprintf (file, _(" -z interpose\t\tMark object to interpose all DSOs but executable\n"));
fprintf (file, _(" -z loadfltr\t\tMark object requiring immediate process\n"));
@ -1712,6 +1712,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
fprintf (file, _(" -z nodelete\t\tMark DSO non-deletable at runtime\n"));
fprintf (file, _(" -z nodlopen\t\tMark DSO not available to dlopen\n"));
fprintf (file, _(" -z nodump\t\tMark DSO not available to dldump\n"));
fprintf (file, _(" -z noexecstack\tMark executable as not requiring executable stack\n"));
fprintf (file, _(" -z now\t\tMark object non-lazy runtime binding\n"));
fprintf (file, _(" -z origin\t\tMark object requiring immediate \$ORIGIN processing\n\t\t\t at runtime\n"));
fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n"));
@ -1772,7 +1773,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
gld${EMULATION_NAME}_handle_option,
${LDEMUL_UNRECOGNIZED_FILE-NULL},
${LDEMUL_LIST_OPTIONS-gld${EMULATION_NAME}_list_options},
${LDEMUL_RECOGNIZED_FILE-NULL},
${LDEMUL_RECOGNIZED_FILE-gld${EMULATION_NAME}_load_symbols},
${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL},
${LDEMUL_NEW_VERS_PATTERN-NULL}
};

View File

@ -1,79 +0,0 @@
This is ld.info, produced by makeinfo version 4.3 from ./ld.texinfo.
START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.14.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
2002, 2003 Free Software Foundation, Inc.

File: ld.info, Node: Top, Next: Overview, Up: (dir)
Using ld
********
This file documents the GNU linker ld version 2.14.
This document is distributed under the terms of the GNU Free
Documentation License. A copy of the license is included in the
section entitled "GNU Free Documentation License".
* Menu:
* Overview:: Overview
* Invocation:: Invocation
* Scripts:: Linker Scripts
* Machine Dependent:: Machine Dependent Features
* BFD:: BFD
* Reporting Bugs:: Reporting Bugs
* MRI:: MRI Compatible Script Files
* GNU Free Documentation License:: GNU Free Documentation License
* Index:: Index

File: ld.info, Node: Overview, Next: Invocation, Prev: Top, Up: Top
Overview
********
`ld' combines a number of object and archive files, relocates their
data and ties up symbol references. Usually the last step in compiling
a program is to run `ld'.
`ld' accepts Linker Command Language files written in a superset of
AT&T's Link Editor Command Language syntax, to provide explicit and
total control over the linking process.
This version of `ld' uses the general purpose BFD libraries to
operate on object files. This allows `ld' to read, combine, and write
object files in many different formats--for example, COFF or `a.out'.
Different formats may be linked together to produce any available kind
of object file. *Note BFD::, for more information.
Aside from its flexibility, the GNU linker is more helpful than other
linkers in providing diagnostic information. Many linkers abandon
execution immediately upon encountering an error; whenever possible,
`ld' continues executing, allowing you to identify other errors (or, in
some cases, to get an output file in spite of the error).

File: ld.info, Node: Invocation, Next: Scripts, Prev: Overview, Up: Top
Invocation
**********
The GNU linker `ld' is meant to cover a broad range of situations,
and to be as compatible as possible with other linkers. As a result,
you have many choices to control its behavior.
* Menu:
* Options:: Command Line Options
* Environment:: Environment Variables

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,873 +0,0 @@
This is ld.info, produced by makeinfo version 4.3 from ./ld.texinfo.
START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.14.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
2002, 2003 Free Software Foundation, Inc.

File: ld.info, Node: WIN32, Next: Xtensa, Prev: TI COFF, Up: Machine Dependent
`ld' and WIN32 (cygwin/mingw)
=============================
This section describes some of the win32 specific `ld' issues. See
*Note Command Line Options: Options for detailed decription of the
command line options mentioned here.
_import libraries_
The standard Windows linker creates and uses so-called import
libraries, which contains information for linking to dll's. They
are regular static archives and are handled as any other static
archive. The cygwin and mingw ports of `ld' have specific support
for creating such libraries provided with the `--out-implib'
command line option.
_exporting DLL symbols_
The cygwin/mingw `ld' has several ways to export symbols for dll's.
_using auto-export functionality_
By default `ld' exports symbols with the auto-export
functionality, which is controlled by the following command
line options:
* -export-all-symbols [This is the default]
* -exclude-symbols
* -exclude-libs
If, however, `--export-all-symbols' is not given explicitly
on the command line, then the default auto-export behavior
will be _disabled_ if either of the following are true:
* A DEF file is used.
* Any symbol in any object file was marked with the
__declspec(dllexport) attribute.
_using a DEF file_
Another way of exporting symbols is using a DEF file. A DEF
file is an ASCII file containing definitions of symbols which
should be exported when a dll is created. Usually it is
named `<dll name>.def' and is added as any other object file
to the linker's command line. The file's name must end in
`.def' or `.DEF'.
gcc -o <output> <objectfiles> <dll name>.def
Using a DEF file turns off the normal auto-export behavior,
unless the `--export-all-symbols' option is also used.
Here is an example of a DEF file for a shared library called
`xyz.dll':
LIBRARY "xyz.dll" BASE=0x10000000
EXPORTS
foo
bar
_bar = bar
This example defines a base address and three symbols. The
third symbol is an alias for the second. For the complete
format specification see ld/deffilep.y in the binutils
sources.
While linking a shared dll, `ld' is able to create a DEF file
with the `--output-def <file>' command line option.
_Using decorations_
Another way of marking symbols for export is to modify the
source code itself, so that when building the DLL each symbol
to be exported is declared as:
__declspec(dllexport) int a_variable
__declspec(dllexport) void a_function(int with_args)
All such symbols will be exported from the DLL. If, however,
any of the object files in the DLL contain symbols decorated
in this way, then the normal auto-export behavior is
disabled, unless the `--export-all-symbols' option is also
used.
Note that object files that wish to access these symbols must
_not_ decorate them with dllexport. Instead, they should use
dllimport, instead:
__declspec(dllimport) int a_variable
__declspec(dllimport) void a_function(int with_args)
This complicates the structure of library header files,
because when included by the library itself the header must
declare the variables and functions as dllexport, but when
included by client code the header must declare them as
dllimport. There are a number of idioms that are typically
used to do this; often client code can omit the __declspec()
declaration completely. See `--enable-auto-import' and
`automatic data imports' for more imformation.
_automatic data imports_
The standard Windows dll format supports data imports from dlls
only by adding special decorations (dllimport/dllexport), which
let the compiler produce specific assembler instructions to deal
with this issue. This increases the effort necessary to port
existing Un*x code to these platforms, especially for large c++
libraries and applications. The auto-import feature, which was
initially provided by Paul Sokolovsky, allows one to omit the
decorations to archieve a behavior that conforms to that on
POSIX/Un*x platforms. This feature is enabled with the
`--enable-auto-import' command-line option, although it is enabled
by default on cygwin/mingw. The `--enable-auto-import' option
itself now serves mainly to suppress any warnings that are
ordinarily emitted when linked objects trigger the feature's use.
auto-import of variables does not always work flawlessly without
additional assistance. Sometimes, you will see this message
"variable '<var>' can't be auto-imported. Please read the
documentation for ld's `--enable-auto-import' for details."
The `--enable-auto-import' documentation explains why this error
occurs, and several methods that can be used to overcome this
difficulty. One of these methods is the _runtime pseudo-relocs_
feature, described below.
For complex variables imported from DLLs (such as structs or
classes), object files typically contain a base address for the
variable and an offset (_addend_) within the variable-to specify a
particular field or public member, for instance. Unfortunately,
the runtime loader used in win32 environments is incapable of
fixing these references at runtime without the additional
information supplied by dllimport/dllexport decorations. The
standard auto-import feature described above is unable to resolve
these references.
The `--enable-runtime-pseudo-relocs' switch allows these
references to be resolved without error, while leaving the task of
adjusting the references themselves (with their non-zero addends)
to specialized code provided by the runtime environment. Recent
versions of the cygwin and mingw environments and compilers
provide this runtime support; older versions do not. However, the
support is only necessary on the developer's platform; the
compiled result will run without error on an older system.
`--enable-runtime-pseudo-relocs' is not the default; it must be
explicitly enabled as needed.
_direct linking to a dll_
The cygwin/mingw ports of `ld' support the direct linking,
including data symbols, to a dll without the usage of any import
libraries. This is much faster and uses much less memory than
does the traditional import library method, expecially when
linking large libraries or applications. When `ld' creates an
import lib, each function or variable exported from the dll is
stored in its own bfd, even though a single bfd could contain many
exports. The overhead involved in storing, loading, and
processing so many bfd's is quite large, and explains the
tremendous time, memory, and storage needed to link against
particularly large or complex libraries when using import libs.
Linking directly to a dll uses no extra command-line switches
other than `-L' and `-l', because `ld' already searches for a
number of names to match each library. All that is needed from
the developer's perspective is an understanding of this search, in
order to force ld to select the dll instead of an import library.
For instance, when ld is called with the argument `-lxxx' it will
attempt to find, in the first directory of its search path,
libxxx.dll.a
xxx.dll.a
libxxx.a
cygxxx.dll (*)
libxxx.dll
xxx.dll
before moving on to the next directory in the search path.
(*) Actually, this is not `cygxxx.dll' but in fact is
`<prefix>xxx.dll', where `<prefix>' is set by the `ld' option
`--dll-search-prefix=<prefix>'. In the case of cygwin, the
standard gcc spec file includes `--dll-search-prefix=cyg', so in
effect we actually search for `cygxxx.dll'.
Other win32-based unix environments, such as mingw or pw32, may
use other `<prefix>'es, although at present only cygwin makes use
of this feature. It was originally intended to help avoid name
conflicts among dll's built for the various win32/un*x
environments, so that (for example) two versions of a zlib dll
could coexist on the same machine.
The generic cygwin/mingw path layout uses a `bin' directory for
applications and dll's and a `lib' directory for the import
libraries (using cygwin nomenclature):
bin/
cygxxx.dll
lib/
libxxx.dll.a (in case of dll's)
libxxx.a (in case of static archive)
Linking directly to a dll without using the import library can be
done two ways:
1. Use the dll directly by adding the `bin' path to the link line
gcc -Wl,-verbose -o a.exe -L../bin/ -lxxx
However, as the dll's often have version numbers appended to their
names (`cygncurses-5.dll') this will often fail, unless one
specifies `-L../bin -lncurses-5' to include the version. Import
libs are generally not versioned, and do not have this difficulty.
2. Create a symbolic link from the dll to a file in the `lib'
directory according to the above mentioned search pattern. This
should be used to avoid unwanted changes in the tools needed for
making the app/dll.
ln -s bin/cygxxx.dll lib/[cyg|lib|]xxx.dll[.a]
Then you can link without any make environment changes.
gcc -Wl,-verbose -o a.exe -L../lib/ -lxxx
This technique also avoids the version number problems, because
the following is perfectly legal
bin/
cygxxx-5.dll
lib/
libxxx.dll.a -> ../bin/cygxxx-5.dll
Linking directly to a dll without using an import lib will work
even when auto-import features are exercised, and even when
`--enable-runtime-pseudo-relocs' is used.
Given the improvements in speed and memory usage, one might
justifiably wonder why import libraries are used at all. There
are two reasons:
1. Until recently, the link-directly-to-dll functionality did _not_
work with auto-imported data.
2. Sometimes it is necessary to include pure static objects within
the import library (which otherwise contains only bfd's for
indirection symbols that point to the exports of a dll). Again,
the import lib for the cygwin kernel makes use of this ability,
and it is not possible to do this without an import lib.
So, import libs are not going away. But the ability to replace
true import libs with a simple symbolic link to (or a copy of) a
dll, in most cases, is a useful addition to the suite of tools
binutils makes available to the win32 developer. Given the
massive improvements in memory requirements during linking, storage
requirements, and linking speed, we expect that many developers
will soon begin to use this feature whenever possible.
_symbol aliasing_
_adding additional names_
Sometimes, it is useful to export symbols with additional
names. A symbol `foo' will be exported as `foo', but it can
also be exported as `_foo' by using special directives in the
DEF file when creating the dll. This will affect also the
optional created import library. Consider the following DEF
file:
LIBRARY "xyz.dll" BASE=0x61000000
EXPORTS
foo
_foo = foo
The line `_foo = foo' maps the symbol `foo' to `_foo'.
Another method for creating a symbol alias is to create it in
the source code using the "weak" attribute:
void foo () { /* Do something. */; }
void _foo () __attribute__ ((weak, alias ("foo")));
See the gcc manual for more information about attributes and
weak symbols.
_renaming symbols_
Sometimes it is useful to rename exports. For instance, the
cygwin kernel does this regularly. A symbol `_foo' can be
exported as `foo' but not as `_foo' by using special
directives in the DEF file. (This will also affect the import
library, if it is created). In the following example:
LIBRARY "xyz.dll" BASE=0x61000000
EXPORTS
_foo = foo
The line `_foo = foo' maps the exported symbol `foo' to
`_foo'.
Note: using a DEF file disables the default auto-export behavior,
unless the `--export-all-symbols' command line option is used.
If, however, you are trying to rename symbols, then you should list
_all_ desired exports in the DEF file, including the symbols that
are not being renamed, and do _not_ use the `--export-all-symbols'
option. If you list only the renamed symbols in the DEF file, and
use `--export-all-symbols' to handle the other symbols, then the
both the new names _and_ the original names for the the renamed
symbols will be exported. In effect, you'd be aliasing those
symbols, not renaming them, which is probably not what you wanted.

File: ld.info, Node: Xtensa, Prev: WIN32, Up: Machine Dependent
`ld' and Xtensa Processors
==========================
The default `ld' behavior for Xtensa processors is to interpret
`SECTIONS' commands so that lists of explicitly named sections in a
specification with a wildcard file will be interleaved when necessary to
keep literal pools within the range of PC-relative load offsets. For
example, with the command:
SECTIONS
{
.text : {
*(.literal .text)
}
}
`ld' may interleave some of the `.literal' and `.text' sections from
different object files to ensure that the literal pools are within the
range of PC-relative load offsets. A valid interleaving might place
the `.literal' sections from an initial group of files followed by the
`.text' sections of that group of files. Then, the `.literal' sections
from the rest of the files and the `.text' sections from the rest of
the files would follow. The non-interleaved order can still be
specified as:
SECTIONS
{
.text : {
*(.literal) *(.text)
}
}
The Xtensa version of `ld' enables the `--relax' option by default
to attempt to reduce space in the output image by combining literals
with identical values. It also provides the `--no-relax' option to
disable this optimization. When enabled, the relaxation algorithm
ensures that a literal will only be merged with another literal when
the new merged literal location is within the offset range of all of
its uses.
The relaxation mechanism will also attempt to optimize
assembler-generated "longcall" sequences of `L32R'/`CALLXN' when the
target is known to fit into a `CALLN' instruction encoding. The
current optimization converts the sequence into `NOP'/`CALLN' and
removes the literal referenced by the `L32R' instruction.

File: ld.info, Node: BFD, Next: Reporting Bugs, Prev: Machine Dependent, Up: Top
BFD
***
The linker accesses object and archive files using the BFD libraries.
These libraries allow the linker to use the same routines to operate on
object files whatever the object file format. A different object file
format can be supported simply by creating a new BFD back end and adding
it to the library. To conserve runtime memory, however, the linker and
associated tools are usually configured to support only a subset of the
object file formats available. You can use `objdump -i' (*note
objdump: (binutils.info)objdump.) to list all the formats available for
your configuration.
As with most implementations, BFD is a compromise between several
conflicting requirements. The major factor influencing BFD design was
efficiency: any time used converting between formats is time which
would not have been spent had BFD not been involved. This is partly
offset by abstraction payback; since BFD simplifies applications and
back ends, more time and care may be spent optimizing algorithms for a
greater speed.
One minor artifact of the BFD solution which you should bear in mind
is the potential for information loss. There are two places where
useful information can be lost using the BFD mechanism: during
conversion and during output. *Note BFD information loss::.
* Menu:
* BFD outline:: How it works: an outline of BFD

File: ld.info, Node: BFD outline, Up: BFD
How It Works: An Outline of BFD
===============================
When an object file is opened, BFD subroutines automatically
determine the format of the input object file. They then build a
descriptor in memory with pointers to routines that will be used to
access elements of the object file's data structures.
As different information from the object files is required, BFD
reads from different sections of the file and processes them. For
example, a very common operation for the linker is processing symbol
tables. Each BFD back end provides a routine for converting between
the object file's representation of symbols and an internal canonical
format. When the linker asks for the symbol table of an object file, it
calls through a memory pointer to the routine from the relevant BFD
back end which reads and converts the table into a canonical form. The
linker then operates upon the canonical form. When the link is finished
and the linker writes the output file's symbol table, another BFD back
end routine is called to take the newly created symbol table and
convert it into the chosen output format.
* Menu:
* BFD information loss:: Information Loss
* Canonical format:: The BFD canonical object-file format

File: ld.info, Node: BFD information loss, Next: Canonical format, Up: BFD outline
Information Loss
----------------
_Information can be lost during output._ The output formats
supported by BFD do not provide identical facilities, and information
which can be described in one form has nowhere to go in another format.
One example of this is alignment information in `b.out'. There is
nowhere in an `a.out' format file to store alignment information on the
contained data, so when a file is linked from `b.out' and an `a.out'
image is produced, alignment information will not propagate to the
output file. (The linker will still use the alignment information
internally, so the link is performed correctly).
Another example is COFF section names. COFF files may contain an
unlimited number of sections, each one with a textual section name. If
the target of the link is a format which does not have many sections
(e.g., `a.out') or has sections without names (e.g., the Oasys format),
the link cannot be done simply. You can circumvent this problem by
describing the desired input-to-output section mapping with the linker
command language.
_Information can be lost during canonicalization._ The BFD internal
canonical form of the external formats is not exhaustive; there are
structures in input formats for which there is no direct representation
internally. This means that the BFD back ends cannot maintain all
possible data richness through the transformation between external to
internal and back to external formats.
This limitation is only a problem when an application reads one
format and writes another. Each BFD back end is responsible for
maintaining as much data as possible, and the internal BFD canonical
form has structures which are opaque to the BFD core, and exported only
to the back ends. When a file is read in one format, the canonical form
is generated for BFD and the application. At the same time, the back
end saves away any information which may otherwise be lost. If the data
is then written back in the same format, the back end routine will be
able to use the canonical form provided by the BFD core as well as the
information it prepared earlier. Since there is a great deal of
commonality between back ends, there is no information lost when
linking or copying big endian COFF to little endian COFF, or `a.out' to
`b.out'. When a mixture of formats is linked, the information is only
lost from the files whose format differs from the destination.

File: ld.info, Node: Canonical format, Prev: BFD information loss, Up: BFD outline
The BFD canonical object-file format
------------------------------------
The greatest potential for loss of information occurs when there is
the least overlap between the information provided by the source
format, that stored by the canonical format, and that needed by the
destination format. A brief description of the canonical form may help
you understand which kinds of data you can count on preserving across
conversions.
_files_
Information stored on a per-file basis includes target machine
architecture, particular implementation format type, a demand
pageable bit, and a write protected bit. Information like Unix
magic numbers is not stored here--only the magic numbers' meaning,
so a `ZMAGIC' file would have both the demand pageable bit and the
write protected text bit set. The byte order of the target is
stored on a per-file basis, so that big- and little-endian object
files may be used with one another.
_sections_
Each section in the input file contains the name of the section,
the section's original address in the object file, size and
alignment information, various flags, and pointers into other BFD
data structures.
_symbols_
Each symbol contains a pointer to the information for the object
file which originally defined it, its name, its value, and various
flag bits. When a BFD back end reads in a symbol table, it
relocates all symbols to make them relative to the base of the
section where they were defined. Doing this ensures that each
symbol points to its containing section. Each symbol also has a
varying amount of hidden private data for the BFD back end. Since
the symbol points to the original file, the private data format
for that symbol is accessible. `ld' can operate on a collection
of symbols of wildly different formats without problems.
Normal global and simple local symbols are maintained on output,
so an output file (no matter its format) will retain symbols
pointing to functions and to global, static, and common variables.
Some symbol information is not worth retaining; in `a.out', type
information is stored in the symbol table as long symbol names.
This information would be useless to most COFF debuggers; the
linker has command line switches to allow users to throw it away.
There is one word of type information within the symbol, so if the
format supports symbol type information within symbols (for
example, COFF, IEEE, Oasys) and the type is simple enough to fit
within one word (nearly everything but aggregates), the
information will be preserved.
_relocation level_
Each canonical BFD relocation record contains a pointer to the
symbol to relocate to, the offset of the data to relocate, the
section the data is in, and a pointer to a relocation type
descriptor. Relocation is performed by passing messages through
the relocation type descriptor and the symbol pointer. Therefore,
relocations can be performed on output data using a relocation
method that is only available in one of the input formats. For
instance, Oasys provides a byte relocation format. A relocation
record requesting this relocation type would point indirectly to a
routine to perform this, so the relocation may be performed on a
byte being written to a 68k COFF file, even though 68k COFF has no
such relocation type.
_line numbers_
Object formats can contain, for debugging purposes, some form of
mapping between symbols, source line numbers, and addresses in the
output file. These addresses have to be relocated along with the
symbol information. Each symbol with an associated list of line
number records points to the first record of the list. The head
of a line number list consists of a pointer to the symbol, which
allows finding out the address of the function whose line number
is being described. The rest of the list is made up of pairs:
offsets into the section and line numbers. Any format which can
simply derive this information can pass it successfully between
formats (COFF, IEEE and Oasys).

File: ld.info, Node: Reporting Bugs, Next: MRI, Prev: BFD, Up: Top
Reporting Bugs
**************
Your bug reports play an essential role in making `ld' reliable.
Reporting a bug may help you by bringing a solution to your problem,
or it may not. But in any case the principal function of a bug report
is to help the entire community by making the next version of `ld' work
better. Bug reports are your contribution to the maintenance of `ld'.
In order for a bug report to serve its purpose, you must include the
information that enables us to fix the bug.
* Menu:
* Bug Criteria:: Have you found a bug?
* Bug Reporting:: How to report bugs

File: ld.info, Node: Bug Criteria, Next: Bug Reporting, Up: Reporting Bugs
Have You Found a Bug?
=====================
If you are not sure whether you have found a bug, here are some
guidelines:
* If the linker gets a fatal signal, for any input whatever, that is
a `ld' bug. Reliable linkers never crash.
* If `ld' produces an error message for valid input, that is a bug.
* If `ld' does not produce an error message for invalid input, that
may be a bug. In the general case, the linker can not verify that
object files are correct.
* If you are an experienced user of linkers, your suggestions for
improvement of `ld' are welcome in any case.

File: ld.info, Node: Bug Reporting, Prev: Bug Criteria, Up: Reporting Bugs
How to Report Bugs
==================
A number of companies and individuals offer support for GNU
products. If you obtained `ld' from a support organization, we
recommend you contact that organization first.
You can find contact information for many support companies and
individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
Otherwise, send bug reports for `ld' to `bug-binutils@gnu.org'.
The fundamental principle of reporting bugs usefully is this:
*report all the facts*. If you are not sure whether to state a fact or
leave it out, state it!
Often people omit facts because they think they know what causes the
problem and assume that some details do not matter. Thus, you might
assume that the name of a symbol you use in an example does not matter.
Well, probably it does not, but one cannot be sure. Perhaps the bug
is a stray memory reference which happens to fetch from the location
where that name is stored in memory; perhaps, if the name were
different, the contents of that location would fool the linker into
doing the right thing despite the bug. Play it safe and give a
specific, complete example. That is the easiest thing for you to do,
and the most helpful.
Keep in mind that the purpose of a bug report is to enable us to fix
the bug if it is new to us. Therefore, always write your bug reports
on the assumption that the bug has not been reported previously.
Sometimes people give a few sketchy facts and ask, "Does this ring a
bell?" This cannot help us fix a bug, so it is basically useless. We
respond by asking for enough details to enable us to investigate. You
might as well expedite matters by sending them to begin with.
To enable us to fix the bug, you should include all these things:
* The version of `ld'. `ld' announces it if you start it with the
`--version' argument.
Without this, we will not know whether there is any point in
looking for the bug in the current version of `ld'.
* Any patches you may have applied to the `ld' source, including any
patches made to the `BFD' library.
* The type of machine you are using, and the operating system name
and version number.
* What compiler (and its version) was used to compile `ld'--e.g.
"`gcc-2.7'".
* The command arguments you gave the linker to link your example and
observe the bug. To guarantee you will not omit something
important, list them all. A copy of the Makefile (or the output
from make) is sufficient.
If we were to try to guess the arguments, we would probably guess
wrong and then we might not encounter the bug.
* A complete input file, or set of input files, that will reproduce
the bug. It is generally most helpful to send the actual object
files provided that they are reasonably small. Say no more than
10K. For bigger files you can either make them available by FTP
or HTTP or else state that you are willing to send the object
file(s) to whomever requests them. (Note - your email will be
going to a mailing list, so we do not want to clog it up with
large attachments). But small attachments are best.
If the source files were assembled using `gas' or compiled using
`gcc', then it may be OK to send the source files rather than the
object files. In this case, be sure to say exactly what version of
`gas' or `gcc' was used to produce the object files. Also say how
`gas' or `gcc' were configured.
* A description of what behavior you observe that you believe is
incorrect. For example, "It gets a fatal signal."
Of course, if the bug is that `ld' gets a fatal signal, then we
will certainly notice it. But if the bug is incorrect output, we
might not notice unless it is glaringly wrong. You might as well
not give us a chance to make a mistake.
Even if the problem you experience is a fatal signal, you should
still say so explicitly. Suppose something strange is going on,
such as, your copy of `ld' is out of synch, or you have
encountered a bug in the C library on your system. (This has
happened!) Your copy might crash and ours would not. If you told
us to expect a crash, then when ours fails to crash, we would know
that the bug was not happening for us. If you had not told us to
expect a crash, then we would not be able to draw any conclusion
from our observations.
* If you wish to suggest changes to the `ld' source, send us context
diffs, as generated by `diff' with the `-u', `-c', or `-p' option.
Always send diffs from the old file to the new file. If you even
discuss something in the `ld' source, refer to it by context, not
by line number.
The line numbers in our development sources will not match those
in your sources. Your line numbers would convey no useful
information to us.
Here are some things that are not necessary:
* A description of the envelope of the bug.
Often people who encounter a bug spend a lot of time investigating
which changes to the input file will make the bug go away and which
changes will not affect it.
This is often time consuming and not very useful, because the way
we will find the bug is by running a single example under the
debugger with breakpoints, not by pure deduction from a series of
examples. We recommend that you save your time for something else.
Of course, if you can find a simpler example to report _instead_
of the original one, that is a convenience for us. Errors in the
output will be easier to spot, running under the debugger will take
less time, and so on.
However, simplification is not vital; if you do not want to do
this, report the bug anyway and send us the entire test case you
used.
* A patch for the bug.
A patch for the bug does help us if it is a good one. But do not
omit the necessary information, such as the test case, on the
assumption that a patch is all we need. We might see problems
with your patch and decide to fix the problem another way, or we
might not understand it at all.
Sometimes with a program as complicated as `ld' it is very hard to
construct an example that will make the program follow a certain
path through the code. If you do not send us the example, we will
not be able to construct one, so we will not be able to verify
that the bug is fixed.
And if we cannot understand what bug you are trying to fix, or why
your patch should be an improvement, we will not install it. A
test case will help us to understand.
* A guess about what the bug is or what it depends on.
Such guesses are usually wrong. Even we cannot guess right about
such things without first using the debugger to find the facts.

File: ld.info, Node: MRI, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top
MRI Compatible Script Files
***************************
To aid users making the transition to GNU `ld' from the MRI linker,
`ld' can use MRI compatible linker scripts as an alternative to the
more general-purpose linker scripting language described in *Note
Scripts::. MRI compatible linker scripts have a much simpler command
set than the scripting language otherwise used with `ld'. GNU `ld'
supports the most commonly used MRI linker commands; these commands are
described here.
In general, MRI scripts aren't of much use with the `a.out' object
file format, since it only has three sections and MRI scripts lack some
features to make use of them.
You can specify a file containing an MRI-compatible script using the
`-c' command-line option.
Each command in an MRI-compatible script occupies its own line; each
command line starts with the keyword that identifies the command (though
blank lines are also allowed for punctuation). If a line of an
MRI-compatible script begins with an unrecognized keyword, `ld' issues
a warning message, but continues processing the script.
Lines beginning with `*' are comments.
You can write these commands using all upper-case letters, or all
lower case; for example, `chip' is the same as `CHIP'. The following
list shows only the upper-case form of each command.
`ABSOLUTE SECNAME'
`ABSOLUTE SECNAME, SECNAME, ... SECNAME'
Normally, `ld' includes in the output file all sections from all
the input files. However, in an MRI-compatible script, you can
use the `ABSOLUTE' command to restrict the sections that will be
present in your output program. If the `ABSOLUTE' command is used
at all in a script, then only the sections named explicitly in
`ABSOLUTE' commands will appear in the linker output. You can
still use other input sections (whatever you select on the command
line, or using `LOAD') to resolve addresses in the output file.
`ALIAS OUT-SECNAME, IN-SECNAME'
Use this command to place the data from input section IN-SECNAME
in a section called OUT-SECNAME in the linker output file.
IN-SECNAME may be an integer.
`ALIGN SECNAME = EXPRESSION'
Align the section called SECNAME to EXPRESSION. The EXPRESSION
should be a power of two.
`BASE EXPRESSION'
Use the value of EXPRESSION as the lowest address (other than
absolute addresses) in the output file.
`CHIP EXPRESSION'
`CHIP EXPRESSION, EXPRESSION'
This command does nothing; it is accepted only for compatibility.
`END'
This command does nothing whatever; it's only accepted for
compatibility.
`FORMAT OUTPUT-FORMAT'
Similar to the `OUTPUT_FORMAT' command in the more general linker
language, but restricted to one of these output formats:
1. S-records, if OUTPUT-FORMAT is `S'
2. IEEE, if OUTPUT-FORMAT is `IEEE'
3. COFF (the `coff-m68k' variant in BFD), if OUTPUT-FORMAT is
`COFF'
`LIST ANYTHING...'
Print (to the standard output file) a link map, as produced by the
`ld' command-line option `-M'.
The keyword `LIST' may be followed by anything on the same line,
with no change in its effect.
`LOAD FILENAME'
`LOAD FILENAME, FILENAME, ... FILENAME'
Include one or more object file FILENAME in the link; this has the
same effect as specifying FILENAME directly on the `ld' command
line.
`NAME OUTPUT-NAME'
OUTPUT-NAME is the name for the program produced by `ld'; the
MRI-compatible command `NAME' is equivalent to the command-line
option `-o' or the general script language command `OUTPUT'.
`ORDER SECNAME, SECNAME, ... SECNAME'
`ORDER SECNAME SECNAME SECNAME'
Normally, `ld' orders the sections in its output file in the order
in which they first appear in the input files. In an
MRI-compatible script, you can override this ordering with the
`ORDER' command. The sections you list with `ORDER' will appear
first in your output file, in the order specified.
`PUBLIC NAME=EXPRESSION'
`PUBLIC NAME,EXPRESSION'
`PUBLIC NAME EXPRESSION'
Supply a value (EXPRESSION) for external symbol NAME used in the
linker input files.
`SECT SECNAME, EXPRESSION'
`SECT SECNAME=EXPRESSION'
`SECT SECNAME EXPRESSION'
You can use any of these three forms of the `SECT' command to
specify the start address (EXPRESSION) for section SECNAME. If
you have more than one `SECT' statement for the same SECNAME, only
the _first_ sets the start address.

View File

@ -1,912 +0,0 @@
This is ld.info, produced by makeinfo version 4.3 from ./ld.texinfo.
START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.14.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
2002, 2003 Free Software Foundation, Inc.

File: ld.info, Node: GNU Free Documentation License, Next: Index, Prev: MRI, Up: Top
GNU Free Documentation License
******************************
Version 1.1, March 2000
Copyright (C) 2000, Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
written document "free" in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.
It complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a
free program should come with manuals providing the same freedoms
that the software does. But this License is not limited to
software manuals; it can be used for any textual work, regardless
of subject matter or whether it is published as a printed book.
We recommend this License principally for works whose purpose is
instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License. The "Document", below, refers to
any such manual or work. Any member of the public is a licensee,
and is addressed as "you."
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter
section of the Document that deals exclusively with the
relationship of the publishers or authors of the Document to the
Document's overall subject (or to related matters) and contains
nothing that could fall directly within that overall subject.
(For example, if the Document is in part a textbook of
mathematics, a Secondary Section may not explain any mathematics.)
The relationship could be a matter of historical connection with
the subject or with related matters, or of legal, commercial,
philosophical, ethical or political position regarding them.
The "Invariant Sections" are certain Secondary Sections whose
titles are designated, as being those of Invariant Sections, in
the notice that says that the Document is released under this
License.
The "Cover Texts" are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
that says that the Document is released under this License.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly
and straightforwardly with generic text editors or (for images
composed of pixels) generic paint programs or (for drawings) some
widely available drawing editor, and that is suitable for input to
text formatters or for automatic translation to a variety of
formats suitable for input to text formatters. A copy made in an
otherwise Transparent file format whose markup has been designed
to thwart or discourage subsequent modification by readers is not
Transparent. A copy that is not "Transparent" is called "Opaque."
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
SGML or XML using a publicly available DTD, and
standard-conforming simple HTML designed for human modification.
Opaque formats include PostScript, PDF, proprietary formats that
can be read and edited only by proprietary word processors, SGML
or XML for which the DTD and/or processing tools are not generally
available, and the machine-generated HTML produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the
material this License requires to appear in the title page. For
works in formats which do not have any title page as such, "Title
Page" means the text near the most prominent appearance of the
work's title, preceding the beginning of the body of the text.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License
applies to the Document are reproduced in all copies, and that you
add no other conditions whatsoever to those of this License. You
may not use technical measures to obstruct or control the reading
or further copying of the copies you make or distribute. However,
you may accept compensation in exchange for copies. If you
distribute a large enough number of copies you must also follow
the conditions in section 3.
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies of the Document numbering more than
100, and the Document's license notice requires Cover Texts, you
must enclose the copies in covers that carry, clearly and legibly,
all these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
front cover must present the full title with all words of the
title equally prominent and visible. You may add other material
on the covers in addition. Copying with changes limited to the
covers, as long as they preserve the title of the Document and
satisfy these conditions, can be treated as verbatim copying in
other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto
adjacent pages.
If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a
machine-readable Transparent copy along with each Opaque copy, or
state in or with each Opaque copy a publicly-accessible
computer-network location containing a complete Transparent copy
of the Document, free of added material, which the general
network-using public has access to download anonymously at no
charge using public-standard network protocols. If you use the
latter option, you must take reasonably prudent steps, when you
begin distribution of Opaque copies in quantity, to ensure that
this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you
distribute an Opaque copy (directly or through your agents or
retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of
copies, to give them a chance to provide you with an updated
version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
release the Modified Version under precisely this License, with
the Modified Version filling the role of the Document, thus
licensing distribution and modification of the Modified Version to
whoever possesses a copy of it. In addition, you must do these
things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title
distinct from that of the Document, and from those of previous
versions (which should, if there were any, be listed in the
History section of the Document). You may use the same title
as a previous version if the original publisher of that version
gives permission.
B. List on the Title Page, as authors, one or more persons or
entities responsible for authorship of the modifications in the
Modified Version, together with at least five of the principal
authors of the Document (all of its principal authors, if it
has less than five).
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license
notice giving the public permission to use the Modified Version
under the terms of this License, in the form shown in the
Addendum below.
G. Preserve in that license notice the full lists of Invariant
Sections and required Cover Texts given in the Document's
license notice.
H. Include an unaltered copy of this License.
I. Preserve the section entitled "History", and its title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page.
If there is no section entitled "History" in the Document,
create one stating the title, year, authors, and publisher of
the Document as given on its Title Page, then add an item
describing the Modified Version as stated in the previous
sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for
previous versions it was based on. These may be placed in the
"History" section. You may omit a network location for a work
that was published at least four years before the Document
itself, or if the original publisher of the version it refers
to gives permission.
K. In any section entitled "Acknowledgements" or "Dedications",
preserve the section's title, and preserve in the section all the
substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section entitled "Endorsements." Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section as "Endorsements" or to
conflict in title with any Invariant Section.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
material copied from the Document, you may at your option
designate some or all of these sections as invariant. To do this,
add their titles to the list of Invariant Sections in the Modified
Version's license notice. These titles must be distinct from any
other section titles.
You may add a section entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties-for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition
of a standard.
You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end
of the list of Cover Texts in the Modified Version. Only one
passage of Front-Cover Text and one of Back-Cover Text may be
added by (or through arrangements made by) any one entity. If the
Document already includes a cover text for the same cover,
previously added by you or by arrangement made by the same entity
you are acting on behalf of, you may not add another; but you may
replace the old one, on explicit permission from the previous
publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under
this License, under the terms defined in section 4 above for
modified versions, provided that you include in the combination
all of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
combined work in its license notice.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name
but different contents, make the title of each such section unique
by adding at the end of it, in parentheses, the name of the
original author or publisher of that section if known, or else a
unique number. Make the same adjustment to the section titles in
the list of Invariant Sections in the license notice of the
combined work.
In the combination, you must combine any sections entitled
"History" in the various original documents, forming one section
entitled "History"; likewise combine any sections entitled
"Acknowledgements", and any sections entitled "Dedications." You
must delete all sections entitled "Endorsements."
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the
rules of this License for verbatim copying of each of the
documents in all other respects.
You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert
a copy of this License into the extracted document, and follow
this License in all other respects regarding verbatim copying of
that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of
a storage or distribution medium, does not as a whole count as a
Modified Version of the Document, provided no compilation
copyright is claimed for the compilation. Such a compilation is
called an "aggregate", and this License does not apply to the
other self-contained works thus compiled with the Document, on
account of their being thus compiled, if they are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one
quarter of the entire aggregate, the Document's Cover Texts may be
placed on covers that surround only the Document within the
aggregate. Otherwise they must appear on covers around the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section
4. Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License provided that you also include the
original English version of this License. In case of a
disagreement between the translation and the original English
version of this License, the original English version will prevail.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided for under this License. Any other
attempt to copy, modify, sublicense or distribute the Document is
void, and will automatically terminate your rights under this
License. However, parties who have received copies, or rights,
from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered
version of this License "or any later version" applies to it, you
have the option of following the terms and conditions either of
that specified version or of any later version that has been
published (not as a draft) by the Free Software Foundation. If
the Document does not specify a version number of this License,
you may choose any version ever published (not as a draft) by the
Free Software Foundation.
ADDENDUM: How to use this License for your documents
====================================================
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:
Copyright (C) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
A copy of the license is included in the section entitled "GNU
Free Documentation License."
If you have no Invariant Sections, write "with no Invariant Sections"
instead of saying which ones are invariant. If you have no Front-Cover
Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being
LIST"; likewise for Back-Cover Texts.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License, to
permit their use in free software.

File: ld.info, Node: Index, Prev: GNU Free Documentation License, Up: Top
Index
*****
* Menu:
* ": Symbols.
* -(: Options.
* --accept-unknown-input-arch: Options.
* --add-stdcall-alias: Options.
* --allow-multiple-definition: Options.
* --allow-shlib-undefined: Options.
* --architecture=ARCH: Options.
* --auxiliary: Options.
* --base-file: Options.
* --check-sections: Options.
* --cref: Options.
* --defsym SYMBOL=EXP: Options.
* --demangle[=STYLE]: Options.
* --disable-auto-image-base: Options.
* --disable-auto-import: Options.
* --disable-new-dtags: Options.
* --disable-runtime-pseudo-reloc: Options.
* --disable-stdcall-fixup: Options.
* --discard-all: Options.
* --discard-locals: Options.
* --dll: Options.
* --dll-search-prefix: Options.
* --dynamic-linker FILE: Options.
* --embedded-relocs: Options.
* --emit-relocs: Options.
* --enable-auto-image-base: Options.
* --enable-auto-import: Options.
* --enable-extra-pe-debug: Options.
* --enable-new-dtags: Options.
* --enable-runtime-pseudo-reloc: Options.
* --enable-stdcall-fixup: Options.
* --entry=ENTRY: Options.
* --exclude-libs: Options.
* --exclude-symbols: Options.
* --export-all-symbols: Options.
* --export-dynamic: Options.
* --fatal-warnings: Options.
* --file-alignment: Options.
* --filter: Options.
* --force-exe-suffix: Options.
* --format=FORMAT: Options.
* --format=VERSION: TI COFF.
* --gc-sections: Options.
* --gpsize: Options.
* --heap: Options.
* --help: Options.
* --image-base: Options.
* --just-symbols=FILE: Options.
* --kill-at: Options.
* --library-path=DIR: Options.
* --library=ARCHIVE: Options.
* --major-image-version: Options.
* --major-os-version: Options.
* --major-subsystem-version: Options.
* --minor-image-version: Options.
* --minor-os-version: Options.
* --minor-subsystem-version: Options.
* --mri-script=MRI-CMDFILE: Options.
* --multi-subspace: HPPA ELF32.
* --nmagic: Options.
* --no-accept-unknown-input-arch: Options.
* --no-allow-shlib-undefined: Options.
* --no-check-sections: Options.
* --no-define-common: Options.
* --no-demangle: Options.
* --no-gc-sections: Options.
* --no-keep-memory: Options.
* --no-omagic: Options.
* --no-relax: Xtensa.
* --no-undefined: Options.
* --no-undefined-version: Options.
* --no-warn-mismatch: Options.
* --no-whole-archive: Options.
* --noinhibit-exec: Options.
* --oformat: Options.
* --omagic: Options.
* --out-implib: Options.
* --output-def: Options.
* --output=OUTPUT: Options.
* --print-map: Options.
* --relax: Options.
* --relax on i960: i960.
* --relax on Xtensa: Xtensa.
* --relocateable: Options.
* --script=SCRIPT: Options.
* --section-alignment: Options.
* --section-start SECTIONNAME=ORG: Options.
* --sort-common: Options.
* --split-by-file: Options.
* --split-by-reloc: Options.
* --stack: Options.
* --stats: Options.
* --strip-all: Options.
* --strip-debug: Options.
* --stub-group-size=N: HPPA ELF32.
* --subsystem: Options.
* --support-old-code: ARM.
* --target-help: Options.
* --thumb-entry=ENTRY: ARM.
* --trace: Options.
* --trace-symbol=SYMBOL: Options.
* --traditional-format: Options.
* --undefined=SYMBOL: Options.
* --unique[=SECTION]: Options.
* --verbose: Options.
* --version: Options.
* --version-script=VERSION-SCRIPTFILE: Options.
* --warn-common: Options.
* --warn-constructors: Options.
* --warn-multiple-gp: Options.
* --warn-once: Options.
* --warn-section-align: Options.
* --whole-archive: Options.
* --wrap: Options.
* -AARCH: Options.
* -aKEYWORD: Options.
* -assert KEYWORD: Options.
* -b FORMAT: Options.
* -Bdynamic: Options.
* -Bgroup: Options.
* -Bshareable: Options.
* -Bstatic: Options.
* -Bsymbolic: Options.
* -c MRI-CMDFILE: Options.
* -call_shared: Options.
* -d: Options.
* -dc: Options.
* -dn: Options.
* -dp: Options.
* -dy: Options.
* -E: Options.
* -e ENTRY: Options.
* -EB: Options.
* -EL: Options.
* -F: Options.
* -f: Options.
* -fini: Options.
* -G: Options.
* -g: Options.
* -hNAME: Options.
* -i: Options.
* -IFILE: Options.
* -init: Options.
* -lARCHIVE: Options.
* -LDIR: Options.
* -M: Options.
* -m EMULATION: Options.
* -Map: Options.
* -N: Options.
* -n: Options.
* -non_shared: Options.
* -nostdlib: Options.
* -O LEVEL: Options.
* -o OUTPUT: Options.
* -q: Options.
* -qmagic: Options.
* -Qy: Options.
* -r: Options.
* -R FILE: Options.
* -rpath: Options.
* -rpath-link: Options.
* -S: Options.
* -s: Options.
* -shared: Options.
* -soname=NAME: Options.
* -static: Options.
* -t: Options.
* -T SCRIPT: Options.
* -Tbss ORG: Options.
* -Tdata ORG: Options.
* -Ttext ORG: Options.
* -u SYMBOL: Options.
* -Ur: Options.
* -V: Options.
* -v: Options.
* -X: Options.
* -x: Options.
* -Y PATH: Options.
* -y SYMBOL: Options.
* -z defs: Options.
* -z KEYWORD: Options.
* -z muldefs: Options.
* .: Location Counter.
* /DISCARD/: Output Section Discarding.
* :PHDR: Output Section Phdr.
* =FILLEXP: Output Section Fill.
* >REGION: Output Section Region.
* [COMMON]: Input Section Common.
* ABSOLUTE (MRI): MRI.
* absolute and relocatable symbols: Expression Section.
* absolute expressions: Expression Section.
* ABSOLUTE(EXP): Builtin Functions.
* ADDR(SECTION): Builtin Functions.
* address, section: Output Section Address.
* ALIAS (MRI): MRI.
* ALIGN (MRI): MRI.
* align location counter: Builtin Functions.
* ALIGN(EXP): Builtin Functions.
* allocating memory: MEMORY.
* architecture: Miscellaneous Commands.
* architectures: Options.
* archive files, from cmd line: Options.
* archive search path in linker script: File Commands.
* arithmetic: Expressions.
* arithmetic operators: Operators.
* ARM interworking support: ARM.
* ASSERT: Miscellaneous Commands.
* assertion in linker script: Miscellaneous Commands.
* assignment in scripts: Assignments.
* AT(LMA): Output Section LMA.
* AT>LMA_REGION: Output Section LMA.
* automatic data imports: WIN32.
* back end: BFD.
* BASE (MRI): MRI.
* BFD canonical format: Canonical format.
* BFD requirements: BFD.
* big-endian objects: Options.
* binary input format: Options.
* BLOCK(EXP): Builtin Functions.
* bug criteria: Bug Criteria.
* bug reports: Bug Reporting.
* bugs in ld: Reporting Bugs.
* BYTE(EXPRESSION): Output Section Data.
* C++ constructors, arranging in link: Output Section Keywords.
* CHIP (MRI): MRI.
* COLLECT_NO_DEMANGLE: Environment.
* combining symbols, warnings on: Options.
* command files: Scripts.
* command line: Options.
* common allocation: Options.
* common allocation in linker script: Miscellaneous Commands.
* common symbol placement: Input Section Common.
* compatibility, MRI: Options.
* constants in linker scripts: Constants.
* CONSTRUCTORS: Output Section Keywords.
* constructors: Options.
* constructors, arranging in link: Output Section Keywords.
* crash of linker: Bug Criteria.
* CREATE_OBJECT_SYMBOLS: Output Section Keywords.
* creating a DEF file: WIN32.
* cross reference table: Options.
* cross references: Miscellaneous Commands.
* current output location: Location Counter.
* data: Output Section Data.
* DATA_SEGMENT_ALIGN(MAXPAGESIZE, COMMONPAGESIZE): Builtin Functions.
* DATA_SEGMENT_END(EXP): Builtin Functions.
* dbx: Options.
* DEF files, creating: Options.
* default emulation: Environment.
* default input format: Environment.
* DEFINED(SYMBOL): Builtin Functions.
* deleting local symbols: Options.
* demangling, default: Environment.
* demangling, from command line: Options.
* direct linking to a dll: WIN32.
* discarding sections: Output Section Discarding.
* discontinuous memory: MEMORY.
* DLLs, creating: Options.
* DLLs, linking to: Options.
* dot: Location Counter.
* dot inside sections: Location Counter.
* dynamic linker, from command line: Options.
* dynamic symbol table: Options.
* ELF program headers: PHDRS.
* emulation: Options.
* emulation, default: Environment.
* END (MRI): MRI.
* endianness: Options.
* entry point: Entry Point.
* entry point, from command line: Options.
* entry point, thumb: ARM.
* ENTRY(SYMBOL): Entry Point.
* error on valid input: Bug Criteria.
* example of linker script: Simple Example.
* exporting DLL symbols: WIN32.
* expression evaluation order: Evaluation.
* expression sections: Expression Section.
* expression, absolute: Builtin Functions.
* expressions: Expressions.
* EXTERN: Miscellaneous Commands.
* fatal signal: Bug Criteria.
* file name wildcard patterns: Input Section Wildcards.
* FILEHDR: PHDRS.
* filename symbols: Output Section Keywords.
* fill pattern, entire section: Output Section Fill.
* FILL(EXPRESSION): Output Section Data.
* finalization function: Options.
* first input file: File Commands.
* first instruction: Entry Point.
* FORCE_COMMON_ALLOCATION: Miscellaneous Commands.
* FORMAT (MRI): MRI.
* functions in expressions: Builtin Functions.
* garbage collection <1>: Input Section Keep.
* garbage collection: Options.
* generating optimized output: Options.
* GNU linker: Overview.
* GNUTARGET: Environment.
* GROUP(FILES): File Commands.
* grouping input files: File Commands.
* groups of archives: Options.
* H8/300 support: H8/300.
* header size: Builtin Functions.
* heap size: Options.
* help: Options.
* holes: Location Counter.
* holes, filling: Output Section Data.
* HPPA multiple sub-space stubs: HPPA ELF32.
* HPPA stub grouping: HPPA ELF32.
* i960 support: i960.
* image base: Options.
* implicit linker scripts: Implicit Linker Scripts.
* import libraries: WIN32.
* INCLUDE FILENAME: File Commands.
* including a linker script: File Commands.
* including an entire archive: Options.
* incremental link: Options.
* INHIBIT_COMMON_ALLOCATION: Miscellaneous Commands.
* initialization function: Options.
* initialized data in ROM: Output Section LMA.
* input file format in linker script: Format Commands.
* input filename symbols: Output Section Keywords.
* input files in linker scripts: File Commands.
* input files, displaying: Options.
* input format: Options.
* input object files in linker scripts: File Commands.
* input section basics: Input Section Basics.
* input section wildcards: Input Section Wildcards.
* input sections: Input Section.
* INPUT(FILES): File Commands.
* integer notation: Constants.
* integer suffixes: Constants.
* internal object-file format: Canonical format.
* invalid input: Bug Criteria.
* K and M integer suffixes: Constants.
* KEEP: Input Section Keep.
* l =: MEMORY.
* L, deleting symbols beginning: Options.
* lazy evaluation: Evaluation.
* ld bugs, reporting: Bug Reporting.
* LDEMULATION: Environment.
* len =: MEMORY.
* LENGTH =: MEMORY.
* library search path in linker script: File Commands.
* link map: Options.
* link-time runtime library search path: Options.
* linker crash: Bug Criteria.
* linker script concepts: Basic Script Concepts.
* linker script example: Simple Example.
* linker script file commands: File Commands.
* linker script format: Script Format.
* linker script input object files: File Commands.
* linker script simple commands: Simple Commands.
* linker scripts: Scripts.
* LIST (MRI): MRI.
* little-endian objects: Options.
* LOAD (MRI): MRI.
* load address: Output Section LMA.
* LOADADDR(SECTION): Builtin Functions.
* loading, preventing: Output Section Type.
* local symbols, deleting: Options.
* location counter: Location Counter.
* LONG(EXPRESSION): Output Section Data.
* M and K integer suffixes: Constants.
* machine architecture: Miscellaneous Commands.
* machine dependencies: Machine Dependent.
* mapping input sections to output sections: Input Section.
* MAX: Builtin Functions.
* MEMORY: MEMORY.
* memory region attributes: MEMORY.
* memory regions: MEMORY.
* memory regions and sections: Output Section Region.
* memory usage: Options.
* MIN: Builtin Functions.
* MIPS embedded PIC code: Options.
* MRI compatibility: MRI.
* MSP430 extra sections: MSP430.
* NAME (MRI): MRI.
* name, section: Output Section Name.
* names: Symbols.
* naming the output file: Options.
* NEXT(EXP): Builtin Functions.
* NMAGIC: Options.
* NOCROSSREFS(SECTIONS): Miscellaneous Commands.
* NOLOAD: Output Section Type.
* not enough room for program headers: Builtin Functions.
* o =: MEMORY.
* objdump -i: BFD.
* object file management: BFD.
* object files: Options.
* object formats available: BFD.
* object size: Options.
* OMAGIC: Options.
* opening object files: BFD outline.
* operators for arithmetic: Operators.
* options: Options.
* ORDER (MRI): MRI.
* org =: MEMORY.
* ORIGIN =: MEMORY.
* output file after errors: Options.
* output file format in linker script: Format Commands.
* output file name in linker scripot: File Commands.
* output section attributes: Output Section Attributes.
* output section data: Output Section Data.
* OUTPUT(FILENAME): File Commands.
* OUTPUT_ARCH(BFDARCH): Miscellaneous Commands.
* OUTPUT_FORMAT(BFDNAME): Format Commands.
* OVERLAY: Overlay Description.
* overlays: Overlay Description.
* partial link: Options.
* PHDRS: PHDRS.
* precedence in expressions: Operators.
* prevent unnecessary loading: Output Section Type.
* program headers: PHDRS.
* program headers and sections: Output Section Phdr.
* program headers, not enough room: Builtin Functions.
* program segments: PHDRS.
* PROVIDE: PROVIDE.
* PUBLIC (MRI): MRI.
* QUAD(EXPRESSION): Output Section Data.
* quoted symbol names: Symbols.
* read-only text: Options.
* read/write from cmd line: Options.
* regions of memory: MEMORY.
* relative expressions: Expression Section.
* relaxing addressing modes: Options.
* relaxing on H8/300: H8/300.
* relaxing on i960: i960.
* relaxing on Xtensa: Xtensa.
* relocatable and absolute symbols: Expression Section.
* relocatable output: Options.
* removing sections: Output Section Discarding.
* reporting bugs in ld: Reporting Bugs.
* requirements for BFD: BFD.
* retain relocations in final executable: Options.
* retaining specified symbols: Options.
* ROM initialized data: Output Section LMA.
* round up location counter: Builtin Functions.
* runtime library name: Options.
* runtime library search path: Options.
* runtime pseudo-relocation: WIN32.
* scaled integers: Constants.
* scommon section: Input Section Common.
* script files: Options.
* scripts: Scripts.
* search directory, from cmd line: Options.
* search path in linker script: File Commands.
* SEARCH_DIR(PATH): File Commands.
* SECT (MRI): MRI.
* section address: Output Section Address.
* section address in expression: Builtin Functions.
* section alignment, warnings on: Options.
* section data: Output Section Data.
* section fill pattern: Output Section Fill.
* section load address: Output Section LMA.
* section load address in expression: Builtin Functions.
* section name: Output Section Name.
* section name wildcard patterns: Input Section Wildcards.
* section size: Builtin Functions.
* section, assigning to memory region: Output Section Region.
* section, assigning to program header: Output Section Phdr.
* SECTIONS: SECTIONS.
* sections, discarding: Output Section Discarding.
* segment origins, cmd line: Options.
* segments, ELF: PHDRS.
* shared libraries: Options.
* SHORT(EXPRESSION): Output Section Data.
* SIZEOF(SECTION): Builtin Functions.
* SIZEOF_HEADERS: Builtin Functions.
* small common symbols: Input Section Common.
* SORT: Input Section Wildcards.
* SQUAD(EXPRESSION): Output Section Data.
* stack size: Options.
* standard Unix system: Options.
* start of execution: Entry Point.
* STARTUP(FILENAME): File Commands.
* strip all symbols: Options.
* strip debugger symbols: Options.
* stripping all but some symbols: Options.
* suffixes for integers: Constants.
* symbol defaults: Builtin Functions.
* symbol definition, scripts: Assignments.
* symbol names: Symbols.
* symbol tracing: Options.
* symbol versions: VERSION.
* symbol-only input: Options.
* symbols, from command line: Options.
* symbols, relocatable and absolute: Expression Section.
* symbols, retaining selectively: Options.
* synthesizing linker: Options.
* synthesizing on H8/300: H8/300.
* TARGET(BFDNAME): Format Commands.
* thumb entry point: ARM.
* TI COFF versions: TI COFF.
* traditional format: Options.
* unallocated address, next: Builtin Functions.
* undefined symbol: Options.
* undefined symbol in linker script: Miscellaneous Commands.
* undefined symbols, warnings on: Options.
* uninitialized data placement: Input Section Common.
* unspecified memory: Output Section Data.
* usage: Options.
* using a DEF file: WIN32.
* using auto-export functionality: WIN32.
* Using decorations: WIN32.
* variables, defining: Assignments.
* verbose: Options.
* version: Options.
* version script: VERSION.
* version script, symbol versions: Options.
* VERSION {script text}: VERSION.
* versions of symbols: VERSION.
* warnings, on combining symbols: Options.
* warnings, on section alignment: Options.
* warnings, on undefined symbols: Options.
* what is this?: Overview.
* wildcard file name patterns: Input Section Wildcards.
* Xtensa processors: Xtensa.

View File

@ -1,5 +1,5 @@
/* ld-emul.h - Linker emulation header file
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -20,104 +20,103 @@
#include "getopt.h"
extern void ldemul_hll
PARAMS ((char *));
(char *);
extern void ldemul_syslib
PARAMS ((char *));
(char *);
extern void ldemul_after_parse
PARAMS ((void));
(void);
extern void ldemul_before_parse
PARAMS ((void));
(void);
extern void ldemul_after_open
PARAMS ((void));
(void);
extern void ldemul_after_allocation
PARAMS ((void));
(void);
extern void ldemul_before_allocation
PARAMS ((void));
(void);
extern void ldemul_set_output_arch
PARAMS ((void));
(void);
extern char *ldemul_choose_target
PARAMS ((int, char**));
(int, char**);
extern void ldemul_choose_mode
PARAMS ((char *));
(char *);
extern void ldemul_list_emulations
PARAMS ((FILE *));
(FILE *);
extern void ldemul_list_emulation_options
PARAMS ((FILE *));
(FILE *);
extern char *ldemul_get_script
PARAMS ((int *isfile));
(int *isfile);
extern void ldemul_finish
PARAMS ((void));
(void);
extern void ldemul_set_symbols
PARAMS ((void));
(void);
extern void ldemul_create_output_section_statements
PARAMS ((void));
(void);
extern bfd_boolean ldemul_place_orphan
PARAMS ((struct lang_input_statement_struct *, asection *));
(struct lang_input_statement_struct *, asection *);
extern bfd_boolean ldemul_parse_args
PARAMS ((int, char **));
(int, char **);
extern void ldemul_add_options
PARAMS ((int, char **, int, struct option **, int, struct option **));
(int, char **, int, struct option **, int, struct option **);
extern bfd_boolean ldemul_handle_option
PARAMS ((int));
(int);
extern bfd_boolean ldemul_unrecognized_file
PARAMS ((struct lang_input_statement_struct *));
(struct lang_input_statement_struct *);
extern bfd_boolean ldemul_recognized_file
PARAMS ((struct lang_input_statement_struct *));
(struct lang_input_statement_struct *);
extern bfd_boolean ldemul_open_dynamic_archive
PARAMS ((const char *, struct search_dirs *,
struct lang_input_statement_struct *));
(const char *, struct search_dirs *, struct lang_input_statement_struct *);
extern char *ldemul_default_target
PARAMS ((int, char**));
(int, char**);
extern void after_parse_default
PARAMS ((void));
(void);
extern void after_open_default
PARAMS ((void));
(void);
extern void after_allocation_default
PARAMS ((void));
(void);
extern void before_allocation_default
PARAMS ((void));
(void);
extern void set_output_arch_default
PARAMS ((void));
(void);
extern void syslib_default
PARAMS ((char*));
(char*);
extern void hll_default
PARAMS ((char*));
(char*);
extern int ldemul_find_potential_libraries
PARAMS ((char *, struct lang_input_statement_struct *));
(char *, struct lang_input_statement_struct *);
extern struct bfd_elf_version_expr *ldemul_new_vers_pattern
PARAMS ((struct bfd_elf_version_expr *));
(struct bfd_elf_version_expr *);
typedef struct ld_emulation_xfer_struct {
/* Run before parsing the command line and script file.
Set the architecture, maybe other things. */
void (*before_parse) PARAMS ((void));
void (*before_parse) (void);
/* Handle the SYSLIB (low level library) script command. */
void (*syslib) PARAMS ((char *));
void (*syslib) (char *);
/* Handle the HLL (high level library) script command. */
void (*hll) PARAMS ((char *));
void (*hll) (char *);
/* Run after parsing the command line and script file. */
void (*after_parse) PARAMS ((void));
void (*after_parse) (void);
/* Run after opening all input files, and loading the symbols. */
void (*after_open) PARAMS ((void));
void (*after_open) (void);
/* Run after allocating output sections. */
void (*after_allocation) PARAMS ( (void));
void (*after_allocation) (void);
/* Set the output architecture and machine if possible. */
void (*set_output_arch) PARAMS ((void));
void (*set_output_arch) (void);
/* Decide which target name to use. */
char * (*choose_target) PARAMS ((int, char**));
char * (*choose_target) (int, char**);
/* Run before allocating output sections. */
void (*before_allocation) PARAMS ((void));
void (*before_allocation) (void);
/* Return the appropriate linker script. */
char * (*get_script) PARAMS ((int *isfile));
char * (*get_script) (int *isfile);
/* The name of this emulation. */
char *emulation_name;
@ -126,65 +125,65 @@ typedef struct ld_emulation_xfer_struct {
char *target_name;
/* Run after assigning values from the script. */
void (*finish) PARAMS ((void));
void (*finish) (void);
/* Create any output sections needed by the target. */
void (*create_output_section_statements) PARAMS ((void));
void (*create_output_section_statements) (void);
/* Try to open a dynamic library. ARCH is an architecture name, and
is normally the empty string. ENTRY is the lang_input_statement
that should be opened. */
bfd_boolean (*open_dynamic_archive)
PARAMS ((const char *arch, struct search_dirs *,
struct lang_input_statement_struct *entry));
(const char *arch, struct search_dirs *,
struct lang_input_statement_struct *entry);
/* Place an orphan section. Return TRUE if it was placed, FALSE if
the default action should be taken. This field may be NULL, in
which case the default action will always be taken. */
bfd_boolean (*place_orphan)
PARAMS ((struct lang_input_statement_struct *, asection *));
(struct lang_input_statement_struct *, asection *);
/* Run after assigning parsing with the args, but before
reading the script. Used to initialize symbols used in the script. */
void (*set_symbols) PARAMS ((void));
void (*set_symbols) (void);
/* Parse args which the base linker doesn't understand.
Return TRUE if the arg needs no further processing. */
bfd_boolean (*parse_args) PARAMS ((int, char **));
bfd_boolean (*parse_args) (int, char **);
/* Hook to add options to parameters passed by the base linker to
getopt_long and getopt_long_only calls. */
void (*add_options)
PARAMS ((int, char **, int, struct option **, int, struct option **));
(int, char **, int, struct option **, int, struct option **);
/* Companion to the above to handle an option. Returns TRUE if it is
one of our options. */
bfd_boolean (*handle_option) PARAMS ((int));
bfd_boolean (*handle_option) (int);
/* Run to handle files which are not recognized as object files or
archives. Return TRUE if the file was handled. */
bfd_boolean (*unrecognized_file)
PARAMS ((struct lang_input_statement_struct *));
(struct lang_input_statement_struct *);
/* Run to list the command line options which parse_args handles. */
void (* list_options) PARAMS ((FILE *));
void (* list_options) (FILE *);
/* Run to specially handle files which *are* recognized as object
files or archives. Return TRUE if the file was handled. */
bfd_boolean (*recognized_file)
PARAMS ((struct lang_input_statement_struct *));
(struct lang_input_statement_struct *);
/* Called when looking for libraries in a directory specified
via a linker command line option or linker script option.
Files that match the pattern "lib*.a" have already been scanned.
(For VMS files matching ":lib*.a" have also been scanned). */
int (* find_potential_libraries)
PARAMS ((char *, struct lang_input_statement_struct *));
(char *, struct lang_input_statement_struct *);
/* Called when adding a new version pattern. PowerPC64-ELF uses
this hook to add a pattern matching ".foo" for every "foo". */
struct bfd_elf_version_expr * (*new_vers_pattern)
PARAMS ((struct bfd_elf_version_expr *));
(struct bfd_elf_version_expr *);
} ld_emulation_xfer_type;

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* Parse options for the GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003
2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -53,91 +53,97 @@
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
static int is_num PARAMS ((const char *, int, int, int));
static void set_default_dirlist PARAMS ((char *));
static void set_section_start PARAMS ((char *, char *));
static void help PARAMS ((void));
static void set_default_dirlist (char *);
static void set_section_start (char *, char *);
static void help (void);
/* Non-zero if we are processing a --defsym from the command line. */
int parsing_defsym = 0;
/* Codes used for the long options with no short synonyms. 150 isn't
special; it's just an arbitrary non-ASCII char value. */
#define OPTION_ASSERT 150
#define OPTION_CALL_SHARED (OPTION_ASSERT + 1)
#define OPTION_CREF (OPTION_CALL_SHARED + 1)
#define OPTION_DEFSYM (OPTION_CREF + 1)
#define OPTION_DEMANGLE (OPTION_DEFSYM + 1)
#define OPTION_DYNAMIC_LINKER (OPTION_DEMANGLE + 1)
#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1)
#define OPTION_EL (OPTION_EB + 1)
#define OPTION_EMBEDDED_RELOCS (OPTION_EL + 1)
#define OPTION_EXPORT_DYNAMIC (OPTION_EMBEDDED_RELOCS + 1)
#define OPTION_HELP (OPTION_EXPORT_DYNAMIC + 1)
#define OPTION_IGNORE (OPTION_HELP + 1)
#define OPTION_MAP (OPTION_IGNORE + 1)
#define OPTION_NO_DEMANGLE (OPTION_MAP + 1)
#define OPTION_NO_KEEP_MEMORY (OPTION_NO_DEMANGLE + 1)
#define OPTION_NO_WARN_MISMATCH (OPTION_NO_KEEP_MEMORY + 1)
#define OPTION_NOINHIBIT_EXEC (OPTION_NO_WARN_MISMATCH + 1)
#define OPTION_NON_SHARED (OPTION_NOINHIBIT_EXEC + 1)
#define OPTION_NO_WHOLE_ARCHIVE (OPTION_NON_SHARED + 1)
#define OPTION_OFORMAT (OPTION_NO_WHOLE_ARCHIVE + 1)
#define OPTION_RELAX (OPTION_OFORMAT + 1)
#define OPTION_RETAIN_SYMBOLS_FILE (OPTION_RELAX + 1)
#define OPTION_RPATH (OPTION_RETAIN_SYMBOLS_FILE + 1)
#define OPTION_RPATH_LINK (OPTION_RPATH + 1)
#define OPTION_SHARED (OPTION_RPATH_LINK + 1)
#define OPTION_SONAME (OPTION_SHARED + 1)
#define OPTION_SORT_COMMON (OPTION_SONAME + 1)
#define OPTION_STATS (OPTION_SORT_COMMON + 1)
#define OPTION_SYMBOLIC (OPTION_STATS + 1)
#define OPTION_TASK_LINK (OPTION_SYMBOLIC + 1)
#define OPTION_TBSS (OPTION_TASK_LINK + 1)
#define OPTION_TDATA (OPTION_TBSS + 1)
#define OPTION_TTEXT (OPTION_TDATA + 1)
#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1)
#define OPTION_UR (OPTION_TRADITIONAL_FORMAT + 1)
#define OPTION_VERBOSE (OPTION_UR + 1)
#define OPTION_VERSION (OPTION_VERBOSE + 1)
#define OPTION_VERSION_SCRIPT (OPTION_VERSION + 1)
#define OPTION_VERSION_EXPORTS_SECTION (OPTION_VERSION_SCRIPT + 1)
#define OPTION_WARN_COMMON (OPTION_VERSION_EXPORTS_SECTION + 1)
#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1)
#define OPTION_WARN_FATAL (OPTION_WARN_CONSTRUCTORS + 1)
#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_FATAL + 1)
#define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1)
#define OPTION_WARN_SECTION_ALIGN (OPTION_WARN_ONCE + 1)
#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1)
#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1)
#define OPTION_FORCE_EXE_SUFFIX (OPTION_WRAP + 1)
#define OPTION_GC_SECTIONS (OPTION_FORCE_EXE_SUFFIX + 1)
#define OPTION_NO_GC_SECTIONS (OPTION_GC_SECTIONS + 1)
#define OPTION_CHECK_SECTIONS (OPTION_NO_GC_SECTIONS + 1)
#define OPTION_NO_CHECK_SECTIONS (OPTION_CHECK_SECTIONS + 1)
#define OPTION_MPC860C0 (OPTION_NO_CHECK_SECTIONS + 1)
#define OPTION_NO_UNDEFINED (OPTION_MPC860C0 + 1)
#define OPTION_INIT (OPTION_NO_UNDEFINED + 1)
#define OPTION_FINI (OPTION_INIT + 1)
#define OPTION_SECTION_START (OPTION_FINI + 1)
#define OPTION_UNIQUE (OPTION_SECTION_START + 1)
#define OPTION_TARGET_HELP (OPTION_UNIQUE + 1)
#define OPTION_ALLOW_SHLIB_UNDEFINED (OPTION_TARGET_HELP + 1)
#define OPTION_NO_ALLOW_SHLIB_UNDEFINED (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
#define OPTION_ALLOW_MULTIPLE_DEFINITION (OPTION_NO_ALLOW_SHLIB_UNDEFINED + 1)
#define OPTION_NO_UNDEFINED_VERSION (OPTION_ALLOW_MULTIPLE_DEFINITION + 1)
#define OPTION_DISCARD_NONE (OPTION_NO_UNDEFINED_VERSION + 1)
#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1)
#define OPTION_NO_DEFINE_COMMON (OPTION_SPARE_DYNAMIC_TAGS + 1)
#define OPTION_NOSTDLIB (OPTION_NO_DEFINE_COMMON + 1)
#define OPTION_NO_OMAGIC (OPTION_NOSTDLIB + 1)
#define OPTION_STRIP_DISCARDED (OPTION_NO_OMAGIC + 1)
#define OPTION_NO_STRIP_DISCARDED (OPTION_STRIP_DISCARDED + 1)
#define OPTION_ACCEPT_UNKNOWN_INPUT_ARCH (OPTION_NO_STRIP_DISCARDED + 1)
#define OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH (OPTION_ACCEPT_UNKNOWN_INPUT_ARCH + 1)
enum option_values
{
OPTION_ASSERT = 150,
OPTION_CALL_SHARED,
OPTION_CREF,
OPTION_DEFSYM,
OPTION_DEMANGLE,
OPTION_DYNAMIC_LINKER,
OPTION_EB,
OPTION_EL,
OPTION_EMBEDDED_RELOCS,
OPTION_EXPORT_DYNAMIC,
OPTION_HELP,
OPTION_IGNORE,
OPTION_MAP,
OPTION_NO_DEMANGLE,
OPTION_NO_KEEP_MEMORY,
OPTION_NO_WARN_MISMATCH,
OPTION_NOINHIBIT_EXEC,
OPTION_NON_SHARED,
OPTION_NO_WHOLE_ARCHIVE,
OPTION_OFORMAT,
OPTION_RELAX,
OPTION_RETAIN_SYMBOLS_FILE,
OPTION_RPATH,
OPTION_RPATH_LINK,
OPTION_SHARED,
OPTION_SONAME,
OPTION_SORT_COMMON,
OPTION_STATS,
OPTION_SYMBOLIC,
OPTION_TASK_LINK,
OPTION_TBSS,
OPTION_TDATA,
OPTION_TTEXT,
OPTION_TRADITIONAL_FORMAT,
OPTION_UR,
OPTION_VERBOSE,
OPTION_VERSION,
OPTION_VERSION_SCRIPT,
OPTION_VERSION_EXPORTS_SECTION,
OPTION_WARN_COMMON,
OPTION_WARN_CONSTRUCTORS,
OPTION_WARN_FATAL,
OPTION_WARN_MULTIPLE_GP,
OPTION_WARN_ONCE,
OPTION_WARN_SECTION_ALIGN,
OPTION_SPLIT_BY_RELOC,
OPTION_SPLIT_BY_FILE ,
OPTION_WHOLE_ARCHIVE,
OPTION_AS_NEEDED,
OPTION_NO_AS_NEEDED,
OPTION_WRAP,
OPTION_FORCE_EXE_SUFFIX,
OPTION_GC_SECTIONS,
OPTION_NO_GC_SECTIONS,
OPTION_CHECK_SECTIONS,
OPTION_NO_CHECK_SECTIONS,
OPTION_NO_UNDEFINED,
OPTION_INIT,
OPTION_FINI,
OPTION_SECTION_START,
OPTION_UNIQUE,
OPTION_TARGET_HELP,
OPTION_ALLOW_SHLIB_UNDEFINED,
OPTION_NO_ALLOW_SHLIB_UNDEFINED,
OPTION_ALLOW_MULTIPLE_DEFINITION,
OPTION_NO_UNDEFINED_VERSION,
OPTION_DISCARD_NONE,
OPTION_SPARE_DYNAMIC_TAGS,
OPTION_NO_DEFINE_COMMON,
OPTION_NOSTDLIB,
OPTION_NO_OMAGIC,
OPTION_STRIP_DISCARDED,
OPTION_NO_STRIP_DISCARDED,
OPTION_ACCEPT_UNKNOWN_INPUT_ARCH,
OPTION_NO_ACCEPT_UNKNOWN_INPUT_ARCH,
OPTION_PIE,
OPTION_UNRESOLVED_SYMBOLS,
OPTION_WARN_UNRESOLVED_SYMBOLS,
OPTION_ERROR_UNRESOLVED_SYMBOLS
};
/* The long options. This structure is used for both the option
parsing and the help text. */
@ -233,8 +239,8 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH },
{ {"emit-relocs", no_argument, NULL, 'q'},
'q', NULL, "Generate relocations in final output", TWO_DASHES },
{ {"relocateable", no_argument, NULL, 'r'},
'r', NULL, N_("Generate relocateable output"), TWO_DASHES },
{ {"relocatable", no_argument, NULL, 'r'},
'r', NULL, N_("Generate relocatable output"), TWO_DASHES },
{ {NULL, no_argument, NULL, '\0'},
'i', NULL, NULL, ONE_DASH },
{ {"just-symbols", required_argument, NULL, 'R'},
@ -334,11 +340,11 @@ static const struct ld_option ld_options[] =
{ {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
'\0', NULL, N_("Use less memory and more disk I/O"), TWO_DASHES },
{ {"no-undefined", no_argument, NULL, OPTION_NO_UNDEFINED},
'\0', NULL, N_("Allow no undefined symbols"), TWO_DASHES },
'\0', NULL, N_("Do not allow unresolved references in object files"), TWO_DASHES },
{ {"allow-shlib-undefined", no_argument, NULL, OPTION_ALLOW_SHLIB_UNDEFINED},
'\0', NULL, N_("Allow undefined symbols in shared objects (the default)"), TWO_DASHES },
'\0', NULL, N_("Allow unresolved references in shared libaries"), TWO_DASHES },
{ {"no-allow-shlib-undefined", no_argument, NULL, OPTION_NO_ALLOW_SHLIB_UNDEFINED},
'\0', NULL, N_("Do not allow undefined symbols in shared objects"), TWO_DASHES },
'\0', NULL, N_("Do not allow unresolved references in shared libs"), TWO_DASHES },
{ {"allow-multiple-definition", no_argument, NULL, OPTION_ALLOW_MULTIPLE_DEFINITION},
'\0', NULL, N_("Allow multiple definitions"), TWO_DASHES },
{ {"no-undefined-version", no_argument, NULL, OPTION_NO_UNDEFINED_VERSION},
@ -370,6 +376,10 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Create a shared library"), ONE_DASH },
{ {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD, NetBSD. */
'\0', NULL, NULL, ONE_DASH },
{ {"pie", no_argument, NULL, OPTION_PIE},
'\0', NULL, N_("Create a position independent executable"), ONE_DASH },
{ {"pic-executable", no_argument, NULL, OPTION_PIE},
'\0', NULL, NULL, TWO_DASHES },
{ {"sort-common", no_argument, NULL, OPTION_SORT_COMMON},
'\0', NULL, N_("Sort common symbols by size"), TWO_DASHES },
{ {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
@ -396,6 +406,9 @@ static const struct ld_option ld_options[] =
'\0', N_("ADDRESS"), N_("Set address of .data section"), ONE_DASH },
{ {"Ttext", required_argument, NULL, OPTION_TTEXT},
'\0', N_("ADDRESS"), N_("Set address of .text section"), ONE_DASH },
{ {"unresolved-symbols=<method>", required_argument, NULL, OPTION_UNRESOLVED_SYMBOLS},
'\0', NULL, N_("How to handle unresolved symbols. <method> is:\n\t\t\t\tignore-all, report-all, ignore-in-object-files,\n\t\t\t\tignore-in-shared-libs"),
TWO_DASHES },
{ {"verbose", no_argument, NULL, OPTION_VERBOSE},
'\0', NULL, N_("Output lots of information during link"), TWO_DASHES },
{ {"dll-verbose", no_argument, NULL, OPTION_VERBOSE}, /* Linux. */
@ -418,6 +431,10 @@ static const struct ld_option ld_options[] =
{ {"warn-section-align", no_argument, NULL, OPTION_WARN_SECTION_ALIGN},
'\0', NULL, N_("Warn if start of section changes due to alignment"),
TWO_DASHES },
{ {"warn-unresolved-symbols", no_argument, NULL, OPTION_WARN_UNRESOLVED_SYMBOLS},
'\0', NULL, N_("Report unresolved symbols as warnings"), TWO_DASHES },
{ {"error-unresolved-symbols", no_argument, NULL, OPTION_ERROR_UNRESOLVED_SYMBOLS},
'\0', NULL, N_("Report unresolved symbols as errors"), TWO_DASHES },
{ {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL},
'\0', NULL, N_("Treat warnings as errors"),
TWO_DASHES },
@ -425,45 +442,18 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Include all objects from following archives"), TWO_DASHES },
{ {"Bforcearchive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
'\0', NULL, NULL, TWO_DASHES }, /* NetBSD. */
{ {"as-needed", no_argument, NULL, OPTION_AS_NEEDED},
'\0', NULL, N_("Only set DT_NEEDED for following dynamic libs if used"), TWO_DASHES },
{ {"no-as-needed", no_argument, NULL, OPTION_NO_AS_NEEDED},
'\0', NULL, N_("Always set DT_NEEDED for following dynamic libs"), TWO_DASHES },
{ {"wrap", required_argument, NULL, OPTION_WRAP},
'\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
{ {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0},
'\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10,\n\t\t\t\tdefault 5) words of a page"), TWO_DASHES }
'\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }
};
#define OPTION_COUNT ARRAY_SIZE (ld_options)
/* Test STRING for containing a string of digits that form a number
between MIN and MAX. The return value is the number or ERR. */
static int
is_num (string, min, max, err)
const char *string;
int min;
int max;
int err;
{
int result = 0;
for (; *string; ++string)
{
if (! ISDIGIT (*string))
{
result = err;
break;
}
result = result * 10 + (*string - '0');
}
if (result < min || result > max)
result = err;
return result;
}
void
parse_args (argc, argv)
unsigned argc;
char **argv;
parse_args (unsigned argc, char **argv)
{
unsigned i;
int is, il, irl;
@ -473,12 +463,11 @@ parse_args (argc, argv)
struct option *longopts;
struct option *really_longopts;
int last_optind;
enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
shortopts = (char *) xmalloc (OPTION_COUNT * 3 + 2);
longopts = (struct option *) xmalloc (sizeof (*longopts)
* (OPTION_COUNT + 1));
really_longopts = (struct option *) xmalloc (sizeof (*really_longopts)
* (OPTION_COUNT + 1));
shortopts = xmalloc (OPTION_COUNT * 3 + 2);
longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1));
really_longopts = xmalloc (sizeof (*really_longopts) * (OPTION_COUNT + 1));
/* Starting the short option string with '-' is for programs that
expect options and other ARGV-elements in any order and that care about
@ -563,7 +552,7 @@ parse_args (argc, argv)
{
char *n;
n = (char *) xmalloc (strlen (argv[i]) + 20);
n = xmalloc (strlen (argv[i]) + 20);
sprintf (n, "--library=%s", argv[i] + 2);
argv[i] = n;
}
@ -610,16 +599,15 @@ parse_args (argc, argv)
einfo (_("%P%F: use the --help option for usage information\n"));
case 1: /* File name. */
lang_add_input_file (optarg, lang_input_file_is_file_enum,
(char *) NULL);
lang_add_input_file (optarg, lang_input_file_is_file_enum, NULL);
break;
case OPTION_IGNORE:
break;
case 'a':
/* For HP/UX compatibility. Actually -a shared should mean
``use only shared libraries'' but, then, we don't
currently support shared libraries on HP/UX anyhow. */
``use only shared libraries'' but, then, we don't
currently support shared libraries on HP/UX anyhow. */
if (strcmp (optarg, "archive") == 0)
config.dynamic_link = FALSE;
else if (strcmp (optarg, "shared") == 0
@ -711,8 +699,7 @@ parse_args (argc, argv)
case 'f':
if (command_line.auxiliary_filters == NULL)
{
command_line.auxiliary_filters =
(char **) xmalloc (2 * sizeof (char *));
command_line.auxiliary_filters = xmalloc (2 * sizeof (char *));
command_line.auxiliary_filters[0] = optarg;
command_line.auxiliary_filters[1] = NULL;
}
@ -724,9 +711,9 @@ parse_args (argc, argv)
c = 0;
for (p = command_line.auxiliary_filters; *p != NULL; p++)
++c;
command_line.auxiliary_filters =
(char **) xrealloc (command_line.auxiliary_filters,
(c + 2) * sizeof (char *));
command_line.auxiliary_filters
= xrealloc (command_line.auxiliary_filters,
(c + 2) * sizeof (char *));
command_line.auxiliary_filters[c] = optarg;
command_line.auxiliary_filters[c + 1] = NULL;
}
@ -759,8 +746,7 @@ parse_args (argc, argv)
ldfile_add_library_path (optarg, TRUE);
break;
case 'l':
lang_add_input_file (optarg, lang_input_file_is_l_enum,
(char *) NULL);
lang_add_input_file (optarg, lang_input_file_is_l_enum, NULL);
break;
case 'M':
config.map_filename = "-";
@ -799,14 +785,53 @@ parse_args (argc, argv)
link_info.keep_memory = FALSE;
break;
case OPTION_NO_UNDEFINED:
link_info.no_undefined = TRUE;
link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
break;
case OPTION_ALLOW_SHLIB_UNDEFINED:
link_info.allow_shlib_undefined = TRUE;
link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
break;
case OPTION_NO_ALLOW_SHLIB_UNDEFINED:
link_info.allow_shlib_undefined = FALSE;
link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
break;
case OPTION_UNRESOLVED_SYMBOLS:
if (strcmp (optarg, "ignore-all") == 0)
{
link_info.unresolved_syms_in_objects = RM_IGNORE;
link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
}
else if (strcmp (optarg, "report-all") == 0)
{
link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
}
else if (strcmp (optarg, "ignore-in-object-files") == 0)
{
link_info.unresolved_syms_in_objects = RM_IGNORE;
link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
}
else if (strcmp (optarg, "ignore-in-shared-libs") == 0)
{
link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
}
else
einfo (_("%P%F: bad --unresolved-symbols option: %s\n"), optarg);
break;
case OPTION_WARN_UNRESOLVED_SYMBOLS:
how_to_report_unresolved_symbols = RM_GENERATE_WARNING;
if (link_info.unresolved_syms_in_objects == RM_GENERATE_ERROR)
link_info.unresolved_syms_in_objects = RM_GENERATE_WARNING;
if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)
link_info.unresolved_syms_in_shared_libs = RM_GENERATE_WARNING;
break;
case OPTION_ERROR_UNRESOLVED_SYMBOLS:
how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
if (link_info.unresolved_syms_in_objects == RM_GENERATE_WARNING)
link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
if (link_info.unresolved_syms_in_shared_libs == RM_GENERATE_WARNING)
link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR;
break;
case OPTION_ALLOW_MULTIPLE_DEFINITION:
link_info.allow_multiple_definition = TRUE;
break;
@ -839,7 +864,7 @@ parse_args (argc, argv)
lang_add_output (optarg, 0);
break;
case OPTION_OFORMAT:
lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0);
lang_add_output_format (optarg, NULL, NULL, 0);
break;
case 'q':
link_info.emitrelocations = TRUE;
@ -857,7 +882,7 @@ parse_args (argc, argv)
and will seg-fault the next time around. */
einfo(_("%P%F: bad -rpath option\n"));
link_info.relocateable = TRUE;
link_info.relocatable = TRUE;
config.build_constructors = FALSE;
config.magic_demand_paged = FALSE;
config.text_read_only = FALSE;
@ -879,7 +904,7 @@ parse_args (argc, argv)
{
lang_add_input_file (optarg,
lang_input_file_is_symbols_only_enum,
(char *) NULL);
NULL);
break;
}
}
@ -957,10 +982,27 @@ parse_args (argc, argv)
break;
case OPTION_SHARED:
if (config.has_shared)
link_info.shared = TRUE;
{
link_info.shared = TRUE;
/* When creating a shared library, the default
behaviour is to ignore any unresolved references. */
if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
link_info.unresolved_syms_in_objects = RM_IGNORE;
if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
}
else
einfo (_("%P%F: -shared not supported\n"));
break;
case OPTION_PIE:
if (config.has_shared)
{
link_info.shared = TRUE;
link_info.pie = TRUE;
}
else
einfo (_("%P%F: -pie not supported\n"));
break;
case 'h': /* Used on Solaris. */
case OPTION_SONAME:
command_line.soname = optarg;
@ -1030,7 +1072,7 @@ parse_args (argc, argv)
link_info.task_link = TRUE;
/* Fall through - do an implied -r option. */
case OPTION_UR:
link_info.relocateable = TRUE;
link_info.relocatable = TRUE;
config.build_constructors = TRUE;
config.magic_demand_paged = FALSE;
config.text_read_only = FALSE;
@ -1049,6 +1091,7 @@ parse_args (argc, argv)
ldversion (1);
version_printed = TRUE;
trace_file_tries = TRUE;
overflow_cutoff_limit = -2;
break;
case 'v':
ldversion (0);
@ -1064,8 +1107,8 @@ parse_args (argc, argv)
break;
case OPTION_VERSION_SCRIPT:
/* This option indicates a small script that only specifies
version information. Read it, but don't assume that
we've seen a linker script. */
version information. Read it, but don't assume that
we've seen a linker script. */
{
FILE *hold_script_handle;
@ -1103,6 +1146,12 @@ parse_args (argc, argv)
case OPTION_WHOLE_ARCHIVE:
whole_archive = TRUE;
break;
case OPTION_AS_NEEDED:
as_needed = TRUE;
break;
case OPTION_NO_AS_NEEDED:
as_needed = FALSE;
break;
case OPTION_WRAP:
add_wrap (optarg);
break;
@ -1166,22 +1215,6 @@ parse_args (argc, argv)
lang_leave_group ();
ingroup = 0;
break;
case OPTION_MPC860C0:
/* Default value (in bytes). */
link_info.mpc860c0 = 20;
if (optarg)
{
unsigned words;
words = is_num (optarg, 1, 10, 0);
if (words == 0)
einfo (_("%P%F: invalid argument to option \"mpc860c0\"\n"));
/* Convert words to bytes. */
link_info.mpc860c0 = words * 4;
}
command_line.relax = TRUE;
break;
case OPTION_INIT:
link_info.init_function = optarg;
@ -1201,14 +1234,21 @@ parse_args (argc, argv)
set_default_dirlist (default_dirlist);
free (default_dirlist);
}
if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
/* FIXME: Should we allow emulations a chance to set this ? */
link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
/* FIXME: Should we allow emulations a chance to set this ? */
link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
}
/* Add the (colon-separated) elements of DIRLIST_PTR to the
library search path. */
static void
set_default_dirlist (dirlist_ptr)
char *dirlist_ptr;
set_default_dirlist (char *dirlist_ptr)
{
char *p;
@ -1226,8 +1266,7 @@ set_default_dirlist (dirlist_ptr)
}
static void
set_section_start (sect, valstr)
char *sect, *valstr;
set_section_start (char *sect, char *valstr)
{
const char *end;
bfd_vma val = bfd_scan_vma (valstr, &end, 16);
@ -1239,7 +1278,7 @@ set_section_start (sect, valstr)
/* Print help messages for the options. */
static void
help ()
help (void)
{
unsigned i;
const char **targets, **pp;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,151 +0,0 @@
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
MEMORY
{
text (rx) : ORIGIN = 0, LENGTH = $TEXT_LENGTH
data (rw!x) : ORIGIN = (0x800000 + $DATA_START), LENGTH = $DATA_LENGTH
eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = $EEPROM_LENGTH
}
SECTIONS
{
/* Read-only sections, merged into text segment: */
${TEXT_DYNAMIC+${DYNAMIC}}
.hash ${RELOCATING-0} : { *(.hash) }
.dynsym ${RELOCATING-0} : { *(.dynsym) }
.dynstr ${RELOCATING-0} : { *(.dynstr) }
.gnu.version ${RELOCATING-0} : { *(.gnu.version) }
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
.rel.init ${RELOCATING-0} : { *(.rel.init) }
.rela.init ${RELOCATING-0} : { *(.rela.init) }
.rel.text ${RELOCATING-0} :
{
*(.rel.text)
${RELOCATING+*(.rel.text.*)}
${RELOCATING+*(.rel.gnu.linkonce.t*)}
}
.rela.text ${RELOCATING-0} :
{
*(.rela.text)
${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t*)}
}
.rel.fini ${RELOCATING-0} : { *(.rel.fini) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) }
.rel.rodata ${RELOCATING-0} :
{
*(.rel.rodata)
${RELOCATING+*(.rel.rodata.*)}
${RELOCATING+*(.rel.gnu.linkonce.r*)}
}
.rela.rodata ${RELOCATING-0} :
{
*(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r*)}
}
.rel.data ${RELOCATING-0} :
{
*(.rel.data)
${RELOCATING+*(.rel.data.*)}
${RELOCATING+*(.rel.gnu.linkonce.d*)}
}
.rela.data ${RELOCATING-0} :
{
*(.rela.data)
${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d*)}
}
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
.rel.got ${RELOCATING-0} : { *(.rel.got) }
.rela.got ${RELOCATING-0} : { *(.rela.got) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
/* Internal text space or external memory */
.text :
{
*(.init)
*(.progmem.gcc*)
*(.progmem*)
${RELOCATING+. = ALIGN(2);}
*(.text)
${RELOCATING+. = ALIGN(2);}
*(.text.*)
${RELOCATING+. = ALIGN(2);}
*(.fini)
${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > text}
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
{
${RELOCATING+ PROVIDE (__data_start = .) ; }
*(.data)
*(.gnu.linkonce.d*)
${RELOCATING+. = ALIGN(2);}
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > data}
.bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
{
${RELOCATING+ PROVIDE (__bss_start = .) ; }
*(.bss)
*(COMMON)
${RELOCATING+ PROVIDE (__bss_end = .) ; }
${RELOCATING+ _end = . ; }
} ${RELOCATING+ > data}
.eeprom ${RELOCATING-0}:
${RELOCATING+AT (ADDR (.text) + SIZEOF (.text) + SIZEOF (.data))}
{
*(.eeprom*)
${RELOCATING+ __eeprom_end = . ; }
} ${RELOCATING+ > eeprom}
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
PROVIDE (__stack = ${STACK}) ;
}
EOF

View File

@ -1,481 +0,0 @@
dnl Process this file with autoconf to produce a configure script
AC_PREREQ(2.13)
AC_INIT(xmalloc.c)
# This works around the fact that libtool configuration may change LD
# for this particular configuration, but some shells, instead of
# keeping the changes in LD private, export them just because LD is
# exported. We don't use libtool yet, but some day we might, so...
ORIGINAL_LD_FOR_MULTILIBS=$LD
dnl We use these options to decide which functions to include.
AC_ARG_WITH(target-subdir,
[ --with-target-subdir=SUBDIR Configuring in a subdirectory for target])
AC_ARG_WITH(build-subdir,
[ --with-build-subdir=SUBDIR Configuring in a subdirectory for build])
AC_ARG_WITH(cross-host,
[ --with-cross-host=HOST Configuring with a cross compiler])
AC_ARG_WITH(newlib,
[ --with-newlib Configuring with newlib])
if test "${srcdir}" = "."; then
if test -n "${with_build_subdir}"; then
libiberty_topdir="${srcdir}/../.."
with_target_subdir=
elif test -z "${with_target_subdir}"; then
libiberty_topdir="${srcdir}/.."
else
if test "${with_target_subdir}" != "."; then
libiberty_topdir="${srcdir}/${with_multisrctop}../.."
else
libiberty_topdir="${srcdir}/${with_multisrctop}.."
fi
fi
else
libiberty_topdir="${srcdir}/.."
fi
AC_SUBST(libiberty_topdir)
AC_CONFIG_AUX_DIR($libiberty_topdir)
dnl Very limited version of automake's enable-maintainer-mode
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode
enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
maintainer_mode=$enableval,
maintainer_mode=no)
AC_MSG_RESULT($maintainer_mode)
if test "$maintainer_mode" = "yes"; then
MAINT=''
NOTMAINT='#'
else
MAINT='#'
NOTMAINT=''
fi
AC_SUBST(MAINT)dnl
AC_SUBST(NOTMAINT)dnl
# Do we have a single-tree copy of texinfo? Even if we do, we can't
# rely on it - libiberty is built before texinfo.
AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
if test "x$MAKEINFO" = "x"; then
MAKEINFO="@echo makeinfo missing; true"
BUILD_INFO=
else
BUILD_INFO=info
case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in
x*\ [[1-3]].* )
MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
BUILD_INFO=
AC_MSG_WARN([
*** Makeinfo is too old. Info documentation will not be built.])
;;
esac
fi
AC_SUBST(MAKEINFO)
AC_SUBST(BUILD_INFO)
AC_CHECK_PROG(PERL, perl, perl, )
if test x"$PERL" = x""; then
HAVE_PERL='#'
else
HAVE_PERL=''
fi
AC_SUBST(HAVE_PERL)
AC_CANONICAL_HOST
dnl When we start using automake:
dnl AM_INIT_AUTOMAKE(libiberty, 1.0)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
LIB_AC_PROG_CC
AC_PROG_CC_C_O
# autoconf is lame and doesn't give us any substitution variable for this.
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
NO_MINUS_C_MINUS_O=yes
else
OUTPUT_OPTION='-o $@'
fi
AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
AC_ISC_POSIX
AC_C_CONST
AC_C_INLINE
dnl When we start using libtool:
dnl Default to a non shared library. This may be overridden by the
dnl configure option --enable-shared.
dnl AM_DISABLE_SHARED
dnl When we start using libtool:
dnl AM_PROG_LIBTOOL
dnl When we start using automake:
dnl AM_CONFIG_HEADER(config.h:config.in)
AC_CONFIG_HEADER(config.h:config.in)
dnl When we start using automake:
dnl AM_MAINTAINER_MODE
dnl AC_EXEEXT
dnl When we start using automake:
dnl AM_PROG_INSTALL
AC_PROG_INSTALL
. ${srcdir}/config.table
host_makefile_frag=${frag}
AC_SUBST_FILE(host_makefile_frag)
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
libiberty_AC_DECLARE_ERRNO
AC_CHECK_TYPE(uintptr_t, unsigned long)
# Given the above check, we always have uintptr_t or a fallback
# definition. So define HAVE_UINTPTR_T in case any imported code
# relies on it.
AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.])
AC_TYPE_PID_T
# This is the list of functions which libiberty will provide if they
# are not available on the host.
funcs="asprintf"
funcs="$funcs atexit"
funcs="$funcs basename"
funcs="$funcs bcmp"
funcs="$funcs bcopy"
funcs="$funcs bsearch"
funcs="$funcs bzero"
funcs="$funcs calloc"
funcs="$funcs clock"
funcs="$funcs ffs"
funcs="$funcs getcwd"
funcs="$funcs getpagesize"
funcs="$funcs index"
funcs="$funcs insque"
funcs="$funcs memchr"
funcs="$funcs memcmp"
funcs="$funcs memcpy"
funcs="$funcs memmove"
funcs="$funcs mempcpy"
funcs="$funcs memset"
funcs="$funcs mkstemps"
funcs="$funcs putenv"
funcs="$funcs random"
funcs="$funcs rename"
funcs="$funcs rindex"
funcs="$funcs setenv"
funcs="$funcs snprintf"
funcs="$funcs sigsetmask"
funcs="$funcs stpcpy"
funcs="$funcs stpncpy"
funcs="$funcs strcasecmp"
funcs="$funcs strchr"
funcs="$funcs strdup"
funcs="$funcs strncasecmp"
funcs="$funcs strrchr"
funcs="$funcs strstr"
funcs="$funcs strtod"
funcs="$funcs strtol"
funcs="$funcs strtoul"
funcs="$funcs tmpnam"
funcs="$funcs vasprintf"
funcs="$funcs vfprintf"
funcs="$funcs vprintf"
funcs="$funcs vsnprintf"
funcs="$funcs vsprintf"
funcs="$funcs waitpid"
# Also in the old function.def file: alloca, vfork, getopt.
vars="sys_errlist sys_nerr sys_siglist _system_configuration"
checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp"
checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bsearch bzero calloc clock)
AC_CHECK_FUNCS(getcwd getpagesize index insque mkstemps memchr memcmp memcpy)
AC_CHECK_FUNCS(memmove mempcpy memset putenv random rename rindex sigsetmask)
AC_CHECK_FUNCS(strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr)
AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf)
AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal)
AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs snprintf vsnprintf)
AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl)
AC_CHECK_FUNCS(realpath canonicalize_file_name)
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.])
fi
# For each of these functions, if the host does not provide the
# function we want to put FN.o in LIBOBJS, and if the host does
# provide the function, we want to define HAVE_FN in config.h.
setobjs=
CHECK=
target_header_dir=
if test -n "${with_target_subdir}"; then
# We are being configured as a target library. AC_REPLACE_FUNCS
# may not work correctly, because the compiler may not be able to
# link executables. Note that we may still be being configured
# native.
# If we are being configured for newlib, we know which functions
# newlib provide and which ones we will be expected to provide.
if test "x${with_newlib}" = "xyes"; then
LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
for f in $funcs; do
case "$f" in
asprintf | basename | insque | random | strdup | vasprintf)
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($n)
;;
esac
done
# newlib doesnt provide any of the variables in $vars, so we
# dont have to check them here.
# Of the functions in $checkfuncs, newlib only has strerror.
AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR)
setobjs=yes
fi
# We may wish to install the target headers somewhere.
AC_ARG_ENABLE(install-libiberty,
[ --enable-install-libiberty Install headers for end users],
enable_install_libiberty=$enableval,
enable_install_libiberty=no)dnl
# Option parsed, now set things appropriately.
case x"$enable_install_libiberty" in
xyes|x)
target_header_dir=libiberty
;;
xno)
target_header_dir=
;;
*)
# This could be sanity-checked in various ways...
target_header_dir="${enable_install_libiberty}"
;;
esac
else
# Not a target library, so we set things up to run the test suite.
CHECK=check-cplus-dem
fi
AC_SUBST(CHECK)
AC_SUBST(target_header_dir)
case "${host}" in
*-*-cygwin* | *-*-mingw*)
AC_DEFINE_NOAUTOHEADER(HAVE_SYS_ERRLIST)
AC_DEFINE_NOAUTOHEADER(HAVE_SYS_NERR)
;;
esac
if test -z "${setobjs}"; then
case "${host}" in
*-*-vxworks*)
# Handle VxWorks configuration specially, since on VxWorks the
# libraries are actually on the target board, not in the file
# system.
LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
for f in $funcs; do
case "$f" in
basename | getpagesize | insque | random | strcasecmp)
;;
strncasecmp | strdup | vfork | waitpid | vasprintf)
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($n)
;;
esac
done
# VxWorks doesn't provide any of the variables in $vars, so we
# don't have to check them here.
# Of the functions in $checkfuncs, VxWorks only has strerror.
AC_DEFINE_NOAUTOHEADER(HAVE_STRERROR)
setobjs=yes
;;
esac
fi
if test -z "${setobjs}"; then
case "${host}" in
*-*-cygwin*)
# The Cygwin library actually uses a couple of files from
# libiberty when it is built. If we are building a native
# Cygwin, and we run the tests, we will appear to have these
# files. However, when we go on to build winsup, we will wind up
# with a library which does not have the files, since they should
# have come from libiberty.
# We handle this by removing the functions the winsup library
# provides from our shell variables, so that they appear to be
# missing.
# DJ - only if we're *building* cygwin, not just building *with* cygwin
if test -n "${with_target_subdir}"
then
funcs="`echo $funcs | sed -e 's/random//'`"
LIBOBJS="$LIBOBJS random.o"
vars="`echo $vars | sed -e 's/sys_siglist//'`"
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
fi
;;
*-*-mingw32*)
# Under mingw32, sys_nerr and sys_errlist exist, but they are
# macros, so the test below won't find them.
libiberty_cv_var_sys_nerr=yes
libiberty_cv_var_sys_errlist=yes
;;
*-*-uwin*)
# Under some versions of uwin, vfork is notoriously buggy and the test
# can hang configure; on other versions, vfork exists just as a stub.
# FIXME: This should be removed once vfork in uwin's runtime is fixed.
ac_cv_func_vfork_works=no
# Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are
# macros (actually, these are imported from a DLL, but the end effect
# is the same), so the test below won't find them.
libiberty_cv_var_sys_nerr=yes
libiberty_cv_var_sys_errlist=yes
;;
*-*-*vms*)
# Under VMS, vfork works very different than on Unix. The standard test
# won't work, and it isn't easily adaptable. It makes more sense to
# just force it.
ac_cv_func_vfork_works=yes
;;
esac
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
AC_PROG_CC_WORKS
AC_REPLACE_FUNCS($funcs)
libiberty_AC_FUNC_C_ALLOCA
AC_FUNC_VFORK
if test $ac_cv_func_vfork_works = no; then
LIBOBJS="$LIBOBJS vfork.o"
fi
# We only need _doprnt if we might use it to implement v*printf.
if test $ac_cv_func_vprintf != yes \
|| test $ac_cv_func_vfprintf != yes \
|| test $ac_cv_func_vsprintf != yes; then
AC_REPLACE_FUNCS(_doprnt)
else
AC_CHECK_FUNCS(_doprnt)
fi
for v in $vars; do
AC_MSG_CHECKING([for $v])
AC_CACHE_VAL(libiberty_cv_var_$v,
[AC_TRY_LINK([int *p;], [extern int $v []; p = $v;],
[eval "libiberty_cv_var_$v=yes"],
[eval "libiberty_cv_var_$v=no"])])
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
AC_MSG_RESULT(yes)
n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($n)
else
AC_MSG_RESULT(no)
fi
done
AC_CHECK_FUNCS($checkfuncs)
libiberty_NEED_DECLARATION(canonicalize_file_name)
fi
# Figure out which version of pexecute to use.
case "${host}" in
*-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;;
*-*-msdosdjgpp*) pexecute=pex-djgpp.o ;;
*-*-msdos*) pexecute=pex-msdos.o ;;
*-*-os2-emx*) pexecute=pex-os2.o ;;
*) pexecute=pex-unix.o ;;
esac
AC_SUBST(pexecute)
libiberty_AC_FUNC_STRNCMP
# Install a library built with a cross compiler in $(tooldir) rather
# than $(libdir).
if test -z "${with_cross_host}"; then
INSTALL_DEST=libdir
else
INSTALL_DEST=tooldir
fi
AC_SUBST(INSTALL_DEST)
# We need multilib support, but only if configuring for the target.
AC_OUTPUT(Makefile testsuite/Makefile,
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
if test -n "$CONFIG_FILES"; then
if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
# FIXME: We shouldn't need to set ac_file
ac_file=Makefile
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
. ${libiberty_topdir}/config-ml.in
fi
fi],
srcdir=${srcdir}
host=${host}
target=${target}
with_target_subdir=${with_target_subdir}
with_build_subdir=${with_build_subdir}
with_multisubdir=${with_multisubdir}
ac_configure_args="--enable-multilib ${ac_configure_args}"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
libiberty_topdir=${libiberty_topdir}
)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -34,7 +34,11 @@ typedef enum
HEX_D,
HEX_E,
HEX_F,
HEX_XX00,
HEX_00YY,
REG_N,
REG_N_D, /* nnn0 */
REG_N_B01, /* nn01 */
REG_M,
SDT_REG_N,
REG_NM,
@ -60,9 +64,12 @@ typedef enum
NOPY,
MOVX,
MOVY,
MOVX_NOPY,
MOVY_NOPX,
PSH,
PMUL,
PPI3,
PPI3NC,
PDC,
PPIC,
REPEAT
@ -88,8 +95,6 @@ typedef enum
A_INC_N,
A_IND_M,
A_IND_N,
A_PMOD_N,
A_PMODY_N,
A_IND_R0_REG_M,
A_IND_R0_REG_N,
A_MACH,
@ -113,6 +118,27 @@ typedef enum
DSP_REG_E,
DSP_REG_F,
DSP_REG_G,
DSP_REG_A_M,
DSP_REG_AX,
DSP_REG_XY,
DSP_REG_AY,
DSP_REG_YX,
AX_INC_N,
AY_INC_N,
AXY_INC_N,
AYX_INC_N,
AX_IND_N,
AY_IND_N,
AXY_IND_N,
AYX_IND_N,
AX_PMOD_N,
AXY_PMOD_N,
AY_PMOD_N,
AYX_PMOD_N,
AS_DEC_N,
AS_INC_N,
AS_IND_N,
AS_PMOD_N,
A_A0,
A_X0,
A_X1,
@ -156,24 +182,34 @@ sh_dsp_reg_nums;
#define arch_sh3e 0x0008
#define arch_sh4 0x0010
#define arch_sh2e 0x0020
#define arch_sh4a 0x0040
#define arch_sh_dsp 0x0100
#define arch_sh3_dsp 0x0200
#define arch_sh4al_dsp 0x0400
#define arch_sh4_nofpu 0x1000
#define arch_sh4a_nofpu 0x2000
#define arch_sh1_up (arch_sh1 | arch_sh2_up)
#define arch_sh2_up (arch_sh2 | arch_sh2e_up | arch_sh3_up | arch_sh_dsp)
#define arch_sh2e_up (arch_sh2e | arch_sh3e_up)
#define arch_sh3_up (arch_sh3 | arch_sh3e_up | arch_sh3_dsp)
#define arch_sh3_up (arch_sh3 | arch_sh3e_up | arch_sh3_dsp_up \
| arch_sh4_nofp_up)
#define arch_sh3e_up (arch_sh3e | arch_sh4_up)
#define arch_sh4_up arch_sh4
#define arch_sh4_up (arch_sh4 | arch_sh4a_up)
#define arch_sh4a_up (arch_sh4a)
#define arch_sh_dsp_up (arch_sh_dsp | arch_sh3_dsp_up)
#define arch_sh3_dsp_up arch_sh3_dsp
#define arch_sh3_dsp_up (arch_sh3_dsp | arch_sh4al_dsp_up)
#define arch_sh4al_dsp_up (arch_sh4al_dsp)
#define arch_sh4_nofp_up (arch_sh4_nofpu | arch_sh4_up | arch_sh4a_nofp_up)
#define arch_sh4a_nofp_up (arch_sh4a_nofpu | arch_sh4a_up | arch_sh4al_dsp_up)
typedef struct
{
char *name;
sh_arg_type arg[4];
sh_nibble_type nibbles[4];
sh_nibble_type nibbles[5];
int arch;
} sh_opcode_info;
@ -211,6 +247,8 @@ const sh_opcode_info sh_table[] =
/* 10001111i8p1.... bf/s <bdisp8> */{"bf/s",{A_BDISP8},{HEX_8,HEX_F,BRANCH_8}, arch_sh2_up},
/* 0000000010001000 clrdmxy */{"clrdmxy",{0},{HEX_0,HEX_0,HEX_8,HEX_8}, arch_sh4al_dsp_up},
/* 0000000000101000 clrmac */{"clrmac",{0},{HEX_0,HEX_0,HEX_2,HEX_8}, arch_sh1_up},
/* 0000000001001000 clrs */{"clrs",{0},{HEX_0,HEX_0,HEX_4,HEX_8}, arch_sh1_up},
@ -249,6 +287,8 @@ const sh_opcode_info sh_table[] =
/* 0110nnnnmmmm1101 extu.w <REG_M>,<REG_N>*/{"extu.w",{ A_REG_M,A_REG_N},{HEX_6,REG_N,REG_M,HEX_D}, arch_sh1_up},
/* 0000nnnn11100011 icbi @<REG_N> */{"icbi",{A_IND_N},{HEX_0,REG_N,HEX_E,HEX_3}, arch_sh4a_nofp_up},
/* 0100nnnn00101011 jmp @<REG_N> */{"jmp",{A_IND_N},{HEX_4,REG_N,HEX_2,HEX_B}, arch_sh1_up},
/* 0100nnnn00001011 jsr @<REG_N> */{"jsr",{A_IND_N},{HEX_4,REG_N,HEX_0,HEX_B}, arch_sh1_up},
@ -269,7 +309,7 @@ const sh_opcode_info sh_table[] =
/* 0100nnnn01001110 ldc <REG_N>,SPC */{"ldc",{A_REG_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_E}, arch_sh3_up},
/* 0100nnnn11111010 ldc <REG_N>,DBR */{"ldc",{A_REG_N,A_DBR},{HEX_4,REG_N,HEX_F,HEX_A}, arch_sh4_up},
/* 0100nnnn11111010 ldc <REG_N>,DBR */{"ldc",{A_REG_N,A_DBR},{HEX_4,REG_N,HEX_F,HEX_A}, arch_sh4_nofp_up},
/* 0100nnnn1xxx1110 ldc <REG_N>,Rn_BANK */{"ldc",{A_REG_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_E}, arch_sh3_up},
@ -289,10 +329,13 @@ const sh_opcode_info sh_table[] =
/* 0100nnnn01000111 ldc.l @<REG_N>+,SPC */{"ldc.l",{A_INC_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_7}, arch_sh3_up},
/* 0100nnnn11110110 ldc.l @<REG_N>+,DBR */{"ldc.l",{A_INC_N,A_DBR},{HEX_4,REG_N,HEX_F,HEX_6}, arch_sh4_up},
/* 0100nnnn11110110 ldc.l @<REG_N>+,DBR */{"ldc.l",{A_INC_N,A_DBR},{HEX_4,REG_N,HEX_F,HEX_6}, arch_sh4_nofp_up},
/* 0100nnnn1xxx0111 ldc.l <REG_N>,Rn_BANK */{"ldc.l",{A_INC_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_7}, arch_sh3_up},
/* 0100mmmm00110100 ldrc <REG_M> */{"ldrc",{A_REG_M},{HEX_4,REG_M,HEX_3,HEX_4}, arch_sh4al_dsp_up},
/* 10001010i8*1.... ldrc #<imm> */{"ldrc",{A_IMM},{HEX_8,HEX_A,IMM0_8}, arch_sh4al_dsp_up},
/* 10001110i8p2.... ldre @(<disp>,PC) */{"ldre",{A_DISP_PC},{HEX_8,HEX_E,PCRELIMM_8BY2}, arch_sh_dsp_up},
/* 10001100i8p2.... ldrs @(<disp>,PC) */{"ldrs",{A_DISP_PC},{HEX_8,HEX_C,PCRELIMM_8BY2}, arch_sh_dsp_up},
@ -414,11 +457,16 @@ const sh_opcode_info sh_table[] =
/* 11000001i8*2.... mov.w R0,@(<disp>,GBR)*/{"mov.w",{A_R0,A_DISP_GBR},{HEX_C,HEX_1,IMM1_8BY2}, arch_sh1_up},
/* 11000111i8p4.... mova @(<disp>,PC),R0*/{"mova",{A_DISP_PC,A_R0},{HEX_C,HEX_7,PCRELIMM_8BY4}, arch_sh1_up},
/* 0000nnnn11000011 movca.l R0,@<REG_N> */{"movca.l",{A_R0,A_IND_N},{HEX_0,REG_N,HEX_C,HEX_3}, arch_sh4_up},
/* 0000nnnn11000011 movca.l R0,@<REG_N> */{"movca.l",{A_R0,A_IND_N},{HEX_0,REG_N,HEX_C,HEX_3}, arch_sh4_nofp_up},
/* 0000nnnn01110011 movco.l r0,@<REG_N> */{"movco.l",{A_R0,A_IND_N},{HEX_0,REG_N,HEX_7,HEX_3}, arch_sh4a_nofp_up},
/* 0000mmmm01100011 movli.l @<REG_M>,r0 */{"movli.l",{A_IND_M,A_R0},{HEX_0,REG_M,HEX_6,HEX_3}, arch_sh4a_nofp_up},
/* 0000nnnn00101001 movt <REG_N> */{"movt",{A_REG_N},{HEX_0,REG_N,HEX_2,HEX_9}, arch_sh1_up},
/* 0100mmmm10101001 movua.l @<REG_M>,r0 */{"movua.l",{A_IND_M,A_R0},{HEX_4,REG_M,HEX_A,HEX_9}, arch_sh4a_nofp_up},
/* 0100mmmm11101001 movua.l @<REG_M>+,r0 */{"movua.l",{A_INC_M,A_R0},{HEX_4,REG_M,HEX_E,HEX_9}, arch_sh4a_nofp_up},
/* 0010nnnnmmmm1111 muls.w <REG_M>,<REG_N>*/{"muls.w",{ A_REG_M,A_REG_N},{HEX_2,REG_N,REG_M,HEX_F}, arch_sh1_up},
/* 0010nnnnmmmm1111 muls <REG_M>,<REG_N>*/{"muls",{ A_REG_M,A_REG_N},{HEX_2,REG_N,REG_M,HEX_F}, arch_sh1_up},
@ -434,11 +482,11 @@ const sh_opcode_info sh_table[] =
/* 0000000000001001 nop */{"nop",{0},{HEX_0,HEX_0,HEX_0,HEX_9}, arch_sh1_up},
/* 0110nnnnmmmm0111 not <REG_M>,<REG_N> */{"not",{ A_REG_M,A_REG_N},{HEX_6,REG_N,REG_M,HEX_7}, arch_sh1_up},
/* 0000nnnn10010011 ocbi @<REG_N> */{"ocbi",{A_IND_N},{HEX_0,REG_N,HEX_9,HEX_3}, arch_sh4_up},
/* 0000nnnn10010011 ocbi @<REG_N> */{"ocbi",{A_IND_N},{HEX_0,REG_N,HEX_9,HEX_3}, arch_sh4_nofp_up},
/* 0000nnnn10100011 ocbp @<REG_N> */{"ocbp",{A_IND_N},{HEX_0,REG_N,HEX_A,HEX_3}, arch_sh4_up},
/* 0000nnnn10100011 ocbp @<REG_N> */{"ocbp",{A_IND_N},{HEX_0,REG_N,HEX_A,HEX_3}, arch_sh4_nofp_up},
/* 0000nnnn10110011 ocbwb @<REG_N> */{"ocbwb",{A_IND_N},{HEX_0,REG_N,HEX_B,HEX_3}, arch_sh4_up},
/* 0000nnnn10110011 ocbwb @<REG_N> */{"ocbwb",{A_IND_N},{HEX_0,REG_N,HEX_B,HEX_3}, arch_sh4_nofp_up},
/* 11001011i8*1.... or #<imm>,R0 */{"or",{A_IMM,A_R0},{HEX_C,HEX_B,IMM0_8}, arch_sh1_up},
@ -447,7 +495,9 @@ const sh_opcode_info sh_table[] =
/* 11001111i8*1.... or.b #<imm>,@(R0,GBR)*/{"or.b",{A_IMM,A_R0_GBR},{HEX_C,HEX_F,IMM0_8}, arch_sh1_up},
/* 0000nnnn10000011 pref @<REG_N> */{"pref",{A_IND_N},{HEX_0,REG_N,HEX_8,HEX_3}, arch_sh3_up},
/* 0000nnnn10000011 pref @<REG_N> */{"pref",{A_IND_N},{HEX_0,REG_N,HEX_8,HEX_3}, arch_sh4_nofp_up},
/* 0000nnnn11010011 prefi @<REG_N> */{"prefi",{A_IND_N},{HEX_0,REG_N,HEX_D,HEX_3}, arch_sh4a_nofp_up},
/* 0100nnnn00100100 rotcl <REG_N> */{"rotcl",{A_REG_N},{HEX_4,REG_N,HEX_2,HEX_4}, arch_sh1_up},
@ -461,6 +511,9 @@ const sh_opcode_info sh_table[] =
/* 0000000000001011 rts */{"rts",{0},{HEX_0,HEX_0,HEX_0,HEX_B}, arch_sh1_up},
/* 0000000010011000 setdmx */{"setdmx",{0},{HEX_0,HEX_0,HEX_9,HEX_8}, arch_sh4al_dsp_up},
/* 0000000011001000 setdmy */{"setdmy",{0},{HEX_0,HEX_0,HEX_C,HEX_8}, arch_sh4al_dsp_up},
/* 0000000001011000 sets */{"sets",{0},{HEX_0,HEX_0,HEX_5,HEX_8}, arch_sh1_up},
/* 0000000000011000 sett */{"sett",{0},{HEX_0,HEX_0,HEX_1,HEX_8}, arch_sh1_up},
@ -514,9 +567,9 @@ const sh_opcode_info sh_table[] =
/* 0000nnnn01000010 stc SPC,<REG_N> */{"stc",{A_SPC,A_REG_N},{HEX_0,REG_N,HEX_4,HEX_2}, arch_sh3_up},
/* 0000nnnn00111010 stc SGR,<REG_N> */{"stc",{A_SGR,A_REG_N},{HEX_0,REG_N,HEX_3,HEX_A}, arch_sh4_up},
/* 0000nnnn00111010 stc SGR,<REG_N> */{"stc",{A_SGR,A_REG_N},{HEX_0,REG_N,HEX_3,HEX_A}, arch_sh4_nofp_up},
/* 0000nnnn11111010 stc DBR,<REG_N> */{"stc",{A_DBR,A_REG_N},{HEX_0,REG_N,HEX_F,HEX_A}, arch_sh4_up},
/* 0000nnnn11111010 stc DBR,<REG_N> */{"stc",{A_DBR,A_REG_N},{HEX_0,REG_N,HEX_F,HEX_A}, arch_sh4_nofp_up},
/* 0000nnnn1xxx0010 stc Rn_BANK,<REG_N> */{"stc",{A_REG_B,A_REG_N},{HEX_0,REG_N,REG_B,HEX_2}, arch_sh3_up},
@ -536,9 +589,9 @@ const sh_opcode_info sh_table[] =
/* 0100nnnn00010011 stc.l GBR,@-<REG_N> */{"stc.l",{A_GBR,A_DEC_N},{HEX_4,REG_N,HEX_1,HEX_3}, arch_sh1_up},
/* 0100nnnn00110010 stc.l SGR,@-<REG_N> */{"stc.l",{A_SGR,A_DEC_N},{HEX_4,REG_N,HEX_3,HEX_2}, arch_sh4_up},
/* 0100nnnn00110010 stc.l SGR,@-<REG_N> */{"stc.l",{A_SGR,A_DEC_N},{HEX_4,REG_N,HEX_3,HEX_2}, arch_sh4_nofp_up},
/* 0100nnnn11110010 stc.l DBR,@-<REG_N> */{"stc.l",{A_DBR,A_DEC_N},{HEX_4,REG_N,HEX_F,HEX_2}, arch_sh4_up},
/* 0100nnnn11110010 stc.l DBR,@-<REG_N> */{"stc.l",{A_DBR,A_DEC_N},{HEX_4,REG_N,HEX_F,HEX_2}, arch_sh4_nofp_up},
/* 0100nnnn1xxx0011 stc.l Rn_BANK,@-<REG_N> */{"stc.l",{A_REG_B,A_DEC_N},{HEX_4,REG_N,REG_B,HEX_3}, arch_sh3_up},
@ -596,6 +649,8 @@ const sh_opcode_info sh_table[] =
/* 0110nnnnmmmm1001 swap.w <REG_M>,<REG_N>*/{"swap.w",{ A_REG_M,A_REG_N},{HEX_6,REG_N,REG_M,HEX_9}, arch_sh1_up},
/* 0000000010101011 synco */{"synco",{0},{HEX_0,HEX_0,HEX_A,HEX_B}, arch_sh4a_nofp_up},
/* 0100nnnn00011011 tas.b @<REG_N> */{"tas.b",{A_IND_N},{HEX_4,REG_N,HEX_1,HEX_B}, arch_sh1_up},
/* 11000011i8*1.... trapa #<imm> */{"trapa",{A_IMM},{HEX_C,HEX_3,IMM0_8}, arch_sh1_up},
@ -634,7 +689,7 @@ const sh_opcode_info sh_table[] =
/* 111101nnmmmm0010 movs.w @<REG_N>+,<DSP_REG_M> */ {"movs.w",{A_INC_N,DSP_REG_M},{HEX_F,SDT_REG_N,REG_M,HEX_8}, arch_sh_dsp_up},
/* 111101nnmmmm0011 movs.w @<REG_N>+r8,<DSP_REG_M> */ {"movs.w",{A_PMOD_N,DSP_REG_M},{HEX_F,SDT_REG_N,REG_M,HEX_C}, arch_sh_dsp_up},
/* 111101nnmmmm0011 movs.w @<REG_N>+r8,<DSP_REG_M> */ {"movs.w",{AS_PMOD_N,DSP_REG_M},{HEX_F,SDT_REG_N,REG_M,HEX_C}, arch_sh_dsp_up},
/* 111101nnmmmm0100 movs.w <DSP_REG_M>,@-<REG_N> */ {"movs.w",{DSP_REG_M,A_DEC_N},{HEX_F,SDT_REG_N,REG_M,HEX_1}, arch_sh_dsp_up},
@ -642,7 +697,7 @@ const sh_opcode_info sh_table[] =
/* 111101nnmmmm0110 movs.w <DSP_REG_M>,@<REG_N>+ */ {"movs.w",{DSP_REG_M,A_INC_N},{HEX_F,SDT_REG_N,REG_M,HEX_9}, arch_sh_dsp_up},
/* 111101nnmmmm0111 movs.w <DSP_REG_M>,@<REG_N>+r8 */ {"movs.w",{DSP_REG_M,A_PMOD_N},{HEX_F,SDT_REG_N,REG_M,HEX_D}, arch_sh_dsp_up},
/* 111101nnmmmm0111 movs.w <DSP_REG_M>,@<REG_N>+r8 */ {"movs.w",{DSP_REG_M,AS_PMOD_N},{HEX_F,SDT_REG_N,REG_M,HEX_D}, arch_sh_dsp_up},
/* 111101nnmmmm1000 movs.l @-<REG_N>,<DSP_REG_M> */ {"movs.l",{A_DEC_N,DSP_REG_M},{HEX_F,SDT_REG_N,REG_M,HEX_2}, arch_sh_dsp_up},
@ -650,7 +705,7 @@ const sh_opcode_info sh_table[] =
/* 111101nnmmmm1010 movs.l @<REG_N>+,<DSP_REG_M> */ {"movs.l",{A_INC_N,DSP_REG_M},{HEX_F,SDT_REG_N,REG_M,HEX_A}, arch_sh_dsp_up},
/* 111101nnmmmm1011 movs.l @<REG_N>+r8,<DSP_REG_M> */ {"movs.l",{A_PMOD_N,DSP_REG_M},{HEX_F,SDT_REG_N,REG_M,HEX_E}, arch_sh_dsp_up},
/* 111101nnmmmm1011 movs.l @<REG_N>+r8,<DSP_REG_M> */ {"movs.l",{AS_PMOD_N,DSP_REG_M},{HEX_F,SDT_REG_N,REG_M,HEX_E}, arch_sh_dsp_up},
/* 111101nnmmmm1100 movs.l <DSP_REG_M>,@-<REG_N> */ {"movs.l",{DSP_REG_M,A_DEC_N},{HEX_F,SDT_REG_N,REG_M,HEX_3}, arch_sh_dsp_up},
@ -658,22 +713,51 @@ const sh_opcode_info sh_table[] =
/* 111101nnmmmm1110 movs.l <DSP_REG_M>,@<REG_N>+ */ {"movs.l",{DSP_REG_M,A_INC_N},{HEX_F,SDT_REG_N,REG_M,HEX_B}, arch_sh_dsp_up},
/* 111101nnmmmm1111 movs.l <DSP_REG_M>,@<REG_N>+r8 */ {"movs.l",{DSP_REG_M,A_PMOD_N},{HEX_F,SDT_REG_N,REG_M,HEX_F}, arch_sh_dsp_up},
/* 111101nnmmmm1111 movs.l <DSP_REG_M>,@<REG_N>+r8 */ {"movs.l",{DSP_REG_M,AS_PMOD_N},{HEX_F,SDT_REG_N,REG_M,HEX_F}, arch_sh_dsp_up},
/* 0*0*0*00** nopx */ {"nopx",{0},{PPI,NOPX}, arch_sh_dsp_up},
/* *0*0*0**00 nopy */ {"nopy",{0},{PPI,NOPY}, arch_sh_dsp_up},
/* n*m*0*01** movx.w @<REG_N>,<DSP_REG_X> */ {"movx.w",{A_IND_N,DSP_REG_X},{PPI,MOVX,HEX_1}, arch_sh_dsp_up},
/* n*m*0*10** movx.w @<REG_N>+,<DSP_REG_X> */ {"movx.w",{A_INC_N,DSP_REG_X},{PPI,MOVX,HEX_2}, arch_sh_dsp_up},
/* n*m*0*11** movx.w @<REG_N>+r8,<DSP_REG_X> */ {"movx.w",{A_PMOD_N,DSP_REG_X},{PPI,MOVX,HEX_3}, arch_sh_dsp_up},
/* n*m*1*01** movx.w <DSP_REG_M>,@<REG_N> */ {"movx.w",{DSP_REG_M,A_IND_N},{PPI,MOVX,HEX_9}, arch_sh_dsp_up},
/* n*m*1*10** movx.w <DSP_REG_M>,@<REG_N>+ */ {"movx.w",{DSP_REG_M,A_INC_N},{PPI,MOVX,HEX_A}, arch_sh_dsp_up},
/* n*m*1*11** movx.w <DSP_REG_M>,@<REG_N>+r8 */ {"movx.w",{DSP_REG_M,A_PMOD_N},{PPI,MOVX,HEX_B}, arch_sh_dsp_up},
/* *n*m*0**01 movy.w @<REG_N>,<DSP_REG_Y> */ {"movy.w",{A_IND_N,DSP_REG_Y},{PPI,MOVY,HEX_1}, arch_sh_dsp_up},
/* *n*m*0**10 movy.w @<REG_N>+,<DSP_REG_Y> */ {"movy.w",{A_INC_N,DSP_REG_Y},{PPI,MOVY,HEX_2}, arch_sh_dsp_up},
/* *n*m*0**11 movy.w @<REG_N>+r9,<DSP_REG_Y> */ {"movy.w",{A_PMODY_N,DSP_REG_Y},{PPI,MOVY,HEX_3}, arch_sh_dsp_up},
/* *n*m*1**01 movy.w <DSP_REG_M>,@<REG_N> */ {"movy.w",{DSP_REG_M,A_IND_N},{PPI,MOVY,HEX_9}, arch_sh_dsp_up},
/* *n*m*1**10 movy.w <DSP_REG_M>,@<REG_N>+ */ {"movy.w",{DSP_REG_M,A_INC_N},{PPI,MOVY,HEX_A}, arch_sh_dsp_up},
/* *n*m*1**11 movy.w <DSP_REG_M>,@<REG_N>+r9 */ {"movy.w",{DSP_REG_M,A_PMODY_N},{PPI,MOVY,HEX_B}, arch_sh_dsp_up},
/* n*m*0*01** movx.w @<REG_N>,<DSP_REG_X> */ {"movx.w",{AX_IND_N,DSP_REG_X},{PPI,MOVX,HEX_1}, arch_sh_dsp_up},
/* n*m*0*10** movx.w @<REG_N>+,<DSP_REG_X> */ {"movx.w",{AX_INC_N,DSP_REG_X},{PPI,MOVX,HEX_2}, arch_sh_dsp_up},
/* n*m*0*11** movx.w @<REG_N>+r8,<DSP_REG_X> */ {"movx.w",{AX_PMOD_N,DSP_REG_X},{PPI,MOVX,HEX_3}, arch_sh_dsp_up},
/* n*m*1*01** movx.w <DSP_REG_M>,@<REG_N> */ {"movx.w",{DSP_REG_A_M,AX_IND_N},{PPI,MOVX,HEX_9}, arch_sh_dsp_up},
/* n*m*1*10** movx.w <DSP_REG_M>,@<REG_N>+ */ {"movx.w",{DSP_REG_A_M,AX_INC_N},{PPI,MOVX,HEX_A}, arch_sh_dsp_up},
/* n*m*1*11** movx.w <DSP_REG_M>,@<REG_N>+r8 */ {"movx.w",{DSP_REG_A_M,AX_PMOD_N},{PPI,MOVX,HEX_B}, arch_sh_dsp_up},
/* nnmm000100 movx.w @<REG_Axy>,<DSP_REG_XY> */ {"movx.w",{AXY_IND_N,DSP_REG_XY},{PPI,MOVX_NOPY,HEX_0,HEX_4}, arch_sh4al_dsp_up},
/* nnmm001000 movx.w @<REG_Axy>+,<DSP_REG_XY> */{"movx.w",{AXY_INC_N,DSP_REG_XY},{PPI,MOVX_NOPY,HEX_0,HEX_8}, arch_sh4al_dsp_up},
/* nnmm001100 movx.w @<REG_Axy>+r8,<DSP_REG_XY> */{"movx.w",{AXY_PMOD_N,DSP_REG_XY},{PPI,MOVX_NOPY,HEX_0,HEX_C}, arch_sh4al_dsp_up},
/* nnmm100100 movx.w <DSP_REG_AX>,@<REG_Axy> */ {"movx.w",{DSP_REG_AX,AXY_IND_N},{PPI,MOVX_NOPY,HEX_2,HEX_4}, arch_sh4al_dsp_up},
/* nnmm101000 movx.w <DSP_REG_AX>,@<REG_Axy>+ */{"movx.w",{DSP_REG_AX,AXY_INC_N},{PPI,MOVX_NOPY,HEX_2,HEX_8}, arch_sh4al_dsp_up},
/* nnmm101100 movx.w <DSP_REG_AX>,@<REG_Axy>+r8 */{"movx.w",{DSP_REG_AX,AXY_PMOD_N},{PPI,MOVX_NOPY,HEX_2,HEX_C}, arch_sh4al_dsp_up},
/* nnmm010100 movx.l @<REG_Axy>,<DSP_REG_XY> */ {"movx.l",{AXY_IND_N,DSP_REG_XY},{PPI,MOVX_NOPY,HEX_1,HEX_4}, arch_sh4al_dsp_up},
/* nnmm011000 movx.l @<REG_Axy>+,<DSP_REG_XY> */{"movx.l",{AXY_INC_N,DSP_REG_XY},{PPI,MOVX_NOPY,HEX_1,HEX_8}, arch_sh4al_dsp_up},
/* nnmm011100 movx.l @<REG_Axy>+r8,<DSP_REG_XY> */{"movx.l",{AXY_PMOD_N,DSP_REG_XY},{PPI,MOVX_NOPY,HEX_1,HEX_C}, arch_sh4al_dsp_up},
/* nnmm110100 movx.l <DSP_REG_AX>,@<REG_Axy> */ {"movx.l",{DSP_REG_AX,AXY_IND_N},{PPI,MOVX_NOPY,HEX_3,HEX_4}, arch_sh4al_dsp_up},
/* nnmm111000 movx.l <DSP_REG_AX>,@<REG_Axy>+ */{"movx.l",{DSP_REG_AX,AXY_INC_N},{PPI,MOVX_NOPY,HEX_3,HEX_8}, arch_sh4al_dsp_up},
/* nnmm111100 movx.l <DSP_REG_AX>,@<REG_Axy>+r8 */{"movx.l",{DSP_REG_AX,AXY_PMOD_N},{PPI,MOVX_NOPY,HEX_3,HEX_C}, arch_sh4al_dsp_up},
/* *n*m*0**01 movy.w @<REG_N>,<DSP_REG_Y> */ {"movy.w",{AY_IND_N,DSP_REG_Y},{PPI,MOVY,HEX_1}, arch_sh_dsp_up},
/* *n*m*0**10 movy.w @<REG_N>+,<DSP_REG_Y> */ {"movy.w",{AY_INC_N,DSP_REG_Y},{PPI,MOVY,HEX_2}, arch_sh_dsp_up},
/* *n*m*0**11 movy.w @<REG_N>+r9,<DSP_REG_Y> */ {"movy.w",{AY_PMOD_N,DSP_REG_Y},{PPI,MOVY,HEX_3}, arch_sh_dsp_up},
/* *n*m*1**01 movy.w <DSP_REG_M>,@<REG_N> */ {"movy.w",{DSP_REG_A_M,AY_IND_N},{PPI,MOVY,HEX_9}, arch_sh_dsp_up},
/* *n*m*1**10 movy.w <DSP_REG_M>,@<REG_N>+ */ {"movy.w",{DSP_REG_A_M,AY_INC_N},{PPI,MOVY,HEX_A}, arch_sh_dsp_up},
/* *n*m*1**11 movy.w <DSP_REG_M>,@<REG_N>+r9 */ {"movy.w",{DSP_REG_A_M,AY_PMOD_N},{PPI,MOVY,HEX_B}, arch_sh_dsp_up},
/* nnmm000001 movy.w @<REG_Ayx>,<DSP_REG_YX> */ {"movy.w",{AYX_IND_N,DSP_REG_YX},{PPI,MOVY_NOPX,HEX_0,HEX_1}, arch_sh4al_dsp_up},
/* nnmm000010 movy.w @<REG_Ayx>+,<DSP_REG_YX> */{"movy.w",{AYX_INC_N,DSP_REG_YX},{PPI,MOVY_NOPX,HEX_0,HEX_2}, arch_sh4al_dsp_up},
/* nnmm000011 movy.w @<REG_Ayx>+r8,<DSP_REG_YX> */{"movy.w",{AYX_PMOD_N,DSP_REG_YX},{PPI,MOVY_NOPX,HEX_0,HEX_3}, arch_sh4al_dsp_up},
/* nnmm010001 movy.w <DSP_REG_AY>,@<REG_Ayx> */ {"movy.w",{DSP_REG_AY,AYX_IND_N},{PPI,MOVY_NOPX,HEX_1,HEX_1}, arch_sh4al_dsp_up},
/* nnmm010010 movy.w <DSP_REG_AY>,@<REG_Ayx>+ */{"movy.w",{DSP_REG_AY,AYX_INC_N},{PPI,MOVY_NOPX,HEX_1,HEX_2}, arch_sh4al_dsp_up},
/* nnmm010011 movy.w <DSP_REG_AY>,@<REG_Ayx>+r8 */{"movy.w",{DSP_REG_AY,AYX_PMOD_N},{PPI,MOVY_NOPX,HEX_1,HEX_3}, arch_sh4al_dsp_up},
/* nnmm100001 movy.l @<REG_Ayx>,<DSP_REG_YX> */ {"movy.l",{AYX_IND_N,DSP_REG_YX},{PPI,MOVY_NOPX,HEX_2,HEX_1}, arch_sh4al_dsp_up},
/* nnmm100010 movy.l @<REG_Ayx>+,<DSP_REG_YX> */{"movy.l",{AYX_INC_N,DSP_REG_YX},{PPI,MOVY_NOPX,HEX_2,HEX_2}, arch_sh4al_dsp_up},
/* nnmm100011 movy.l @<REG_Ayx>+r8,<DSP_REG_YX> */{"movy.l",{AYX_PMOD_N,DSP_REG_YX},{PPI,MOVY_NOPX,HEX_2,HEX_3}, arch_sh4al_dsp_up},
/* nnmm110001 movy.l <DSP_REG_AY>,@<REG_Ayx> */ {"movy.l",{DSP_REG_AY,AYX_IND_N},{PPI,MOVY_NOPX,HEX_3,HEX_1}, arch_sh4al_dsp_up},
/* nnmm110010 movy.l <DSP_REG_AY>,@<REG_Ayx>+ */{"movy.l",{DSP_REG_AY,AYX_INC_N},{PPI,MOVY_NOPX,HEX_3,HEX_2}, arch_sh4al_dsp_up},
/* nnmm110011 movy.l <DSP_REG_AY>,@<REG_Ayx>+r8 */{"movy.l",{DSP_REG_AY,AYX_PMOD_N},{PPI,MOVY_NOPX,HEX_3,HEX_3}, arch_sh4al_dsp_up},
/* 01aaeeffxxyyggnn pmuls Se,Sf,Dg */ {"pmuls",{DSP_REG_E,DSP_REG_F,DSP_REG_G},{PPI,PMUL}, arch_sh_dsp_up},
/* 10100000xxyynnnn psubc <DSP_REG_X>,<DSP_REG_Y>,<DSP_REG_N> */
@ -687,13 +771,21 @@ const sh_opcode_info sh_table[] =
/* 10110100xxyynnnn pwad <DSP_REG_X>,<DSP_REG_Y>,<DSP_REG_N> */
{"pwad", {DSP_REG_X,DSP_REG_Y,DSP_REG_N},{PPI,PPI3,HEX_B,HEX_4}, arch_sh_dsp_up},
/* 10001000xxyynnnn pabs <DSP_REG_X>,<DSP_REG_N> */
{"pabs", {DSP_REG_X,DSP_REG_N},{PPI,PPI3,HEX_8,HEX_8}, arch_sh_dsp_up},
{"pabs", {DSP_REG_X,DSP_REG_N},{PPI,PPI3NC,HEX_8,HEX_8}, arch_sh_dsp_up},
/* 1000100!xx01nnnn pabs <DSP_REG_X>,<DSP_REG_N> */
{"pabs", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_8,HEX_9,HEX_1}, arch_sh4al_dsp_up},
/* 10101000xxyynnnn pabs <DSP_REG_Y>,<DSP_REG_N> */
{"pabs", {DSP_REG_Y,DSP_REG_N},{PPI,PPI3,HEX_A,HEX_8}, arch_sh_dsp_up},
{"pabs", {DSP_REG_Y,DSP_REG_N},{PPI,PPI3NC,HEX_A,HEX_8}, arch_sh_dsp_up},
/* 1010100!01yynnnn pabs <DSP_REG_Y>,<DSP_REG_N> */
{"pabs", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_A,HEX_9,HEX_4}, arch_sh4al_dsp_up},
/* 10011000xxyynnnn prnd <DSP_REG_X>,<DSP_REG_N> */
{"prnd", {DSP_REG_X,DSP_REG_N},{PPI,PPI3,HEX_9,HEX_8}, arch_sh_dsp_up},
{"prnd", {DSP_REG_X,DSP_REG_N},{PPI,PPI3NC,HEX_9,HEX_8}, arch_sh_dsp_up},
/* 1001100!xx01nnnn prnd <DSP_REG_X>,<DSP_REG_N> */
{"prnd", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_9,HEX_9,HEX_1}, arch_sh4al_dsp_up},
/* 10111000xxyynnnn prnd <DSP_REG_Y>,<DSP_REG_N> */
{"prnd", {DSP_REG_Y,DSP_REG_N},{PPI,PPI3,HEX_B,HEX_8}, arch_sh_dsp_up},
{"prnd", {DSP_REG_Y,DSP_REG_N},{PPI,PPI3NC,HEX_B,HEX_8}, arch_sh_dsp_up},
/* 1011100!01yynnnn prnd <DSP_REG_Y>,<DSP_REG_N> */
{"prnd", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_9,HEX_4}, arch_sh4al_dsp_up},
{"dct",{0},{PPI,PDC,HEX_1}, arch_sh_dsp_up},
{"dcf",{0},{PPI,PDC,HEX_2}, arch_sh_dsp_up},
@ -706,6 +798,8 @@ const sh_opcode_info sh_table[] =
/* 00010iiiiiiinnnn psha #<imm>,<DSP_REG_N> */ {"psha",{A_IMM,DSP_REG_N},{PPI,PSH,HEX_1}, arch_sh_dsp_up},
/* 10100001xxyynnnn psub <DSP_REG_X>,<DSP_REG_Y>,<DSP_REG_N> */
{"psub", {DSP_REG_X,DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_A,HEX_1}, arch_sh_dsp_up},
/* 10000101xxyynnnn psub <DSP_REG_Y>,<DSP_REG_X>,<DSP_REG_N> */
{"psub", {DSP_REG_Y,DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_8,HEX_5}, arch_sh4al_dsp_up},
/* 10110001xxyynnnn padd <DSP_REG_X>,<DSP_REG_Y>,<DSP_REG_N> */
{"padd", {DSP_REG_X,DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_1}, arch_sh_dsp_up},
/* 10010101xxyynnnn pand <DSP_REG_X>,<DSP_REG_Y>,<DSP_REG_N> */
@ -718,16 +812,16 @@ const sh_opcode_info sh_table[] =
{"pdec", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_8,HEX_9}, arch_sh_dsp_up},
/* 10101001xxyynnnn pdec <DSP_REG_Y>,<DSP_REG_N> */
{"pdec", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_A,HEX_9}, arch_sh_dsp_up},
/* 10011001xxyynnnn pinc <DSP_REG_X>,<DSP_REG_N> */
{"pinc", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_9,HEX_9}, arch_sh_dsp_up},
/* 10111001xxyynnnn pinc <DSP_REG_Y>,<DSP_REG_N> */
{"pinc", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_9}, arch_sh_dsp_up},
/* 10011001xx00nnnn pinc <DSP_REG_X>,<DSP_REG_N> */
{"pinc", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_9,HEX_9,HEX_XX00}, arch_sh_dsp_up},
/* 1011100100yynnnn pinc <DSP_REG_Y>,<DSP_REG_N> */
{"pinc", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_9,HEX_00YY}, arch_sh_dsp_up},
/* 10001101xxyynnnn pclr <DSP_REG_N> */
{"pclr", {DSP_REG_N},{PPI,PPIC,HEX_8,HEX_D}, arch_sh_dsp_up},
/* 10011101xxyynnnn pdmsb <DSP_REG_X>,<DSP_REG_N> */
{"pdmsb", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_9,HEX_D}, arch_sh_dsp_up},
/* 10111101xxyynnnn pdmsb <DSP_REG_Y>,<DSP_REG_N> */
{"pdmsb", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_D}, arch_sh_dsp_up},
/* 10011101xx00nnnn pdmsb <DSP_REG_X>,<DSP_REG_N> */
{"pdmsb", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_9,HEX_D,HEX_XX00}, arch_sh_dsp_up},
/* 1011110100yynnnn pdmsb <DSP_REG_Y>,<DSP_REG_N> */
{"pdmsb", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_D,HEX_00YY}, arch_sh_dsp_up},
/* 11001001xxyynnnn pneg <DSP_REG_X>,<DSP_REG_N> */
{"pneg", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_C,HEX_9}, arch_sh_dsp_up},
/* 11101001xxyynnnn pneg <DSP_REG_Y>,<DSP_REG_N> */
@ -744,9 +838,13 @@ const sh_opcode_info sh_table[] =
{"plds", {DSP_REG_N,A_MACH},{PPI,PPIC,HEX_E,HEX_D}, arch_sh_dsp_up},
/* 11111101xxyynnnn plds <DSP_REG_N>,MACL */
{"plds", {DSP_REG_N,A_MACL},{PPI,PPIC,HEX_F,HEX_D}, arch_sh_dsp_up},
/* 10011101xx01zzzz pswap <DSP_REG_X>,<DSP_REG_N> */
{"pswap", {DSP_REG_X,DSP_REG_N},{PPI,PPIC,HEX_9,HEX_D,HEX_1}, arch_sh4al_dsp_up},
/* 1011110101yyzzzz pswap <DSP_REG_Y>,<DSP_REG_N> */
{"pswap", {DSP_REG_Y,DSP_REG_N},{PPI,PPIC,HEX_B,HEX_D,HEX_4}, arch_sh4al_dsp_up},
/* 1111nnnn01011101 fabs <F_REG_N> */{"fabs",{F_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh2e_up},
/* 1111nnnn01011101 fabs <D_REG_N> */{"fabs",{D_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh4_up},
/* 1111nnn001011101 fabs <D_REG_N> */{"fabs",{D_REG_N},{HEX_F,REG_N,HEX_5,HEX_D}, arch_sh4_up},
/* 1111nnnnmmmm0000 fadd <F_REG_M>,<F_REG_N>*/{"fadd",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_0}, arch_sh2e_up},
/* 1111nnn0mmm00000 fadd <D_REG_M>,<D_REG_N>*/{"fadd",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_0}, arch_sh4_up},
@ -757,9 +855,9 @@ const sh_opcode_info sh_table[] =
/* 1111nnnnmmmm0101 fcmp/gt <F_REG_M>,<F_REG_N>*/{"fcmp/gt",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_5}, arch_sh2e_up},
/* 1111nnn0mmm00101 fcmp/gt <D_REG_M>,<D_REG_N>*/{"fcmp/gt",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_5}, arch_sh4_up},
/* 1111nnn010111101 fcnvds <D_REG_N>,FPUL*/{"fcnvds",{D_REG_N,FPUL_M},{HEX_F,REG_N,HEX_B,HEX_D}, arch_sh4_up},
/* 1111nnn010111101 fcnvds <D_REG_N>,FPUL*/{"fcnvds",{D_REG_N,FPUL_M},{HEX_F,REG_N_D,HEX_B,HEX_D}, arch_sh4_up},
/* 1111nnn010101101 fcnvsd FPUL,<D_REG_N>*/{"fcnvsd",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_A,HEX_D}, arch_sh4_up},
/* 1111nnn010101101 fcnvsd FPUL,<D_REG_N>*/{"fcnvsd",{FPUL_M,D_REG_N},{HEX_F,REG_N_D,HEX_A,HEX_D}, arch_sh4_up},
/* 1111nnnnmmmm0011 fdiv <F_REG_M>,<F_REG_N>*/{"fdiv",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_3}, arch_sh2e_up},
/* 1111nnn0mmm00011 fdiv <D_REG_M>,<D_REG_N>*/{"fdiv",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_3}, arch_sh4_up},
@ -773,42 +871,42 @@ const sh_opcode_info sh_table[] =
/* 1111nnnn00011101 flds <F_REG_N>,FPUL*/{"flds",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_1,HEX_D}, arch_sh2e_up},
/* 1111nnnn00101101 float FPUL,<F_REG_N>*/{"float",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh2e_up},
/* 1111nnnn00101101 float FPUL,<D_REG_N>*/{"float",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh4_up},
/* 1111nnn000101101 float FPUL,<D_REG_N>*/{"float",{FPUL_M,D_REG_N},{HEX_F,REG_N,HEX_2,HEX_D}, arch_sh4_up},
/* 1111nnnnmmmm1110 fmac FR0,<F_REG_M>,<F_REG_N>*/{"fmac",{F_FR0,F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_E}, arch_sh2e_up},
/* 1111nnnnmmmm1100 fmov <F_REG_M>,<F_REG_N>*/{"fmov",{F_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh2e_up},
/* 1111nnnnmmmm1100 fmov <DX_REG_M>,<DX_REG_N>*/{"fmov",{DX_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh4_up},
/* 1111nnn1mmmm1100 fmov <DX_REG_M>,<DX_REG_N>*/{"fmov",{DX_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_C}, arch_sh4_up},
/* 1111nnnnmmmm1000 fmov @<REG_M>,<F_REG_N>*/{"fmov",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh2e_up},
/* 1111nnnnmmmm1000 fmov @<REG_M>,<DX_REG_N>*/{"fmov",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
/* 1111nnn1mmmm1000 fmov @<REG_M>,<DX_REG_N>*/{"fmov",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
/* 1111nnnnmmmm1010 fmov <F_REG_M>,@<REG_N>*/{"fmov",{F_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh2e_up},
/* 1111nnnnmmmm1010 fmov <DX_REG_M>,@<REG_N>*/{"fmov",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
/* 1111nnnnmmm11010 fmov <DX_REG_M>,@<REG_N>*/{"fmov",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
/* 1111nnnnmmmm1001 fmov @<REG_M>+,<F_REG_N>*/{"fmov",{A_INC_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh2e_up},
/* 1111nnnnmmmm1001 fmov @<REG_M>+,<DX_REG_N>*/{"fmov",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
/* 1111nnn1mmmm1001 fmov @<REG_M>+,<DX_REG_N>*/{"fmov",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
/* 1111nnnnmmmm1011 fmov <F_REG_M>,@-<REG_N>*/{"fmov",{F_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh2e_up},
/* 1111nnnnmmmm1011 fmov <DX_REG_M>,@-<REG_N>*/{"fmov",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
/* 1111nnnnmmm11011 fmov <DX_REG_M>,@-<REG_N>*/{"fmov",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
/* 1111nnnnmmmm0110 fmov @(R0,<REG_M>),<F_REG_N>*/{"fmov",{A_IND_R0_REG_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh2e_up},
/* 1111nnnnmmmm0110 fmov @(R0,<REG_M>),<DX_REG_N>*/{"fmov",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
/* 1111nnn1mmmm0110 fmov @(R0,<REG_M>),<DX_REG_N>*/{"fmov",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
/* 1111nnnnmmmm0111 fmov <F_REG_M>,@(R0,<REG_N>)*/{"fmov",{F_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh2e_up},
/* 1111nnnnmmmm0111 fmov <DX_REG_M>,@(R0,<REG_N>)*/{"fmov",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
/* 1111nnnnmmm10111 fmov <DX_REG_M>,@(R0,<REG_N>)*/{"fmov",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
/* 1111nnnnmmmm1000 fmov.d @<REG_M>,<DX_REG_N>*/{"fmov.d",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
/* 1111nnn1mmmm1000 fmov.d @<REG_M>,<DX_REG_N>*/{"fmov.d",{A_IND_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh4_up},
/* 1111nnnnmmmm1010 fmov.d <DX_REG_M>,@<REG_N>*/{"fmov.d",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
/* 1111nnnnmmm11010 fmov.d <DX_REG_M>,@<REG_N>*/{"fmov.d",{DX_REG_M,A_IND_N},{HEX_F,REG_N,REG_M,HEX_A}, arch_sh4_up},
/* 1111nnnnmmmm1001 fmov.d @<REG_M>+,<DX_REG_N>*/{"fmov.d",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
/* 1111nnn1mmmm1001 fmov.d @<REG_M>+,<DX_REG_N>*/{"fmov.d",{A_INC_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_9}, arch_sh4_up},
/* 1111nnnnmmmm1011 fmov.d <DX_REG_M>,@-<REG_N>*/{"fmov.d",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
/* 1111nnnnmmm11011 fmov.d <DX_REG_M>,@-<REG_N>*/{"fmov.d",{DX_REG_M,A_DEC_N},{HEX_F,REG_N,REG_M,HEX_B}, arch_sh4_up},
/* 1111nnnnmmmm0110 fmov.d @(R0,<REG_M>),<DX_REG_N>*/{"fmov.d",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
/* 1111nnn1mmmm0110 fmov.d @(R0,<REG_M>),<DX_REG_N>*/{"fmov.d",{A_IND_R0_REG_M,DX_REG_N},{HEX_F,REG_N,REG_M,HEX_6}, arch_sh4_up},
/* 1111nnnnmmmm0111 fmov.d <DX_REG_M>,@(R0,<REG_N>)*/{"fmov.d",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
/* 1111nnnnmmm10111 fmov.d <DX_REG_M>,@(R0,<REG_N>)*/{"fmov.d",{DX_REG_M,A_IND_R0_REG_N},{HEX_F,REG_N,REG_M,HEX_7}, arch_sh4_up},
/* 1111nnnnmmmm1000 fmov.s @<REG_M>,<F_REG_N>*/{"fmov.s",{A_IND_M,F_REG_N},{HEX_F,REG_N,REG_M,HEX_8}, arch_sh2e_up},
@ -826,14 +924,20 @@ const sh_opcode_info sh_table[] =
/* 1111nnn0mmm00010 fmul <D_REG_M>,<D_REG_N>*/{"fmul",{D_REG_M,D_REG_N},{HEX_F,REG_N,REG_M,HEX_2}, arch_sh4_up},
/* 1111nnnn01001101 fneg <F_REG_N> */{"fneg",{F_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh2e_up},
/* 1111nnnn01001101 fneg <D_REG_N> */{"fneg",{D_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh4_up},
/* 1111nnn001001101 fneg <D_REG_N> */{"fneg",{D_REG_N},{HEX_F,REG_N,HEX_4,HEX_D}, arch_sh4_up},
/* 1111011111111101 fpchg */{"fpchg",{0},{HEX_F,HEX_7,HEX_F,HEX_D}, arch_sh4a_up},
/* 1111101111111101 frchg */{"frchg",{0},{HEX_F,HEX_B,HEX_F,HEX_D}, arch_sh4_up},
/* 1111nnn011111101 fsca FPUL,<D_REG_N> */{"fsca",{FPUL_M,D_REG_N},{HEX_F,REG_N_D,HEX_F,HEX_D}, arch_sh4_up},
/* 1111001111111101 fschg */{"fschg",{0},{HEX_F,HEX_3,HEX_F,HEX_D}, arch_sh4_up},
/* 1111nnnn01101101 fsqrt <F_REG_N> */{"fsqrt",{F_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh3e_up},
/* 1111nnnn01101101 fsqrt <D_REG_N> */{"fsqrt",{D_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh4_up},
/* 1111nnn001101101 fsqrt <D_REG_N> */{"fsqrt",{D_REG_N},{HEX_F,REG_N,HEX_6,HEX_D}, arch_sh4_up},
/* 1111nnnn01111101 fsrra <F_REG_N> */{"fsrra",{F_REG_N},{HEX_F,REG_N,HEX_7,HEX_D}, arch_sh4_up},
/* 1111nnnn00001101 fsts FPUL,<F_REG_N>*/{"fsts",{FPUL_M,F_REG_N},{HEX_F,REG_N,HEX_0,HEX_D}, arch_sh2e_up},
@ -843,7 +947,7 @@ const sh_opcode_info sh_table[] =
/* 1111nnnn00111101 ftrc <F_REG_N>,FPUL*/{"ftrc",{F_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}, arch_sh2e_up},
/* 1111nnnn00111101 ftrc <D_REG_N>,FPUL*/{"ftrc",{D_REG_N,FPUL_M},{HEX_F,REG_N,HEX_3,HEX_D}, arch_sh4_up},
/* 1111nn0111111101 ftrv XMTRX_M4,<V_REG_n>*/{"ftrv",{XMTRX_M4,V_REG_N},{HEX_F,REG_NM,HEX_F,HEX_D}, arch_sh4_up},
/* 1111nn0111111101 ftrv XMTRX_M4,<V_REG_n>*/{"ftrv",{XMTRX_M4,V_REG_N},{HEX_F,REG_N_B01,HEX_F,HEX_D}, arch_sh4_up},
{ 0, {0}, {0}, 0 }
};

View File

@ -1,6 +1,6 @@
/* Print SPARC instructions.
Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2002, 2003 Free Software Foundation, Inc.
2000, 2002, 2003, 2004 Free Software Foundation, Inc.
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
@ -224,7 +224,7 @@ print_insn_sparc (memaddr, info)
static int opcodes_initialized = 0;
/* bfd mach number of last call. */
static unsigned long current_mach = 0;
bfd_vma (*getword) PARAMS ((const unsigned char *));
bfd_vma (*getword) (const void *);
if (!opcodes_initialized
|| info->mach != current_mach)