summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2004-12-27 10:37:56 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2004-12-27 10:37:56 +0000
commite8a3113f375447d9d92edd89fe06c2d7c5a480eb (patch)
treee4da5d03d6c9c62c4dd48a1b0fbc38aaad6dd2a2 /gnu
parent7b94bf8258a545f258e7365c51e84a677c90c487 (diff)
Some post bintuils-2.15 changes for gdb-6.3.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/binutils/bfd/bfd-in.h5
-rw-r--r--gnu/usr.bin/binutils/bfd/bfd-in2.h5
-rw-r--r--gnu/usr.bin/binutils/bfd/cache.c27
3 files changed, 35 insertions, 2 deletions
diff --git a/gnu/usr.bin/binutils/bfd/bfd-in.h b/gnu/usr.bin/binutils/bfd/bfd-in.h
index 1a5d1ea0dd6..500fa15a587 100644
--- a/gnu/usr.bin/binutils/bfd/bfd-in.h
+++ b/gnu/usr.bin/binutils/bfd/bfd-in.h
@@ -308,7 +308,8 @@ typedef struct bfd_section *sec_ptr;
#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
#define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
+#define bfd_section_size(bfd, ptr) ((ptr)->_raw_size)
+#define bfd_get_section_size(ptr) ((ptr)->_raw_size)
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
@@ -505,6 +506,8 @@ extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
+extern bfd_boolean bfd_cache_close_all (void);
+
extern bfd_boolean bfd_record_phdr
(bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
diff --git a/gnu/usr.bin/binutils/bfd/bfd-in2.h b/gnu/usr.bin/binutils/bfd/bfd-in2.h
index 2464d27e399..40d2fd46e2a 100644
--- a/gnu/usr.bin/binutils/bfd/bfd-in2.h
+++ b/gnu/usr.bin/binutils/bfd/bfd-in2.h
@@ -315,7 +315,8 @@ typedef struct bfd_section *sec_ptr;
#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
#define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
+#define bfd_section_size(bfd, ptr) ((ptr)->_raw_size)
+#define bfd_get_section_size(ptr) ((ptr)->_raw_size)
#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
@@ -512,6 +513,8 @@ extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
+extern bfd_boolean bfd_cache_close_all (void);
+
extern bfd_boolean bfd_record_phdr
(bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
diff --git a/gnu/usr.bin/binutils/bfd/cache.c b/gnu/usr.bin/binutils/bfd/cache.c
index 7d056ea0cfa..e0303e0cdee 100644
--- a/gnu/usr.bin/binutils/bfd/cache.c
+++ b/gnu/usr.bin/binutils/bfd/cache.c
@@ -237,6 +237,33 @@ bfd_cache_close (bfd *abfd)
}
/*
+FUNCTION
+ bfd_cache_close_all
+
+SYNOPSIS
+ bfd_boolean bfd_cache_close_all (void);
+
+DESCRIPTION
+ Remove all BFDs from the cache. If the attached file is open,
+ then close it too.
+
+RETURNS
+ <<FALSE>> is returned if closing one of the file fails, <<TRUE>> is
+ returned if all is well.
+*/
+
+bfd_boolean
+bfd_cache_close_all ()
+{
+ bfd_boolean ret = TRUE;
+
+ while (bfd_last_cache != NULL)
+ ret &= bfd_cache_close (bfd_last_cache);
+
+ return ret;
+}
+
+/*
INTERNAL_FUNCTION
bfd_open_file