aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-07-11 07:28:25 +0000
committerAndrew Cagney <cagney@redhat.com>2000-07-11 07:28:25 +0000
commit6d9019e4c003d8676c973ce8f6d65807f5ce8120 (patch)
treed08de243f7ba28d4b43285a54c8d07c2173becde /bfd/elf.c
parent23e2c83b83cf07b348412eddafa930d7dc7666e9 (diff)
downloadgdb-6d9019e4c003d8676c973ce8f6d65807f5ce8120.zip
gdb-6d9019e4c003d8676c973ce8f6d65807f5ce8120.tar.gz
gdb-6d9019e4c003d8676c973ce8f6d65807f5ce8120.tar.bz2
Add function bfd_elf_get_sign_extend_vma.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index f88ebbd..d334cb9 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1777,6 +1777,20 @@ bfd_elf_get_arch_size (abfd)
return (get_elf_backend_data (abfd))->s->arch_size;
}
+/* True if addresses "naturally" sign extend. Return 0/1 if known.
+ -1 if unknown. */
+int
+bfd_elf_get_sign_extend_vma (abfd)
+ bfd *abfd;
+{
+ if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return -1;
+ }
+ return (get_elf_backend_data (abfd)->sign_extend_vma);
+}
+
/* Assign all ELF section numbers. The dummy first section is handled here
too. The link/info pointers for the standard section types are filled
in here too, while we're at it. */