[binutils-gdb] Add a new function to the BFD library to allow users access to the COFF internal_extra_pe_outhdr str
Nick Clifton
nickc@sourceware.org
Wed Mar 25 11:59:46 GMT 2020
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aac88046e6cccf13fc408fc4e515aaf2548fe898
commit aac88046e6cccf13fc408fc4e515aaf2548fe898
Author: Nick Clifton <nickc@redhat.com>
Date: Wed Mar 25 11:58:49 2020 +0000
Add a new function to the BFD library to allow users access to the COFF internal_extra_pe_outhdr structure.
* cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
function.
* libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
* libbfd.h: Regenerate.
Diff:
---
bfd/ChangeLog | 7 +++++++
bfd/cofflink.c | 9 +++++++++
bfd/libbfd-in.h | 5 +++++
bfd/libbfd.h | 5 +++++
4 files changed, 26 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7f04a97daac..cac27e37ec9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2020-03-25 Nick Clifton <nickc@redhat.com>
+
+ * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
+ function.
+ * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
+ * libbfd.h: Regenerate.
+
2020-03-25 Shahab Vahedi <shahab@synopsys.com>
* elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index e52f543ee6e..845d1e58467 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -3157,3 +3157,12 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
}
return TRUE;
}
+
+
+struct internal_extra_pe_aouthdr *
+bfd_coff_get_internal_extra_pe_aouthdr (bfd* abfd)
+{
+ if (abfd == NULL || bfd_get_flavour (abfd) != bfd_target_coff_flavour)
+ return NULL;
+ return & pe_data (abfd)->pe_opthdr;
+}
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 5d24efbeb26..2f1f88644ed 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -854,6 +854,11 @@ extern bfd_vma _bfd_get_gp_value
extern void _bfd_set_gp_value
(bfd *, bfd_vma) ATTRIBUTE_HIDDEN;
+/* Provide access to the internal_extra_pe_aouthdr structure which
+ contains interesting information for PE format binaries. */
+extern struct internal_extra_pe_aouthdr *
+ bfd_coff_get_internal_extra_pe_aouthdr (bfd *);
+
/* Function shared by the COFF and ELF SH backends, which have no
other common header files. */
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 348ccfd4b57..fc8b81c45f0 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -859,6 +859,11 @@ extern bfd_vma _bfd_get_gp_value
extern void _bfd_set_gp_value
(bfd *, bfd_vma) ATTRIBUTE_HIDDEN;
+/* Provide access to the internal_extra_pe_aouthdr structure which
+ contains interesting information for PE format binaries. */
+extern struct internal_extra_pe_aouthdr *
+ bfd_coff_get_internal_extra_pe_aouthdr (bfd *);
+
/* Function shared by the COFF and ELF SH backends, which have no
other common header files. */
More information about the Binutils-cvs
mailing list