aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-01-10 20:28:18 +1030
committerAlan Modra <amodra@gmail.com>2023-01-10 20:42:24 +1030
commit56b3aa508cdbabddd4f46357c8382fe7dca35249 (patch)
treeba517cff16bc4174f18a76a0ea3f163ab12bda7c /bfd/bfd.c
parentfd95c73ef5a6c4386b599d4a796377bc065ed6b6 (diff)
downloadgdb-56b3aa508cdbabddd4f46357c8382fe7dca35249.zip
gdb-56b3aa508cdbabddd4f46357c8382fe7dca35249.tar.gz
gdb-56b3aa508cdbabddd4f46357c8382fe7dca35249.tar.bz2
Re: Move bfd_init to bfd.c
Commit b1c95bc4dd73 resulted in ...bfd.texi:246: @include: could not find init.texi which went unnoticed due to not building in a clean directory. This fixes the problem by moving bfd_init earlier, giving it a doc node, and stitching the nodes back together. * bfd.c (bfd_init): Move earlier. Give it a doc inode. Adjust other inodes to suit. * doc/bfd.texi: Don't include init.texi. Adjust nodes to suit.
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r--bfd/bfd.c69
1 files changed, 36 insertions, 33 deletions
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 1d1c449..c59e31d 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -643,7 +643,7 @@ CODE_FRAGMENT
/*
INODE
-Error reporting, Miscellaneous, typedef bfd, BFD front end
+Error reporting, Initialization, typedef bfd, BFD front end
SECTION
Error reporting
@@ -1628,10 +1628,44 @@ bfd_set_assert_handler (bfd_assert_handler_type pnew)
_bfd_assert_handler = pnew;
return pold;
}
+
+/*
+INODE
+Initialization, Miscellaneous, Error reporting, BFD front end
+
+FUNCTION
+ bfd_init
+
+SYNOPSIS
+ unsigned int bfd_init (void);
+
+DESCRIPTION
+ This routine must be called before any other BFD function to
+ initialize magical internal data structures.
+ Returns a magic number, which may be used to check
+ that the bfd library is configured as expected by users.
+
+.{* Value returned by bfd_init. *}
+.#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
+.
+*/
+
+unsigned int
+bfd_init (void)
+{
+ bfd_error = bfd_error_no_error;
+ input_bfd = NULL;
+ input_error = bfd_error_no_error;
+ _bfd_error_program_name = NULL;
+ _bfd_error_internal = error_handler_fprintf;
+ _bfd_assert_handler = _bfd_default_assert_handler;
+
+ return BFD_INIT_MAGIC;
+}
/*
INODE
-Miscellaneous, Memory Usage, Error reporting, BFD front end
+Miscellaneous, Memory Usage, Initialization, BFD front end
SECTION
Miscellaneous
@@ -2605,34 +2639,3 @@ _bfd_get_link_info (bfd *abfd)
return elf_link_info (abfd);
}
-
-/*
-FUNCTION
- bfd_init
-
-SYNOPSIS
- unsigned int bfd_init (void);
-
-DESCRIPTION
- This routine must be called before any other BFD function to
- initialize magical internal data structures.
- Returns a magic number, which may be used to check
- that the bfd library is configured as expected by users.
-
-.{* Value returned by bfd_init. *}
-.#define BFD_INIT_MAGIC (sizeof (struct bfd_section))
-.
-*/
-
-unsigned int
-bfd_init (void)
-{
- bfd_error = bfd_error_no_error;
- input_bfd = NULL;
- input_error = bfd_error_no_error;
- _bfd_error_program_name = NULL;
- _bfd_error_internal = error_handler_fprintf;
- _bfd_assert_handler = _bfd_default_assert_handler;
-
- return BFD_INIT_MAGIC;
-}