diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 2 | ||||
-rw-r--r-- | bfd/opncls.c | 20 |
3 files changed, 27 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f498a91..ea0f060 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2019-09-11 Tom Tromey <tom@tromey.com> + + * opncls.c (bfd_set_filename): New function. + * bfd-in2.h: Regenerate. + 2019-09-11 Alan Modra <amodra@gmail.com> * targets.c (struct bfd_target): Add _bfd_group_name. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index dc9b5da..13445a1 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1193,6 +1193,8 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ diff --git a/bfd/opncls.c b/bfd/opncls.c index 07f89b9..d14dfe9 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -2089,3 +2089,23 @@ bfd_follow_build_id_debuglink (bfd *abfd, const char *dir) get_build_id_name, check_build_id_file, &build_id); } + +/* +FUNCTION + bfd_set_filename + +SYNOPSIS + void bfd_set_filename (bfd *abfd, char *filename); + +DESCRIPTION + Set the filename of @var{abfd}. The old filename, if any, is freed. + @var{filename} must be allocated using @code{xmalloc}. After + this call, it is owned @var{abfd}. +*/ + +void +bfd_set_filename (bfd *abfd, char *filename) +{ + free ((char *) abfd->filename); + abfd->filename = filename; +} |