2000-11-08 Kazu Hirata <kazu@hxi.com>

* bfd.c: Fix formatting.
	* binary.c: Likewise.
	* bout.c: Likewise.
This commit is contained in:
Kazu Hirata
2000-11-08 06:38:10 +00:00
parent ed37ab2087
commit aebad5fe2c
4 changed files with 32 additions and 47 deletions

View File

@ -1,3 +1,9 @@
2000-11-08 Kazu Hirata <kazu@hxi.com>
* bfd.c: Fix formatting.
* binary.c: Likewise.
* bout.c: Likewise.
2000-11-07 Kazu Hirata <kazu@hxi.com> 2000-11-07 Kazu Hirata <kazu@hxi.com>
* aix386-core.c: Fix formatting. * aix386-core.c: Fix formatting.

View File

@ -33,10 +33,10 @@ SECTION
CODE_FRAGMENT CODE_FRAGMENT
. .
.struct _bfd .struct _bfd
.{ .{
. {* The filename the application opened the BFD with. *} . {* The filename the application opened the BFD with. *}
. CONST char *filename; . CONST char *filename;
. .
. {* A pointer to the target jump table. *} . {* A pointer to the target jump table. *}
. const struct bfd_target *xvec; . const struct bfd_target *xvec;
@ -69,7 +69,7 @@ CODE_FRAGMENT
. {* When a file is closed by the caching routines, BFD retains . {* When a file is closed by the caching routines, BFD retains
. state information on the file here: *} . state information on the file here: *}
. .
. file_ptr where; . file_ptr where;
. .
. {* and here: (``once'' means at least once) *} . {* and here: (``once'' means at least once) *}
. .
@ -82,7 +82,7 @@ CODE_FRAGMENT
. .
. {* File modified time, if mtime_set is true: *} . {* File modified time, if mtime_set is true: *}
. .
. long mtime; . long mtime;
. .
. {* Reserved for an unimplemented file locking extension.*} . {* Reserved for an unimplemented file locking extension.*}
. .
@ -101,13 +101,13 @@ CODE_FRAGMENT
. .
. {* Format_specific flags*} . {* Format_specific flags*}
. .
. flagword flags; . flagword flags;
. .
. {* Currently my_archive is tested before adding origin to . {* Currently my_archive is tested before adding origin to
. anything. I believe that this can become always an add of . anything. I believe that this can become always an add of
. origin, with origin set to 0 for non archive files. *} . origin, with origin set to 0 for non archive files. *}
. .
. file_ptr origin; . file_ptr origin;
. .
. {* Remember when output has begun, to stop strange things . {* Remember when output has begun, to stop strange things
. from happening. *} . from happening. *}
@ -119,7 +119,7 @@ CODE_FRAGMENT
. {* The number of sections *} . {* The number of sections *}
. unsigned int section_count; . unsigned int section_count;
. .
. {* Stuff only useful for object files: . {* Stuff only useful for object files:
. The start address. *} . The start address. *}
. bfd_vma start_address; . bfd_vma start_address;
. .
@ -127,17 +127,17 @@ CODE_FRAGMENT
. unsigned int symcount; . unsigned int symcount;
. .
. {* Symbol table for output BFD (with symcount entries) *} . {* Symbol table for output BFD (with symcount entries) *}
. struct symbol_cache_entry **outsymbols; . struct symbol_cache_entry **outsymbols;
. .
. {* Pointer to structure which contains architecture information*} . {* Pointer to structure which contains architecture information*}
. const struct bfd_arch_info *arch_info; . const struct bfd_arch_info *arch_info;
. .
. {* Stuff only useful for archives:*} . {* Stuff only useful for archives:*}
. PTR arelt_data; . PTR arelt_data;
. struct _bfd *my_archive; {* The containing archive BFD. *} . struct _bfd *my_archive; {* The containing archive BFD. *}
. struct _bfd *next; {* The next BFD in the archive. *} . struct _bfd *next; {* The next BFD in the archive. *}
. struct _bfd *archive_head; {* The first BFD in the archive. *} . struct _bfd *archive_head; {* The first BFD in the archive. *}
. boolean has_armap; . boolean has_armap;
. .
. {* A chain of BFD structures involved in a link. *} . {* A chain of BFD structures involved in a link. *}
. struct _bfd *link_next; . struct _bfd *link_next;
@ -148,7 +148,7 @@ CODE_FRAGMENT
. .
. {* Used by the back end to hold private data. *} . {* Used by the back end to hold private data. *}
. .
. union . union
. { . {
. struct aout_data_struct *aout_data; . struct aout_data_struct *aout_data;
. struct artdata *aout_ar_data; . struct artdata *aout_ar_data;
@ -180,7 +180,7 @@ CODE_FRAGMENT
. struct netbsd_core_struct *netbsd_core_data; . struct netbsd_core_struct *netbsd_core_data;
. PTR any; . PTR any;
. } tdata; . } tdata;
. .
. {* Used by the application to hold private data*} . {* Used by the application to hold private data*}
. PTR usrdata; . PTR usrdata;
. .
@ -219,7 +219,6 @@ CODE_FRAGMENT
it to the following struct so that the data will be available in coffcode.h it to the following struct so that the data will be available in coffcode.h
where it is needed. The typedef's used are defined in bfd.h */ where it is needed. The typedef's used are defined in bfd.h */
/* /*
SECTION SECTION
@ -376,7 +375,7 @@ bfd_perror (message)
CONST char *message; CONST char *message;
{ {
if (bfd_get_error () == bfd_error_system_call) if (bfd_get_error () == bfd_error_system_call)
perror((char *)message); /* must be system error then... */ perror((char *)message); /* must be system error then... */
else { else {
if (message == NULL || *message == '\0') if (message == NULL || *message == '\0')
fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ()));
@ -510,7 +509,6 @@ bfd_set_error_program_name (name)
_bfd_error_program_name = name; _bfd_error_program_name = name;
} }
/* /*
FUNCTION FUNCTION
bfd_get_error_handler bfd_get_error_handler
@ -547,7 +545,6 @@ DESCRIPTION
*/ */
long long
bfd_get_reloc_upper_bound (abfd, asect) bfd_get_reloc_upper_bound (abfd, asect)
bfd *abfd; bfd *abfd;
@ -584,7 +581,6 @@ DESCRIPTION
The @var{syms} table is also needed for horrible internal magic The @var{syms} table is also needed for horrible internal magic
reasons. reasons.
*/ */
long long
bfd_canonicalize_reloc (abfd, asect, location, symbols) bfd_canonicalize_reloc (abfd, asect, location, symbols)
@ -615,7 +611,7 @@ DESCRIPTION
The argument @var{abfd} is ignored. The argument @var{abfd} is ignored.
*/ */
/*ARGSUSED*/
void void
bfd_set_reloc (ignore_abfd, asect, location, count) bfd_set_reloc (ignore_abfd, asect, location, count)
bfd *ignore_abfd ATTRIBUTE_UNUSED; bfd *ignore_abfd ATTRIBUTE_UNUSED;
@ -786,7 +782,6 @@ bfd_vma vma;
return true; return true;
} }
/* /*
FUNCTION FUNCTION
bfd_get_mtime bfd_get_mtime
@ -1009,7 +1004,7 @@ bfd_scan_vma (string, end, base)
(string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X'))) (string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X')))
string += 2; string += 2;
/* XXX should we also skip over "0b" or "0B" if base is 2? */ /* XXX should we also skip over "0b" or "0B" if base is 2? */
/* Speed could be improved with a table like hex_value[] in gas. */ /* Speed could be improved with a table like hex_value[] in gas. */
#define HEX_VALUE(c) \ #define HEX_VALUE(c) \
(isxdigit ((unsigned char) c) \ (isxdigit ((unsigned char) c) \
@ -1037,7 +1032,7 @@ SYNOPSIS
boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd);
DESCRIPTION DESCRIPTION
Copy private BFD information from the BFD @var{ibfd} to the Copy private BFD information from the BFD @var{ibfd} to the
the BFD @var{obfd}. Return <<true>> on success, <<false>> on error. the BFD @var{obfd}. Return <<true>> on success, <<false>> on error.
Possible error returns are: Possible error returns are:
@ -1058,7 +1053,7 @@ SYNOPSIS
boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd);
DESCRIPTION DESCRIPTION
Merge private BFD information from the BFD @var{ibfd} to the Merge private BFD information from the BFD @var{ibfd} to the
the output file BFD @var{obfd} when linking. Return <<true>> the output file BFD @var{obfd} when linking. Return <<true>>
on success, <<false>> on error. Possible error returns are: on success, <<false>> on error. Possible error returns are:

