+static enum gmon_ptr_size
+gmon_get_ptr_size (void)
+{
+ int size;
+
+ /* Pick best size for pointers. Start with the ELF size, and if not
+ elf go with the architecture's address size. */
+ size = bfd_get_arch_size (core_bfd);
+ if (size == -1)
+ size = bfd_arch_bits_per_address (core_bfd);
+
+ switch (size)
+ {
+ case 32:
+ return ptr_32bit;
+
+ case 64:
+ return ptr_64bit;
+
+ default:
+ fprintf (stderr, _("%s: address size has unexpected value of %u\n"),
+ whoami, size);
+ done (1);
+ }
+}
+
+static enum gmon_ptr_signedness
+gmon_get_ptr_signedness (void)
+{
+ int sext;
+
+ /* Figure out whether to sign extend. If BFD doesn't know, assume no. */
+ sext = bfd_get_sign_extend_vma (core_bfd);
+ if (sext == -1)
+ return ptr_unsigned;
+ return (sext ? ptr_signed : ptr_unsigned);
+}
+