* sco5-core.c: Fix formatting.
* section.c: Likewise.
* sparclinux.c: Likewise.
* sparclynx.c: Likewise.
* sparcnetbsd.c: Likewise.
* srec.c: Likewise.
* stabs.c: Likewise.
* stab-syms.c: Likewise.
* sunos.c: Likewise.
* syms.c: Likewise.
* sysdep.h: Likewise.
+2000-12-19 Kazu Hirata <kazu@hxi.com>
+
+ * sco5-core.c: Fix formatting.
+ * section.c: Likewise.
+ * sparclinux.c: Likewise.
+ * sparclynx.c: Likewise.
+ * sparcnetbsd.c: Likewise.
+ * srec.c: Likewise.
+ * stabs.c: Likewise.
+ * stab-syms.c: Likewise.
+ * sunos.c: Likewise.
+ * syms.c: Likewise.
+ * sysdep.h: Likewise.
+
2000-12-18 Nick Clifton <nickc@redhat.com>
* coff-arm.c (EXTRA_S_FLAGS): Only define if not already
new->the_bfd = abfd;
return new;
}
-
+
static struct user *
read_uarea(abfd, filepos)
bfd *abfd;
}
/* Sanity check perhaps??? */
- if (rawptr->u.u_dsize > 0x1000000) /* Remember, it's in pages... */
+ if (rawptr->u.u_dsize > 0x1000000) /* Remember, it's in pages... */
{
bfd_set_error (bfd_error_wrong_format);
return NULL;
|| (bfd_read ((void *)&coffset_siz, 1, sizeof coffset_siz, abfd)
!= sizeof coffset_siz) )
{
- bfd_set_error (bfd_error_wrong_format);
+ bfd_set_error (bfd_error_wrong_format);
return NULL;
}
!= sizeof coffsets)
|| ((coffsets.u_info != 1) && (coffsets.u_info != C_VERSION)))
{
- bfd_set_error (bfd_error_wrong_format);
+ bfd_set_error (bfd_error_wrong_format);
return NULL;
}
-
- if (coffsets.u_info == 1)
- {
+ if (coffsets.u_info == 1)
+ {
/* Old version, no section heads, read info from user struct */
u = read_uarea(abfd, coffsets.u_user);
if (! u)
return NULL;
- if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS,
+ if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS,
(bfd_size_type) coffsets.u_usize,
0 - (bfd_vma) u->u_ar0,
(file_ptr) coffsets.u_user))
return NULL;
-
- if (!make_bfd_asection (abfd, ".data",
+
+ if (!make_bfd_asection (abfd, ".data",
SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
((bfd_size_type) u->u_exdata.ux_dsize
+ u->u_exdata.ux_bsize),
(bfd_vma) u->u_exdata.ux_datorg,
(file_ptr) coffsets.u_data))
return NULL;
-
- if (!make_bfd_asection (abfd, ".stack",
- SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
+
+ if (!make_bfd_asection (abfd, ".stack",
+ SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
(bfd_size_type) u->u_ssize * NBPC,
(bfd_vma) u->u_sub,
(file_ptr) coffsets.u_stack))
return NULL;
return abfd->xvec; /* Done for version 1 */
- }
+ }
/* Immediately before coreoffsets region is a long with offset in core
to first coresecthead (CORES_OFFSETS), the long before this is the
number of section heads in the list. Read both longs and read the
coresecthead and check its validity */
-
- if ((bfd_seek (abfd,
- coresize - coffset_siz - 2 * sizeof coffset_siz,
+
+ if ((bfd_seek (abfd,
+ coresize - coffset_siz - 2 * sizeof coffset_siz,
SEEK_SET) != 0)
|| (bfd_read ((void *)&nsecs, 1, sizeof nsecs, abfd) != sizeof nsecs)
|| (bfd_read ((void *)&cheadoffs, 1, sizeof cheadoffs, abfd)
/* Now loop over all regions and map them */
nsecs--; /* We've seen CORES_OFFSETS already */
- for (; nsecs; nsecs--)
+ for (; nsecs; nsecs--)
{
if ((bfd_seek (abfd, chead.cs_hseek, SEEK_SET) != 0)
|| bfd_read ((void *)&chead, 1, sizeof chead, abfd) != sizeof chead)
{
- bfd_set_error (bfd_error_wrong_format);
+ bfd_set_error (bfd_error_wrong_format);
return NULL;
}
- switch (chead.cs_stype)
+ switch (chead.cs_stype)
{
case CORES_MAGIC: /* Core header, check magic */
if (chead.cs_x.csx_magic != COREMAGIC_NUMBER)
*u_ar0. The other is that u_ar0 is sometimes an absolute
address in kernel memory, and on other systems it is an
offset from the beginning of the `struct user'.
-
+
As a practical matter, we don't know where the registers
actually are, so we have to pass the whole area to GDB.
We encode the value of u_ar0 by setting the .regs section
pointed to by u_ar0 (by setting the vma of the start of
the section to -u_ar0). GDB uses this info to locate the
regs, using minor trickery to get around the
- offset-or-absolute-addr problem. */
+ offset-or-absolute-addr problem. */
chead.cs_vaddr = 0 - (bfd_vma) u->u_ar0;
-
secname = ".reg";
flags = SEC_HAS_CONTENTS;
sco5_core_file_failing_signal (ignore_abfd)
bfd *ignore_abfd;
{
- return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0)
- ? ignore_abfd->tdata.sco5_core_data->u.u_sysabort
+ return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0)
+ ? ignore_abfd->tdata.sco5_core_data->u.u_sysabort
: -1);
}
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort()
+swap_abort ()
{
- abort(); /* This way doesn't require any declaration for ANSI to fuck up */
+ abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
-
+
(PTR) 0 /* backend_data */
};
| size 0x103 |
| output_section --------|
-
SUBSECTION
Link orders
*/
-
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
return NULL;
}
-
/*
FUNCTION
bfd_get_unique_section_name
return sname;
}
-
/*
FUNCTION
bfd_make_section_old_way
*/
-
asection *
bfd_make_section_old_way (abfd, name)
bfd *abfd;
return bfd_make_section_anyway (abfd, name);
}
-
/*
FUNCTION
bfd_set_section_flags
return true;
}
-
/*
FUNCTION
bfd_map_over_sections
SYNOPSIS
void bfd_map_over_sections(bfd *abfd,
- void (*func)(bfd *abfd,
+ void (*func) (bfd *abfd,
asection *sect,
PTR obj),
PTR obj);
| for (p = abfd->sections; p != NULL; p = p->next)
| func(abfd, p, ...)
-
*/
/*VARARGS2*/
abort ();
}
-
/*
FUNCTION
bfd_set_section_size
bfd_size_type val;
{
/* Once you've started writing to any section you cannot create or change
- the size of any others. */
+ the size of any others. */
if (abfd->output_has_begun)
{
file_ptr offset,
bfd_size_type count);
-
DESCRIPTION
Sets the contents of the section @var{section} in BFD
@var{abfd} to the data starting in memory at @var{data}. The
data is written to the output section starting at offset
@var{offset} for @var{count} octets.
-
-
Normally <<true>> is returned, else <<false>>. Possible error
returns are:
o <<bfd_error_no_contents>> -
This routine is front end to the back end function
<<_bfd_set_section_contents>>.
-
*/
#define bfd_get_section_size_now(abfd,sec) \
with zeroes. If no errors occur, <<true>> is returned, else
<<false>>.
-
-
*/
boolean
bfd_get_section_contents (abfd, section, location, offset, count)
#define IS_GOT_SYM(name) \
(strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0)
-/* See if a symbol name is a reference to the procedure linkage table. */
+/* See if a symbol name is a reference to the procedure linkage table. */
#ifndef PLT_REF_PREFIX
#define PLT_REF_PREFIX "__PLT_"
(h->root.root.root.string
+ sizeof PLT_REF_PREFIX - 1),
false, false, true);
- /* h2 does not follow indirect symbols. */
+ /* h2 does not follow indirect symbols. */
h2 = linux_link_hash_lookup (linux_hash_table (info),
(h->root.root.root.string
+ sizeof PLT_REF_PREFIX - 1),
}
/* Quick and dirty way of stripping these symbols from the
- symtab. */
+ symtab. */
if (bfd_is_abs_section (h->root.root.u.def.section))
h->root.written = true;
}
if (output_bfd->xvec != &MY(vec))
return true;
- /* First find the fixups... */
+ /* First find the fixups... */
linux_link_hash_traverse (linux_hash_table (info),
linux_tally_symbols,
(PTR) info);
/* This is needed to reject a NewsOS file, e.g. in
gdb/testsuite/gdb.t10/crossload.exp. <kingdon@cygnus.com>
I needed to add M_UNKNOWN to recognize a 68000 object, so this will
- probably no longer reject a NewsOS object. <ian@cygnus.com>. */
+ probably no longer reject a NewsOS object. <ian@cygnus.com>. */
#define MACHTYPE_OK(mtype) ((mtype) == M_UNKNOWN \
|| (mtype) == M_68010 \
|| (mtype) == M_68020 \
case M_UNKNOWN:
/* Some Sun3s make magic numbers without cpu types in them, so
- we'll default to the 68000. */
+ we'll default to the 68000. */
arch = bfd_arch_m68k;
machine = bfd_mach_m68000;
break;
}
#define SET_ARCH_MACH(ABFD, EXEC) \
- NAME(lynx,set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \
+ NAME(lynx,set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \
choose_reloc_size(ABFD);
/* Determine the size of a relocation entry, based on the architecture */
#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
S-Record handling
DESCRIPTION
-
+
Ordinary S-Records cannot hold anything but addresses and
data, so that's all that we implement.
up and output them when it's time to close the bfd.
An s record looks like:
-
+
EXAMPLE
S<type><length><address><data><checksum>
-
+
DESCRIPTION
Where
o length
7) four byte address termination record
8) three byte address termination record
9) two byte address termination record
-
+
o address
is the start address of the data following, or in the case of
a termination record, the start address of the image
is the sum of all the raw byte data in the record, from the length
upwards, modulo 256 and subtracted from 255.
-
SUBSECTION
Symbol S-Record handling
DESCRIPTION
We allow symbols to be anywhere in the data stream - the module names
are always ignored.
-
+
*/
#include "bfd.h"
regardless of the siez of the addresses. */
if (S3Forced)
tdata->type = 3;
- else if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
+ else if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
; /* The default, S1, is OK. */
else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
&& tdata->type <= 2)
#include "bfd.h"
-#define ARCH_SIZE 32 /* Value doesn't matter. */
+#define ARCH_SIZE 32 /* Value doesn't matter. */
#include "libaout.h"
#include "aout/aout64.h"
/* These are not really stab symbols, but it is
convenient to have them here for the sake of nm.
For completeness, we could also add N_TEXT etc, but those
- are never needed, since nm treats those specially. */
+ are never needed, since nm treats those specially. */
#define EXTRA_SYMBOLS \
__define_name (N_SETA, "SETA")/* Absolute set element symbol */ \
__define_name (N_SETT, "SETT")/* Text set element symbol */ \
__define_name (N_SETD, "SETD")/* Data set element symbol */ \
__define_name (N_SETB, "SETB")/* Bss set element symbol */ \
- __define_name (N_SETV, "SETV")/* Pointer to set vector in data area. */ \
+ __define_name (N_SETV, "SETV")/* Pointer to set vector in data area. */ \
__define_name (N_INDR, "INDR") \
__define_name (N_WARNING, "WARNING")
as the input offsets, because no stabs have been deleted from
this section. Otherwise the i'th entry is the number of
bytes of stabs that have been deleted prior to the i'th
- stab. */
+ stab. */
bfd_size_type *cumulative_skips;
/* This is an array of string indices. For each stab symbol, we
sinfo->stabstr->_cooked_size = _bfd_stringtab_size (sinfo->strings);
/* Calculate the `cumulative_skips' array now that stabs have been
- deleted for this section. */
+ deleted for this section. */
if (skip != 0)
{
* 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)
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
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);
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
}
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
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;
}
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;
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] =
}
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] =
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
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)
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
All storage for the symbols themselves is in an objalloc
connected to the BFD; it is freed when the BFD is closed.
-
INODE
Writing Symbols, Mini Symbols, Reading Symbols, Symbols
SUBSECTION
*/
-
-
/*
DOCDD
INODE
Return the actual number of symbol pointers, not
including the NULL.
-
.#define bfd_canonicalize_symtab(abfd, location) \
. BFD_SEND (abfd, _bfd_canonicalize_symtab,\
. (abfd, location))
*/
-
/*
FUNCTION
bfd_set_symtab
: ((type & BSF_OBJECT) ? 'O' : ' '))));
}
-
/*
FUNCTION
bfd_make_empty_symbol
};
/* Return the single-character symbol type corresponding to
- section S, or '?' for an unknown COFF section.
+ section S, or '?' for an unknown COFF section.
Check for any leading string which matches, so .text5 returns
't' as well as .text */
{
CONST struct section_to_type *t;
- for (t = &stt[0]; t->section; t++)
+ for (t = &stt[0]; t->section; t++)
if (!strncmp (s, t->section, strlen (t->section)))
return t->type;
/*
FUNCTION
- bfd_is_undefined_symclass
+ bfd_is_undefined_symclass
DESCRIPTION
Returns non-zero if the class symbol returned by
symbol_info *ret;
{
ret->type = bfd_decode_symclass (symbol);
-
+
if (bfd_is_undefined_symclass (ret->type))
ret->value = 0;
else
ret->value = symbol->value + symbol->section->vma;
-
+
ret->name = symbol->name;
}
if (bfd_get_32 (abfd, stab + STRDXOFF) == 0)
continue;
- /* if we did not see a function def, leave space for one. */
+ /* if we did not see a function def, leave space for one. */
if (saw_fun == 0)
++info->indextablesize;
if (saw_fun == 0)
++info->indextablesize;
-
+
if (info->indextablesize == 0)
return true;
++info->indextablesize;
/* The following code creates a new indextable entry with
a NULL function name if there were no N_FUNs in a file.
Note that a N_SO without a file name is an EOF and
- there could be 2 N_SO following it with the new filename
- and directory. */
+ there could be 2 N_SO following it with the new filename
+ and directory. */
if (saw_fun == 0)
{
info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
++i;
}
saw_fun = 0;
-
+
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
if (*file_name == '\0')
{
#ifdef ENABLE_NLS
#include <libintl.h>
/* Note the use of dgetext() and PACKAGE here, rather than gettext().
-
+
This is because the code in this directory is used to build a library which
will be linked with code in other directories to form programs. We want to
maintain a seperate translation file for this directory however, rather