summaryrefslogtreecommitdiff
path: root/bfd/bfd.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-07-18 19:20:13 +0000
committerNick Clifton <nickc@redhat.com>2000-07-18 19:20:13 +0000
commit3c13089472d047f8b005a224f5b2bcd668d3fd3a (patch)
tree8a68e01eab8aa63446aa5732308eae9360ef25cf /bfd/bfd.c
parent46490a12561aaa236c44122284ecb8f7e64b1cda (diff)
downloadgdb-3c13089472d047f8b005a224f5b2bcd668d3fd3a.tar.gz
Rename bfd_elf_get_arch_size to bfd_get_arch_size
Rename bfd_elf_get_sign_extend_vma to bfd_get_sign_extend_vma
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r--bfd/bfd.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/bfd/bfd.c b/bfd/bfd.c
index e04172fb016..f7f8c2ab205 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -706,6 +706,65 @@ _bfd_abort (file, line, fn)
/*
FUNCTION
+ bfd_get_arch_size
+
+SYNOPSIS
+ int bfd_get_arch_size (bfd *abfd);
+
+DESCRIPTION
+ Returns the architecture address size, in bits, as determined
+ by the object file's format. For ELF, this information is
+ included in the header.
+
+RETURNS
+ Returns the arch size in bits if known, <<-1>> otherwise.
+*/
+
+int
+bfd_get_arch_size (abfd)
+ bfd *abfd;
+{
+ if (abfd->xvec->flavour == bfd_target_elf_flavour)
+ return (get_elf_backend_data (abfd))->s->arch_size;
+
+ bfd_set_error (bfd_error_wrong_format);
+ return -1;
+}
+
+/*
+FUNCTION
+ bfd_get_sign_extend_vma
+
+SYNOPSIS
+ int bfd_get_sign_extend_vma (bfd *abfd);
+
+DESCRIPTION
+ Indicates if the target architecture "naturally" sign extends
+ an address. Some architectures implicitly sign extend address
+ values when they are converted to types larger than the size
+ of an address. For instance, bfd_get_start_address() will
+ return an address sign extended to fill a bfd_vma when this is
+ the case.
+
+RETURNS
+ Returns <<1>> if the target architecture is known to sign
+ extend addresses, <<0>> if the target architecture is known to
+ not sign extend addresses, and <<-1>> otherwise.
+*/
+
+int
+bfd_get_sign_extend_vma (abfd)
+ bfd *abfd;
+{
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+ return (get_elf_backend_data (abfd)->sign_extend_vma);
+
+ bfd_set_error (bfd_error_wrong_format);
+ return -1;
+}
+
+/*
+FUNCTION
bfd_set_start_address
SYNOPSIS