Resolve conflicts from binutils 2.11 import.

This commit is contained in:
tv 2001-04-23 14:16:30 +00:00
parent 27b65c5cd9
commit 4031f2faa5
77 changed files with 21797 additions and 11447 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@ MY(callback) (abfd)
bfd_vma adjust;
adjust = execp->a_entry - obj_textsec (abfd)->vma;
/* Adjust only by whole pages. */
/* Adjust only by whole pages. */
adjust &= ~(TARGET_PAGE_SIZE - 1);
obj_textsec (abfd)->vma += adjust;
obj_datasec (abfd)->vma += adjust;
@ -89,7 +89,7 @@ MY(callback) (abfd)
/* The file offsets of the string table and symbol table. */
obj_sym_filepos (abfd) = N_SYMOFF (*execp);
obj_str_filepos (abfd) = N_STROFF (*execp);
/* Determine the architecture and machine type of the object file. */
#ifdef SET_ARCH_MACH
SET_ARCH_MACH(abfd, *execp);
@ -169,7 +169,7 @@ MY(object_p) (abfd)
if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) return 0;
#endif
NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
NAME(aout,swap_exec_header_in) (abfd, &exec_bytes, &exec);
#ifdef SWAP_MAGIC
/* swap_exec_header_in read in a_info with the wrong byte order */
@ -183,7 +183,7 @@ MY(object_p) (abfd)
* means that it isn't obvious if EXEC_P should be set.
* All of the following must be true for an executable:
* There must be no relocations, the bfd can be neither an
* archive nor an archive element, and the file must be executable. */
* archive nor an archive element, and the file must be executable. */
if (exec.a_trsize + exec.a_drsize == 0
&& bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
@ -202,7 +202,6 @@ MY(object_p) (abfd)
#define MY_object_p MY(object_p)
#endif
#ifndef MY_mkobject
static boolean MY(mkobject) PARAMS ((bfd *));
@ -211,7 +210,7 @@ static boolean
MY(mkobject) (abfd)
bfd *abfd;
{
if (NAME(aout,mkobject)(abfd) == false)
if (NAME(aout,mkobject) (abfd) == false)
return false;
#if 0 /* Sizes get set in set_sizes callback, later, after we know
the architecture and machine. */
@ -235,7 +234,6 @@ MY(mkobject) (abfd)
static boolean MY_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));
/*ARGSUSED*/
static boolean
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
bfd *ibfd;
@ -555,7 +553,6 @@ MY_bfd_final_link (abfd, info)
#define MY_bfd_link_split_section _bfd_generic_link_split_section
#endif
#ifndef MY_bfd_copy_private_bfd_data
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif
@ -606,7 +603,7 @@ MY_bfd_final_link (abfd, info)
#endif
/* Aout symbols normally have leading underscores */
#ifndef MY_symbol_leading_char
#ifndef MY_symbol_leading_char
#define MY_symbol_leading_char '_'
#endif
@ -668,7 +665,7 @@ const bfd_target MY(vec) =
/* Alternative_target */
NULL,
(PTR) MY_backend_data
};
#endif /* MY_BFD_TARGET */

View File

@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
SECTION
a.out backends
DESCRIPTION
BFD supports a number of different flavours of a.out format,
@ -165,10 +164,18 @@ DESCRIPTION
#define MY_swap_std_reloc_in NAME(aout,swap_std_reloc_in)
#endif
#ifndef MY_swap_ext_reloc_in
#define MY_swap_ext_reloc_in NAME(aout,swap_ext_reloc_in)
#endif
#ifndef MY_swap_std_reloc_out
#define MY_swap_std_reloc_out NAME(aout,swap_std_reloc_out)
#endif
#ifndef MY_swap_ext_reloc_out
#define MY_swap_ext_reloc_out NAME(aout,swap_ext_reloc_out)
#endif
#ifndef MY_final_link_relocate
#define MY_final_link_relocate _bfd_final_link_relocate
#endif
@ -265,7 +272,7 @@ EMPTY_HOWTO (-1),
HOWTO(0, 0, 2, 0, true, 0, complain_overflow_bitfield,0,"GOTPC", false, 0,0x00000000, false),
};
#define TABLE_SIZE(TABLE) (sizeof(TABLE)/sizeof(TABLE[0]))
#define TABLE_SIZE(TABLE) (sizeof (TABLE)/sizeof (TABLE[0]))
reloc_howto_type *
NAME(aout,reloc_type_lookup) (abfd,code)
@ -288,6 +295,8 @@ NAME(aout,reloc_type_lookup) (abfd,code)
if (ext)
switch (code)
{
EXT (BFD_RELOC_8, 0);
EXT (BFD_RELOC_16, 1);
EXT (BFD_RELOC_32, 2);
EXT (BFD_RELOC_HI22, 8);
EXT (BFD_RELOC_LO10, 11);
@ -362,7 +371,7 @@ NAME(aout,swap_exec_header_in) (abfd, raw_bytes, execp)
/* The internal_exec structure has some fields that are unused in this
configuration (IE for i960), so ensure that all such uninitialized
fields are zero'd out. There are places where two of these structs
are memcmp'd, and thus the contents do matter. */
are memcmp'd, and thus the contents do matter. */
memset ((PTR) execp, 0, sizeof (struct internal_exec));
/* Now fill in fields in the execp, from the bytes in the raw data. */
execp->a_info = bfd_h_get_32 (abfd, bytes->e_info);
@ -399,7 +408,7 @@ NAME(aout,swap_exec_header_out) (abfd, execp, raw_bytes)
{
struct external_exec *bytes = (struct external_exec *)raw_bytes;
/* Now fill in fields in the raw data, from the fields in the exec struct. */
/* Now fill in fields in the raw data, from the fields in the exec struct. */
bfd_h_put_32 (abfd, execp->a_info , bytes->e_info);
PUT_WORD (abfd, execp->a_text , bytes->e_text);
PUT_WORD (abfd, execp->a_data , bytes->e_data);
@ -435,7 +444,7 @@ FUNCTION
SYNOPSIS
const bfd_target *aout_@var{size}_some_aout_object_p
(bfd *abfd,
const bfd_target *(*callback_to_real_object_p)());
const bfd_target *(*callback_to_real_object_p) ());
DESCRIPTION
Some a.out variant thinks that the file open in @var{abfd}
@ -516,7 +525,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
/* The default relocation entry size is that of traditional V7 Unix. */
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
/* The default symbol entry size is that of traditional Unix. */
/* The default symbol entry size is that of traditional Unix. */
obj_symbol_entry_size (abfd) = EXTERNAL_NLIST_SIZE;
#ifdef USE_MMAP
@ -600,7 +609,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
header, should cope with them in this callback as well. */
#endif /* DOCUMENTATION */
result = (*callback_to_real_object_p)(abfd);
result = (*callback_to_real_object_p) (abfd);
/* Now that the segment addresses have been worked out, take a better
guess at whether the file is executable. If the entry point
@ -615,7 +624,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
To fix this, we now accept any non-zero entry point as an indication of
executability. This will work most of the time, since only the linker
sets the entry point, and that is likely to be non-zero for most systems. */
sets the entry point, and that is likely to be non-zero for most systems. */
if (execp->a_entry != 0
|| (execp->a_entry >= obj_textsec(abfd)->vma
@ -692,7 +701,6 @@ NAME(aout,mkobject) (abfd)
return true;
}
/*
FUNCTION
aout_@var{size}_machine_type
@ -756,7 +764,7 @@ NAME(aout,machine_type) (arch, machine, unknown)
case bfd_arch_arm:
if (machine == 0) arch_flags = M_ARM;
break;
case bfd_arch_mips:
switch (machine) {
case 0:
@ -777,7 +785,12 @@ NAME(aout,machine_type) (arch, machine, unknown)
case bfd_mach_mips8000:
case bfd_mach_mips10000:
case bfd_mach_mips16:
/* FIXME: These should be MIPS3 or MIPS4. */
case bfd_mach_mips32:
case bfd_mach_mips32_4k:
case bfd_mach_mips5:
case bfd_mach_mips64:
case bfd_mach_mips_sb1:
/* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */
arch_flags = M_MIPS2;
break;
default:
@ -799,6 +812,10 @@ NAME(aout,machine_type) (arch, machine, unknown)
*unknown = false;
break;
case bfd_arch_cris:
if (machine == 0 || machine == 255) arch_flags = M_CRIS;
break;
default:
arch_flags = M_UNKNOWN;
}
@ -809,7 +826,6 @@ NAME(aout,machine_type) (arch, machine, unknown)
return arch_flags;
}
/*
FUNCTION
aout_@var{size}_set_arch_mach
@ -936,7 +952,7 @@ adjust_z_magic (abfd, execp)
file_ptr text_end;
CONST struct aout_backend_data *abdp;
int ztih; /* Nonzero if text includes exec header. */
abdp = aout_backend_info (abfd);
/* Text. */
@ -1004,7 +1020,7 @@ adjust_z_magic (abfd, execp)
}
obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos
+ obj_textsec(abfd)->_raw_size);
/* Fix up exec header while we're at it. */
execp->a_text = obj_textsec(abfd)->_raw_size;
if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
@ -1049,7 +1065,7 @@ adjust_n_magic (abfd, execp)
file_ptr pos = adata(abfd).exec_bytes_size;
bfd_vma vma = 0;
int pad;
/* Text. */
obj_textsec(abfd)->filepos = pos;
if (!obj_textsec(abfd)->user_set_vma)
@ -1064,7 +1080,7 @@ adjust_n_magic (abfd, execp)
if (!obj_datasec(abfd)->user_set_vma)
obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
vma = obj_datasec(abfd)->vma;
/* Since BSS follows data immediately, see if it needs alignment. */
vma += obj_datasec(abfd)->_raw_size;
pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
@ -1109,7 +1125,7 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end)
(TARGET_PAGE_SIZE). However, newer versions of SUNOS start the text
segment right after the exec header; the latter is counted in the
text segment size, and is paged in by the kernel with the rest of
the text. */
the text. */
/* This perhaps isn't the right way to do this, but made it simpler for me
to understand enough to implement it. Better would probably be to go
@ -1196,7 +1212,6 @@ NAME(aout,new_section_hook) (abfd, newsect)
/* align to double at least */
newsect->alignment_power = bfd_get_arch_info(abfd)->section_align_power;
if (bfd_get_format (abfd) == bfd_object)
{
if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) {
@ -1306,7 +1321,7 @@ aout_get_external_symbols (abfd)
obj_aout_external_syms (abfd) = syms;
obj_aout_external_sym_count (abfd) = count;
}
if (obj_aout_external_strings (abfd) == NULL
&& exec_hdr (abfd)->a_syms != 0)
{
@ -1649,7 +1664,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
file. */
(*_bfd_error_handler)
(_("%s: can not represent section for symbol `%s' in a.out object file format"),
bfd_get_filename (abfd),
bfd_get_filename (abfd),
cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*"));
bfd_set_error (bfd_error_nonrepresentable_section);
return false;
@ -1694,6 +1709,8 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
sym_pointer->e_type[0] = ((aout_symbol_type *) cache_ptr)->type;
else if ((cache_ptr->flags & BSF_GLOBAL) != 0)
sym_pointer->e_type[0] |= N_EXT;
else if ((cache_ptr->flags & BSF_LOCAL) != 0)
sym_pointer->e_type[0] &= ~N_EXT;
if ((cache_ptr->flags & BSF_CONSTRUCTOR) != 0)
{
@ -1729,7 +1746,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
return true;
}
/* Native-level interface to symbols. */
/* Native-level interface to symbols. */
asymbol *
NAME(aout,make_empty_symbol) (abfd)
@ -1796,7 +1813,7 @@ NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic)
/* We read the symbols into a buffer, which is discarded when this
function exits. We read the strings into a buffer large enough to
hold them all plus all the cached symbol entries. */
hold them all plus all the cached symbol entries. */
boolean
NAME(aout,slurp_symbol_table) (abfd)
@ -1983,7 +2000,6 @@ error_return:
_bfd_stringtab_free (strtab);
return false;
}
long
NAME(aout,get_symtab) (abfd, location)
@ -1993,18 +2009,17 @@ NAME(aout,get_symtab) (abfd, location)
unsigned int counter = 0;
aout_symbol_type *symbase;
if (!NAME(aout,slurp_symbol_table)(abfd))
if (!NAME(aout,slurp_symbol_table) (abfd))
return -1;
for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);)
*(location++) = (asymbol *)( symbase++);
*(location++) = (asymbol *) ( symbase++);
*location++ =0;
return bfd_get_symcount (abfd);
}
/* Standard reloc stuff */
/* Output standard relocation information to a file in target byte order. */
/* Output standard relocation information to a file in target byte order. */
extern void NAME(aout,swap_std_reloc_out)
PARAMS ((bfd *, arelent *, struct reloc_std_external *));
@ -2047,7 +2062,6 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr)
check for that here
*/
if (bfd_is_com_section (output_section)
|| bfd_is_abs_section (output_section)
|| bfd_is_und_section (output_section))
@ -2116,9 +2130,8 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr)
}
}
/* Extended stuff */
/* Output extended relocation information to a file in target byte order. */
/* Output extended relocation information to a file in target byte order. */
extern void NAME(aout,swap_ext_reloc_out)
PARAMS ((bfd *, arelent *, struct reloc_ext_external *));
@ -2200,7 +2213,6 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr)
contain 60. This macro subs the base of each section from the value
to give the true offset from the section */
#define MOVE_ADDRESS(ad) \
if (r_extern) { \
/* undefined symbol */ \
@ -2420,8 +2432,8 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols)
(struct reloc_ext_external *) relocs;
for (; counter < count; counter++, rptr++, cache_ptr++)
NAME(aout,swap_ext_reloc_in) (abfd, rptr, cache_ptr, symbols,
bfd_get_symcount (abfd));
MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols,
bfd_get_symcount (abfd));
}
else
{
@ -2471,7 +2483,8 @@ NAME(aout,squirt_out_relocs) (abfd, section)
for (natptr = native;
count != 0;
--count, natptr += each_size, ++generic)
NAME(aout,swap_ext_reloc_out) (abfd, *generic, (struct reloc_ext_external *)natptr);
MY_swap_ext_reloc_out (abfd, *generic,
(struct reloc_ext_external *) natptr);
}
else
{
@ -2507,7 +2520,7 @@ NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols)
return 0;
}
if (!(tblptr || NAME(aout,slurp_reloc_table)(abfd, section, symbols)))
if (!(tblptr || NAME(aout,slurp_reloc_table) (abfd, section, symbols)))
return -1;
if (section->flags & SEC_CONSTRUCTOR) {
@ -2562,19 +2575,17 @@ NAME(aout,get_reloc_upper_bound) (abfd, asect)
bfd_set_error (bfd_error_invalid_operation);
return -1;
}
long
NAME(aout,get_symtab_upper_bound) (abfd)
bfd *abfd;
{
if (!NAME(aout,slurp_symbol_table)(abfd))
if (!NAME(aout,slurp_symbol_table) (abfd))
return -1;
return (bfd_get_symcount (abfd)+1) * (sizeof (aout_symbol_type *));
}
/*ARGSUSED*/
alent *
NAME(aout,get_lineno) (ignore_abfd, ignore_symbol)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -2583,7 +2594,6 @@ NAME(aout,get_lineno) (ignore_abfd, ignore_symbol)
return (alent *)NULL;
}
/*ARGSUSED*/
void
NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -2600,18 +2610,17 @@ NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret)
if (stab_name == NULL)
{
sprintf(buf, "(%d)", type_code);
sprintf (buf, "(%d)", type_code);
stab_name = buf;
}
ret->type = '-';
ret->stab_type = type_code;
ret->stab_other = (unsigned)(aout_symbol(symbol)->other & 0xff);
ret->stab_desc = (unsigned)(aout_symbol(symbol)->desc & 0xffff);
ret->stab_other = (unsigned) (aout_symbol(symbol)->other & 0xff);
ret->stab_desc = (unsigned) (aout_symbol(symbol)->desc & 0xffff);
ret->stab_name = stab_name;
}
}
/*ARGSUSED*/
void
NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -2624,27 +2633,26 @@ NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how)
switch (how) {
case bfd_print_symbol_name:
if (symbol->name)
fprintf(file,"%s", symbol->name);
fprintf (file,"%s", symbol->name);
break;
case bfd_print_symbol_more:
fprintf(file,"%4x %2x %2x",(unsigned)(aout_symbol(symbol)->desc & 0xffff),
(unsigned)(aout_symbol(symbol)->other & 0xff),
(unsigned)(aout_symbol(symbol)->type));
fprintf (file,"%4x %2x %2x",(unsigned) (aout_symbol(symbol)->desc & 0xffff),
(unsigned) (aout_symbol(symbol)->other & 0xff),
(unsigned) (aout_symbol(symbol)->type));
break;
case bfd_print_symbol_all:
{
CONST char *section_name = symbol->section->name;
bfd_print_symbol_vandf((PTR)file,symbol);
fprintf(file," %-5s %04x %02x %02x",
fprintf (file," %-5s %04x %02x %02x",
section_name,
(unsigned)(aout_symbol(symbol)->desc & 0xffff),
(unsigned)(aout_symbol(symbol)->other & 0xff),
(unsigned)(aout_symbol(symbol)->type & 0xff));
(unsigned) (aout_symbol(symbol)->desc & 0xffff),
(unsigned) (aout_symbol(symbol)->other & 0xff),
(unsigned) (aout_symbol(symbol)->type & 0xff));
if (symbol->name)
fprintf(file," %s", symbol->name);
fprintf (file," %s", symbol->name);
}
break;
}
@ -2744,8 +2752,8 @@ NAME(aout,find_nearest_line)
CONST char *directory_name = NULL;
CONST char *main_file_name = NULL;
CONST char *current_file_name = NULL;
CONST char *line_file_name = NULL; /* Value of current_file_name at line number. */
CONST char *line_directory_name = NULL; /* Value of directory_name at line number. */
CONST char *line_file_name = NULL; /* Value of current_file_name at line number. */
CONST char *line_directory_name = NULL; /* Value of directory_name at line number. */
bfd_vma low_line_vma = 0;
bfd_vma low_func_vma = 0;
asymbol *func = 0;
@ -2757,7 +2765,7 @@ NAME(aout,find_nearest_line)
*line_ptr = 0;
if (symbols != (asymbol **)NULL) {
for (p = symbols; *p; p++) {
aout_symbol_type *q = (aout_symbol_type *)(*p);
aout_symbol_type *q = (aout_symbol_type *) (*p);
next:
switch (q->type){
case N_TEXT:
@ -2804,15 +2812,15 @@ NAME(aout,find_nearest_line)
}
main_file_name = current_file_name = q->symbol.name;
/* Look ahead to next symbol to check if that too is an N_SO. */
/* Look ahead to next symbol to check if that too is an N_SO. */
p++;
if (*p == NULL)
break;
q = (aout_symbol_type *)(*p);
q = (aout_symbol_type *) (*p);
if (q->type != (int)N_SO)
goto next;
/* Found a second N_SO First is directory; second is filename. */
/* Found a second N_SO First is directory; second is filename. */
directory_name = current_file_name;
main_file_name = current_file_name = q->symbol.name;
if (obj_textsec(abfd) != section)
@ -2920,7 +2928,6 @@ NAME(aout,find_nearest_line)
return true;
}
/*ARGSUSED*/
int
NAME(aout,sizeof_headers) (abfd, execable)
bfd *abfd;
@ -4164,7 +4171,7 @@ aout_link_write_symbols (finfo, input_bfd)
/* We have saved the hash table entry for this symbol, if
there is one. Note that we could just look it up again
in the hash table, provided we first check that it is an
external symbol. */
external symbol. */
h = *sym_hash;
/* Use the name from the hash table, in case the symbol was
@ -4828,7 +4835,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
#ifdef MY_reloc_howto
howto = MY_reloc_howto(input_bfd, rel, r_index, r_extern, r_pcrel);
#else
#else
{
int r_jmptable;
int r_relative;
@ -5710,6 +5717,10 @@ aout_link_reloc_link_order (finfo, o, p)
}
else
{
#ifdef MY_put_ext_reloc
MY_put_ext_reloc (finfo->output_bfd, r_extern, r_index, p->offset,
howto, &erel, pr->addend);
#else
PUT_WORD (finfo->output_bfd, p->offset, erel.r_address);
if (bfd_header_big_endian (finfo->output_bfd))
@ -5732,6 +5743,7 @@ aout_link_reloc_link_order (finfo, o, p)
}
PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend);
#endif /* MY_put_ext_reloc */
rel_ptr = (PTR) &erel;
}

View File

@ -152,10 +152,8 @@ extern int errno;
the cache when we actually read one. We also don't sort the cache;
it's generally short enough to search linearly.
Note that the pointers here point to the front of the ar_hdr, not
to the front of the contents!
*/
struct ar_cache
{
to the front of the contents! */
struct ar_cache {
file_ptr ptr;
bfd *arelt;
struct ar_cache *next;
@ -164,7 +162,7 @@ struct ar_cache
#define ar_padchar(abfd) ((abfd)->xvec->ar_pad_char)
#define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen)
#define arch_eltdata(bfd) ((struct areltdata *)((bfd)->arelt_data))
#define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data))
#define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header)
static char *get_extended_arelt_filename PARAMS ((bfd *arch,
@ -316,7 +314,7 @@ _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt)
}
/* The name begins with space. Hence the rest of the name is an index into
the string table. */
the string table. */
static char *
get_extended_arelt_filename (arch, name)
@ -326,9 +324,9 @@ get_extended_arelt_filename (arch, name)
unsigned long index = 0;
/* Should extract string so that I can guarantee not to overflow into
the next region, but I'm too lazy. */
the next region, but I'm too lazy. */
errno = 0;
/* Skip first char, which is '/' in SVR4 or ' ' in some other variants. */
/* Skip first char, which is '/' in SVR4 or ' ' in some other variants. */
index = strtol (name + 1, NULL, 10);
if (errno != 0)
{
@ -411,7 +409,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
}
}
/* BSD4.4-style long filename.
Only implemented for reading, so far! */
Only implemented for reading, so far! */
else if (hdr.ar_name[0] == '#'
&& hdr.ar_name[1] == '1'
&& hdr.ar_name[2] == '/'
@ -440,15 +438,15 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
{
/* We judge the end of the name by looking for '/' or ' '.
Note: The SYSV format (terminated by '/') allows embedded
spaces, so only look for ' ' if we don't find '/'. */
spaces, so only look for ' ' if we don't find '/'. */
char *e;
e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
if (e == NULL)
{
e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
if (e == NULL)
e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
}
if (e != NULL)
@ -526,7 +524,7 @@ _bfd_get_elt_at_filepos (archive, filepos)
if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd))
return n_nfd;
/* huh? */
/* Huh? */
bfd_release (archive, (PTR) n_nfd);
bfd_release (archive, (PTR) new_areldata);
return NULL;
@ -560,7 +558,6 @@ DESCRIPTION
the archive and the previous return value to return a created
BFD to the next contained element. NULL is returned when there
are no more.
*/
bfd *
@ -595,7 +592,7 @@ bfd_generic_openr_next_archived_file (archive, last_file)
unsigned int size = arelt_size (last_file);
/* Pad to an even boundary...
Note that last_file->origin can be odd in the case of
BSD-4.4-style element with a long odd size. */
BSD-4.4-style element with a long odd size. */
filestart = last_file->origin + size;
if (!strncmp(arch_hdr (last_file)->ar_name, "#1/", 3))
size += strlen(normalize(last_file, last_file->filename));
@ -605,7 +602,6 @@ bfd_generic_openr_next_archived_file (archive, last_file)
return _bfd_get_elt_at_filepos (archive, filestart);
}
const bfd_target *
bfd_generic_archive_p (abfd)
bfd *abfd;
@ -632,7 +628,7 @@ bfd_generic_archive_p (abfd)
#endif
/* We are setting bfd_ardata(abfd) here, but since bfd_ardata
involves a cast, we can't do it as the left operand of assignment. */
involves a cast, we can't do it as the left operand of assignment. */
abfd->tdata.aout_ar_data = ((struct artdata *)
bfd_zalloc (abfd, sizeof (struct artdata)));
@ -739,7 +735,7 @@ do_slurp_bsd_armap (abfd)
if (mapdata == NULL)
return false;
parsed_size = mapdata->parsed_size;
bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */
bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */
raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size);
if (raw_armap == (bfd_byte *) NULL)
@ -784,16 +780,17 @@ do_slurp_bsd_armap (abfd)
}
ardata->first_file_filepos = bfd_tell (abfd);
/* Pad to an even boundary if you have to */
/* Pad to an even boundary if you have to. */
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
/* FIXME, we should provide some way to free raw_ardata when
we are done using the strings from it. For now, it seems
to be allocated on an objalloc anyway... */
to be allocated on an objalloc anyway... */
bfd_has_map (abfd) = true;
return true;
}
/* Returns false on error, true otherwise */
/* Returns false on error, true otherwise. */
static boolean
do_slurp_coff_armap (abfd)
bfd *abfd;
@ -805,7 +802,7 @@ do_slurp_coff_armap (abfd)
unsigned int stringsize;
unsigned int parsed_size;
carsym *carsyms;
unsigned int nsymz; /* Number of symbols in armap. */
unsigned int nsymz; /* Number of symbols in armap. */
bfd_vma (*swap) PARAMS ((const bfd_byte *));
char int_buf[sizeof (long)];
unsigned int carsym_size, ptrsize, i;
@ -814,7 +811,7 @@ do_slurp_coff_armap (abfd)
if (mapdata == NULL)
return false;
parsed_size = mapdata->parsed_size;
bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */
bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */
if (bfd_read ((PTR) int_buf, 1, 4, abfd) != 4)
{
@ -823,7 +820,7 @@ do_slurp_coff_armap (abfd)
return false;
}
/* It seems that all numeric information in a coff archive is always
in big endian format, nomatter the host or target. */
in big endian format, nomatter the host or target. */
swap = bfd_getb32;
nsymz = bfd_getb32 ((PTR) int_buf);
stringsize = parsed_size - (4 * nsymz) - 4;
@ -838,7 +835,7 @@ do_slurp_coff_armap (abfd)
&& bfd_get_arch (abfd) == bfd_arch_i960
&& bfd_get_flavour (abfd) == bfd_target_coff_flavour)
{
/* This looks dangerous, let's do it the other way around */
/* This looks dangerous, let's do it the other way around. */
nsymz = bfd_getl32 ((PTR) int_buf);
stringsize = parsed_size - (4 * nsymz) - 4;
swap = bfd_getl32;
@ -846,7 +843,7 @@ do_slurp_coff_armap (abfd)
#endif
/* The coff armap must be read sequentially. So we construct a
bsd-style one in core all at once, for simplicity. */
bsd-style one in core all at once, for simplicity. */
carsym_size = (nsymz * sizeof (carsym));
ptrsize = (4 * nsymz);
@ -857,7 +854,7 @@ do_slurp_coff_armap (abfd)
carsyms = ardata->symdefs;
stringbase = ((char *) ardata->symdefs) + carsym_size;
/* Allocate and read in the raw offsets. */
/* Allocate and read in the raw offsets. */
raw_armap = (int *) bfd_alloc (abfd, ptrsize);
if (raw_armap == NULL)
goto release_symdefs;
@ -869,7 +866,7 @@ do_slurp_coff_armap (abfd)
goto release_raw_armap;
}
/* OK, build the carsyms */
/* OK, build the carsyms. */
for (i = 0; i < nsymz; i++)
{
rawptr = raw_armap + i;
@ -882,27 +879,25 @@ do_slurp_coff_armap (abfd)
ardata->symdef_count = nsymz;
ardata->first_file_filepos = bfd_tell (abfd);
/* Pad to an even boundary if you have to */
/* Pad to an even boundary if you have to. */
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
bfd_has_map (abfd) = true;
bfd_release (abfd, (PTR) raw_armap);
/* Check for a second archive header (as used by PE) */
/* Check for a second archive header (as used by PE). */
{
struct areltdata *tmp;
bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET);
tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd);
if (tmp != NULL)
if (tmp != NULL)
{
if (tmp->arch_header[0] == '/'
&& tmp->arch_header[1] == ' ')
&& tmp->arch_header[1] == ' ')
{
ardata->first_file_filepos +=
(tmp->parsed_size + sizeof(struct ar_hdr) + 1) & ~1;
(tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~1;
}
bfd_release (abfd, tmp);
}
@ -954,7 +949,7 @@ bfd_slurp_armap (abfd)
/* Returns false on error, true otherwise */
/* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the
header is in a slightly different order and the map name is '/'.
This flavour is used by hp300hpux. */
This flavour is used by hp300hpux. */
#define HPUX_SYMDEF_COUNT_SIZE 2
@ -977,7 +972,7 @@ bfd_slurp_bsd_armap_f2 (abfd)
if (i != 16)
return false;
/* The archive has at least 16 bytes in it */
/* The archive has at least 16 bytes in it. */
if (bfd_seek (abfd, -16L, SEEK_CUR) != 0)
return false;
@ -1026,7 +1021,7 @@ bfd_slurp_bsd_armap_f2 (abfd)
ardata->cache = 0;
stringsize = bfd_h_get_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE);
/* skip sym count and string sz */
/* Skip sym count and string sz. */
stringbase = ((char *) raw_armap
+ HPUX_SYMDEF_COUNT_SIZE
+ BSD_STRING_COUNT_SIZE);
@ -1046,11 +1041,11 @@ bfd_slurp_bsd_armap_f2 (abfd)
}
ardata->first_file_filepos = bfd_tell (abfd);
/* Pad to an even boundary if you have to */
/* Pad to an even boundary if you have to. */
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
/* FIXME, we should provide some way to free raw_ardata when
we are done using the strings from it. For now, it seems
to be allocated on an objalloc anyway... */
to be allocated on an objalloc anyway... */
bfd_has_map (abfd) = true;
return true;
}
@ -1063,9 +1058,10 @@ bfd_slurp_bsd_armap_f2 (abfd)
element (the first in the archive, or second if there is an armap);
the name in the ar_hdr is replaced by <space><index into filename
element>. Index is the P.R. of an int (decimal). Data General have
extended the format by using the prefix // for the special element */
extended the format by using the prefix // for the special element. */
/* Returns false on error, true otherwise. */
/* Returns false on error, true otherwise */
boolean
_bfd_slurp_extended_name_table (abfd)
bfd *abfd;
@ -1119,22 +1115,25 @@ _bfd_slurp_extended_name_table (abfd)
{
char *temp = bfd_ardata (abfd)->extended_names;
char *limit = temp + namedata->parsed_size;
for (; temp < limit; ++temp) {
if (*temp == '\012')
temp[temp[-1] == '/' ? -1 : 0] = '\0';
if (*temp == '\\')
*temp = '/';
}
for (; temp < limit; ++temp)
{
if (*temp == '\012')
temp[temp[-1] == '/' ? -1 : 0] = '\0';
if (*temp == '\\')
*temp = '/';
}
}
/* Pad to an even boundary if you have to */
/* Pad to an even boundary if you have to. */
bfd_ardata (abfd)->first_file_filepos = bfd_tell (abfd);
bfd_ardata (abfd)->first_file_filepos +=
(bfd_ardata (abfd)->first_file_filepos) % 2;
/* FIXME, we can't release namedata here because it was allocated
below extended_names on the objalloc... */
/* bfd_release (abfd, namedata); */
below extended_names on the objalloc... */
#if 0
bfd_release (abfd, namedata);
#endif
}
return true;
}
@ -1142,7 +1141,8 @@ _bfd_slurp_extended_name_table (abfd)
#ifdef VMS
/* Return a copy of the stuff in the filename between any :]> and a
semicolon */
semicolon. */
static const char *
normalize (abfd, file)
bfd *abfd;
@ -1185,12 +1185,11 @@ normalize (abfd, file)
{
const char *filename = strrchr (file, '/');
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (file, '\\');
if (bslash > filename)
if (filename == NULL || (bslash != NULL && bslash > filename))
filename = bslash;
if (filename == NULL && file[0] != '\0' && file[1] == ':')
filename = file + 1;
@ -1290,7 +1289,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
*tablen = 0;
/* Figure out how long the table should be */
/* Figure out how long the table should be. */
for (current = abfd->archive_head; current != NULL; current = current->next)
{
const char *normal;
@ -1358,7 +1357,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
{
/* Works for now; may need to be re-engineered if we
encounter an oddball archive format and want to
generalise this hack. */
generalise this hack. */
struct ar_hdr *hdr = arch_hdr (current);
strcpy (strptr, normal);
if (! trailing_slash)
@ -1370,10 +1369,10 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
}
hdr->ar_name[0] = ar_padchar (current);
/* We know there will always be enough room (one of the few
cases where you may safely use sprintf). */
cases where you may safely use sprintf). */
sprintf ((hdr->ar_name) + 1, "%-d", (unsigned) (strptr - *tabloc));
/* Kinda Kludgy. We should just use the returned value of
sprintf but not all implementations get this right */
sprintf but not all implementations get this right. */
{
char *temp = hdr->ar_name + 2;
for (; temp < hdr->ar_name + maxname; temp++)
@ -1391,6 +1390,24 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
/** A couple of functions for creating ar_hdrs */
#ifdef HPUX_LARGE_AR_IDS
/* Function to encode large UID/GID values according to HP. */
static void
hpux_uid_gid_encode (str, id)
char str[6];
long int id;
{
int cnt;
str[5] = '@' + (id & 3);
id >>= 2;
for (cnt = 4; cnt >= 0; ++cnt, id >>= 6)
str[cnt] = ' ' + (id & 0x3f);
}
#endif /* HPUX_LARGE_AR_IDS */
#ifndef HAVE_GETUID
#define getuid() 0
#endif
@ -1402,7 +1419,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
/* Takes a filename, returns an arelt_data for it, or NULL if it can't
make one. The filename must refer to a filename in the filesystem.
The filename field of the ar_hdr will NOT be initialized. If member
is set, and it's an in-memory bfd, we fake it. */
is set, and it's an in-memory bfd, we fake it. */
static struct areltdata *
bfd_ar_hdr_from_filesystem (abfd, filename, member)
@ -1417,11 +1434,11 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member)
if (member && (member->flags & BFD_IN_MEMORY) != 0)
{
/* Assume we just "made" the member, and fake it */
/* Assume we just "made" the member, and fake it. */
struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream;
time(&status.st_mtime);
status.st_uid = getuid();
status.st_gid = getgid();
time (&status.st_mtime);
status.st_uid = getuid ();
status.st_gid = getgid ();
status.st_mode = 0644;
status.st_size = bim->size;
}
@ -1437,24 +1454,47 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member)
return NULL;
hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata));
/* ar headers are space padded, not null padded! */
/* ar headers are space padded, not null padded! */
memset ((PTR) hdr, ' ', sizeof (struct ar_hdr));
strncpy (hdr->ar_fmag, ARFMAG, 2);
/* Goddamned sprintf doesn't permit MAXIMUM field lengths */
/* Goddamned sprintf doesn't permit MAXIMUM field lengths. */
sprintf ((hdr->ar_date), "%-12ld", (long) status.st_mtime);
if (status.st_uid > 65535U)
fprintf (stderr, "%s: uid %ld truncated to 16 bits\n", filename, (long) status.st_uid);
sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid & 0xffffU);
if (status.st_gid > 65535U)
fprintf (stderr, "%s: gid %ld truncated to 16 bits\n", filename, (long) status.st_gid);
sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid & 0xffffU);
if (status.st_uid > 99999)
{
#ifdef HPUX_LARGE_AR_IDS
/* HP has a very "special" way to handle UID/GID's with numeric values
> 99999. */
hpux_uid_gid_encode (hdr->ar_gid, (long) status.st_uid);
#else
fprintf (stderr, "%s: uid %ld truncated to 5 digits\n", filename, (long) status.st_uid);
sprintf ((hdr->ar_uid), "%ld", (long) (status.st_uid % 100000));
#endif
}
else
sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid);
if (status.st_gid > 99999)
{
#ifdef HPUX_LARGE_AR_IDS
/* HP has a very "special" way to handle UID/GID's with numeric values
> 99999. */
hpux_uid_gid_encode (hdr->ar_uid, (long) status.st_gid);
#else
fprintf (stderr, "%s: gid %ld truncated to 5 digits\n", filename, (long) status.st_gid);
sprintf ((hdr->ar_gid), "%ld", (long) (status.st_gid % 100000);
#endif
}
else
sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid);
sprintf ((hdr->ar_mode), "%-8o", (unsigned int) status.st_mode);
sprintf ((hdr->ar_size), "%-10ld", (long) status.st_size);
/* Correct for a lossage in sprintf whereby it null-terminates. I cannot
understand how these C losers could design such a ramshackle bunch of
IO operations */
IO operations. */
temp = (char *) hdr;
temp1 = temp + sizeof (struct ar_hdr) - 2;
for (; temp < temp1; temp++)
@ -1470,9 +1510,9 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member)
}
/* This is magic required by the "ar" program. Since it's
undocumented, it's undocumented. You may think that it would take
a strong stomach to write this, and it does, but it takes even a
stronger stomach to try to code around such a thing! */
undocumented, it's undocumented. You may think that it would take
a strong stomach to write this, and it does, but it takes even a
stronger stomach to try to code around such a thing! */
struct ar_hdr *bfd_special_undocumented_glue PARAMS ((bfd *, const char *));
@ -1487,8 +1527,8 @@ bfd_special_undocumented_glue (abfd, filename)
return (struct ar_hdr *) ar_elt->arch_header;
}
/* Analogous to stat call. */
/* Analogous to stat call */
int
bfd_generic_stat_arch_elt (abfd, buf)
bfd *abfd;
@ -1505,13 +1545,40 @@ bfd_generic_stat_arch_elt (abfd, buf)
hdr = arch_hdr (abfd);
#define foo(arelt, stelt, size) \
buf->stelt = strtol (hdr->arelt, &aloser, size); \
if (aloser == hdr->arelt) return -1;
#define foo(arelt, stelt, size) \
buf->stelt = strtol (hdr->arelt, &aloser, size); \
if (aloser == hdr->arelt) \
return -1;
/* Some platforms support special notations for large IDs. */
#ifdef HPUX_LARGE_AR_IDS
# define foo2(arelt, stelt, size) \
if (hdr->arelt[5] == ' ') \
{ \
foo (arelt, stelt, size); \
} \
else \
{ \
int cnt; \
for (buf->stelt = cnt = 0; cnt < 5; ++cnt) \
{ \
if (hdr->arelt[cnt] < ' ' || hdr->arelt[cnt] > ' ' + 0x3f) \
return -1; \
buf->stelt <<= 6; \
buf->stelt += hdr->arelt[cnt] - ' '; \
} \
if (hdr->arelt[5] < '@' || hdr->arelt[5] > '@' + 3) \
return -1; \
buf->stelt <<= 2; \
buf->stelt += hdr->arelt[5] - '@'; \
}
#else
# define foo2(arelt, stelt, size) foo (arelt, stelt, size)
#endif
foo (ar_date, st_mtime, 10);
foo (ar_uid, st_uid, 10);
foo (ar_gid, st_gid, 10);
foo2 (ar_uid, st_uid, 10);
foo2 (ar_gid, st_gid, 10);
foo (ar_mode, st_mode, 8);
buf->st_size = arch_eltdata (abfd)->parsed_size;
@ -1528,7 +1595,7 @@ bfd_dont_truncate_arname (abfd, pathname, arhdr)
/* FIXME: This interacts unpleasantly with ar's quick-append option.
Fortunately ic960 users will never use that option. Fixing this
is very hard; fortunately I know how to do it and will do so once
intel's release is out the door. */
intel's release is out the door. */
struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
size_t length;
@ -1574,7 +1641,7 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (pathname, '\\');
if (bslash > filename)
if (filename == NULL || (bslash != NULL && bslash > filename))
filename = bslash;
if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':')
filename = pathname + 1;
@ -1608,7 +1675,7 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr)
4> truncate it before the .o, append .o, stuff THAT in. */
/* This is what gnu ar does. It's better but incompatible with the
bsd ar. */
bsd ar. */
void
bfd_gnu_truncate_arname (abfd, pathname, arhdr)
@ -1625,7 +1692,7 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (pathname, '\\');
if (bslash > filename)
if (filename == NULL || (bslash != NULL && bslash > filename))
filename = bslash;
if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':')
filename = pathname + 1;
@ -1656,7 +1723,7 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr)
(hdr->ar_name)[length] = ar_padchar (abfd);
}
/* The BFD is open for write and has its format set to bfd_archive */
/* The BFD is open for write and has its format set to bfd_archive. */
boolean
_bfd_write_archive_contents (arch)
@ -1667,7 +1734,7 @@ _bfd_write_archive_contents (arch)
bfd_size_type elength = 0;
const char *ename = NULL;
boolean makemap = bfd_has_map (arch);
boolean hasobjects = false; /* if no .o's, don't bother to make a map */
boolean hasobjects = false; /* If no .o's, don't bother to make a map. */
bfd_size_type wrote;
unsigned int i;
int tries;
@ -1677,6 +1744,11 @@ _bfd_write_archive_contents (arch)
then construct a fresh ar_hdr for them. */
for (current = arch->archive_head; current; current = current->next)
{
/* This check is checking the bfds for the objects we're reading
from (which are usually either an object file or archive on
disk), not the archive entries we're writing to. We don't
actually create bfds for the archive members, we just copy
them byte-wise when we write out the archive. */
if (bfd_write_p (current))
{
bfd_set_error (bfd_error_invalid_operation);
@ -1689,14 +1761,14 @@ _bfd_write_archive_contents (arch)
if (!current->arelt_data)
return false;
/* Put in the file name */
/* Put in the file name. */
BFD_SEND (arch, _bfd_truncate_arname, (arch,
current->filename,
(char *) arch_hdr (current)));
}
if (makemap && ! hasobjects)
{ /* don't bother if we won't make a map! */
{ /* Don't bother if we won't make a map! */
if ((bfd_check_format (current, bfd_object))
#if 0 /* FIXME -- these are not set correctly */
&& ((bfd_get_file_flags (current) & HAS_SYMS))
@ -1757,7 +1829,7 @@ _bfd_write_archive_contents (arch)
unsigned int remaining = saved_size;
struct ar_hdr *hdr = arch_hdr (current);
/* write ar header */
/* Write ar header. */
if (bfd_write ((char *) hdr, 1, sizeof (*hdr), arch) != sizeof (*hdr))
return false;
/* write filename if it is a 4.4BSD extended file, and add to size */
@ -1816,7 +1888,7 @@ _bfd_write_archive_contents (arch)
return true;
}
/* Note that the namidx for the first symbol is 0 */
/* Note that the namidx for the first symbol is 0. */
boolean
_bfd_compute_and_write_armap (arch, elength)
@ -1834,7 +1906,7 @@ _bfd_compute_and_write_armap (arch, elength)
long syms_max = 0;
boolean ret;
/* Dunno if this is the best place for this info... */
/* Dunno if this is the best place for this info... */
if (elength != 0)
elength += sizeof (struct ar_hdr);
elength += elength % 2;
@ -1849,13 +1921,12 @@ _bfd_compute_and_write_armap (arch, elength)
if (first_name == NULL)
goto error_return;
/* Drop all the files called __.SYMDEF, we're going to make our
own */
/* Drop all the files called __.SYMDEF, we're going to make our own. */
while (arch->archive_head &&
strcmp (arch->archive_head->filename, "__.SYMDEF") == 0)
arch->archive_head = arch->archive_head->next;
/* Map over each element */
/* Map over each element. */
for (current = arch->archive_head;
current != (bfd *) NULL;
current = current->next, elt_no++)
@ -1886,7 +1957,8 @@ _bfd_compute_and_write_armap (arch, elength)
if (symcount < 0)
goto error_return;
/* Now map over all the symbols, picking out the ones we want */
/* Now map over all the symbols, picking out the ones we
want. */
for (src_count = 0; src_count < symcount; src_count++)
{
flagword flags = (syms[src_count])->flags;
@ -1901,7 +1973,7 @@ _bfd_compute_and_write_armap (arch, elength)
size_t namelen;
struct orl *new_map;
/* This symbol will go into the archive header */
/* This symbol will go into the archive header. */
if (orl_count == orl_max)
{
orl_max *= 2;
@ -1940,7 +2012,7 @@ _bfd_compute_and_write_armap (arch, elength)
}
}
/* OK, now we have collected all the data, let's write them out */
/* OK, now we have collected all the data, let's write them out. */
ret = BFD_SEND (arch, write_armap,
(arch, elength, map, orl_count, stridx));
@ -1975,7 +2047,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
int padit = stridx & 1;
unsigned int ranlibsize = orl_count * BSD_SYMDEF_SIZE;
unsigned int stringsize = stridx + padit;
/* Include 8 bytes to store ranlibsize and stringsize in output. */
/* Include 8 bytes to store ranlibsize and stringsize in output. */
unsigned int mapsize = ranlibsize + stringsize + 8;
file_ptr firstreal;
bfd *current = arch->archive_head;
@ -2035,7 +2107,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
return false;
}
/* now write the strings themselves */
/* Now write the strings themselves. */
bfd_h_put_32 (arch, stringsize, temp);
if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp))
return false;
@ -2048,7 +2120,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
}
/* The spec sez this should be a newline. But in order to be
bug-compatible for sun's ar we use a null. */
bug-compatible for sun's ar we use a null. */
if (padit)
{
if (bfd_write ("", 1, 1, arch) != 1)
@ -2078,10 +2150,13 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
if (bfd_stat (arch, &archstat) == -1)
{
perror (_("Reading archive file mod timestamp"));
return true; /* Can't read mod time for some reason */
/* Can't read mod time for some reason. */
return true;
}
if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp)
return true; /* OK by the linker's rules */
/* OK by the linker's rules. */
return true;
/* Update the timestamp. */
bfd_ardata (arch)->armap_timestamp = archstat.st_mtime + ARMAP_TIME_OFFSET;
@ -2102,10 +2177,13 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
{
/* FIXME: bfd can't call perror. */
perror (_("Writing updated armap timestamp"));
return true; /* Some error while writing */
/* Some error while writing. */
return true;
}
return false; /* We updated the timestamp successfully. */
/* We updated the timestamp successfully. */
return false;
}
/* A coff armap looks like :
@ -2131,7 +2209,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
int stridx;
{
/* The size of the ranlib is the number of exported symbols in the
archive * the number of bytes in a int, + an int for the count */
archive * the number of bytes in a int, + an int for the count. */
unsigned int ranlibsize = (symbol_count * 4) + 4;
unsigned int stringsize = stridx;
unsigned int mapsize = stringsize + ranlibsize;
@ -2145,7 +2223,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
if (padit)
mapsize++;
/* work out where the first object file will go in the archive */
/* Work out where the first object file will go in the archive. */
archive_member_file_ptr = (mapsize
+ elength
+ sizeof (struct ar_hdr)
@ -2155,7 +2233,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
hdr.ar_name[0] = '/';
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
sprintf (hdr.ar_date, "%ld", (long) time (NULL));
/* This, at least, is what Intel coff sets the values to.: */
/* This, at least, is what Intel coff sets the values to. */
sprintf ((hdr.ar_uid), "%d", 0);
sprintf ((hdr.ar_gid), "%d", 0);
sprintf ((hdr.ar_mode), "%-7o", (unsigned) 0);
@ -2165,7 +2243,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
if (((char *) (&hdr))[i] == '\0')
(((char *) (&hdr))[i]) = ' ';
/* Write the ar header for this item and the number of symbols */
/* Write the ar header for this item and the number of symbols. */
if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), arch)
!= sizeof (struct ar_hdr))
@ -2183,23 +2261,23 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
count = 0;
while (current != (bfd *) NULL && count < symbol_count)
{
/* For each symbol which is used defined in this object, write out
the object file's address in the archive */
/* For each symbol which is used defined in this object, write
out the object file's address in the archive. */
while (((bfd *) (map[count]).pos) == current)
while (count < symbol_count && ((bfd *) (map[count]).pos) == current)
{
bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr);
count++;
}
/* Add size of this archive entry */
/* Add size of this archive entry. */
archive_member_file_ptr += (arelt_size (current)
+ sizeof (struct ar_hdr));
/* remember aboout the even alignment */
/* Remember aboout the even alignment. */
archive_member_file_ptr += archive_member_file_ptr % 2;
current = current->next;
}
/* now write the strings themselves */
/* Now write the strings themselves. */
for (count = 0; count < symbol_count; count++)
{
size_t len = strlen (*map[count].name) + 1;
@ -2209,7 +2287,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
}
/* The spec sez this should be a newline. But in order to be
bug-compatible for arc960 we use a null. */
bug-compatible for arc960 we use a null. */
if (padit)
{
if (bfd_write ("", 1, 1, arch) != 1)

View File

@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* bfd.h -- The only header file required by users of the bfd library
/* bfd.h -- The only header file required by users of the bfd library
The bfd.h file is generated from bfd-in.h and various .c files; if you
change it, your changes will probably be lost.
@ -84,7 +84,7 @@ typedef struct _bfd bfd;
/* General rules: functions which are boolean return true on success
and false on failure (unless they're a predicate). -- bfd.doc */
/* I'm sure this is going to break something and someone is going to
force me to change it. */
force me to change it. */
/* typedef enum boolean {false, true} boolean; */
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
/* It gets worse if the host also defines a true/false enum... -sts */
@ -93,7 +93,7 @@ typedef struct _bfd bfd;
#define TRUE_FALSE_ALREADY_DEFINED
#endif
#ifdef MPW
/* Pre-emptive strike - get the file with the enum. */
/* Pre-emptive strike - get the file with the enum. */
#include <Types.h>
#define TRUE_FALSE_ALREADY_DEFINED
#endif /* MPW */
@ -109,7 +109,7 @@ typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
/* FIXME: This should be using off_t from <sys/types.h>.
For now, try to avoid breaking stuff by not including <sys/types.h> here.
This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
Probably the best long-term answer is to avoid using file_ptr AND off_t
Probably the best long-term answer is to avoid using file_ptr AND off_t
in this header file, and to handle this in the BFD implementation
rather than in its interface. */
/* typedef off_t file_ptr; */
@ -177,8 +177,8 @@ typedef unsigned long symvalue;
typedef unsigned long bfd_size_type;
/* Print a bfd_vma x on stream s. */
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
#define sprintf_vma(s,x) sprintf(s, "%08lx", x)
#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
#endif /* not BFD64 */
@ -287,19 +287,17 @@ typedef struct carsym {
file_ptr file_offset; /* look here to find the file */
} carsym; /* to make these you call a carsymogen */
/* Used in generating armaps (archive tables of contents).
Perhaps just a forward definition would do? */
struct orl { /* output ranlib */
char **name; /* symbol name */
char **name; /* symbol name */
file_ptr pos; /* bfd* or file position */
int namidx; /* index into string table */
};
/* Linenumber stuff */
typedef struct lineno_cache_entry {
unsigned int line_number; /* Linenumber from start of function*/
unsigned int line_number; /* Linenumber from start of function*/
union {
struct symbol_cache_entry *sym; /* Function name */
unsigned long offset; /* Offset into section */
@ -330,15 +328,15 @@ typedef struct sec *sec_ptr;
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
typedef struct stat stat_type;
typedef struct stat stat_type;
typedef enum bfd_print_symbol
{
{
bfd_print_symbol_name,
bfd_print_symbol_more,
bfd_print_symbol_all
} bfd_print_symbol_type;
/* Information about a symbol that nm needs. */
typedef struct _symbol_info
@ -347,7 +345,7 @@ typedef struct _symbol_info
char type;
CONST char *name; /* Symbol name. */
unsigned char stab_type; /* Stab type. */
char stab_other; /* Stab other. */
char stab_other; /* Stab other. */
short stab_desc; /* Stab desc. */
CONST char *stab_name; /* String for stab type. */
} symbol_info;
@ -484,7 +482,6 @@ extern long bfd_tell PARAMS ((bfd *abfd));
extern int bfd_flush PARAMS ((bfd *abfd));
extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
/* Cast from const char * to char * so that caller can assign to
a char * without a warning. */
#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
@ -492,6 +489,9 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
#define bfd_get_format(abfd) ((abfd)->format)
#define bfd_get_target(abfd) ((abfd)->xvec->name)
#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
#define bfd_family_coff(abfd) \
(bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
#define bfd_header_big_endian(abfd) \
@ -514,7 +514,7 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *));
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean)(bool)), true)
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
extern boolean bfd_record_phdr
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
@ -540,6 +540,11 @@ void bfd_putb32 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl32 PARAMS ((bfd_vma, unsigned char *));
void bfd_putb16 PARAMS ((bfd_vma, unsigned char *));
void bfd_putl16 PARAMS ((bfd_vma, unsigned char *));
/* Byte swapping routines which take size and endiannes as arguments. */
bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean));
void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean));
/* Externally visible ECOFF routines. */
@ -627,7 +632,10 @@ extern boolean bfd_elf64_size_dynamic_sections
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *));
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
PARAMS ((bfd *, struct bfd_link_info *));
/* Return an upper bound on the number of bytes required to store a
copy of ABFD's program header table entries. Return -1 if an error
@ -643,6 +651,16 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
error occurs; bfd_get_error will return an appropriate code. */
extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs));
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
extern int bfd_get_arch_size PARAMS ((bfd *));
/* Return true if address "naturally" sign extends, or -1 if not elf. */
extern int bfd_get_sign_extend_vma PARAMS ((bfd *));
extern boolean bfd_m68k_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
@ -731,6 +749,10 @@ extern boolean bfd_coff_get_auxent
extern boolean bfd_coff_set_symbol_class
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
extern boolean bfd_m68k_coff_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
/* ARM Interworking support. Called from linker. */
extern boolean bfd_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
@ -761,4 +783,11 @@ extern boolean bfd_elf32_arm_process_before_allocation
extern boolean bfd_elf32_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
/* TI COFF load page support. */
extern void bfd_ticoff_set_section_load_page
PARAMS ((struct sec *, int));
extern int bfd_ticoff_get_section_load_page
PARAMS ((struct sec *));
/* And more from the source. */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -32,10 +32,15 @@ alpha*) targ_archs=bfd_alpha_arch ;;
arm*) targ_archs=bfd_arm_arch ;;
strongarm*) targ_archs=bfd_arm_arch ;;
thumb*) targ_archs=bfd_arm_arch ;;
xscale*) targ_archs=bfd_arm_arch ;;
c30*) targ_archs=bfd_tic30_arch ;;
c54x*) targ_archs=bfd_tic54x_arch ;;
hppa*) targ_archs=bfd_hppa_arch ;;
x86_64) targ_archs=bfd_i386_arch ;;
i[3456]86) targ_archs=bfd_i386_arch ;;
i370) targ_archs=bfd_i370_arch ;;
m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;;
m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;;
m68*) targ_archs=bfd_m68k_arch ;;
m88*) targ_archs=bfd_m88k_arch ;;
mips*) targ_archs=bfd_mips_arch ;;
@ -79,6 +84,18 @@ case "${targ}" in
alpha*-*-*)
targ_defvec=ecoffalpha_little_vec
;;
ia64*-*-freebsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
targ_defvec=bfd_elf64_ia64_little_vec
targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
;;
ia64*-*-hpux*)
targ_defvec=bfd_elf64_ia64_big_vec
targ_selvecs="bfd_elf32_ia64_big_vec"
;;
sparc64-*-freebsd*)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
;;
#endif /* BFD64 */
arc-*-elf*)
@ -109,7 +126,7 @@ case "${targ}" in
targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
targ_underscore=yes
;;
arm-*-aout | armel-*-aout)
arm-*-aout | armel-*-aout)
targ_defvec=aout_arm_little_vec
targ_selvecs=aout_arm_big_vec
;;
@ -122,11 +139,15 @@ case "${targ}" in
targ_selvecs=armcoff_big_vec
targ_underscore=yes
;;
arm-*-rtems*)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
armeb-*-elf | arm*b-*-linux-gnu*)
targ_defvec=bfd_elf32_bigarm_vec
targ_selvecs=bfd_elf32_littlearm_vec
;;
arm-*-elf | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
@ -167,9 +188,18 @@ case "${targ}" in
targ_selvecs=armcoff_big_vec
targ_underscore=yes
;;
xscale-*-elf)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
xscale-*-coff)
targ_defvec=armcoff_little_vec
targ_selvecs=armcoff_big_vec
targ_underscore=yes
;;
a29k-*-ebmon* | a29k-*-udi* | a29k-*-coff* | a29k-*-sym1* | \
a29k-*-vxworks* | a29k-*-sysv*)
a29k-*-vxworks* | a29k-*-sysv* | a29k-*rtems*)
targ_defvec=a29kcoff_big_vec
targ_selvecs=sunos_big_vec
targ_underscore=yes
@ -190,6 +220,18 @@ case "${targ}" in
targ_defvec=tic30_coff_vec
;;
c54x*-*-*coff* | tic54x-*-*coff*)
targ_defvec=tic54x_coff1_vec
targ_selvecs="tic54x_coff1_beh_vec tic54x_coff2_vec tic54x_coff2_beh_vec tic54x_coff0_vec tic54x_coff0_beh_vec"
targ_underscore=yes
;;
cris-*-*)
targ_defvec=cris_aout_vec
targ_selvecs="bfd_elf32_us_cris_vec bfd_elf32_cris_vec ieee_vec"
targ_underscore=yes # Note: not true for bfd_elf32_cris_vec.
;;
d10v-*-*)
targ_defvec=bfd_elf32_d10v_vec
;;
@ -213,27 +255,39 @@ case "${targ}" in
targ_underscore=yes
;;
#if 0 /* HPPA ELF does not work currently. */
hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
targ_defvec=bfd_elf32_hppa_vec
#ifdef BFD64
hppa*64*-*-linux-gnu*)
targ_defvec=bfd_elf64_hppa_linux_vec
targ_selvecs=bfd_elf64_hppa_vec
;;
hppa*64*-*-hpux11*)
targ_defvec=bfd_elf64_hppa_vec
targ_selvecs=bfd_elf64_hppa_linux_vec
targ_cflags=-DHPUX_LARGE_AR_IDS
;;
#endif
hppa*-*-linux-gnu*)
targ_defvec=bfd_elf32_hppa_linux_vec
targ_selvecs=bfd_elf32_hppa_vec
;;
hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
targ_defvec=bfd_elf32_hppa_vec
targ_selvecs=bfd_elf32_hppa_linux_vec
;;
#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX)
#if 0 /* HPPA ELF does not work currently. */
hppa*-*-bsd*)
targ_defvec=som_vec
targ_selvecs=bfd_elf32_hppa_vec
;;
#endif
hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*)
targ_defvec=som_vec
;;
#if 0 /* HPPA ELF does not work currently. */
hppa*-*-osf*)
targ_defvec=som_vec
targ_selvecs=bfd_elf32_hppa_vec
;;
#endif
#endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */
i370-*-*)
@ -250,6 +304,13 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
i[3456]86-*-rtemself*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs="i386coff_vec i386aout_vec"
;;
i[3456]86-*-chorus*)
targ_defvec=bfd_elf32_i386_vec
;;
i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )
targ_defvec=go32coff_vec
targ_selvecs="go32stubbedcoff_vec i386aout_vec"
@ -258,14 +319,10 @@ case "${targ}" in
i[3456]86-*-aix*)
targ_defvec=i386coff_vec
;;
i[3456]86-*-rtemscoff*)
i[3456]86*-*-rtems*)
targ_defvec=i386coff_vec
targ_selvecs="bfd_elf32_i386_vec i386aout_vec"
;;
i[3456]86-*-rtemself* | i[3456]86*-*-rtems*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs="i386coff_vec i386aout_vec"
;;
i[3456]86-sequent-bsd*)
targ_defvec=i386dynix_vec
targ_underscore=yes
@ -309,8 +366,18 @@ case "${targ}" in
;;
i[3456]86-*-linux-gnu*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386linux_vec
targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
;;
#ifdef BFD64
x86_64-*-freebsd*)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
;;
x86_64-*-linux-gnu*)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
;;
#endif
i[3456]86-*-lynxos*)
targ_defvec=i386lynx_coff_vec
targ_selvecs=i386lynx_aout_vec
@ -362,10 +429,18 @@ case "${targ}" in
targ_defvec=i386aout_vec
targ_underscore=yes
;;
i[3456]86-*-chaos)
targ_defvec=bfd_elf32_i386_vec
targ_selfvecs=i386chaos_vec
;;
i860-*-mach3* | i860-*-osf1* | i860-*-coff*)
targ_defvec=i860coff_vec
;;
i860-stardent-sysv4* | i860-stardent-elf*)
targ_defvec=bfd_elf32_i860_little_vec
targ_selvecs="bfd_elf32_i860_vec bfd_elf32_i860_little_vec"
;;
i860-*-sysv4* | i860-*-elf*)
targ_defvec=bfd_elf32_i860_vec
;;
@ -375,12 +450,7 @@ case "${targ}" in
targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
targ_underscore=yes
;;
i960-*-rtemself*)
targ_defvec=bfd_elf32_i960_vec
targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec"
targ_underscore=yes
;;
i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtemscoff* | i960-*-rtems*)
i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtems*)
targ_defvec=icoff_little_vec
targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec"
targ_underscore=yes
@ -399,6 +469,15 @@ case "${targ}" in
targ_defvec=bfd_elf32_m32r_vec
;;
m68hc11-*-* | m6811-*-*)
targ_defvec=bfd_elf32_m68hc11_vec
targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec"
;;
m68hc12-*-* | m6812-*-*)
targ_defvec=bfd_elf32_m68hc12_vec
targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec"
;;
m68*-apollo-*)
targ_defvec=apollocoff_vec
;;
@ -425,16 +504,10 @@ case "${targ}" in
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs="m68kcoff_vec ieee_vec"
;;
m68*-*-rtemscoff*)
# same as m68k-coff with some extra targets
m68*-*-rtems*)
targ_defvec=m68kcoff_vec
targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
;;
m68*-*-rtems* | m68*-*-rtemself*)
# same as m68k-elf with some extra targets
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
;;
m68*-*-coff* | m68*-*-sysv*)
targ_defvec=m68kcoff_vec
targ_selvecs="m68kcoff_vec versados_vec ieee_vec"
@ -574,14 +647,14 @@ case "${targ}" in
targ_underscore=yes
;;
mips*-*-sysv4*)
targ_defvec=bfd_elf32_bigmips_vec
targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
targ_defvec=bfd_elf32_tradbigmips_vec
targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
;;
mips*-*-sysv* | mips*-*-riscos*)
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*)
mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks* | mips*-*-chorus*)
targ_defvec=bfd_elf32_littlemips_vec
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
;;
@ -631,6 +704,7 @@ case "${targ}" in
powerpc-*-aix* | powerpc-*-beos*)
targ_defvec=rs6000coff_vec
targ_selvecs="rs6000coff64_vec"
;;
powerpc-*-netbsd*)
targ_defvec=bfd_elf32_powerpc_vec
@ -638,7 +712,7 @@ case "${targ}" in
;;
powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
powerpc-*-vxworks*)
powerpc-*-chorus* | powerpc-*-vxworks*)
targ_defvec=bfd_elf32_powerpc_vec
targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
;;
@ -665,6 +739,11 @@ case "${targ}" in
targ_defvec=rs6000coff_vec
;;
sh-*-linux*)
targ_defvec=bfd_elf32_shblin_vec
targ_selvecs=bfd_elf32_shlin_vec
;;
sh-*-elf* | sh-*-rtemself*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
@ -675,7 +754,7 @@ case "${targ}" in
targ_selvecs="shlpe_vec shlpei_vec"
targ_underscore=yes
;;
sh-*-* | sh-*-rtemscoff* | sh-*-rtems*)
sh-*-* | sh-*-rtems*)
targ_defvec=shcoff_vec
targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
targ_underscore=yes
@ -693,6 +772,9 @@ case "${targ}" in
sparclite-*-elf* | sparc86x-*-elf*)
targ_defvec=bfd_elf32_sparc_vec
;;
sparc*-*-chorus*)
targ_defvec=bfd_elf32_sparc_vec
;;
sparc-*-linux*aout*)
targ_defvec=sparclinux_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
@ -752,7 +834,7 @@ case "${targ}" in
sparc64-*-elf*)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs=bfd_elf32_sparc_vec
;;
;;
#endif /* BFD64 */
sparc*-*-coff*)
targ_defvec=sparccoff_vec
@ -766,7 +848,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_sparc_vec
targ_selvecs="sunos_big_vec sparccoff_vec"
;;
sparc*-*-*)
sparc*-*-* | sparc*-*-rtems*)
targ_defvec=sunos_big_vec
targ_underscore=yes
;;

File diff suppressed because it is too large Load Diff

View File

@ -27,6 +27,8 @@ hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;;
hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;;
hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;;
ia64-*-linux*) host64=true; HOST_64BIT_TYPE=long ;;
i[3456]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;;
i[3456]86-sequent-sysv4*) ;;
i[3456]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;;
@ -43,6 +45,10 @@ mips*-*-riscos*) HDEFINES="-G 4" ;;
m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
*-*-aix*) HOST_64BIT_TYPE="long long"
HOST_U_64BIT_TYPE="unsigned long long"
;;
*-*-solaris*) HOST_64BIT_TYPE="long long"
HOST_U_64BIT_TYPE="unsigned long long"
;;

View File

@ -7,7 +7,7 @@ AC_INIT(libbfd.c)
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
AM_INIT_AUTOMAKE(bfd, 2.10.1)
AM_INIT_AUTOMAKE(bfd, 2.11)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
@ -50,6 +50,27 @@ AC_ARG_WITH(mmap,
*) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
esac],[want_mmap=false])dnl
build_warnings="-W -Wall"
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
[case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${build_warnings} ${t}";;
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
echo "Setting warning flags = $build_warnings" 6>&1
fi])dnl
WARN_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
WARN_CFLAGS="${build_warnings}"
fi
AC_SUBST(WARN_CFLAGS)
AM_CONFIG_HEADER(config.h:config.in)
if test -z "$target" ; then
@ -114,13 +135,16 @@ COREFLAG=
TRAD_HEADER=
if test "${target}" = "${host}"; then
case "${host}" in
alpha*-*-freebsd*)
COREFILE=''
;;
alpha*-*-linux-gnu*)
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/alphalinux.h"'
;;
alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
alpha*-*-freebsd*) ;;
alpha*-*-*) COREFILE=osf-core.lo ;;
arm-*-freebsd*) COREFILE='' ;;
arm-*-riscix) COREFILE=trad-core.lo ;;
arm*-*-netbsd*) COREFILE=netbsd-core.lo ;;
hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
@ -147,11 +171,17 @@ changequote([,])dnl
TRAD_HEADER='"hosts/symmetry.h"'
;;
changequote(,)dnl
i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*)
changequote([,])dnl
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/i386bsd.h"'
;;
changequote(,)dnl
i[3456]86-*-freebsd*)
changequote([,])dnl
COREFILE=''
TRAD_HEADER='"hosts/i386bsd.h"'
;;
changequote(,)dnl
i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
changequote([,])dnl
@ -267,12 +297,20 @@ changequote([,])dnl
COREFILE=netbsd-core.lo
;;
rs6000-*-lynx*) COREFILE=lynx-core.lo ;;
changequote(,)dnl
rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*)
changequote([,])dnl
COREFILE=rs6000-core.lo
COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE"
;;
rs6000-*-aix4*) COREFILE=rs6000-core.lo ;;
rs6000-*-*) COREFILE=rs6000-core.lo ;;
powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
powerpc-*-aix4*) COREFILE=rs6000-core.lo ;;
powerpc-*-aix*) COREFILE=rs6000-core.lo ;;
powerpc-*-beos*) ;;
powerpc-*-freebsd*) COREFILE='' ;;
powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
sparc*-*-netbsd* | sparc-*-openbsd*)
COREFILE=netbsd-core.lo
;;
@ -316,11 +354,18 @@ changequote([,])dnl
AC_CHECK_HEADERS(sys/procfs.h)
if test "$ac_cv_header_sys_procfs_h" = yes; then
BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who)
BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t)
BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t)
BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t)
BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg)
BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t)
@ -328,8 +373,10 @@ changequote([,])dnl
fi
AC_SUBST(COREFILE)
AC_SUBST(COREFLAG)
AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
[Name of host specific header file to include in trad-core.c.])
if test -n "$TRAD_HEADER"; then
AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
[Name of host specific header file to include in trad-core.c.])
fi
# Horrible hacks to build DLLs on Windows.
WIN32LDFLAGS=
@ -413,7 +460,7 @@ selarchs="$f"
# Target backend .o files.
tb=
elf="elf.lo elflink.lo dwarf2.lo dwarf1.lo"
elf="elf.lo elflink.lo dwarf1.lo"
for vec in $selvecs
do
@ -441,8 +488,19 @@ do
apollocoff_vec) tb="$tb coff-apollo.lo" ;;
b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;;
b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;;
bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo peigen.lo cofflink.lo"
target64=true ;;
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
target64=true ;;
bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec)
tb="$tb elf64-hppa.lo elf64.lo $elf"
target64=true ;;
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"
target64=true ;;
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"
target64=true ;;
bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;;
bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
@ -454,19 +512,27 @@ do
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec)
tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"
target64=true ;;
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;;
bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
@ -479,7 +545,11 @@ do
bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;;
bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"
target64=true ;;
@ -489,6 +559,7 @@ do
target64=true ;;
cisco_core_big_vec) tb="$tb cisco-core.lo" ;;
cisco_core_little_vec) tb="$tb cisco-core.lo" ;;
cris_aout_vec) tb="$tb aout-cris.lo" ;;
demo_64_vec) tb="$tb demo64.lo aout64.lo"
target64=true ;;
ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
@ -532,14 +603,16 @@ do
m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
mipselnetbsd_vec) tb="$tb mipselnetbsd.lo aout32.lo" ;;
mipslpe_vec) tb="$tb pe-mips.lo cofflink.lo" ;;
mipslpei_vec) tb="$tb pei-mips.lo cofflink.lo" ;;
mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;;
mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;;
mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo"
target64=true ;;
nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
target64=true ;;
@ -558,8 +631,8 @@ do
shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo cofflink.lo" ;;
shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo cofflink.lo" ;;
shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;;
som_vec) tb="$tb som.lo" ;;
sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
@ -573,6 +646,12 @@ do
tekhex_vec) tb="$tb tekhex.lo" ;;
tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;;
tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;;
tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;;
tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;;
tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;;
tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;;
tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
vaxcoff_vec) tb="$tb coff-vax.lo" ;;
vaxnetbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;;

View File

@ -1,5 +1,5 @@
/* Routines to link ECOFF debugging information.
Copyright 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc.
Copyright 1993, 94, 95, 96, 97, 99, 2000 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@ -69,8 +69,8 @@ _bfd_ecoff_swap_tir_in (bigend, ext_copy, intern)
struct tir_ext ext[1];
*ext = *ext_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
/* now the fun stuff... */
if (bigend) {
intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG);
intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG);
@ -109,7 +109,7 @@ _bfd_ecoff_swap_tir_in (bigend, ext_copy, intern)
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
abort();
abort ();
#endif
}
@ -126,8 +126,8 @@ _bfd_ecoff_swap_tir_out (bigend, intern_copy, ext)
TIR intern[1];
*intern = *intern_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
/* now the fun stuff... */
if (bigend) {
ext->t_bits1[0] = ((intern->fBitfield ? TIR_BITS1_FBITFIELD_BIG : 0)
| (intern->continued ? TIR_BITS1_CONTINUED_BIG : 0)
@ -166,7 +166,7 @@ _bfd_ecoff_swap_tir_out (bigend, intern_copy, ext)
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
abort();
abort ();
#endif
}
@ -182,8 +182,8 @@ _bfd_ecoff_swap_rndx_in (bigend, ext_copy, intern)
struct rndx_ext ext[1];
*ext = *ext_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
/* now the fun stuff... */
if (bigend) {
intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_BIG)
| ((ext->r_bits[1] & RNDX_BITS1_RFD_BIG)
@ -205,7 +205,7 @@ _bfd_ecoff_swap_rndx_in (bigend, ext_copy, intern)
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
abort();
abort ();
#endif
}
@ -221,8 +221,8 @@ _bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext)
RNDXR intern[1];
*intern = *intern_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
/* now the fun stuff... */
if (bigend) {
ext->r_bits[0] = intern->rfd >> RNDX_BITS0_RFD_SH_LEFT_BIG;
ext->r_bits[1] = (((intern->rfd << RNDX_BITS1_RFD_SH_BIG)
@ -243,7 +243,7 @@ _bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext)
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
abort();
abort ();
#endif
}
@ -465,7 +465,7 @@ add_memory_shuffle (ainfo, head, tail, data, size)
unsigned long size;
{
struct shuffle *n;
n = (struct shuffle *) objalloc_alloc (ainfo->memory,
sizeof (struct shuffle));
if (!n)
@ -488,7 +488,6 @@ add_memory_shuffle (ainfo, head, tail, data, size)
/* Initialize the FDR hash table. This returns a handle which is then
passed in to bfd_ecoff_debug_accumulate, et. al. */
/*ARGSUSED*/
PTR
bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
bfd *output_bfd ATTRIBUTE_UNUSED;
@ -547,7 +546,6 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
/* Free the accumulated debugging information. */
/*ARGSUSED*/
void
bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info)
PTR handle;
@ -557,7 +555,7 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info)
struct bfd_link_info *info;
{
struct accumulate *ainfo = (struct accumulate *) handle;
bfd_hash_table_free (&ainfo->fdr_hash.table);
if (! info->relocateable)
@ -576,7 +574,6 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info)
linker information structure. HANDLE is returned by
bfd_ecoff_debug_init. */
/*ARGSUSED*/
boolean
bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
input_bfd, input_debug, input_swap,
@ -1409,7 +1406,6 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym)
/* Align the ECOFF debugging information. */
/*ARGSUSED*/
static void
ecoff_align_debug (abfd, debug, swap)
bfd *abfd ATTRIBUTE_UNUSED;
@ -1967,9 +1963,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
boolean stabs;
FDR *fdr_ptr;
int i;
offset = line_info->cache.start;
/* Build FDR table (sorted by object file's base-address) if we
don't have it already. */
if (line_info->fdrtab == NULL
@ -1981,7 +1977,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
/* find first FDR for address OFFSET */
i = fdrtab_lookup (line_info, offset);
if (i < 0)
return false; /* no FDR, no fun... */
return false; /* no FDR, no fun... */
fdr_ptr = tab[i].fdr;
/* Check whether this file has stabs debugging information. In a
@ -2046,9 +2042,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
malloc.c. I'm not sure why this happens, but it could
be due to optimizations that reorder a function's
position within an object-file.
Strategy:
On the first call to this function, we build a table of FDRs
that is sorted by the base-address of the object-file the FDR
is referring to. Notice that each object-file may contain
@ -2079,9 +2075,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
bfd_vma dist, min_dist = 0;
char *pdr_hold;
char *pdr_end;
fdr_ptr = tab[i].fdr;
pdr_ptr = ((char *) debug_info->external_pdr
+ fdr_ptr->ipdFirst * external_pdr_size);
pdr_end = pdr_ptr + fdr_ptr->cpd * external_pdr_size;
@ -2105,7 +2101,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
}
}
}
if (!best_pdr || min_dist < best_dist)
{
best_dist = min_dist;
@ -2118,7 +2114,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info)
&& tab[i].base_addr == tab[i - 1].base_addr);
if (!best_fdr || !best_pdr)
return false; /* shouldn't happen... */
return false; /* shouldn't happen... */
/* phew, finally we got something that we can hold onto: */
fdr_ptr = best_fdr;

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

@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define NO_COFF_SYMBOLS
#define NO_COFF_LINENOS
/* Get the ECOFF swapping routines. Needed for the debug information. */
/* Get the ECOFF swapping routines. Needed for the debug information. */
#include "coff/internal.h"
#include "coff/sym.h"
#include "coff/symconst.h"
@ -46,7 +46,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ECOFF_64
#include "ecoffswap.h"
static boolean elf64_alpha_mkobject PARAMS ((bfd *));
static int alpha_elf_dynamic_symbol_p
PARAMS((struct elf_link_hash_entry *, struct bfd_link_info *));
static struct bfd_hash_entry * elf64_alpha_link_hash_newfunc
PARAMS((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
static struct bfd_link_hash_table * elf64_alpha_bfd_link_hash_table_create
@ -66,6 +67,8 @@ static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup
static void elf64_alpha_info_to_howto
PARAMS((bfd *, arelent *, Elf64_Internal_Rela *));
static boolean elf64_alpha_mkobject
PARAMS((bfd *));
static boolean elf64_alpha_object_p
PARAMS((bfd *));
static boolean elf64_alpha_section_from_shdr
@ -129,7 +132,6 @@ static boolean elf64_alpha_merge_ind_symbols
PARAMS((struct alpha_elf_link_hash_entry *, PTR));
static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs
PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int));
struct alpha_elf_link_hash_entry
{
@ -224,14 +226,35 @@ struct alpha_elf_link_hash_table
/* Should we do dynamic things to this symbol? */
#define alpha_elf_dynamic_symbol_p(h, info) \
((((info)->shared && !(info)->symbolic) \
|| (((h)->elf_link_hash_flags \
& (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) \
== (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) \
|| (h)->root.type == bfd_link_hash_undefweak \
|| (h)->root.type == bfd_link_hash_defweak) \
&& (h)->dynindx != -1)
static int
alpha_elf_dynamic_symbol_p (h, info)
struct elf_link_hash_entry *h;
struct bfd_link_info *info;
{
if (h == NULL)
return false;
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
if (h->dynindx == -1)
return false;
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
return false;
if (h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_defweak)
return true;
if ((info->shared && !info->symbolic)
|| ((h->elf_link_hash_flags
& (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
== (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
return true;
return false;
}
/* Create an entry in a Alpha ELF linker hash table. */
@ -711,7 +734,7 @@ static reloc_howto_type elf64_alpha_howto_table[] =
false), /* pcrel_offset */
/* The high bits of a 32-bit displacement to the starting address of the
current section (the relocation target is ignored); the low bits are
current section (the relocation target is ignored); the low bits are
supplied in the subsequent R_ALPHA_IMMED_LO32 relocs. */
/* XXX: Not implemented. */
HOWTO (R_ALPHA_IMMED_SCN_HI32,
@ -762,7 +785,7 @@ static reloc_howto_type elf64_alpha_howto_table[] =
0, /* dst_mask */
false), /* pcrel_offset */
/* Misc ELF relocations. */
/* Misc ELF relocations. */
/* A dynamic relocation to copy the target into our .dynbss section. */
/* Not generated, as all Alpha objects use PIC, so it is not needed. It
@ -979,7 +1002,7 @@ static const struct elf_reloc_map elf64_alpha_reloc_map[] =
/* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to process
the explicit !<reloc>!sequence relocations, and are mapped into the normal
relocations at the end of processing. */
relocations at the end of processing. */
{BFD_RELOC_ALPHA_USER_LITERAL, R_ALPHA_LITERAL},
{BFD_RELOC_ALPHA_USER_LITUSE_BASE, R_ALPHA_LITUSE},
{BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, R_ALPHA_LITUSE},
@ -1022,7 +1045,7 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst)
cache_ptr->howto = &elf64_alpha_howto_table[r_type];
}
/* These functions do relaxation for Alpha ELF.
/* These functions do relaxation for Alpha ELF.
Currently I'm only handling what I can do with existing compiler
and assembler support, which means no instructions are removed,
@ -1062,11 +1085,11 @@ struct alpha_relax_info
};
static Elf_Internal_Rela * elf64_alpha_relax_with_lituse
PARAMS((struct alpha_relax_info *info, bfd_vma symval,
PARAMS((struct alpha_relax_info *info, bfd_vma symval,
Elf_Internal_Rela *irel, Elf_Internal_Rela *irelend));
static boolean elf64_alpha_relax_without_lituse
PARAMS((struct alpha_relax_info *info, bfd_vma symval,
PARAMS((struct alpha_relax_info *info, bfd_vma symval,
Elf_Internal_Rela *irel));
static bfd_vma elf64_alpha_relax_opt_call
@ -1125,14 +1148,15 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
flags |= 1 << urel->r_addend;
}
/* A little preparation for the loop... */
/* A little preparation for the loop... */
disp = symval - info->gp;
fits16 = (disp >= -(bfd_signed_vma)0x8000 && disp < 0x8000);
fits32 = (disp >= -(bfd_signed_vma)0x80000000 && disp < 0x7fff8000);
for (urel = irel+1, i = 0; i < count; ++i, ++urel)
{
unsigned int insn;
int insn_disp;
bfd_signed_vma xdisp;
insn = bfd_get_32 (info->abfd, info->contents + urel->r_offset);
switch (urel->r_addend)
@ -1145,14 +1169,23 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
case 1: /* MEM FORMAT */
/* We can always optimize 16-bit displacements. */
/* Extract the displacement from the instruction, sign-extending
it if necessary, then test whether it is within 16 or 32 bits
displacement from GP. */
insn_disp = insn & 0x0000ffff;
if (insn_disp & 0x00008000)
insn_disp |= 0xffff0000; /* Negative: sign-extend. */
xdisp = disp + insn_disp;
fits16 = (xdisp >= - (bfd_signed_vma) 0x00008000 && xdisp < 0x00008000);
fits32 = (xdisp >= - (bfd_signed_vma) 0x80000000 && xdisp < 0x7fff8000);
if (fits16)
{
/* FIXME: sanity check the insn for mem format with
zero addend. */
/* Take the op code and dest from this insn, take the base
/* Take the op code and dest from this insn, take the base
register from the literal insn. Leave the offset alone. */
insn = (insn & 0xffe00000) | (lit_insn & 0x001f0000);
insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000);
urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_ALPHA_GPRELLOW);
urel->r_addend = irel->r_addend;
@ -1165,8 +1198,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
/* If all mem+byte, we can optimize 32-bit mem displacements. */
else if (fits32 && !(flags & ~6))
{
/* FIXME: sanity check that lit insn Ra is mem insn Rb, and
that mem_insn disp is zero. */
/* FIXME: sanity check that lit insn Ra is mem insn Rb. */
irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_ALPHA_GPRELHIGH);
@ -1215,12 +1247,12 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
{
Elf_Internal_Rela *xrel;
/* Preserve branch prediction call stack when possible. */
/* Preserve branch prediction call stack when possible. */
if ((insn & INSN_JSR_MASK) == INSN_JSR)
insn = (OP_BSR << 26) | (insn & 0x03e00000);
else
insn = (OP_BR << 26) | (insn & 0x03e00000);
urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_ALPHA_BRADDR);
urel->r_addend = irel->r_addend;
@ -1234,7 +1266,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
/* Kill any HINT reloc that might exist for this insn. */
xrel = (elf64_alpha_find_reloc_at_ofs
(info->relocs, info->relend, urel->r_offset,
(info->relocs, info->relend, urel->r_offset,
R_ALPHA_HINT));
if (xrel)
xrel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
@ -1249,7 +1281,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
This does depend on every place a gp could be reloaded will
be, which currently happens for all code produced by gcc, but
not necessarily by hand-coded assembly, or if sibling calls
are enabled in gcc.
are enabled in gcc.
Perhaps conditionalize this on a flag being set in the target
object file's header, and have gcc set it? */
@ -1295,22 +1327,22 @@ elf64_alpha_relax_opt_call (info, symval)
/* If the symbol is marked NOPV, we are being told the function never
needs its procedure value. */
if (info->other == STO_ALPHA_NOPV)
if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_NOPV)
return symval;
/* If the symbol is marked STD_GP, we are being told the function does
a normal ldgp in the first two words. */
else if (info->other == STO_ALPHA_STD_GPLOAD)
a normal ldgp in the first two words. */
else if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_STD_GPLOAD)
;
/* Otherwise, we may be able to identify a GP load in the first two
words, which we can then skip. */
else
else
{
Elf_Internal_Rela *tsec_relocs, *tsec_relend, *tsec_free, *gpdisp;
bfd_vma ofs;
/* Load the relocations from the section that the target symbol is in. */
/* Load the relocations from the section that the target symbol is in. */
if (info->sec == info->tsec)
{
tsec_relocs = info->relocs;
@ -1332,7 +1364,7 @@ elf64_alpha_relax_opt_call (info, symval)
/* Recover the symbol's offset within the section. */
ofs = (symval - info->tsec->output_section->vma
- info->tsec->output_offset);
/* Look for a GPDISP reloc. */
gpdisp = (elf64_alpha_find_reloc_at_ofs
(tsec_relocs, tsec_relend, ofs, R_ALPHA_GPDISP));
@ -1347,7 +1379,7 @@ elf64_alpha_relax_opt_call (info, symval)
free (tsec_free);
}
/* We've now determined that we can skip an initial gp load. Verify
/* We've now determined that we can skip an initial gp load. Verify
that the call and the target use the same gp. */
if (info->link_info->hash->creator != info->tsec->owner->xvec
|| info->gotobj != alpha_elf_tdata (info->tsec->owner)->gotobj)
@ -1408,7 +1440,7 @@ elf64_alpha_relax_without_lituse (info, symval, irel)
Any such memory load insn may be substituted by a load directly
off the GP. This allows the memory load insn to be issued before
the calculated GP register would otherwise be ready.
the calculated GP register would otherwise be ready.
Any such jsr insn can be replaced by a bsr if it is in range.
@ -1460,7 +1492,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
if (! link_info->keep_memory)
free_relocs = internal_relocs;
memset(&info, 0, sizeof(info));
memset(&info, 0, sizeof (info));
info.abfd = abfd;
info.sec = sec;
info.link_info = link_info;
@ -1543,8 +1575,8 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
info.tsec = bfd_abs_section_ptr;
else if (isym.st_shndx == SHN_COMMON)
info.tsec = bfd_com_section_ptr;
else
continue; /* who knows. */
else
continue; /* who knows. */
info.h = NULL;
info.other = isym.st_other;
@ -1967,7 +1999,7 @@ elf64_alpha_read_ecoff_info (abfd, section, debug)
char *ext_hdr = NULL;
swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
memset (debug, 0, sizeof(*debug));
memset (debug, 0, sizeof (*debug));
ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size);
if (ext_hdr == NULL && swap->external_hdr_size != 0)
@ -2078,6 +2110,12 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
{
asection *msec;
if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
filename_ptr, functionname_ptr,
line_ptr, 0,
&elf_tdata (abfd)->dwarf2_find_line_info))
return true;
msec = bfd_get_section_by_name (abfd, ".mdebug");
if (msec != NULL)
{
@ -2544,7 +2582,8 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
sreloc = bfd_make_section (dynobj, rel_sec_name);
if (sreloc == NULL
|| !bfd_set_section_flags (dynobj, sreloc,
(SEC_ALLOC|SEC_LOAD
((sec->flags & (SEC_ALLOC
| SEC_LOAD))
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
| SEC_LINKER_CREATED
@ -2560,7 +2599,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
don't know whether we'll actually need a dynamic relocation
entry for this reloc. So make a record of it. Once we
find out if this thing needs dynamic relocation we'll
expand the relocation sections by the appropriate amount. */
expand the relocation sections by the appropriate amount. */
struct alpha_elf_reloc_entry *rent;
@ -3132,7 +3171,7 @@ elf64_alpha_calc_dynrel_sizes (h, info)
|| relent->rtype == R_ALPHA_REFQUAD)
{
relent->srel->_raw_size +=
sizeof(Elf64_External_Rela) * relent->count;
sizeof (Elf64_External_Rela) * relent->count;
}
dynobj = elf_hash_table(info)->dynobj;
@ -3207,7 +3246,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
i = alpha_elf_tdata(i)->got_link_next)
count += alpha_elf_tdata(i)->n_local_got_entries;
srel->_raw_size += count * sizeof(Elf64_External_Rela);
srel->_raw_size += count * sizeof (Elf64_External_Rela);
}
}
/* else we're not dynamic and by definition we don't need such things. */
@ -3310,13 +3349,14 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0)
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0)
|| ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT,
sizeof(Elf64_External_Rela)))
sizeof (Elf64_External_Rela)))
return false;
if (reltext)
{
if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
return false;
info->flags |= DF_TEXTREL;
}
}
@ -3399,7 +3439,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
/* The symbol associated with GPDISP and LITUSE is
/* The symbol associated with GPDISP and LITUSE is
immaterial. Only the addend is significant. */
if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE)
continue;
@ -3522,7 +3562,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
case R_ALPHA_OP_PSUB:
case R_ALPHA_OP_PRSHIFT:
/* We hate these silly beasts. */
abort();
abort ();
case R_ALPHA_LITERAL:
{
@ -3576,7 +3616,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
((Elf64_External_Rela *)
srelgot->contents)
+ srelgot->reloc_count++);
BFD_ASSERT (sizeof(Elf64_External_Rela)
BFD_ASSERT (sizeof (Elf64_External_Rela)
* srelgot->reloc_count
<= srelgot->_cooked_size);
}
@ -3681,7 +3721,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
((Elf64_External_Rela *)
srel->contents)
+ srel->reloc_count++);
BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count
BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size);
}
goto default_reloc;
@ -3850,7 +3890,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
((Elf64_External_Rela *)
srel->contents)
+ srel->reloc_count++);
BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count
BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size);
}
@ -3883,7 +3923,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_elf64_swap_reloca_out (output_bfd, &outrel,
((Elf64_External_Rela *)srel->contents
+ srel->reloc_count++));
BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count
BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size);
}
}
@ -4301,7 +4341,6 @@ elf64_alpha_final_link (abfd, info)
}
#endif
/* Build the external symbol information. */
einfo.abfd = abfd;
einfo.info = info;
@ -4621,7 +4660,7 @@ elf64_alpha_final_link (abfd, info)
/* ECOFF swapping routines. These are used when dealing with the
.mdebug section, which is in the ECOFF debugging format. Copied
from elf32-mips.c. */
from elf32-mips.c. */
static const struct ecoff_debug_swap
elf64_alpha_ecoff_debug_swap =
{
@ -4664,6 +4703,36 @@ elf64_alpha_ecoff_debug_swap =
elf64_alpha_read_ecoff_info
};
/* Use a non-standard hash bucket size of 8. */
const struct elf_size_info alpha_elf_size_info =
{
sizeof (Elf64_External_Ehdr),
sizeof (Elf64_External_Phdr),
sizeof (Elf64_External_Shdr),
sizeof (Elf64_External_Rel),
sizeof (Elf64_External_Rela),
sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note),
8,
1,
64, 8,
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
bfd_elf64_write_relocs,
bfd_elf64_swap_symbol_out,
bfd_elf64_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
bfd_elf64_swap_dyn_in,
bfd_elf64_swap_dyn_out,
NULL,
NULL,
NULL,
NULL
};
#define TARGET_LITTLE_SYM bfd_elf64_alpha_vec
#define TARGET_LITTLE_NAME "elf64-alpha"
#define ELF_ARCH bfd_arch_alpha
@ -4719,9 +4788,10 @@ elf64_alpha_ecoff_debug_swap =
#define elf_backend_ecoff_debug_swap \
&elf64_alpha_ecoff_debug_swap
/*
* A few constants that determine how the .plt section is set up.
*/
#define elf_backend_size_info \
alpha_elf_size_info
/* A few constants that determine how the .plt section is set up. */
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0
#define elf_backend_want_plt_sym 1

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
/* HPPA linker stub instructions */
/* These are the instructions which the linker may insert into the
code stream when building final executables to handle out-of-range
calls and argument relocations. */
#define LDO_M4_R31_R31 0x37ff3ff9 /* ldo -4(%r31),%r31 */
#define LDIL_R1 0x20200000 /* ldil XXX,%r1 */
#define BE_SR4_R1 0xe0202000 /* be XXX(%sr4,%r1) */
#define COPY_R31_R2 0x081f0242 /* copy %r31,%r2 */
#define BLE_SR4_R0 0xe4002000 /* ble XXX(%sr4,%r0) */
#define BLE_SR4_R1 0xe4202000 /* ble XXX(%sr4,%r1) */
#define BV_N_0_R31 0xebe0c002 /* bv,n 0(%r31) */
#define STW_R31_M8R30 0x6bdf3ff1 /* stw %r31,-8(%r30) */
#define LDW_M8R30_R31 0x4bdf3ff1 /* ldw -8(%r30),%r31 */
#define STW_ARG_M16R30 0x6bc03fe1 /* stw %argX,-16(%r30) */
#define LDW_M16R30_ARG 0x4bc03fe1 /* ldw -12(%r30),%argX */
#define STW_ARG_M12R30 0x6bc03fe9 /* stw %argX,-16(%r30) */
#define LDW_M12R30_ARG 0x4bc03fe9 /* ldw -12(%r30),%argX */
#define FSTW_FARG_M16R30 0x27c11200 /* fstws %fargX,-16(%r30) */
#define FLDW_M16R30_FARG 0x27c11000 /* fldws -16(%r30),%fargX */
#define FSTD_FARG_M16R30 0x2fc11200 /* fstds %fargX,-16(%r30) */
#define FLDD_M16R30_FARG 0x2fc11000 /* fldds -16(%r30),%fargX */

View File

@ -278,7 +278,8 @@ enum machine_type {
M_SPARCLET_5 = 211, /* 0xd3, reserved */
M_SPARCLET_6 = 227, /* 0xe3, reserved */
/* M_SPARCLET_7 = 243 / * 0xf3, reserved */
M_SPARCLITE_LE = 243
M_SPARCLITE_LE = 243,
M_CRIS = 255 /* Axis CRIS binary. */
};
#define N_DYNAMIC(exec) ((exec).a_info & 0x80000000)

View File

@ -59,9 +59,9 @@ struct artdata {
file_ptr first_file_filepos;
/* Speed up searching the armap */
struct ar_cache *cache;
bfd *archive_head; /* Only interesting in output routines */
bfd *archive_head; /* Only interesting in output routines */
carsym *symdefs; /* the symdef entries */
symindex symdef_count; /* how many there are */
symindex symdef_count; /* how many there are */
char *extended_names; /* clever intel extension */
/* when more compilers are standard C, this can be a time_t */
long armap_timestamp; /* Timestamp value written into armap.
@ -79,9 +79,9 @@ struct artdata {
/* Goes in bfd's arelt_data slot */
struct areltdata {
char * arch_header; /* it's actually a string */
unsigned int parsed_size; /* octets of filesize not including ar_hdr */
char *filename; /* null-terminated */
char * arch_header; /* it's actually a string */
unsigned int parsed_size; /* octets of filesize not including ar_hdr */
char *filename; /* null-terminated */
};
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
@ -128,11 +128,11 @@ void bfd_void PARAMS ((bfd *ignore));
bfd *_bfd_new_bfd_contained_in PARAMS ((bfd *));
const bfd_target *_bfd_dummy_target PARAMS ((bfd *abfd));
void bfd_dont_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
void bfd_dont_truncate_arname PARAMS ((bfd *abfd, const char *filename,
char *hdr));
void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, const char *filename,
char *hdr));
void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, const char *filename,
char *hdr));
boolean bsd_write_armap PARAMS ((bfd *arch, unsigned int elength,
@ -367,7 +367,8 @@ extern boolean _bfd_dwarf1_find_nearest_line
/* Find the nearest line using DWARF 2 debugging information. */
extern boolean _bfd_dwarf2_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *, unsigned int));
const char **, unsigned int *, unsigned int,
PTR *));
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc

View File

@ -42,7 +42,6 @@ DESCRIPTION
/* A routine which is used in target vectors for unsupported
operations. */
/*ARGSUSED*/
boolean
bfd_false (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
@ -54,7 +53,6 @@ bfd_false (ignore)
/* A routine which is used in target vectors for supported operations
which do not actually do anything. */
/*ARGSUSED*/
boolean
bfd_true (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
@ -65,7 +63,6 @@ bfd_true (ignore)
/* A routine which is used in target vectors for unsupported
operations which return a pointer value. */
/*ARGSUSED*/
PTR
bfd_nullvoidptr (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
@ -74,23 +71,20 @@ bfd_nullvoidptr (ignore)
return NULL;
}
/*ARGSUSED*/
int
int
bfd_0 (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
{
return 0;
}
/*ARGSUSED*/
unsigned int
unsigned int
bfd_0u (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
{
return 0;
}
/*ARGUSED*/
long
bfd_0l (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
@ -101,7 +95,6 @@ bfd_0l (ignore)
/* A routine which is used in target vectors for unsupported
operations which return -1 on error. */
/*ARGSUSED*/
long
_bfd_n1 (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -110,14 +103,12 @@ _bfd_n1 (ignore_abfd)
return -1;
}
/*ARGSUSED*/
void
void
bfd_void (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
{
}
/*ARGSUSED*/
boolean
_bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
bfd *ignore_core_bfd ATTRIBUTE_UNUSED;
@ -130,7 +121,6 @@ _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
/* Routine to handle core_file_failing_command entry point for targets
without core file support. */
/*ARGSUSED*/
char *
_bfd_nocore_core_file_failing_command (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -142,7 +132,6 @@ _bfd_nocore_core_file_failing_command (ignore_abfd)
/* Routine to handle core_file_failing_signal entry point for targets
without core file support. */
/*ARGSUSED*/
int
_bfd_nocore_core_file_failing_signal (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -151,7 +140,6 @@ _bfd_nocore_core_file_failing_signal (ignore_abfd)
return 0;
}
/*ARGSUSED*/
const bfd_target *
_bfd_dummy_target (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -217,13 +205,12 @@ bfd_zmalloc (size)
/* Some IO code */
/* Note that archive entries don't have streams; they share their parent's.
This allows someone to play with the iostream behind BFD's back.
Also, note that the origin pointer points to the beginning of a file's
contents (0 for non-archive elements). For archive entries this is the
first octet in the file, NOT the beginning of the archive header. */
first octet in the file, NOT the beginning of the archive header. */
static int
real_read (where, a,b, file)
@ -285,7 +272,7 @@ bfd_read (ptr, size, nitems, abfd)
return get;
}
nread = real_read (ptr, 1, (size_t)(size*nitems), bfd_cache_lookup(abfd));
nread = real_read (ptr, 1, (size_t) (size*nitems), bfd_cache_lookup(abfd));
if (nread > 0)
abfd->where += nread;
@ -317,7 +304,7 @@ struct _bfd_window_internal {
struct _bfd_window_internal *next;
PTR data;
bfd_size_type size;
int refcount : 31; /* should be enough... */
int refcount : 31; /* should be enough... */
unsigned mapped : 1; /* 1 = mmap, 0 = malloc */
};
@ -674,7 +661,7 @@ bfd_seek (abfd, position, direction)
file_ptr file_position;
/* For the time being, a BFD may not seek to it's end. The problem
is that we don't easily have a way to recognize the end of an
element in an archive. */
element in an archive. */
BFD_ASSERT (direction == SEEK_SET || direction == SEEK_CUR);
@ -686,19 +673,39 @@ bfd_seek (abfd, position, direction)
struct bfd_in_memory *bim;
bim = (struct bfd_in_memory *) abfd->iostream;
if (direction == SEEK_SET)
abfd->where = position;
else
abfd->where += position;
if ((bfd_size_type) abfd->where > bim->size)
{
abfd->where = bim->size;
bfd_set_error (bfd_error_file_truncated);
return -1;
if ((abfd->direction == write_direction) ||
(abfd->direction == both_direction))
{
long newsize, oldsize = (bim->size + 127) & ~127;
bim->size = abfd->where;
/* Round up to cut down on memory fragmentation */
newsize = (bim->size + 127) & ~127;
if (newsize > oldsize)
{
bim->buffer = bfd_realloc (bim->buffer, newsize);
if (bim->buffer == 0)
{
bim->size = 0;
bfd_set_error (bfd_error_no_memory);
return -1;
}
}
}
else
{
abfd->where = bim->size;
bfd_set_error (bfd_error_file_truncated);
return -1;
}
}
return 0;
}
@ -779,7 +786,7 @@ bfd_seek (abfd, position, direction)
/* FIXME: Should these take a count argument?
Answer (gnu@cygnus.com): No, but perhaps they should be inline
functions in swap.h #ifdef __GNUC__.
functions in swap.h #ifdef __GNUC__.
Gprof them later and find out. */
/*
@ -810,13 +817,13 @@ DESCRIPTION
.{* Byte swapping macros for user section data. *}
.
.#define bfd_put_8(abfd, val, ptr) \
. ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
. ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
.#define bfd_put_signed_8 \
. bfd_put_8
.#define bfd_get_8(abfd, ptr) \
. (*(unsigned char *)(ptr))
. (*(unsigned char *) (ptr))
.#define bfd_get_signed_8(abfd, ptr) \
. ((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
. ((*(unsigned char *) (ptr) ^ 0x80) - 0x80)
.
.#define bfd_put_16(abfd, val, ptr) \
. BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
@ -859,7 +866,7 @@ DESCRIPTION
. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
. : (abort (), (void) 0))
.
*/
*/
/*
FUNCTION
@ -911,7 +918,7 @@ DESCRIPTION
.#define bfd_h_get_signed_64(abfd, ptr) \
. BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
.
*/
*/
/* Sign extension to bfd_signed_vma. */
#define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000)
@ -954,17 +961,17 @@ bfd_putb16 (data, addr)
bfd_vma data;
register bfd_byte *addr;
{
addr[0] = (bfd_byte)(data >> 8);
addr[0] = (bfd_byte) (data >> 8);
addr[1] = (bfd_byte )data;
}
void
bfd_putl16 (data, addr)
bfd_vma data;
bfd_vma data;
register bfd_byte *addr;
{
addr[0] = (bfd_byte )data;
addr[1] = (bfd_byte)(data >> 8);
addr[1] = (bfd_byte) (data >> 8);
}
bfd_vma
@ -1119,9 +1126,9 @@ bfd_putb32 (data, addr)
bfd_vma data;
register bfd_byte *addr;
{
addr[0] = (bfd_byte)(data >> 24);
addr[1] = (bfd_byte)(data >> 16);
addr[2] = (bfd_byte)(data >> 8);
addr[0] = (bfd_byte) (data >> 24);
addr[1] = (bfd_byte) (data >> 16);
addr[2] = (bfd_byte) (data >> 8);
addr[3] = (bfd_byte)data;
}
@ -1131,9 +1138,9 @@ bfd_putl32 (data, addr)
register bfd_byte *addr;
{
addr[0] = (bfd_byte)data;
addr[1] = (bfd_byte)(data >> 8);
addr[2] = (bfd_byte)(data >> 16);
addr[3] = (bfd_byte)(data >> 24);
addr[1] = (bfd_byte) (data >> 8);
addr[2] = (bfd_byte) (data >> 16);
addr[3] = (bfd_byte) (data >> 24);
}
void
@ -1142,14 +1149,14 @@ bfd_putb64 (data, addr)
register bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
addr[0] = (bfd_byte)(data >> (7*8));
addr[1] = (bfd_byte)(data >> (6*8));
addr[2] = (bfd_byte)(data >> (5*8));
addr[3] = (bfd_byte)(data >> (4*8));
addr[4] = (bfd_byte)(data >> (3*8));
addr[5] = (bfd_byte)(data >> (2*8));
addr[6] = (bfd_byte)(data >> (1*8));
addr[7] = (bfd_byte)(data >> (0*8));
addr[0] = (bfd_byte) (data >> (7*8));
addr[1] = (bfd_byte) (data >> (6*8));
addr[2] = (bfd_byte) (data >> (5*8));
addr[3] = (bfd_byte) (data >> (4*8));
addr[4] = (bfd_byte) (data >> (3*8));
addr[5] = (bfd_byte) (data >> (2*8));
addr[6] = (bfd_byte) (data >> (1*8));
addr[7] = (bfd_byte) (data >> (0*8));
#else
BFD_FAIL();
#endif
@ -1161,18 +1168,66 @@ bfd_putl64 (data, addr)
register bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
addr[7] = (bfd_byte)(data >> (7*8));
addr[6] = (bfd_byte)(data >> (6*8));
addr[5] = (bfd_byte)(data >> (5*8));
addr[4] = (bfd_byte)(data >> (4*8));
addr[3] = (bfd_byte)(data >> (3*8));
addr[2] = (bfd_byte)(data >> (2*8));
addr[1] = (bfd_byte)(data >> (1*8));
addr[0] = (bfd_byte)(data >> (0*8));
addr[7] = (bfd_byte) (data >> (7*8));
addr[6] = (bfd_byte) (data >> (6*8));
addr[5] = (bfd_byte) (data >> (5*8));
addr[4] = (bfd_byte) (data >> (4*8));
addr[3] = (bfd_byte) (data >> (3*8));
addr[2] = (bfd_byte) (data >> (2*8));
addr[1] = (bfd_byte) (data >> (1*8));
addr[0] = (bfd_byte) (data >> (0*8));
#else
BFD_FAIL();
#endif
}
void
bfd_put_bits (data, addr, bits, big_p)
bfd_vma data;
bfd_byte *addr;
int bits;
boolean big_p;
{
int i;
int bytes;
if (bits % 8 != 0)
abort ();
bytes = bits / 8;
for (i = 0; i < bytes; i++)
{
int index = big_p ? bytes - i - 1 : i;
addr[index] = (bfd_byte) data;
data >>= 8;
}
}
bfd_vma
bfd_get_bits (addr, bits, big_p)
bfd_byte *addr;
int bits;
boolean big_p;
{
bfd_vma data;
int i;
int bytes;
if (bits % 8 != 0)
abort ();
data = 0;
bytes = bits / 8;
for (i = 0; i < bytes; i++)
{
int index = big_p ? i : bytes - i - 1;
data = (data << 8) | addr[index];
}
return data;
}
/* Default implementation */
@ -1309,13 +1364,17 @@ _bfd_generic_verify_endian_match (ibfd, obfd)
bfd *obfd;
{
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
&& ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
&& obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
{
(*_bfd_error_handler)
("%s: compiled for a %s endian system and target is %s endian",
bfd_get_filename (ibfd),
bfd_big_endian (ibfd) ? "big" : "little",
bfd_big_endian (obfd) ? "big" : "little");
const char *msg;
if (bfd_big_endian (ibfd))
msg = _("%s: compiled for a big endian system and target is little endian");
else
msg = _("%s: compiled for a little endian system and target is big endian");
(*_bfd_error_handler) (msg, bfd_get_filename (ibfd));
bfd_set_error (bfd_error_wrong_format);
return false;

View File

@ -59,9 +59,9 @@ struct artdata {
file_ptr first_file_filepos;
/* Speed up searching the armap */
struct ar_cache *cache;
bfd *archive_head; /* Only interesting in output routines */
bfd *archive_head; /* Only interesting in output routines */
carsym *symdefs; /* the symdef entries */
symindex symdef_count; /* how many there are */
symindex symdef_count; /* how many there are */
char *extended_names; /* clever intel extension */
/* when more compilers are standard C, this can be a time_t */
long armap_timestamp; /* Timestamp value written into armap.
@ -79,9 +79,9 @@ struct artdata {
/* Goes in bfd's arelt_data slot */
struct areltdata {
char * arch_header; /* it's actually a string */
unsigned int parsed_size; /* octets of filesize not including ar_hdr */
char *filename; /* null-terminated */
char * arch_header; /* it's actually a string */
unsigned int parsed_size; /* octets of filesize not including ar_hdr */
char *filename; /* null-terminated */
};
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
@ -128,11 +128,11 @@ void bfd_void PARAMS ((bfd *ignore));
bfd *_bfd_new_bfd_contained_in PARAMS ((bfd *));
const bfd_target *_bfd_dummy_target PARAMS ((bfd *abfd));
void bfd_dont_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
void bfd_dont_truncate_arname PARAMS ((bfd *abfd, const char *filename,
char *hdr));
void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, const char *filename,
char *hdr));
void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, const char *filename,
char *hdr));
boolean bsd_write_armap PARAMS ((bfd *arch, unsigned int elength,
@ -367,7 +367,8 @@ extern boolean _bfd_dwarf1_find_nearest_line
/* Find the nearest line using DWARF 2 debugging information. */
extern boolean _bfd_dwarf2_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *, unsigned int));
const char **, unsigned int *, unsigned int,
PTR *));
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
@ -553,10 +554,10 @@ extern boolean _bfd_sh_align_load_span
/* And more follows */
void
void
bfd_write_bigendian_4byte_int PARAMS ((bfd *abfd, int i));
unsigned int
unsigned int
bfd_log2 PARAMS ((bfd_vma x));
#define BFD_CACHE_MAX_OPEN 10
@ -564,15 +565,15 @@ extern bfd *bfd_last_cache;
#define bfd_cache_lookup(x) \
((x)==bfd_last_cache? \
(FILE*)(bfd_last_cache->iostream): \
(FILE*) (bfd_last_cache->iostream): \
bfd_cache_lookup_worker(x))
boolean
bfd_cache_init PARAMS ((bfd *abfd));
boolean
bfd_cache_init PARAMS ((bfd *abfd));
boolean
bfd_cache_close PARAMS ((bfd *abfd));
boolean
bfd_cache_close PARAMS ((bfd *abfd));
FILE*
FILE*
bfd_open_file PARAMS ((bfd *abfd));
FILE *
@ -716,6 +717,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_386_RELATIVE",
"BFD_RELOC_386_GOTOFF",
"BFD_RELOC_386_GOTPC",
"BFD_RELOC_X86_64_GOT32",
"BFD_RELOC_X86_64_PLT32",
"BFD_RELOC_X86_64_COPY",
"BFD_RELOC_X86_64_GLOB_DAT",
"BFD_RELOC_X86_64_JUMP_SLOT",
"BFD_RELOC_X86_64_RELATIVE",
"BFD_RELOC_X86_64_GOTPCREL",
"BFD_RELOC_X86_64_32S",
"BFD_RELOC_NS32K_IMM_8",
"BFD_RELOC_NS32K_IMM_16",
"BFD_RELOC_NS32K_IMM_32",
@ -767,6 +776,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_I370_D12",
"BFD_RELOC_CTOR",
"BFD_RELOC_ARM_PCREL_BRANCH",
"BFD_RELOC_ARM_PCREL_BLX",
"BFD_RELOC_THUMB_PCREL_BLX",
"BFD_RELOC_ARM_IMMEDIATE",
"BFD_RELOC_ARM_ADRL_IMMEDIATE",
"BFD_RELOC_ARM_OFFSET_IMM",
@ -811,6 +822,13 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_SH_CODE",
"BFD_RELOC_SH_DATA",
"BFD_RELOC_SH_LABEL",
"BFD_RELOC_SH_LOOP_START",
"BFD_RELOC_SH_LOOP_END",
"BFD_RELOC_SH_COPY",
"BFD_RELOC_SH_GLOB_DAT",
"BFD_RELOC_SH_JMP_SLOT",
"BFD_RELOC_SH_RELATIVE",
"BFD_RELOC_SH_GOTPC",
"BFD_RELOC_THUMB_PCREL_BRANCH9",
"BFD_RELOC_THUMB_PCREL_BRANCH12",
"BFD_RELOC_THUMB_PCREL_BRANCH23",
@ -859,6 +877,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MN10300_32_PCREL",
"BFD_RELOC_MN10300_16_PCREL",
"BFD_RELOC_TIC30_LDP",
"BFD_RELOC_TIC54X_PARTLS7",
"BFD_RELOC_TIC54X_PARTMS9",
"BFD_RELOC_TIC54X_23",
"BFD_RELOC_TIC54X_16_OF_23",
"BFD_RELOC_TIC54X_MS7_OF_23",
"BFD_RELOC_FR30_48",
"BFD_RELOC_FR30_20",
"BFD_RELOC_FR30_6_IN_4",
@ -891,28 +914,128 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_AVR_CALL",
"BFD_RELOC_VTABLE_INHERIT",
"BFD_RELOC_VTABLE_ENTRY",
"BFD_RELOC_IA64_IMM14",
"BFD_RELOC_IA64_IMM22",
"BFD_RELOC_IA64_IMM64",
"BFD_RELOC_IA64_DIR32MSB",
"BFD_RELOC_IA64_DIR32LSB",
"BFD_RELOC_IA64_DIR64MSB",
"BFD_RELOC_IA64_DIR64LSB",
"BFD_RELOC_IA64_GPREL22",
"BFD_RELOC_IA64_GPREL64I",
"BFD_RELOC_IA64_GPREL32MSB",
"BFD_RELOC_IA64_GPREL32LSB",
"BFD_RELOC_IA64_GPREL64MSB",
"BFD_RELOC_IA64_GPREL64LSB",
"BFD_RELOC_IA64_LTOFF22",
"BFD_RELOC_IA64_LTOFF64I",
"BFD_RELOC_IA64_PLTOFF22",
"BFD_RELOC_IA64_PLTOFF64I",
"BFD_RELOC_IA64_PLTOFF64MSB",
"BFD_RELOC_IA64_PLTOFF64LSB",
"BFD_RELOC_IA64_FPTR64I",
"BFD_RELOC_IA64_FPTR32MSB",
"BFD_RELOC_IA64_FPTR32LSB",
"BFD_RELOC_IA64_FPTR64MSB",
"BFD_RELOC_IA64_FPTR64LSB",
"BFD_RELOC_IA64_PCREL21B",
"BFD_RELOC_IA64_PCREL21BI",
"BFD_RELOC_IA64_PCREL21M",
"BFD_RELOC_IA64_PCREL21F",
"BFD_RELOC_IA64_PCREL22",
"BFD_RELOC_IA64_PCREL60B",
"BFD_RELOC_IA64_PCREL64I",
"BFD_RELOC_IA64_PCREL32MSB",
"BFD_RELOC_IA64_PCREL32LSB",
"BFD_RELOC_IA64_PCREL64MSB",
"BFD_RELOC_IA64_PCREL64LSB",
"BFD_RELOC_IA64_LTOFF_FPTR22",
"BFD_RELOC_IA64_LTOFF_FPTR64I",
"BFD_RELOC_IA64_LTOFF_FPTR64MSB",
"BFD_RELOC_IA64_LTOFF_FPTR64LSB",
"BFD_RELOC_IA64_SEGREL32MSB",
"BFD_RELOC_IA64_SEGREL32LSB",
"BFD_RELOC_IA64_SEGREL64MSB",
"BFD_RELOC_IA64_SEGREL64LSB",
"BFD_RELOC_IA64_SECREL32MSB",
"BFD_RELOC_IA64_SECREL32LSB",
"BFD_RELOC_IA64_SECREL64MSB",
"BFD_RELOC_IA64_SECREL64LSB",
"BFD_RELOC_IA64_REL32MSB",
"BFD_RELOC_IA64_REL32LSB",
"BFD_RELOC_IA64_REL64MSB",
"BFD_RELOC_IA64_REL64LSB",
"BFD_RELOC_IA64_LTV32MSB",
"BFD_RELOC_IA64_LTV32LSB",
"BFD_RELOC_IA64_LTV64MSB",
"BFD_RELOC_IA64_LTV64LSB",
"BFD_RELOC_IA64_IPLTMSB",
"BFD_RELOC_IA64_IPLTLSB",
"BFD_RELOC_IA64_COPY",
"BFD_RELOC_IA64_TPREL22",
"BFD_RELOC_IA64_TPREL64MSB",
"BFD_RELOC_IA64_TPREL64LSB",
"BFD_RELOC_IA64_LTOFF_TP22",
"BFD_RELOC_IA64_LTOFF22X",
"BFD_RELOC_IA64_LDXMOV",
"BFD_RELOC_M68HC11_HI8",
"BFD_RELOC_M68HC11_LO8",
"BFD_RELOC_M68HC11_3B",
"BFD_RELOC_CRIS_BDISP8",
"BFD_RELOC_CRIS_UNSIGNED_5",
"BFD_RELOC_CRIS_SIGNED_6",
"BFD_RELOC_CRIS_UNSIGNED_6",
"BFD_RELOC_CRIS_UNSIGNED_4",
"BFD_RELOC_860_COPY",
"BFD_RELOC_860_GLOB_DAT",
"BFD_RELOC_860_JUMP_SLOT",
"BFD_RELOC_860_RELATIVE",
"BFD_RELOC_860_PC26",
"BFD_RELOC_860_PLT26",
"BFD_RELOC_860_PC16",
"BFD_RELOC_860_LOW0",
"BFD_RELOC_860_SPLIT0",
"BFD_RELOC_860_LOW1",
"BFD_RELOC_860_SPLIT1",
"BFD_RELOC_860_LOW2",
"BFD_RELOC_860_SPLIT2",
"BFD_RELOC_860_LOW3",
"BFD_RELOC_860_LOGOT0",
"BFD_RELOC_860_SPGOT0",
"BFD_RELOC_860_LOGOT1",
"BFD_RELOC_860_SPGOT1",
"BFD_RELOC_860_LOGOTOFF0",
"BFD_RELOC_860_SPGOTOFF0",
"BFD_RELOC_860_LOGOTOFF1",
"BFD_RELOC_860_SPGOTOFF1",
"BFD_RELOC_860_LOGOTOFF2",
"BFD_RELOC_860_LOGOTOFF3",
"BFD_RELOC_860_LOPC",
"BFD_RELOC_860_HIGHADJ",
"BFD_RELOC_860_HAGOT",
"BFD_RELOC_860_HAGOTOFF",
"BFD_RELOC_860_HAPC",
"BFD_RELOC_860_HIGH",
"BFD_RELOC_860_HIGOT",
"BFD_RELOC_860_HIGOTOFF",
"@@overflow: BFD_RELOC_UNUSED@@",
};
#endif
reloc_howto_type *
bfd_default_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
bfd_default_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
boolean
bfd_generic_relax_section
PARAMS ((bfd *abfd,
boolean
bfd_generic_relax_section PARAMS ((bfd *abfd,
asection *section,
struct bfd_link_info *,
boolean *));
boolean
bfd_generic_gc_sections
PARAMS ((bfd *, struct bfd_link_info *));
boolean
bfd_generic_gc_sections PARAMS ((bfd *, struct bfd_link_info *));
bfd_byte *
bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd,
bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
@ -920,19 +1043,18 @@ bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd,
asymbol **symbols));
extern const bfd_arch_info_type bfd_default_arch_struct;
boolean
boolean
bfd_default_set_arch_mach PARAMS ((bfd *abfd,
enum bfd_architecture arch,
unsigned long mach));
const bfd_arch_info_type *
bfd_default_compatible
PARAMS ((const bfd_arch_info_type *a,
bfd_default_compatible PARAMS ((const bfd_arch_info_type *a,
const bfd_arch_info_type *b));
boolean
boolean
bfd_default_scan PARAMS ((const struct bfd_arch_info *info, const char *string));
struct elf_internal_shdr *
bfd_elf_find_section PARAMS ((bfd *abfd, char *name));
bfd_elf_find_section PARAMS ((bfd *abfd, char *name));

View File

@ -20,12 +20,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
/* Check for our machine type (part of magic number). */
/* If other MID values, define MACHTYPE_OK in xxxnetbsd.c */
#ifndef MACHTYPE_OK
#define MACHTYPE_OK(m) ((m) == DEFAULT_MID || (m) == M_UNKNOWN)
#endif
/* This is the normal load address for executables. */
/* This is the normal load address for executables. */
#define TEXT_START_ADDR TARGET_PAGE_SIZE
/* NetBSD ZMAGIC has its header in the text segment. */
@ -34,22 +33,22 @@ USA. */
/* Determine if this file is compiled as pic code. */
#define N_PIC(exec) ((exec).a_info & 0x40000000)
/* Determine if this is a shared library using the flags. */
/* Determine if this is a shared library using the flags. */
#define N_SHARED_LIB(x) (N_DYNAMIC(x) && N_PIC(x))
/* We have 6 bits of flags and 10 bits of machine ID. */
#define N_MACHTYPE(exec) \
((enum machine_type)(((exec).a_info >> 16) & 0x03ff))
((enum machine_type) (((exec).a_info >> 16) & 0x03ff))
#define N_FLAGS(exec) \
(((exec).a_info >> 26) & 0x3f)
#define N_SET_INFO(exec, magic, type, flags) \
((exec).a_info = ((magic) & 0xffff) \
| (((int)(type) & 0x3ff) << 16) \
| (((int) (type) & 0x3ff) << 16) \
| (((flags) & 0x3f) << 24))
#define N_SET_MACHTYPE(exec, machtype) \
((exec).a_info = \
((exec).a_info & 0xfb00ffff) | ((((int)(machtype))&0x3ff) << 16))
((exec).a_info & 0xfb00ffff) | ((((int) (machtype))&0x3ff) << 16))
#define N_SET_FLAGS(exec, flags) \
((exec).a_info = \
((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26))

View File

@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_IS_BIG_ENDIAN_P
/* SPARC chips use either 4K or 8K pages, but object files always
assume 8K page alignment so they will work on either one. */
assume 8K page alignment so they will work on either one. */
#define TARGET_PAGE_SIZE 0x2000
#define DEFAULT_ARCH bfd_arch_sparc

View File

@ -512,7 +512,7 @@ sunos_canonicalize_dynamic_reloc (abfd, storage, syms)
* sizeof (arelent))));
if (info->canonical_dynrel == NULL && info->dynrel_count != 0)
return -1;
to = info->canonical_dynrel;
if (obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE)
@ -1425,7 +1425,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr,
s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
if (s->contents == NULL && s->_raw_size != 0)
return false;
/* The number of buckets is just the number of symbols divided
by four. To compute the final size of the hash table, we
must actually compute the hash table. Normally we need
@ -2278,16 +2278,16 @@ sunos_write_dynamic_symbol (output_bfd, info, harg)
PUT_WORD (output_bfd, r_address, srel->r_address);
if (bfd_header_big_endian (output_bfd))
{
srel->r_index[0] = (bfd_byte)(h->dynindx >> 16);
srel->r_index[1] = (bfd_byte)(h->dynindx >> 8);
srel->r_index[2] = (bfd_byte)(h->dynindx);
srel->r_index[0] = (bfd_byte) (h->dynindx >> 16);
srel->r_index[1] = (bfd_byte) (h->dynindx >> 8);
srel->r_index[2] = (bfd_byte) (h->dynindx);
srel->r_type[0] = (RELOC_STD_BITS_EXTERN_BIG
| RELOC_STD_BITS_JMPTABLE_BIG);
}
else
{
srel->r_index[2] = (bfd_byte)(h->dynindx >> 16);
srel->r_index[1] = (bfd_byte)(h->dynindx >> 8);
srel->r_index[2] = (bfd_byte) (h->dynindx >> 16);
srel->r_index[1] = (bfd_byte) (h->dynindx >> 8);
srel->r_index[0] = (bfd_byte)h->dynindx;
srel->r_type[0] = (RELOC_STD_BITS_EXTERN_LITTLE
| RELOC_STD_BITS_JMPTABLE_LITTLE);
@ -2301,8 +2301,8 @@ sunos_write_dynamic_symbol (output_bfd, info, harg)
PUT_WORD (output_bfd, r_address, erel->r_address);
if (bfd_header_big_endian (output_bfd))
{
erel->r_index[0] = (bfd_byte)(h->dynindx >> 16);
erel->r_index[1] = (bfd_byte)(h->dynindx >> 8);
erel->r_index[0] = (bfd_byte) (h->dynindx >> 16);
erel->r_index[1] = (bfd_byte) (h->dynindx >> 8);
erel->r_index[2] = (bfd_byte)h->dynindx;
erel->r_type[0] =
(RELOC_EXT_BITS_EXTERN_BIG
@ -2310,8 +2310,8 @@ sunos_write_dynamic_symbol (output_bfd, info, harg)
}
else
{
erel->r_index[2] = (bfd_byte)(h->dynindx >> 16);
erel->r_index[1] = (bfd_byte)(h->dynindx >> 8);
erel->r_index[2] = (bfd_byte) (h->dynindx >> 16);
erel->r_index[1] = (bfd_byte) (h->dynindx >> 8);
erel->r_index[0] = (bfd_byte)h->dynindx;
erel->r_type[0] =
(RELOC_EXT_BITS_EXTERN_LITTLE
@ -2598,8 +2598,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc,
srel->r_address);
if (bfd_header_big_endian (dynobj))
{
srel->r_index[0] = (bfd_byte)(indx >> 16);
srel->r_index[1] = (bfd_byte)(indx >> 8);
srel->r_index[0] = (bfd_byte) (indx >> 16);
srel->r_index[1] = (bfd_byte) (indx >> 8);
srel->r_index[2] = (bfd_byte)indx;
if (h == NULL)
srel->r_type[0] = 2 << RELOC_STD_BITS_LENGTH_SH_BIG;
@ -2612,8 +2612,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc,
}
else
{
srel->r_index[2] = (bfd_byte)(indx >> 16);
srel->r_index[1] = (bfd_byte)(indx >> 8);
srel->r_index[2] = (bfd_byte) (indx >> 16);
srel->r_index[1] = (bfd_byte) (indx >> 8);
srel->r_index[0] = (bfd_byte)indx;
if (h == NULL)
srel->r_type[0] = 2 << RELOC_STD_BITS_LENGTH_SH_LITTLE;
@ -2637,8 +2637,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc,
erel->r_address);
if (bfd_header_big_endian (dynobj))
{
erel->r_index[0] = (bfd_byte)(indx >> 16);
erel->r_index[1] = (bfd_byte)(indx >> 8);
erel->r_index[0] = (bfd_byte) (indx >> 16);
erel->r_index[1] = (bfd_byte) (indx >> 8);
erel->r_index[2] = (bfd_byte)indx;
if (h == NULL)
erel->r_type[0] =
@ -2650,8 +2650,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc,
}
else
{
erel->r_index[2] = (bfd_byte)(indx >> 16);
erel->r_index[1] = (bfd_byte)(indx >> 8);
erel->r_index[2] = (bfd_byte) (indx >> 16);
erel->r_index[1] = (bfd_byte) (indx >> 8);
erel->r_index[0] = (bfd_byte)indx;
if (h == NULL)
erel->r_type[0] =
@ -2730,14 +2730,14 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc,
srel->r_address);
if (bfd_header_big_endian (dynobj))
{
srel->r_index[0] = (bfd_byte)(indx >> 16);
srel->r_index[1] = (bfd_byte)(indx >> 8);
srel->r_index[0] = (bfd_byte) (indx >> 16);
srel->r_index[1] = (bfd_byte) (indx >> 8);
srel->r_index[2] = (bfd_byte)indx;
}
else
{
srel->r_index[2] = (bfd_byte)(indx >> 16);
srel->r_index[1] = (bfd_byte)(indx >> 8);
srel->r_index[2] = (bfd_byte) (indx >> 16);
srel->r_index[1] = (bfd_byte) (indx >> 8);
srel->r_index[0] = (bfd_byte)indx;
}
/* FIXME: We may have to change the addend for a PC relative
@ -2755,14 +2755,14 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc,
erel->r_address);
if (bfd_header_big_endian (dynobj))
{
erel->r_index[0] = (bfd_byte)(indx >> 16);
erel->r_index[1] = (bfd_byte)(indx >> 8);
erel->r_index[0] = (bfd_byte) (indx >> 16);
erel->r_index[1] = (bfd_byte) (indx >> 8);
erel->r_index[2] = (bfd_byte)indx;
}
else
{
erel->r_index[2] = (bfd_byte)(indx >> 16);
erel->r_index[1] = (bfd_byte)(indx >> 8);
erel->r_index[2] = (bfd_byte) (indx >> 16);
erel->r_index[1] = (bfd_byte) (indx >> 8);
erel->r_index[0] = (bfd_byte)indx;
}
if (pcrel && h != NULL)
@ -2937,7 +2937,7 @@ sunos_finish_dynamic_link (abfd, info)
PUT_WORD (dynobj,
BFD_ALIGN (obj_textsec (abfd)->_raw_size, 0x2000),
esdl.ld_text);
if (! bfd_set_section_contents (abfd, sdyn->output_section, &esdl,
(sdyn->output_offset
+ sizeof esd

View File

@ -1,5 +1,5 @@
/* Generic target-file-type support for the BFD library.
Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "fnmatch.h"
/*
SECTION
SECTION
Targets
DESCRIPTION
@ -34,7 +34,7 @@ DESCRIPTION
part of BFD is a structure containing pointers to functions
which perform certain low level operations on files. BFD
translates the applications's requests through a pointer into
calls to the back end routines.
calls to the back end routines.
When a file is opened with <<bfd_openr>>, its format and
target are unknown. BFD uses various mechanisms to determine
@ -42,11 +42,11 @@ DESCRIPTION
o Create a BFD by calling the internal routine
<<_bfd_new_bfd>>, then call <<bfd_find_target>> with the
target string supplied to <<bfd_openr>> and the new BFD pointer.
target string supplied to <<bfd_openr>> and the new BFD pointer.
o If a null target string was provided to <<bfd_find_target>>,
look up the environment variable <<GNUTARGET>> and use
that as the target string.
that as the target string.
o If the target string is still <<NULL>>, or the target string is
<<default>>, then use the first item in the target vector
@ -56,7 +56,7 @@ DESCRIPTION
o Otherwise, inspect the elements in the target vector
one by one, until a match on target name is found. When found,
use it.
use it.
o Otherwise return the error <<bfd_error_invalid_target>> to
<<bfd_openr>>.
@ -66,7 +66,7 @@ DESCRIPTION
Once the BFD has been opened and the target selected, the file
format may be determined. This is done by calling
<<bfd_check_format>> on the BFD with a suggested format.
<<bfd_check_format>> on the BFD with a suggested format.
If <<target_defaulted>> has been set, each possible target
type is tried to see if it recognizes the specified format.
<<bfd_check_format>> returns <<true>> when the caller guesses right.
@ -75,7 +75,6 @@ DESCRIPTION
@end menu
*/
/*
INODE
@ -87,17 +86,17 @@ SUBSECTION
DESCRIPTION
This structure contains everything that BFD knows about a
target. It includes things like its byte order, name, and which
routines to call to do various operations.
routines to call to do various operations.
Every BFD points to a target structure with its <<xvec>>
member.
member.
The macros below are used to dispatch to functions through the
<<bfd_target>> vector. They are used in a number of macros further
down in @file{bfd.h}, and are also used when calling various
routines by hand inside the BFD implementation. The @var{arglist}
argument must be parenthesized; it contains all the arguments
to the called function.
to the called function.
They make the documentation (more) unpleasant to read, so if
someone wants to fix this and not break the above, please do.
@ -116,13 +115,13 @@ DESCRIPTION
For operations which index on the BFD format:
.#define BFD_SEND_FMT(bfd, message, arglist) \
. (((bfd)->xvec->message[(int)((bfd)->format)]) arglist)
. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
.
.#ifdef DEBUG_BFD_SEND
.#undef BFD_SEND_FMT
.#define BFD_SEND_FMT(bfd, message, arglist) \
. (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
. (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \
. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
. (bfd_assert (__FILE__,__LINE__), NULL))
.#endif
@ -131,16 +130,16 @@ DESCRIPTION
module that implements access to a different target under BFD,
defines one of these.
FIXME, these names should be rationalised with the names of
the entry points which call them. Too bad we can't have one
macro to define them both!
macro to define them both!
.enum bfd_flavour {
. bfd_target_unknown_flavour,
. bfd_target_aout_flavour,
. bfd_target_coff_flavour,
. bfd_target_ecoff_flavour,
. bfd_target_xcoff_flavour,
. bfd_target_elf_flavour,
. bfd_target_ieee_flavour,
. bfd_target_nlm_flavour,
@ -184,21 +183,21 @@ The order of bytes within the header parts of a file.
A mask of all the flags which an executable may have set -
from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.
. flagword object_flags;
. flagword object_flags;
A mask of all the flags which a section may have set - from
the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.
. flagword section_flags;
The character normally found at the front of a symbol
The character normally found at the front of a symbol
(if any), perhaps `_'.
. char symbol_leading_char;
The pad character for file names within an archive header.
. char ar_pad_char;
. char ar_pad_char;
The maximum number of characters in an archive header.
@ -233,15 +232,15 @@ Byte swapping for the headers
Format dependent routines: these are vectors of entry points
within the target vector structure, one for each format to check.
Check the format of a file being read. Return a <<bfd_target *>> or zero.
Check the format of a file being read. Return a <<bfd_target *>> or zero.
. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
Set the format of a file being written.
Set the format of a file being written.
. boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
Write cached information into a file being written, at <<bfd_close>>.
Write cached information into a file being written, at <<bfd_close>>.
. boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
@ -264,7 +263,7 @@ BFD_JUMP_TABLE macros.
. {* Called when a new section is created. *}
. boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
. {* Read the contents of a section. *}
. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
. file_ptr, bfd_size_type));
. boolean (*_bfd_get_section_contents_in_window)
. PARAMS ((bfd *, sec_ptr, bfd_window *,
@ -288,7 +287,7 @@ BFD_JUMP_TABLE macros.
. to another. *}
. boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
. bfd *, sec_ptr));
. {* Called to copy BFD private symbol data from one symbol
. {* Called to copy BFD private symbol data from one symbol
. to another. *}
. boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
. bfd *, asymbol *));
@ -324,10 +323,10 @@ BFD_JUMP_TABLE macros.
. boolean (*_bfd_construct_extended_name_table)
. PARAMS ((bfd *, char **, bfd_size_type *, const char **));
. void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
. boolean (*write_armap) PARAMS ((bfd *arch,
. boolean (*write_armap) PARAMS ((bfd *arch,
. unsigned int elength,
. struct orl *map,
. unsigned int orl_count,
. unsigned int orl_count,
. int stridx));
. PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
. bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
@ -467,15 +466,15 @@ and little endian code, and target chosen by the linker has the wrong
endianness. The function open_output() in ld/ldlang.c uses this field
to find an alternative output format that is suitable.
. {* Opposite endian version of this target. *}
. {* Opposite endian version of this target. *}
. const struct bfd_target * alternative_target;
.
.
Data for use by back-end routines, which isn't generic enough to belong
in this structure.
. PTR backend_data;
.
.
.} bfd_target;
*/
@ -486,49 +485,57 @@ in this structure.
we can't intermix extern's and initializers. */
extern const bfd_target a29kcoff_big_vec;
extern const bfd_target a_out_adobe_vec;
extern const bfd_target aout0_big_vec;
extern const bfd_target aout_arm_big_vec;
extern const bfd_target aout_arm_little_vec;
extern const bfd_target aout_mips_big_vec;
extern const bfd_target aout_mips_little_vec;
extern const bfd_target aout0_big_vec;
extern const bfd_target apollocoff_vec;
extern const bfd_target armcoff_little_vec;
extern const bfd_target armcoff_big_vec;
extern const bfd_target armnetbsd_vec;
extern const bfd_target armpe_little_vec;
extern const bfd_target armpe_big_vec;
extern const bfd_target armpei_little_vec;
extern const bfd_target armpei_big_vec;
extern const bfd_target arm_epoc_pe_little_vec;
extern const bfd_target arm_epoc_pe_big_vec;
extern const bfd_target arm_epoc_pei_little_vec;
extern const bfd_target arm_epoc_pe_little_vec;
extern const bfd_target arm_epoc_pei_big_vec;
extern const bfd_target arm_epoc_pei_little_vec;
extern const bfd_target armcoff_big_vec;
extern const bfd_target armcoff_little_vec;
extern const bfd_target armnetbsd_vec;
extern const bfd_target armpe_big_vec;
extern const bfd_target armpe_little_vec;
extern const bfd_target armpei_big_vec;
extern const bfd_target armpei_little_vec;
extern const bfd_target b_out_vec_big_host;
extern const bfd_target b_out_vec_little_host;
extern const bfd_target bfd_elf64_alpha_vec;
extern const bfd_target bfd_efi_app_ia32_vec;
extern const bfd_target bfd_efi_app_ia64_vec;
extern const bfd_target bfd_elf32_avr_vec;
extern const bfd_target bfd_elf32_bigarc_vec;
extern const bfd_target bfd_elf32_bigarm_vec;
extern const bfd_target bfd_elf32_bigarm_oabi_vec;
extern const bfd_target bfd_elf32_littlearc_vec;
extern const bfd_target bfd_elf32_littlearm_vec;
extern const bfd_target bfd_elf32_littlearm_oabi_vec;
extern const bfd_target bfd_elf32_big_generic_vec;
extern const bfd_target bfd_elf32_bigarc_vec;
extern const bfd_target bfd_elf32_bigarm_oabi_vec;
extern const bfd_target bfd_elf32_bigarm_vec;
extern const bfd_target bfd_elf32_bigmips_vec;
extern const bfd_target bfd_elf64_bigmips_vec;
extern const bfd_target bfd_elf32_cris_vec;
extern const bfd_target bfd_elf32_d10v_vec;
extern const bfd_target bfd_elf32_d30v_vec;
extern const bfd_target bfd_elf32_fr30_vec;
extern const bfd_target bfd_elf32_hppa_linux_vec;
extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_vec;
extern const bfd_target bfd_elf32_i860_little_vec;
extern const bfd_target bfd_elf32_i860_vec;
extern const bfd_target bfd_elf32_i960_vec;
extern const bfd_target bfd_elf32_ia64_big_vec;
extern const bfd_target bfd_elf32_little_generic_vec;
extern const bfd_target bfd_elf32_littlearc_vec;
extern const bfd_target bfd_elf32_littlearm_oabi_vec;
extern const bfd_target bfd_elf32_littlearm_vec;
extern const bfd_target bfd_elf32_littlemips_vec;
extern const bfd_target bfd_elf64_littlemips_vec;
extern const bfd_target bfd_elf32_m32r_vec;
extern const bfd_target bfd_elf32_m68hc11_vec;
extern const bfd_target bfd_elf32_m68hc12_vec;
extern const bfd_target bfd_elf32_m68k_vec;
extern const bfd_target bfd_elf32_m88k_vec;
extern const bfd_target bfd_elf32_mcore_big_vec;
extern const bfd_target bfd_elf32_mcore_little_vec;
extern const bfd_target bfd_elf32_mn10200_vec;
extern const bfd_target bfd_elf32_mn10300_vec;
extern const bfd_target bfd_elf32_pj_vec;
@ -538,50 +545,61 @@ extern const bfd_target bfd_elf32_powerpcle_vec;
extern const bfd_target bfd_elf32_shunx_vec;
extern const bfd_target bfd_elf32_shlunx_vec;
extern const bfd_target bfd_elf32_sh_vec;
extern const bfd_target bfd_elf32_shblin_vec;
extern const bfd_target bfd_elf32_shl_vec;
extern const bfd_target bfd_elf32_shlin_vec;
extern const bfd_target bfd_elf32_sparc_vec;
extern const bfd_target bfd_elf32_tradbigmips_vec;
extern const bfd_target bfd_elf32_tradlittlemips_vec;
extern const bfd_target bfd_elf32_us_cris_vec;
extern const bfd_target bfd_elf32_v850_vec;
extern const bfd_target bfd_elf32_fr30_vec;
extern const bfd_target bfd_elf32_mcore_big_vec;
extern const bfd_target bfd_elf32_mcore_little_vec;
extern const bfd_target bfd_elf64_alpha_vec;
extern const bfd_target bfd_elf64_big_generic_vec;
extern const bfd_target bfd_elf64_bigmips_vec;
extern const bfd_target bfd_elf64_hppa_linux_vec;
extern const bfd_target bfd_elf64_hppa_vec;
extern const bfd_target bfd_elf64_ia64_big_vec;
extern const bfd_target bfd_elf64_ia64_little_vec;
extern const bfd_target bfd_elf64_little_generic_vec;
extern const bfd_target bfd_elf64_littlemips_vec;
extern const bfd_target bfd_elf64_sparc_vec;
extern const bfd_target bfd_elf64_x86_64_vec;
extern const bfd_target bfd_powerpc_pe_vec;
extern const bfd_target bfd_powerpc_pei_vec;
extern const bfd_target bfd_powerpcle_pe_vec;
extern const bfd_target bfd_powerpcle_pei_vec;
extern const bfd_target cris_aout_vec;
extern const bfd_target demo_64_vec;
extern const bfd_target ecoff_big_vec;
extern const bfd_target ecoff_little_vec;
extern const bfd_target ecoff_biglittle_vec;
extern const bfd_target ecoff_little_vec;
extern const bfd_target ecoffalpha_little_vec;
extern const bfd_target go32coff_vec;
extern const bfd_target go32stubbedcoff_vec;
extern const bfd_target h8300coff_vec;
extern const bfd_target h8500coff_vec;
extern const bfd_target host_aout_vec;
extern const bfd_target hp300bsd_vec;
extern const bfd_target hp300hpux_vec;
extern const bfd_target som_vec;
extern const bfd_target i386aout_vec;
extern const bfd_target i386bsd_vec;
extern const bfd_target i386coff_vec;
extern const bfd_target i386dynix_vec;
extern const bfd_target i386freebsd_vec;
extern const bfd_target i386os9k_vec;
extern const bfd_target i386coff_vec;
extern const bfd_target bfd_powerpc_pe_vec;
extern const bfd_target bfd_powerpcle_pe_vec;
extern const bfd_target bfd_powerpc_pei_vec;
extern const bfd_target bfd_powerpcle_pei_vec;
extern const bfd_target i386pe_vec;
extern const bfd_target i386pei_vec;
extern const bfd_target go32coff_vec;
extern const bfd_target go32stubbedcoff_vec;
extern const bfd_target i386linux_vec;
extern const bfd_target i386lynx_aout_vec;
extern const bfd_target i386lynx_coff_vec;
extern const bfd_target i386mach3_vec;
extern const bfd_target i386msdos_vec;
extern const bfd_target i386netbsd_vec;
extern const bfd_target i386os9k_vec;
extern const bfd_target i386pe_vec;
extern const bfd_target i386pei_vec;
extern const bfd_target i860coff_vec;
extern const bfd_target icoff_big_vec;
extern const bfd_target icoff_little_vec;
extern const bfd_target ieee_vec;
extern const bfd_target m68k4knetbsd_vec;
extern const bfd_target m68kaux_coff_vec;
extern const bfd_target m68kcoff_vec;
extern const bfd_target m68kcoffun_vec;
@ -590,52 +608,59 @@ extern const bfd_target m68klynx_aout_vec;
extern const bfd_target m68klynx_coff_vec;
extern const bfd_target m68knetbsd_vec;
extern const bfd_target m68ksysvcoff_vec;
extern const bfd_target m68k4knetbsd_vec;
extern const bfd_target m88kbcs_vec;
extern const bfd_target m88kmach3_vec;
extern const bfd_target mipselnetbsd_vec;
extern const bfd_target mipslpe_vec;
extern const bfd_target mipslpei_vec;
extern const bfd_target mcore_pe_big_vec;
extern const bfd_target mcore_pe_little_vec;
extern const bfd_target mcore_pei_big_vec;
extern const bfd_target mcore_pei_little_vec;
extern const bfd_target mipselnetbsd_vec;
extern const bfd_target mipslpe_vec;
extern const bfd_target mipslpei_vec;
extern const bfd_target newsos3_vec;
extern const bfd_target nlm32_i386_vec;
extern const bfd_target nlm32_sparc_vec;
extern const bfd_target nlm32_alpha_vec;
extern const bfd_target nlm32_i386_vec;
extern const bfd_target nlm32_powerpc_vec;
extern const bfd_target pc532netbsd_vec;
extern const bfd_target nlm32_sparc_vec;
extern const bfd_target oasys_vec;
extern const bfd_target pc532machaout_vec;
extern const bfd_target pc532netbsd_vec;
extern const bfd_target pmac_xcoff_vec;
extern const bfd_target ppcboot_vec;
extern const bfd_target riscix_vec;
extern const bfd_target pmac_xcoff_vec;
extern const bfd_target rs6000coff64_vec;
extern const bfd_target rs6000coff_vec;
extern const bfd_target shcoff_vec;
extern const bfd_target shlcoff_vec;
extern const bfd_target shcoff_small_vec;
extern const bfd_target shcoff_vec;
extern const bfd_target shlcoff_small_vec;
extern const bfd_target shlcoff_vec;
extern const bfd_target shlpe_vec;
extern const bfd_target shlpei_vec;
extern const bfd_target som_vec;
extern const bfd_target sparccoff_vec;
extern const bfd_target sparcle_aout_vec;
extern const bfd_target sparclinux_vec;
extern const bfd_target sparclynx_aout_vec;
extern const bfd_target sparclynx_coff_vec;
extern const bfd_target sparcnetbsd_vec;
extern const bfd_target sparccoff_vec;
extern const bfd_target sunos_big_vec;
extern const bfd_target tekhex_vec;
extern const bfd_target tic30_aout_vec;
extern const bfd_target tic30_coff_vec;
extern const bfd_target tic54x_coff0_beh_vec;
extern const bfd_target tic54x_coff0_vec;
extern const bfd_target tic54x_coff1_beh_vec;
extern const bfd_target tic54x_coff1_vec;
extern const bfd_target tic54x_coff2_beh_vec;
extern const bfd_target tic54x_coff2_vec;
extern const bfd_target tic80coff_vec;
extern const bfd_target vaxcoff_vec;
extern const bfd_target vaxnetbsd_vec;
extern const bfd_target versados_vec;
extern const bfd_target vms_alpha_vec;
extern const bfd_target vms_vax_vec;
extern const bfd_target we32kcoff_vec;
extern const bfd_target w65_vec;
extern const bfd_target we32kcoff_vec;
extern const bfd_target z8kcoff_vec;
/* srec is always included. */
@ -687,6 +712,11 @@ static const bfd_target * const _bfd_target_vector[] = {
&b_out_vec_big_host,
&b_out_vec_little_host,
&bfd_efi_app_ia32_vec,
#ifdef BFD64
&bfd_efi_app_ia64_vec,
#endif
/* This, and other vectors, may not be used in any *.mt configuration.
But that does not mean they are unnecessary. If configured with
--enable-targets=all, objdump or gdb should be able to examine
@ -694,6 +724,10 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_big_generic_vec,
#ifdef BFD64
&bfd_elf64_alpha_vec,
&bfd_elf64_hppa_vec,
&bfd_elf64_hppa_linux_vec,
&bfd_elf64_ia64_little_vec,
&bfd_elf64_ia64_big_vec,
#endif
&bfd_elf32_avr_vec,
&bfd_elf32_bigarc_vec,
@ -703,14 +737,19 @@ static const bfd_target * const _bfd_target_vector[] = {
#ifdef BFD64
&bfd_elf64_bigmips_vec,
#endif
&bfd_elf32_cris_vec,
&bfd_elf32_us_cris_vec,
&bfd_elf32_d10v_vec,
&bfd_elf32_d30v_vec,
#if 0
&bfd_elf32_hppa_vec,
#endif
&bfd_elf32_hppa_linux_vec,
&bfd_elf32_i370_vec,
&bfd_elf32_i386_vec,
#ifdef BFD64
&bfd_elf64_x86_64_vec,
#endif
&bfd_elf32_i860_vec,
&bfd_elf32_i860_little_vec,
&bfd_elf32_i960_vec,
&bfd_elf32_little_generic_vec,
&bfd_elf32_littlearc_vec,
@ -723,6 +762,8 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_m32r_vec,
&bfd_elf32_mn10200_vec,
&bfd_elf32_mn10300_vec,
&bfd_elf32_m68hc11_vec,
&bfd_elf32_m68hc12_vec,
&bfd_elf32_m68k_vec,
&bfd_elf32_m88k_vec,
&bfd_elf32_sparc_vec,
@ -734,6 +775,8 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_fr30_vec,
&bfd_elf32_mcore_big_vec,
&bfd_elf32_mcore_little_vec,
&bfd_elf32_tradbigmips_vec,
&bfd_elf32_tradlittlemips_vec,
#ifdef BFD64 /* No one seems to use this. */
&bfd_elf64_big_generic_vec,
&bfd_elf64_little_generic_vec,
@ -744,6 +787,8 @@ static const bfd_target * const _bfd_target_vector[] = {
/* We don't include cisco_core_*_vec. Although it has a magic number,
the magic number isn't at the beginning of the file, and thus
might spuriously match other kinds of files. */
&cris_aout_vec,
#ifdef BFD64
&demo_64_vec, /* Only compiled if host has long-long support */
#endif
@ -848,10 +893,13 @@ static const bfd_target * const _bfd_target_vector[] = {
&riscix_vec,
#endif
#if 0
/* This has the same magic number as RS/6000. */
/* This has the same magic number as RS/6000. */
&pmac_xcoff_vec,
#endif
&rs6000coff_vec,
#ifdef BFD64
&rs6000coff64_vec,
#endif
&ppcboot_vec,
&shcoff_vec,
&shlcoff_vec,
@ -866,6 +914,12 @@ static const bfd_target * const _bfd_target_vector[] = {
&aout0_big_vec,
&tic30_aout_vec,
&tic30_coff_vec,
&tic54x_coff0_vec,
&tic54x_coff0_beh_vec,
&tic54x_coff1_vec,
&tic54x_coff1_beh_vec,
&tic54x_coff2_vec,
&tic54x_coff2_beh_vec,
&tic80coff_vec,
&vaxcoff_vec,
&vaxnetbsd_vec,
@ -1037,7 +1091,7 @@ DESCRIPTION
variable to "default" will cause the first entry in the target
list to be returned, and "target_defaulted" will be set in the
BFD. This causes <<bfd_check_format>> to loop over all the
targets to find the one that matches the file being read.
targets to find the one that matches the file being read.
*/
const bfd_target *
@ -1120,7 +1174,7 @@ FUNCTION
bfd_seach_for_target
SYNOPSIS
const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *);
const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *);
DESCRIPTION
Return a pointer to the first transfer vector in the list of

View File

@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define BYTES_IN_WORD 4
#undef TARGET_IS_BIG_ENDIAN_P

View File

@ -219,7 +219,7 @@ make_tempname (filename)
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
char *bslash = strrchr (filename, '\\');
if (bslash > slash)
if (slash == NULL || (bslash != NULL && bslash > slash))
slash = bslash;
if (slash == NULL && filename[0] != '\0' && filename[1] == ':')
slash = filename + 1;

View File

@ -1,5 +1,5 @@
/* objcopy.c -- copy object file from input to output, optionally massaging it.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -215,6 +215,8 @@ static boolean weaken = false;
#define OPTION_STRIP_UNNEEDED (OPTION_SET_START + 1)
#define OPTION_WEAKEN (OPTION_STRIP_UNNEEDED + 1)
#define OPTION_REDEFINE_SYM (OPTION_WEAKEN + 1)
#define OPTION_SREC_LEN (OPTION_REDEFINE_SYM + 1)
#define OPTION_SREC_FORCES3 (OPTION_SREC_LEN + 1)
/* Options to handle if running as "strip". */
@ -290,6 +292,8 @@ static struct option copy_options[] =
{"weaken", no_argument, 0, OPTION_WEAKEN},
{"weaken-symbol", required_argument, 0, 'W'},
{"redefine-sym", required_argument, 0, OPTION_REDEFINE_SYM},
{"srec-len", required_argument, 0, OPTION_SREC_LEN},
{"srec-forceS3", no_argument, 0, OPTION_SREC_FORCES3},
{0, no_argument, 0, 0}
};
@ -301,6 +305,14 @@ extern char *program_name;
-1 means if we should use argv[0] to decide. */
extern int is_strip;
/* The maximum length of an S record. This variable is declared in srec.c
and can be modified by the --srec-len parameter. */
extern unsigned int Chunk;
/* Restrict the generation of Srecords to type S3 only.
This variable is declare in bfd/srec.c and can be toggled
on by the --srec-forceS3 command line switch. */
extern boolean S3Forced;
static void
copy_usage (stream, exit_status)
@ -350,6 +362,8 @@ copy_usage (stream, exit_status)
--change-leading-char Force output format's leading character style\n\
--remove-leading-char Remove leading character from global symbols\n\
--redefine-sym <old>=<new> Redefine symbol name <old> to <new>\n\
--srec-len <number> Restrict the length of generated Srecords\n\
--srec-forceS3 Restrict the type of generated Srecords to S3\n\
-v --verbose List all object files modified\n\
-V --version Display this program's version number\n\
-h --help Display this output\n\
@ -557,6 +571,8 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
{
register asymbol **from = isyms, **to = osyms;
long src_count = 0, dst_count = 0;
int relocatable = (abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC))
== HAS_RELOC;
for (; src_count < symcount; src_count++)
{
@ -611,6 +627,9 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
&& ((*bfd_get_section (sym)->symbol_ptr_ptr)->flags
& BSF_KEEP) != 0))
keep = 1;
else if (relocatable /* Relocatable file. */
&& (flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
keep = 1;
else if ((flags & BSF_GLOBAL) != 0 /* Global symbol. */
|| (flags & BSF_WEAK) != 0
|| bfd_is_und_section (bfd_get_section (sym))
@ -746,6 +765,13 @@ copy_object (ibfd, obfd)
long symsize;
PTR dhandle;
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
&& ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
&& obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
{
fatal (_("Unable to change endianness of input file(s)"));
return;
}
if (!bfd_set_format (obfd, bfd_get_format (ibfd)))
RETURN_NONFATAL (bfd_get_filename (obfd));
@ -1246,7 +1272,7 @@ setup_section (ibfd, isection, obfdarg)
bfd_vma vma;
bfd_vma lma;
flagword flags;
char *err;
const char *err;
if ((bfd_get_section_flags (ibfd, isection) & SEC_DEBUGGING) != 0
&& (strip_symbols == STRIP_DEBUG
@ -1269,7 +1295,7 @@ setup_section (ibfd, isection, obfdarg)
if (osection == NULL)
{
err = "making";
err = _("making");
goto loser;
}
@ -1278,7 +1304,7 @@ setup_section (ibfd, isection, obfdarg)
size = (size + interleave - 1) / interleave;
if (! bfd_set_section_size (obfd, osection, size))
{
err = "size";
err = _("size");
goto loser;
}
@ -1292,7 +1318,7 @@ setup_section (ibfd, isection, obfdarg)
if (! bfd_set_section_vma (obfd, osection, vma))
{
err = "vma";
err = _("vma");
goto loser;
}
@ -1318,7 +1344,7 @@ setup_section (ibfd, isection, obfdarg)
bfd_section_alignment (ibfd, isection))
== false)
{
err = "alignment";
err = _("alignment");
goto loser;
}
@ -1327,7 +1353,7 @@ setup_section (ibfd, isection, obfdarg)
flags = p->flags | (flags & SEC_HAS_CONTENTS);
if (!bfd_set_section_flags (obfd, osection, flags))
{
err = "flags";
err = _("flags");
goto loser;
}
@ -1341,7 +1367,7 @@ setup_section (ibfd, isection, obfdarg)
from the input section to the output section. */
if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection))
{
err = "private data";
err = _("private data");
goto loser;
}
@ -1687,7 +1713,7 @@ strip_main (argc, argv)
break;
case 'S':
case 'g':
case 'd': /* NetBSD, historic BSD strip */
case 'd': /* Historic BSD alias for -g. Used by early NetBSD. */
strip_symbols = STRIP_DEBUG;
break;
case OPTION_STRIP_UNNEEDED:
@ -2124,6 +2150,14 @@ copy_main (argc, argv)
set_start_set = true;
break;
case OPTION_SREC_LEN:
Chunk = parse_vma (optarg, "--srec-len");
break;
case OPTION_SREC_FORCES3:
S3Forced = true;
break;
case 0:
break; /* we've been given a long option */

View File

@ -255,7 +255,9 @@ usage (stream, status)
-EL --endian=little Assume little endian format when disassembling\n\
--file-start-context Include context from start of file (with -S)\n\
-l, --line-numbers Include line numbers and filenames in output\n\
-C, --demangle Decode mangled/processed symbol names\n\
-C, --demangle[=STYLE] Decode mangled/processed symbol names\n\
The STYLE, if specified, can be `auto', 'gnu',\n\
'lucid', 'arm', 'hp', 'edg', or 'gnu-new-abi'\n\
-w, --wide Format output for more than 80 columns\n\
-z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n\
--start-address=ADDR Only process data whoes address is >= ADDR\n\
@ -288,7 +290,7 @@ static struct option long_options[]=
{"architecture", required_argument, NULL, 'm'},
{"archive-headers", no_argument, NULL, 'a'},
{"debugging", no_argument, NULL, 'g'},
{"demangle", no_argument, NULL, 'C'},
{"demangle", optional_argument, NULL, 'C'},
{"disassemble", no_argument, NULL, 'd'},
{"disassemble-all", no_argument, NULL, 'D'},
{"disassembler-options", required_argument, NULL, 'M'},
@ -371,6 +373,8 @@ dump_section_header (abfd, section, ignored)
PF (SEC_NEVER_LOAD, "NEVER_LOAD");
PF (SEC_EXCLUDE, "EXCLUDE");
PF (SEC_SORT_ENTRIES, "SORT_ENTRIES");
PF (SEC_BLOCK, "BLOCK");
PF (SEC_CLINK, "CLINK");
PF (SEC_SMALL_DATA, "SMALL_DATA");
PF (SEC_SHARED, "SHARED");
@ -1354,13 +1358,15 @@ disassemble_bytes (info, disassemble_fn, insns, data,
info->bytes_per_line = 0;
info->bytes_per_chunk = 0;
#ifdef DISASSEMBLER_NEEDS_RELOCS
/* FIXME: This is wrong. It tests the number of octets
in the last instruction, not the current one. */
if (*relppp < relppend
&& (**relppp)->address >= addr_offset
&& (**relppp)->address < addr_offset + octets / opb)
&& (**relppp)->address <= addr_offset + octets / opb)
info->flags = INSN_HAS_RELOC;
else
#endif
info->flags = 0;
octets = (*disassemble_fn) (section->vma + addr_offset, info);
@ -1500,12 +1506,20 @@ disassemble_bytes (info, disassemble_fn, insns, data,
need_nl = true;
}
if (dump_reloc_info
&& (section->flags & SEC_RELOC) != 0)
if ((section->flags & SEC_RELOC) != 0
#ifndef DISASSEMBLER_NEEDS_RELOCS
&& dump_reloc_info
#endif
)
{
while ((*relppp) < relppend
&& ((**relppp)->address >= (bfd_vma) addr_offset
&& (**relppp)->address < (bfd_vma) addr_offset + octets / opb))
#ifdef DISASSEMBLER_NEEDS_RELOCS
if (! dump_reloc_info)
++(*relppp);
else
#endif
{
arelent *q;
@ -1661,8 +1675,11 @@ disassemble_data (abfd)
if (only != (char *) NULL && strcmp (only, section->name) != 0)
continue;
if (dump_reloc_info
&& (section->flags & SEC_RELOC) != 0)
if ((section->flags & SEC_RELOC) != 0
#ifndef DISASSEMBLER_NEEDS_RELOCS
&& dump_reloc_info
#endif
)
{
long relsize;
@ -2631,7 +2648,7 @@ display_target_list ()
char *dummy_name;
int t;
dummy_name = choose_temp_base ();
dummy_name = make_temp_file (NULL);
for (t = 0; bfd_target_vector[t]; t++)
{
const bfd_target *p = bfd_target_vector[t];
@ -2685,7 +2702,7 @@ display_info_table (first, last)
printf ("%s ", bfd_target_vector[t]->name);
putchar ('\n');
dummy_name = choose_temp_base ();
dummy_name = make_temp_file (NULL);
for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0)
{
@ -2831,6 +2848,17 @@ main (argc, argv)
break;
case 'C':
do_demangle = true;
if (optarg != NULL)
{
enum demangling_styles style;
style = cplus_demangle_name_to_style (optarg);
if (style == unknown_demangling)
fatal (_("unknown demangling style `%s'"),
optarg);
cplus_demangle_set_style (style);
}
break;
case 'w':
wide_output = true;

View File

@ -1,6 +1,6 @@
.\" Copyright (c) 1991 Free Software Foundation
.\" Copyright (c) 1991, 2000 Free Software Foundation
.\" See section COPYING for conditions for redistribution
.TH size 1 "5 November 1991" "cygnus support" "GNU Development Tools"
.TH size 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools"
.de BP
.sp
.ti \-.2i
@ -148,19 +148,377 @@ entry in
.BR objdump ( 1 ).
.SH COPYING
Copyright (c) 1991 Free Software Foundation, Inc.
Copyright (c) 1991, 2000 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
.PP
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
.PP
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
This document is distributed under the terms of the GNU Free
Documentation License, version 1.1. That license is described in the
sources for this manual page, but it is not displayed here in order to
make this manual more consise. Copies of this license can also be
obtained from: http://www.gnu.org/copyleft/.
\" .SH 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.
\" .PP
\" 0. PREAMBLE
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 1. APPLICABILITY AND DEFINITIONS
\" .PP
\" 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".
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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".
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 2. VERBATIM COPYING
\" .PP
\" 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.
\" .PP
\" You may also lend copies, under the same conditions stated above, and
\" you may publicly display copies.
\" .PP
\" 3. COPYING IN QUANTITY
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 4. MODIFICATIONS
\" .PP
\" 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:
\" .PP
\" 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.
\" .PP
\" 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).
\" .PP
\" C. State on the Title page the name of the publisher of the
\" Modified Version, as the publisher.
\" .PP
\" D. Preserve all the copyright notices of the Document.
\" .PP
\" E. Add an appropriate copyright notice for your modifications
\" adjacent to the other copyright notices.
\" .PP
\" 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.
\" Preserve in that license notice the full lists of Invariant Sections
\" and required Cover Texts given in the Document's license notice.
\" .PP
\" H. Include an unaltered copy of this License.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" M. Delete any section entitled "Endorsements". Such a section
\" may not be included in the Modified Version.
\" .PP
\" N. Do not retitle any existing section as "Endorsements"
\" or to conflict in title with any Invariant Section.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 5. COMBINING DOCUMENTS
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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."
\" .PP
\" 6. COLLECTIONS OF DOCUMENTS
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 7. AGGREGATION WITH INDEPENDENT WORKS
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 8. TRANSLATION
\" .PP
\" 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.
\" .PP
\" 9. TERMINATION
\" .PP
\" 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.
\" .PP
\" 10. FUTURE REVISIONS OF THIS LICENSE
\" .PP
\" 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/.
\" .PP
\" 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.
\" .PP
\" ADDENDUM: How to use this License for your documents
\" .PP
\" 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:
\" .PP
\" 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".
\" .PP
\" 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.
\" .PP
\" 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.

View File

@ -80,8 +80,10 @@ usage (stream, status)
int status;
{
fprintf (stream, _("\
Usage: %s [-ABdotxV] [--format=berkeley|sysv] [--radix=8|10|16]\n\
[--target=bfdname] [--version] [--help] [file...]\n"), program_name);
Usage: %s [-A | --format=sysv | -B | --format=berkeley]\n\
[-o | --radix=8 | -d | --radix=10 | -h | --radix=16]\n\
[-V | --version] [--target=bfdname] [--help] [-t] [file...]\n"),
program_name);
#if BSD_DEFAULT
fputs (_("default is --format=berkeley\n"), stream);
#else
@ -123,7 +125,7 @@ main (argc, argv)
bfd_init ();
set_default_bfd_target ();
while ((c = getopt_long (argc, argv, "ABVdotwx", long_options,
while ((c = getopt_long (argc, argv, "ABVdfotwx", long_options,
(int *) 0)) != EOF)
switch (c)
{
@ -192,6 +194,16 @@ main (argc, argv)
case 't':
show_totals = 1;
break;
case 'f': /* FIXME : For sysv68, `-f' means `full format', i.e.
`[fname:] M(.text) + N(.data) + O(.bss) + P(.comment) = Q'
where `fname: ' appears only if there are >= 2 input files,
and M, N, O, P, Q are expressed in decimal by default,
hexa or octal if requested by `-x' or `-o'.
Just to make things interesting, Solaris also accepts -f,
which prints out the size of each allocatable section, the
name of the section, and the total of the section sizes. */
/* For the moment, accept `-f' silently, and ignore it. */
break;
case 'w':
case 0:
break;

View File

@ -1,6 +1,6 @@
.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation
.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation
.\" See section COPYING for conditions for redistribution
.TH strip 1 "5 November 1991" "cygnus support" "GNU Development Tools"
.TH strip 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools"
.de BP
.sp
.ti \-.2i
@ -169,19 +169,377 @@ entry in
Roland H. Pesch (October 1991).
.SH COPYING
Copyright (c) 1991 Free Software Foundation, Inc.
Copyright (c) 1991, 2000 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
.PP
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
.PP
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be included in
translations approved by the Free Software Foundation instead of in
the original English.
This document is distributed under the terms of the GNU Free
Documentation License, version 1.1. That license is described in the
sources for this manual page, but it is not displayed here in order to
make this manual more consise. Copies of this license can also be
obtained from: http://www.gnu.org/copyleft/.
\" .SH 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.
\" .PP
\" 0. PREAMBLE
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 1. APPLICABILITY AND DEFINITIONS
\" .PP
\" 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".
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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".
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 2. VERBATIM COPYING
\" .PP
\" 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.
\" .PP
\" You may also lend copies, under the same conditions stated above, and
\" you may publicly display copies.
\" .PP
\" 3. COPYING IN QUANTITY
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 4. MODIFICATIONS
\" .PP
\" 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:
\" .PP
\" 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.
\" .PP
\" 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).
\" .PP
\" C. State on the Title page the name of the publisher of the
\" Modified Version, as the publisher.
\" .PP
\" D. Preserve all the copyright notices of the Document.
\" .PP
\" E. Add an appropriate copyright notice for your modifications
\" adjacent to the other copyright notices.
\" .PP
\" 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.
\" Preserve in that license notice the full lists of Invariant Sections
\" and required Cover Texts given in the Document's license notice.
\" .PP
\" H. Include an unaltered copy of this License.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" M. Delete any section entitled "Endorsements". Such a section
\" may not be included in the Modified Version.
\" .PP
\" N. Do not retitle any existing section as "Endorsements"
\" or to conflict in title with any Invariant Section.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 5. COMBINING DOCUMENTS
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 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."
\" .PP
\" 6. COLLECTIONS OF DOCUMENTS
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 7. AGGREGATION WITH INDEPENDENT WORKS
\" .PP
\" 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.
\" .PP
\" 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.
\" .PP
\" 8. TRANSLATION
\" .PP
\" 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.
\" .PP
\" 9. TERMINATION
\" .PP
\" 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.
\" .PP
\" 10. FUTURE REVISIONS OF THIS LICENSE
\" .PP
\" 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/.
\" .PP
\" 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.
\" .PP
\" ADDENDUM: How to use this License for your documents
\" .PP
\" 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:
\" .PP
\" 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".
\" .PP
\" 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.
\" .PP
\" 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.

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
version='2000-09-05'
timestamp='2001-03-16'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -32,30 +32,41 @@ version='2000-09-05'
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of this system.
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit"
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case "$1" in
--version | --vers* | -V )
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
@ -64,9 +75,7 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
exec >&2
echo "$me: invalid option $1"
echo "$help"
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
@ -78,19 +87,30 @@ if test $# != 0; then
exit 1
fi
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
fi
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int dummy(){}" > $dummy.c
for c in cc gcc c89 ; do
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
if test $? = 0 ; then
CC_FOR_BUILD="$c"; break
fi
done
rm -f $dummy.c $dummy.o $dummy.rel
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
@ -100,12 +120,9 @@ fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@ -227,7 +244,7 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:*)
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
@ -363,7 +380,7 @@ EOF
EOF
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm $dummy.c $dummy && exit 0
&& rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
@ -417,6 +434,14 @@ EOF
i?86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >$dummy.c
@ -430,7 +455,7 @@ EOF
exit(0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
@ -439,9 +464,9 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@ -449,7 +474,7 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
@ -475,10 +500,28 @@ EOF
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
case "${HPUX_REV}" in
11.[0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
esac ;;
esac
fi ;;
esac
if [ "${HP_ARCH}" = "" ]; then
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
@ -513,11 +556,16 @@ EOF
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
fi ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
@ -544,7 +592,7 @@ EOF
exit (0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
@ -608,23 +656,24 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@ -673,57 +722,38 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
*ia64)
echo "${UNAME_MACHINE}-unknown-linux"
exit 0
;;
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
elf_i?86)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32ppc | elf32ppclinux)
# Determine Lib Version
cat >$dummy.c <<EOF
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
;;
ppc:Linux:*:*)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
@ -736,129 +766,127 @@ main(argc, argv)
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unkown\n");
printf("unknown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then LIBC="libc1" ; fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0 ;;
alpha:Linux:*:*)
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0) UNAME_MACHINE="alpha" ;;
1-0) UNAME_MACHINE="alphaev5" ;;
1-1) UNAME_MACHINE="alphaev56" ;;
1-101) UNAME_MACHINE="alphapca56" ;;
2-303) UNAME_MACHINE="alphaev6" ;;
2-307) UNAME_MACHINE="alphaev67" ;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
LIBC="libc1"
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit 0 ;;
i?86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_supported_emulations=`cd /; ld --help 2>&1 \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
shelf_linux)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
elf_i?86)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
elif test "${UNAME_MACHINE}" = "s390"; then
echo s390-ibm-linux && exit 0
elif test "${UNAME_MACHINE}" = "x86_64"; then
echo x86_64-unknown-linux-gnu && exit 0
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@ -882,10 +910,10 @@ EOF
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
fi ;;
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
@ -962,7 +990,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@ -985,9 +1013,12 @@ EOF
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
@ -1067,6 +1098,9 @@ EOF
NSR-[KW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
@ -1084,6 +1118,29 @@ EOF
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
i?86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@ -1175,11 +1232,24 @@ main ()
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
@ -1190,7 +1260,7 @@ main ()
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
@ -1226,8 +1296,9 @@ fi
cat >&2 <<EOF
$0: unable to guess system type
The $version version of this script cannot recognize your system type.
Please download the most up to date version of the config scripts:
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
@ -1236,7 +1307,7 @@ send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess version = $version
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
@ -1263,7 +1334,7 @@ exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "version='"
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
version='2000-09-11'
timestamp='2001-03-19'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -60,16 +60,30 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit"
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case "$1" in
--version | --vers* | -V )
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
@ -78,9 +92,7 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
exec >&2
echo "$me: invalid option $1"
echo "$help"
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
@ -105,7 +117,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu*)
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@ -203,22 +215,25 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | armv[2345] | armv[345][lb] | pyramid | mn10200 | mn10300 | tron | a29k \
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
| pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| hppa64 \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | sh[34] \
| powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| 1750a | dsp16xx | pdp10 | pdp11 \
| mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | d30v | fr30 | avr)
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
| pj | pjl | h8500)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
@ -226,7 +241,7 @@ case $basic_machine in
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
;;
# We use `pc' rather than `unknown'
@ -243,26 +258,28 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | s390-* | sv1-* | t3e-* \
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
| [cjt]90-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-*)
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@ -353,8 +370,8 @@ case $basic_machine in
basic_machine=cray2-cray
os=-unicos
;;
[ctj]90-cray)
basic_machine=c90-cray
[cjt]90)
basic_machine=${basic_machine}-cray
os=-unicos
;;
crds | unos)
@ -410,6 +427,10 @@ case $basic_machine in
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@ -509,18 +530,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
i[34567]86-pw32 | pw32)
basic_machine=i586-unknown
os=-pw32
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@ -546,6 +555,10 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
@ -576,7 +589,7 @@ case $basic_machine in
os=-coff
;;
msdos)
basic_machine=i386-unknown
basic_machine=i386-pc
os=-msdos
;;
mvs)
@ -636,6 +649,10 @@ case $basic_machine in
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
@ -671,28 +688,28 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexen)
pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
basic_machine=i686-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexen-*)
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
@ -707,6 +724,10 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@ -897,6 +918,10 @@ case $basic_machine in
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
@ -904,7 +929,7 @@ case $basic_machine in
basic_machine=we32k-att
;;
sh3 | sh4)
base_machine=sh-unknown
basic_machine=sh-unknown
;;
sparc | sparcv9)
basic_machine=sparc-sun
@ -987,7 +1012,8 @@ case $os in
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32*)
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1085,7 +1111,7 @@ case $os in
-xenix)
os=-xenix
;;
-*mint | -*MiNT)
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
@ -1119,6 +1145,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
@ -1227,7 +1256,7 @@ case $basic_machine in
*-masscomp)
os=-rtu
;;
f301-fujitsu)
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
@ -1305,7 +1334,7 @@ case $basic_machine in
-mpw* | -macos*)
vendor=apple
;;
-*mint | -*MiNT)
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
esac
@ -1318,7 +1347,7 @@ exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "version='"
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:

View File

@ -47,10 +47,20 @@ if [ "${enable_gdbgui}" = "yes" ] ; then
host_libs="${host_libs} libgui"
fi
# Set up configure/Makefile variables if libstdc++-v3 is to be built.
if [ "${enable_libstdcxx_v3}" = "yes" ] && test -d $srcdir/libstdc++-v3; then
libstdcxx_version="target-libstdc++-v3"
# Don't use libstdc++-v3's flags to configure/build itself.
libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) cat $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/libstdc++.INC 2>/dev/null || : ;; esac` -L$$r/$(TARGET_SUBDIR)/libstd++-v3/src -L$$r/$(TARGET_SUBDIR)/libstd++-v3/src/.libs'
else
libstdcxx_version="target-libio target-libstdc++"
libstdcxx_flags='-isystem $$s/libstdc++ -isystem $$s/libstdc++/std -isystem $$s/libstdc++/stl -isystem $$s/libio/ -isystem $$s/libio/stdio -L$$r/$(TARGET_SUBDIR)/libstdc++'
fi
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
# know that we are building the simulator.
host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip"
host_tools="byacc flex bison binutils ld gas gcc cgen sid sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip"
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
@ -58,10 +68,15 @@ host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr
target_libs="target-libiberty \
target-libgloss \
target-newlib \
target-libio \
target-librx \
target-libstdc++ \
target-libg++"
${libstdcxx_version} \
target-libf2c \
target-libchill \
target-libffi \
target-libjava \
target-zlib \
target-boehm-gc \
target-qthreads \
target-libobjc"
# these tools are built using the target libs, and are intended to run only
# in the target environment
@ -154,6 +169,9 @@ case "${host}" in
mips*-*-sysv*)
host_makefile_frag="${host_makefile_frag} config/mh-riscos"
;;
i370-ibm-opened*)
host_makefile_frag="${host_makefile_frag} config/mh-openedition"
;;
i[3456]86-*-sysv5*)
host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
;;
@ -291,6 +309,9 @@ if [ x${shared} = xyes ]; then
i370-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-i370pic"
;;
ia64-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-ia64pic"
;;
sparc64-*-*)
host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
;;
@ -524,7 +545,7 @@ case "${host}" in
noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
;;
i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext libffi"
;;
i[3456]86-*-mingw32*)
# noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
@ -542,18 +563,21 @@ case "${host}" in
ppc*-*-pe)
noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv"
;;
powerpc-*-beos*)
noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
;;
esac
case "${target}" in
*-*-netware)
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss target-libffi"
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
*-*-vxworks*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
;;
alpha*-dec-osf*)
# ld works, but does not support shared libraries. emacs doesn't
@ -562,13 +586,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
;;
alpha*-*-*vms*)
noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
;;
alpha*-*-linux*)
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
# linux has rx in libc
skipdirs="$skipdirs target-librx"
noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss target-libffi"
;;
alpha*-*-*)
# newlib is not 64 bit ready
@ -577,20 +595,20 @@ case "${target}" in
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
noconfigdirs="$noconfigdirs target-libjava target-libffi target-zlib"
noconfigdirs="$noconfigdirs target-boehm-gc target-qthreads target-examples"
noconfigdirs="$noconfigdirs target-librx target-libiberty texinfo send-pr"
noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr"
noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
noconfigdirs="$noconfigdirs expect dejagnu"
# the C++ libraries don't build on top of CE's C libraries
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio"
noconfigdirs="$noconfigdirs ${libstdcxx_version}"
skipdirs="$skipdirs target-newlib"
case "${host}" in
*-*-cygwin*) ;; # keep gdb and readline
*) noconfigdirs="$noconfigdirs gdb readline target-libio target-libstdc++ target-libg++"
*) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
;;
esac
;;
arc-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
arm-*-pe*)
noconfigdirs="$noconfigdirs target-libgloss"
@ -612,40 +630,55 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld"
;;
arm-*-oabi*)
noconfigdirs="$noconfigdirs target-libgloss"
;;
c4x-*-*)
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
thumb-*-coff)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
thumb-*-elf)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
thumb-*-oabi)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
strongarm-*-elf)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
strongarm-*-coff)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
xscale-*-elf)
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
xscale-*-coff)
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
thumb-*-pe)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
arm-*-riscix*)
noconfigdirs="$noconfigdirs ld target-libgloss"
noconfigdirs="$noconfigdirs ld target-libgloss target-libffi"
;;
c4x-*-*)
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
;;
c54x*-*-* | tic54x-*-*)
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi gcc gdb newlib"
;;
d10v-*-*)
noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio"
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
;;
d30v-*-*)
;;
@ -656,12 +689,13 @@ case "${target}" in
;;
h8300*-*-* | \
h8500-*-*)
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
;;
hppa*-*-*elf* | \
hppa*-*-linux-gnu* | \
hppa*-*-lites*)
# Do configure ld/binutils/gas for the above cases.
hppa*-*-lites* | \
hppa*64*-*-*)
# Do configure ld/binutils/gas for this case.
;;
hppa*-*-*)
# HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
@ -673,6 +707,10 @@ case "${target}" in
esac
noconfigdirs="$noconfigdirs ld shellutils"
;;
ia64*-*-elf*)
# No gdb support yet.
noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
;;
i[3456]86-*-coff | i[3456]86-*-elf)
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-libstub target-cygmon"
@ -680,11 +718,11 @@ case "${target}" in
;;
i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
# but don't build gdb
noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
noconfigdirs="$noconfigdirs gdb ${libstdcxx_version} target-libffi"
;;
i[3456]86-*-mingw32*)
target_configdirs="$target_configdirs target-mingw"
noconfigdirs="$noconfigdirs expect target-libgloss"
noconfigdirs="$noconfigdirs expect target-libgloss target-libffi"
# Can't build gdb for mingw32 if not native.
case "${host}" in
@ -695,7 +733,7 @@ case "${target}" in
;;
*-*-cygwin*)
target_configdirs="$target_configdirs target-libtermcap target-winsup"
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-gperf target-libgloss target-libffi"
# always build newlib.
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
@ -707,15 +745,15 @@ case "${target}" in
esac
;;
i[3456]86-*-pe)
noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss target-libffi"
;;
i[3456]86-*-sco3.2v5*)
# The linker does not yet know about weak symbols in COFF,
# and is not configured to handle mixed ELF and COFF.
noconfigdirs="$noconfigdirs ld target-libgloss"
noconfigdirs="$noconfigdirs ld target-libgloss target-libffi"
;;
i[3456]86-*-sco*)
noconfigdirs="$noconfigdirs gprof target-libgloss"
noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
;;
i[3456]86-*-solaris2*)
noconfigdirs="$noconfigdirs target-libgloss"
@ -727,7 +765,7 @@ case "${target}" in
*) ;;
esac
# but that's okay since emacs doesn't work anyway
noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss target-libffi"
;;
i[3456]86-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
@ -736,7 +774,10 @@ case "${target}" in
i[3456]86-*-netbsd*) # (a.out)
noconfigdirs="$noconfigdirs ld"
;;
m68k-*-elf*)
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-librx target-libg++ target-libstdc++ target-libio target-libf2c target-libchill target-zlib target-libobjc"
;;
m68k-*-elf*)
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
@ -751,13 +792,13 @@ case "${target}" in
noconfigdirs="$noconfigdirs gas ld"
;;
mn10200-*-*)
noconfigdirs="$noconfigdirs"
noconfigdirs="$noconfigdirs target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-libstub target-cygmon"
fi
;;
mn10300-*-*)
noconfigdirs="$noconfigdirs"
noconfigdirs="$noconfigdirs target-libffi"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
@ -771,18 +812,21 @@ case "${target}" in
# GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
# The symptom is that GDBtk 4.18 fails at startup with a segfault
# if linked by GNU ld, but not if linked by the native ld.
noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss ld"
noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss target-libffi ld"
use_gnu_ld=no
;;
powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
target_configdirs="$target_configdirs target-winsup"
noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv"
noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv target-libffi"
# always build newlib.
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
;;
# This is temporary until we can link against shared libraries
powerpcle-*-solaris*)
noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv"
noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv target-libffi"
;;
powerpc-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
;;
powerpc-*-eabi)
if [ x${is_cross_compiler} != xno ] ; then
@ -791,22 +835,21 @@ case "${target}" in
;;
rs6000-*-lynxos*)
# The CVS server code doesn't work on the RS/6000
# Newlib makes problems for libg++ in crosses.
noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
noconfigdirs="$noconfigdirs target-newlib gprof cvssrc target-libffi"
;;
rs6000-*-aix*)
# The configure and build of ld are currently disabled because
# GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
# The symptom is that GDBtk 4.18 fails at startup with a segfault
# if linked by GNU ld, but not if linked by the native ld.
noconfigdirs="$noconfigdirs gprof ld"
noconfigdirs="$noconfigdirs gprof target-libffi ld"
use_gnu_ld=no
;;
rs6000-*-*)
noconfigdirs="$noconfigdirs gprof"
noconfigdirs="$noconfigdirs gprof target-libffi"
;;
m68k-apollo-*)
noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss target-libffi"
;;
mips*-*-irix5*)
# The GNU linker does not support shared libraries.
@ -818,26 +861,21 @@ case "${target}" in
# emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss"
;;
mips*-*-linux*)
noconfigdirs="$noconfigdirs gprof"
# linux has rx in libc
skipdirs="$skipdirs target-librx"
;;
mips*-dec-bsd*)
noconfigdirs="$noconfigdirs gprof target-libgloss"
noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
;;
mips*-*-bsd*)
noconfigdirs="$noconfigdirs gprof target-libgloss"
noconfigdirs="$noconfigdirs gprof target-libgloss target-libffi"
;;
mipstx39-*-*)
noconfigdirs="$noconfigdirs gprof" # same as generic mips
noconfigdirs="$noconfigdirs gprof target-libffi" # same as generic mips
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
;;
mips*-*-*)
noconfigdirs="$noconfigdirs gprof"
noconfigdirs="$noconfigdirs gprof target-libffi"
;;
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss target-libffi"
;;
sh-*-*)
case "${host}" in
@ -846,7 +884,7 @@ case "${target}" in
i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
*) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
esac
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
sparc-*-elf*)
if [ x${is_cross_compiler} != xno ] ; then
@ -857,11 +895,13 @@ case "${target}" in
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-libstub target-cygmon"
fi
noconfigdirs="target-libffi"
;;
sparclite-*-*)
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
noconfigdirs="target-libffi"
;;
sparc-*-sunos4*)
if [ x${is_cross_compiler} != xno ] ; then
@ -875,19 +915,19 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld"
;;
v810-*-*)
noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss target-libffi"
;;
v850-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
v850e-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
v850ea-*-*)
noconfigdirs="$noconfigdirs target-libgloss"
noconfigdirs="$noconfigdirs target-libgloss target-libffi"
;;
vax-*-vms)
noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss target-libffi"
;;
vax-*-netbsdelf*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
@ -896,20 +936,16 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld target-newlib target-libgloss"
;;
vax-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
*-*-linux*)
# linux has rx in libc
skipdirs="$skipdirs target-librx"
noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
;;
*-*-lynxos*)
# Newlib makes problems for libg++ in crosses.
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libffi"
;;
*-*-macos* | \
*-*-mpw*)
# Macs want a resource compiler.
configdirs="$configdirs grez"
noconfigdirs="target-libffi"
;;
esac
@ -932,6 +968,55 @@ if [ x$with_gnu_as = xno ]; then
noconfigdirs="$noconfigdirs gas"
fi
# Figure out what language subdirectories are present.
# Look if the user specified --enable-languages="..."; if not, use
# the environment variable $LANGUAGES if defined. $LANGUAGES might
# go away some day.
if test x"${enable_languages+set}" != xset; then
if test x"${LANGUAGES+set}" = xset; then
enable_languages="`echo ${LANGUAGES} | tr ' ' ','`"
else
enable_languages=all
fi
else
if test x"${enable_languages}" = x; then
echo configure.in: --enable-languages needs at least one argument 1>&2
exit 1
fi
fi
subdirs=
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
case $lang in
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/gcc/[*]/config-lang.in) ;;
*)
lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
if test "x$lang_alias" = x
then
echo "$lang doesn't set \$language." 1>&2
exit 1
fi
case ${build_by_default},${enable_languages}, in
*,$lang_alias,*) add_this_lang=yes ;;
no,*) add_this_lang=no ;;
*,all,*) add_this_lang=yes ;;
*) add_this_lang=no ;;
esac
if test x"${add_this_lang}" = xyes; then
eval target_libs='"$target_libs "'\"$this_lang_libs\"
else
eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs\"
fi
;;
esac
done
# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
# $target_configdirs.
# If we have the source for $noconfigdirs entries, add them to $notsupp.
@ -1072,6 +1157,12 @@ if [ x${shared} = xyes ]; then
i[3456]86-*)
target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
;;
ia64-*)
target_makefile_frag="${target_makefile_frag} config/mt-ia64pic"
;;
powerpc*-*-aix*)
# We don't want -fPIC on AIX.
;;
powerpc*-*)
target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
;;
@ -1190,7 +1281,7 @@ fi
# provide a proper gxx_include_dir.
# Note, if you change the default, make sure to fix both here and in
# the gcc, libio, libstdc++ and libg++ subdirectories.
# the gcc, libio, and libstdc++ subdirectories.
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
gxx_include_dir=
if test -n "${with_gxx_include_dir}"; then
@ -1217,9 +1308,113 @@ else
gxx_include_dir=${gxx_include_dir}
fi
targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
FLAGS_FOR_TARGET=
case " $skipdirs " in
*" target-newlib "*) ;;
*)
case "$target" in
*-cygwin*)
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;;
esac
# If we're not building GCC, don't discard standard headers.
if test -d ${topsrcdir}/gcc; then
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc'
if test "${build}" != "${host}"; then
# On Canadian crosses, CC_FOR_TARGET will have already been set
# by `configure', so we won't have an opportunity to add -Bgcc/
# to it. This is right: we don't want to search that directory
# for binaries, but we want the header files in there, so add
# them explicitly.
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include'
# Someone might think of using the pre-installed headers on
# Canadian crosses, in case the installed compiler is not fully
# compatible with the compiler being built. In this case, it
# would be better to flag an error than risking having
# incompatible object files being constructed. We can't
# guarantee that an error will be flagged, but let's hope the
# compiler will do it, when presented with incompatible header
# files.
fi
fi
# If we're building newlib, use its generic headers last, but search
# for any libc-related directories first (so make it the last -B
# switch).
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include'
;;
esac
# On Canadian crosses, we'll be searching the right directories for
# the previously-installed cross compiler, so don't bother to add
# flags for directories within the install tree of the compiler
# being built; programs in there won't even run.
if test "${build}" = "${host}" && test -d ${topsrcdir}/gcc; then
# Search for pre-installed headers if nothing else fits.
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
fi
if test "x${use_gnu_ld}" = x && test "x${with_gnu_ld}" != xno &&
echo " ${configdirs} " | grep " ld " > /dev/null &&
test -d ${srcdir}/ld; then
# Arrange for us to find uninstalled linker scripts.
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld'
fi
if test "x${CC_FOR_TARGET+set}" = xset; then
:
elif test -d ${topsrcdir}/gcc; then
CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/'
elif test "$host" = "$target"; then
CC_FOR_TARGET='$(CC)'
else
CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
fi
# On Canadian crosses, configure reads CC_FOR_TARGET from Makefile,
# if Makefile exists. Prevent $(FLAGS_FOR_TARGET) from being duplicated.
case $CC_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
if test "x${CHILL_FOR_TARGET+set}" = xset; then
:
elif test -d ${topsrcdir}/gcc; then
CHILL_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/'
elif test "$host" = "$target"; then
CHILL_FOR_TARGET='$(CC)'
else
CHILL_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
fi
case $CHILL_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) CHILL_FOR_TARGET=$CHILL_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
if test "x${CXX_FOR_TARGET+set}" = xset; then
:
elif test -d ${topsrcdir}/gcc; then
CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
elif test "$host" = "$target"; then
CXX_FOR_TARGET='$(CXX)'
else
CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
fi
case $CXX_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,&,\\\&,g'`
targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
-e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
-e "s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%" \
-e "s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \
-e "s%^CHILL_FOR_TARGET[ ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \
-e "s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \
-e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
-e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
Makefile > Makefile.tem

View File

@ -63,7 +63,6 @@ enum reloc_type
#endif /* TC_SPARC or TC_A29K or TC_VAX */
#define __GNU_EXEC_MACROS__
#ifndef __STRUCT_EXEC_OVERRIDE__
@ -184,7 +183,6 @@ enum machine_type
sizeof (struct exec))
#endif
#ifndef N_DATOFF
#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text )
#endif
@ -318,7 +316,6 @@ struct reloc_ext_bytes
unsigned char r_addend[4];
};
#define RELOC_EXT_BITS_EXTERN_BIG 0x80
#define RELOC_EXT_BITS_EXTERN_LITTLE 0x01
@ -346,8 +343,6 @@ struct reloc_info_extended
/* The standard, old-fashioned, Berkeley compatible relocation struct */
#ifdef TC_I860
/* NOTE: three bits max, see struct reloc_info_i860.r_type */
enum i860_reloc_type
@ -363,7 +358,6 @@ enum highlow_type
NO_SPEC = 0, PAIR, HIGH, HIGHADJ,
};
struct reloc_info_i860
{
unsigned long r_address;
@ -382,7 +376,6 @@ struct reloc_info_i860
#endif /* TC_I860 */
struct reloc_std_bytes
{
unsigned char r_address[4];

View File

@ -17,7 +17,7 @@ the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
02111-1307, USA. */
#define OBJ_HEADER "obj-aout.h"
@ -102,7 +102,6 @@ const pseudo_typeS aout_pseudo_table[] =
{NULL, NULL, 0} /* end sentinel */
}; /* aout_pseudo_table */
#ifdef BFD_ASSEMBLER
/* Do NetBSD specific things to the symbols. This includes adding SIZE
@ -168,7 +167,7 @@ obj_aout_nbsd_frob_file()
void
obj_aout_frob_symbol (sym, punt)
symbolS *sym;
int *punt;
int *punt ATTRIBUTE_UNUSED;
{
flagword flags;
asection *sec;
@ -294,7 +293,7 @@ obj_aout_frob_file ()
#else /* ! BFD_ASSEMBLER */
/* Relocation. */
/* Relocation. */
/*
* emit_relocations()
@ -304,7 +303,7 @@ obj_aout_frob_file ()
void
obj_emit_relocations (where, fixP, segment_address_in_file)
char **where;
fixS *fixP; /* Fixup chain for this segment. */
fixS *fixP; /* Fixup chain for this segment. */
relax_addressT segment_address_in_file;
{
for (; fixP; fixP = fixP->fx_next)
@ -393,13 +392,13 @@ obj_emit_symbols (where, symbol_rootP)
for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
{
/* Used to save the offset of the name. It is used to point
to the string in memory but must be a file offset. */
to the string in memory but must be a file offset. */
register char *temp;
temp = S_GET_NAME (symbolP);
S_SET_OFFSET (symbolP, symbolP->sy_name_offset);
/* Any symbol still undefined and is not a dbg symbol is made N_EXT. */
/* Any symbol still undefined and is not a dbg symbol is made N_EXT. */
if (!S_IS_DEBUG (symbolP) && !S_IS_DEFINED (symbolP))
S_SET_EXTERNAL (symbolP);
@ -430,11 +429,11 @@ obj_emit_symbols (where, symbol_rootP)
static void
obj_aout_line (ignore)
int ignore;
int ignore ATTRIBUTE_UNUSED;
{
/* Assume delimiter is part of expression.
BSD4.2 as fails with delightful bug, so we
are not being incompatible here. */
are not being incompatible here. */
new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
demand_empty_rest_of_line ();
} /* obj_aout_line() */
@ -443,7 +442,7 @@ obj_aout_line (ignore)
static void
obj_aout_weak (ignore)
int ignore;
int ignore ATTRIBUTE_UNUSED;
{
char *name;
int c;
@ -476,7 +475,7 @@ obj_aout_weak (ignore)
static void
obj_aout_type (ignore)
int ignore;
int ignore ATTRIBUTE_UNUSED;
{
char *name;
int c;
@ -487,35 +486,32 @@ obj_aout_type (ignore)
c = get_symbol_end ();
sym = symbol_find_or_make (name);
*input_line_pointer = c;
if (sym != NULL)
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
{
++input_line_pointer;
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
if (*input_line_pointer == '@')
{
++input_line_pointer;
SKIP_WHITESPACE ();
if (*input_line_pointer == '@')
{
++input_line_pointer;
if (strncmp (input_line_pointer, "object", 6) == 0)
if (strncmp (input_line_pointer, "object", 6) == 0)
#ifdef BFD_ASSEMBLER
aout_symbol (symbol_get_bfdsym (sym))->other = 1;
aout_symbol (symbol_get_bfdsym (sym))->other = 1;
#else
S_SET_OTHER (sym, 1);
S_SET_OTHER (sym, 1);
#endif
else if (strncmp (input_line_pointer, "function", 8) == 0)
else if (strncmp (input_line_pointer, "function", 8) == 0)
#ifdef BFD_ASSEMBLER
aout_symbol (symbol_get_bfdsym (sym))->other = 2;
aout_symbol (symbol_get_bfdsym (sym))->other = 2;
#else
S_SET_OTHER (sym, 2);
S_SET_OTHER (sym, 2);
#endif
else if (strncmp (input_line_pointer, "label", 5) == 0)
else if (strncmp (input_line_pointer, "label", 5) == 0)
#ifdef BFD_ASSEMBLER
aout_symbol (symbol_get_bfdsym (sym))->other = 3;
aout_symbol (symbol_get_bfdsym (sym))->other = 3;
#else
S_SET_OTHER (sym, 3);
S_SET_OTHER (sym, 3);
#endif
}
}
}
@ -535,7 +531,7 @@ obj_crawl_symbol_chain (headers)
tc_crawl_symbol_chain (headers);
symbolPP = &symbol_rootP; /*->last symbol chain link. */
symbolPP = &symbol_rootP; /*->last symbol chain link. */
while ((symbolP = *symbolPP) != NULL)
{
if (symbolP->sy_mri_common)
@ -576,8 +572,7 @@ obj_crawl_symbol_chain (headers)
switch was passed to gas.
All other symbols are output. We complain if a deleted
symbol was marked external. */
symbol was marked external. */
if (!S_IS_REGISTER (symbolP)
&& (!S_GET_NAME (symbolP)
@ -593,11 +588,11 @@ obj_crawl_symbol_chain (headers)
end of each string */
if (!S_IS_STABD (symbolP))
{
/* Ordinary case. */
/* Ordinary case. */
symbolP->sy_name_offset = string_byte_count;
string_byte_count += strlen (S_GET_NAME (symbolP)) + 1;
}
else /* .Stabd case. */
else /* .Stabd case. */
symbolP->sy_name_offset = 0;
symbolPP = &symbolP->sy_next;
}
@ -609,7 +604,7 @@ obj_crawl_symbol_chain (headers)
register names... */
{
as_bad (_("Local symbol %s never defined."), decode_local_label_name (S_GET_NAME (symbolP)));
} /* oops. */
} /* oops. */
/* Unhook it from the chain */
*symbolPP = symbol_next (symbolP);
@ -660,7 +655,7 @@ obj_pre_write_hook (headers)
}
void
DEFUN_VOID (s_sect)
s_sect ()
{
/* Strip out the section name */
char *section_name;
@ -832,7 +827,14 @@ static void obj_aout_size(ignore)
static void aout_pop_insert PARAMS ((void));
static int obj_aout_s_get_other PARAMS ((symbolS *));
static void obj_aout_s_set_other PARAMS ((symbolS *, int));
static int obj_aout_s_get_desc PARAMS ((symbolS *));
static void obj_aout_s_set_desc PARAMS ((symbolS *, int));
static int obj_aout_s_get_type PARAMS ((symbolS *));
static void obj_aout_s_set_type PARAMS ((symbolS *, int));
static int obj_aout_separate_stab_sections PARAMS ((void));
static int obj_aout_sec_sym_ok_for_reloc PARAMS ((asection *));
static void obj_aout_process_stab PARAMS ((segT, int, const char *, int, int, int));
static void
aout_pop_insert ()
@ -847,6 +849,33 @@ obj_aout_s_get_other (sym)
return aout_symbol (symbol_get_bfdsym (sym))->other;
}
static void
obj_aout_s_set_other (sym, o)
symbolS *sym;
int o;
{
aout_symbol (symbol_get_bfdsym (sym))->other = o;
}
static int
obj_aout_sec_sym_ok_for_reloc (sec)
asection *sec ATTRIBUTE_UNUSED;
{
return obj_sec_sym_ok_for_reloc (sec);
}
static void
obj_aout_process_stab (seg, w, s, t, o, d)
segT seg ATTRIBUTE_UNUSED;
int w;
const char *s;
int t;
int o;
int d;
{
aout_process_stab (w, s, t, o, d);
}
static int
obj_aout_s_get_desc (sym)
symbolS *sym;
@ -854,30 +883,67 @@ obj_aout_s_get_desc (sym)
return aout_symbol (symbol_get_bfdsym (sym))->desc;
}
static void
obj_aout_s_set_desc (sym, d)
symbolS *sym;
int d;
{
aout_symbol (symbol_get_bfdsym (sym))->desc = d;
}
static int
obj_aout_s_get_type (sym)
symbolS *sym;
{
return aout_symbol (symbol_get_bfdsym (sym))->type;
}
static void
obj_aout_s_set_type (sym, t)
symbolS *sym;
int t;
{
aout_symbol (symbol_get_bfdsym (sym))->type = t;
}
static int
obj_aout_separate_stab_sections ()
{
return 0;
}
/* When changed, make sure these table entries match the single-format
definitions in obj-aout.h. */
const struct format_ops aout_format_ops =
{
bfd_target_aout_flavour,
1, /* dfl_leading_underscore */
0, /* emit_section_symbols */
0, /* begin */
0, /* app_file */
obj_aout_frob_symbol,
obj_aout_frob_file,
0, /* frob_file_before_adjust */
0, /* frob_file_after_relocs */
0, /* s_get_size */
0, /* s_set_size */
0, /* s_get_align */
0, /* s_set_align */
obj_aout_s_get_other,
obj_aout_s_set_other,
obj_aout_s_get_desc,
obj_aout_s_set_desc,
obj_aout_s_get_type,
obj_aout_s_set_type,
0, /* copy_symbol_attributes */
0, /* generate_asm_lineno */
0, /* process_stab */
0, /* sec_sym_ok_for_reloc */
obj_aout_process_stab,
obj_aout_separate_stab_sections,
0, /* init_stab_section */
obj_aout_sec_sym_ok_for_reloc,
aout_pop_insert,
0, /* ecoff_set_ext */
0, /* read_begin_hook */
0 /* symbol_new_hook */
};
#endif BFD_ASSEMBLER
/* end of obj-aout.c */

View File

@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
02111-1307, USA. */
/* Tag to validate a.out object file format processing */
#define OBJ_AOUT 1
@ -33,7 +33,7 @@
#else /* ! BFD_ASSEMBLER */
#ifndef VMS
#include "aout_gnu.h" /* Needed to define struct nlist. Sigh. */
#include "aout_gnu.h" /* Needed to define struct nlist. Sigh. */
#else
#include "a_out.h"
#endif
@ -229,12 +229,12 @@ extern void obj_aout_frob_file PARAMS ((void));
typedef struct
{
struct exec header; /* a.out header */
long string_table_size; /* names + '\0' + sizeof(int) */
long string_table_size; /* names + '\0' + sizeof (int) */
}
object_headers;
/* line numbering stuff. */
/* line numbering stuff. */
#define OBJ_EMIT_LINENO(a, b, c) {;}
struct fix;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* This file is tc-arm.h
Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999
Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
Modified by David Taylor (dtaylor@armltd.co.uk)
@ -68,12 +68,12 @@
#if defined OBJ_COFF || defined OBJ_ELF
# define ARM_BI_ENDIAN
# define TC_VALIDATE_FIX(fixP, segType, Label) \
if (arm_validate_fix (fixP)) add_symbolP = fixP->fx_addsy
extern boolean arm_validate_fix PARAMS ((struct fix *));
#endif
#ifdef OBJ_COFF
# if defined TE_PE
# define TC_FORCE_RELOCATION(x) ((x)->fx_r_type == BFD_RELOC_RVA)
@ -90,7 +90,7 @@
#ifdef OBJ_ELF
# define TARGET_FORMAT elf32_arm_target_format()
extern const char * elf32_arm_target_format PARAMS ((void));
# define TC_FORCE_RELOCATION(fixp) arm_force_relocation (fixp)
extern int arm_force_relocation PARAMS ((struct fix *));
#endif
@ -116,10 +116,14 @@
#define TC_FIX_TYPE PTR
#define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL)
#ifdef OBJ_ELF
#if defined OBJ_ELF || defined OBJ_COFF
#include "write.h" /* For definition of fixS */
#define obj_fix_adjustable(fixP) arm_fix_adjustable (fixP)
boolean arm_fix_adjustable PARAMS ((fixS *));
/* This arranges for gas/write.c to not apply a relocation if
obj_fix_adjustable() says it is not adjustable. */
#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP)
#else
#define obj_fix_adjustable(fixP) 0
#endif
@ -143,7 +147,6 @@ boolean arm_fix_adjustable PARAMS ((fixS *));
#define ARM_SET_INTERWORK(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_INTERWORK) : ARM_RESET_FLAG (s, ARM_FLAG_INTERWORK))
#define THUMB_SET_FUNC(s,t) ((t) ? ARM_SET_FLAG (s, THUMB_FLAG_FUNC) : ARM_RESET_FLAG (s, THUMB_FLAG_FUNC))
#define TC_START_LABEL(C,STR) \
(c == ':' || (c == '/' && arm_data_in_code ()))
int arm_data_in_code PARAMS ((void));
@ -206,14 +209,14 @@ extern boolean pic_code;
extern void cons_fix_new_arm PARAMS ((fragS *, int, int, expressionS *));
/* Don't allow symbols to be discarded on GOT related relocs,
nor on globals. */
nor on globals. */
#define tc_fix_adjustable(x) (\
((x)->fx_r_type == BFD_RELOC_ARM_PLT32 \
|| (x)->fx_r_type == BFD_RELOC_ARM_GOT32 \
|| (x)->fx_r_type == BFD_RELOC_ARM_GOTOFF \
|| S_IS_EXTERN ((x)->fx_addsy) \
|| S_IS_WEAK ((x)->fx_addsy)) ? 0 : 1)
#ifdef OBJ_ELF
#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
#else
@ -223,4 +226,6 @@ extern boolean pic_code;
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES)\
parse_cons_expression_arm(EXP)
/* end of tc-arm.h */
#ifdef OBJ_ELF
#define DWARF2_LINE_MIN_INSN_LENGTH 2
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* tc-i386.h -- Header file for tc-i386.c
Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Free Software Foundation.
This file is part of GAS, the GNU Assembler.
@ -41,21 +41,25 @@ struct fix;
#define tc_fix_adjustable(X) tc_i386_fix_adjustable(X)
extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
/* This is the relocation type for direct references to GLOBAL_OFFSET_TABLE.
* It comes up in complicated expressions such as
* _GLOBAL_OFFSET_TABLE_+[.-.L284], which cannot be expressed normally with
* the regular expressions. The fixup specified here when used at runtime
* implies that we should add the address of the GOT to the specified location,
* and as a result we have simplified the expression into something we can use.
*/
#define TC_RELOC_GLOBAL_OFFSET_TABLE BFD_RELOC_386_GOTPC
#if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF) || defined (OBJ_MAYBE_COFF) || defined (OBJ_COFF)) && !defined (TE_PE)
/* This arranges for gas/write.c to not apply a relocation if
tc_fix_adjustable() says it is not adjustable.
The "! symbol_used_in_reloc_p" test is there specifically to cover
the case of non-global symbols in linkonce sections. It's the
generally correct thing to do though; If a reloc is going to be
emitted against a symbol then we don't want to adjust the fixup by
applying the reloc during assembly. The reloc will be applied by
the linker during final link. */
#define TC_FIX_ADJUSTABLE(fixP) \
(! symbol_used_in_reloc_p ((fixP)->fx_addsy) && tc_fix_adjustable (fixP))
#endif
/* This expression evaluates to false if the relocation is for a local object
for which we still want to do the relocation at runtime. True if we
are willing to perform this relocation while building the .o file.
This is only used for pcrel relocations, so GOTOFF does not need to be
checked here. I am not sure if some of the others are ever used with
pcrel, but it is easier to be safe than sorry. */
pcrel, but it is easier to be safe than sorry. */
#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \
((FIX)->fx_r_type != BFD_RELOC_386_PLT32 \
@ -68,7 +72,12 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
&& ! S_IS_COMMON ((FIX)->fx_addsy))))
#define TARGET_ARCH bfd_arch_i386
#define TARGET_MACH (i386_mach ())
extern unsigned long i386_mach PARAMS ((void));
#ifdef TE_FreeBSD
#define AOUT_TARGET_FORMAT "a.out-i386-freebsd"
#endif
#ifdef TE_NetBSD
#define AOUT_TARGET_FORMAT "a.out-i386-netbsd"
#endif
@ -88,9 +97,8 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
#define AOUT_TARGET_FORMAT "a.out-i386"
#endif
#if ((defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_COFF)) \
|| (defined (OBJ_MAYBE_ELF) && defined (OBJ_MAYBE_AOUT)) \
|| (defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)))
#if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
|| defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))
extern const char *i386_target_format PARAMS ((void));
#define TARGET_FORMAT i386_target_format ()
#else
@ -134,7 +142,6 @@ extern int tc_coff_sizemachdep PARAMS ((fragS *frag));
/* Need this for PIC relocations */
#define NEED_FX_R_TYPE
#ifdef TE_386BSD
/* The BSDI linker apparently rejects objects with a machine type of
M_386 (100). */
@ -184,13 +191,14 @@ extern const char extra_symbol_chars[];
/* Prefixes will be emitted in the order defined below.
WAIT_PREFIX must be the first prefix since FWAIT is really is an
instruction, and so must come before any prefixes. */
instruction, and so must come before any prefixes. */
#define WAIT_PREFIX 0
#define LOCKREP_PREFIX 1
#define ADDR_PREFIX 2
#define DATA_PREFIX 3
#define SEG_PREFIX 4
#define MAX_PREFIXES 5 /* max prefixes per opcode */
#define REX_PREFIX 5 /* must come last. */
#define MAX_PREFIXES 6 /* max prefixes per opcode */
/* we define the syntax here (modulo base,index,scale syntax) */
#define REGISTER_PREFIX '%'
@ -217,10 +225,9 @@ extern const char extra_symbol_chars[];
#define BYTE_MNEM_SUFFIX 'b'
#define SHORT_MNEM_SUFFIX 's'
#define LONG_MNEM_SUFFIX 'l'
#define QWORD_MNEM_SUFFIX 'q'
/* Intel Syntax */
#define LONG_DOUBLE_MNEM_SUFFIX 'x'
/* Intel Syntax */
#define DWORD_MNEM_SUFFIX 'd'
/* modrm.mode = REGMEM_FIELD_HAS_REG when a register is in there */
#define REGMEM_FIELD_HAS_REG 0x3/* always = 0x3 */
@ -239,77 +246,6 @@ extern const char extra_symbol_chars[];
#define OFFSET_FLAT 6
#define FLAT 7
#define NONE_FOUND 8
/*
When an operand is read in it is classified by its type. This type includes
all the possible ways an operand can be used. Thus, '%eax' is both 'register
# 0' and 'The Accumulator'. In our language this is expressed by OR'ing
'Reg32' (any 32 bit register) and 'Acc' (the accumulator).
Operands are classified so that we can match given operand types with
the opcode table in opcode/i386.h.
*/
/* register */
#define Reg8 0x1 /* 8 bit reg */
#define Reg16 0x2 /* 16 bit reg */
#define Reg32 0x4 /* 32 bit reg */
/* immediate */
#define Imm8 0x8 /* 8 bit immediate */
#define Imm8S 0x10 /* 8 bit immediate sign extended */
#define Imm16 0x20 /* 16 bit immediate */
#define Imm32 0x40 /* 32 bit immediate */
#define Imm1 0x80 /* 1 bit immediate */
/* memory */
#define BaseIndex 0x100
/* Disp8,16,32 are used in different ways, depending on the
instruction. For jumps, they specify the size of the PC relative
displacement, for baseindex type instructions, they specify the
size of the offset relative to the base register, and for memory
offset instructions such as `mov 1234,%al' they specify the size of
the offset relative to the segment base. */
#define Disp8 0x200 /* 8 bit displacement */
#define Disp16 0x400 /* 16 bit displacement */
#define Disp32 0x800 /* 32 bit displacement */
/* specials */
#define InOutPortReg 0x1000 /* register to hold in/out port addr = dx */
#define ShiftCount 0x2000 /* register to hold shift cound = cl */
#define Control 0x4000 /* Control register */
#define Debug 0x8000 /* Debug register */
#define Test 0x10000 /* Test register */
#define FloatReg 0x20000 /* Float register */
#define FloatAcc 0x40000 /* Float stack top %st(0) */
#define SReg2 0x80000 /* 2 bit segment register */
#define SReg3 0x100000 /* 3 bit segment register */
#define Acc 0x200000 /* Accumulator %al or %ax or %eax */
#define JumpAbsolute 0x400000
#define RegMMX 0x800000 /* MMX register */
#define RegXMM 0x1000000 /* XMM registers in PIII */
#define EsSeg 0x2000000 /* String insn operand with fixed es segment */
/* InvMem is for instructions with a modrm byte that only allow a
general register encoding in the i.tm.mode and i.tm.regmem fields,
eg. control reg moves. They really ought to support a memory form,
but don't, so we add an InvMem flag to the register operand to
indicate that it should be encoded in the i.tm.regmem field. */
#define InvMem 0x4000000
#define Reg (Reg8|Reg16|Reg32) /* gen'l register */
#define WordReg (Reg16|Reg32)
#define ImplicitRegister (InOutPortReg|ShiftCount|Acc|FloatAcc)
#define Imm (Imm8|Imm8S|Imm16|Imm32) /* gen'l immediate */
#define Disp (Disp8|Disp16|Disp32) /* General displacement */
#define AnyMem (Disp|BaseIndex|InvMem) /* General memory */
/* The following aliases are defined because the opcode table
carefully specifies the allowed memory types for each instruction.
At the moment we can only tell a memory reference size by the
instruction suffix, so there's not much point in defining Mem8,
Mem16, Mem32 and Mem64 opcode modifiers - We might as well just use
the suffix directly to check memory operands. */
#define LLongMem AnyMem /* 64 bits (or more) */
#define LongMem AnyMem /* 32 bit memory ref */
#define ShortMem AnyMem /* 16 bit memory ref */
#define WordMem AnyMem /* 16 or 32 bit memory ref */
#define ByteMem AnyMem /* 8 bit memory ref */
#define SMALLEST_DISP_TYPE(num) \
(fits_in_signed_byte(num) ? (Disp8|Disp32) : Disp32)
typedef struct
{
@ -328,7 +264,33 @@ typedef struct
AMD 3DNow! instructions.
If this template has no extension opcode (the usual case) use None */
unsigned int extension_opcode;
#define None 0xffff /* If no extension_opcode is possible. */
#define None 0xffff /* If no extension_opcode is possible. */
/* cpu feature flags */
unsigned int cpu_flags;
#define Cpu086 0x1 /* Any old cpu will do, 0 does the same */
#define Cpu186 0x2 /* i186 or better required */
#define Cpu286 0x4 /* i286 or better required */
#define Cpu386 0x8 /* i386 or better required */
#define Cpu486 0x10 /* i486 or better required */
#define Cpu586 0x20 /* i585 or better required */
#define Cpu686 0x40 /* i686 or better required */
#define CpuP4 0x80 /* Pentium4 or better required */
#define CpuK6 0x100 /* AMD K6 or better required*/
#define CpuAthlon 0x200 /* AMD Athlon or better required*/
#define CpuSledgehammer 0x400 /* Sledgehammer or better required */
#define CpuMMX 0x800 /* MMX support required */
#define CpuSSE 0x1000 /* Streaming SIMD extensions required */
#define CpuSSE2 0x2000 /* Streaming SIMD extensions 2 required */
#define Cpu3dnow 0x4000 /* 3dnow! support required */
#define CpuUnknown 0x8000 /* The CPU is unknown, be on the safe side. */
/* These flags are set by gas depending on the flag_code. */
#define Cpu64 0x4000000 /* 64bit support required */
#define CpuNo64 0x8000000 /* Not supported in the 64bit mode */
/* The default value for unknown CPUs - enable all features to avoid problems. */
#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuSSE|CpuSSE2|Cpu3dnow|CpuK6|CpuAthlon)
/* the bits in opcode_modifier are used to generate the final opcode from
the base_opcode. These bits also are used to detect alternate forms of
@ -344,35 +306,107 @@ typedef struct
#define FloatR 0x8 /* src/dest swap for floats: MUST BE 0x8 */
#define ShortForm 0x10 /* register is in low 3 bits of opcode */
#define FloatMF 0x20 /* FP insn memory format bit, sized by 0x4 */
#define Jump 0x40 /* special case for jump insns. */
#define Jump 0x40 /* special case for jump insns. */
#define JumpDword 0x80 /* call and jump */
#define JumpByte 0x100 /* loop and jecxz */
#define JumpInterSegment 0x200 /* special case for intersegment leaps/calls */
#define FloatD 0x400 /* direction for float insns: MUST BE 0x400 */
#define Seg2ShortForm 0x800 /* encoding of load segment reg insns */
#define Seg3ShortForm 0x1000 /* fs/gs segment register insns. */
#define Seg3ShortForm 0x1000 /* fs/gs segment register insns. */
#define Size16 0x2000 /* needs size prefix if in 32-bit mode */
#define Size32 0x4000 /* needs size prefix if in 16-bit mode */
#define IgnoreSize 0x8000 /* instruction ignores operand size prefix */
#define DefaultSize 0x10000 /* default insn size depends on mode */
#define No_bSuf 0x20000 /* b suffix on instruction illegal */
#define No_wSuf 0x40000 /* w suffix on instruction illegal */
#define No_lSuf 0x80000 /* l suffix on instruction illegal */
#define No_sSuf 0x100000 /* s suffix on instruction illegal */
#define No_dSuf 0x200000 /* d suffix on instruction illegal */
#define No_xSuf 0x400000 /* x suffix on instruction illegal */
#define FWait 0x800000 /* instruction needs FWAIT */
#define IsString 0x1000000 /* quick test for string instructions */
#define regKludge 0x2000000 /* fake an extra reg operand for clr, imul */
#define IsPrefix 0x4000000 /* opcode is a prefix */
#define ImmExt 0x8000000 /* instruction has extension in 8 bit imm */
#define Size64 0x8000 /* needs size prefix if in 16-bit mode */
#define IgnoreSize 0x10000 /* instruction ignores operand size prefix */
#define DefaultSize 0x20000 /* default insn size depends on mode */
#define No_bSuf 0x40000 /* b suffix on instruction illegal */
#define No_wSuf 0x80000 /* w suffix on instruction illegal */
#define No_lSuf 0x100000 /* l suffix on instruction illegal */
#define No_sSuf 0x200000 /* s suffix on instruction illegal */
#define No_qSuf 0x400000 /* q suffix on instruction illegal */
#define No_xSuf 0x800000 /* x suffix on instruction illegal */
#define FWait 0x1000000 /* instruction needs FWAIT */
#define IsString 0x2000000 /* quick test for string instructions */
#define regKludge 0x4000000 /* fake an extra reg operand for clr, imul */
#define IsPrefix 0x8000000 /* opcode is a prefix */
#define ImmExt 0x10000000 /* instruction has extension in 8 bit imm */
#define NoRex64 0x20000000 /* instruction don't need Rex64 prefix. */
#define Rex64 0x40000000 /* instruction require Rex64 prefix. */
#define Ugh 0x80000000 /* deprecated fp insn, gets a warning */
/* operand_types[i] describes the type of operand i. This is made
by OR'ing together all of the possible type masks. (e.g.
'operand_types[i] = Reg|Imm' specifies that operand i can be
either a register or an immediate operand */
either a register or an immediate operand. */
unsigned int operand_types[3];
/* operand_types[i] bits */
/* register */
#define Reg8 0x1 /* 8 bit reg */
#define Reg16 0x2 /* 16 bit reg */
#define Reg32 0x4 /* 32 bit reg */
#define Reg64 0x8 /* 64 bit reg */
/* immediate */
#define Imm8 0x10 /* 8 bit immediate */
#define Imm8S 0x20 /* 8 bit immediate sign extended */
#define Imm16 0x40 /* 16 bit immediate */
#define Imm32 0x80 /* 32 bit immediate */
#define Imm32S 0x100 /* 32 bit immediate sign extended */
#define Imm64 0x200 /* 64 bit immediate */
#define Imm1 0x400 /* 1 bit immediate */
/* memory */
#define BaseIndex 0x800
/* Disp8,16,32 are used in different ways, depending on the
instruction. For jumps, they specify the size of the PC relative
displacement, for baseindex type instructions, they specify the
size of the offset relative to the base register, and for memory
offset instructions such as `mov 1234,%al' they specify the size of
the offset relative to the segment base. */
#define Disp8 0x1000 /* 8 bit displacement */
#define Disp16 0x2000 /* 16 bit displacement */
#define Disp32 0x4000 /* 32 bit displacement */
#define Disp32S 0x8000 /* 32 bit signed displacement */
#define Disp64 0x10000 /* 64 bit displacement */
/* specials */
#define InOutPortReg 0x20000 /* register to hold in/out port addr = dx */
#define ShiftCount 0x40000 /* register to hold shift cound = cl */
#define Control 0x80000 /* Control register */
#define Debug 0x100000 /* Debug register */
#define Test 0x200000 /* Test register */
#define FloatReg 0x400000 /* Float register */
#define FloatAcc 0x800000 /* Float stack top %st(0) */
#define SReg2 0x1000000 /* 2 bit segment register */
#define SReg3 0x2000000 /* 3 bit segment register */
#define Acc 0x4000000 /* Accumulator %al or %ax or %eax */
#define JumpAbsolute 0x8000000
#define RegMMX 0x10000000 /* MMX register */
#define RegXMM 0x20000000 /* XMM registers in PIII */
#define EsSeg 0x40000000 /* String insn operand with fixed es segment */
/* InvMem is for instructions with a modrm byte that only allow a
general register encoding in the i.tm.mode and i.tm.regmem fields,
eg. control reg moves. They really ought to support a memory form,
but don't, so we add an InvMem flag to the register operand to
indicate that it should be encoded in the i.tm.regmem field. */
#define InvMem 0x80000000
#define Reg (Reg8|Reg16|Reg32|Reg64) /* gen'l register */
#define WordReg (Reg16|Reg32|Reg64)
#define ImplicitRegister (InOutPortReg|ShiftCount|Acc|FloatAcc)
#define Imm (Imm8|Imm8S|Imm16|Imm32S|Imm32|Imm64) /* gen'l immediate */
#define EncImm (Imm8|Imm16|Imm32|Imm32S) /* Encodable gen'l immediate */
#define Disp (Disp8|Disp16|Disp32|Disp32S|Disp64) /* General displacement */
#define AnyMem (Disp8|Disp16|Disp32|Disp32S|BaseIndex|InvMem) /* General memory */
/* The following aliases are defined because the opcode table
carefully specifies the allowed memory types for each instruction.
At the moment we can only tell a memory reference size by the
instruction suffix, so there's not much point in defining Mem8,
Mem16, Mem32 and Mem64 opcode modifiers - We might as well just use
the suffix directly to check memory operands. */
#define LLongMem AnyMem /* 64 bits (or more) */
#define LongMem AnyMem /* 32 bit memory ref */
#define ShortMem AnyMem /* 16 bit memory ref */
#define WordMem AnyMem /* 16 or 32 bit memory ref */
#define ByteMem AnyMem /* 8 bit memory ref */
}
template;
@ -384,47 +418,70 @@ template;
END.
*/
typedef struct
{
const template *start;
const template *end;
} templates;
{
const template *start;
const template *end;
}
templates;
/* these are for register name --> number & type hash lookup */
typedef struct
{
char *reg_name;
unsigned int reg_type;
unsigned int reg_num;
}
{
char *reg_name;
unsigned int reg_type;
unsigned int reg_flags;
#define RegRex 0x1 /* Extended register. */
#define RegRex64 0x2 /* Extended 8 bit register. */
unsigned int reg_num;
}
reg_entry;
typedef struct
{
char *seg_name;
unsigned int seg_prefix;
}
{
char *seg_name;
unsigned int seg_prefix;
}
seg_entry;
/* 386 operand encoding bytes: see 386 book for details of this. */
/* 386 operand encoding bytes: see 386 book for details of this. */
typedef struct
{
unsigned int regmem; /* codes register or memory operand */
unsigned int reg; /* codes register operand (or extended opcode) */
unsigned int mode; /* how to interpret regmem & reg */
}
{
unsigned int regmem; /* codes register or memory operand */
unsigned int reg; /* codes register operand (or extended opcode) */
unsigned int mode; /* how to interpret regmem & reg */
}
modrm_byte;
/* 386 opcode byte to code indirect addressing. */
/* x86-64 extension prefix. */
typedef struct
{
unsigned base;
unsigned index;
unsigned scale;
unsigned int mode64;
unsigned int extX; /* Used to extend modrm reg field. */
unsigned int extY; /* Used to extend SIB index field. */
unsigned int extZ; /* Used to extend modrm reg/mem, SIB base, modrm base fields. */
unsigned int empty; /* Used to old-style byte registers to new style. */
}
rex_byte;
/* 386 opcode byte to code indirect addressing. */
typedef struct
{
unsigned base;
unsigned index;
unsigned scale;
}
sib_byte;
/* x86 arch names and features */
typedef struct
{
const char *name; /* arch name */
unsigned int flags; /* cpu feature flags */
}
arch_entry;
/* The name of the global offset table generated by the compiler. Allow
this to be overridden if need be. */
this to be overridden if need be. */
#ifndef GLOBAL_OFFSET_TABLE_NAME
#if defined(TE_NetBSD) && defined(OBJ_AOUT)
#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
@ -450,13 +507,12 @@ if ((n) && !need_pass_2 \
&& (!(fill) || ((char)*(fill) == (char)0x90 && (len) == 1)) \
&& subseg_text_p (now_seg)) \
{ \
char *p; \
p = frag_var (rs_align_code, 15, 1, (relax_substateT) max, \
(symbolS *) 0, (offsetT) (n), (char *) 0); \
*p = 0x90; \
frag_align_code ((n), (max)); \
goto around; \
}
#define MAX_MEM_FOR_RS_ALIGN_CODE 15
extern void i386_align_code PARAMS ((fragS *, int));
#define HANDLE_ALIGN(fragP) \
@ -479,5 +535,3 @@ extern void sco_id PARAMS ((void));
#endif
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
/* end of tc-i386.h */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -126,7 +126,7 @@ struct { \
frag_opcode_offset (X) = 0; \
frag_bsr (X) = 0; \
} \
while(0)
while (0)
/* Accessor macros for things which may move around */
#define frag_opcode_frag(X) (X)->tc_frag_data.fr_opcode_fragP
@ -156,14 +156,14 @@ struct \
fix_opcode_offset(X) = 0; \
fix_bsr(X) = 0; \
} \
while(0)
while (0)
#define TC_FIX_DATA_PRINT(FILE, FIXP) \
do \
{ \
fprintf((FILE), "opcode_frag=%ld, operand offset=%d, bsr=%d\n", \
fprintf ((FILE), "opcode_frag=%ld, operand offset=%d, bsr=%d\n", \
(unsigned long) fix_opcode_frag (FIXP), \
fix_opcode_offset (FIXP), \
fix_bsr (FIXP)); \
} \
while(0)
while (0)

View File

@ -44,6 +44,9 @@ extern int sh_small;
/* Don't try to break words. */
#define WORKING_DOT_WORD
/* All SH instructions are multiples of 16 bits. */
#define DWARF2_LINE_MIN_INSN_LENGTH 2
/* We require .long, et. al., to be aligned correctly. */
#define md_cons_align(nbytes) sh_cons_align (nbytes)
extern void sh_cons_align PARAMS ((int));
@ -53,6 +56,8 @@ extern void sh_cons_align PARAMS ((int));
#define HANDLE_ALIGN(frag) sh_handle_align (frag)
extern void sh_handle_align PARAMS ((fragS *));
#define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2)
/* We need to force out some relocations when relaxing. */
#define TC_FORCE_RELOCATION(fix) sh_force_relocation (fix)
extern int sh_force_relocation ();
@ -61,6 +66,10 @@ extern int sh_force_relocation ();
#define obj_fix_adjustable(fixP) sh_fix_adjustable(fixP)
struct fix;
extern boolean sh_fix_adjustable PARAMS ((struct fix *));
/* This arranges for gas/write.c to not apply a relocation if
obj_fix_adjustable() says it is not adjustable. */
#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP)
#endif
#define IGNORE_NONSTANDARD_ESCAPES
@ -72,11 +81,6 @@ extern boolean sh_fix_adjustable PARAMS ((struct fix *));
extern const struct relax_type md_relax_table[];
#define TC_GENERIC_RELAX_TABLE md_relax_table
/* We use a special alignment function to insert the correct nop
pattern. */
extern int sh_do_align PARAMS ((int, const char *, int, int));
#define md_do_align(n,fill,len,max,l) if (sh_do_align (n,fill,len,max)) goto l
/* We record, for each section, whether we have most recently output a
CODE reloc or a DATA reloc. */
struct sh_segment_info_type
@ -158,6 +162,8 @@ extern int target_big_endian;
#ifdef TE_NetBSD
#define TARGET_FORMAT (shl ? "elf32-shl-unx" : "elf32-sh-unx")
#elifdef TE_LINUX
#define TARGET_FORMAT (shl ? "elf32-sh-linux" : "elf32-shbig-linux")
#else
#define TARGET_FORMAT (shl ? "elf32-shl" : "elf32-sh")
#endif
@ -165,6 +171,40 @@ extern int target_big_endian;
#define elf_tc_final_processing sh_elf_final_processing
extern void sh_elf_final_processing PARAMS ((void));
#endif /* OBJ_ELF */
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */
/* end of tc-sh.h */
#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
/* This is the relocation type for direct references to
GLOBAL_OFFSET_TABLE. It comes up in complicated expressions such
as _GLOBAL_OFFSET_TABLE_+[.-.L284], which cannot be expressed
normally with the regular expressions. The fixup specified here
when used at runtime implies that we should add the address of the
GOT to the specified location, and as a result we have simplified
the expression into something we can use. */
#define TC_RELOC_GLOBAL_OFFSET_TABLE BFD_RELOC_SH_GOTPC
/* This expression evaluates to false if the relocation is for a local object
for which we still want to do the relocation at runtime. True if we
are willing to perform this relocation while building the .o file.
This is only used for pcrel relocations, so GOTOFF does not need to be
checked here. I am not sure if some of the others are ever used with
pcrel, but it is easier to be safe than sorry.
We can't resolve references to the GOT or the PLT when creating the
object file, since these tables are only created by the linker.
Also, if the symbol is global, weak, common or not defined, the
assembler can't compute the appropriate reloc, since its location
can only be determined at link time. */
#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \
((FIX)->fx_r_type != BFD_RELOC_32_PLT_PCREL \
&& (FIX)->fx_r_type != BFD_RELOC_32_GOT_PCREL \
&& (FIX)->fx_r_type != BFD_RELOC_SH_GOTPC \
&& ((FIX)->fx_addsy == NULL \
|| (! S_IS_EXTERNAL ((FIX)->fx_addsy) \
&& ! S_IS_WEAK ((FIX)->fx_addsy) \
&& S_IS_DEFINED ((FIX)->fx_addsy) \
&& ! S_IS_COMMON ((FIX)->fx_addsy))))
#endif /* OBJ_ELF */

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* tc-vax.c - vax-specific -
Copyright (C) 1987, 91, 92, 93, 94, 95, 98, 1999
Copyright (C) 1987, 91, 92, 93, 94, 95, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -28,11 +28,11 @@
another comment */
const char comment_chars[] = "#";
/* These chars only start a comment at the beginning of a line. */
/* Note that for the VAX the are the same as comment_chars above. */
/* These chars only start a comment at the beginning of a line. */
/* Note that for the VAX the are the same as comment_chars above. */
const char line_comment_chars[] = "#";
const char line_separator_chars[] = "";
const char line_separator_chars[] = ";";
/* Chars that can be used to separate mant from exp in floating point nums */
const char EXP_CHARS[] = "eE";
@ -50,13 +50,13 @@ const char FLT_CHARS[] = "dDfFgGhH";
static expressionS exp_of_operand[VIT_MAX_OPERANDS];
static segT seg_of_operand[VIT_MAX_OPERANDS];
/* A vax instruction after decoding. */
/* A vax instruction after decoding. */
static struct vit v;
/* Hold details of big operands. */
/* Hold details of big operands. */
LITTLENUM_TYPE big_operand_bits[VIT_MAX_OPERANDS][SIZE_OF_LARGE_NUMBER];
FLONUM_TYPE float_operand[VIT_MAX_OPERANDS];
/* Above is made to point into big_operand_bits by md_begin(). */
/* Above is made to point into big_operand_bits by md_begin(). */
#ifndef OBJ_VMS
#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
@ -122,8 +122,6 @@ int flag_no_hash_mixed_case; /* -h NUM */
bbcs e3
bbsc e4
bbcc e5
bbssi e6
bbcci e7
Always, you complement 0th bit to reverse condition.
Always, 1-byte opcde, longword-address, byte-address, 1-byte-displacement
@ -182,16 +180,15 @@ int flag_no_hash_mixed_case; /* -h NUM */
/* These displacements are relative to the start address of the
displacement. The first letter is Byte, Word. 2nd letter is
Forward, Backward. */
Forward, Backward. */
#define BF (1+ 127)
#define BB (1+-128)
#define WF (2+ 32767)
#define WB (2+-32768)
/* Dont need LF, LB because they always reach. [They are coded as 0.] */
#define C(a,b) ENCODE_RELAX(a,b)
/* This macro has no side-effects. */
/* This macro has no side-effects. */
#define ENCODE_RELAX(what,length) (((what) << 2) + (length))
const relax_typeS md_relax_table[] =
@ -249,7 +246,7 @@ const pseudo_typeS md_pseudo_table[] =
#define STATE_PC_RELATIVE (1)
#define STATE_CONDITIONAL_BRANCH (2)
#define STATE_ALWAYS_BRANCH (3) /* includes BSB... */
#define STATE_ALWAYS_BRANCH (3) /* includes BSB... */
#define STATE_COMPLEX_BRANCH (4)
#define STATE_COMPLEX_HOP (5)
#define STATE_PC_RELATIVE_CALL (6)
@ -260,7 +257,6 @@ const pseudo_typeS md_pseudo_table[] =
#define STATE_LONG (2)
#define STATE_UNDF (3) /* Symbol undefined in pass1 */
#define min(a, b) ((a) < (b) ? (a) : (b))
int flonum_gen2vax PARAMS ((char format_letter, FLONUM_TYPE * f,
@ -304,7 +300,7 @@ md_number_to_chars (con, value, nbytes)
/* Fix up some data or instructions after we find out the value of a symbol
that they reference. */
void /* Knows about order of bytes in address. */
void /* Knows about order of bytes in address. */
md_apply_fix (fixP, value)
fixS *fixP;
long value;
@ -315,8 +311,8 @@ md_apply_fix (fixP, value)
long
md_chars_to_number (con, nbytes)
unsigned char con[]; /* Low order byte 1st. */
int nbytes; /* Number of bytes in the input. */
unsigned char con[]; /* Low order byte 1st. */
int nbytes; /* Number of bytes in the input. */
{
long retval;
for (retval = 0, con += nbytes - 1; nbytes--; con--)
@ -331,19 +327,19 @@ md_chars_to_number (con, nbytes)
void
md_assemble (instruction_string)
char *instruction_string; /* A string: assemble 1 instruction. */
char *instruction_string; /* A string: assemble 1 instruction. */
{
/* Non-zero if operand expression's segment is not known yet. */
/* Non-zero if operand expression's segment is not known yet. */
int is_undefined;
int length_code;
char *p;
/* An operand. Scans all operands. */
/* An operand. Scans all operands. */
struct vop *operandP;
char *save_input_line_pointer;
/* What used to live after an expression. */
/* What used to live after an expression. */
char c_save;
/* 1: instruction_string bad for all passes. */
/* 1: instruction_string bad for all passes. */
int goofed;
/* Points to slot just after last operand. */
struct vop *end_operandP;
@ -351,28 +347,28 @@ md_assemble (instruction_string)
expressionS *expP;
segT *segP;
/* These refer to an instruction operand expression. */
/* These refer to an instruction operand expression. */
/* Target segment of the address. */
segT to_seg;
valueT this_add_number;
/* Positive (minuend) symbol. */
/* Positive (minuend) symbol. */
symbolS *this_add_symbol;
/* As a number. */
/* As a number. */
long opcode_as_number;
/* Least significant byte 1st. */
/* Least significant byte 1st. */
char *opcode_as_chars;
/* As an array of characters. */
/* As an array of characters. */
/* Least significant byte 1st */
char *opcode_low_byteP;
/* length (bytes) meant by vop_short. */
/* length (bytes) meant by vop_short. */
int length;
/* 0, or 1 if '@' is in addressing mode. */
/* 0, or 1 if '@' is in addressing mode. */
int at;
/* From vop_nbytes: vax_operand_width (in bytes) */
int nbytes;
FLONUM_TYPE *floatP;
LITTLENUM_TYPE literal_float[8];
/* Big enough for any floating point literal. */
/* Big enough for any floating point literal. */
vip (&v, instruction_string);
@ -409,13 +405,13 @@ md_assemble (instruction_string)
}
else
{
/* statement has no syntax goofs: lets sniff the expression */
int can_be_short = 0; /* 1 if a bignum can be reduced to a short literal. */
/* Statement has no syntax goofs: let's sniff the expression. */
int can_be_short = 0; /* 1 if a bignum can be reduced to a short literal. */
input_line_pointer = operandP->vop_expr_begin;
c_save = operandP->vop_expr_end[1];
operandP->vop_expr_end[1] = '\0';
/* If to_seg == SEG_PASS1, expression() will have set need_pass_2 = 1. */
/* If to_seg == SEG_PASS1, expression() will have set need_pass_2 = 1. */
*segP = expression (expP);
switch (expP->X_op)
{
@ -455,7 +451,7 @@ md_assemble (instruction_string)
break;
case O_big:
/* Preserve the bits. */
/* Preserve the bits. */
if (expP->X_add_number > 0)
{
bignum_copy (generic_bignum, expP->X_add_number,
@ -518,20 +514,20 @@ md_assemble (instruction_string)
&& operandP->vop_reg == 0xF
&& (operandP->vop_mode & 0xE) == 0x8))
{
/* Saw a '#'. */
/* Saw a '#'. */
if (operandP->vop_short == ' ')
{
/* We must chose S^ or I^. */
/* We must chose S^ or I^. */
if (expP->X_add_number > 0)
{
/* Bignum: Short literal impossible. */
/* Bignum: Short literal impossible. */
operandP->vop_short = 'i';
operandP->vop_mode = 8;
operandP->vop_reg = 0xF; /* VAX PC. */
operandP->vop_reg = 0xF; /* VAX PC. */
}
else
{
/* Flonum: Try to do it. */
/* Flonum: Try to do it. */
if (can_be_short)
{
operandP->vop_short = 's';
@ -547,17 +543,17 @@ md_assemble (instruction_string)
operandP->vop_reg = 0xF; /* VAX PC */
}
} /* bignum or flonum ? */
} /* if #, but no S^ or I^ seen. */
/* No more ' ' case: either 's' or 'i'. */
} /* if #, but no S^ or I^ seen. */
/* No more ' ' case: either 's' or 'i'. */
if (operandP->vop_short == 's')
{
/* Wants to be a short literal. */
/* Wants to be a short literal. */
if (expP->X_add_number > 0)
{
as_warn (_("Bignum not permitted in short literal. Immediate mode assumed."));
operandP->vop_short = 'i';
operandP->vop_mode = 8;
operandP->vop_reg = 0xF; /* VAX PC. */
operandP->vop_reg = 0xF; /* VAX PC. */
}
else
{
@ -566,10 +562,10 @@ md_assemble (instruction_string)
as_warn (_("Can't do flonum short literal: immediate mode used."));
operandP->vop_short = 'i';
operandP->vop_mode = 8;
operandP->vop_reg = 0xF; /* VAX PC. */
operandP->vop_reg = 0xF; /* VAX PC. */
}
else
{ /* Encode short literal now. */
{ /* Encode short literal now. */
int temp = 0;
switch (-expP->X_add_number)
@ -599,18 +595,18 @@ md_assemble (instruction_string)
} /* flonum or bignum ? */
}
else
{ /* I^# seen: set it up if float. */
{ /* I^# seen: set it up if float. */
if (expP->X_add_number < 0)
{
memcpy (floatP->low, literal_float, sizeof (literal_float));
}
} /* if S^# seen. */
} /* if S^# seen. */
}
else
{
as_warn (_("A bignum/flonum may not be a displacement: 0x%lx used"),
(expP->X_add_number = 0x80000000L));
/* Chosen so luser gets the most offset bits to patch later. */
/* Chosen so luser gets the most offset bits to patch later. */
}
expP->X_add_number = floatP->low[0]
| ((LITTLENUM_MASK & (floatP->low[1])) << LITTLENUM_NUMBER_OF_BITS);
@ -643,9 +639,8 @@ md_assemble (instruction_string)
return;
}
/* Emit op-code. */
/* Remember where it is, in case we want to modify the op-code later. */
/* Emit op-code. */
/* Remember where it is, in case we want to modify the op-code later. */
opcode_low_byteP = frag_more (v.vit_opcode_nbytes);
memcpy (opcode_low_byteP, v.vit_opcode, v.vit_opcode_nbytes);
opcode_as_number = md_chars_to_number (opcode_as_chars = v.vit_opcode, 4);
@ -669,7 +664,7 @@ md_assemble (instruction_string)
FRAG_APPEND_1_CHAR (0x40 + operandP->vop_ndx);
} /* if(vop_ndx>=0) */
/* Here to make main operand frag(s). */
/* Here to make main operand frag(s). */
this_add_number = expP->X_add_number;
this_add_symbol = expP->X_add_symbol;
to_seg = *segP;
@ -684,7 +679,7 @@ md_assemble (instruction_string)
{
if (to_seg == now_seg || is_undefined)
{
/* If is_undefined, then it might BECOME now_seg. */
/* If is_undefined, then it might BECOME now_seg. */
if (nbytes)
{
p = frag_more (nbytes);
@ -748,7 +743,7 @@ md_assemble (instruction_string)
{
know (!(opcode_as_number & VIT_OPCODE_SYNTHETIC));
p = frag_more (nbytes);
/* Conventional relocation. */
/* Conventional relocation. */
fix_new (frag_now, p - frag_now->fr_literal,
nbytes, &abs_symbol, this_add_number,
1, NO_RELOC);
@ -764,9 +759,9 @@ md_assemble (instruction_string)
*opcode_low_byteP = opcode_as_chars[0] + VAX_WIDEN_LONG;
know (opcode_as_chars[1] == 0);
p = frag_more (5);
p[0] = VAX_ABSOLUTE_MODE; /* @#... */
p[0] = VAX_ABSOLUTE_MODE; /* @#... */
md_number_to_chars (p + 1, this_add_number, 4);
/* Now (eg) JMP @#foo or JSB @#foo. */
/* Now (eg) JMP @#foo or JSB @#foo. */
}
else
{
@ -778,7 +773,7 @@ md_assemble (instruction_string)
p[2] = VAX_BRB;
p[3] = 6;
p[4] = VAX_JMP;
p[5] = VAX_ABSOLUTE_MODE; /* @#... */
p[5] = VAX_ABSOLUTE_MODE; /* @#... */
md_number_to_chars (p + 6, this_add_number, 4);
/*
* Now (eg) ACBx 1f
@ -795,7 +790,7 @@ md_assemble (instruction_string)
p[1] = VAX_BRB;
p[2] = 6;
p[3] = VAX_JMP;
p[4] = VAX_PC_RELATIVE_MODE + 1; /* @#... */
p[4] = VAX_ABSOLUTE_MODE; /* @#... */
md_number_to_chars (p + 5, this_add_number, 4);
/*
* Now (eg) xOBxxx 1f
@ -811,11 +806,11 @@ md_assemble (instruction_string)
/* b<cond> */
*opcode_low_byteP ^= 1;
/* To reverse the condition in a VAX branch,
complement the lowest order bit. */
complement the lowest order bit. */
p = frag_more (7);
p[0] = 6;
p[1] = VAX_JMP;
p[2] = VAX_ABSOLUTE_MODE; /* @#... */
p[2] = VAX_ABSOLUTE_MODE; /* @#... */
md_number_to_chars (p + 3, this_add_number, 4);
/*
* Now (eg) BLEQ 1f
@ -830,7 +825,7 @@ md_assemble (instruction_string)
/* to_seg != now_seg && to_seg != SEG_UNKNOWN && to_Seg != SEG_ABSOLUTE */
if (nbytes > 0)
{
/* Pc-relative. Conventional relocation. */
/* Pc-relative. Conventional relocation. */
know (!(opcode_as_number & VIT_OPCODE_SYNTHETIC));
p = frag_more (nbytes);
fix_new (frag_now, p - frag_now->fr_literal,
@ -853,7 +848,7 @@ md_assemble (instruction_string)
p + 1 - frag_now->fr_literal, 4,
this_add_symbol,
this_add_number, 1, NO_RELOC);
/* Now eg JMP foo or JSB foo. */
/* Now eg JMP foo or JSB foo. */
}
else
{
@ -902,7 +897,7 @@ md_assemble (instruction_string)
else
{
know (operandP->vop_width == VAX_WIDTH_CONDITIONAL_JUMP);
*opcode_low_byteP ^= 1; /* Reverse branch condition. */
*opcode_low_byteP ^= 1; /* Reverse branch condition. */
p = frag_more (7);
p[0] = 6;
p[1] = VAX_JMP;
@ -917,8 +912,8 @@ md_assemble (instruction_string)
}
else
{
know (operandP->vop_access != 'b'); /* So it is ordinary operand. */
know (operandP->vop_access != ' '); /* ' ' target-independent: elsewhere. */
know (operandP->vop_access != 'b'); /* So it is ordinary operand. */
know (operandP->vop_access != ' '); /* ' ' target-independent: elsewhere. */
know (operandP->vop_access == 'a'
|| operandP->vop_access == 'm'
|| operandP->vop_access == 'r'
@ -949,10 +944,10 @@ md_assemble (instruction_string)
if (operandP->vop_reg >= 0 && (operandP->vop_mode < 8
|| (operandP->vop_reg != 0xF && operandP->vop_mode < 10)))
{
/* One byte operand. */
/* One byte operand. */
know (operandP->vop_mode > 3);
FRAG_APPEND_1_CHAR (operandP->vop_mode << 4 | operandP->vop_reg);
/* All 1-bytes except S^# happen here. */
/* All 1-bytes except S^# happen here. */
}
else
{
@ -974,7 +969,7 @@ md_assemble (instruction_string)
/* At is the only context we need to carry
to other side of relax() process. Must
be in the correct bit position of VAX
operand spec. byte. */
operand spec. byte. */
}
else
{
@ -992,9 +987,9 @@ md_assemble (instruction_string)
if (this_add_symbol == NULL)
{
know (to_seg == SEG_ABSOLUTE);
/* Do @#foo: simpler relocation than foo-.(pc) anyway. */
/* Do @#foo: simpler relocation than foo-.(pc) anyway. */
p = frag_more (5);
p[0] = VAX_ABSOLUTE_MODE; /* @#... */
p[0] = VAX_ABSOLUTE_MODE; /* @#... */
md_number_to_chars (p + 1, this_add_number, 4);
if (length && length != 4)
{
@ -1032,7 +1027,7 @@ md_assemble (instruction_string)
if (length == 0)
{
know (operandP->vop_short == ' ');
length = 4; /* Longest possible. */
length = 4; /* Longest possible. */
}
p = frag_more (length + 1);
p[0] = 0xF | ((at + "?\12\14?\16"[length]) << 4);
@ -1063,7 +1058,7 @@ md_assemble (instruction_string)
}
if (length == 0
&& to_seg == SEG_ABSOLUTE && (expP->X_op != O_big)
&& operandP->vop_mode == 8 /* No '@'. */
&& operandP->vop_mode == 8 /* No '@'. */
&& this_add_number < 64)
{
operandP->vop_short = 's';
@ -1076,7 +1071,7 @@ md_assemble (instruction_string)
{
int reloc_type = NO_RELOC;
int is_pcrel = 0;
/* I^#... */
/* I^#... */
know (nbytes);
p = frag_more (nbytes + 1);
know (operandP->vop_reg == 0xF);
@ -1101,7 +1096,7 @@ md_assemble (instruction_string)
* are to be 0xFF or 0x00. BSD4.2 & RMS
* say use 0x00. OK --- but this
* assembler needs ANOTHER rewrite to
* cope properly with this bug. */
* cope properly with this bug. */
md_number_to_chars (p + 1, this_add_number, min (4, nbytes));
if (nbytes > 4)
{
@ -1116,7 +1111,7 @@ md_assemble (instruction_string)
* Problem here is to get the bytes
* in the right order. We stored
* our constant as LITTLENUMs, not
* bytes. */
* bytes. */
LITTLENUM_TYPE *lP;
lP = floatP->low;
@ -1212,7 +1207,7 @@ md_estimate_size_before_relax (fragP, segment)
{
case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_UNDF):
if (S_GET_SEGMENT (fragP->fr_symbol) == segment)
{ /* A relaxable case. */
{ /* A relaxable case. */
fragP->fr_subtype = ENCODE_RELAX (STATE_PC_RELATIVE, STATE_BYTE);
}
else
@ -1263,7 +1258,7 @@ md_estimate_size_before_relax (fragP, segment)
else
{
p = fragP->fr_literal + old_fr_fix;
p[0] |= VAX_PC_RELATIVE_MODE; /* don't force @ bit */
p[0] |= VAX_PC_RELATIVE_MODE; /* Preserve @ bit. */
fragP->fr_fix += 1 + 4;
fix_new (fragP, old_fr_fix + 1, 4, fragP->fr_symbol,
fragP->fr_offset, 1,
@ -1303,7 +1298,7 @@ md_estimate_size_before_relax (fragP, segment)
else
{
p = fragP->fr_literal + old_fr_fix;
*fragP->fr_opcode ^= 1; /* Reverse sense of branch. */
*fragP->fr_opcode ^= 1; /* Reverse sense of branch. */
p[0] = 6;
p[1] = VAX_JMP;
p[2] = VAX_PC_RELATIVE_MODE; /* ...(PC) */
@ -1399,11 +1394,11 @@ md_convert_frag (headers, seg, fragP)
segT seg;
fragS *fragP;
{
char *addressP; /* -> _var to change. */
char *opcodeP; /* -> opcode char(s) to change. */
char *addressP; /* -> _var to change. */
char *opcodeP; /* -> opcode char(s) to change. */
short int length_code; /* 2=long 1=word 0=byte */
short int extension = 0; /* Size of relaxed address. */
/* Added to fr_fix: incl. ALL var chars. */
short int extension = 0; /* Size of relaxed address. */
/* Added to fr_fix: incl. ALL var chars. */
symbolS *symbolP;
long where;
long address_of_var;
@ -1428,8 +1423,8 @@ md_convert_frag (headers, seg, fragP)
case ENCODE_RELAX (STATE_PC_RELATIVE_JMP, STATE_BYTE):
case ENCODE_RELAX (STATE_PC_RELATIVE_CALL, STATE_BYTE):
case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_BYTE):
know (*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xAF; /* Byte displacement. */
know (*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xAF; /* Byte displacement. */
addressP[1] = target_address - (address_of_var + 2);
extension = 2;
break;
@ -1437,8 +1432,8 @@ md_convert_frag (headers, seg, fragP)
case ENCODE_RELAX (STATE_PC_RELATIVE_JMP, STATE_WORD):
case ENCODE_RELAX (STATE_PC_RELATIVE_CALL, STATE_WORD):
case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_WORD):
know (*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xCF; /* Word displacement. */
know (*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xCF; /* Word displacement. */
md_number_to_chars (addressP + 1, target_address - (address_of_var + 3), 2);
extension = 3;
break;
@ -1446,8 +1441,8 @@ md_convert_frag (headers, seg, fragP)
case ENCODE_RELAX (STATE_PC_RELATIVE_JMP, STATE_LONG):
case ENCODE_RELAX (STATE_PC_RELATIVE_CALL, STATE_LONG):
case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_LONG):
know (*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xEF; /* Long word displacement. */
know (*addressP == 0 || *addressP == 0x10); /* '@' bit. */
addressP[0] |= 0xEF; /* Long word displacement. */
md_number_to_chars (addressP + 1, target_address - (address_of_var + 5), 4);
extension = 5;
break;
@ -1458,7 +1453,7 @@ md_convert_frag (headers, seg, fragP)
break;
case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_WORD):
opcodeP[0] ^= 1; /* Reverse sense of test. */
opcodeP[0] ^= 1; /* Reverse sense of test. */
addressP[0] = 3;
addressP[1] = VAX_BRB + VAX_WIDEN_WORD;
md_number_to_chars (addressP + 2, target_address - (address_of_var + 4), 2);
@ -1466,11 +1461,11 @@ md_convert_frag (headers, seg, fragP)
break;
case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_LONG):
opcodeP[0] ^= 1; /* Reverse sense of test. */
opcodeP[0] ^= 1; /* Reverse sense of test. */
addressP[0] = 6;
addressP[1] = VAX_JMP;
addressP[2] = VAX_PC_RELATIVE_MODE;
md_number_to_chars (addressP + 3, target_address, 4);
md_number_to_chars (addressP + 3, target_address - (address_of_var + 7), 4);
extension = 7;
break;
@ -1504,7 +1499,7 @@ md_convert_frag (headers, seg, fragP)
addressP[3] = 6;
addressP[4] = VAX_JMP;
addressP[5] = VAX_PC_RELATIVE_MODE;
md_number_to_chars (addressP + 6, target_address, 4);
md_number_to_chars (addressP + 6, target_address - (address_of_var + 10), 4);
extension = 10;
break;
@ -1528,7 +1523,7 @@ md_convert_frag (headers, seg, fragP)
addressP[2] = 6;
addressP[3] = VAX_JMP;
addressP[4] = VAX_PC_RELATIVE_MODE;
md_number_to_chars (addressP + 5, target_address, 4);
md_number_to_chars (addressP + 5, target_address - (address_of_var + 9), 4);
extension = 9;
break;
@ -1544,7 +1539,7 @@ md_convert_frag (headers, seg, fragP)
On vax: first 4 bytes are normal unsigned long, next three bytes
are symbolnum, least sig. byte first. Last byte is broken up with
the upper nibble as nuthin, bit 3 as extern, bits 2 & 1 as length, and
bit 0 as pcrel. */
bit 0 as pcrel. */
#ifdef comment
void
md_ri_to_chars (the_bytes, ri)
@ -1563,7 +1558,7 @@ md_ri_to_chars (the_bytes, ri)
#endif /* comment */
void
void
tc_aout_fix_to_chars (where, fixP, segment_address_in_file)
char *where;
fixS *fixP;
@ -1718,10 +1713,10 @@ static const short int vax_operand_width_size[256] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 8, 0, 4, 8, 16, 0, 0, 0, 4, 0, 0,16, /* ..b.d.fgh...l..o */
0, 8, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, /* .q.....w........ */
0, 0, 1, 0, 8, 0, 4, 8, 16, 0, 0, 0, 4, 0, 0,16, /* ..b.d.fgh...l..o */
0, 8, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, /* .q.....w........ */
0, 0, 1, 0, 8, 0, 4, 8, 16, 0, 0, 0, 4, 0, 0,16, /* ..b.d.fgh...l..o */
0, 8, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, /* .q.....w........ */
0, 0, 1, 0, 8, 0, 4, 8, 16, 0, 0, 0, 4, 0, 0,16, /* ..b.d.fgh...l..o */
0, 8, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, /* .q.....w........ */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -1828,8 +1823,6 @@ static const struct vot
{"jbcs", {"rlvbb?", 0x800000e3}},
{"jbsc", {"rlvbb?", 0x800000e4}},
{"jbcc", {"rlvbb?", 0x800000e5}},
{"jbssi", {"rlvbb?", 0x800000e6}},
{"jbcci", {"rlvbb?", 0x800000e7}},
{"jlbs", {"rlb?", 0x800000e8}},
{"jlbc", {"rlb?", 0x800000e9}},
@ -1838,8 +1831,8 @@ static const struct vot
{"jsobgeq", {"mlb:", 0xC00000f4}},
{"jsobgtr", {"mlb:", 0xC00000f5}},
/* CASEx has no branch addresses in our conception of it. */
/* You should use ".word ..." statements after the "case ...". */
/* CASEx has no branch addresses in our conception of it. */
/* You should use ".word ..." statements after the "case ...". */
{"", {"", 0}} /* empty is end sentinel */
@ -1858,7 +1851,7 @@ static const struct vot
static const char *
vip_begin (synthetic_too, immediate, indirect, displen)
int synthetic_too; /* 1 means include jXXX op-codes. */
int synthetic_too; /* 1 means include jXXX op-codes. */
const char *immediate, *indirect, *displen;
{
const struct vot *vP; /* scan votstrs */
@ -1880,7 +1873,6 @@ vip_begin (synthetic_too, immediate, indirect, displen)
return retval;
}
/*
* v i p ( )
*
@ -1907,10 +1899,10 @@ vip_begin (synthetic_too, immediate, indirect, displen)
static void
vip (vitP, instring)
struct vit *vitP; /* We build an exploded instruction here. */
char *instring; /* Text of a vax instruction: we modify. */
struct vit *vitP; /* We build an exploded instruction here. */
char *instring; /* Text of a vax instruction: we modify. */
{
/* How to bit-encode this opcode. */
/* How to bit-encode this opcode. */
struct vot_wot *vwP;
/* 1/skip whitespace.2/scan vot_how */
char *p;
@ -1921,16 +1913,16 @@ vip (vitP, instring)
struct vop *operandp;
/* error over all operands */
const char *alloperr;
/* Remember char, (we clobber it with '\0' temporarily). */
/* Remember char, (we clobber it with '\0' temporarily). */
char c;
/* Op-code of this instruction. */
/* Op-code of this instruction. */
vax_opcodeT oc;
if (*instring == ' ')
++instring; /* Skip leading whitespace. */
for (p = instring; *p && *p != ' '; p++);; /* MUST end in end-of-string or exactly 1 space. */
/* Scanned up to end of operation-code. */
/* Operation-code is ended with whitespace. */
++instring; /* Skip leading whitespace. */
for (p = instring; *p && *p != ' '; p++);; /* MUST end in end-of-string or exactly 1 space. */
/* Scanned up to end of operation-code. */
/* Operation-code is ended with whitespace. */
if (p - instring == 0)
{
vitP->vit_error = _("No operator");
@ -1947,7 +1939,7 @@ vip (vitP, instring)
* We trust instring points to an op-name, with no whitespace.
*/
vwP = (struct vot_wot *) hash_find (op_hash, instring);
*p = c; /* Restore char after op-code. */
*p = c; /* Restore char after op-code. */
if (vwP == 0)
{
vitP->vit_error = _("Unknown operator");
@ -1957,7 +1949,7 @@ vip (vitP, instring)
else
{
/*
* We found a match! So lets pick up as many operands as the
* We found a match! So let's pick up as many operands as the
* instruction wants, and even gripe if there are too many.
* We expect comma to seperate each operand.
* We let instring track the text, while p tracks a part of the
@ -1970,7 +1962,7 @@ vip (vitP, instring)
* we return 32 bits of opcode, including bucky bits, BUT
* an opcode length is either 8 or 16 bits for vit_opcode_nbytes.
*/
oc = vwP->vot_code; /* The op-code. */
oc = vwP->vot_code; /* The op-code. */
vitP->vit_opcode_nbytes = (oc & 0xFF) >= 0xFD ? 2 : 1;
md_number_to_chars (vitP->vit_opcode, oc, 4);
count = 0; /* no operands seen yet */
@ -1999,7 +1991,7 @@ vip (vitP, instring)
operandp->vop_nbytes = vax_operand_width_size[(unsigned) howp[1]];
operandp->vop_access = howp[0];
vip_op (instring, operandp);
*q = c; /* Restore input text. */
*q = c; /* Restore input text. */
if (operandp->vop_error)
alloperr = _("Bad operand");
instring = q + (c ? 1 : 0); /* next operand (if any) */
@ -2011,7 +2003,7 @@ vip (vitP, instring)
if (!*alloperr)
{
if (*instring == ' ')
instring++; /* Skip whitespace. */
instring++; /* Skip whitespace. */
if (*instring)
alloperr = _("Too many operands");
}
@ -2032,7 +2024,7 @@ char answer[100]; /* human types a line of vax assembler here */
char *mybug; /* "" or an internal logic diagnostic */
int mycount; /* number of operands */
struct vop *myvop; /* scan operands from myvit */
int mysynth; /* 1 means want synthetic opcodes. */
int mysynth; /* 1 means want synthetic opcodes. */
char my_immediate[200];
char my_indirect[200];
char my_displen[200];
@ -2111,7 +2103,7 @@ main ()
/* vax_reg_parse.c - convert a VAX register name to a number */
/* Copyright (C) 1987 Free Software Foundation, Inc. A part of GNU. */
/* Copyright (C) 1987 Free Software Foundation, Inc. A part of GNU. */
/*
* v a x _ r e g _ p a r s e ( )
@ -2297,7 +2289,6 @@ vax_reg_parse (c1, c2, c3) /* 3 chars of register name */
* if the other outputs are to be taken seriously.
*/
/*
* Because this module is useful for both VMS and UN*X style assemblers
* and because of the variety of UN*X assemblers we must recognise
@ -2365,7 +2356,7 @@ vip_op_1 (bit, syms)
}
/* Can be called any time. More arguments may appear in future. */
static void
static void
vip_op_defaults (immediate, indirect, displen)
const char *immediate;
const char *indirect;
@ -2444,7 +2435,7 @@ vip_op (optext, vopP)
/* Input fields: vop_access, vop_width.
Output fields: _ndx, _reg, _mode, _short, _warn,
_error _expr_begin, _expr_end, _nbytes.
vop_nbytes : number of bytes in a datum. */
vop_nbytes : number of bytes in a datum. */
struct vop *vopP;
{
/* track operand text forward */
@ -2467,7 +2458,7 @@ vip_op (optext, vopP)
int ndx = 0;
/* report illegal operand, ""==OK */
/* " " is a FAKE error: means we won */
/* ANY err that begins with ' ' is a fake. */
/* ANY err that begins with ' ' is a fake. */
/* " " is converted to "" before return */
const char *err;
/* warn about weird modes pf address */
@ -2483,8 +2474,8 @@ vip_op (optext, vopP)
* get the types wrong below, we lose at compile time rather than at
* lint or run time.
*/
char access_mode; /* vop_access. */
char width; /* vop_width. */
char access_mode; /* vop_access. */
char width; /* vop_width. */
access_mode = vopP->vop_access;
width = vopP->vop_width;
@ -2494,13 +2485,13 @@ vip_op (optext, vopP)
p = optext;
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
p++; /* skip over whitespace */
if ((at = INDIRECTP (*p)) != 0)
{ /* 1 if *p=='@'(or '*' for Un*x) */
p++; /* at is determined */
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
p++; /* skip over whitespace */
}
@ -2521,7 +2512,7 @@ vip_op (optext, vopP)
len = ' '; /* len is determined */
}
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
if (*p == ' ') /* Expect all whitespace reduced to ' '. */
p++; /* skip over whitespace */
if ((hash = IMMEDIATEP (*p)) != 0) /* 1 if *p=='#' ('$' for Un*x) */
@ -2539,7 +2530,7 @@ vip_op (optext, vopP)
;
q--; /* now q points at last char of text */
if (*q == ' ' && q >= p) /* Expect all whitespace reduced to ' '. */
if (*q == ' ' && q >= p) /* Expect all whitespace reduced to ' '. */
q--;
/* reverse over whitespace, but don't */
/* run back over *p */
@ -2592,7 +2583,7 @@ vip_op (optext, vopP)
* Otherwise, ndx is index register number, and q points before "[...]".
*/
if (*q == ' ' && q >= p) /* Expect all whitespace reduced to ' '. */
if (*q == ' ' && q >= p) /* Expect all whitespace reduced to ' '. */
q--;
/* reverse over whitespace, but don't */
/* run back over *p */
@ -2689,7 +2680,7 @@ vip_op (optext, vopP)
*/
if (!paren)
{
if (*q == ' ' && q >= p) /* Expect all whitespace reduced to ' '. */
if (*q == ' ' && q >= p) /* Expect all whitespace reduced to ' '. */
q--;
/* reverse over whitespace, but don't */
/* run back over *p */
@ -2753,7 +2744,7 @@ vip_op (optext, vopP)
err = " ";
}
/* Since nobody seems to use it: comment this 'feature'(?) out for now. */
/* Since nobody seems to use it: comment this 'feature'(?) out for now. */
#ifdef NEVER
/*
* Case of stand-alone operand. e.g. ".long foo"
@ -3106,7 +3097,7 @@ vip_op (optext, vopP)
*/
#ifdef TEST /* #Define to use this testbed. */
#ifdef TEST /* #Define to use this testbed. */
/*
* Follows a test program for this function.
@ -3282,7 +3273,7 @@ CONST char *md_shortopts = "d:STt:Vk";
struct option md_longopts[] = {
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof(md_longopts);
size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (c, arg)
@ -3312,7 +3303,7 @@ md_parse_option (c, arg)
break;
#ifdef OBJ_VMS
case '+': /* For g++. Hash any name > 31 chars long. */
case '+': /* For g++. Hash any name > 31 chars long. */
flag_hash_long_names = 1;
break;
@ -3359,7 +3350,7 @@ void
md_show_usage (stream)
FILE *stream;
{
fprintf(stream, _("\
fprintf (stream, _("\
VAX options:\n\
-d LENGTH ignored\n\
-J ignored\n\
@ -3381,7 +3372,6 @@ VMS options:\n\
/* We have no need to default values of symbols. */
/* ARGSUSED */
symbolS *
md_undefined_symbol (name)
char *name;

View File

@ -1,5 +1,6 @@
/* tc-vax.h -- Header file for tc-vax.c.
Copyright (C) 1987, 91, 92, 93, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 1987, 91, 92, 93, 95, 96, 97, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -16,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
02111-1307, USA. */
#define TC_VAX 1
@ -47,5 +48,3 @@ extern const struct relax_type md_relax_table[];
* fill-column: 131
* End:
*/
/* end of tc-vax.h */

File diff suppressed because it is too large Load Diff

View File

@ -9,8 +9,9 @@ AC_PREREQ(2.13)
AC_INIT(as.h)
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
AM_INIT_AUTOMAKE(gas, 2.10.1)
AM_INIT_AUTOMAKE(gas, 2.11)
AM_PROG_LIBTOOL
@ -40,6 +41,27 @@ esac])dnl
using_cgen=no
build_warnings="-W -Wall"
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
[case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${build_warnings} ${t}";;
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
echo "Setting warning flags = $build_warnings" 6>&1
fi])dnl
WARN_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
WARN_CFLAGS="${build_warnings}"
fi
AC_SUBST(WARN_CFLAGS)
# Generate a header file
AM_CONFIG_HEADER(config.h:config.in)
@ -95,11 +117,15 @@ changequote([,])dnl
armb*) cpu_type=arm endian=little ;;
armv*l) cpu_type=arm endian=little ;;
armv*b) cpu_type=arm endian=big ;;
xscale*) cpu_type=arm endian=little ;;
strongarm*) cpu_type=arm endian=little ;;
thumb*) cpu_type=arm endian=little ;;
hppa*) cpu_type=hppa ;;
changequote(,)dnl
i[456]86) cpu_type=i386 ;;
i[3456]86) cpu_type=i386 arch=i386;;
x86_64) cpu_type=i386 arch=x86_64;;
ia64) cpu_type=ia64 ;;
m6811|m6812|m68hc12) cpu_type=m68hc11 ;;
m680[012346]0) cpu_type=m68k ;;
changequote([,])dnl
m68008) cpu_type=m68k ;;
@ -139,6 +165,7 @@ changequote([,])dnl
a29k-amd-udi) fmt=coff ;;
a29k-amd-ebmon) fmt=coff ;;
a29k-nyu-sym1) fmt=coff ;;
a29k-*-rtems*) fmt=coff ;;
a29k-*-vxworks*) fmt=coff ;;
alpha*-*-*vms*) fmt=evax ;;
@ -147,42 +174,57 @@ changequote([,])dnl
alpha*-*-osf*) fmt=ecoff ;;
alpha*-*-linuxecoff*) fmt=ecoff ;;
alpha*-*-linux-gnu*) fmt=elf em=linux ;;
alpha*-*-freebsd*) fmt=elf em=freebsd ;;
alpha*-*-netbsd*) fmt=elf em=nbsd ;;
arc-*-elf*) fmt=elf bfd_gas=yes ;;
arm-*-aout) fmt=aout ;;
arm-*-coff | thumb-*-coff) fmt=coff ;;
arm-*-rtems | thumb-*-rtems) fmt=elf ;;
arm-*-elf | thumb-*-elf) fmt=elf ;;
arm*-*-conix*) fmt=elf ;;
arm-*-linux*aout*) fmt=aout em=linux ;;
arm*-*-linux-gnu*) fmt=elf em=linux ;;
arm-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
arm*-*-linux-gnu* | arm*-*-uclinux*)
fmt=elf em=linux ;;
arm-*-netbsd*) fmt=aout em=nbsd ;;
arm-*-oabi | thumb-*-oabi) fmt=elf ;;
arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;;
arm-*-wince) fmt=coff em=wince-pe bfd_gas=yes;;
arm-*-wince) fmt=coff em=wince-pe ;;
arm-*-pe | thumb-*-pe) fmt=coff em=pe ;;
arm-*-riscix*) fmt=aout em=riscix ;;
avr-*-*) fmt=elf bfd_gas=yes ;;
cris-*-*) fmt=multi bfd_gas=yes ;;
d10v-*-*) fmt=elf bfd_gas=yes ;;
d30v-*-*) fmt=elf bfd_gas=yes ;;
fr30-*-*) fmt=elf bfd_gas=yes ;;
hppa-*-linux-gnu*) case ${cpu} in
hppa*64*)
fmt=elf em=hppalinux64;;
hppa*)
fmt=elf em=linux;;
esac ;;
hppa-*-*elf*) fmt=elf em=hppa ;;
hppa-*-linux-gnu*) fmt=elf em=hppa ;;
hppa-*-lites*) fmt=elf em=hppa ;;
hppa-*-osf*) fmt=som em=hppa ;;
hppa-*-rtems*) fmt=elf em=hppa ;;
hppa-*-hpux11*) case ${cpu} in
hppa*64*)
fmt=elf em=hppa64 ;;
hppa*)
fmt=som em=hppa ;;
esac ;;
hppa-*-hpux*) fmt=som em=hppa ;;
hppa-*-mpeix*) fmt=som em=hppa ;;
hppa-*-bsd*) fmt=som em=hppa ;;
hppa-*-hiux*) fmt=som em=hppa ;;
h8300-*-rtems*) fmt=coff ;;
h8300-*-coff) fmt=coff ;;
i370-*-elf* | i370-*-linux*) fmt=elf ;;
@ -197,14 +239,14 @@ changequote([,])dnl
i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
i386-*-linux*coff*) fmt=coff em=linux ;;
i386-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;;
x86_64-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;;
i386-*-lynxos*) fmt=coff em=lynx ;;
i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
fmt=elf bfd_gas=yes ;;
changequote(,)dnl
i386-*-sysv[45]* | i386-*-solaris* | i386-*-elf)
fmt=elf bfd_gas=yes ;;
i386-*-freebsdaout* | i386-*-freebsd[12].* | i386-*-freebsd[12])
fmt=aout em=386bsd ;;
changequote([,])dnl
i386-*-freebsd*) fmt=elf bfd_gas=yes ;;
i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*)
fmt=coff ;;
i386-*-sco3.2v5*) fmt=elf
@ -216,25 +258,28 @@ changequote([,])dnl
i386-*-sco3.2*) fmt=coff ;;
i386-*-vsta) fmt=aout ;;
i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
fmt=coff em=go32;;
i386-*-rtemscoff*) fmt=coff ;;
fmt=coff em=go32 bfd_gas=yes
AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?])
;;
i386-*-rtemself*) fmt=elf ;;
i386-*-rtems*) fmt=elf ;;
i386-*-rtems*) fmt=coff ;;
i386-*-gnu*) fmt=elf ;;
i386-*-mach*)
fmt=aout em=mach bfd_gas=yes ;;
i386-*-msdos*) fmt=aout ;;
i386-*-moss*) fmt=elf ;;
i386-*-pe) fmt=coff em=pe ;;
i386-*-pe) fmt=coff em=pe bfd_gas=yes ;;
i386-*-cygwin*) fmt=coff em=pe bfd_gas=yes ;;
i386-*-interix*) fmt=coff em=interix bfd_gas=yes ;;
i386-*-mingw32*) fmt=coff em=pe bfd_gas=yes ;;
i386-*-*nt*) fmt=coff em=pe ;;
i386-*-*nt*) fmt=coff em=pe bfd_gas=yes ;;
i386-*-vxworks*) fmt=aout ;;
i386-*-chaos) fmt=elf ;;
i860-stardent-sysv4* | i860-stardent-elf*)
fmt=elf bfd_gas=yes endian=little
AC_MSG_WARN(GAS support for ${generic_target} is preliminary and a work in progress) ;;
i960-*-bout) fmt=bout ;;
i960-*-coff) fmt=coff em=ic960 ;;
i960-*-rtemscoff*) fmt=coff em=ic960 ;;
i960-*-rtemself*) fmt=elf ;;
i960-*-rtems*) fmt=coff em=ic960 ;;
i960-*-nindy*) fmt=bout ;;
i960-*-vxworks4*) fmt=bout ;;
@ -243,8 +288,14 @@ changequote([,])dnl
i960-*-vxworks*) fmt=bout ;;
i960-*-elf*) fmt=elf ;;
ia64-*-elf*) fmt=elf ;;
ia64-*-linux-gnu*) fmt=elf em=linux ;;
ia64-*-hpux*) fmt=elf em=hpux ;;
m32r-*-*) fmt=elf bfd_gas=yes ;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)fmt=elf bfd_gas=yes ;;
m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
fmt=aout em=sun3 ;;
m68k-motorola-sysv*) fmt=coff em=delta ;;
@ -253,10 +304,7 @@ changequote([,])dnl
m68k-*-sysv4*) # must be before -sysv*
fmt=elf em=svr4 ;;
m68k-*-elf*) fmt=elf ;;
m68k-*-rtemscoff*) fmt=coff ;;
m68k-*-rtemself*) fmt=elf ;;
m68k-*-rtems*) fmt=elf ;;
m68k-*-coff | m68k-*-sysv*)
m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
fmt=coff ;;
m68k-*-hpux*) fmt=hp300 em=hp300 ;;
m68k-*-linux*aout*) fmt=aout em=linux ;;
@ -291,6 +339,7 @@ changequote([,])dnl
mips-*-irix*) fmt=ecoff ;;
mips-*-lnews*) fmt=ecoff em=lnews ;;
mips-*-riscos*) fmt=ecoff ;;
mips-*-sysv4*MP*) fmt=elf em=tmips ;;
mips-*-sysv*) fmt=ecoff ;;
mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* | mips-*-openbsd*)
fmt=elf ;;
@ -329,12 +378,12 @@ changequote([,])dnl
ppc-*-netware*) fmt=elf em=ppcnw ;;
ppc-*-vxworks*) fmt=elf ;;
sh-*-linux*) fmt=elf em=linux ;;
sh-*-elf*) fmt=elf ;;
sh-*-coff*) fmt=coff ;;
sh-*-pe*) fmt=coff em=pe bfd_gas=yes;;
sh-*-rtemself*) fmt=elf ;;
sh-*-rtemscoff*) fmt=coff ;;
sh-*-rtems*) fmt=coff ;;
sh-*-rtems*) fmt=coff ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
@ -364,9 +413,13 @@ changequote([,])dnl
strongarm-*-coff) fmt=coff ;;
strongarm-*-elf) fmt=elf ;;
xscale-*-coff) fmt=coff ;;
xscale-*-elf) fmt=elf ;;
tic30-*-*aout*) fmt=aout bfd_gas=yes ;;
tic30-*-*coff*) fmt=coff bfd_gas=yes ;;
tic54x-*-* | c54x*-*-*)
fmt=coff bfd_gas=yes need_libm=yes;;
tic80-*-*) fmt=coff ;;
v850-*-*) fmt=elf bfd_gas=yes ;;
@ -384,6 +437,7 @@ changequote([,])dnl
w65-*-*) fmt=coff ;;
*-*-freebsd*) fmt=elf bfd_gas=yes ;;
*-*-aout | *-*-scout)
fmt=aout ;;
*-*-nindy*)
@ -418,11 +472,13 @@ changequote([,])dnl
arm-*) bfd_gas=yes ;;
# not yet
# i386-aout) bfd_gas=preferred ;;
ia64*-*) bfd_gas=yes ;;
mips-*) bfd_gas=yes ;;
ns32k-*) bfd_gas=yes ;;
ppc-*) bfd_gas=yes ;;
sparc-*) bfd_gas=yes ;;
strongarm-*) bfd_gas=yes ;;
xscale-*) bfd_gas=yes ;;
*-elf) bfd_gas=yes ;;
*-ecoff) bfd_gas=yes ;;
*-som) bfd_gas=yes ;;
@ -485,6 +541,11 @@ changequote([,])dnl
fi
;;
i386)
if test $this_target = $target ; then
AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
fi
;;
sparc)
if test $this_target = $target ; then
AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
@ -534,6 +595,9 @@ changequote([,])dnl
big) emulation="mipsbelf mipslelf mipself" ;;
*) emulation="mipslelf mipsbelf mipself" ;;
esac ;;
mips-*-sysv4*MP*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
# i386-pc-pe-coff != i386-pc-coff.
i386-*-pe-coff) ;;
# Uncommenting the next line will turn on support for i386 AOUT
# for the default linux configuration
# i386-*-linux*-elf) emulation="i386elf i386aout" ;;
@ -541,6 +605,10 @@ changequote([,])dnl
i386-*-aout) emulation="i386aout" ;;
i386-*-coff) emulation="i386coff" ;;
i386-*-elf) emulation="i386elf" ;;
# Always all formats. The first stated emulation becomes the default.
cris-*-*aout*) emulation="crisaout criself" ;;
cris-*-*) emulation="criself crisaout" ;;
esac
emulations="$emulations $emulation"
@ -655,12 +723,12 @@ for em in . $emulations ; do
fmt=elf file=mipself ;;
mipsbecoff | mipslecoff)
fmt=ecoff file=mipsecoff ;;
i386aout)
fmt=aout file=i386aout ;;
i386coff)
fmt=coff file=i386coff ;;
i386elf)
fmt=elf file=i386elf ;;
*coff)
fmt=coff file=$em ;;
*aout)
fmt=aout file=$em ;;
*elf)
fmt=elf file=$em ;;
esac
formats="$formats $fmt"
emfiles="$emfiles e-$file.o"
@ -788,6 +856,14 @@ AC_CHECK_FUNCS(unlink remove, break)
# Some systems don't have sbrk().
AC_CHECK_FUNCS(sbrk)
# do we need the math library?
case "${need_libm}" in
yes)
AC_CHECK_LIBM
AC_SUBST(LIBM)
;;
esac
# Some non-ANSI preprocessors botch requoting inside strings. That's bad
# enough, but on some of those systems, the assert macro relies on requoting
# working properly!

View File

@ -1,5 +1,6 @@
/* struct_symbol.h - Internal symbol structure
Copyright (C) 1987, 92, 93, 94, 95, 98, 1999 Free Software Foundation, Inc.
Copyright (C) 1987, 92, 93, 94, 95, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -21,6 +22,12 @@
#ifndef __struc_symbol_h__
#define __struc_symbol_h__
#ifdef BFD_ASSEMBLER
/* The BFD code wants to walk the list in both directions. */
#undef SYMBOLS_NEED_BACKPOINTERS
#define SYMBOLS_NEED_BACKPOINTERS
#endif
/* The information we keep for a symbol. Note that the symbol table
holds pointers both to this and to local_symbol structures. See
below. */
@ -34,13 +41,13 @@ struct symbol
/* The (4-origin) position of sy_name in the symbol table of the object
file. This will be 0 for (nameless) .stabd symbols.
Not used until write_object_file() time. */
Not used until write_object_file() time. */
unsigned long sy_name_offset;
/* What we write in .o file (if permitted). */
obj_symbol_type sy_symbol;
/* The 24 bit symbol number. Symbol numbers start at 0 and are unsigned. */
/* The 24 bit symbol number. Symbol numbers start at 0 and are unsigned. */
long sy_number;
#endif
@ -69,7 +76,7 @@ struct symbol
are local and would otherwise not be. */
unsigned int sy_used_in_reloc : 1;
/* Whether the symbol is used as an operand or in an expression.
/* Whether the symbol is used as an operand or in an expression.
NOTE: Not all the backends keep this information accurate;
backends which use this bit are responsible for setting it when
a symbol is used in backend routines. */
@ -146,5 +153,3 @@ struct local_symbol
#endif /* BFD_ASSEMBLER */
#endif /* __struc_symbol_h__ */
/* end of struc-symbol.h */

View File

@ -1,3 +1,24 @@
/* corefile.c
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "libiberty.h"
#include "gprof.h"
#include "corefile.h"
@ -13,7 +34,8 @@ int min_insn_size;
int offset_to_code;
/* For mapping symbols to specific .o files during file ordering. */
struct function_map {
struct function_map
{
char *function_name;
char *file_name;
};
@ -21,9 +43,9 @@ struct function_map {
struct function_map *symbol_map;
unsigned int symbol_map_count;
extern void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
@ -112,6 +134,7 @@ DEFUN (read_function_mappings, (filename), const char *filename)
symbol_map_count = count;
}
void
DEFUN (core_init, (a_out_name), const char *a_out_name)
{
@ -130,7 +153,7 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
done (1);
}
/* get core's text section: */
/* Get core's text section. */
core_text_sect = bfd_get_section_by_name (core_bfd, ".text");
if (!core_text_sect)
{
@ -143,9 +166,9 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
}
}
/* read core's symbol table: */
/* Read core's symbol table. */
/* this will probably give us more than we need, but that's ok: */
/* This will probably give us more than we need, but that's ok. */
core_num_syms = bfd_get_symtab_upper_bound (core_bfd);
if (core_num_syms < 0)
{
@ -156,6 +179,7 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
core_syms = (asymbol **) xmalloc (core_num_syms);
core_num_syms = bfd_canonicalize_symtab (core_bfd, core_syms);
if (core_num_syms < 0)
{
fprintf (stderr, "%s: %s: %s\n", whoami, a_out_name,
@ -185,10 +209,8 @@ DEFUN (core_init, (a_out_name), const char *a_out_name)
read_function_mappings (function_mapping_file);
}
/* Read in the text space of an a.out file. */
/*
* Read in the text space of an a.out file
*/
void
DEFUN (core_get_text_space, (core_bfd), bfd * core_bfd)
{
@ -200,6 +222,7 @@ DEFUN (core_get_text_space, (core_bfd), bfd * core_bfd)
whoami, (unsigned long) core_text_sect->_raw_size);
done (1);
}
if (!bfd_get_section_contents (core_bfd, core_text_sect, core_text_space,
0, core_text_sect->_raw_size))
{
@ -207,10 +230,9 @@ DEFUN (core_get_text_space, (core_bfd), bfd * core_bfd)
free (core_text_space);
core_text_space = 0;
}
if (!core_text_space)
{
fprintf (stderr, _("%s: can't do -c\n"), whoami);
}
fprintf (stderr, _("%s: can't do -c\n"), whoami);
}
@ -249,12 +271,11 @@ DEFUN (find_call, (parent, p_lowpc, p_highpc),
}
}
/*
* Return class of symbol SYM. The returned class can be any of:
* 0 -> symbol is not interesting to us
* 'T' -> symbol is a global name
* 't' -> symbol is a local (static) name
*/
/* Return class of symbol SYM. The returned class can be any of:
0 -> symbol is not interesting to us
'T' -> symbol is a global name
't' -> symbol is a local (static) name. */
static int
DEFUN (core_sym_class, (sym), asymbol * sym)
{
@ -264,14 +285,10 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
int i;
if (sym->section == NULL || (sym->flags & BSF_DEBUGGING) != 0)
{
return 0;
}
return 0;
/*
* Must be a text symbol, and static text symbols don't qualify if
* ignore_static_funcs set.
*/
/* Must be a text symbol, and static text symbols
don't qualify if ignore_static_funcs set. */
if (ignore_static_funcs && (sym->flags & BSF_LOCAL))
{
DBG (AOUTDEBUG, printf ("[core_sym_class] %s: not a function\n",
@ -283,81 +300,65 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
i = syminfo.type;
if (i == 'T')
{
return i; /* it's a global symbol */
}
return i; /* It's a global symbol. */
if (i == 'W')
{
/* Treat weak symbols as text symbols. FIXME: a weak symbol may
also be a data symbol. */
return 'T';
}
/* Treat weak symbols as text symbols. FIXME: a weak symbol may
also be a data symbol. */
return 'T';
if (i != 't')
{
/* not a static text symbol */
/* Not a static text symbol. */
DBG (AOUTDEBUG, printf ("[core_sym_class] %s is of class %c\n",
sym->name, i));
return 0;
}
/* do some more filtering on static function-names: */
/* Do some more filtering on static function-names. */
if (ignore_static_funcs)
{
return 0;
}
/*
* Can't zero-length name or funny characters in name, where
* `funny' includes: `.' (.o file names) and `$' (Pascal labels).
*/
return 0;
/* Can't zero-length name or funny characters in name, where
`funny' includes: `.' (.o file names) and `$' (Pascal labels). */
if (!sym->name || sym->name[0] == '\0')
{
return 0;
}
return 0;
for (name = sym->name; *name; ++name)
{
if (*name == '.' || *name == '$')
{
return 0;
}
return 0;
}
/*
* On systems where the C compiler adds an underscore to all
* names, static names without underscores seem usually to be
* labels in hand written assembler in the library. We don't want
* these names. This is certainly necessary on a Sparc running
* SunOS 4.1 (try profiling a program that does a lot of
* division). I don't know whether it has harmful side effects on
* other systems. Perhaps it should be made configurable.
*/
/* On systems where the C compiler adds an underscore to all
names, static names without underscores seem usually to be
labels in hand written assembler in the library. We don't want
these names. This is certainly necessary on a Sparc running
SunOS 4.1 (try profiling a program that does a lot of
division). I don't know whether it has harmful side effects on
other systems. Perhaps it should be made configurable. */
sym_prefix = bfd_get_symbol_leading_char (core_bfd);
if ((sym_prefix && sym_prefix != sym->name[0])
/*
* GCC may add special symbols to help gdb figure out the file
* language. We want to ignore these, since sometimes they mask
* the real function. (dj@ctron)
*/
/* GCC may add special symbols to help gdb figure out the file
language. We want to ignore these, since sometimes they mask
the real function. (dj@ctron) */
|| !strncmp (sym->name, "__gnu_compiled", 14)
|| !strncmp (sym->name, "___gnu_compiled", 15))
{
return 0;
}
/* If the object file supports marking of function symbols, then we can
zap anything that doesn't have BSF_FUNCTION set. */
/* If the object file supports marking of function symbols, then
we can zap anything that doesn't have BSF_FUNCTION set. */
if (ignore_non_functions && (sym->flags & BSF_FUNCTION) == 0)
return 0;
return 't'; /* it's a static text symbol */
return 't'; /* It's a static text symbol. */
}
/* Get whatever source info we can get regarding address ADDR. */
/*
* Get whatever source info we can get regarding address ADDR:
*/
static bool
DEFUN (get_src_info, (addr, filename, name, line_num),
bfd_vma addr AND const char **filename AND const char **name
@ -387,11 +388,9 @@ DEFUN (get_src_info, (addr, filename, name, line_num),
}
}
/* Read in symbol table from core.
One symbol per function is entered. */
/*
* Read in symbol table from core. One symbol per function is
* entered.
*/
void
core_create_function_syms (core_bfd)
bfd *core_bfd ATTRIBUTE_UNUSED;
@ -401,14 +400,13 @@ core_create_function_syms (core_bfd)
long i, found, skip;
unsigned int j;
/* pass 1 - determine upper bound on number of function names: */
/* Pass 1 - determine upper bound on number of function names. */
symtab.len = 0;
for (i = 0; i < core_num_syms; ++i)
{
if (!core_sym_class (core_syms[i]))
{
continue;
}
continue;
/* This should be replaced with a binary search or hashed
search. Gross.
@ -425,6 +423,7 @@ core_create_function_syms (core_bfd)
skip = 1;
break;
}
if (!skip)
++symtab.len;
}
@ -435,15 +434,16 @@ core_create_function_syms (core_bfd)
done (1);
}
/* the "+ 2" is for the sentinels: */
/* The "+ 2" is for the sentinels. */
symtab.base = (Sym *) xmalloc ((symtab.len + 2) * sizeof (Sym));
/* pass 2 - create symbols: */
/* Pass 2 - create symbols. */
symtab.limit = symtab.base;
for (i = 0; i < core_num_syms; ++i)
{
class = core_sym_class (core_syms[i]);
if (!class)
{
DBG (AOUTDEBUG,
@ -452,11 +452,12 @@ core_create_function_syms (core_bfd)
core_syms[i]->name));
continue;
}
/* This should be replaced with a binary search or hashed
search. Gross. */
skip = 0;
found = 0;
for (j = 0; j < symbol_map_count; j++)
if (!strcmp (core_syms[i]->name, symbol_map[j].function_name))
{
@ -473,9 +474,9 @@ core_create_function_syms (core_bfd)
sym_init (symtab.limit);
/* symbol offsets are always section-relative: */
/* Symbol offsets are always section-relative. */
symtab.limit->addr = core_syms[i]->value + core_syms[i]->section->vma;
if (symbol_map_count
&& !strcmp (core_syms[i]->name, symbol_map[found].function_name))
{
@ -488,8 +489,7 @@ core_create_function_syms (core_bfd)
symtab.limit->mapped = 0;
}
/* Lookup filename and line number, if we can */
/* Lookup filename and line number, if we can. */
{
const char *filename, *func_name;
@ -501,22 +501,18 @@ core_create_function_syms (core_bfd)
/* FIXME: Checking __osf__ here does not work with a cross
gprof. */
#ifdef __osf__
/*
* Suppress symbols that are not function names. This is
* useful to suppress code-labels and aliases.
*
* This is known to be useful under DEC's OSF/1. Under SunOS 4.x,
* labels do not appear in the symbol table info, so this isn't
* necessary.
*/
/* Suppress symbols that are not function names. This is
useful to suppress code-labels and aliases.
This is known to be useful under DEC's OSF/1. Under SunOS 4.x,
labels do not appear in the symbol table info, so this isn't
necessary. */
if (strcmp (symtab.limit->name, func_name) != 0)
{
/*
* The symbol's address maps to a different name, so
* it can't be a function-entry point. This happens
* for labels, for example.
*/
/* The symbol's address maps to a different name, so
it can't be a function-entry point. This happens
for labels, for example. */
DBG (AOUTDEBUG,
printf ("[core_create_function_syms: rej %s (maps to %s)\n",
symtab.limit->name, func_name));
@ -528,23 +524,18 @@ core_create_function_syms (core_bfd)
symtab.limit->is_func = TRUE;
symtab.limit->is_bb_head = TRUE;
if (class == 't')
{
symtab.limit->is_static = TRUE;
}
symtab.limit->is_static = TRUE;
min_vma = MIN (symtab.limit->addr, min_vma);
max_vma = MAX (symtab.limit->addr, max_vma);
/*
* If we see "main" without an initial '_', we assume names
* are *not* prefixed by '_'.
*/
/* If we see "main" without an initial '_', we assume names
are *not* prefixed by '_'. */
if (symtab.limit->name[0] == 'm' && discard_underscores
&& strcmp (symtab.limit->name, "main") == 0)
{
discard_underscores = 0;
}
discard_underscores = 0;
DBG (AOUTDEBUG, printf ("[core_create_function_syms] %ld %s 0x%lx\n",
(long) (symtab.limit - symtab.base),
@ -553,8 +544,7 @@ core_create_function_syms (core_bfd)
++symtab.limit;
}
/* create sentinels: */
/* Create sentinels. */
sym_init (symtab.limit);
symtab.limit->name = "<locore>";
symtab.limit->addr = 0;
@ -571,11 +561,9 @@ core_create_function_syms (core_bfd)
symtab_finalize (&symtab);
}
/* Read in symbol table from core.
One symbol per line of source code is entered. */
/*
* Read in symbol table from core. One symbol per line of source code
* is entered.
*/
void
DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
{
@ -587,43 +575,40 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
const char *filename;
int prev_line_num;
Sym_Table ltab;
/*
* Create symbols for functions as usual. This is necessary in
* cases where parts of a program were not compiled with -g. For
* those parts we still want to get info at the function level:
*/
/* Create symbols for functions as usual. This is necessary in
cases where parts of a program were not compiled with -g. For
those parts we still want to get info at the function level. */
core_create_function_syms (core_bfd);
/* pass 1 - counter number of symbols: */
/* Pass 1 - counter number of symbols. */
/*
* To find all line information, walk through all possible
* text-space addresses (one by one!) and get the debugging
* info for each address. When the debugging info changes,
* it is time to create a new symbol.
*
* Of course, this is rather slow and it would be better if
* bfd would provide an iterator for enumerating all line infos
*/
/* To find all line information, walk through all possible
text-space addresses (one by one!) and get the debugging
info for each address. When the debugging info changes,
it is time to create a new symbol.
Of course, this is rather slow and it would be better if
bfd would provide an iterator for enumerating all line infos. */
prev_name_len = PATH_MAX;
prev_filename_len = PATH_MAX;
prev_name = xmalloc (prev_name_len);
prev_filename = xmalloc (prev_filename_len);
ltab.len = 0;
prev_line_num = 0;
for (offset = 0; offset < core_text_sect->_raw_size; offset += min_insn_size)
{
int len;
vma = core_text_sect->vma + offset;
if (!get_src_info (vma, &filename, &dummy.name, &dummy.line_num)
|| (prev_line_num == dummy.line_num
&& prev_name != NULL
&& strcmp (prev_name, dummy.name) == 0
&& strcmp (prev_filename, filename) == 0))
{
continue;
}
continue;
++ltab.len;
prev_line_num = dummy.line_num;
@ -635,15 +620,17 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
free (prev_name);
prev_name = xmalloc (prev_name_len);
}
strcpy (prev_name, dummy.name);
len = strlen (filename);
if (len >= prev_filename_len)
{
prev_filename_len = len + 1024;
free (prev_filename);
prev_filename = xmalloc (prev_filename_len);
}
strcpy (prev_filename, filename);
min_vma = MIN (vma, min_vma);
@ -653,12 +640,12 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
free (prev_name);
free (prev_filename);
/* make room for function symbols, too: */
/* Make room for function symbols, too. */
ltab.len += symtab.len;
ltab.base = (Sym *) xmalloc (ltab.len * sizeof (Sym));
ltab.limit = ltab.base;
/* pass 2 - create symbols: */
/* Pass 2 - create symbols. */
/* We now set is_static as we go along, rather than by running
through the symbol table at the end.
@ -676,31 +663,28 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
Perhaps symtab_finalize should be modified to make this
distinction as well, but the current fix works and the code is a
lot cleaner now. */
prev = 0;
for (offset = 0; offset < core_text_sect->_raw_size; offset += min_insn_size)
{
sym_init (ltab.limit);
if (!get_src_info (core_text_sect->vma + offset, &filename,
&ltab.limit->name, &ltab.limit->line_num)
|| (prev && prev->line_num == ltab.limit->line_num
&& strcmp (prev->name, ltab.limit->name) == 0
&& strcmp (prev->file->name, filename) == 0))
{
continue;
}
continue;
/* make name pointer a malloc'ed string: */
/* Make name pointer a malloc'ed string. */
ltab.limit->name = xstrdup (ltab.limit->name);
ltab.limit->file = source_file_lookup_path (filename);
ltab.limit->addr = core_text_sect->vma + offset;
/* Set is_static based on the enclosing function, using either:
* 1) the previous symbol, if it's from the same function, or
* 2) a symtab lookup
*/
1) the previous symbol, if it's from the same function, or
2) a symtab lookup. */
if (prev && ltab.limit->file == prev->file &&
strcmp (ltab.limit->name, prev->name) == 0)
{
@ -714,15 +698,11 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
prev = ltab.limit;
/*
* If we see "main" without an initial '_', we assume names
* are *not* prefixed by '_'.
*/
/* If we see "main" without an initial '_', we assume names
are *not* prefixed by '_'. */
if (ltab.limit->name[0] == 'm' && discard_underscores
&& strcmp (ltab.limit->name, "main") == 0)
{
discard_underscores = 0;
}
discard_underscores = 0;
DBG (AOUTDEBUG, printf ("[core_create_line_syms] %lu %s 0x%lx\n",
(unsigned long) (ltab.limit - ltab.base),
@ -731,22 +711,19 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
++ltab.limit;
}
/* update sentinels: */
/* Update sentinels. */
sentinel = sym_lookup (&symtab, 0);
if (strcmp (sentinel->name, "<locore>") == 0
&& min_vma <= sentinel->end_addr)
{
sentinel->end_addr = min_vma - 1;
}
sentinel->end_addr = min_vma - 1;
sentinel = sym_lookup (&symtab, ~0);
if (strcmp (sentinel->name, "<hicore>") == 0 && max_vma >= sentinel->addr)
{
sentinel->addr = max_vma + 1;
}
sentinel->addr = max_vma + 1;
/* copy in function symbols: */
/* Copy in function symbols. */
memcpy (ltab.limit, symtab.base, symtab.len * sizeof (Sym));
ltab.limit += symtab.len;
@ -758,10 +735,8 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
done (1);
}
/* finalize ltab and make it symbol table: */
/* Finalize ltab and make it symbol table. */
symtab_finalize (&ltab);
free (symtab.base);
symtab = ltab;
}

View File

@ -1,6 +1,24 @@
/*
* Input and output from/to gmon.out files.
*/
/* gmon_io.c - Input and output from/to gmon.out files.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "cg_arcs.h"
#include "basic_blocks.h"
#include "bfd.h"
@ -8,18 +26,17 @@
#include "call_graph.h"
#include "gmon_io.h"
#include "gmon_out.h"
#include "gmon.h" /* fetch header for old format */
#include "gmon.h" /* Fetch header for old format. */
#include "gprof.h"
#include "hertz.h"
#include "hist.h"
#include "libiberty.h"
int gmon_input = 0;
int gmon_file_version = 0; /* 0 == old (non-versioned) file format */
int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */
/* This probably ought to be in libbfd. */
/*
* This probably ought to be in libbfd.
*/
bfd_vma
DEFUN (get_vma, (abfd, addr), bfd * abfd AND bfd_byte * addr)
{
@ -37,9 +54,8 @@ DEFUN (get_vma, (abfd, addr), bfd * abfd AND bfd_byte * addr)
}
/*
* This probably ought to be in libbfd.
*/
/* This probably ought to be in libbfd. */
void
DEFUN (put_vma, (abfd, val, addr), bfd * abfd AND bfd_vma val AND bfd_byte * addr)
{
@ -67,8 +83,7 @@ DEFUN (gmon_out_read, (filename), const char *filename)
unsigned char tag;
int nhist = 0, narcs = 0, nbbs = 0;
/* open gmon.out file: */
/* Open gmon.out file. */
if (strcmp (filename, "-") == 0)
{
ifp = stdin;
@ -79,12 +94,14 @@ DEFUN (gmon_out_read, (filename), const char *filename)
else
{
ifp = fopen (filename, FOPEN_RB);
if (!ifp)
{
perror (filename);
done (1);
}
}
if (fread (&ghdr, sizeof (struct gmon_hdr), 1, ifp) != 1)
{
fprintf (stderr, _("%s: file too short to be a gmon file\n"),
@ -102,9 +119,9 @@ DEFUN (gmon_out_read, (filename), const char *filename)
done (1);
}
/* right magic, so it's probably really a new gmon.out file */
/* Right magic, so it's probably really a new gmon.out file. */
gmon_file_version = bfd_get_32 (core_bfd, (bfd_byte *) ghdr.version);
if (gmon_file_version != GMON_VERSION && gmon_file_version != 0)
{
fprintf (stderr,
@ -113,7 +130,7 @@ DEFUN (gmon_out_read, (filename), const char *filename)
done (1);
}
/* read in all the records: */
/* Read in all the records. */
while (fread (&tag, sizeof (tag), 1, ifp) == 1)
{
switch (tag)
@ -163,22 +180,19 @@ DEFUN (gmon_out_read, (filename), const char *filename)
UNIT raw_bin_count;
struct hdr tmp;
/*
* Information from a gmon.out file is in two parts: an array of
* sampling hits within pc ranges, and the arcs.
*/
/* Information from a gmon.out file is in two parts: an array of
sampling hits within pc ranges, and the arcs. */
gmon_input = INPUT_HISTOGRAM | INPUT_CALL_GRAPH;
/*
* This fseek() ought to work even on stdin as long as it's
* not an interactive device (heck, is there anybody who would
* want to type in a gmon.out at the terminal?).
*/
/* This fseek() ought to work even on stdin as long as it's
not an interactive device (heck, is there anybody who would
want to type in a gmon.out at the terminal?). */
if (fseek (ifp, 0, SEEK_SET) < 0)
{
perror (filename);
done (1);
}
if (fread (&raw, 1, sizeof (struct raw_phdr), ifp)
!= sizeof (struct raw_phdr))
{
@ -186,6 +200,7 @@ DEFUN (gmon_out_read, (filename), const char *filename)
filename);
done (1);
}
tmp.low_pc = get_vma (core_bfd, (bfd_byte *) &raw.low_pc[0]);
tmp.high_pc = get_vma (core_bfd, (bfd_byte *) &raw.high_pc[0]);
tmp.ncnt = bfd_get_32 (core_bfd, (bfd_byte *) &raw.ncnt[0]);
@ -196,8 +211,8 @@ DEFUN (gmon_out_read, (filename), const char *filename)
int profrate;
/* 4.4BSD format header. */
profrate = bfd_get_32 (core_bfd, (bfd_byte *) &raw.profrate[0]);
if (!s_highpc)
hz = profrate;
else if (hz != profrate)
@ -212,7 +227,7 @@ DEFUN (gmon_out_read, (filename), const char *filename)
}
else
{
/* old style BSD format. */
/* Old style BSD format. */
if (file_format == FF_BSD44)
{
fprintf (stderr, _("%s: file `%s' has bad magic cookie\n"),
@ -236,6 +251,7 @@ DEFUN (gmon_out_read, (filename), const char *filename)
filename);
done (1);
}
h = tmp;
s_lowpc = (bfd_vma) h.low_pc;
s_highpc = (bfd_vma) h.high_pc;
@ -243,6 +259,7 @@ DEFUN (gmon_out_read, (filename), const char *filename)
highpc = (bfd_vma) h.high_pc / sizeof (UNIT);
samp_bytes = h.ncnt - header_size;
hist_num_bins = samp_bytes / sizeof (UNIT);
DBG (SAMPLEDEBUG,
printf ("[gmon_out_read] lowpc 0x%lx highpc 0x%lx ncnt %d\n",
(unsigned long) h.low_pc, (unsigned long) h.high_pc,
@ -264,14 +281,13 @@ DEFUN (gmon_out_read, (filename), const char *filename)
}
if (hist_num_bins)
{
++nhist;
}
++nhist;
if (!hist_sample)
{
hist_sample =
(int *) xmalloc (hist_num_bins * sizeof (hist_sample[0]));
memset (hist_sample, 0, hist_num_bins * sizeof (hist_sample[0]));
}
@ -284,13 +300,12 @@ DEFUN (gmon_out_read, (filename), const char *filename)
whoami, --i, hist_num_bins);
done (1);
}
hist_sample[i] += bfd_get_16 (core_bfd, (bfd_byte *) raw_bin_count);
}
/*
* The rest of the file consists of a bunch of <from,self,count>
* tuples:
*/
/* The rest of the file consists of a bunch of
<from,self,count> tuples. */
while (fread (&raw_arc, sizeof (raw_arc), 1, ifp) == 1)
{
++narcs;
@ -301,21 +316,23 @@ DEFUN (gmon_out_read, (filename), const char *filename)
#else
count = bfd_get_32 (core_bfd, (bfd_byte *) raw_arc.count);
#endif
DBG (SAMPLEDEBUG,
printf ("[gmon_out_read] frompc 0x%lx selfpc 0x%lx count %lu\n",
(unsigned long) from_pc, (unsigned long) self_pc, count));
/* add this arc: */
/* Add this arc. */
cg_tally (from_pc, self_pc, count);
}
fclose (ifp);
if (hz == HZ_WRONG)
{
/*
* How many ticks per second? If we can't tell, report
* time in ticks.
*/
/* How many ticks per second? If we can't tell, report
time in ticks. */
hz = hertz ();
if (hz == HZ_WRONG)
{
hz = 1;
@ -360,33 +377,28 @@ DEFUN (gmon_out_write, (filename), const char *filename)
if (file_format == FF_AUTO || file_format == FF_MAGIC)
{
/* write gmon header: */
/* Write gmon header. */
memcpy (&ghdr.cookie[0], GMON_MAGIC, 4);
bfd_put_32 (core_bfd, GMON_VERSION, (bfd_byte *) ghdr.version);
if (fwrite (&ghdr, sizeof (ghdr), 1, ofp) != 1)
{
perror (filename);
done (1);
}
/* write execution time histogram if we have one: */
/* Write execution time histogram if we have one. */
if (gmon_input & INPUT_HISTOGRAM)
{
hist_write_hist (ofp, filename);
}
hist_write_hist (ofp, filename);
/* write call graph arcs if we have any: */
/* Write call graph arcs if we have any. */
if (gmon_input & INPUT_CALL_GRAPH)
{
cg_write_arcs (ofp, filename);
}
cg_write_arcs (ofp, filename);
/* write basic-block info if we have it: */
/* Write basic-block info if we have it. */
if (gmon_input & INPUT_BB_COUNTS)
{
bb_write_blocks (ofp, filename);
}
bb_write_blocks (ofp, filename);
}
else if (file_format == FF_BSD || file_format == FF_BSD44)
{
@ -427,8 +439,7 @@ DEFUN (gmon_out_write, (filename), const char *filename)
}
}
/* dump the samples: */
/* Dump the samples. */
for (i = 0; i < hist_num_bins; ++i)
{
bfd_put_16 (core_bfd, hist_sample[i], (bfd_byte *) & raw_bin_count[0]);
@ -439,8 +450,7 @@ DEFUN (gmon_out_write, (filename), const char *filename)
}
}
/* dump the normalized raw arc information: */
/* Dump the normalized raw arc information. */
for (sym = symtab.base; sym < symtab.limit; ++sym)
{
for (arc = sym->cg.children; arc; arc = arc->next_child)
@ -461,6 +471,7 @@ DEFUN (gmon_out_write, (filename), const char *filename)
(unsigned long) arc->child->addr, arc->count));
}
}
fclose (ofp);
}
else

View File

@ -389,13 +389,29 @@ struct reloc_ext_external {
bfd_byte r_addend[BYTES_IN_WORD]; /* datum addend */
};
#ifndef RELOC_EXT_BITS_EXTERN_BIG
#define RELOC_EXT_BITS_EXTERN_BIG ((unsigned int) 0x80)
#define RELOC_EXT_BITS_EXTERN_LITTLE ((unsigned int) 0x01)
#endif
#ifndef RELOC_EXT_BITS_EXTERN_LITTLE
#define RELOC_EXT_BITS_EXTERN_LITTLE ((unsigned int) 0x01)
#endif
#ifndef RELOC_EXT_BITS_TYPE_BIG
#define RELOC_EXT_BITS_TYPE_BIG ((unsigned int) 0x1F)
#endif
#ifndef RELOC_EXT_BITS_TYPE_SH_BIG
#define RELOC_EXT_BITS_TYPE_SH_BIG 0
#endif
#ifndef RELOC_EXT_BITS_TYPE_LITTLE
#define RELOC_EXT_BITS_TYPE_LITTLE ((unsigned int) 0xF8)
#endif
#ifndef RELOC_EXT_BITS_TYPE_SH_LITTLE
#define RELOC_EXT_BITS_TYPE_SH_LITTLE 3
#endif
/* Bytes per relocation entry */
#define RELOC_EXT_SIZE (BYTES_IN_WORD + 3 + 1 + BYTES_IN_WORD)

View File

@ -1,88 +0,0 @@
/* ARM ELF support for BFD.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _ELF_ARM_H
#define _ELF_ARM_H
#include "elf/reloc-macros.h"
/* Processor specific flags for the ELF header e_flags field. */
#define EF_ARM_RELEXEC 0x01
#define EF_ARM_HASENTRY 0x02
#define EF_INTERWORK 0x04
#define EF_APCS_26 0x08
#define EF_APCS_FLOAT 0x10
#define EF_PIC 0x20
#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use. */
#define EF_NEW_ABI 0x80
#define EF_OLD_ABI 0x100
/* Local aliases for some flags to match names used by COFF port. */
#define F_INTERWORK EF_INTERWORK
#define F_APCS26 EF_APCS_26
#define F_APCS_FLOAT EF_APCS_FLOAT
#define F_PIC EF_PIC
/* Additional symbol types for Thumb. */
#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
/* ARM-specific values for sh_flags. */
#define SHF_ENTRYSECT 0x10000000 /* Section contains an entry point. */
#define SHF_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step. */
/* ARM-specific program header flags. */
#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base. */
/* Relocation types. */
START_RELOC_NUMBERS (elf_arm_reloc_type)
RELOC_NUMBER (R_ARM_NONE, 0)
RELOC_NUMBER (R_ARM_PC24, 1)
RELOC_NUMBER (R_ARM_ABS32, 2)
RELOC_NUMBER (R_ARM_REL32, 3)
RELOC_NUMBER (R_ARM_ABS8, 4)
RELOC_NUMBER (R_ARM_ABS16, 5)
RELOC_NUMBER (R_ARM_ABS12, 6)
RELOC_NUMBER (R_ARM_THM_ABS5, 7)
RELOC_NUMBER (R_ARM_THM_PC22, 8)
RELOC_NUMBER (R_ARM_SBREL32, 9)
RELOC_NUMBER (R_ARM_AMP_VCALL9, 10)
RELOC_NUMBER (R_ARM_THM_PC11, 11) /* Cygnus extension to abi: Thumb unconditional branch. */
RELOC_NUMBER (R_ARM_THM_PC9, 12) /* Cygnus extension to abi: Thumb conditional branch. */
RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 13)
RELOC_NUMBER (R_ARM_GNU_VTENTRY, 14)
RELOC_NUMBER (R_ARM_COPY, 20) /* Copy symbol at runtime. */
RELOC_NUMBER (R_ARM_GLOB_DAT, 21) /* Create GOT entry. */
RELOC_NUMBER (R_ARM_JUMP_SLOT, 22) /* Create PLT entry. */
RELOC_NUMBER (R_ARM_RELATIVE, 23) /* Adjust by program base. */
RELOC_NUMBER (R_ARM_GOTOFF, 24) /* 32 bit offset to GOT. */
RELOC_NUMBER (R_ARM_GOTPC, 25) /* 32 bit PC relative offset to GOT. */
RELOC_NUMBER (R_ARM_GOT32, 26) /* 32 bit GOT entry. */
RELOC_NUMBER (R_ARM_PLT32, 27) /* 32 bit PLT address. */
FAKE_RELOC (FIRST_INVALID_RELOC, 28)
FAKE_RELOC (LAST_INVALID_RELOC, 249)
RELOC_NUMBER (R_ARM_RSBREL32, 250)
RELOC_NUMBER (R_ARM_THM_RPC22, 251)
RELOC_NUMBER (R_ARM_RREL32, 252)
RELOC_NUMBER (R_ARM_RABS32, 253)
RELOC_NUMBER (R_ARM_RPC24, 254)
RELOC_NUMBER (R_ARM_RBASE, 255)
END_RELOC_NUMBERS
#endif

View File

@ -16,6 +16,13 @@ extern "C" {
#include "ansidecl.h"
#ifdef ANSI_PROTOTYPES
/* Get a definition for size_t. */
#include <stddef.h>
/* Get a definition for va_list. */
#include <stdarg.h>
#endif
/* Build an argument vector from a string. Allocates memory using
malloc. Use freeargv to free the vector. */
@ -36,10 +43,17 @@ extern char **dupargv PARAMS ((char **)) ATTRIBUTE_MALLOC;
across different systems, sometimes as "char *" and sometimes as
"const char *" */
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined(__NetBSD__) || defined (__OpenBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__)
/* HAVE_DECL_* is a three-state macro: undefined, 0 or 1. If it is
undefined, we haven't run the autoconf check so provide the
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || (defined (HAVE_DECL_BASENAME) && !HAVE_DECL_BASENAME)
extern char *basename PARAMS ((const char *));
#else
# if !defined (HAVE_DECL_BASENAME)
extern char *basename ();
# endif
#endif
/* Concatenate an arbitrary number of strings, up to (char *) NULL.
@ -123,16 +137,13 @@ extern void xexit PARAMS ((int status)) ATTRIBUTE_NORETURN;
extern void xmalloc_set_program_name PARAMS ((const char *));
/* Report an allocation failure. */
extern void xmalloc_failed PARAMS ((size_t)) ATTRIBUTE_NORETURN;
/* Allocate memory without fail. If malloc fails, this will print a
message to stderr (using the name set by xmalloc_set_program_name,
if any) and then call xexit. */
#ifdef ANSI_PROTOTYPES
/* Get a definition for size_t. */
#include <stddef.h>
/* Get a definition for va_list. */
#include <stdarg.h>
#endif
extern PTR xmalloc PARAMS ((size_t)) ATTRIBUTE_MALLOC;
/* Reallocate memory without fail. This works like xmalloc. Note,
@ -193,6 +204,8 @@ extern int asprintf PARAMS ((char **, const char *, ...)) ATTRIBUTE_PRINTF_2;
extern int vasprintf PARAMS ((char **, const char *, va_list))
ATTRIBUTE_PRINTF(2,0);
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
#ifdef __cplusplus
}
#endif

View File

@ -13,6 +13,9 @@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bis
YFLAGS = -d
LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
WARN_CFLAGS = @WARN_CFLAGS@
AM_CFLAGS = $(WARN_CFLAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
@ -101,52 +104,59 @@ ALL_EMULATIONS = \
eaixrs6.o \
ealpha.o \
earcelf.o \
earmelf.o \
earmelf_oabi.o \
earmelf_linux.o \
earmelf_linux26.o \
earm_epoc_pe.o \
earmaoutb.o \
earmaoutl.o \
earmcoff.o \
earmelf.o \
earmelf_linux.o \
earmelf_oabi.o \
earmnbsd.o \
earmpe.o \
earm_epoc_pe.o \
eavr1200.o \
eavr23xx.o \
eavr44x4.o \
eavr4433.o \
eavr44x4.o \
eavr85xx.o \
eavrmega603.o \
eavrmega103.o \
eavrmega161.o \
eavrmega603.o \
ecoff_sparc.o \
ecrisaout.o \
ecriself.o \
ecrislinux.o \
ed10velf.o \
ed30velf.o \
ed30v_e.o \
ed30v_o.o \
ed30velf.o \
edelta68.o \
eebmon29k.o \
eelf32_sparc.o \
eelf32_i960.o \
eelf32_i860.o \
eelf32_sparc.o \
eelf32b4300.o \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
eelf32ebmip.o \
eelf32elmip.o \
eelf32bmipn32.o \
eelf32fr30.o \
eelf32i370.o \
eelf32l4300.o \
eelf32lmip.o \
eelf32lppc.o \
eelf32lppcsim.o \
eelf32mcore.o \
eelf32ppc.o \
eelf32ppclinux.o \
eelf32ppcsim.o \
eelf32shlunx.o \
eelf32shunx.o \
eelf_i386.o \
eelf_i386_be.o \
eelf_i386_chaos.o \
egld960.o \
egld960coff.o \
eelf32fr30.o \
eelf32mcore.o \
eh8300.o \
eh8300h.o \
eh8300s.o \
@ -157,6 +167,8 @@ ALL_EMULATIONS = \
eh8500s.o \
ehp300bsd.o \
ehp3hpux.o \
ehppaelf.o \
ehppalinux.o \
ei386aout.o \
ei386beos.o \
ei386bsd.o \
@ -172,6 +184,10 @@ ALL_EMULATIONS = \
ei386pe.o \
ei386pe_posix.o \
elnk960.o \
em68hc11elf.o \
em68hc11elfb.o \
em68hc12elf.o \
em68hc12elfb.o \
em68k4knbsd.o \
em68kaout.o \
em68kaux.o \
@ -191,10 +207,10 @@ ALL_EMULATIONS = \
emipslnews.o \
emipspe.o \
enews.o \
epjelf.o \
epjlelf.o \
ens32knbsd.o \
epc532macha.o \
epjelf.o \
epjlelf.o \
eppcmacos.o \
eppcnw.o \
eppcpe.o \
@ -202,9 +218,11 @@ ALL_EMULATIONS = \
esa29200.o \
esh.o \
eshelf.o \
eshelf_linux.o \
eshlelf_linux.o \
eshl.o \
eshlelf.o \
eshlunx.o \
eshl.o \
eshpe.o \
eshunx.o \
esparcaout.o \
@ -216,6 +234,7 @@ ALL_EMULATIONS = \
esun4.o \
etic30aout.o \
etic30coff.o \
etic54xcoff.o \
etic80coff.o \
evanilla.o \
evax.o \
@ -225,13 +244,16 @@ ALL_EMULATIONS = \
ez8002.o
ALL_64_EMULATIONS = \
eelf64_ia64.o \
eelf_x86_64.o \
eelf64_sparc.o \
eelf64alpha.o \
eelf64bmip.o
eelf64bmip.o \
eelf64hppa.o
ALL_EMUL_EXTRA_OFILES = \
pe-dll.o \
deffilep.o
deffilep.o \
pe-dll.o
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
@ -283,7 +305,7 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
# These all start with e so 'make clean' can find them.
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${exec_prefix} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
@TDIRS@
@ -303,17 +325,16 @@ earcelf.c: $(srcdir)/emulparams/arcelf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} arcelf "$(tdir_arcelf)"
earmelf.c: $(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf "$(tdir_armelf)"
earmelf_oabi.c: $(srcdir)/emulparams/armelf_oabi.sh \
$(srcdir)/emultempl/armelf_oabi.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_oabi "$(tdir_armelf)"
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
earmelf_linux26.c: $(srcdir)/emulparams/armelf_linux26.sh \
$(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux26 "$(tdir_armelf_linux26)"
earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
@ -367,6 +388,15 @@ eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS}
${GENSCRIPTS} crisaout "$(tdir_cris)"
ecriself.c: $(srcdir)/emulparams/criself.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} criself "$(tdir_cris)"
ecrislinux.c: $(srcdir)/emulparams/crislinux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} crislinux "$(tdir_cris)"
ed10velf.c: $(srcdir)/emulparams/d10velf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS}
${GENSCRIPTS} d10velf "$(tdir_d10v)"
@ -397,6 +427,9 @@ em32relf.c: $(srcdir)/emulparams/m32relf.sh \
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
@ -409,6 +442,9 @@ eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
@ -425,16 +461,22 @@ eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppcsim "$(tdir_elf32ppcsim)"
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
@ -442,6 +484,12 @@ eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)"
eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)"
eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
@ -451,9 +499,15 @@ eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
egld960.c: $(srcdir)/emulparams/gld960.sh \
$(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
${GENSCRIPTS} gld960 "$(tdir_gld960)"
@ -490,6 +544,14 @@ ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/hppaelf.em \
$(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
ehppalinux.c: $(srcdir)/emulparams/hppalinux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/hppaelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} hppalinux "$(tdir_hppalinux)"
ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386aout "$(tdir_i386aout)"
@ -535,6 +597,18 @@ ei386pe_posix.c: $(srcdir)/emulparams/i386pe_posix.sh \
elnk960.c: $(srcdir)/emulparams/lnk960.sh \
$(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
@ -545,10 +619,11 @@ em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/m68kcoff.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
@ -631,6 +706,12 @@ esh.c: $(srcdir)/emulparams/sh.sh \
eshelf.c: $(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf "$(tdir_shelf)"
eshelf_linux.c: $(srcdir)/emulparams/shelf_linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_linux "$(tdir_shelf_linux)"
eshlelf_linux.c: $(srcdir)/emulparams/shlelf_linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_linux "$(tdir_shlelf_linux)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf "$(tdir_shlelf)"
@ -679,6 +760,9 @@ etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
etic54xcoff.c: $(srcdir)/emulparams/tic54xcoff.sh \
$(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic54xcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic54xcoff "$(tdir_tic54xcoff)"
etic80coff.c: $(srcdir)/emulparams/tic80coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic80coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic80coff "$(tdir_tic80coff)"
@ -704,6 +788,9 @@ ez8002.c: $(srcdir)/emulparams/z8002.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
${GENSCRIPTS} z8002 "$(tdir_z8002)"
# We need this for automake to use YLWRAP.
EXTRA_ld_new_SOURCES = deffilep.y
ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLDEPS)
@ -823,7 +910,7 @@ MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
mostlyclean-local:
-rm -rf tmpdir
CLEANFILES = dep.sed DEP DEP1 DEP2
CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
.PHONY: install-exec-local install-data-local
@ -862,8 +949,13 @@ distclean-local:
DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
rm -f DEP1
$(MAKE) MKDEP="$(MKDEP)" DEP1
sed -f dep.sed < DEP1 > $@
echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@
sed -f dep.sed < DEP1 > DEPA
echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA
if grep ' /' DEPA > /dev/null 2> /dev/null; then \
echo 'make DEP failed!'; exit 1; \
else \
mv -f DEPA $@; \
fi
DEP1: $(CFILES) $(GENERATED_CFILES)
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2
@ -903,7 +995,7 @@ ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
ldgram.h ldmain.h ldctor.h
ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h \
ldmisc.h ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h \
ldemul-list.h
ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
@ -916,29 +1008,30 @@ ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmain.h ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h \
ldmisc.h ldctor.h ldfile.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h
ldmain.h ldgram.h ldexp.h ldlang.h ldlex.h ldmisc.h \
ldctor.h ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h
ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/progress.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \
ldemul.h ldlex.h ldfile.h ldctor.h
$(INCDIR)/progress.h $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \
ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldwrite.h \
ldgram.h ldexp.h ldlang.h ldlex.h ldfile.h ldemul.h \
ldctor.h
ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h ldmisc.h \
ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h
ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
ldver.h ldemul.h ldmain.h
ldver.h ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h
ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
$(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \
ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
ldver.h ldemul.h
$(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmain.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h \
ldfile.h ldver.h ldemul.h $(INCDIR)/demangle.h
mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h sysdep.h \
config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
ldexp.h ldlang.h ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h
@ -949,13 +1042,13 @@ ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
pe-dll.o: pe-dll.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
$(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h ldemul.h \
$(INCDIR)/coff/internal.h ../bfd/libcoff.h deffile.h \
pe-dll.h
ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h ldfile.h \
ldemul.h $(INCDIR)/coff/internal.h ../bfd/libcoff.h \
deffile.h pe-dll.h
ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
ld.h $(INCDIR)/bin-bugs.h ldexp.h ldver.h ldlang.h \
ldemul.h ldfile.h ldmisc.h ldmain.h mri.h ldctor.h \
ldfile.h ldemul.h ldmisc.h ldmain.h mri.h ldctor.h \
ldlex.h
ldlex.o: ldlex.c ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \
ld.h $(INCDIR)/bin-bugs.h ldgram.h ldmisc.h ldexp.h \

View File

@ -68,11 +68,14 @@ CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CC_FOR_BUILD = @CC_FOR_BUILD@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DLLTOOL = @DLLTOOL@
EMULATION_LIBPATH = @EMULATION_LIBPATH@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
@ -90,11 +93,13 @@ MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
STRINGIFY = @STRINGIFY@
STRIP = @STRIP@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
@ -112,6 +117,9 @@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bis
YFLAGS = -d
LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
WARN_CFLAGS = @WARN_CFLAGS@
AM_CFLAGS = $(WARN_CFLAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
@ -204,52 +212,59 @@ ALL_EMULATIONS = \
eaixrs6.o \
ealpha.o \
earcelf.o \
earmelf.o \
earmelf_oabi.o \
earmelf_linux.o \
earmelf_linux26.o \
earm_epoc_pe.o \
earmaoutb.o \
earmaoutl.o \
earmcoff.o \
earmelf.o \
earmelf_linux.o \
earmelf_oabi.o \
earmnbsd.o \
earmpe.o \
earm_epoc_pe.o \
eavr1200.o \
eavr23xx.o \
eavr44x4.o \
eavr4433.o \
eavr44x4.o \
eavr85xx.o \
eavrmega603.o \
eavrmega103.o \
eavrmega161.o \
eavrmega603.o \
ecoff_sparc.o \
ecrisaout.o \
ecriself.o \
ecrislinux.o \
ed10velf.o \
ed30velf.o \
ed30v_e.o \
ed30v_o.o \
ed30velf.o \
edelta68.o \
eebmon29k.o \
eelf32_sparc.o \
eelf32_i960.o \
eelf32_i860.o \
eelf32_sparc.o \
eelf32b4300.o \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
eelf32ebmip.o \
eelf32elmip.o \
eelf32bmipn32.o \
eelf32fr30.o \
eelf32i370.o \
eelf32l4300.o \
eelf32lmip.o \
eelf32lppc.o \
eelf32lppcsim.o \
eelf32mcore.o \
eelf32ppc.o \
eelf32ppclinux.o \
eelf32ppcsim.o \
eelf32shlunx.o \
eelf32shunx.o \
eelf_i386.o \
eelf_i386_be.o \
eelf_i386_chaos.o \
egld960.o \
egld960coff.o \
eelf32fr30.o \
eelf32mcore.o \
eh8300.o \
eh8300h.o \
eh8300s.o \
@ -260,6 +275,8 @@ ALL_EMULATIONS = \
eh8500s.o \
ehp300bsd.o \
ehp3hpux.o \
ehppaelf.o \
ehppalinux.o \
ei386aout.o \
ei386beos.o \
ei386bsd.o \
@ -275,6 +292,10 @@ ALL_EMULATIONS = \
ei386pe.o \
ei386pe_posix.o \
elnk960.o \
em68hc11elf.o \
em68hc11elfb.o \
em68hc12elf.o \
em68hc12elfb.o \
em68k4knbsd.o \
em68kaout.o \
em68kaux.o \
@ -294,10 +315,10 @@ ALL_EMULATIONS = \
emipslnews.o \
emipspe.o \
enews.o \
epjelf.o \
epjlelf.o \
ens32knbsd.o \
epc532macha.o \
epjelf.o \
epjlelf.o \
eppcmacos.o \
eppcnw.o \
eppcpe.o \
@ -305,9 +326,11 @@ ALL_EMULATIONS = \
esa29200.o \
esh.o \
eshelf.o \
eshelf_linux.o \
eshlelf_linux.o \
eshl.o \
eshlelf.o \
eshlunx.o \
eshl.o \
eshpe.o \
eshunx.o \
esparcaout.o \
@ -319,6 +342,7 @@ ALL_EMULATIONS = \
esun4.o \
etic30aout.o \
etic30coff.o \
etic54xcoff.o \
etic80coff.o \
evanilla.o \
evax.o \
@ -329,14 +353,17 @@ ALL_EMULATIONS = \
ALL_64_EMULATIONS = \
eelf64_ia64.o \
eelf_x86_64.o \
eelf64_sparc.o \
eelf64alpha.o \
eelf64bmip.o
eelf64bmip.o \
eelf64hppa.o
ALL_EMUL_EXTRA_OFILES = \
pe-dll.o \
deffilep.o
deffilep.o \
pe-dll.o
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
@ -367,9 +394,12 @@ POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
# These all start with e so 'make clean' can find them.
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${exec_prefix} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
# We need this for automake to use YLWRAP.
EXTRA_ld_new_SOURCES = deffilep.y
ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
@ -384,7 +414,7 @@ MAINTAINERCLEANFILES = ldver.texi
MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
CLEANFILES = dep.sed DEP DEP1 DEP2
CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
# Stuff that should be included in a distribution. The diststuff
# target is run by the taz target in ../Makefile.in.
@ -403,11 +433,14 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I.
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
ld_new_OBJECTS = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o \
ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o
ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex.$(OBJEXT) lexsup.$(OBJEXT) \
ldlang.$(OBJEXT) mri.$(OBJEXT) ldctor.$(OBJEXT) ldmain.$(OBJEXT) \
ldwrite.$(OBJEXT) ldexp.$(OBJEXT) ldemul.$(OBJEXT) ldver.$(OBJEXT) \
ldmisc.$(OBJEXT) ldfile.$(OBJEXT) ldcref.$(OBJEXT)
ld_new_LDFLAGS =
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LEXLIB = @LEXLIB@
YLWRAP = $(top_srcdir)/../ylwrap
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -424,19 +457,19 @@ MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
NEWS TODO acinclude.m4 aclocal.m4 config.in configure configure.in \
ldgram.c ldlex.c
deffilep.c ldgram.c ldlex.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
SOURCES = $(ld_new_SOURCES)
SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
OBJECTS = $(ld_new_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .txi .y
.SUFFIXES: .S .c .dvi .info .l .lo .o .obj .ps .s .texi .texinfo .txi .y
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
@ -489,6 +522,11 @@ maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
# FIXME: We should only use cygpath when building on Windows,
# and only if it is available.
.c.obj:
$(COMPILE) -c `cygpath -w $<`
.s.o:
$(COMPILE) -c $<
@ -497,6 +535,7 @@ maintainer-clean-noinstPROGRAMS:
mostlyclean-compile:
-rm -f *.o core *.core
-rm -f *.$(OBJEXT)
clean-compile:
@ -530,10 +569,8 @@ ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES)
.l.c:
$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
.y.c:
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
if test -f y.tab.h; then \
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
else :; fi
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS)
deffilep.h: deffilep.c
ldgram.h: ldgram.c
@ -904,7 +941,7 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
-test -z "ldlexlldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexl ldgramh ldgramc $(MAINTAINERCLEANFILES)
-test -z "ldlexldeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexl deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \
@ -1002,17 +1039,16 @@ earcelf.c: $(srcdir)/emulparams/arcelf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} arcelf "$(tdir_arcelf)"
earmelf.c: $(srcdir)/emulparams/armelf.sh \
$(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf "$(tdir_armelf)"
earmelf_oabi.c: $(srcdir)/emulparams/armelf_oabi.sh \
$(srcdir)/emultempl/armelf_oabi.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_oabi "$(tdir_armelf)"
earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
$(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
earmelf_linux26.c: $(srcdir)/emulparams/armelf_linux26.sh \
$(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux26 "$(tdir_armelf_linux26)"
earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
@ -1066,6 +1102,15 @@ eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS}
${GENSCRIPTS} crisaout "$(tdir_cris)"
ecriself.c: $(srcdir)/emulparams/criself.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} criself "$(tdir_cris)"
ecrislinux.c: $(srcdir)/emulparams/crislinux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} crislinux "$(tdir_cris)"
ed10velf.c: $(srcdir)/emulparams/d10velf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS}
${GENSCRIPTS} d10velf "$(tdir_d10v)"
@ -1096,6 +1141,9 @@ em32relf.c: $(srcdir)/emulparams/m32relf.sh \
eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
@ -1108,6 +1156,9 @@ eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
@ -1124,16 +1175,22 @@ eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppcsim "$(tdir_elf32ppcsim)"
eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
@ -1141,6 +1198,12 @@ eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)"
eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)"
eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
@ -1150,9 +1213,15 @@ eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
egld960.c: $(srcdir)/emulparams/gld960.sh \
$(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
${GENSCRIPTS} gld960 "$(tdir_gld960)"
@ -1189,6 +1258,14 @@ ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/hppaelf.em \
$(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
ehppalinux.c: $(srcdir)/emulparams/hppalinux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/hppaelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} hppalinux "$(tdir_hppalinux)"
ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} i386aout "$(tdir_i386aout)"
@ -1234,6 +1311,18 @@ ei386pe_posix.c: $(srcdir)/emulparams/i386pe_posix.sh \
elnk960.c: $(srcdir)/emulparams/lnk960.sh \
$(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
@ -1244,10 +1333,11 @@ em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/m68kcoff.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/m68kelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
$(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
@ -1330,6 +1420,12 @@ esh.c: $(srcdir)/emulparams/sh.sh \
eshelf.c: $(srcdir)/emulparams/shelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf "$(tdir_shelf)"
eshelf_linux.c: $(srcdir)/emulparams/shelf_linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shelf_linux "$(tdir_shelf_linux)"
eshlelf_linux.c: $(srcdir)/emulparams/shlelf_linux.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf_linux "$(tdir_shlelf_linux)"
eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} shlelf "$(tdir_shlelf)"
@ -1378,6 +1474,9 @@ etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
etic54xcoff.c: $(srcdir)/emulparams/tic54xcoff.sh \
$(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic54xcoff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic54xcoff "$(tdir_tic54xcoff)"
etic80coff.c: $(srcdir)/emulparams/tic80coff.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic80coff.sc ${GEN_DEPENDS}
${GENSCRIPTS} tic80coff "$(tdir_tic80coff)"
@ -1541,8 +1640,13 @@ distclean-local:
DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
rm -f DEP1
$(MAKE) MKDEP="$(MKDEP)" DEP1
sed -f dep.sed < DEP1 > $@
echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@
sed -f dep.sed < DEP1 > DEPA
echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA
if grep ' /' DEPA > /dev/null 2> /dev/null; then \
echo 'make DEP failed!'; exit 1; \
else \
mv -f DEPA $@; \
fi
DEP1: $(CFILES) $(GENERATED_CFILES)
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2
@ -1582,7 +1686,7 @@ ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
ldgram.h ldmain.h ldctor.h
ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h \
ldmisc.h ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h \
ldemul-list.h
ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
@ -1595,29 +1699,30 @@ ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmain.h ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h \
ldmisc.h ldctor.h ldfile.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h
ldmain.h ldgram.h ldexp.h ldlang.h ldlex.h ldmisc.h \
ldctor.h ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h
ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/progress.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \
ldemul.h ldlex.h ldfile.h ldctor.h
$(INCDIR)/progress.h $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \
ld.h $(INCDIR)/bin-bugs.h ldmain.h ldmisc.h ldwrite.h \
ldgram.h ldexp.h ldlang.h ldlex.h ldfile.h ldemul.h \
ldctor.h
ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/demangle.h ld.h $(INCDIR)/bin-bugs.h ldmisc.h \
ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h
ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
ldver.h ldemul.h ldmain.h
ldver.h ldexp.h ldlang.h ldfile.h ldemul.h ldmain.h
ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
$(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
$(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h ldmain.h \
ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
ldver.h ldemul.h
$(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h $(INCDIR)/bin-bugs.h \
ldmain.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h \
ldfile.h ldver.h ldemul.h $(INCDIR)/demangle.h
mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h sysdep.h \
config.h $(INCDIR)/fopen-same.h ld.h $(INCDIR)/bin-bugs.h \
ldexp.h ldlang.h ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h
@ -1628,13 +1733,13 @@ ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
pe-dll.o: pe-dll.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
$(INCDIR)/libiberty.h ld.h $(INCDIR)/bin-bugs.h ldexp.h \
ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h ldemul.h \
$(INCDIR)/coff/internal.h ../bfd/libcoff.h deffile.h \
pe-dll.h
ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h ldfile.h \
ldemul.h $(INCDIR)/coff/internal.h ../bfd/libcoff.h \
deffile.h pe-dll.h
ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
ld.h $(INCDIR)/bin-bugs.h ldexp.h ldver.h ldlang.h \
ldemul.h ldfile.h ldmisc.h ldmain.h mri.h ldctor.h \
ldfile.h ldemul.h ldmisc.h ldmain.h mri.h ldctor.h \
ldlex.h
ldlex.o: ldlex.c ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \
ld.h $(INCDIR)/bin-bugs.h ldgram.h ldmisc.h ldexp.h \

View File

@ -30,17 +30,12 @@ alpha*-*-linux-gnu*)
HOSTING_CRT0=/usr/lib/crt0.o
;;
alpha*-*-*)
HOSTING_CRT0=/usr/ccs/lib/crt0.o
NATIVE_LIB_DIRS=/usr/ccs/lib
;;
arm*-*-linux-gnu*)
HOSTING_CRT0='-p -dynamic-linker `fgrep ld-linux.so \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
i[3456]86-*-freebsdelf*)
i[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout*)
# The new BSD `make' has a bug: it doesn't pass empty arguments in
# shell commands. So we need to make this value non-empty in order
# for the genscripts.sh call to work. There's nothing magic about
@ -125,6 +120,15 @@ i[3456]86-pc-interix*)
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L $$X/local_bin -L $$INTERIX_ROOT/usr/lib -lc -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a'
;;
i[3456]86-*-cygwin*)
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
;;
ia64-*-linux-gnu*)
HOSTING_CRT0='-dynamic-linker `egrep "ld-linux-ia64.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld-linux-ia64.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
mips*-dec-bsd*)
HOSTING_CRT0=/usr/lib/crt0.o
;;
@ -193,10 +197,6 @@ powerpc*-*-linux-gnu*)
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
;;
romp-*-*)
HDEFINES=-DNO_VARARGS
;;
sparc*-*-solaris2*)
HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
@ -213,4 +213,27 @@ sparc64-*-linux-gnu*)
HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
#
# Generic configurations:
#
*-*-freebsd*)
NATIVE_LIB_DIRS=/usr/lib
# Older versions of gcc do not use a specs file. In those cases,
# gcc -print-file-name=specs will simply print specs. We create a
# dummy specs files to handle this.
echo "-dynamic-linker `${CC} --print-file-name=ld-elf.so.1`" > specs
HOSTING_CRT0='-dynamic-linker `${CC} --print-file-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
HOSTING_LIBS='`${CC} -print-libgcc-file-name` -L`dirname \`${CC} --print-file-name=libc.so\`` -lc `${CC} -print-libgcc-file-name` `${CC} --print-file-name=crtend.o` `${CC} --print-file-name=crtn.o`'
;;
alpha*-*-*)
HOSTING_CRT0=/usr/ccs/lib/crt0.o
NATIVE_LIB_DIRS=/usr/ccs/lib
;;
romp-*-*)
HDEFINES=-DNO_VARARGS
;;
esac

View File

@ -23,6 +23,12 @@ arm-*-pe) targ_emul=armpe ;
arc-*-elf*) targ_emul=arcelf ;;
avr-*-*) targ_emul=avr85xx
targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433 avrmega603 avrmega103 avrmega161" ;;
cris-*-*aout*) targ_emul=crisaout
targ_extra_emuls="criself crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
cris-*-*) targ_emul=criself
targ_extra_emuls="crisaout crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
d10v-*-*) targ_emul=d10velf ;;
d30v-*-*ext*) targ_emul=d30v_e; targ_extra_emuls="d30velf d30v_o" ;;
d30v-*-*onchip*) targ_emul=d30v_o; targ_extra_emuls="d30velf d30v_e" ;;
@ -37,6 +43,12 @@ sparc*-*-aout) targ_emul=sparcaout ;;
sparc*-*-coff) targ_emul=coff_sparc ;;
sparc*-*-elf) targ_emul=elf32_sparc ;;
sparc*-*-sysv4*) targ_emul=elf32_sparc ;;
sparc64-*-freebsd* | sparcv9-*-freebsd*)
targ_emul=elf64_sparc
targ_extra_emuls="elf32_sparc"
targ_extra_libpath=$targ_extra_emuls
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
;;
sparc*-*-linux*aout*) targ_emul=sparclinux
targ_extra_emuls="elf32_sparc sun4"
tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
@ -79,19 +91,26 @@ sparcv9-*-solaris2* | sparc64-*-solaris2*)
;;
sparc*-*-solaris2*) targ_emul=elf32_sparc ;;
sparc*-wrs-vxworks*) targ_emul=sparcaout ;;
sparc*-*-rtemsaout*) targ_emul=sparcaout ;;
sparc*-*-rtemself*) targ_emul=elf32_sparc ;;
sparc*-*-rtems*) targ_emul=elf32_sparc ;;
sparc*-*-rtemsaout*) targ_emul=sparcaout ;;
sparc*-*-rtemself*) targ_emul=elf32_sparc ;;
sparc*-*-rtems*) targ_emul=elf32_sparc ;;
i860-stardent-sysv4* | i860-stardent-elf*)
targ_emul=elf32_i860 ;;
i960-wrs-vxworks5.0*) targ_emul=gld960 ;;
i960-wrs-vxworks5*) targ_emul=gld960coff ;;
i960-wrs-vxworks*) targ_emul=gld960 ;;
i960-*-coff) targ_emul=gld960coff ;;
i960-intel-nindy) targ_emul=gld960 ;;
i960-*-rtemscoff*) targ_emul=gld960coff ;;
i960-*-rtemself*) targ_emul=elf32_i960 ;;
i960-*-rtems*) targ_emul=gld960coff ;;
i960-*-elf*) targ_emul=elf32_i960 ;;
ia64-*-elf*) targ_emul=elf64_ia64 ;;
ia64-*-freebsd*) targ_emul=elf64_ia64 ;;
ia64-*-linux*) targ_emul=elf64_ia64 ;;
m32r-*-*) targ_emul=m32relf ;;
m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
targ_extra_emuls="m68hc12elfb m68hc11elf m68hc11elfb" ;;
m68*-sun-sunos[34]*) targ_emul=sun3 ;;
m68*-wrs-vxworks*) targ_emul=sun3 ;;
m68*-ericsson-ose) targ_emul=sun3 ;;
@ -108,9 +127,8 @@ i[3456]86-*-sco*) targ_emul=i386coff ;;
i[3456]86-*-isc*) targ_emul=i386coff ;;
i[3456]86-*-lynxos*) targ_emul=i386lynx ;;
i[3456]86-*-coff) targ_emul=i386coff ;;
i[3456]86-*-rtemscoff*) targ_emul=i386coff ;;
i[3456]86-*-rtemself*) targ_emul=elf_i386 ;;
i[3456]86-*-rtems*) targ_emul=elf_i386 ;;
i[3456]86-*-rtems*) targ_emul=i386coff ;;
i[3456]86-*-bsd) targ_emul=i386bsd ;;
i[3456]86-*-bsd386) targ_emul=i386bsd ;;
i[3456]86-*-bsdi*) targ_emul=i386bsd ;;
@ -124,6 +142,10 @@ i[3456]86-*-linux-gnu*) targ_emul=elf_i386
targ_extra_emuls=i386linux
tdir_i386linux=${targ_alias}aout
;;
x86_64-*-linux-gnu*) targ_emul=elf_x86_64
targ_extra_emuls="elf_i386 i386linux"
tdir_i386linux=${targ_alias}aout
;;
i[3456]86-*-sysv[45]*) targ_emul=elf_i386 ;;
i[3456]86-*-solaris2*) targ_emul=elf_i386 ;;
i[3456]86-*-unixware) targ_emul=elf_i386 ;;
@ -139,6 +161,10 @@ i[3456]86-*-elf*) targ_emul=elf_i386 ;;
i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | i[3456]86-*-freebsd[12])
targ_emul=i386bsd ;;
i[3456]86-*-freebsd*) targ_emul=elf_i386 ;;
x86_64-*-freebsd*) targ_emul=elf_x86_64
targ_extra_emuls=elf_i386
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
;;
i[3456]86-*-sysv*) targ_emul=i386coff ;;
i[3456]86-*-ptx*) targ_emul=i386coff ;;
i[3456]86-*-mach*) targ_emul=i386mach ;;
@ -158,6 +184,7 @@ i[3456]86-*-interix*) targ_emul=i386pe_posix;
i[3456]86-*-beospe*) targ_emul=i386beos ;;
i[3456]86-*-beos*) targ_emul=elf_i386_be ;;
i[3456]86-*-vxworks*) targ_emul=i386aout ;;
i[3456]86-*-chaos) targ_emul=elf_i386_chaos ;;
m8*-*-*) targ_emul=m88kbcs ;;
a29k-*-udi) targ_emul=sa29200 ;;
a29k-*-ebmon) targ_emul=ebmon29k ;;
@ -166,10 +193,12 @@ a29k-*-*) targ_emul=a29k ;;
arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
armeb-*-aout) targ_emul=armaoutb ;;
arm-*-coff) targ_emul=armcoff ;;
arm-*-freebsd*) targ_emul=armelf ;;
arm-*-netbsd*) targ_emul=armnbsd ;;
arm-*-rtems*) targ_emul=armelf ;;
arm-*-elf) targ_emul=armelf ;;
arm-*-oabi) targ_emul=armelf_oabi ;;
arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls="armelf_linux26 armelf" ;;
arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
arm*-*-conix*) targ_emul=armelf ;;
thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
@ -182,21 +211,26 @@ thumb-epoc-pe) targ_emul=arm_epoc_pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
thumb-*-pe) targ_emul=armpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
h8300-*-hms* | h8300-*-coff*)
xscale-*-coff) targ_emul=armcoff ;;
xscale-*-elf) targ_emul=armelf ;;
h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*)
targ_emul=h8300; targ_extra_emuls="h8300h h8300s"
;;
h8500-*-hms* | h8500-*-coff*)
targ_emul=h8500
targ_extra_emuls="h8500s h8500b h8500m h8500c"
;;
sh-*-linux*)
targ_emul=shelf_linux
targ_extra_emuls=shlelf_linux
;;
sh-*-elf* | sh-*-rtemself*)
targ_emul=shelf
targ_extra_emuls="shlelf sh shl"
;;
sh-*-pe) targ_emul=shpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
sh-*-rtemscoff* | sh-*-* | sh-*-rtems*)
targ_emul=sh; targ_extra_emuls=shl ;;
sh-*-*|sh-*-rtems*) targ_emul=sh; targ_extra_emuls=shl ;;
m68k-sony-*) targ_emul=news ;;
m68k-hp-bsd*) targ_emul=hp300bsd ;;
m68*-motorola-sysv*) targ_emul=delta68 ;;
@ -224,12 +258,10 @@ m68*-*-netbsd*) targ_emul=m68knbsd
targ_extra_emuls=m68k4knbsd
;;
m68*-*-psos*) targ_emul=m68kpsos ;;
m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
m68*-*-rtemself) targ_emul=m68kelf ;;
m68*-*-rtems*) targ_emul=m68kelf ;;
hppa*w*-*) targ_emul=elf64hppa ;;
m68*-*-rtems*) targ_emul=m68kcoff ;;
hppa*64*-*) targ_emul=elf64hppa ;;
hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
hppa*-*-*elf*) targ_emul=hppaelf ;;
hppa*-*-linux-gnu*) targ_emul=hppaelf ;;
hppa*-*-lites*) targ_emul=hppaelf ;;
hppa*-*-rtems*) targ_emul=hppaelf ;;
vax-dec-ultrix* | vax-dec-bsd*) targ_emul=vax ;;
@ -271,9 +303,13 @@ mips*-*-linux-gnu*) targ_emul=elf32bsmip
targ_extra_emuls="elf32lsmip mipsbig mipslit"
;;
mips*-*-lnews*) targ_emul=mipslnews ;;
mips*-*-sysv4*) targ_emul=elf32btsmip ;;
mn10200-*-*) targ_emul=mn10200 ;;
mn10300-*-*) targ_emul=mn10300 ;;
alpha-*-freebsd*) targ_emul=elf64alpha ;;
alpha*-*-freebsd*) targ_emul=elf64alpha
targ_extra_emuls=alpha
tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'`
;;
alpha*-*-linuxecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha
tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'`
;;
@ -287,16 +323,22 @@ alpha*-*-netbsd*) targ_emul=elf64alpha ;;
z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 ;;
ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
powerpc-*-linux-gnu*) targ_emul=elf32ppclinux; targ_extra_emuls=elf32ppc;
powerpc-*-freebsd*) targ_emul=elf32ppc;
targ_extra_emuls=elf32ppcsim;
targ_extra_libpath=elf32ppc;
tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'`
;;
powerpc-*-linux-gnu*) targ_emul=elf32ppclinux;
targ_extra_emuls="elf32ppc elf32ppcsim";
targ_extra_libpath=elf32ppc ;;
pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;;
pj*-*-*) targ_emul=pjelf ;;
powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-sysv* \
| powerpc-*-netbsd* | powerpc-*-vxworks*)
targ_emul=elf32ppc ;;
targ_emul=elf32ppc targ_extra_emuls="elf32ppclinux elf32ppcsim";;
powerpcle-*-elf* | powerpcle-*-eabi* | powerpcle-*-solaris* \
| powerpcle-*-sysv* | powerpcle-*-vxworks*)
targ_emul=elf32lppc ;;
targ_emul=elf32lppc targ_extra_emuls="elf32ppcsim";;
powerpcle-*-rtems*) targ_emul=elf32leppc ;;
powerpc-*-rtems*) targ_emul=elf32ppc ;;
powerpc-*-macos*) targ_emul=ppcmacos ;;
@ -309,6 +351,7 @@ powerpc-*-beos*) targ_emul=aixppc ;;
rs6000-*-aix*) targ_emul=aixrs6 ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
tic30-*-*coff*) targ_emul=tic30coff ;;
tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;;
tic80-*-*) targ_emul=tic80coff ;;
v850-*-*) targ_emul=v850 ;;
v850e-*-*) targ_emul=v850 ;;

View File

@ -1,20 +0,0 @@
ARCH=arm
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-littlearm"
BIG_OUTPUT_FORMAT="elf32-bigarm"
LITTLE_OUTPUT_FORMAT="elf32-littlearm"
MAXPAGESIZE=0x8000
TEMPLATE_NAME=armelf
GENERATE_SHLIB_SCRIPT=yes
DATA_START_SYMBOLS='__data_start = . ;';
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
# This needs to be high enough so that we can load ld.so below it,
# yet low enough to stay away from the mmap area at 0x01100000.
# Also, it is small enough so that relocs which are pointing
# at absolute 0 will still be fixed up.
# These values give us about 0.5MB for ld.so, 16.5MB for user
# programs, and 15MB for mmap which seems a reasonable compromise.
TEXT_START_ADDR=0x00080000

View File

@ -7,5 +7,6 @@ ARCH=m68k
MACHINE=
NOP=0x4e75
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=m68kelf
GENERATE_SHLIB_SCRIPT=yes
ELFSIZE=32

View File

@ -1,23 +1,32 @@
#!/bin/sh
# genscripts.sh - generate the ld-emulation-target specific files
#
# Usage: genscripts.sh srcdir libdir host target target_alias \
# default_emulation native_lib_dirs this_emulation tool_dir
# Usage: genscripts.sh srcdir libdir exec_prefix \
# host target target_alias default_emulation \
# native_lib_dirs this_emulation tool_dir
#
# Sample usage:
# genscripts.sh /djm/ld-devo/devo/ld /usr/local/lib sparc-sun-sunos4.1.3 \
# sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 "" sun3 sparc-sun-sunos4.1.3
# genscripts.sh /djm/ld-devo/devo/ld /usr/local/lib /usr/local \
# sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 \
# "" sun3 sparc-sun-sunos4.1.3
# produces sun3.x sun3.xbn sun3.xn sun3.xr sun3.xu em_sun3.c
srcdir=$1
libdir=$2
host=$3
target=$4
target_alias=$5
EMULATION_LIBPATH=$6
NATIVE_LIB_DIRS=$7
EMULATION_NAME=$8
tool_lib=`echo ${libdir} | sed -e 's|/lib$||'`/${9-$target_alias}/lib
exec_prefix=$3
host=$4
target=$5
target_alias=$6
EMULATION_LIBPATH=$7
NATIVE_LIB_DIRS=$8
EMULATION_NAME=$9
shift 9
# Can't use ${1:-$target_alias} here due to an Ultrix shell bug.
if [ "x$1" = "x" ] ; then
tool_lib=${exec_prefix}/${target_alias}/lib
else
tool_lib=${exec_prefix}/$1/lib
fi
# Include the emulation-specific parameters:
. ${srcdir}/emulparams/${EMULATION_NAME}.sh

View File

@ -35,12 +35,11 @@
# define N_(String) (String)
# endif
#else
/* Stubs that do something close enough. */
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
# define gettext(Msgid) (Msgid)
# define dgettext(Domainname, Msgid) (Msgid)
# define dcgettext(Domainname, Msgid, Category) (Msgid)
# define textdomain(Domainname) while (0) /* nothing */
# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
# define _(String) (String)
# define N_(String) (String)
#endif
@ -59,30 +58,27 @@
#define DISCARD_SECTION_NAME "/DISCARD/"
/* A file name list */
typedef struct name_list
{
const char *name;
struct name_list *next;
} name_list;
typedef struct name_list {
const char *name;
struct name_list *next;
}
name_list;
/* A wildcard specification. This is only used in ldgram.y, but it
winds up in ldgram.h, so we need to define it outside. */
struct wildcard_spec
{
struct wildcard_spec {
const char *name;
struct name_list *exclude_name_list;
boolean sorted;
};
/* Extra information we hold on sections */
typedef struct user_section_struct
{
typedef struct user_section_struct {
/* Pointer to the section where this data will go */
struct lang_input_statement_struct *file;
} section_userdata_type;
#define get_userdata(x) ((x)->userdata)
#define BYTE_SIZE (1)
@ -98,8 +94,7 @@ typedef struct user_section_struct
#define ALIGN_N(this, boundary) \
((( (this) + ((boundary) -1)) & (~((boundary)-1))))
typedef struct
{
typedef struct {
/* 1 => assign space to common symbols even if `relocatable_output'. */
boolean force_common_definition;
boolean relax;
@ -128,7 +123,7 @@ typedef struct
file. */
boolean embedded_relocs;
/* If true, force generation of a file with a .exe file. */
/* If true, force generation of a file with a .exe file. */
boolean force_exe_suffix;
/* If true, generate a cross reference report. */
@ -156,15 +151,14 @@ typedef struct
/* If true (the default) check section addresses, once compute,
fpor overlaps. */
boolean check_section_addresses;
} args_type;
extern args_type command_line;
typedef int token_code_type;
typedef struct
{
typedef struct {
bfd_size_type specified_data_size;
boolean magic_demand_paged;
boolean make_executable;
@ -210,14 +204,17 @@ typedef struct
boolean stats;
int split_by_reloc;
boolean split_by_file;
/* If set, orphan input sections will be mapped to separate output
sections. */
boolean unique_orphan_sections;
unsigned int split_by_reloc;
bfd_size_type split_by_file;
} ld_config_type;
extern ld_config_type config;
typedef enum
{
typedef enum {
lang_first_phase_enum,
lang_allocating_phase_enum,
lang_final_phase_enum

View File

@ -122,8 +122,8 @@
#include "ldexp.h"
#include "ldver.h"
#include "ldlang.h"
#include "ldemul.h"
#include "ldfile.h"
#include "ldemul.h"
#include "ldmisc.h"
#include "ldmain.h"
#include "mri.h"
@ -383,20 +383,20 @@ static const short yyrline[] = { 0,
507, 512, 522, 524, 527, 529, 532, 535, 537, 539,
541, 545, 553, 558, 561, 563, 565, 567, 569, 571,
573, 578, 578, 582, 587, 595, 602, 603, 606, 610,
612, 613, 617, 619, 622, 630, 639, 642, 645, 647,
650, 653, 657, 662, 664, 668, 671, 676, 678, 681,
684, 687, 691, 696, 705, 716, 718, 721, 724, 726,
728, 730, 732, 735, 737, 739, 741, 743, 745, 747,
749, 751, 753, 755, 757, 759, 761, 763, 765, 767,
769, 771, 773, 775, 777, 780, 782, 784, 786, 788,
790, 792, 794, 796, 798, 803, 805, 808, 810, 813,
815, 817, 823, 824, 830, 830, 832, 835, 839, 841,
847, 847, 853, 857, 860, 862, 863, 864, 865, 868,
870, 871, 874, 876, 877, 882, 886, 888, 891, 894,
898, 901, 904, 909, 922, 924, 930, 932, 938, 940,
944, 946, 949, 951, 953, 959, 989, 994, 1006, 1013,
1018, 1026, 1032, 1040, 1044, 1050, 1052, 1055, 1060, 1066,
1071, 1077, 1082, 1086, 1090, 1094, 1100, 1105, 1109, 1114
612, 613, 617, 619, 624, 632, 641, 644, 647, 649,
652, 655, 659, 664, 666, 670, 673, 678, 680, 683,
686, 689, 693, 698, 707, 718, 720, 723, 726, 728,
730, 732, 734, 737, 739, 741, 743, 745, 747, 749,
751, 753, 755, 757, 759, 761, 763, 765, 767, 769,
771, 773, 775, 777, 779, 782, 784, 786, 788, 790,
792, 794, 796, 798, 800, 805, 807, 810, 812, 815,
817, 819, 825, 826, 832, 832, 834, 837, 841, 843,
849, 849, 855, 859, 862, 864, 865, 866, 867, 870,
872, 873, 876, 878, 879, 884, 888, 890, 893, 896,
900, 903, 906, 911, 924, 926, 932, 934, 940, 942,
946, 948, 951, 953, 955, 961, 991, 996, 1008, 1015,
1020, 1028, 1034, 1042, 1046, 1052, 1054, 1057, 1062, 1068,
1073, 1079, 1084, 1088, 1092, 1096, 1102, 1107, 1111, 1116
};
#endif
@ -1956,14 +1956,14 @@ case 153:
{ region = lang_memory_region_lookup(yyvsp[0].name); ;
break;}
case 155:
#line 624 "ldgram.y"
#line 626 "ldgram.y"
{ region->current =
region->origin =
exp_get_vma(yyvsp[0].etree, 0L,"origin", lang_first_phase_enum);
;
break;}
case 156:
#line 632 "ldgram.y"
#line 634 "ldgram.y"
{ region->length = exp_get_vma(yyvsp[0].etree,
~((bfd_vma)0),
"length",
@ -1971,53 +1971,53 @@ case 156:
;
break;}
case 157:
#line 641 "ldgram.y"
#line 643 "ldgram.y"
{ /* dummy action to avoid bison 1.25 error message */ ;
break;}
case 161:
#line 652 "ldgram.y"
#line 654 "ldgram.y"
{ lang_set_flags (region, yyvsp[0].name, 0); ;
break;}
case 162:
#line 654 "ldgram.y"
#line 656 "ldgram.y"
{ lang_set_flags (region, yyvsp[0].name, 1); ;
break;}
case 163:
#line 659 "ldgram.y"
#line 661 "ldgram.y"
{ lang_startup(yyvsp[-1].name); ;
break;}
case 165:
#line 665 "ldgram.y"
#line 667 "ldgram.y"
{ ldemul_hll((char *)NULL); ;
break;}
case 166:
#line 670 "ldgram.y"
{ ldemul_hll(yyvsp[0].name); ;
break;}
case 167:
#line 672 "ldgram.y"
{ ldemul_hll(yyvsp[0].name); ;
break;}
case 167:
#line 674 "ldgram.y"
{ ldemul_hll(yyvsp[0].name); ;
break;}
case 169:
#line 680 "ldgram.y"
#line 682 "ldgram.y"
{ ldemul_syslib(yyvsp[0].name); ;
break;}
case 171:
#line 686 "ldgram.y"
#line 688 "ldgram.y"
{ lang_float(true); ;
break;}
case 172:
#line 688 "ldgram.y"
#line 690 "ldgram.y"
{ lang_float(false); ;
break;}
case 173:
#line 693 "ldgram.y"
#line 695 "ldgram.y"
{
yyval.nocrossref = NULL;
;
break;}
case 174:
#line 697 "ldgram.y"
#line 699 "ldgram.y"
{
struct lang_nocrossref *n;
@ -2028,7 +2028,7 @@ case 174:
;
break;}
case 175:
#line 706 "ldgram.y"
#line 708 "ldgram.y"
{
struct lang_nocrossref *n;
@ -2039,191 +2039,191 @@ case 175:
;
break;}
case 176:
#line 716 "ldgram.y"
#line 718 "ldgram.y"
{ ldlex_expression(); ;
break;}
case 177:
#line 718 "ldgram.y"
#line 720 "ldgram.y"
{ ldlex_popstate(); yyval.etree=yyvsp[0].etree;;
break;}
case 178:
#line 723 "ldgram.y"
#line 725 "ldgram.y"
{ yyval.etree = exp_unop('-', yyvsp[0].etree); ;
break;}
case 179:
#line 725 "ldgram.y"
#line 727 "ldgram.y"
{ yyval.etree = yyvsp[-1].etree; ;
break;}
case 180:
#line 727 "ldgram.y"
#line 729 "ldgram.y"
{ yyval.etree = exp_unop((int) yyvsp[-3].integer,yyvsp[-1].etree); ;
break;}
case 181:
#line 729 "ldgram.y"
#line 731 "ldgram.y"
{ yyval.etree = exp_unop('!', yyvsp[0].etree); ;
break;}
case 182:
#line 731 "ldgram.y"
#line 733 "ldgram.y"
{ yyval.etree = yyvsp[0].etree; ;
break;}
case 183:
#line 733 "ldgram.y"
#line 735 "ldgram.y"
{ yyval.etree = exp_unop('~', yyvsp[0].etree);;
break;}
case 184:
#line 736 "ldgram.y"
#line 738 "ldgram.y"
{ yyval.etree = exp_binop('*', yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 185:
#line 738 "ldgram.y"
#line 740 "ldgram.y"
{ yyval.etree = exp_binop('/', yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 186:
#line 740 "ldgram.y"
#line 742 "ldgram.y"
{ yyval.etree = exp_binop('%', yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 187:
#line 742 "ldgram.y"
#line 744 "ldgram.y"
{ yyval.etree = exp_binop('+', yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 188:
#line 744 "ldgram.y"
#line 746 "ldgram.y"
{ yyval.etree = exp_binop('-' , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 189:
#line 746 "ldgram.y"
#line 748 "ldgram.y"
{ yyval.etree = exp_binop(LSHIFT , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 190:
#line 748 "ldgram.y"
#line 750 "ldgram.y"
{ yyval.etree = exp_binop(RSHIFT , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 191:
#line 750 "ldgram.y"
#line 752 "ldgram.y"
{ yyval.etree = exp_binop(EQ , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 192:
#line 752 "ldgram.y"
#line 754 "ldgram.y"
{ yyval.etree = exp_binop(NE , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 193:
#line 754 "ldgram.y"
#line 756 "ldgram.y"
{ yyval.etree = exp_binop(LE , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 194:
#line 756 "ldgram.y"
#line 758 "ldgram.y"
{ yyval.etree = exp_binop(GE , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 195:
#line 758 "ldgram.y"
#line 760 "ldgram.y"
{ yyval.etree = exp_binop('<' , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 196:
#line 760 "ldgram.y"
#line 762 "ldgram.y"
{ yyval.etree = exp_binop('>' , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 197:
#line 762 "ldgram.y"
#line 764 "ldgram.y"
{ yyval.etree = exp_binop('&' , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 198:
#line 764 "ldgram.y"
#line 766 "ldgram.y"
{ yyval.etree = exp_binop('^' , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 199:
#line 766 "ldgram.y"
#line 768 "ldgram.y"
{ yyval.etree = exp_binop('|' , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 200:
#line 768 "ldgram.y"
#line 770 "ldgram.y"
{ yyval.etree = exp_trinop('?' , yyvsp[-4].etree, yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 201:
#line 770 "ldgram.y"
#line 772 "ldgram.y"
{ yyval.etree = exp_binop(ANDAND , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 202:
#line 772 "ldgram.y"
#line 774 "ldgram.y"
{ yyval.etree = exp_binop(OROR , yyvsp[-2].etree, yyvsp[0].etree); ;
break;}
case 203:
#line 774 "ldgram.y"
#line 776 "ldgram.y"
{ yyval.etree = exp_nameop(DEFINED, yyvsp[-1].name); ;
break;}
case 204:
#line 776 "ldgram.y"
#line 778 "ldgram.y"
{ yyval.etree = exp_intop(yyvsp[0].integer); ;
break;}
case 205:
#line 778 "ldgram.y"
#line 780 "ldgram.y"
{ yyval.etree = exp_nameop(SIZEOF_HEADERS,0); ;
break;}
case 206:
#line 781 "ldgram.y"
#line 783 "ldgram.y"
{ yyval.etree = exp_nameop(SIZEOF,yyvsp[-1].name); ;
break;}
case 207:
#line 783 "ldgram.y"
#line 785 "ldgram.y"
{ yyval.etree = exp_nameop(ADDR,yyvsp[-1].name); ;
break;}
case 208:
#line 785 "ldgram.y"
#line 787 "ldgram.y"
{ yyval.etree = exp_nameop(LOADADDR,yyvsp[-1].name); ;
break;}
case 209:
#line 787 "ldgram.y"
#line 789 "ldgram.y"
{ yyval.etree = exp_unop(ABSOLUTE, yyvsp[-1].etree); ;
break;}
case 210:
#line 789 "ldgram.y"
{ yyval.etree = exp_unop(ALIGN_K,yyvsp[-1].etree); ;
break;}
case 211:
#line 791 "ldgram.y"
{ yyval.etree = exp_unop(ALIGN_K,yyvsp[-1].etree); ;
break;}
case 212:
case 211:
#line 793 "ldgram.y"
{ yyval.etree = exp_unop(ALIGN_K,yyvsp[-1].etree); ;
break;}
case 212:
#line 795 "ldgram.y"
{ yyval.etree = exp_nameop(NAME,yyvsp[0].name); ;
break;}
case 213:
#line 795 "ldgram.y"
#line 797 "ldgram.y"
{ yyval.etree = exp_binop (MAX_K, yyvsp[-3].etree, yyvsp[-1].etree ); ;
break;}
case 214:
#line 797 "ldgram.y"
#line 799 "ldgram.y"
{ yyval.etree = exp_binop (MIN_K, yyvsp[-3].etree, yyvsp[-1].etree ); ;
break;}
case 215:
#line 799 "ldgram.y"
#line 801 "ldgram.y"
{ yyval.etree = exp_assert (yyvsp[-3].etree, yyvsp[-1].name); ;
break;}
case 216:
#line 804 "ldgram.y"
#line 806 "ldgram.y"
{ yyval.name = yyvsp[0].name; ;
break;}
case 217:
#line 805 "ldgram.y"
#line 807 "ldgram.y"
{ yyval.name = "*default*"; ;
break;}
case 218:
#line 809 "ldgram.y"
#line 811 "ldgram.y"
{ yyval.etree = yyvsp[-1].etree; ;
break;}
case 219:
#line 810 "ldgram.y"
#line 812 "ldgram.y"
{ yyval.etree = 0; ;
break;}
case 220:
#line 813 "ldgram.y"
#line 815 "ldgram.y"
{ ldlex_expression(); ;
break;}
case 221:
#line 815 "ldgram.y"
#line 817 "ldgram.y"
{ ldlex_popstate (); ldlex_script (); ;
break;}
case 222:
#line 817 "ldgram.y"
#line 819 "ldgram.y"
{
lang_enter_output_section_statement(yyvsp[-5].name, yyvsp[-3].etree,
sectype,
@ -2231,128 +2231,128 @@ case 222:
;
break;}
case 223:
#line 823 "ldgram.y"
#line 825 "ldgram.y"
{ ldlex_popstate (); ldlex_expression (); ;
break;}
case 224:
#line 825 "ldgram.y"
#line 827 "ldgram.y"
{
ldlex_popstate ();
lang_leave_output_section_statement (yyvsp[0].integer, yyvsp[-3].name, yyvsp[-1].section_phdr, yyvsp[-2].name);
;
break;}
case 226:
#line 831 "ldgram.y"
#line 833 "ldgram.y"
{ ldlex_expression (); ;
break;}
case 227:
#line 833 "ldgram.y"
#line 835 "ldgram.y"
{ ldlex_popstate (); ldlex_script (); ;
break;}
case 228:
#line 835 "ldgram.y"
#line 837 "ldgram.y"
{
lang_enter_overlay (yyvsp[-4].etree, yyvsp[-2].etree, (int) yyvsp[-3].integer);
;
break;}
case 229:
#line 840 "ldgram.y"
#line 842 "ldgram.y"
{ ldlex_popstate (); ldlex_expression (); ;
break;}
case 230:
#line 842 "ldgram.y"
#line 844 "ldgram.y"
{
ldlex_popstate ();
lang_leave_overlay (yyvsp[0].integer, yyvsp[-3].name, yyvsp[-1].section_phdr, yyvsp[-2].name);
;
break;}
case 232:
#line 851 "ldgram.y"
#line 853 "ldgram.y"
{ ldlex_expression (); ;
break;}
case 233:
#line 853 "ldgram.y"
#line 855 "ldgram.y"
{
ldlex_popstate ();
lang_add_assignment (exp_assop ('=', ".", yyvsp[0].etree));
;
break;}
case 235:
#line 861 "ldgram.y"
#line 863 "ldgram.y"
{ sectype = noload_section; ;
break;}
case 236:
#line 862 "ldgram.y"
#line 864 "ldgram.y"
{ sectype = dsect_section; ;
break;}
case 237:
#line 863 "ldgram.y"
#line 865 "ldgram.y"
{ sectype = copy_section; ;
break;}
case 238:
#line 864 "ldgram.y"
#line 866 "ldgram.y"
{ sectype = info_section; ;
break;}
case 239:
#line 865 "ldgram.y"
#line 867 "ldgram.y"
{ sectype = overlay_section; ;
break;}
case 241:
#line 870 "ldgram.y"
#line 872 "ldgram.y"
{ sectype = normal_section; ;
break;}
case 242:
#line 871 "ldgram.y"
#line 873 "ldgram.y"
{ sectype = normal_section; ;
break;}
case 243:
#line 875 "ldgram.y"
#line 877 "ldgram.y"
{ yyval.etree = yyvsp[-2].etree; ;
break;}
case 244:
#line 876 "ldgram.y"
#line 878 "ldgram.y"
{ yyval.etree = (etree_type *)NULL; ;
break;}
case 245:
#line 881 "ldgram.y"
#line 883 "ldgram.y"
{ yyval.etree = yyvsp[-3].etree; ;
break;}
case 246:
#line 883 "ldgram.y"
#line 885 "ldgram.y"
{ yyval.etree = yyvsp[-7].etree; ;
break;}
case 247:
#line 887 "ldgram.y"
#line 889 "ldgram.y"
{ yyval.etree = yyvsp[-1].etree; ;
break;}
case 248:
#line 888 "ldgram.y"
#line 890 "ldgram.y"
{ yyval.etree = (etree_type *) NULL; ;
break;}
case 249:
#line 893 "ldgram.y"
#line 895 "ldgram.y"
{ yyval.integer = 0; ;
break;}
case 250:
#line 895 "ldgram.y"
#line 897 "ldgram.y"
{ yyval.integer = 1; ;
break;}
case 251:
#line 900 "ldgram.y"
#line 902 "ldgram.y"
{ yyval.name = yyvsp[0].name; ;
break;}
case 252:
#line 901 "ldgram.y"
#line 903 "ldgram.y"
{ yyval.name = "*default*"; ;
break;}
case 253:
#line 906 "ldgram.y"
#line 908 "ldgram.y"
{
yyval.section_phdr = NULL;
;
break;}
case 254:
#line 910 "ldgram.y"
#line 912 "ldgram.y"
{
struct lang_output_section_phdr_list *n;
@ -2365,40 +2365,40 @@ case 254:
;
break;}
case 256:
#line 926 "ldgram.y"
#line 928 "ldgram.y"
{
ldlex_script ();
lang_enter_overlay_section (yyvsp[0].name);
;
break;}
case 257:
#line 931 "ldgram.y"
#line 933 "ldgram.y"
{ ldlex_popstate (); ldlex_expression (); ;
break;}
case 258:
#line 933 "ldgram.y"
#line 935 "ldgram.y"
{
ldlex_popstate ();
lang_leave_overlay_section (yyvsp[0].integer, yyvsp[-1].section_phdr);
;
break;}
case 263:
#line 950 "ldgram.y"
#line 952 "ldgram.y"
{ ldlex_expression (); ;
break;}
case 264:
#line 951 "ldgram.y"
#line 953 "ldgram.y"
{ ldlex_popstate (); ;
break;}
case 265:
#line 953 "ldgram.y"
#line 955 "ldgram.y"
{
lang_new_phdr (yyvsp[-5].name, yyvsp[-3].etree, yyvsp[-2].phdr.filehdr, yyvsp[-2].phdr.phdrs, yyvsp[-2].phdr.at,
yyvsp[-2].phdr.flags);
;
break;}
case 266:
#line 961 "ldgram.y"
#line 963 "ldgram.y"
{
yyval.etree = yyvsp[0].etree;
@ -2427,13 +2427,13 @@ case 266:
;
break;}
case 267:
#line 991 "ldgram.y"
#line 993 "ldgram.y"
{
memset (&yyval.phdr, 0, sizeof (struct phdr_info));
;
break;}
case 268:
#line 995 "ldgram.y"
#line 997 "ldgram.y"
{
yyval.phdr = yyvsp[0].phdr;
if (strcmp (yyvsp[-2].name, "FILEHDR") == 0 && yyvsp[-1].etree == NULL)
@ -2447,126 +2447,127 @@ case 268:
;
break;}
case 269:
#line 1007 "ldgram.y"
#line 1009 "ldgram.y"
{
yyval.phdr = yyvsp[0].phdr;
yyval.phdr.at = yyvsp[-2].etree;
;
break;}
case 270:
#line 1015 "ldgram.y"
#line 1017 "ldgram.y"
{
yyval.etree = NULL;
;
break;}
case 271:
#line 1019 "ldgram.y"
#line 1021 "ldgram.y"
{
yyval.etree = yyvsp[-1].etree;
;
break;}
case 272:
#line 1027 "ldgram.y"
#line 1029 "ldgram.y"
{
ldlex_version_file ();
PUSH_ERROR (_("VERSION script"));
;
break;}
case 273:
#line 1032 "ldgram.y"
#line 1034 "ldgram.y"
{
ldlex_popstate ();
POP_ERROR ();
;
break;}
case 274:
#line 1041 "ldgram.y"
#line 1043 "ldgram.y"
{
ldlex_version_script ();
;
break;}
case 275:
#line 1045 "ldgram.y"
#line 1047 "ldgram.y"
{
ldlex_popstate ();
;
break;}
case 278:
#line 1057 "ldgram.y"
#line 1059 "ldgram.y"
{
lang_register_vers_node (yyvsp[-4].name, yyvsp[-2].versnode, NULL);
;
break;}
case 279:
#line 1061 "ldgram.y"
#line 1063 "ldgram.y"
{
lang_register_vers_node (yyvsp[-5].name, yyvsp[-3].versnode, yyvsp[-1].deflist);
;
break;}
case 280:
#line 1068 "ldgram.y"
#line 1070 "ldgram.y"
{
yyval.deflist = lang_add_vers_depend (NULL, yyvsp[0].name);
;
break;}
case 281:
#line 1072 "ldgram.y"
#line 1074 "ldgram.y"
{
yyval.deflist = lang_add_vers_depend (yyvsp[-1].deflist, yyvsp[0].name);
;
break;}
case 282:
#line 1079 "ldgram.y"
#line 1081 "ldgram.y"
{
yyval.versnode = lang_new_vers_node (NULL, NULL);
;
break;}
case 283:
#line 1083 "ldgram.y"
#line 1085 "ldgram.y"
{
yyval.versnode = lang_new_vers_node (yyvsp[-1].versyms, NULL);
;
break;}
case 284:
#line 1087 "ldgram.y"
#line 1089 "ldgram.y"
{
yyval.versnode = lang_new_vers_node (yyvsp[-1].versyms, NULL);
;
break;}
case 285:
#line 1091 "ldgram.y"
#line 1093 "ldgram.y"
{
yyval.versnode = lang_new_vers_node (NULL, yyvsp[-1].versyms);
;
break;}
case 286:
#line 1095 "ldgram.y"
#line 1097 "ldgram.y"
{
yyval.versnode = lang_new_vers_node (yyvsp[-5].versyms, yyvsp[-1].versyms);
;
break;}
case 287:
#line 1102 "ldgram.y"
#line 1104 "ldgram.y"
{
yyval.versyms = lang_new_vers_regex (NULL, yyvsp[0].name, ldgram_vers_current_lang);
;
break;}
case 288:
#line 1106 "ldgram.y"
#line 1108 "ldgram.y"
{
yyval.versyms = lang_new_vers_regex (yyvsp[-2].versyms, yyvsp[0].name, ldgram_vers_current_lang);
;
break;}
case 289:
#line 1110 "ldgram.y"
#line 1112 "ldgram.y"
{
yyval.name = ldgram_vers_current_lang;
ldgram_vers_current_lang = yyvsp[-1].name;
;
break;}
case 290:
#line 1115 "ldgram.y"
#line 1117 "ldgram.y"
{
yyval.versyms = yyvsp[-1].versyms;
ldgram_vers_current_lang = yyvsp[-2].name;
;
break;}
@ -2792,7 +2793,7 @@ yyerrhandle:
}
return 1;
}
#line 1120 "ldgram.y"
#line 1123 "ldgram.y"
void
yyerror(arg)

View File

@ -33,8 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ldexp.h"
#include "ldver.h"
#include "ldlang.h"
#include "ldemul.h"
#include "ldfile.h"
#include "ldemul.h"
#include "ldmisc.h"
#include "ldmain.h"
#include "mri.h"
@ -619,7 +619,9 @@ memory_spec: NAME
attributes_opt ':'
origin_spec opt_comma length_spec
; origin_spec:
;
origin_spec:
ORIGIN '=' mustbe_exp
{ region->current =
region->origin =
@ -1113,6 +1115,7 @@ vers_defns:
}
vers_defns '}'
{
$$ = $5;
ldgram_vers_current_lang = $<name>4;
}
;

File diff suppressed because it is too large Load Diff

View File

@ -36,12 +36,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldgram.h"
#include "ldexp.h"
#include "ldlang.h"
#include "ldemul.h"
#include "ldlex.h"
#include "ldfile.h"
#include "ldemul.h"
#include "ldctor.h"
/* Somewhere above, sys/stat.h got included . . . . */
/* Somewhere above, sys/stat.h got included . . . . */
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
@ -65,7 +65,7 @@ const char *output_filename = "a.out";
/* Name this program was invoked by. */
char *program_name;
/* The file that we're creating */
/* The file that we're creating. */
bfd *output_bfd = 0;
/* Set by -G argument, for MIPS ECOFF target. */
@ -130,8 +130,7 @@ static boolean unattached_reloc PARAMS ((struct bfd_link_info *,
static boolean notice PARAMS ((struct bfd_link_info *, const char *,
bfd *, asection *, bfd_vma));
static struct bfd_link_callbacks link_callbacks =
{
static struct bfd_link_callbacks link_callbacks = {
add_archive_element,
multiple_definition,
multiple_common,
@ -150,10 +149,10 @@ struct bfd_link_info link_info;
static void
remove_output ()
{
if (output_filename)
if (output_filename)
{
if (output_bfd && output_bfd->iostream)
fclose((FILE *)(output_bfd->iostream));
fclose ((FILE *) (output_bfd->iostream));
if (delete_output_file_on_failure)
unlink (output_filename);
}
@ -201,6 +200,8 @@ main (argc, argv)
config.dynamic_link = false;
config.has_shared = false;
config.no_std_path = (getenv("LD_NOSTD_PATH") ? true : false);
config.split_by_reloc = (unsigned) -1;
config.split_by_file = (bfd_size_type) -1;
command_line.force_common_definition = false;
command_line.interpreter = NULL;
command_line.rpath = NULL;
@ -216,12 +217,14 @@ main (argc, argv)
link_info.callbacks = &link_callbacks;
link_info.relocateable = false;
link_info.emitrelocations = false;
link_info.shared = false;
link_info.symbolic = false;
link_info.static_link = false;
link_info.traditional_format = false;
link_info.optimize = false;
link_info.no_undefined = false;
link_info.allow_shlib_undefined = false;
link_info.strip = strip_none;
link_info.discard = discard_none;
link_info.keep_memory = true;
@ -237,6 +240,9 @@ main (argc, argv)
and _fini symbols. We are compatible. */
link_info.init_function = "_init";
link_info.fini_function = "_fini";
link_info.new_dtags = false;
link_info.flags = (bfd_vma) 0;
link_info.flags_1 = (bfd_vma) 0;
ldfile_add_arch ("");
@ -244,7 +250,6 @@ main (argc, argv)
force_make_executable = false;
config.magic_demand_paged = true;
config.text_read_only = true;
config.make_executable = true;
emulation = get_emulation (argc, argv);
ldemul_choose_mode (emulation);
@ -323,7 +328,6 @@ main (argc, argv)
ldemul_after_parse ();
if (config.map_filename)
{
if (strcmp (config.map_filename, "-") == 0)
@ -342,21 +346,22 @@ main (argc, argv)
}
}
lang_process ();
/* Print error messages for any missing symbols, for any warning
symbols, and possibly multiple definitions */
symbols, and possibly multiple definitions. */
if (config.text_read_only)
if (! link_info.relocateable)
{
/* Look for a text section and mark the readonly attribute in it */
/* Look for a text section and switch the readonly attribute in it. */
asection *found = bfd_get_section_by_name (output_bfd, ".text");
if (found != (asection *) NULL)
{
found->flags |= SEC_READONLY;
if (config.text_read_only)
found->flags |= SEC_READONLY;
else
found->flags &= ~SEC_READONLY;
}
}
@ -396,12 +401,12 @@ main (argc, argv)
einfo (_("%F%B: final close failed: %E\n"), output_bfd);
/* If the --force-exe-suffix is enabled, and we're making an
executable file and it doesn't end in .exe, copy it to one which does. */
executable file and it doesn't end in .exe, copy it to one
which does. */
if (! link_info.relocateable && command_line.force_exe_suffix)
{
int len = strlen (output_filename);
if (len < 4
if (len < 4
|| (strcasecmp (output_filename + len - 4, ".exe") != 0
&& strcasecmp (output_filename + len - 4, ".dll") != 0))
{
@ -492,7 +497,7 @@ get_emulation (argc, argv)
}
else
{
einfo(_("%P%F: missing argument to -m\n"));
einfo (_("%P%F: missing argument to -m\n"));
}
}
else if (strcmp (argv[i], "-mips1") == 0
@ -540,7 +545,7 @@ check_for_scripts_dir (dir)
dirlen = strlen (dir);
/* sizeof counts the terminating NUL. */
buf = (char *) xmalloc (dirlen + sizeof("/ldscripts"));
buf = (char *) xmalloc (dirlen + sizeof ("/ldscripts"));
sprintf (buf, "%s/ldscripts", dir);
res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode);
@ -565,7 +570,8 @@ set_scripts_dir ()
size_t dirlen;
if (check_for_scripts_dir (SCRIPTDIR))
return; /* We've been installed normally. */
/* We've been installed normally. */
return;
/* Look for "ldscripts" in the dir where our binary is. */
end = strrchr (program_name, '/');
@ -573,7 +579,7 @@ set_scripts_dir ()
{
/* We could have \foo\bar, or /foo\bar. */
char *bslash = strrchr (program_name, '\\');
if (bslash > end)
if (end == NULL || (bslash != NULL && bslash > end))
end = bslash;
}
#endif
@ -593,14 +599,16 @@ set_scripts_dir ()
dir[dirlen] = '\0';
if (check_for_scripts_dir (dir))
return; /* Don't free dir. */
/* Don't free dir. */
return;
/* Look for "ldscripts" in <the dir where our binary is>/../lib. */
strcpy (dir + dirlen, "/../lib");
if (check_for_scripts_dir (dir))
return;
free (dir); /* Well, we tried. */
/* Well, we tried. */
free (dir);
}
void
@ -615,7 +623,7 @@ add_ysym (name)
bfd_hash_newfunc,
61))
einfo (_("%P%F: bfd_hash_table_init failed: %E\n"));
}
}
if (bfd_hash_lookup (link_info.notice_hash, name, true, true)
== (struct bfd_hash_entry *) NULL)
@ -712,7 +720,6 @@ add_keepsyms_file (filename)
/* This is called when BFD has decided to include an archive member in
a link. */
/*ARGSUSED*/
static boolean
add_archive_element (info, abfd, name)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -827,7 +834,6 @@ add_archive_element (info, abfd, name)
/* This is called when BFD has discovered a symbol which is defined
multiple times. */
/*ARGSUSED*/
static boolean
multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -856,6 +862,13 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
nbfd, nsec, nval, name);
if (obfd != (bfd *) NULL)
einfo (_("%D: first defined here\n"), obfd, osec, oval);
if (command_line.relax)
{
einfo (_("%P: Disabling relaxation: it will not work with multiple definitions\n"));
command_line.relax = 0;
}
return true;
}
@ -864,7 +877,6 @@ multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
or when two common symbols are found. We only do something if
-warn-common was used. */
/*ARGSUSED*/
static boolean
multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -931,7 +943,6 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
entry in the linker hash table for the set. SECTION and VALUE
represent a value which should be added to the set. */
/*ARGSUSED*/
static boolean
add_to_set (info, h, reloc, abfd, section, value)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -1020,8 +1031,7 @@ constructor_callback (info, constructor, name, abfd, section, value)
/* A structure used by warning_callback to pass information through
bfd_map_over_sections. */
struct warning_callback_info
{
struct warning_callback_info {
boolean found;
const char *warning;
const char *symbol;
@ -1030,7 +1040,6 @@ struct warning_callback_info
/* This is called when there is a reference to a warning symbol. */
/*ARGSUSED*/
static boolean
warning_callback (info, warning, symbol, abfd, section, address)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -1152,7 +1161,6 @@ warning_find_reloc (abfd, sec, iarg)
/* This is called when an undefined symbol is found. */
/*ARGSUSED*/
static boolean
undefined_symbol (info, name, abfd, section, address, fatal)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -1160,7 +1168,7 @@ undefined_symbol (info, name, abfd, section, address, fatal)
bfd *abfd;
asection *section;
bfd_vma address;
boolean fatal;
boolean fatal ATTRIBUTE_UNUSED;
{
static char *error_name;
static unsigned int error_count;
@ -1233,7 +1241,6 @@ undefined_symbol (info, name, abfd, section, address, fatal)
/* This is called when a reloc overflows. */
/*ARGSUSED*/
static boolean
reloc_overflow (info, name, reloc_name, addend, abfd, section, address)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -1257,7 +1264,6 @@ reloc_overflow (info, name, reloc_name, addend, abfd, section, address)
/* This is called when a dangerous relocation is made. */
/*ARGSUSED*/
static boolean
reloc_dangerous (info, message, abfd, section, address)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -1277,7 +1283,6 @@ reloc_dangerous (info, message, abfd, section, address)
/* This is called when a reloc is being generated attached to a symbol
that is not being output. */
/*ARGSUSED*/
static boolean
unattached_reloc (info, name, abfd, section, address)
struct bfd_link_info *info ATTRIBUTE_UNUSED;

View File

@ -1,5 +1,5 @@
/* Parse options for the GNU linker.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldfile.h"
#include "ldver.h"
#include "ldemul.h"
#include "demangle.h"
#ifndef PATH_SEPARATOR
#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN32__))
@ -46,7 +47,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
#endif
/* Somewhere above, sys/stat.h got included . . . . */
/* Somewhere above, sys/stat.h got included . . . . */
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
@ -123,7 +124,11 @@ int parsing_defsym = 0;
#define OPTION_NO_UNDEFINED (OPTION_MPC860C0 + 1)
#define OPTION_INIT (OPTION_NO_UNDEFINED + 1)
#define OPTION_FINI (OPTION_INIT + 1)
#define OPTION_NO_STD_PATH (OPTION_FINI + 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_STD_PATH (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
/* The long options. This structure is used for both the option
parsing and the help text. */
@ -139,15 +144,24 @@ struct ld_option
/* The documentation string. If this is NULL, this is a synonym for
the previous option. */
const char *doc;
enum
{
/* Use one dash before long option name. */
ONE_DASH,
/* Use two dashes before long option name. */
TWO_DASHES,
/* Don't mention this option in --help output. */
NO_HELP
} control;
enum {
/* Use one dash before long option name. */
ONE_DASH,
/* Use two dashes before long option name. */
TWO_DASHES,
/* Only accept two dashes before the long option name.
This is an overloading of the use of this enum, since originally it
was only intended to tell the --help display function how to display
the long option name. This feature was added in order to resolve
the confusion about the -omagic command line switch. Is it setting
the output file name to "magic" or is it setting the NMAGIC flag on
the output ? It has been decided that it is setting the output file
name, and that if you want to set the NMAGIC flag you should use -N
or --omagic. */
EXACTLY_TWO_DASHES,
/* Don't mention this option in --help output. */
NO_HELP
} control;
};
static const struct ld_option ld_options[] =
@ -197,13 +211,15 @@ static const struct ld_option ld_options[] =
'n', NULL, N_("Do not page align data"), TWO_DASHES },
{ {"omagic", no_argument, NULL, 'N'},
'N', NULL, N_("Do not page align data, do not make text readonly"),
TWO_DASHES },
EXACTLY_TWO_DASHES },
{ {"output", required_argument, NULL, 'o'},
'o', N_("FILE"), N_("Set output file name"), TWO_DASHES },
'o', N_("FILE"), N_("Set output file name"), EXACTLY_TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
'O', NULL, N_("Optimize output file"), ONE_DASH },
{ {"Qy", no_argument, NULL, OPTION_IGNORE},
'\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 },
{ {NULL, no_argument, NULL, '\0'},
@ -221,6 +237,8 @@ static const struct ld_option ld_options[] =
'T', N_("FILE"), N_("Read linker script"), TWO_DASHES },
{ {"undefined", required_argument, NULL, 'u'},
'u', N_("SYMBOL"), N_("Start with undefined reference to SYMBOL"), TWO_DASHES },
{ {"unique", optional_argument, NULL, OPTION_UNIQUE},
'\0', N_("[=SECTION]"), N_("Don't merge input [SECTION | orphan] sections"), TWO_DASHES },
{ {"Ur", no_argument, NULL, OPTION_UR},
'\0', NULL, N_("Build global constructor/destructor tables"), ONE_DASH },
{ {"version", no_argument, NULL, OPTION_VERSION},
@ -235,8 +253,6 @@ static const struct ld_option ld_options[] =
'y', N_("SYMBOL"), N_("Trace mentions of SYMBOL"), TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
'Y', N_("PATH"), N_("Default search path for Solaris compatibility"), ONE_DASH },
{ {NULL, required_argument, NULL, '\0'},
'z', N_("KEYWORD"), N_("Ignored for Solaris compatibility"), ONE_DASH },
{ {"start-group", no_argument, NULL, '('},
'(', NULL, N_("Start a group"), TWO_DASHES },
{ {"end-group", no_argument, NULL, ')'},
@ -268,8 +284,8 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Output cross reference table"), TWO_DASHES },
{ {"defsym", required_argument, NULL, OPTION_DEFSYM},
'\0', N_("SYMBOL=EXPRESSION"), N_("Define a symbol"), TWO_DASHES },
{ {"demangle", no_argument, NULL, OPTION_DEMANGLE},
'\0', NULL, N_("Demangle symbol names"), TWO_DASHES },
{ {"demangle", optional_argument, NULL, OPTION_DEMANGLE},
'\0', N_("[=STYLE]"), N_("Demangle symbol names [using STYLE]"), TWO_DASHES },
{ {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
'\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES },
{ {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
@ -296,6 +312,8 @@ static const struct ld_option ld_options[] =
'\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 },
{ {"allow-shlib-undefined", no_argument, NULL, OPTION_ALLOW_SHLIB_UNDEFINED},
'\0', NULL, N_("Allow undefined symbols in shared objects"), TWO_DASHES },
{ {"no-warn-mismatch", no_argument, NULL, OPTION_NO_WARN_MISMATCH},
'\0', NULL, N_("Don't warn about mismatched input files"), TWO_DASHES},
{ {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE},
@ -307,7 +325,7 @@ static const struct ld_option ld_options[] =
{ {"nostdlib", no_argument, NULL, OPTION_NO_STD_PATH}, /* NetBSD. */
'\0', NULL, "Do not use default library search path", ONE_DASH },
{ {"oformat", required_argument, NULL, OPTION_OFORMAT},
'\0', N_("TARGET"), N_("Specify target of output file"), TWO_DASHES },
'\0', N_("TARGET"), N_("Specify target of output file"), EXACTLY_TWO_DASHES },
{ {"qmagic", no_argument, NULL, OPTION_IGNORE},
'\0', NULL, N_("Ignored for Linux compatibility"), ONE_DASH },
{ {"relax", no_argument, NULL, OPTION_RELAX},
@ -327,16 +345,20 @@ static const struct ld_option ld_options[] =
'\0', NULL, N_("Sort common symbols by size"), TWO_DASHES },
{ {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
'\0', NULL, NULL, NO_HELP },
{ {"split-by-file", no_argument, NULL, OPTION_SPLIT_BY_FILE},
'\0', NULL, N_("Split output sections for each file"), TWO_DASHES },
{ {"split-by-reloc", required_argument, NULL, OPTION_SPLIT_BY_RELOC},
'\0', N_("COUNT"), N_("Split output sections every COUNT relocs"), TWO_DASHES },
{ {"split-by-file", optional_argument, NULL, OPTION_SPLIT_BY_FILE},
'\0', N_("[=SIZE]"), N_("Split output sections every SIZE octets"), TWO_DASHES },
{ {"split-by-reloc", optional_argument, NULL, OPTION_SPLIT_BY_RELOC},
'\0', N_("[=COUNT]"), N_("Split output sections every COUNT relocs"), TWO_DASHES },
{ {"stats", no_argument, NULL, OPTION_STATS},
'\0', NULL, N_("Print memory usage statistics"), TWO_DASHES },
{ {"target-help", no_argument, NULL, OPTION_TARGET_HELP},
'\0', NULL, N_("Display target specific options"), TWO_DASHES },
{ {"task-link", required_argument, NULL, OPTION_TASK_LINK},
'\0', N_("SYMBOL"), N_("Do task level linking"), TWO_DASHES },
{ {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
'\0', NULL, N_("Use same format as native linker"), TWO_DASHES },
{ {"section-start", required_argument, NULL, OPTION_SECTION_START},
'\0', N_("SECTION=ADDRESS"), N_("Set address of named section"), TWO_DASHES },
{ {"Tbss", required_argument, NULL, OPTION_TBSS},
'\0', N_("ADDRESS"), N_("Set address of .bss section"), ONE_DASH },
{ {"Tdata", required_argument, NULL, OPTION_TDATA},
@ -375,7 +397,7 @@ static const struct ld_option ld_options[] =
'\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10,\n\t\t\t\tdefault 5) words of a page"), TWO_DASHES }
};
#define OPTION_COUNT ((int) (sizeof ld_options / sizeof ld_options[0]))
#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. */
@ -406,14 +428,16 @@ is_num (string, min, max, err)
void
parse_args (argc, argv)
int argc;
unsigned argc;
char **argv;
{
int i, is, il;
unsigned i;
int is, il, irl;
int ingroup = 0;
char *default_dirlist = NULL;
char shortopts[OPTION_COUNT * 3 + 2];
struct option longopts[OPTION_COUNT + 1];
struct option really_longopts[OPTION_COUNT + 1];
int last_optind;
/* Starting the short option string with '-' is for programs that
@ -423,6 +447,7 @@ parse_args (argc, argv)
shortopts[0] = '-';
is = 1;
il = 0;
irl = 0;
for (i = 0; i < OPTION_COUNT; i++)
{
if (ld_options[i].shortopt != '\0')
@ -443,12 +468,21 @@ parse_args (argc, argv)
}
if (ld_options[i].opt.name != NULL)
{
longopts[il] = ld_options[i].opt;
++il;
if (ld_options[i].control == EXACTLY_TWO_DASHES)
{
really_longopts[irl] = ld_options[i].opt;
++irl;
}
else
{
longopts[il] = ld_options[i].opt;
++il;
}
}
}
shortopts[is] = '\0';
longopts[il].name = NULL;
really_longopts[irl].name = NULL;
/* The -G option is ambiguous on different platforms. Sometimes it
specifies the largest data size to put into the small data
@ -514,12 +548,22 @@ parse_args (argc, argv)
/* getopt_long_only is like getopt_long, but '-' as well as '--'
can indicate a long option. */
opterr = 0;
optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
if (optc == '?')
{
--optind;
optc = getopt_long (argc, argv, shortopts, really_longopts, &longind);
}
if (optc == -1)
break;
switch (optc)
{
case '?':
fprintf (stderr, _("%s: unrecognized option '%s'\n"),
program_name, argv[optind - 1]);
default:
fprintf (stderr,
_("%s: use the --help option for usage information\n"),
@ -592,6 +636,17 @@ parse_args (argc, argv)
break;
case OPTION_DEMANGLE:
demangling = true;
if (optarg != NULL)
{
enum demangling_styles style;
style = cplus_demangle_name_to_style (optarg);
if (style == unknown_demangling)
einfo (_("%F%P: unknown demangling style `%s'"),
optarg);
cplus_demangle_set_style (style);
}
break;
case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg;
@ -699,6 +754,9 @@ parse_args (argc, argv)
case OPTION_NO_UNDEFINED:
link_info.no_undefined = true;
break;
case OPTION_ALLOW_SHLIB_UNDEFINED:
link_info.allow_shlib_undefined = true;
break;
case OPTION_NO_WARN_MISMATCH:
command_line.warn_mismatch = false;
break;
@ -719,11 +777,14 @@ parse_args (argc, argv)
link_info.optimize = strtoul (optarg, NULL, 0) ? true : false;
break;
case 'o':
lang_add_output (optarg, 0);
lang_add_output (optarg, 0);
break;
case OPTION_OFORMAT:
lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0);
break;
case 'q':
link_info.emitrelocations = true;
break;
case 'i':
case 'r':
link_info.relocateable = true;
@ -844,6 +905,48 @@ parse_args (argc, argv)
parser_input = input_script;
yyparse ();
break;
case OPTION_SECTION_START:
{
char *optarg2;
char *sec_name;
int len;
/* Check for <something>=<somthing>... */
optarg2 = strchr (optarg, '=');
if (optarg2 == NULL)
{
fprintf (stderr,
_("%s: Invalid argument to option \"--section-start\"\n"),
program_name);
xexit (1);
}
optarg2++;
/* So far so good. Are all the args present? */
if ((*optarg == '\0') || (*optarg2 == '\0'))
{
fprintf (stderr,
_("%s: Missing argument(s) to option \"--section-start\"\n"),
program_name);
xexit (1);
}
/* We must copy the section name as set_section_start
doesn't do it for us. */
len = optarg2 - optarg;
sec_name = xmalloc (len);
memcpy (sec_name, optarg, len - 1);
sec_name[len - 1] = 0;
/* Then set it... */
set_section_start (sec_name, optarg2);
}
break;
case OPTION_TARGET_HELP:
/* Mention any target specific options. */
ldemul_list_emulation_options (stdout);
exit (0);
case OPTION_TBSS:
set_section_start (".bss", optarg);
break;
@ -869,6 +972,12 @@ parse_args (argc, argv)
case 'u':
ldlang_add_undef (optarg);
break;
case OPTION_UNIQUE:
if (optarg != NULL)
lang_add_unique (optarg);
else
config.unique_orphan_sections = true;
break;
case OPTION_VERBOSE:
ldversion (1);
version_printed = true;
@ -885,15 +994,15 @@ parse_args (argc, argv)
case OPTION_VERSION:
/* This output is intended to follow the GNU standards document. */
printf ("GNU ld %s\n", ld_program_version);
printf (_("Copyright 2000 Free Software Foundation, Inc.\n"));
printf (_("Copyright 2001 Free Software Foundation, Inc.\n"));
printf (_("\
This program is free software; you may redistribute it under the terms of\n\
the GNU General Public License. This program has absolutely no warranty.\n"));
{
ld_emulation_xfer_type **ptr = ld_emulations;
printf (_(" Supported emulations:\n"));
while (*ptr)
while (*ptr)
{
printf (" %s\n", (*ptr)->emulation_name);
ptr++;
@ -956,17 +1065,18 @@ the GNU General Public License. This program has absolutely no warranty.\n"));
case 'y':
add_ysym (optarg);
break;
case 'z':
/* We accept and ignore this option for Solaris
compatibility. Actually, on Solaris, optarg is not
ignored. Someday we should handle it correctly. FIXME. */
break;
case OPTION_SPLIT_BY_RELOC:
config.split_by_reloc = strtoul (optarg, NULL, 0);
break;
if (optarg != NULL)
config.split_by_reloc = strtoul (optarg, NULL, 0);
else
config.split_by_reloc = 32768;
break;
case OPTION_SPLIT_BY_FILE:
config.split_by_file = true;
break;
if (optarg != NULL)
config.split_by_file = bfd_scan_vma (optarg, NULL, 0);
else
config.split_by_file = 1;
break;
case OPTION_CHECK_SECTIONS:
command_line.check_section_addresses = true;
break;
@ -995,29 +1105,29 @@ the GNU General Public License. This program has absolutely no warranty.\n"));
lang_leave_group ();
ingroup = 0;
break;
case OPTION_MPC860C0:
link_info.mpc860c0 = 20; /* default value (in bytes) */
if (optarg)
{
unsigned words;
case OPTION_MPC860C0:
link_info.mpc860c0 = 20; /* default value (in bytes) */
if (optarg)
{
unsigned words;
words = is_num (optarg, 1, 10, 0);
if (words == 0)
{
fprintf (stderr,
words = is_num (optarg, 1, 10, 0);
if (words == 0)
{
fprintf (stderr,
_("%s: Invalid argument to option \"mpc860c0\"\n"),
program_name);
xexit (1);
}
link_info.mpc860c0 = words * 4; /* convert words to bytes */
}
command_line.relax = true;
break;
xexit (1);
}
link_info.mpc860c0 = words * 4; /* convert words to bytes */
}
command_line.relax = true;
break;
case OPTION_INIT:
link_info.init_function = optarg;
break;
case OPTION_FINI:
link_info.fini_function = optarg;
break;
@ -1070,7 +1180,7 @@ set_section_start (sect, valstr)
static void
help ()
{
int i;
unsigned i;
const char **targets, **pp;
printf (_("Usage: %s [options] file...\n"), program_name);
@ -1082,7 +1192,7 @@ help ()
{
boolean comma;
int len;
int j;
unsigned j;
printf (" ");
@ -1119,13 +1229,17 @@ help ()
if (ld_options[j].opt.name != NULL
&& ld_options[j].control != NO_HELP)
{
int two_dashes =
(ld_options[j].control == TWO_DASHES
|| ld_options[j].control == EXACTLY_TWO_DASHES);
printf ("%s-%s%s",
comma ? ", " : "",
ld_options[j].control == TWO_DASHES ? "-" : "",
two_dashes ? "-" : "",
ld_options[j].opt.name);
len += ((comma ? 2 : 0)
+ 1
+ (ld_options[j].control == TWO_DASHES ? 1 : 0)
+ (two_dashes ? 1 : 0)
+ strlen (ld_options[j].opt.name));
if (ld_options[j].arg != NULL)
{

View File

@ -1,288 +0,0 @@
#
# Unusual variables checked by this code:
# NOP - two byte opcode for no-op (defaults to 0)
# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
# (e.g., .PARISC.milli)
# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
# (e.g., .PARISC.global)
# OTHER_SECTIONS - at the end
# EXECUTABLE_SYMBOLS - symbols that must be defined for an
# executable (e.g., _DYNAMIC_LINK)
# TEXT_START_SYMBOLS - symbols that appear at the start of the
# .text section.
# DATA_START_SYMBOLS - symbols that appear at the start of the
# .data section.
# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
# .bss section besides __bss_start.
#
# When adding sections, do note that the names of some sections are used
# when specifying the start address of the next.
#
test -z "$ENTRY" && ENTRY=_start
test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
test "$LD_FLAG" = "N" && DATA_ADDR=.
SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) }"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) }"
INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
PLT=".plt ${RELOCATING-0} : { *(.plt) }"
CTOR=".ctors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${CTOR_START}}
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}}
}"
DTOR=" .dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+${DTOR_START}}
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
${CONSTRUCTING+${DTOR_END}}
}"
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
"${LITTLE_OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
ENTRY(${ENTRY})
${RELOCATING+${LIB_SEARCH_DIRS}}
${RELOCATING+/* Do we need any of these for elf?
__DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
${RELOCATING+${EXECUTABLE_SYMBOLS}}
${RELOCATING- /* For some reason, the Solaris linker makes bad executables
if gld -r is used and the intermediate file has sections starting
at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
bug. But for now assigning the zero vmas works. */}
${RELOCATING+PROVIDE (__stack = 0);}
${RELOCATING+PROVIDE (___stack = 0);}
SECTIONS
{
/* Read-only sections, merged into text segment: */
${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
${CREATE_SHLIB-${INTERP}}
.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) }
.rela.text ${RELOCATING-0} :
{
*(.rela.text)
${RELOCATING+*(.rela.text.*)}
${RELOCATING+*(.rela.gnu.linkonce.t*)}
}
.rela.data ${RELOCATING-0} :
{
*(.rela.data)
${RELOCATING+*(.rela.data.*)}
${RELOCATING+*(.rela.gnu.linkonce.d*)}
}
.rela.rodata ${RELOCATING-0} :
{
*(.rela.rodata)
${RELOCATING+*(.rela.rodata.*)}
${RELOCATING+*(.rela.gnu.linkonce.r*)}
}
.rela.got ${RELOCATING-0} : { *(.rela.got) }
.rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
.rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
.rela.init ${RELOCATING-0} : { *(.rela.init) }
.rela.fini ${RELOCATING-0} : { *(.rela.fini) }
.rela.bss ${RELOCATING-0} : { *(.rela.bss) }
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) }
.rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
.rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2) }
.rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2) }
.text ${RELOCATING-0} :
{
${RELOCATING+${TEXT_START_SYMBOLS}}
*(.text)
${RELOCATING+*(.text.*)}
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+*(.gnu.linkonce.t*)}
} =${NOP-0}
.init ${RELOCATING-0} : { KEEP (*(.init)) } =${NOP-0}
.fini ${RELOCATING-0} : { KEEP (*(.fini)) } =${NOP-0}
.rodata ${RELOCATING-0} :
{
*(.rodata)
${RELOCATING+*(.rodata.*)}
${RELOCATING+*(.gnu.linkonce.r*)}
}
.rodata1 ${RELOCATING-0} : { *(.rodata1) }
${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);}
${RELOCATING+PROVIDE (__etext = .);}
${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}}
${RELOCATING+${OTHER_READONLY_SECTIONS}}
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. It would
be more correct to do this:
${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (ALIGN(8) & (${MAXPAGESIZE} - 1))};}
The current expression does not correctly handle the case of a
text segment ending precisely at the end of a page; it causes the
data segment to skip a page. The above expression does not have
this problem, but it will currently (2/95) cause BFD to allocate
a single segment, combining both text and data, for this case.
This will prevent the text segment from being shared among
multiple executions of the program; I think that is more
important than losing a page of the virtual address space (note
that no actual memory is lost; the page which is skipped can not
be referenced). */
${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
.data ${RELOCATING-0} :
{
${RELOCATING+${DATA_START_SYMBOLS}}
*(.data)
${RELOCATING+*(.data.*)}
${RELOCATING+*(.gnu.linkonce.d*)}
${CONSTRUCTING+CONSTRUCTORS}
}
.data1 ${RELOCATING-0} : { *(.data1) }
${RELOCATING+${OTHER_READWRITE_SECTIONS}}
.got1 ${RELOCATING-0} : { *(.got1) }
.dynamic ${RELOCATING-0} : { *(.dynamic) }
/* Put .ctors and .dtors next to the .got2 section, so that the pointers
get relocated with -mrelocatable. Also put in the .fixup pointers.
The current compiler no longer needs this, but keep it around for 2.7.2 */
${RELOCATING+PROVIDE (_GOT2_START_ = .);}
${RELOCATING+PROVIDE (__GOT2_START_ = .);}
.got2 ${RELOCATING-0} : { *(.got2) }
${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
${RELOCATING+PROVIDE (___CTOR_LIST__ = .);}
${RELOCATING+${CTOR}}
${RELOCATING+PROVIDE (__CTOR_END__ = .);}
${RELOCATING+PROVIDE (___CTOR_END__ = .);}
${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
${RELOCATING+PROVIDE (___DTOR_LIST__ = .);}
${RELOCATING+${DTOR}}
${RELOCATING+PROVIDE (__DTOR_END__ = .);}
${RELOCATING+PROVIDE (___DTOR_END__ = .);}
${RELOCATING+PROVIDE (_FIXUP_START_ = .);}
${RELOCATING+PROVIDE (__FIXUP_START_ = .);}
.fixup ${RELOCATING-0} : { *(.fixup) }
${RELOCATING+PROVIDE (_FIXUP_END_ = .);}
${RELOCATING+PROVIDE (__FIXUP_END_ = .);}
${RELOCATING+PROVIDE (_GOT2_END_ = .);}
${RELOCATING+PROVIDE (__GOT2_END_ = .);}
${RELOCATING+PROVIDE (_GOT_START_ = .);}
${RELOCATING+PROVIDE (__GOT_START_ = .);}
.got ${RELOCATING-0} : { *(.got) }
.got.plt ${RELOCATING-0} : { *(.got.plt) }
${CREATE_SHLIB+${SDATA2}}
${CREATE_SHLIB+${SBSS2}}
${RELOCATING+PROVIDE (_GOT_END_ = .);}
${RELOCATING+PROVIDE (__GOT_END_ = .);}
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata ${RELOCATING-0} : { *(.sdata) }
${RELOCATING+_edata = .;}
${RELOCATING+PROVIDE (edata = .);}
${RELOCATING+PROVIDE (__edata = .);}
.sbss ${RELOCATING-0} :
{
${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);}
*(.sbss)
*(.scommon)
*(.dynsbss)
${RELOCATING+PROVIDE (__sbss_end = .);}
${RELOCATING+PROVIDE (___sbss_end = .);}
}
${PLT}
.bss ${RELOCATING-0} :
{
${RELOCATING+${OTHER_BSS_SYMBOLS}}
${RELOCATING+PROVIDE (__bss_start = .);}
${RELOCATING+PROVIDE (___bss_start = .);}
*(.dynbss)
*(.bss)
*(COMMON)
}
${RELOCATING+_end = . ;}
${RELOCATING+PROVIDE (end = .);}
${RELOCATING+PROVIDE (__end = .);}
/* These are needed for ELF backends which have not yet been
converted to the new style linker. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
/* 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) }
.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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* These must appear regardless of ${RELOCATING}. */
${OTHER_SECTIONS}
}
EOF

View File

@ -1,11 +0,0 @@
/* Define if you have the sys_errlist variable. */
#undef HAVE_SYS_ERRLIST
/* Define if you have the sys_nerr variable. */
#undef HAVE_SYS_NERR
/* Define if you have the sys_siglist variable. */
#undef HAVE_SYS_SIGLIST
/* Define if you have the strerror function. */
#undef HAVE_STRERROR

View File

@ -29,31 +29,24 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <errno.h>
#ifdef NEED_DECLARATION_ERRNO
extern int errno;
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#define ISSPACE (x) isspace(x)
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef vfork /* Autoconf may define this to fork for us. */
# define VFORK_STRING "fork"
#else
# define VFORK_STRING "vfork"
#endif
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif
#ifdef VMS
#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
#endif /* VMS */
#include "libiberty.h"
#include "safe-ctype.h"
/* stdin file number. */
#define STDIN_FILE_NO 0
@ -151,9 +144,9 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
abort ();
#ifdef __GO32__
#ifdef __DJGPP__
/* ??? What are the possible return values from spawnv? */
rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_WAIT, program, argv);
#else
char *scmd, *rf;
FILE *argfile;
@ -202,7 +195,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
if (rc == -1)
{
*errmsg_fmt = install_error_msg;
*errmsg_arg = program;
*errmsg_arg = (char *)program;
return -1;
}
@ -211,6 +204,13 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
return last_pid;
}
/* Use ECHILD if available, otherwise use EINVAL. */
#ifdef ECHILD
#define PWAIT_ERROR ECHILD
#else
#define PWAIT_ERROR EINVAL
#endif
int
pwait (pid, status, flags)
int pid;
@ -222,13 +222,16 @@ pwait (pid, status, flags)
/* Called twice for the same child? */
|| pid == last_reaped)
{
/* ??? ECHILD would be a better choice. Can we use it here? */
errno = EINVAL;
errno = PWAIT_ERROR;
return -1;
}
/* ??? Here's an opportunity to canonicalize the values in STATUS.
Needed? */
#ifdef __DJGPP__
*status = (last_status >> 8);
#else
*status = last_status;
#endif
last_reaped = last_pid;
return last_pid;
}
@ -698,9 +701,10 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
/* Fork a subprocess; wait and retry if it fails. */
sleep_interval = 1;
pid = -1;
for (retries = 0; retries < 4; retries++)
{
pid = vfork ();
pid = fork ();
if (pid >= 0)
break;
sleep (sleep_interval);
@ -710,11 +714,9 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
switch (pid)
{
case -1:
{
*errmsg_fmt = VFORK_STRING;
*errmsg_arg = NULL;
return -1;
}
*errmsg_fmt = "fork";
*errmsg_arg = NULL;
return -1;
case 0: /* child */
/* Move the input and output pipes into place, if necessary. */
@ -738,7 +740,6 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
/* Exec the program. */
(*func) (program, argv);
/* Note: Calling fprintf and exit here doesn't seem right for vfork. */
fprintf (stderr, "%s: ", this_pname);
fprintf (stderr, install_error_msg, program);
fprintf (stderr, ": %s\n", xstrerror (errno));

File diff suppressed because it is too large Load Diff