View File

@ -281,7 +281,7 @@ binary_set_section_contents (abfd, sec, data, offset, size)
s->filepos = s->lma - low; s->filepos = s->lma - low;
/* Skip following warning check for sections that will not /* Skip following warning check for sections that will not
occupy file space. */ occupy file space. */
if ((s->flags if ((s->flags
& (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD)) & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD))
!= (SEC_HAS_CONTENTS | SEC_ALLOC)) != (SEC_HAS_CONTENTS | SEC_ALLOC))
@ -291,7 +291,7 @@ binary_set_section_contents (abfd, sec, data, offset, size)
LMA's all over the place, huge (sparse?) binary files may LMA's all over the place, huge (sparse?) binary files may
result. This condition attempts to detect this situation result. This condition attempts to detect this situation
and print a warning. Better heuristics would be nice to and print a warning. Better heuristics would be nice to
have. */ have. */
if (s->filepos < 0) if (s->filepos < 0)
(*_bfd_error_handler) (*_bfd_error_handler)
@ -383,6 +383,6 @@ const bfd_target binary_vec =
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL, NULL,
NULL NULL
}; };

View File

@ -19,7 +19,6 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software 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. */
#include "bfd.h" #include "bfd.h"
#include "sysdep.h" #include "sysdep.h"
#include "libbfd.h" #include "libbfd.h"
@ -30,7 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "aout/stab_gnu.h" #include "aout/stab_gnu.h"
#include "libaout.h" /* BFD a.out internal data structures */ #include "libaout.h" /* BFD a.out internal data structures */
static int aligncode PARAMS ((bfd *abfd, asection *input_section, static int aligncode PARAMS ((bfd *abfd, asection *input_section,
arelent *r, unsigned int shrink)); arelent *r, unsigned int shrink));
static void perform_slip PARAMS ((bfd *abfd, unsigned int slip, static void perform_slip PARAMS ((bfd *abfd, unsigned int slip,
@ -97,7 +95,7 @@ bout_swap_exec_header_out (abfd, execp, raw_bytes)
{ {
struct external_exec *bytes = (struct external_exec *)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); 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_text , bytes->e_text);
PUT_WORD (abfd, execp->a_data , bytes->e_data); PUT_WORD (abfd, execp->a_data , bytes->e_data);
@ -114,7 +112,6 @@ bout_swap_exec_header_out (abfd, execp, raw_bytes)
bytes->e_relaxable[0] = execp->a_relaxable; bytes->e_relaxable[0] = execp->a_relaxable;
} }
static const bfd_target * static const bfd_target *
b_out_object_p (abfd) b_out_object_p (abfd)
bfd *abfd; bfd *abfd;
@ -140,7 +137,6 @@ b_out_object_p (abfd)
return aout_32_some_aout_object_p (abfd, &anexec, b_out_callback); return aout_32_some_aout_object_p (abfd, &anexec, b_out_callback);
} }
/* Finish up the opening of a b.out file for reading. Fill in all the /* Finish up the opening of a b.out file for reading. Fill in all the
fields that are not handled by common code. */ fields that are not handled by common code. */
@ -189,8 +185,8 @@ b_out_callback (abfd)
obj_textsec (abfd)->rel_filepos = N_TROFF(*execp); obj_textsec (abfd)->rel_filepos = N_TROFF(*execp);
obj_datasec (abfd)->rel_filepos = N_DROFF(*execp); obj_datasec (abfd)->rel_filepos = N_DROFF(*execp);
adata(abfd).page_size = 1; /* Not applicable. */ adata(abfd).page_size = 1; /* Not applicable. */
adata(abfd).segment_size = 1; /* Not applicable. */ adata(abfd).segment_size = 1; /* Not applicable. */
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
if (execp->a_relaxable) if (execp->a_relaxable)
@ -344,7 +340,6 @@ b_out_write_object_contents (abfd)
#define CALL 0x09000000 #define CALL 0x09000000
#define PCREL13_MASK 0x1fff #define PCREL13_MASK 0x1fff
#define output_addr(sec) ((sec)->output_offset+(sec)->output_section->vma) #define output_addr(sec) ((sec)->output_offset+(sec)->output_section->vma)
/* Magic to turn callx into calljx */ /* Magic to turn callx into calljx */
@ -384,7 +379,6 @@ calljx_callback (abfd, link_info, reloc_entry, src, dst, input_section)
return bfd_reloc_ok; return bfd_reloc_ok;
} }
/* Magic to turn call into callj */ /* Magic to turn call into callj */
static bfd_reloc_status_type static bfd_reloc_status_type
callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx, callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx,
@ -417,7 +411,7 @@ callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx,
/* The next symbol should be an N_BALNAME. */ /* The next symbol should be an N_BALNAME. */
BFD_ASSERT(IS_BALNAME(balsym->other)); BFD_ASSERT(IS_BALNAME(balsym->other));
/* We are calling a leaf, so replace the call instruction with a /* We are calling a leaf, so replace the call instruction with a
bal. */ bal. */
word = BAL | ((word word = BAL | ((word
@ -472,7 +466,6 @@ HOWTO(PCREL24, 0, 2, 24, true, 0, complain_overflow_signed,0,"pcrel24", true, 0x
static reloc_howto_type howto_reloc_pcrel13 = static reloc_howto_type howto_reloc_pcrel13 =
HOWTO(PCREL13, 0, 2, 13, true, 0, complain_overflow_signed,0,"pcrel13", true, 0x00001fff,0x00001fff,false); HOWTO(PCREL13, 0, 2, 13, true, 0, complain_overflow_signed,0,"pcrel13", true, 0x00001fff,0x00001fff,false);
static reloc_howto_type howto_reloc_abs32codeshrunk = static reloc_howto_type howto_reloc_abs32codeshrunk =
HOWTO(ABS32CODE_SHRUNK, 0, 2, 24, true, 0, complain_overflow_signed, 0,"callx->callj", true, 0x00ffffff, 0x00ffffff,false); HOWTO(ABS32CODE_SHRUNK, 0, 2, 24, true, 0, complain_overflow_signed, 0,"callx->callj", true, 0x00ffffff, 0x00ffffff,false);
@ -577,8 +570,6 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
return false; return false;
} }
if (bfd_header_big_endian (abfd)) { if (bfd_header_big_endian (abfd)) {
/* big-endian bit field allocation order */ /* big-endian bit field allocation order */
pcrel_mask = 0x80; pcrel_mask = 0x80;
@ -728,17 +719,14 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
} }
} }
if (relocs != NULL) if (relocs != NULL)
free (relocs); free (relocs);
asect->relocation = reloc_cache; asect->relocation = reloc_cache;
asect->reloc_count = count; asect->reloc_count = count;
return true; return true;
} }
static boolean static boolean
b_out_squirt_out_relocs (abfd, section) b_out_squirt_out_relocs (abfd, section)
bfd *abfd; bfd *abfd;
@ -1008,8 +996,6 @@ b_out_sizeof_headers (ignore_abfd, ignore)
return sizeof(struct internal_exec); return sizeof(struct internal_exec);
} }
/************************************************************************/ /************************************************************************/
static bfd_vma static bfd_vma
get_value (reloc, link_info, input_section) get_value (reloc, link_info, input_section)
@ -1125,7 +1111,6 @@ abs32code (abfd, input_section, r, shrink, link_info)
gap = value - (dot - shrink); gap = value - (dot - shrink);
if (-1<<23 < (long)gap && (long)gap < 1<<23 ) if (-1<<23 < (long)gap && (long)gap < 1<<23 )
{ {
/* Change the reloc type from 32bitcode possible 24, to 24bit /* Change the reloc type from 32bitcode possible 24, to 24bit
@ -1494,11 +1479,10 @@ const bfd_target b_out_vec_big_host =
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
& b_out_vec_little_host, & b_out_vec_little_host,
(PTR) 0, (PTR) 0,
}; };
const bfd_target b_out_vec_little_host = const bfd_target b_out_vec_little_host =
{ {
"b.out.little", /* name */ "b.out.little", /* name */
@ -1537,6 +1521,6 @@ const bfd_target b_out_vec_little_host =
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
& b_out_vec_big_host, & b_out_vec_big_host,
(PTR) 0 (PTR) 0
}; };