bfd_openr
Synopsis
bfd *bfd_openr (const char *filename, const char *target);
Descriptionfopen) with the target
target. Return a pointer to the created BFD.
Calls bfd_find_target, so target is interpreted as by
that function.
If NULL is returned then an error has occured. Possible errors
are bfd_error_no_memory, bfd_error_invalid_target or
system_call error.
bfd_fdopenr
Synopsis
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
Descriptionbfd_fdopenr is to bfd_fopenr much like fdopen is to
fopen. It opens a BFD on a file already described by the
fd supplied.
When the file is later bfd_closed, 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 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 caching; the file descriptor will remain open
until bfd_close, and will not be affected by BFD operations
on other files.
Possible errors are bfd_error_no_memory,
bfd_error_invalid_target and bfd_error_system_call.
bfd_openstreamr
Synopsis
bfd *bfd_openstreamr (const char *, const char *, void *);
Descriptionbfd_close, the stream will be closed.
bfd_openw
Synopsis
bfd *bfd_openw (const char *filename, const char *target);
DescriptionPossible errors are bfd_error_system_call, bfd_error_no_memory,
bfd_error_invalid_target.
bfd_close
Synopsis
bfd_boolean bfd_close (bfd *abfd);
Descriptionchmod is called
to mark it as such.
All memory attached to the BFD is released.
The file descriptor associated with the BFD is closed (even
if it was passed in to BFD by bfd_fdopenr).
Returns
TRUE is returned if all is ok, otherwise FALSE.
bfd_close_all_done
Synopsis
bfd_boolean bfd_close_all_done (bfd *);
Descriptionbfd_close 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 chmod is called
to mark it as such.
All memory attached to the BFD is released.
Returns
TRUE is returned if all is ok, otherwise FALSE.
bfd_create
Synopsis
bfd *bfd_create (const char *filename, bfd *templ);
Descriptionbfd_openw, but without
opening a file. The new BFD takes the target from the target
used by template. The format is always set to bfd_object.
bfd_make_writable
Synopsis
bfd_boolean bfd_make_writable (bfd *abfd);
Descriptionbfd_create and converts it
into one like as returned by bfd_openw. It does this
by converting the BFD to BFD_IN_MEMORY. It's assumed that
you will call bfd_make_readable on this bfd later.
Returns
TRUE is returned if all is ok, otherwise FALSE.
bfd_make_readable
Synopsis
bfd_boolean bfd_make_readable (bfd *abfd);
Descriptionbfd_create and
bfd_make_writable and converts it into one like as
returned by bfd_openr. It does this by writing the
contents out to the memory buffer, then reversing the
direction.
Returns
TRUE is returned if all is ok, otherwise FALSE.
bfd_alloc
Synopsis
void *bfd_alloc (bfd *abfd, size_t wanted);
Descriptionabfd and return a pointer to it.
bfd_calc_gnu_debuglink_crc32
Synopsis
unsigned long bfd_calc_gnu_debuglink_crc32
(unsigned long crc, const unsigned char *buf, bfd_size_type len);
DescriptionReturns
Return the updated CRC32 value.
get_debug_link_info
Synopsis
char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
Descriptionseparate_debug_file_exists
Synopsis
bfd_boolean separate_debug_file_exists
(char *name, unsigned long crc32);
Descriptionfind_separate_debug_file
Synopsis
char *find_separate_debug_file (bfd *abfd);
Descriptionbfd_follow_gnu_debuglink
Synopsis
char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
DescriptionIf dir is NULL, it will search a default path configured into libbfd at build time. [XXX this feature is not currently implemented].
Returns
NULL on any errors or failure to locate the .debug file,
otherwise a pointer to a heap-allocated string containing the
filename. The caller is responsible for freeing this string.
bfd_create_gnu_debuglink_section
Synopsis
struct bfd_section *bfd_create_gnu_debuglink_section
(bfd *abfd, const char *filename);
DescriptionReturns
A pointer to the new section is returned if all is ok. Otherwise NULL is
returned and bfd_error is set.
bfd_fill_in_gnu_debuglink_section
Synopsis
bfd_boolean bfd_fill_in_gnu_debuglink_section
(bfd *abfd, struct bfd_section *sect, const char *filename);
DescriptionReturns
TRUE is returned if all is ok. Otherwise FALSE is returned
and bfd_error is set.