From 5bff4f5642edc6e44c15f3e189d683d5dde1a2c8 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 20 Dec 2000 19:53:11 +0000 Subject: [PATCH] 2000-12-20 Kazu Hirata * targets.c: Fix formatting. * tekhex.c: Likewise. * trad-core.c: Likewise. --- bfd/ChangeLog | 6 +++++ bfd/targets.c | 60 ++++++++++++++++++++++++------------------------- bfd/tekhex.c | 19 +++++++--------- bfd/trad-core.c | 20 ++++++++--------- 4 files changed, 53 insertions(+), 52 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8a034160661..c0d5df67850 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2000-12-20 Kazu Hirata + + * targets.c: Fix formatting. + * tekhex.c: Likewise. + * trad-core.c: Likewise. + 2000-12-19 Kazu Hirata * sco5-core.c: Fix formatting. diff --git a/bfd/targets.c b/bfd/targets.c index 94e3e9f41a0..589ba236414 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -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 <>, 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 <> with the - target string supplied to <> and the new BFD pointer. + target string supplied to <> and the new BFD pointer. o If a null target string was provided to <>, look up the environment variable <> and use - that as the target string. + that as the target string. o If the target string is still <>, or the target string is <>, 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 <> to <>. @@ -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 - <> on the BFD with a suggested format. + <> on the BFD with a suggested format. If <> has been set, each possible target type is tried to see if it recognizes the specified format. <> returns <> 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 <> - member. + member. The macros below are used to dispatch to functions through the <> 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,10 +130,9 @@ 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, @@ -185,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 <>, <>, ...<>. -. flagword object_flags; +. flagword object_flags; A mask of all the flags which a section may have set - from the set <>, <>, ...<>. . 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. @@ -234,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 <> or zero. +Check the format of a file being read. Return a <> 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 <>. +Write cached information into a file being written, at <>. . boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); @@ -265,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 *, @@ -289,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 *)); @@ -325,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)); @@ -468,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; */ @@ -887,7 +885,7 @@ 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, @@ -983,7 +981,7 @@ const bfd_target *bfd_default_vector[] = { /* When there is an ambiguous match, bfd_check_format_matches puts the names of the matching targets in an array. This variable is the maximum number of entries that the array could possibly need. */ -const size_t _bfd_target_vector_entries = sizeof(bfd_target_vector)/sizeof(*bfd_target_vector); +const size_t _bfd_target_vector_entries = sizeof (bfd_target_vector)/sizeof (*bfd_target_vector); /* This array maps configuration triplets onto BFD vectors. */ @@ -1083,7 +1081,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 <> 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 * @@ -1166,7 +1164,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 diff --git a/bfd/tekhex.c b/bfd/tekhex.c index b1ffe75e073..e5fa95a7b1a 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -24,11 +24,11 @@ SUBSECTION Tektronix Hex Format handling DESCRIPTION - + Tek Hex records can hold symbols and data, but not relocations. Their main application is communication with devices like PROM programmers and ICE equipment. - + It seems that the sections are descibed as being really big, the example I have says that the text section is 0..ffffffff. BFD would barf with this, many apps would try to alloc 4GB to @@ -49,11 +49,10 @@ DESCRIPTION Any number of sections may be created for output, we save them up and output them when it's time to close the bfd. - A TekHex record looks like: EXAMPLE % - + DESCRIPTION Where o length @@ -63,7 +62,6 @@ DESCRIPTION 3) symbol record 6) data record 8) termination record - The data can come out of order, and may be discontigous. This is a serial protocol, so big files are unlikely, so we keep a list of 8k chunks @@ -123,7 +121,7 @@ static const bfd_target *tekhex_object_p PARAMS ((bfd *)); static boolean tekhex_mkobject PARAMS ((bfd *)); static long tekhex_get_symtab_upper_bound PARAMS ((bfd *)); static long tekhex_get_symtab PARAMS ((bfd *, asymbol **)); -static void pass_over PARAMS ((bfd *, void (*)(bfd*, int, char *))); +static void pass_over PARAMS ((bfd *, void (*) (bfd*, int, char *))); static void first_phase PARAMS ((bfd *, int, char *)); static void insert_byte PARAMS ((bfd *, int, bfd_vma)); static struct data_struct *find_chunk PARAMS ((bfd *, bfd_vma)); @@ -216,7 +214,6 @@ fcffffff g T_SEGMENT i$1 00000000 g T_SEGMENT $ 00000010 g T_SEGMENT $ - RELOCATION RECORDS FOR [D00000000]: (none) RELOCATION RECORDS FOR [D00008000]: (none) @@ -425,7 +422,7 @@ first_phase (abfd, type, src) char *n = bfd_alloc (abfd, len + 1); if (!n) - abort(); /* FIXME */ + abort (); /* FIXME */ memcpy (n, sym, len + 1); section = bfd_make_section (abfd, n); } @@ -454,7 +451,7 @@ first_phase (abfd, type, src) char type = (*src); if (!new) - abort(); /* FIXME */ + abort (); /* FIXME */ new->symbol.the_bfd = abfd; src++; abfd->symcount++; @@ -464,7 +461,7 @@ first_phase (abfd, type, src) len = getsym (sym, &src); new->symbol.name = bfd_alloc (abfd, len + 1); if (!new->symbol.name) - abort(); /* FIXME */ + abort (); /* FIXME */ memcpy ((char *) (new->symbol.name), sym, len + 1); new->symbol.section = section; if (type <= '4') @@ -1063,6 +1060,6 @@ const bfd_target tekhex_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/bfd/trad-core.c b/bfd/trad-core.c index 9cd12c04aee..194da154a0c 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -46,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include TRAD_HEADER #endif - struct trad_core_struct + struct trad_core_struct { asection *data_section; asection *stack_section; @@ -85,7 +85,7 @@ trad_unix_core_file_p (abfd) if (bfd_seek (abfd, TRAD_CORE_USER_OFFSET, SEEK_SET) != 0) return 0; #endif - + val = bfd_read ((void *)&u, 1, sizeof u, abfd); if (val != sizeof u) { @@ -95,7 +95,7 @@ trad_unix_core_file_p (abfd) } /* Sanity check perhaps??? */ - if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */ + if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */ { bfd_set_error (bfd_error_wrong_format); return 0; @@ -152,7 +152,7 @@ trad_unix_core_file_p (abfd) bfd_zmalloc (sizeof (struct trad_core_struct)); if (rawptr == NULL) return 0; - + abfd->tdata.trad_core_data = rawptr; rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ @@ -207,13 +207,13 @@ trad_unix_core_file_p (abfd) from *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 up so that its virtual memory address 0 is at the place 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. */ + using minor trickery to get around the offset-or-absolute-addr problem. */ core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0; core_datasec (abfd)->filepos = NBPG * UPAGES; @@ -273,9 +273,9 @@ trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd) /* 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 ) @@ -316,7 +316,7 @@ const bfd_target trad_core_vec = bfd_false, bfd_false, bfd_false, bfd_false }, - + BFD_JUMP_TABLE_GENERIC (_bfd_generic), BFD_JUMP_TABLE_COPY (_bfd_generic), BFD_JUMP_TABLE_CORE (trad_unix), @@ -328,6 +328,6 @@ const bfd_target trad_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; -- 2.30.2