From 98333b7f2b88e52aa673e2f64eed036210815754 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 6 Oct 2002 09:03:06 +0000 Subject: [PATCH] * opncls.c: Formatting. (_bfd_new_bfd): Use a smaller section hash table. --- bfd/ChangeLog | 5 +++++ bfd/opncls.c | 70 ++++++++++++++++++++++++++++++----------------------------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7f0d4383bf..bf17264f67 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-10-06 Alan Modra + + * opncls.c: Formatting. + (_bfd_new_bfd): Use a smaller section hash table. + 2002-10-05 Alexandre Oliva * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type diff --git a/bfd/opncls.c b/bfd/opncls.c index cdf08df05d..af8ff7e4a6 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -63,7 +63,9 @@ _bfd_new_bfd () nbfd->direction = no_direction; nbfd->iostream = NULL; nbfd->where = 0; - if (!bfd_hash_table_init (&nbfd->section_htab, bfd_section_hash_newfunc)) + if (!bfd_hash_table_init_n (&nbfd->section_htab, + bfd_section_hash_newfunc, + 251)) { free (nbfd); return NULL; @@ -124,7 +126,7 @@ FUNCTION bfd_openr SYNOPSIS - bfd *bfd_openr(const char *filename, const char *target); + bfd *bfd_openr(const char *filename, const char *target); DESCRIPTION Open the file @var{filename} (using <>) with the target @@ -134,7 +136,8 @@ DESCRIPTION that function. If <> is returned then an error has occured. Possible errors - are <>, <> or <> error. + are <>, <> or + <> error. */ bfd * @@ -179,28 +182,28 @@ bfd_openr (filename, target) the file descriptor too, even though we didn't open it. */ /* FUNCTION - bfd_fdopenr + bfd_fdopenr SYNOPSIS - bfd *bfd_fdopenr(const char *filename, const char *target, int fd); + bfd *bfd_fdopenr(const char *filename, const char *target, int fd); DESCRIPTION - <> is to <> much like <> is to <>. - It opens a BFD on a file already described by the @var{fd} - supplied. - - When the file is later <>d, the file descriptor will be closed. - - If the caller desires that this file descriptor be cached by BFD - (opened as needed, closed as needed to free descriptors for - other opens), with the supplied @var{fd} used as an initial - file descriptor (but subject to closure at any time), call - bfd_set_cacheable(bfd, 1) on the returned BFD. The default is to - assume no cacheing; the file descriptor will remain open until - <>, and will not be affected by BFD operations on other - files. - - Possible errors are <>, <> and <>. + <> is to <> much like <> is to + <>. It opens a BFD on a file already described by the + @var{fd} supplied. + + When the file is later <>d, the file descriptor will + be closed. If the caller desires that this file descriptor be + cached by BFD (opened as needed, closed as needed to free + descriptors for other opens), with the supplied @var{fd} used as + an initial file descriptor (but subject to closure at any time), + call bfd_set_cacheable(bfd, 1) on the returned BFD. The default + is to assume no cacheing; the file descriptor will remain open + until <>, and will not be affected by BFD operations + on other files. + + Possible errors are <>, + <> and <>. */ bfd * @@ -389,10 +392,10 @@ SYNOPSIS DESCRIPTION - Close a BFD. If the BFD was open for writing, - then pending operations are completed and the file written out - and closed. If the created file is executable, then - <> is called to mark it as such. + Close a BFD. If the BFD was open for writing, then pending + operations are completed and the file written out and closed. + If the created file is executable, then <> is called + to mark it as such. All memory attached to the BFD is released. @@ -431,7 +434,7 @@ bfd_close (abfd) if (stat (abfd->filename, &buf) == 0) { - unsigned int mask = umask (0); + unsigned int mask = umask (0); umask (mask); chmod (abfd->filename, @@ -453,10 +456,10 @@ SYNOPSIS boolean bfd_close_all_done(bfd *); DESCRIPTION - Close a BFD. Differs from <> - since it does not complete any pending operations. This - routine would be used if the application had just used BFD for - swapping and didn't want to use any of the writing code. + Close a BFD. Differs from <> since it does not + complete any pending operations. This routine would be used + if the application had just used BFD for swapping and didn't + want to use any of the writing code. If the created file is executable, then <> is called to mark it as such. @@ -507,10 +510,9 @@ SYNOPSIS bfd *bfd_create(const char *filename, bfd *templ); DESCRIPTION - Create a new BFD in the manner of - <>, but without opening a file. The new BFD - takes the target from the target used by @var{template}. The - format is always set to <>. + Create a new BFD in the manner of <>, but without + opening a file. The new BFD takes the target from the target + used by @var{template}. The format is always set to <>. */ bfd * -- 2.11.0