projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ChangeLog rotatation and copyright year update
[deliverable/binutils-gdb.git]
/
bfd
/
aoutx.h
diff --git
a/bfd/aoutx.h
b/bfd/aoutx.h
index e808716d6404f8573a7c6002320dffe201782b1c..d4e0fecb6bc758e3b9ac3813d04e5dde5f7b8580 100644
(file)
--- a/
bfd/aoutx.h
+++ b/
bfd/aoutx.h
@@
-1,7
+1,5
@@
/* BFD semi-generic back-end for a.out binaries.
/* BFD semi-generic back-end for a.out binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2015 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@
-68,12
+66,12
@@
DESCRIPTION
from @file{sunos.c}:
| #define TARGET_NAME "a.out-sunos-big"
from @file{sunos.c}:
| #define TARGET_NAME "a.out-sunos-big"
-| #define VECNAME s
unos_big
_vec
+| #define VECNAME s
parc_aout_sunos_be
_vec
| #include "aoutf1.h"
requires all the names from @file{aout32.c}, and produces the jump vector
| #include "aoutf1.h"
requires all the names from @file{aout32.c}, and produces the jump vector
-| s
unos_big
_vec
+| s
parc_aout_sunos_be
_vec
The file @file{host-aout.c} is a special case. It is for a large set
of hosts that use ``more or less standard'' a.out files, and
The file @file{host-aout.c} is a special case. It is for a large set
of hosts that use ``more or less standard'' a.out files, and
@@
-103,7
+101,7
@@
DESCRIPTION
| TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
| TDEPFILES= host-aout.o trad-core.o
| TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
| TDEPFILES= host-aout.o trad-core.o
- in the @file{config/@var{XXX}.mt} file, and modify @file{configure.
in
}
+ in the @file{config/@var{XXX}.mt} file, and modify @file{configure.
ac
}
to use the
@file{@var{XXX}.mt} file (by setting "<<bfd_target=XXX>>") when your
configuration is selected. */
to use the
@file{@var{XXX}.mt} file (by setting "<<bfd_target=XXX>>") when your
configuration is selected. */
@@
-269,7
+267,7
@@
NAME (aout, reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code)
int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE;
if (code == BFD_RELOC_CTOR)
int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE;
if (code == BFD_RELOC_CTOR)
- switch (bfd_
get_arch_info (abfd)->bits_per_address
)
+ switch (bfd_
arch_bits_per_address (abfd)
)
{
case 32:
code = BFD_RELOC_32;
{
case 32:
code = BFD_RELOC_32;
@@
-464,7
+462,7
@@
NAME (aout, some_aout_object_p) (bfd *abfd,
const bfd_target *result;
bfd_size_type amt = sizeof (* rawptr);
const bfd_target *result;
bfd_size_type amt = sizeof (* rawptr);
- rawptr = bfd_zalloc (abfd, amt);
+ rawptr =
(struct aout_data_struct *)
bfd_zalloc (abfd, amt);
if (rawptr == NULL)
return NULL;
if (rawptr == NULL)
return NULL;
@@
-629,7
+627,9
@@
NAME (aout, some_aout_object_p) (bfd *abfd,
if (execp->a_entry != 0
|| (execp->a_entry >= obj_textsec (abfd)->vma
&& execp->a_entry < (obj_textsec (abfd)->vma
if (execp->a_entry != 0
|| (execp->a_entry >= obj_textsec (abfd)->vma
&& execp->a_entry < (obj_textsec (abfd)->vma
- + obj_textsec (abfd)->size)))
+ + obj_textsec (abfd)->size)
+ && execp->a_trsize == 0
+ && execp->a_drsize == 0))
abfd->flags |= EXEC_P;
#ifdef STAT_FOR_EXEC
else
abfd->flags |= EXEC_P;
#ifdef STAT_FOR_EXEC
else
@@
-679,7
+679,7
@@
NAME (aout, mkobject) (bfd *abfd)
bfd_set_error (bfd_error_system_call);
bfd_set_error (bfd_error_system_call);
- rawptr = bfd_zalloc (abfd, amt);
+ rawptr =
(struct aout_data_struct *)
bfd_zalloc (abfd, amt);
if (rawptr == NULL)
return FALSE;
if (rawptr == NULL)
return FALSE;
@@
-791,10
+791,17
@@
NAME (aout, machine_type) (enum bfd_architecture arch,
case bfd_mach_mips16:
case bfd_mach_mipsisa32:
case bfd_mach_mipsisa32r2:
case bfd_mach_mips16:
case bfd_mach_mipsisa32:
case bfd_mach_mipsisa32r2:
+ case bfd_mach_mipsisa32r3:
+ case bfd_mach_mipsisa32r5:
+ case bfd_mach_mipsisa32r6:
case bfd_mach_mips5:
case bfd_mach_mipsisa64:
case bfd_mach_mipsisa64r2:
case bfd_mach_mips5:
case bfd_mach_mipsisa64:
case bfd_mach_mipsisa64r2:
+ case bfd_mach_mipsisa64r3:
+ case bfd_mach_mipsisa64r5:
+ case bfd_mach_mipsisa64r6:
case bfd_mach_mips_sb1:
case bfd_mach_mips_sb1:
+ case bfd_mach_mips_xlr:
/* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */
arch_flags = M_MIPS2;
break;
/* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */
arch_flags = M_MIPS2;
break;
@@
-1293,15
+1300,14
@@
aout_get_external_symbols (bfd *abfd)
{
bfd_size_type count;
struct external_nlist *syms;
{
bfd_size_type count;
struct external_nlist *syms;
- bfd_size_type amt;
+ bfd_size_type amt
= exec_hdr (abfd)->a_syms
;
- count =
exec_hdr (abfd)->a_syms
/ EXTERNAL_NLIST_SIZE;
+ count =
amt
/ EXTERNAL_NLIST_SIZE;
if (count == 0)
return TRUE; /* Nothing to do. */
#ifdef USE_MMAP
if (count == 0)
return TRUE; /* Nothing to do. */
#ifdef USE_MMAP
- if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd),
- exec_hdr (abfd)->a_syms,
+ if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), amt,
&obj_aout_sym_window (abfd), TRUE))
return FALSE;
syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
&obj_aout_sym_window (abfd), TRUE))
return FALSE;
syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
@@
-1309,11
+1315,10
@@
aout_get_external_symbols (bfd *abfd)
/* We allocate using malloc to make the values easy to free
later on. If we put them on the objalloc it might not be
possible to free them. */
/* We allocate using malloc to make the values easy to free
later on. If we put them on the objalloc it might not be
possible to free them. */
- syms =
bfd_malloc (count * EXTERNAL_NLIST_SIZE
);
+ syms =
(struct external_nlist *) bfd_malloc (amt
);
if (syms == NULL)
return FALSE;
if (syms == NULL)
return FALSE;
- amt = exec_hdr (abfd)->a_syms;
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
|| bfd_bread (syms, amt, abfd) != amt)
{
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
|| bfd_bread (syms, amt, abfd) != amt)
{
@@
-1346,7
+1351,7
@@
aout_get_external_symbols (bfd *abfd)
return FALSE;
strings = (char *) obj_aout_string_window (abfd).data;
#else
return FALSE;
strings = (char *) obj_aout_string_window (abfd).data;
#else
- strings = bfd_malloc (stringsize + 1);
+ strings =
(char *)
bfd_malloc (stringsize + 1);
if (strings == NULL)
return FALSE;
if (strings == NULL)
return FALSE;
@@
-1665,12
+1670,12
@@
NAME (aout, make_empty_symbol) (bfd *abfd)
{
bfd_size_type amt = sizeof (aout_symbol_type);
{
bfd_size_type amt = sizeof (aout_symbol_type);
- aout_symbol_type *new
=
bfd_zalloc (abfd, amt);
- if (!new)
+ aout_symbol_type *new
_symbol = (aout_symbol_type *)
bfd_zalloc (abfd, amt);
+ if (!new
_symbol
)
return NULL;
return NULL;
- new->symbol.the_bfd = abfd;
+ new
_symbol
->symbol.the_bfd = abfd;
- return &new->symbol;
+ return &new
_symbol
->symbol;
}
/* Translate a set of internal symbols into external symbols. */
}
/* Translate a set of internal symbols into external symbols. */
@@
-1747,7
+1752,7
@@
NAME (aout, slurp_symbol_table) (bfd *abfd)
return TRUE; /* Nothing to do. */
cached_size *= sizeof (aout_symbol_type);
return TRUE; /* Nothing to do. */
cached_size *= sizeof (aout_symbol_type);
- cached = bfd_zmalloc (cached_size);
+ cached =
(aout_symbol_type *)
bfd_zmalloc (cached_size);
if (cached == NULL)
return FALSE;
if (cached == NULL)
return FALSE;
@@
-1805,7
+1810,7
@@
add_to_stringtab (bfd *abfd,
bfd_boolean copy)
{
bfd_boolean hash;
bfd_boolean copy)
{
bfd_boolean hash;
- bfd_size_type index;
+ bfd_size_type
str_
index;
/* An index of 0 always means the empty string. */
if (str == 0 || *str == '\0')
/* An index of 0 always means the empty string. */
if (str == 0 || *str == '\0')
@@
-1817,14
+1822,14
@@
add_to_stringtab (bfd *abfd,
if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
hash = FALSE;
if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
hash = FALSE;
- index = _bfd_stringtab_add (tab, str, hash, copy);
+
str_
index = _bfd_stringtab_add (tab, str, hash, copy);
- if (index != (bfd_size_type) -1)
+ if (
str_
index != (bfd_size_type) -1)
/* Add BYTES_IN_WORD to the return value to account for the
space taken up by the string table size. */
/* Add BYTES_IN_WORD to the return value to account for the
space taken up by the string table size. */
- index += BYTES_IN_WORD;
+
str_
index += BYTES_IN_WORD;
- return index;
+ return
str_
index;
}
/* Write out a strtab. ABFD is already at the right location in the
}
/* Write out a strtab. ABFD is already at the right location in the
@@
-2308,7
+2313,7
@@
NAME (aout, slurp_reloc_table) (bfd *abfd, sec_ptr asect, asymbol **symbols)
return TRUE; /* Nothing to be done. */
amt = count * sizeof (arelent);
return TRUE; /* Nothing to be done. */
amt = count * sizeof (arelent);
- reloc_cache = bfd_zmalloc (amt);
+ reloc_cache =
(arelent *)
bfd_zmalloc (amt);
if (reloc_cache == NULL)
return FALSE;
if (reloc_cache == NULL)
return FALSE;
@@
-2369,7
+2374,7
@@
NAME (aout, squirt_out_relocs) (bfd *abfd, asection *section)
each_size = obj_reloc_entry_size (abfd);
natsize = (bfd_size_type) each_size * count;
each_size = obj_reloc_entry_size (abfd);
natsize = (bfd_size_type) each_size * count;
- native = bfd_zalloc (abfd, natsize);
+ native =
(unsigned char *)
bfd_zalloc (abfd, natsize);
if (!native)
return FALSE;
if (!native)
return FALSE;
@@
-2631,12
+2636,13
@@
NAME (aout, minisymbol_to_symbol) (bfd *abfd,
bfd_boolean
NAME (aout, find_nearest_line) (bfd *abfd,
bfd_boolean
NAME (aout, find_nearest_line) (bfd *abfd,
- asection *section,
asymbol **symbols,
asymbol **symbols,
+ asection *section,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
bfd_vma offset,
const char **filename_ptr,
const char **functionname_ptr,
- unsigned int *line_ptr)
+ unsigned int *line_ptr,
+ unsigned int *disriminator_ptr)
{
/* Run down the file looking for the filename, function and linenumber. */
asymbol **p;
{
/* Run down the file looking for the filename, function and linenumber. */
asymbol **p;
@@
-2654,6
+2660,8
@@
NAME (aout, find_nearest_line) (bfd *abfd,
*filename_ptr = abfd->filename;
*functionname_ptr = 0;
*line_ptr = 0;
*filename_ptr = abfd->filename;
*functionname_ptr = 0;
*line_ptr = 0;
+ if (disriminator_ptr)
+ *disriminator_ptr = 0;
if (symbols != NULL)
{
if (symbols != NULL)
{
@@
-2783,7
+2791,7
@@
NAME (aout, find_nearest_line) (bfd *abfd,
adata (abfd).line_buf = buf = NULL;
else
{
adata (abfd).line_buf = buf = NULL;
else
{
- buf = bfd_malloc (filelen + funclen + 3);
+ buf =
(char *)
bfd_malloc (filelen + funclen + 3);
adata (abfd).line_buf = buf;
if (buf == NULL)
return FALSE;
adata (abfd).line_buf = buf;
if (buf == NULL)
return FALSE;
@@
-2877,7
+2885,8
@@
NAME (aout, link_hash_newfunc) (struct bfd_hash_entry *entry,
/* Allocate the structure if it has not already been allocated by a
subclass. */
if (ret == NULL)
/* Allocate the structure if it has not already been allocated by a
subclass. */
if (ret == NULL)
- ret = bfd_hash_allocate (table, sizeof (* ret));
+ ret = (struct aout_link_hash_entry *) bfd_hash_allocate (table,
+ sizeof (* ret));
if (ret == NULL)
return NULL;
if (ret == NULL)
return NULL;
@@
-2916,7
+2925,7
@@
NAME (aout, link_hash_table_create) (bfd *abfd)
struct aout_link_hash_table *ret;
bfd_size_type amt = sizeof (* ret);
struct aout_link_hash_table *ret;
bfd_size_type amt = sizeof (* ret);
- ret = bfd_malloc (amt);
+ ret =
(struct aout_link_hash_table *)
bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (ret == NULL)
return NULL;
@@
-2971,7
+2980,7
@@
aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
table, but keeping the list is more efficient. Perhaps this
should be conditional on info->keep_memory. */
amt = sym_count * sizeof (struct aout_link_hash_entry *);
table, but keeping the list is more efficient. Perhaps this
should be conditional on info->keep_memory. */
amt = sym_count * sizeof (struct aout_link_hash_entry *);
- sym_hash = bfd_alloc (abfd, amt);
+ sym_hash =
(struct aout_link_hash_entry **)
bfd_alloc (abfd, amt);
if (sym_hash == NULL)
return FALSE;
obj_aout_sym_hashes (abfd) = sym_hash;
if (sym_hash == NULL)
return FALSE;
obj_aout_sym_hashes (abfd) = sym_hash;
@@
-3204,7
+3213,8
@@
aout_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
static bfd_boolean
aout_link_check_ar_symbols (bfd *abfd,
struct bfd_link_info *info,
static bfd_boolean
aout_link_check_ar_symbols (bfd *abfd,
struct bfd_link_info *info,
- bfd_boolean *pneeded)
+ bfd_boolean *pneeded,
+ bfd **subsbfd)
{
struct external_nlist *p;
struct external_nlist *pend;
{
struct external_nlist *p;
struct external_nlist *pend;
@@
-3280,7
+3290,7
@@
aout_link_check_ar_symbols (bfd *abfd,
{
int skip = 0;
{
int skip = 0;
- switch (info->common_skip_ar_
a
ymbols)
+ switch (info->common_skip_ar_
s
ymbols)
{
case bfd_link_common_skip_text:
skip = (type == (N_TEXT | N_EXT));
{
case bfd_link_common_skip_text:
skip = (type == (N_TEXT | N_EXT));
@@
-3298,7
+3308,8
@@
aout_link_check_ar_symbols (bfd *abfd,
continue;
}
continue;
}
- if (! (*info->callbacks->add_archive_element) (info, abfd, name))
+ if (!(*info->callbacks
+ ->add_archive_element) (info, abfd, name, subsbfd))
return FALSE;
*pneeded = TRUE;
return TRUE;
return FALSE;
*pneeded = TRUE;
return TRUE;
@@
-3325,9
+3336,8
@@
aout_link_check_ar_symbols (bfd *abfd,
outside BFD. We assume that we should link
in the object file. This is done for the -u
option in the linker. */
outside BFD. We assume that we should link
in the object file. This is done for the -u
option in the linker. */
- if (! (*info->callbacks->add_archive_element) (info,
- abfd,
- name))
+ if (!(*info->callbacks
+ ->add_archive_element) (info, abfd, name, subsbfd))
return FALSE;
*pneeded = TRUE;
return TRUE;
return FALSE;
*pneeded = TRUE;
return TRUE;
@@
-3335,8
+3345,9
@@
aout_link_check_ar_symbols (bfd *abfd,
/* Turn the current link symbol into a common
symbol. It is already on the undefs list. */
h->type = bfd_link_hash_common;
/* Turn the current link symbol into a common
symbol. It is already on the undefs list. */
h->type = bfd_link_hash_common;
- h->u.c.p = bfd_hash_allocate (&info->hash->table,
- sizeof (struct bfd_link_hash_common_entry));
+ h->u.c.p = (struct bfd_link_hash_common_entry *)
+ bfd_hash_allocate (&info->hash->table,
+ sizeof (struct bfd_link_hash_common_entry));
if (h->u.c.p == NULL)
return FALSE;
if (h->u.c.p == NULL)
return FALSE;
@@
-3374,7
+3385,8
@@
aout_link_check_ar_symbols (bfd *abfd,
it if the current link symbol is common. */
if (h->type == bfd_link_hash_undefined)
{
it if the current link symbol is common. */
if (h->type == bfd_link_hash_undefined)
{
- if (! (*info->callbacks->add_archive_element) (info, abfd, name))
+ if (!(*info->callbacks
+ ->add_archive_element) (info, abfd, name, subsbfd))
return FALSE;
*pneeded = TRUE;
return TRUE;
return FALSE;
*pneeded = TRUE;
return TRUE;
@@
-3393,23
+3405,40
@@
aout_link_check_ar_symbols (bfd *abfd,
static bfd_boolean
aout_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
static bfd_boolean
aout_link_check_archive_element (bfd *abfd,
struct bfd_link_info *info,
+ struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED,
bfd_boolean *pneeded)
{
bfd_boolean *pneeded)
{
- if (! aout_get_external_symbols (abfd))
+ bfd *oldbfd;
+ bfd_boolean needed;
+
+ if (!aout_get_external_symbols (abfd))
return FALSE;
return FALSE;
- if (! aout_link_check_ar_symbols (abfd, info, pneeded))
+ oldbfd = abfd;
+ if (!aout_link_check_ar_symbols (abfd, info, pneeded, &abfd))
return FALSE;
return FALSE;
- if (*pneeded)
+ needed = *pneeded;
+ if (needed)
{
{
- if (! aout_link_add_symbols (abfd, info))
+ /* Potentially, the add_archive_element hook may have set a
+ substitute BFD for us. */
+ if (abfd != oldbfd)
+ {
+ if (!info->keep_memory
+ && !aout_link_free_symbols (oldbfd))
+ return FALSE;
+ if (!aout_get_external_symbols (abfd))
+ return FALSE;
+ }
+ if (!aout_link_add_symbols (abfd, info))
return FALSE;
}
return FALSE;
}
- if (!
info->keep_memory || ! *p
needed)
+ if (!
info->keep_memory || !
needed)
{
{
- if (!
aout_link_free_symbols (abfd))
+ if (!aout_link_free_symbols (abfd))
return FALSE;
}
return FALSE;
}
@@
-3506,7
+3535,8
@@
aout_link_includes_newfunc (struct bfd_hash_entry *entry,
/* Allocate the structure if it has not already been allocated by a
subclass. */
if (ret == NULL)
/* Allocate the structure if it has not already been allocated by a
subclass. */
if (ret == NULL)
- ret = bfd_hash_allocate (table, sizeof (* ret));
+ ret = (struct aout_link_includes_entry *)
+ bfd_hash_allocate (table, sizeof (* ret));
if (ret == NULL)
return NULL;
if (ret == NULL)
return NULL;
@@
-3526,9
+3556,10
@@
aout_link_includes_newfunc (struct bfd_hash_entry *entry,
object. */
static bfd_boolean
object. */
static bfd_boolean
-aout_link_write_other_symbol (struct
aout_link_hash_entry *h, void *
data)
+aout_link_write_other_symbol (struct
bfd_hash_entry *bh, void *
data)
{
{
- struct aout_final_link_info *finfo = (struct aout_final_link_info *) data;
+ struct aout_link_hash_entry *h = (struct aout_link_hash_entry *) bh;
+ struct aout_final_link_info *flaginfo = (struct aout_final_link_info *) data;
bfd *output_bfd;
int type;
bfd_vma val;
bfd *output_bfd;
int type;
bfd_vma val;
@@
-3543,12
+3574,12
@@
aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data)
return TRUE;
}
return TRUE;
}
- output_bfd = finfo->output_bfd;
+ output_bfd = f
lag
info->output_bfd;
if (aout_backend_info (output_bfd)->write_dynamic_symbol != NULL)
{
if (! ((*aout_backend_info (output_bfd)->write_dynamic_symbol)
if (aout_backend_info (output_bfd)->write_dynamic_symbol != NULL)
{
if (! ((*aout_backend_info (output_bfd)->write_dynamic_symbol)
- (output_bfd, finfo->info, h)))
+ (output_bfd, f
lag
info->info, h)))
{
/* FIXME: No way to handle errors. */
abort ();
{
/* FIXME: No way to handle errors. */
abort ();
@@
-3562,9
+3593,9
@@
aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data)
/* An indx of -2 means the symbol must be written. */
if (h->indx != -2
/* An indx of -2 means the symbol must be written. */
if (h->indx != -2
- && (finfo->info->strip == strip_all
- || (finfo->info->strip == strip_some
- && bfd_hash_lookup (finfo->info->keep_hash, h->root.root.string,
+ && (f
lag
info->info->strip == strip_all
+ || (f
lag
info->info->strip == strip_some
+ && bfd_hash_lookup (f
lag
info->info->keep_hash, h->root.root.string,
FALSE, FALSE) == NULL)))
return TRUE;
FALSE, FALSE) == NULL)))
return TRUE;
@@
-3612,6
+3643,7
@@
aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data)
case bfd_link_hash_undefweak:
type = N_WEAKU;
val = 0;
case bfd_link_hash_undefweak:
type = N_WEAKU;
val = 0;
+ break;
case bfd_link_hash_indirect:
/* We ignore these symbols, since the indirected symbol is
already in the hash table. */
case bfd_link_hash_indirect:
/* We ignore these symbols, since the indirected symbol is
already in the hash table. */
@@
-3621,7
+3653,7
@@
aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data)
H_PUT_8 (output_bfd, type, outsym.e_type);
H_PUT_8 (output_bfd, 0, outsym.e_other);
H_PUT_16 (output_bfd, 0, outsym.e_desc);
H_PUT_8 (output_bfd, type, outsym.e_type);
H_PUT_8 (output_bfd, 0, outsym.e_other);
H_PUT_16 (output_bfd, 0, outsym.e_desc);
- indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string,
+ indx = add_to_stringtab (output_bfd, f
lag
info->strtab, h->root.root.string,
FALSE);
if (indx == - (bfd_size_type) 1)
/* FIXME: No way to handle errors. */
FALSE);
if (indx == - (bfd_size_type) 1)
/* FIXME: No way to handle errors. */
@@
-3631,12
+3663,12
@@
aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data)
PUT_WORD (output_bfd, val, outsym.e_value);
amt = EXTERNAL_NLIST_SIZE;
PUT_WORD (output_bfd, val, outsym.e_value);
amt = EXTERNAL_NLIST_SIZE;
- if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0
+ if (bfd_seek (output_bfd, f
lag
info->symoff, SEEK_SET) != 0
|| bfd_bwrite ((void *) &outsym, amt, output_bfd) != amt)
/* FIXME: No way to handle errors. */
abort ();
|| bfd_bwrite ((void *) &outsym, amt, output_bfd) != amt)
/* FIXME: No way to handle errors. */
abort ();
- finfo->symoff += EXTERNAL_NLIST_SIZE;
+ f
lag
info->symoff += EXTERNAL_NLIST_SIZE;
h->indx = obj_aout_external_sym_count (output_bfd);
++obj_aout_external_sym_count (output_bfd);
h->indx = obj_aout_external_sym_count (output_bfd);
++obj_aout_external_sym_count (output_bfd);
@@
-3646,7
+3678,7
@@
aout_link_write_other_symbol (struct aout_link_hash_entry *h, void * data)
/* Handle a link order which is supposed to generate a reloc. */
static bfd_boolean
/* Handle a link order which is supposed to generate a reloc. */
static bfd_boolean
-aout_link_reloc_link_order (struct aout_final_link_info *finfo,
+aout_link_reloc_link_order (struct aout_final_link_info *f
lag
info,
asection *o,
struct bfd_link_order *p)
{
asection *o,
struct bfd_link_order *p)
{
@@
-3669,7
+3701,7
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
r_index = N_ABS | N_EXT;
else
{
r_index = N_ABS | N_EXT;
else
{
- BFD_ASSERT (pr->u.section->owner == finfo->output_bfd);
+ BFD_ASSERT (pr->u.section->owner == f
lag
info->output_bfd);
r_index = pr->u.section->target_index;
}
}
r_index = pr->u.section->target_index;
}
}
@@
-3680,7
+3712,7
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
BFD_ASSERT (p->type == bfd_symbol_reloc_link_order);
r_extern = 1;
h = ((struct aout_link_hash_entry *)
BFD_ASSERT (p->type == bfd_symbol_reloc_link_order);
r_extern = 1;
h = ((struct aout_link_hash_entry *)
- bfd_wrapped_link_hash_lookup (f
info->output_bfd, f
info->info,
+ bfd_wrapped_link_hash_lookup (f
laginfo->output_bfd, flag
info->info,
pr->u.name, FALSE, FALSE, TRUE));
if (h != NULL
&& h->indx >= 0)
pr->u.name, FALSE, FALSE, TRUE));
if (h != NULL
&& h->indx >= 0)
@@
-3693,37
+3725,37
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
symbol. */
h->indx = -2;
h->written = FALSE;
symbol. */
h->indx = -2;
h->written = FALSE;
- if (!
aout_link_write_other_symbol (h, (void *) f
info))
+ if (!
aout_link_write_other_symbol (&h->root.root, flag
info))
return FALSE;
r_index = h->indx;
}
else
{
return FALSE;
r_index = h->indx;
}
else
{
- if (! ((*finfo->info->callbacks->unattached_reloc)
- (finfo->info, pr->u.name, NULL, NULL, (bfd_vma) 0)))
+ if (! ((*f
lag
info->info->callbacks->unattached_reloc)
+ (f
lag
info->info, pr->u.name, NULL, NULL, (bfd_vma) 0)))
return FALSE;
r_index = 0;
}
}
return FALSE;
r_index = 0;
}
}
- howto = bfd_reloc_type_lookup (finfo->output_bfd, pr->reloc);
+ howto = bfd_reloc_type_lookup (f
lag
info->output_bfd, pr->reloc);
if (howto == 0)
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (howto == 0)
{
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
- if (o == obj_textsec (finfo->output_bfd))
- reloff_ptr = &finfo->treloff;
- else if (o == obj_datasec (finfo->output_bfd))
- reloff_ptr = &finfo->dreloff;
+ if (o == obj_textsec (f
lag
info->output_bfd))
+ reloff_ptr = &f
lag
info->treloff;
+ else if (o == obj_datasec (f
lag
info->output_bfd))
+ reloff_ptr = &f
lag
info->dreloff;
else
abort ();
else
abort ();
- if (obj_reloc_entry_size (finfo->output_bfd) == RELOC_STD_SIZE)
+ if (obj_reloc_entry_size (f
lag
info->output_bfd) == RELOC_STD_SIZE)
{
#ifdef MY_put_reloc
{
#ifdef MY_put_reloc
- MY_put_reloc (finfo->output_bfd, r_extern, r_index, p->offset, howto,
+ MY_put_reloc (f
lag
info->output_bfd, r_extern, r_index, p->offset, howto,
&srel);
#else
{
&srel);
#else
{
@@
-3739,8
+3771,8
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
r_relative = (howto->type & 32) != 0;
r_length = howto->size;
r_relative = (howto->type & 32) != 0;
r_length = howto->size;
- PUT_WORD (finfo->output_bfd, p->offset, srel.r_address);
- if (bfd_header_big_endian (finfo->output_bfd))
+ PUT_WORD (f
lag
info->output_bfd, p->offset, srel.r_address);
+ if (bfd_header_big_endian (f
lag
info->output_bfd))
{
srel.r_index[0] = r_index >> 16;
srel.r_index[1] = r_index >> 8;
{
srel.r_index[0] = r_index >> 16;
srel.r_index[1] = r_index >> 8;
@@
-3783,10
+3815,10
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
bfd_boolean ok;
size = bfd_get_reloc_size (howto);
bfd_boolean ok;
size = bfd_get_reloc_size (howto);
- buf = bfd_zmalloc (size);
+ buf =
(bfd_byte *)
bfd_zmalloc (size);
if (buf == NULL)
return FALSE;
if (buf == NULL)
return FALSE;
- r = MY_relocate_contents (howto, finfo->output_bfd,
+ r = MY_relocate_contents (howto, f
lag
info->output_bfd,
(bfd_vma) pr->addend, buf);
switch (r)
{
(bfd_vma) pr->addend, buf);
switch (r)
{
@@
-3796,10
+3828,10
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
case bfd_reloc_outofrange:
abort ();
case bfd_reloc_overflow:
case bfd_reloc_outofrange:
abort ();
case bfd_reloc_overflow:
- if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info, NULL,
+ if (! ((*f
lag
info->info->callbacks->reloc_overflow)
+ (f
lag
info->info, NULL,
(p->type == bfd_section_reloc_link_order
(p->type == bfd_section_reloc_link_order
- ? bfd_section_name (finfo->output_bfd,
+ ? bfd_section_name (f
lag
info->output_bfd,
pr->u.section)
: pr->u.name),
howto->name, pr->addend, NULL, NULL, (bfd_vma) 0)))
pr->u.section)
: pr->u.name),
howto->name, pr->addend, NULL, NULL, (bfd_vma) 0)))
@@
-3809,7
+3841,7
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
}
break;
}
}
break;
}
- ok = bfd_set_section_contents (finfo->output_bfd, o, (void *) buf,
+ ok = bfd_set_section_contents (f
lag
info->output_bfd, o, (void *) buf,
(file_ptr) p->offset, size);
free (buf);
if (! ok)
(file_ptr) p->offset, size);
free (buf);
if (! ok)
@@
-3819,12
+3851,12
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
else
{
#ifdef MY_put_ext_reloc
else
{
#ifdef MY_put_ext_reloc
- MY_put_ext_reloc (finfo->output_bfd, r_extern, r_index, p->offset,
+ MY_put_ext_reloc (f
lag
info->output_bfd, r_extern, r_index, p->offset,
howto, &erel, pr->addend);
#else
howto, &erel, pr->addend);
#else
- PUT_WORD (finfo->output_bfd, p->offset, erel.r_address);
+ PUT_WORD (f
lag
info->output_bfd, p->offset, erel.r_address);
- if (bfd_header_big_endian (finfo->output_bfd))
+ if (bfd_header_big_endian (f
lag
info->output_bfd))
{
erel.r_index[0] = r_index >> 16;
erel.r_index[1] = r_index >> 8;
{
erel.r_index[0] = r_index >> 16;
erel.r_index[1] = r_index >> 8;
@@
-3843,25
+3875,25
@@
aout_link_reloc_link_order (struct aout_final_link_info *finfo,
| (howto->type << RELOC_EXT_BITS_TYPE_SH_LITTLE);
}
| (howto->type << RELOC_EXT_BITS_TYPE_SH_LITTLE);
}
- PUT_WORD (finfo->output_bfd, (bfd_vma) pr->addend, erel.r_addend);
+ PUT_WORD (f
lag
info->output_bfd, (bfd_vma) pr->addend, erel.r_addend);
#endif /* MY_put_ext_reloc */
rel_ptr = (void *) &erel;
}
#endif /* MY_put_ext_reloc */
rel_ptr = (void *) &erel;
}
- amt = obj_reloc_entry_size (finfo->output_bfd);
- if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0
- || bfd_bwrite (rel_ptr, amt, finfo->output_bfd) != amt)
+ amt = obj_reloc_entry_size (f
lag
info->output_bfd);
+ if (bfd_seek (f
lag
info->output_bfd, *reloff_ptr, SEEK_SET) != 0
+ || bfd_bwrite (rel_ptr, amt, f
lag
info->output_bfd) != amt)
return FALSE;
return FALSE;
- *reloff_ptr += obj_reloc_entry_size (finfo->output_bfd);
+ *reloff_ptr += obj_reloc_entry_size (f
lag
info->output_bfd);
/* Assert that the relocs have not run into the symbols, and that n
the text relocs have not run into the data relocs. */
/* Assert that the relocs have not run into the symbols, and that n
the text relocs have not run into the data relocs. */
- BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (finfo->output_bfd)
- && (reloff_ptr != &finfo->treloff
+ BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (f
lag
info->output_bfd)
+ && (reloff_ptr != &f
lag
info->treloff
|| (*reloff_ptr
|| (*reloff_ptr
- <= obj_datasec (finfo->output_bfd)->rel_filepos)));
+ <= obj_datasec (f
lag
info->output_bfd)->rel_filepos)));
return TRUE;
}
return TRUE;
}
@@
-3886,7
+3918,7
@@
aout_reloc_index_to_section (bfd *abfd, int indx)
/* Relocate an a.out section using standard a.out relocs. */
static bfd_boolean
/* Relocate an a.out section using standard a.out relocs. */
static bfd_boolean
-aout_link_input_section_std (struct aout_final_link_info *finfo,
+aout_link_input_section_std (struct aout_final_link_info *f
lag
info,
bfd *input_bfd,
asection *input_section,
struct reloc_std_external *relocs,
bfd *input_bfd,
asection *input_section,
struct reloc_std_external *relocs,
@@
-3907,18
+3939,18
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
struct reloc_std_external *rel;
struct reloc_std_external *rel_end;
struct reloc_std_external *rel;
struct reloc_std_external *rel_end;
- output_bfd = finfo->output_bfd;
+ output_bfd = f
lag
info->output_bfd;
check_dynamic_reloc = aout_backend_info (output_bfd)->check_dynamic_reloc;
BFD_ASSERT (obj_reloc_entry_size (input_bfd) == RELOC_STD_SIZE);
BFD_ASSERT (input_bfd->xvec->header_byteorder
== output_bfd->xvec->header_byteorder);
check_dynamic_reloc = aout_backend_info (output_bfd)->check_dynamic_reloc;
BFD_ASSERT (obj_reloc_entry_size (input_bfd) == RELOC_STD_SIZE);
BFD_ASSERT (input_bfd->xvec->header_byteorder
== output_bfd->xvec->header_byteorder);
- relocatable = finfo->info->relocatable;
+ relocatable = f
lag
info->info->relocatable;
syms = obj_aout_external_syms (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_hashes = obj_aout_sym_hashes (input_bfd);
syms = obj_aout_external_syms (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_hashes = obj_aout_sym_hashes (input_bfd);
- symbol_map = finfo->symbol_map;
+ symbol_map = f
lag
info->symbol_map;
reloc_count = rel_size / RELOC_STD_SIZE;
rel = relocs;
reloc_count = rel_size / RELOC_STD_SIZE;
rel = relocs;
@@
-3987,7
+4019,7
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
if (howto == NULL)
{
if (howto == NULL)
{
- (*finfo->info->callbacks->einfo)
+ (*f
lag
info->info->callbacks->einfo)
(_("%P: %B: unexpected relocation type\n"), input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
(_("%P: %B: unexpected relocation type\n"), input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
@@
-4051,8
+4083,8
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
{
h->indx = -2;
h->written = FALSE;
{
h->indx = -2;
h->written = FALSE;
- if (!
aout_link_write_other_symbol (h
,
-
(void *) f
info))
+ if (!
aout_link_write_other_symbol (&h->root.root
,
+
flag
info))
return FALSE;
}
r_index = h->indx;
return FALSE;
}
r_index = h->indx;
@@
-4063,8
+4095,8
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx);
name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx);
- if (! ((*finfo->info->callbacks->unattached_reloc)
- (finfo->info, name, input_bfd, input_section,
+ if (! ((*f
lag
info->info->callbacks->unattached_reloc)
+ (f
lag
info->info, name, input_bfd, input_section,
r_addr)))
return FALSE;
r_index = 0;
r_addr)))
return FALSE;
r_index = 0;
@@
-4170,7
+4202,7
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
bfd_boolean skip;
if (! ((*check_dynamic_reloc)
bfd_boolean skip;
if (! ((*check_dynamic_reloc)
- (finfo->info, input_bfd, input_section, h,
+ (f
lag
info->info, input_bfd, input_section, h,
(void *) rel, contents, &skip, &relocation)))
return FALSE;
if (skip)
(void *) rel, contents, &skip, &relocation)))
return FALSE;
if (skip)
@@
-4180,7
+4212,7
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
/* Now warn if a global symbol is undefined. We could not
do this earlier, because check_dynamic_reloc might want
to skip this reloc. */
/* Now warn if a global symbol is undefined. We could not
do this earlier, because check_dynamic_reloc might want
to skip this reloc. */
- if (hundef && ! finfo->info->shared && ! r_baserel)
+ if (hundef && ! f
lag
info->info->shared && ! r_baserel)
{
const char *name;
{
const char *name;
@@
-4188,8
+4220,8
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
name = h->root.root.string;
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
name = h->root.root.string;
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
- if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section,
+ if (! ((*f
lag
info->info->callbacks->undefined_symbol)
+ (f
lag
info->info, name, input_bfd, input_section,
r_addr, TRUE)))
return FALSE;
}
r_addr, TRUE)))
return FALSE;
}
@@
-4223,8
+4255,8
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
s = aout_reloc_index_to_section (input_bfd, r_index);
name = bfd_section_name (input_bfd, s);
}
s = aout_reloc_index_to_section (input_bfd, r_index);
name = bfd_section_name (input_bfd, s);
}
- if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info, (h ? &h->root : NULL), name,
+ if (! ((*f
lag
info->info->callbacks->reloc_overflow)
+ (f
lag
info->info, (h ? &h->root : NULL), name,
howto->name, (bfd_vma) 0, input_bfd,
input_section, r_addr)))
return FALSE;
howto->name, (bfd_vma) 0, input_bfd,
input_section, r_addr)))
return FALSE;
@@
-4240,7
+4272,7
@@
aout_link_input_section_std (struct aout_final_link_info *finfo,
/* Relocate an a.out section using extended a.out relocs. */
static bfd_boolean
/* Relocate an a.out section using extended a.out relocs. */
static bfd_boolean
-aout_link_input_section_ext (struct aout_final_link_info *finfo,
+aout_link_input_section_ext (struct aout_final_link_info *f
lag
info,
bfd *input_bfd,
asection *input_section,
struct reloc_ext_external *relocs,
bfd *input_bfd,
asection *input_section,
struct reloc_ext_external *relocs,
@@
-4261,18
+4293,18
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
struct reloc_ext_external *rel;
struct reloc_ext_external *rel_end;
struct reloc_ext_external *rel;
struct reloc_ext_external *rel_end;
- output_bfd = finfo->output_bfd;
+ output_bfd = f
lag
info->output_bfd;
check_dynamic_reloc = aout_backend_info (output_bfd)->check_dynamic_reloc;
BFD_ASSERT (obj_reloc_entry_size (input_bfd) == RELOC_EXT_SIZE);
BFD_ASSERT (input_bfd->xvec->header_byteorder
== output_bfd->xvec->header_byteorder);
check_dynamic_reloc = aout_backend_info (output_bfd)->check_dynamic_reloc;
BFD_ASSERT (obj_reloc_entry_size (input_bfd) == RELOC_EXT_SIZE);
BFD_ASSERT (input_bfd->xvec->header_byteorder
== output_bfd->xvec->header_byteorder);
- relocatable = finfo->info->relocatable;
+ relocatable = f
lag
info->info->relocatable;
syms = obj_aout_external_syms (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_hashes = obj_aout_sym_hashes (input_bfd);
syms = obj_aout_external_syms (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_hashes = obj_aout_sym_hashes (input_bfd);
- symbol_map = finfo->symbol_map;
+ symbol_map = f
lag
info->symbol_map;
reloc_count = rel_size / RELOC_EXT_SIZE;
rel = relocs;
reloc_count = rel_size / RELOC_EXT_SIZE;
rel = relocs;
@@
-4313,7
+4345,7
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
if (r_type >= TABLE_SIZE (howto_table_ext))
{
if (r_type >= TABLE_SIZE (howto_table_ext))
{
- (*finfo->info->callbacks->einfo)
+ (*f
lag
info->info->callbacks->einfo)
(_("%P: %B: unexpected relocation type\n"), input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
(_("%P: %B: unexpected relocation type\n"), input_bfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
@@
-4393,8
+4425,8
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
{
h->indx = -2;
h->written = FALSE;
{
h->indx = -2;
h->written = FALSE;
- if (!
aout_link_write_other_symbol (h
,
-
(void *) f
info))
+ if (!
aout_link_write_other_symbol (&h->root.root
,
+
flag
info))
return FALSE;
}
r_index = h->indx;
return FALSE;
}
r_index = h->indx;
@@
-4405,8
+4437,8
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx);
name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx);
- if (! ((*finfo->info->callbacks->unattached_reloc)
- (finfo->info, name, input_bfd, input_section,
+ if (! ((*f
lag
info->info->callbacks->unattached_reloc)
+ (f
lag
info->info, name, input_bfd, input_section,
r_addr)))
return FALSE;
r_index = 0;
r_addr)))
return FALSE;
r_index = 0;
@@
-4573,7
+4605,7
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
bfd_boolean skip;
if (! ((*check_dynamic_reloc)
bfd_boolean skip;
if (! ((*check_dynamic_reloc)
- (finfo->info, input_bfd, input_section, h,
+ (f
lag
info->info, input_bfd, input_section, h,
(void *) rel, contents, &skip, &relocation)))
return FALSE;
if (skip)
(void *) rel, contents, &skip, &relocation)))
return FALSE;
if (skip)
@@
-4584,7
+4616,7
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
do this earlier, because check_dynamic_reloc might want
to skip this reloc. */
if (hundef
do this earlier, because check_dynamic_reloc might want
to skip this reloc. */
if (hundef
- && ! finfo->info->shared
+ && ! f
lag
info->info->shared
&& r_type != (unsigned int) RELOC_BASE10
&& r_type != (unsigned int) RELOC_BASE13
&& r_type != (unsigned int) RELOC_BASE22)
&& r_type != (unsigned int) RELOC_BASE10
&& r_type != (unsigned int) RELOC_BASE13
&& r_type != (unsigned int) RELOC_BASE22)
@@
-4595,8
+4627,8
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
name = h->root.root.string;
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
name = h->root.root.string;
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
- if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section,
+ if (! ((*f
lag
info->info->callbacks->undefined_symbol)
+ (f
lag
info->info, name, input_bfd, input_section,
r_addr, TRUE)))
return FALSE;
}
r_addr, TRUE)))
return FALSE;
}
@@
-4642,8
+4674,8
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
s = aout_reloc_index_to_section (input_bfd, r_index);
name = bfd_section_name (input_bfd, s);
}
s = aout_reloc_index_to_section (input_bfd, r_index);
name = bfd_section_name (input_bfd, s);
}
- if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info, (h ? &h->root : NULL), name,
+ if (! ((*f
lag
info->info->callbacks->reloc_overflow)
+ (f
lag
info->info, (h ? &h->root : NULL), name,
howto_table_ext[r_type].name,
r_addend, input_bfd, input_section, r_addr)))
return FALSE;
howto_table_ext[r_type].name,
r_addend, input_bfd, input_section, r_addr)))
return FALSE;
@@
-4660,7
+4692,7
@@
aout_link_input_section_ext (struct aout_final_link_info *finfo,
/* Link an a.out section into the output file. */
static bfd_boolean
/* Link an a.out section into the output file. */
static bfd_boolean
-aout_link_input_section (struct aout_final_link_info *finfo,
+aout_link_input_section (struct aout_final_link_info *f
lag
info,
bfd *input_bfd,
asection *input_section,
file_ptr *reloff_ptr,
bfd *input_bfd,
asection *input_section,
file_ptr *reloff_ptr,
@@
-4672,7
+4704,7
@@
aout_link_input_section (struct aout_final_link_info *finfo,
/* Get the section contents. */
input_size = input_section->size;
if (! bfd_get_section_contents (input_bfd, input_section,
/* Get the section contents. */
input_size = input_section->size;
if (! bfd_get_section_contents (input_bfd, input_section,
- (void *) finfo->contents,
+ (void *) f
lag
info->contents,
(file_ptr) 0, input_size))
return FALSE;
(file_ptr) 0, input_size))
return FALSE;
@@
-4682,7
+4714,7
@@
aout_link_input_section (struct aout_final_link_info *finfo,
relocs = aout_section_data (input_section)->relocs;
else
{
relocs = aout_section_data (input_section)->relocs;
else
{
- relocs = finfo->relocs;
+ relocs = f
lag
info->relocs;
if (rel_size > 0)
{
if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
if (rel_size > 0)
{
if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
@@
-4694,44
+4726,44
@@
aout_link_input_section (struct aout_final_link_info *finfo,
/* Relocate the section contents. */
if (obj_reloc_entry_size (input_bfd) == RELOC_STD_SIZE)
{
/* Relocate the section contents. */
if (obj_reloc_entry_size (input_bfd) == RELOC_STD_SIZE)
{
- if (! aout_link_input_section_std (finfo, input_bfd, input_section,
+ if (! aout_link_input_section_std (f
lag
info, input_bfd, input_section,
(struct reloc_std_external *) relocs,
(struct reloc_std_external *) relocs,
- rel_size, finfo->contents))
+ rel_size, f
lag
info->contents))
return FALSE;
}
else
{
return FALSE;
}
else
{
- if (! aout_link_input_section_ext (finfo, input_bfd, input_section,
+ if (! aout_link_input_section_ext (f
lag
info, input_bfd, input_section,
(struct reloc_ext_external *) relocs,
(struct reloc_ext_external *) relocs,
- rel_size, finfo->contents))
+ rel_size, f
lag
info->contents))
return FALSE;
}
/* Write out the section contents. */
return FALSE;
}
/* Write out the section contents. */
- if (! bfd_set_section_contents (finfo->output_bfd,
+ if (! bfd_set_section_contents (f
lag
info->output_bfd,
input_section->output_section,
input_section->output_section,
- (void *) finfo->contents,
+ (void *) f
lag
info->contents,
(file_ptr) input_section->output_offset,
input_size))
return FALSE;
/* If we are producing relocatable output, the relocs were
modified, and we now write them out. */
(file_ptr) input_section->output_offset,
input_size))
return FALSE;
/* If we are producing relocatable output, the relocs were
modified, and we now write them out. */
- if (finfo->info->relocatable && rel_size > 0)
+ if (f
lag
info->info->relocatable && rel_size > 0)
{
{
- if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
+ if (bfd_seek (f
lag
info->output_bfd, *reloff_ptr, SEEK_SET) != 0)
return FALSE;
return FALSE;
- if (bfd_bwrite (relocs, rel_size, finfo->output_bfd) != rel_size)
+ if (bfd_bwrite (relocs, rel_size, f
lag
info->output_bfd) != rel_size)
return FALSE;
*reloff_ptr += rel_size;
/* Assert that the relocs have not run into the symbols, and
that if these are the text relocs they have not run into the
data relocs. */
return FALSE;
*reloff_ptr += rel_size;
/* Assert that the relocs have not run into the symbols, and
that if these are the text relocs they have not run into the
data relocs. */
- BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (finfo->output_bfd)
- && (reloff_ptr != &finfo->treloff
+ BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (f
lag
info->output_bfd)
+ && (reloff_ptr != &f
lag
info->treloff
|| (*reloff_ptr
|| (*reloff_ptr
- <= obj_datasec (finfo->output_bfd)->rel_filepos)));
+ <= obj_datasec (f
lag
info->output_bfd)->rel_filepos)));
}
return TRUE;
}
return TRUE;
@@
-4741,7
+4773,7
@@
aout_link_input_section (struct aout_final_link_info *finfo,
symbol indices into a symbol_map. */
static bfd_boolean
symbol indices into a symbol_map. */
static bfd_boolean
-aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
+aout_link_write_symbols (struct aout_final_link_info *f
lag
info, bfd *input_bfd)
{
bfd *output_bfd;
bfd_size_type sym_count;
{
bfd *output_bfd;
bfd_size_type sym_count;
@@
-4757,25
+4789,25
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
bfd_boolean pass;
bfd_boolean skip_next;
bfd_boolean pass;
bfd_boolean skip_next;
- output_bfd = finfo->output_bfd;
+ output_bfd = f
lag
info->output_bfd;
sym_count = obj_aout_external_sym_count (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_count = obj_aout_external_sym_count (input_bfd);
strings = obj_aout_external_strings (input_bfd);
- strip = finfo->info->strip;
- discard = finfo->info->discard;
- outsym = finfo->output_syms;
+ strip = f
lag
info->info->strip;
+ discard = f
lag
info->info->discard;
+ outsym = f
lag
info->output_syms;
/* First write out a symbol for this object file, unless we are
discarding such symbols. */
if (strip != strip_all
&& (strip != strip_some
/* First write out a symbol for this object file, unless we are
discarding such symbols. */
if (strip != strip_all
&& (strip != strip_some
- || bfd_hash_lookup (finfo->info->keep_hash, input_bfd->filename,
+ || bfd_hash_lookup (f
lag
info->info->keep_hash, input_bfd->filename,
FALSE, FALSE) != NULL)
&& discard != discard_all)
{
H_PUT_8 (output_bfd, N_TEXT, outsym->e_type);
H_PUT_8 (output_bfd, 0, outsym->e_other);
H_PUT_16 (output_bfd, 0, outsym->e_desc);
FALSE, FALSE) != NULL)
&& discard != discard_all)
{
H_PUT_8 (output_bfd, N_TEXT, outsym->e_type);
H_PUT_8 (output_bfd, 0, outsym->e_other);
H_PUT_16 (output_bfd, 0, outsym->e_desc);
- strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
+ strtab_index = add_to_stringtab (output_bfd, f
lag
info->strtab,
input_bfd->filename, FALSE);
if (strtab_index == (bfd_size_type) -1)
return FALSE;
input_bfd->filename, FALSE);
if (strtab_index == (bfd_size_type) -1)
return FALSE;
@@
-4794,7
+4826,7
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
sym = obj_aout_external_syms (input_bfd);
sym_end = sym + sym_count;
sym_hash = obj_aout_sym_hashes (input_bfd);
sym = obj_aout_external_syms (input_bfd);
sym_end = sym + sym_count;
sym_hash = obj_aout_sym_hashes (input_bfd);
- symbol_map = finfo->symbol_map;
+ symbol_map = f
lag
info->symbol_map;
memset (symbol_map, 0, (size_t) sym_count * sizeof *symbol_map);
for (; sym < sym_end; sym++, sym_hash++, symbol_map++)
{
memset (symbol_map, 0, (size_t) sym_count * sizeof *symbol_map);
for (; sym < sym_end; sym++, sym_hash++, symbol_map++)
{
@@
-4893,7
+4925,7
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
skip = TRUE;
break;
case strip_some:
skip = TRUE;
break;
case strip_some:
- if (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
+ if (bfd_hash_lookup (f
lag
info->info->keep_hash, name, FALSE, FALSE)
== NULL)
skip = TRUE;
break;
== NULL)
skip = TRUE;
break;
@@
-5121,8
+5153,8
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
/* If we have already included a header file with the
same value, then replace this one with an N_EXCL
symbol. */
/* If we have already included a header file with the
same value, then replace this one with an N_EXCL
symbol. */
- copy = (bfd_boolean) (! finfo->info->keep_memory);
- incl_entry = aout_link_includes_lookup (&finfo->includes,
+ copy = (bfd_boolean) (! f
lag
info->info->keep_memory);
+ incl_entry = aout_link_includes_lookup (&f
lag
info->includes,
name, TRUE, copy);
if (incl_entry == NULL)
return FALSE;
name, TRUE, copy);
if (incl_entry == NULL)
return FALSE;
@@
-5133,7
+5165,8
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
{
/* This is the first time we have seen this header
file with this set of stabs strings. */
{
/* This is the first time we have seen this header
file with this set of stabs strings. */
- t = bfd_hash_allocate (&finfo->includes.root,
+ t = (struct aout_link_includes_totals *)
+ bfd_hash_allocate (&flaginfo->includes.root,
sizeof *t);
if (t == NULL)
return FALSE;
sizeof *t);
if (t == NULL)
return FALSE;
@@
-5182,7
+5215,7
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other);
H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc);
copy = FALSE;
H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other);
H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc);
copy = FALSE;
- if (! finfo->info->keep_memory)
+ if (! f
lag
info->info->keep_memory)
{
/* name points into a string table which we are going to
free. If there is a hash table entry, use that string.
{
/* name points into a string table which we are going to
free. If there is a hash table entry, use that string.
@@
-5192,7
+5225,7
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
else
copy = TRUE;
}
else
copy = TRUE;
}
- strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
+ strtab_index = add_to_stringtab (output_bfd, f
lag
info->strtab,
name, copy);
if (strtab_index == (bfd_size_type) -1)
return FALSE;
name, copy);
if (strtab_index == (bfd_size_type) -1)
return FALSE;
@@
-5204,18
+5237,18
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
}
/* Write out the output symbols we have just constructed. */
}
/* Write out the output symbols we have just constructed. */
- if (outsym > finfo->output_syms)
+ if (outsym > f
lag
info->output_syms)
{
bfd_size_type outsym_size;
{
bfd_size_type outsym_size;
- if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0)
+ if (bfd_seek (output_bfd, f
lag
info->symoff, SEEK_SET) != 0)
return FALSE;
return FALSE;
- outsym_size = outsym - finfo->output_syms;
+ outsym_size = outsym - f
lag
info->output_syms;
outsym_size *= EXTERNAL_NLIST_SIZE;
outsym_size *= EXTERNAL_NLIST_SIZE;
- if (bfd_bwrite ((void *) finfo->output_syms, outsym_size, output_bfd)
+ if (bfd_bwrite ((void *) f
lag
info->output_syms, outsym_size, output_bfd)
!= outsym_size)
return FALSE;
!= outsym_size)
return FALSE;
- finfo->symoff += outsym_size;
+ f
lag
info->symoff += outsym_size;
}
return TRUE;
}
return TRUE;
@@
-5224,28
+5257,24
@@
aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
/* Link an a.out input BFD into the output file. */
static bfd_boolean
/* Link an a.out input BFD into the output file. */
static bfd_boolean
-aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
+aout_link_input_bfd (struct aout_final_link_info *f
lag
info, bfd *input_bfd)
{
{
- bfd_size_type sym_count;
-
BFD_ASSERT (bfd_get_format (input_bfd) == bfd_object);
/* If this is a dynamic object, it may need special handling. */
if ((input_bfd->flags & DYNAMIC) != 0
&& aout_backend_info (input_bfd)->link_dynamic_object != NULL)
return ((*aout_backend_info (input_bfd)->link_dynamic_object)
BFD_ASSERT (bfd_get_format (input_bfd) == bfd_object);
/* If this is a dynamic object, it may need special handling. */
if ((input_bfd->flags & DYNAMIC) != 0
&& aout_backend_info (input_bfd)->link_dynamic_object != NULL)
return ((*aout_backend_info (input_bfd)->link_dynamic_object)
- (finfo->info, input_bfd));
+ (f
lag
info->info, input_bfd));
/* Get the symbols. We probably have them already, unless
/* Get the symbols. We probably have them already, unless
- finfo->info->keep_memory is FALSE. */
+ f
lag
info->info->keep_memory is FALSE. */
if (! aout_get_external_symbols (input_bfd))
return FALSE;
if (! aout_get_external_symbols (input_bfd))
return FALSE;
- sym_count = obj_aout_external_sym_count (input_bfd);
-
/* Write out the symbols and get a map of the new indices. The map
/* Write out the symbols and get a map of the new indices. The map
- is placed into finfo->symbol_map. */
- if (! aout_link_write_symbols (finfo, input_bfd))
+ is placed into f
lag
info->symbol_map. */
+ if (! aout_link_write_symbols (f
lag
info, input_bfd))
return FALSE;
/* Relocate and write out the sections. These functions use the
return FALSE;
/* Relocate and write out the sections. These functions use the
@@
-5254,17
+5283,17
@@
aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
link, which will normally be the case. */
if (obj_textsec (input_bfd)->linker_mark)
{
link, which will normally be the case. */
if (obj_textsec (input_bfd)->linker_mark)
{
- if (! aout_link_input_section (finfo, input_bfd,
+ if (! aout_link_input_section (f
lag
info, input_bfd,
obj_textsec (input_bfd),
obj_textsec (input_bfd),
- &finfo->treloff,
+ &f
lag
info->treloff,
exec_hdr (input_bfd)->a_trsize))
return FALSE;
}
if (obj_datasec (input_bfd)->linker_mark)
{
exec_hdr (input_bfd)->a_trsize))
return FALSE;
}
if (obj_datasec (input_bfd)->linker_mark)
{
- if (! aout_link_input_section (finfo, input_bfd,
+ if (! aout_link_input_section (f
lag
info, input_bfd,
obj_datasec (input_bfd),
obj_datasec (input_bfd),
- &finfo->dreloff,
+ &f
lag
info->dreloff,
exec_hdr (input_bfd)->a_drsize))
return FALSE;
}
exec_hdr (input_bfd)->a_drsize))
return FALSE;
}
@@
-5272,7
+5301,7
@@
aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
/* If we are not keeping memory, we don't need the symbols any
longer. We still need them if we are keeping memory, because the
strings in the hash table point into them. */
/* If we are not keeping memory, we don't need the symbols any
longer. We still need them if we are keeping memory, because the
strings in the hash table point into them. */
- if (! finfo->info->keep_memory)
+ if (! f
lag
info->info->keep_memory)
{
if (! aout_link_free_symbols (input_bfd))
return FALSE;
{
if (! aout_link_free_symbols (input_bfd))
return FALSE;
@@
-5283,7
+5312,7
@@
aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
/* Do the final link step. This is called on the output BFD. The
INFO structure should point to a list of BFDs linked through the
/* Do the final link step. This is called on the output BFD. The
INFO structure should point to a list of BFDs linked through the
- link
_
next field which can be used to find each BFD which takes part
+ link
.
next field which can be used to find each BFD which takes part
in the output. Also, each section in ABFD should point to a list
of bfd_link_order structures which list all the input sections for
the output section. */
in the output. Also, each section in ABFD should point to a list
of bfd_link_order structures which list all the input sections for
the output section. */
@@
-5330,7
+5359,7
@@
NAME (aout, final_link) (bfd *abfd,
max_contents_size = 0;
max_relocs_size = 0;
max_sym_count = 0;
max_contents_size = 0;
max_relocs_size = 0;
max_sym_count = 0;
- for (sub = info->input_bfds; sub != NULL; sub = sub->link
_
next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link
.
next)
{
bfd_size_type sz;
{
bfd_size_type sz;
@@
-5424,11
+5453,11
@@
NAME (aout, final_link) (bfd *abfd,
goto error_return;
/* Allocate buffers to hold section contents and relocs. */
goto error_return;
/* Allocate buffers to hold section contents and relocs. */
- aout_info.contents = bfd_malloc (max_contents_size);
+ aout_info.contents =
(bfd_byte *)
bfd_malloc (max_contents_size);
aout_info.relocs = bfd_malloc (max_relocs_size);
aout_info.relocs = bfd_malloc (max_relocs_size);
- aout_info.symbol_map =
bfd_malloc (max_sym_count * sizeof (int *
));
- aout_info.output_syms =
bfd_malloc ((max_sym_count + 1
)
-
* sizeof (struct external_nlist));
+ aout_info.symbol_map =
(int *) bfd_malloc (max_sym_count * sizeof (int
));
+ aout_info.output_syms =
(struct external_nlist *
)
+
bfd_malloc ((max_sym_count + 1)
* sizeof (struct external_nlist));
if ((aout_info.contents == NULL && max_contents_size != 0)
|| (aout_info.relocs == NULL && max_relocs_size != 0)
|| (aout_info.symbol_map == NULL && max_sym_count != 0)
if ((aout_info.contents == NULL && max_contents_size != 0)
|| (aout_info.relocs == NULL && max_relocs_size != 0)
|| (aout_info.symbol_map == NULL && max_sym_count != 0)
@@
-5445,7
+5474,7
@@
NAME (aout, final_link) (bfd *abfd,
h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC",
FALSE, FALSE, FALSE);
if (h != NULL)
h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC",
FALSE, FALSE, FALSE);
if (h != NULL)
- aout_link_write_other_symbol (
h
, &aout_info);
+ aout_link_write_other_symbol (
&h->root.root
, &aout_info);
}
/* The most time efficient way to do the link would be to read all
}
/* The most time efficient way to do the link would be to read all
@@
-5469,7
+5498,7
@@
NAME (aout, final_link) (bfd *abfd,
We use the output_has_begun field of the input BFDs to see
whether we have already handled it. */
We use the output_has_begun field of the input BFDs to see
whether we have already handled it. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link
_
next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link
.
next)
sub->output_has_begun = FALSE;
/* Mark all sections which are to be included in the link. This
sub->output_has_begun = FALSE;
/* Mark all sections which are to be included in the link. This
@@
-5519,9
+5548,9
@@
NAME (aout, final_link) (bfd *abfd,
}
/* Write out any symbols that we have not already written out. */
}
/* Write out any symbols that we have not already written out. */
-
aout_link_hash_traverse (aout_hash_table (info)
,
-
aout_link_write_other_symbol,
-
(void *)
&aout_info);
+
bfd_hash_traverse (&info->hash->table
,
+ aout_link_write_other_symbol,
+ &aout_info);
/* Now handle any relocs we were asked to create by the linker.
These did not come from any input file. We must do these after
/* Now handle any relocs we were asked to create by the linker.
These did not come from any input file. We must do these after
This page took
0.047333 seconds
and
4
git commands to generate.